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">
27
        <div id="hud">
28
          <span class="pull-right">Howdy! | <a href="/logout">Logout</a></span>
29
        </div>
30
        <div id="notifications"></div>
31
      </div>
32
      <div id="content-container">
33
      </div>
34
      <div id="footer">
35
      </div>
36
    </div>
37
38
    <script>
39
      // initialize editor
40
      window.M = window.M || {};
41
      M.site_content = {{ content|tojson|safe }};
42
      window.onload = function() {
43
        M.editor.init();
44
      };
45
    </script>
46
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
47
    <script>window.jQuery || document.write('<script src="/static/js/lib/jquery-1.8.0.min.js"><\/script>')</script>
48
    <script src="/static/js/lib/underscore.js"></script>
49
    <script src="/static/js/lib/backbone-1.0.0.js"></script>
50
    <script src="/static/js/lib/bootstrap.js"></script>
51
    <script src="/static/js/lib/tinymce/tinymce.min.js"></script>
52
    <script src="/static/js/lib/tinymce/jquery.tinymce.min.js"></script>
53
    <script src="/static/js/plugins.js"></script>
54
    <script src="/static/js/mouchak.js"></script>
55
    <script src="/static/js/models.js"></script>
56
    <script src="/static/js/editor.js"></script>
57
58
    <!-- Underscore templates -->
59
    <script type="text/template" id="menu-config-template">
60
      <div class="page">
61
        <div class="menu-config">
62
          <h4> Menu Config </h4>
63
64
          <div class="control-group" id="menu-order-wrap">
65
            <div class="input-prepend">
66
              <span class="add-on"> <strong> Menu Order</strong></span>
67
              <input id="menu-order" type="text" class="span4"
68
              placeholder="list,page,names,for,menu,order" value="<%= menu_order %>">
69
            </div>
70
          </div>
71
72
          <div class="control-group">
73
            <input id="custom-menu" type="checkbox">
74
            <span class=""><strong> Custom Menu </strong></span>
75
          </div>
76
77
          <div class="menu-options" style="display: none;">
78
            <div class="control-group">
79
              <div class="input-prepend">
80
                <span class="add-on"> <strong> Position </strong></span>
81
                <input id="pos" type="text" placeholder="[left, top]"
82
                value="<%= pos %>">
83
              </div>
84
            </div>
85
            <label><strong> HTML for menu: </strong></label>
86
            <textarea cols="25" rows="8" id="menu"><%= menu %></textarea>
87
          </div>
88
89
        </div>
90
        <button id="updateMenu" class="btn btn-primary pull-right"> Update </button>
91
        <div class="clearfix"></div>
92
      </div>
93
    </script>
94
95
    <script type="text/template" id="page-list-template">
96
      <div id="pagelistview">
97
        <h4> List of Pages </h4>
98
        <div id="pagelist"></div>
99
        <button class="btn btn-primary" id="addPage">Add Page</button>
100
        <hr>
101
        <p> <a href="javascript:void(0);" id="menu-config"> Site Menu </a> </p>
102
        <p><a href="/"> Go to site </a></p>
103
      </div>
104
    </script>
105
106
    <script type="text/template" id="page-list-item-template">
107
      <div class="pagename">
108
        <a class="disp" id="<%= id %>" href="javascript:void(0);"><%= name %></a>
109
        <span class="pull-right">
110
          <a href="javascript:void(0);" class="remove" for="<%= id %>">
111
            <i class="icon-trash"></i>
112
          </a>
113
        </span>
114
        <span class="clearfix"></span>
115
      </div>
116
    </script>
117
118
    <script type="text/template" id="page-template">
119
      <div class="page">
120
        <h4> Page Properties </h4>
121
        <form class="form-horizontal">
122
          <div class="control-group">
123
            <div class="input-prepend">
124
              <span class="add-on"> <strong> Name </strong></span>
125
              <input id="name" type="text" placeholder="name of the page" value="<%= name %>">
126
            </div>
127
          </div>
128
          <div class="control-group">
129
            <div class="input-prepend">
130
              <span class="add-on"> <strong>Title</strong> </span>
131
              <input id="title" type="text" placeholder="title of the page"
132
               value="<%= title %>">
133
            </div>
134
          </div>
135
          <div class="control-group">
136
            <div class="input-prepend">
137
              <span class="add-on"> <strong>Children</strong> </span>
138
              <input id="children" type="text" placeholder="csv of child pages"
139
              value="<%= children %>">
140
            </div>
141
          </div>
142
          <div class="control-group">
143
            <div class="input-prepend">
144
              <span class="add-on"><strong> Show Navigation </strong></span>
145
              <input id="showNav" type="checkbox" <%=checked%>>
146
            </div>
147
          </div>
148
          <label><strong> Content </strong></label>
149
          <div id="content" class="content well">
150
            <%= content %>
151
            <p></p>
152
            <button class="addContent btn btn-mini btn-primary">Add Content</button>
153
          </div>
154
          <button id="updatePage" type="submit" class="btn btn-primary pull-right"> Update </button>
155
          <div class="clearfix"></div>
156
        </form>
157
      </div>
158
    </script>
159
160
    <script type="text/template" id="content-list-template">
161
      <div class="content-item-wrapper">
162
        <span class="content-item" id="content-<%= no %>">
163
          <span class="label label-info"> <%= type %> </span>
164
          <span class="">
165
            [ <small> <%= title %>  <%= more %> </small> ]
166
          </span>
167
        </span>
168
        <span class="pull-right">
169
          <a href="javascript:void(0);" class="remove" for="<%=no%>"><i class="icon-trash"></i></a>
170
        </span>
171
        <span class="clearfix"></span>
172
      </div>
173
    </script>
174
175
    <script type="text/template" id="content-template">
176
      <div class="contentview">
177
        <div class="">
178
          <label><b>Type</b></label>
179
          <select>
180
            <% _.each(M.contentTypes, function(type) { %>
181
              <option><%= type %></option>
182
            <%  }); %>
183
          </select>
184
          <div class="control-group">
185
            <div class="input-prepend">
186
              <span class="add-on"> <b>Title</b> </span>
187
              <input type="text" placeholder="title of the content" value="<%=
188
              title %>" m-data-target="title">
189
            </div>
190
          </div>
191
          <div class="control-group">
192
            <div class="input-prepend">
193
              <span class="add-on"> <strong>Tags</strong> </span>
194
              <input type="text" placeholder="csv of tags for this content"
195
              value="<%= tags %>" m-data-target="tags">
196
            </div>
197
          </div>
198
        </div>
199
        <div id="specific-content"></div>
200
        <button class="btn btn-info" id="done">Done</button>
201
        <button class="btn btn-primary" id="updateContent">Update</button>
202
      </div>
203
    </script>
204
205
    <script type="text/template" id="media-template">
206
      <div class="data">
207
        <div class="control-group">
208
          <div class="input-prepend">
209
            <span class="add-on"><strong>path to file</strong></span>
210
            <input type="text" placeholder="src" value="<%= src %>"
211
            m-data-target="src">
212
          </div>
213
        </div>
214
        <div class="preview"></div>
215
      </div>
216
    </script>
217
218
    <script type="text/template" id="text-template">
219
      <div class="data">
220
        <label><b> Content </b></label>
221
        <p>
222
        <span class="label label-important">Tip</span>
223
        <span><small> You can unleash your HTML power here </small></span>
224
        </p>
225
        <textarea id="edit" m-data-target="data">
226
          <%= data %>
227
        </textarea>
228
      </div>
229
    </script>
230
231
    <!-- notification templates -->
232
    <script type="text/template" id="success-notif">
233
      <div class="alert alert-success">
234
        <button type="button" class="close" data-dismiss="alert">&times;</button>
235
        <h4> <%= title %> </h4>
236
        <%= msg %>
237
      </div>
238
    </script>
239
240
    <script type="text/template" id="fail-notif">
241
      <div class="alert alert-error">
242
        <button type="button" class="close" data-dismiss="alert">&times;</button>
243
        <h4> <%= title %> </h4>
244
        <%= msg %>
245
      </div>
246
    </script>
247
248
  </body>
249
</html>