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
          <div class="control-group">
58
            <input id="custom-menu" type="checkbox">
59
            <span class=""><strong> Custom Menu </strong></span>
60
          </div>
61
          <div class="control-group" id="menu-order-wrap">
62
            <% if(!$('#custom-menu').is(':checked')) { %>
63
              <div class="input-prepend">
64
                <span class="add-on"> <strong> Menu Order</strong></span>
65
                <input id="menu-order" type="text"
66
                placeholder="list,page,names,for,menu,order" value="<%= menu_order %>">
67
              </div>
68
              <% } %>
69
          </div>
70
          <div class="menu-options" style="display: none;">
71
            <div class="control-group">
72
              <div class="input-prepend">
73
                <span class="add-on"> <strong> Position </strong></span>
74
                <input id="pos" type="text" placeholder="[left, top]"
75
                value="<%= pos %>">
76
              </div>
77
            </div>
78
            <label><strong> HTML for menu: </strong></label>
79
            <textarea cols="25" rows="8" id="menu"><%= menu %></textarea>
80
          </div>
81
        </div>
82
        <button id="updateMenu" class="btn btn-primary pull-right"> Update </button>
83
        <div class="clearfix"></div>
84
      </div>
85
    </script>
86
87
    <script type="text/template" id="page-list-template">
88
      <div id="pagelistview">
89
        <h4> List of Pages </h4>
90
        <div id="pagelist"></div>
91
        <button class="btn btn-primary" id="addPage">Add Page</button>
92
        <hr>
93
        <p> <a href="javascript:void(0);" id="menu-config"> Site Menu </a> </p>
94
        <p><a href="/"> Go to site </a></p>
95
      </div>
96
    </script>
97
98
    <script type="text/template" id="page-list-item-template">
99
      <div class="pagename">
100
        <a class="disp" id="<%= id %>" href="javascript:void(0);"><%= name %></a>
101
        <span class="pull-right">
102
          <a href="javascript:void(0);" class="remove" for="<%= id %>">
103
            <i class="icon-trash"></i>
104
          </a>
105
        </span>
106
        <span class="clearfix"></span>
107
      </div>
108
    </script>
109
110
    <script type="text/template" id="page-template">
111
      <div class="page">
112
        <h4> Page Properties </h4>
113
        <form class="form-horizontal">
114
          <div class="control-group">
115
            <div class="input-prepend">
116
              <span class="add-on"> <strong> Name </strong></span>
117
              <input id="name" type="text" placeholder="name of the page" value="<%= name %>">
118
            </div>
119
          </div>
120
          <div class="control-group">
121
            <div class="input-prepend">
122
              <span class="add-on"> <strong>Title</strong> </span>
123
              <input id="title" type="text" placeholder="title of the page"
124
               value="<%= title %>">
125
            </div>
126
          </div>
127
          <div class="control-group">
128
            <div class="input-prepend">
129
              <span class="add-on"> <strong>Children</strong> </span>
130
              <input id="children" type="text" placeholder="csv of child pages"
131
              value="<%= children %>">
132
            </div>
133
          </div>
134
          <div class="control-group">
135
            <div class="input-prepend">
136
              <span class="add-on"><strong> Show Navigation </strong></span>
137
              <input id="showNav" type="checkbox" <%=checked%>>
138
            </div>
139
          </div>
140
          <label><strong> Content </strong></label>
141
          <div id="content" class="content well">
142
            <%= content %>
143
            <p></p>
144
            <button class="addContent btn btn-mini btn-primary">Add Content</button>
145
          </div>
146
          <button id="updatePage" type="submit" class="btn btn-primary pull-right"> Update </button>
147
          <div class="clearfix"></div>
148
        </form>
149
      </div>
150
    </script>
151
152
    <script type="text/template" id="content-list-template">
153
      <div class="content-item-wrapper">
154
        <span class="content-item" id="content-<%= no %>">
155
          <span class="label label-info"> <%= type %> </span>
156
          <span class="">
157
            [ <small> <%= title %>  <%= more %> </small> ]
158
          </span>
159
        </span>
160
        <span class="pull-right">
161
          <a href="javascript:void(0);" class="remove" for="<%=no%>"><i class="icon-trash"></i></a>
162
        </span>
163
        <span class="clearfix"></span>
164
      </div>
165
    </script>
166
167
    <script type="text/template" id="content-template">
168
      <div class="contentview">
169
        <div class="">
170
          <label><b>Type</b></label>
171
          <select>
172
            <% _.each(M.contentTypes, function(type) { %>
173
              <option><%= type %></option>
174
            <%  }); %>
175
          </select>
176
          <div class="control-group">
177
            <div class="input-prepend">
178
              <span class="add-on"> <b>Title</b> </span>
179
              <input type="text" placeholder="title of the content" value="<%=
180
              title %>" m-data-target="title">
181
            </div>
182
          </div>
183
          <div class="control-group">
184
            <div class="input-prepend">
185
              <span class="add-on"> <strong>Tags</strong> </span>
186
              <input type="text" placeholder="csv of tags for this content"
187
              value="<%= tags %>" m-data-target="tags">
188
            </div>
189
          </div>
190
        </div>
191
        <div id="specific-content"></div>
192
        <button class="btn btn-info" id="done">Done</button>
193
        <button class="btn btn-primary" id="updateContent">Update</button>
194
      </div>
195
    </script>
196
197
    <script type="text/template" id="media-template">
198
      <div class="data">
199
        <div class="control-group">
200
          <div class="input-prepend">
201
            <span class="add-on"><strong>path to file</strong></span>
202
            <input type="text" placeholder="src" value="<%= src %>"
203
            m-data-target="src">
204
          </div>
205
        </div>
206
        <div class="preview"></div>
207
      </div>
208
    </script>
209
210
    <script type="text/template" id="text-template">
211
      <div class="data">
212
        <label><b> Content </b></label>
213
        <p>
214
        <span class="label label-important">Tip</span>
215
        <span><small> You can unleash your HTML power here </small></span>
216
        </p>
217
        <textarea id="edit" m-data-target="data">
218
          <%= data %>
219
        </textarea>
220
      </div>
221
    </script>
222
  </body>
223
</html>