1
<!DOCTYPE html>
2
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
3
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
4
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
5
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
6
  <head>
7
    <meta charset="utf-8">
8
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
9
    <title> Editing.. | {{title}} </title>
10
    <meta name="description" content="">
11
    <meta name="viewport" content="width=device-width">
12
13
    <!-- Place favicon.ico in the root directory -->
14
15
    <link rel="stylesheet" href="/static/css/normalize.css">
16
    <link rel="stylesheet" href="/static/css/bootstrap.css">
17
    <link rel="stylesheet" href="/static/css/editor.css">
18
    <script src="/static/js/lib/modernizr-2.6.1.min.js"></script>
19
  </head>
20
  <body>
21
    <!--[if lt IE 7]>
22
    <p class="chromeframe">You are using an outdated browser. <a href="http://browsehappy.com/">Upgrade your browser today</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to better experience this site.</p>
23
    <![endif]-->
24
25
    <div class="container" id="container">
26
      <div id="header"> </div>
27
      <div id="content-container"></div>
28
      <div id="footer">
29
      </div>
30
    </div>
31
32
    <script>
33
      // initialize editor
34
      window.M = window.M || {};
35
      M.site_content = {{ content|tojson|safe }};
36
      window.onload = function() {
37
        M.editor.init();
38
      };
39
    </script>
40
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
41
    <script>window.jQuery || document.write('<script src="/static/js/lib/jquery-1.8.0.min.js"><\/script>')</script>
42
    <script src="/static/js/lib/underscore.js"></script>
43
    <script src="/static/js/lib/backbone-1.0.0.js"></script>
44
    <script src="/static/js/lib/bootstrap.js"></script>
45
    <script src="/static/js/lib/tinymce/tinymce.min.js"></script>
46
    <script src="/static/js/lib/tinymce/jquery.tinymce.min.js"></script>
47
    <script src="/static/js/plugins.js"></script>
48
    <script src="/static/js/mouchak.js"></script>
49
    <script src="/static/js/models.js"></script>
50
    <script src="/static/js/editor.js"></script>
51
52
    <!-- Underscore templates -->
53
    <script type="text/template" id="menu-config-template">
54
      <div class="page">
55
        <div class="menu-config">
56
          <h4> Menu Config </h4>
57
          <!-- <form class="form-horizontal"> -->
58
            <div class="control-group">
59
              <input id="custom-menu" type="checkbox">
60
              <span class=""><strong> Custom Menu </strong></span>
61
            </div>
62
            <button id="updateMenu" class="btn btn-primary pull-right"> Update </button>
63
            <div class="clearfix"></div>
64
            <div class="menu-options" style="display: none;">
65
              <div class="control-group">
66
                <div class="input-prepend">
67
                  <span class="add-on"> <strong> Position </strong></span>
68
                  <input id="pos" type="text" placeholder="[left, top]"
69
                  value="<%= pos %>">
70
                </div>
71
              </div>
72
              <label><strong> HTML </strong></label>
73
              <div id="menu">
74
                <%= menu %>
75
              </div>
76
            </div>
77
          <!-- </form> -->
78
        </div>
79
      </div>
80
    </script>
81
82
    <script type="text/template" id="page-list-template">
83
      <div id="pagelistview">
84
        <h4> List of Pages </h4>
85
        <div id="pagelist"></div>
86
        <button class="btn btn-primary" id="addPage">Add Page</button>
87
        <hr>
88
        <p> <a href="javascript:void(0);" id="menu-config"> Site Menu </a> </p>
89
        <p><a href="/"> Go to site </a></p>
90
      </div>
91
    </script>
92
93
    <script type="text/template" id="page-list-item-template">
94
      <div class="pagename">
95
        <a class="disp" id="<%= id %>" href="javascript:void(0);"><%= name %></a>
96
        <span class="pull-right">
97
          <a href="javascript:void(0);" class="remove" for="<%= id %>">
98
            <i class="icon-trash"></i>
99
          </a>
100
        </span>
101
        <span class="clearfix"></span>
102
      </div>
103
    </script>
104
105
    <script type="text/template" id="page-template">
106
      <div class="page">
107
        <h4> Page Properties </h4>
108
        <form class="form-horizontal">
109
          <div class="control-group">
110
            <div class="input-prepend">
111
              <span class="add-on"> <strong> Name </strong></span>
112
              <input id="name" type="text" placeholder="name of the page" value="<%= name %>">
113
            </div>
114
          </div>
115
          <div class="control-group">
116
            <div class="input-prepend">
117
              <span class="add-on"> <strong>Title</strong> </span>
118
              <input id="title" type="text" placeholder="title of the page"
119
               value="<%= title %>">
120
            </div>
121
          </div>
122
          <div class="control-group">
123
            <div class="input-prepend">
124
              <span class="add-on"> <strong>Children</strong> </span>
125
              <input id="children" type="text" placeholder="csv of child pages"
126
              value="<%= children %>">
127
            </div>
128
          </div>
129
          <div class="control-group">
130
            <div class="input-prepend">
131
              <span class="add-on"><strong> Show Navigation </strong></span>
132
              <input id="showNav" type="checkbox" <%=checked%>>
133
            </div>
134
          </div>
135
          <label><strong> Content </strong></label>
136
          <div id="content" class="content well">
137
            <%= content %>
138
            <p></p>
139
            <button class="addContent btn btn-mini btn-primary">Add Content</button>
140
          </div>
141
          <button id="updatePage" type="submit" class="btn btn-primary pull-right"> Update </button>
142
          <div class="clearfix"></div>
143
        </form>
144
      </div>
145
    </script>
146
147
    <script type="text/template" id="content-list-template">
148
      <div class="content-item-wrapper">
149
        <span class="content-item" id="content-<%= no %>">
150
          <span class="label label-info"> <%= type %> </span>
151
          <span class="">
152
            [ <small> <%= title %>  <%= more %> </small> ]
153
          </span>
154
        </span>
155
        <span class="pull-right">
156
          <a href="javascript:void(0);" class="remove" for="<%=no%>"><i class="icon-trash"></i></a>
157
        </span>
158
        <span class="clearfix"></span>
159
      </div>
160
    </script>
161
162
    <script type="text/template" id="content-template">
163
      <div class="contentview">
164
        <div class="">
165
          <label><b>Type</b></label>
166
          <select>
167
            <% _.each(_.keys(M.types.model), function(type) { %>
168
              <option><%= type %></option>
169
            <%  }); %>
170
          </select>
171
          <div class="control-group">
172
            <div class="input-prepend">
173
              <span class="add-on"> <b>Title</b> </span>
174
              <input type="text" placeholder="title of the content" value="<%=
175
              title %>" m-data-target="title">
176
            </div>
177
          </div>
178
          <div class="control-group">
179
            <div class="input-prepend">
180
              <span class="add-on"> <strong>Tags</strong> </span>
181
              <input type="text" placeholder="csv of tags for this content"
182
              value="<%= tags %>" m-data-target="tags">
183
            </div>
184
          </div>
185
        </div>
186
        <div id="specific-content"></div>
187
        <button class="btn btn-info" id="done">Done</button>
188
        <button class="btn btn-primary" id="updateContent">Update</button>
189
      </div>
190
    </script>
191
192
    <script type="text/template" id="media-template">
193
      <div class="data">
194
        <div class="control-group">
195
          <div class="input-prepend">
196
            <span class="add-on"><strong>path to file</strong></span>
197
            <input type="text" placeholder="src" value="<%= src %>"
198
            m-data-target="src">
199
          </div>
200
        </div>
201
        <div class="preview"></div>
202
      </div>
203
    </script>
204
205
    <script type="text/template" id="text-template">
206
      <div class="data">
207
        <label><b> Content </b></label>
208
        <p>
209
        <span class="label label-important">Tip</span>
210
        <span><small> You can unleash your HTML power here </small></span>
211
        </p>
212
        <textarea id="edit" m-data-target="data">
213
          <%= data %>
214
        </textarea>
215
      </div>
216
    </script>
217
  </body>
218
</html>