2b4c217 by Anon Ray at 2013-10-03 1
{% extends "base.html" %}
2
3
{% block head %}
4
  <link rel="stylesheet" href="{{url_for('static', filename='css/editor.css')}}">
5
  <title> Editing.. | {{ title }} </title>
6
{% endblock %}
7
8
{% block body %}
9
  <div class="container" id="container">
10
    <div id="header">
11
      <div id="hud">
12
        <span class="pull-right">Howdy! | <a href="{{ url_for('logout') }}">Logout</a></span>
4a1fae7 by Anon Ray at 2013-05-09 13
      </div>
2b4c217 by Anon Ray at 2013-10-03 14
      <div id="notifications"></div>
4a1fae7 by Anon Ray at 2013-05-09 15
    </div>
2b4c217 by Anon Ray at 2013-10-03 16
    <div id="content-container">
17
    </div>
18
    <div id="footer">
19
    </div>
20
  </div>
21
22
  <script>
23
    // initialize editor
24
    window.M = window.M || {};
25
    M.MenuURL = function() { return "{{ url_for('insertMenu') }}"};
26
    M.PageURL = function() { return "{{ url_for('insertPage') }}"};
27
    M.site_content = {{ content|tojson|safe }};
28
    window.onload = function() {
29
      M.editor.init();
30
    };
31
  </script>
32
{% endblock %}
33
34
{% block scripts %}
35
  <script src="{{url_for('static', filename='js/lib/tinymce/tinymce.min.js')}}"></script>
36
  <script src="{{url_for('static', filename='js/lib/tinymce/jquery.tinymce.min.js')}}"></script>
37
  <script src="{{url_for('static', filename='js/mouchak.js')}}"></script>
38
  <script src="{{url_for('static', filename='js/models.js')}}"></script>
39
  <script src="{{url_for('static', filename='js/views.js')}}"></script>
40
  <script src="{{url_for('static', filename='js/editor.js')}}"></script>
41
{% endblock %}
42
43
{% block templates %}
44
45
  <!-- Underscore templates -->
46
  <script type="text/template" id="menu-config-template">
47
    <div class="page">
48
      <div class="menu-config">
49
        <h4> Menu Config </h4>
50
51
        <div class="form-group" id="menu-order-wrap">
52
          <div class="input-group">
53
            <span class="input-group-addon"> <strong> Menu Order</strong></span>
54
            <input class="form-control"  id="menu-order" type="text" class="col-md-4"
55
            placeholder="list,page,names,for,menu,order" value="<%= menu_order %>">
66e3c71 by Anon Ray at 2013-08-30 56
          </div>
2b4c217 by Anon Ray at 2013-10-03 57
        </div>
66e3c71 by Anon Ray at 2013-08-30 58
2b4c217 by Anon Ray at 2013-10-03 59
        <div class="form-group">
60
          <input class="form-control"  id="custom-menu" type="checkbox">
61
          <span class=""><strong> Custom Menu </strong></span>
62
        </div>
66e3c71 by Anon Ray at 2013-08-30 63
2b4c217 by Anon Ray at 2013-10-03 64
        <div class="menu-options" style="display: none;">
65
          <div class="form-group">
66
            <div class="input-group">
67
              <span class="input-group-addon"> <strong> Position </strong></span>
68
              <input class="form-control"  id="pos" type="text" placeholder="[left, top]"
69
              value="<%= pos %>">
63c7919 by Anon Ray at 2013-05-30 70
            </div>
3fd837c by Anon Ray at 2013-08-23 71
          </div>
2b4c217 by Anon Ray at 2013-10-03 72
          <label><strong> HTML for menu: </strong></label>
73
          <textarea cols="25" rows="8" id="menu"><%= menu %></textarea>
63c7919 by Anon Ray at 2013-05-30 74
        </div>
75
4a1fae7 by Anon Ray at 2013-05-09 76
      </div>
2b4c217 by Anon Ray at 2013-10-03 77
      <button id="updateMenu" class="btn btn-primary pull-right"> Update </button>
78
      <div class="clearfix"></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="{{ url_for('index') }}"> 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
          <span class="glyphicon glyphicon-trash"></span>
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 Details </h4>
108
      <form class="form-horizontal">
109
        <div class="form-group">
110
          <div class="input-group">
111
            <span class="input-group-addon"> <strong> Name </strong></span>
112
            <input class="form-control"  id="name" type="text" placeholder="name of the page" value="<%= name %>">
4a1fae7 by Anon Ray at 2013-05-09 113
          </div>
2b4c217 by Anon Ray at 2013-10-03 114
        </div>
115
        <div class="form-group">
116
          <div class="input-group">
117
            <span class="input-group-addon"> <strong>Title</strong> </span>
118
            <input class="form-control"  id="title" type="text" placeholder="title of the page"
119
             value="<%= title %>">
4a1fae7 by Anon Ray at 2013-05-09 120
          </div>
2b4c217 by Anon Ray at 2013-10-03 121
        </div>
122
        <div class="form-group">
123
          <div class="input-group">
124
            <span class="input-group-addon"> <strong>Children</strong> </span>
125
            <input class="form-control"  id="children" type="text" placeholder="csv of child pages"
126
            value="<%= children %>">
4a1fae7 by Anon Ray at 2013-05-09 127
          </div>
2b4c217 by Anon Ray at 2013-10-03 128
        </div>
129
        <div class="form-group">
130
          <div class="checkbox">
131
            <label>
63c7919 by Anon Ray at 2013-05-30 132
              <input id="showNav" type="checkbox" <%=checked%>>
2b4c217 by Anon Ray at 2013-10-03 133
              <strong> Show Navigation </strong>
134
            </label>
4a1fae7 by Anon Ray at 2013-05-09 135
          </div>
2b4c217 by Anon Ray at 2013-10-03 136
        </div>
137
        <label><strong> Content </strong></label>
138
        <div id="content" class="content well">
139
          <%= content %>
140
          <p></p>
141
          <button class="addContent btn btn-sm btn-primary">Add Content</button>
142
        </div>
143
        <button id="updatePage" type="submit" class="btn btn-primary pull-right"> Update </button>
144
        <div class="clearfix"></div>
145
      </form>
146
    </div>
147
  </script>
148
149
  <script type="text/template" id="content-list-template">
150
    <div class="content-item-wrapper">
151
      <span class="content-item" id="content-<%= no %>">
152
        <span class="label label-default"> <%= type %> </span>
153
        <span class="content-snippet">
154
          [ <small> <%= title %>  <%= more %> </small> ]
4a1fae7 by Anon Ray at 2013-05-09 155
        </span>
2b4c217 by Anon Ray at 2013-10-03 156
      </span>
157
      <span class="pull-right">
158
        <a href="javascript:void(0);" class="remove" for="<%=no%>">
159
          <span class="glyphicon glyphicon-trash"></span>
160
        </a>
161
      </span>
162
      <span class="clearfix"></span>
163
    </div>
164
  </script>
4a1fae7 by Anon Ray at 2013-05-09 165
2b4c217 by Anon Ray at 2013-10-03 166
  <script type="text/template" id="content-template">
167
    <div class="contentview">
168
      <form class="form-horizontal">
169
        <div class="form-group">
4a1fae7 by Anon Ray at 2013-05-09 170
          <label><b>Type</b></label>
2b4c217 by Anon Ray at 2013-10-03 171
          <select class="form-control">
3fd837c by Anon Ray at 2013-08-23 172
            <% _.each(M.contentTypes, function(type) { %>
4a1fae7 by Anon Ray at 2013-05-09 173
              <option><%= type %></option>
174
            <%  }); %>
175
          </select>
176
        </div>
2b4c217 by Anon Ray at 2013-10-03 177
        <div class="form-group">
178
          <div class="input-group">
179
            <span class="input-group-addon"> <b>Title</b> </span>
180
            <input class="form-control"  type="text" placeholder="title of the content" value="<%=
181
            title %>" m-data-target="title">
748ffb6 by Arvind at 2013-09-30 182
          </div>
183
        </div>
2b4c217 by Anon Ray at 2013-10-03 184
        <div class="form-group">
185
          <div class="input-group">
186
            <span class="input-group-addon"> <strong>Tags</strong> </span>
187
            <input class="form-control"  type="text" placeholder="csv of tags for this content"
188
            value="<%= tags %>" m-data-target="tags">
4a1fae7 by Anon Ray at 2013-05-09 189
          </div>
190
        </div>
2b4c217 by Anon Ray at 2013-10-03 191
      </form>
192
      <div id="specific-content"></div>
193
      <button class="btn btn-info" id="done">Done</button>
194
      <button class="btn btn-primary" id="updateContent">Update</button>
195
    </div>
196
  </script>
197
198
  <script type="text/template" id="map-template">
199
    <div class="data">
200
      <div class="form-group">
201
        <div class="input-group">
202
          <span class="input-group-addon"><strong>Tile Provider URL</strong></span>
203
          <input class="form-control"  type="text" placeholder="http://{s}.tile.cloudmade.com/<API_KEY>/997/256/{z}/{x}/{y}.png" value="<%= tileLayer %>"
204
          m-data-target="tileLayer">
205
        </div>
4a1fae7 by Anon Ray at 2013-05-09 206
      </div>
2b4c217 by Anon Ray at 2013-10-03 207
      <div class="preview"></div>
208
    </div>
209
  </script>
aeb1feb by Anon Ray at 2013-08-23 210
211
2b4c217 by Anon Ray at 2013-10-03 212
  <script type="text/template" id="media-template">
213
    <div class="data">
214
      <div class="form-group">
215
        <div class="input-group">
216
          <span class="input-group-addon"><strong>path to file</strong></span>
217
          <input class="form-control"  type="text" placeholder="src" value="<%= src %>"
218
          m-data-target="src">
219
        </div>
aeb1feb by Anon Ray at 2013-08-23 220
      </div>
2b4c217 by Anon Ray at 2013-10-03 221
      <div class="preview"></div>
222
    </div>
223
  </script>
224
225
  <script type="text/template" id="text-template">
226
    <div class="data">
227
      <label><b> Content </b></label>
228
      <p>
229
      <span class="label label-info">Tip</span>
230
      <span><small> You can unleash your HTML power here </small></span>
231
      </p>
232
      <textarea id="edit" m-data-target="data">
233
        <%= data %>
234
      </textarea>
235
    </div>
236
  </script>
237
238
  <!-- notification templates -->
239
  <script type="text/template" id="success-notif">
240
    <div class="alert alert-success">
241
      <button type="button" class="close" data-dismiss="alert">&times;</button>
242
      <h4> <%= title %> </h4>
243
      <%= msg %>
244
    </div>
245
  </script>
aeb1feb by Anon Ray at 2013-08-23 246
2b4c217 by Anon Ray at 2013-10-03 247
  <script type="text/template" id="fail-notif">
248
    <div class="alert alert-danger">
249
      <button type="button" class="close" data-dismiss="alert">&times;</button>
250
      <h4> <%= title %> </h4>
251
      <%= msg %>
252
    </div>
253
  </script>
254
{% endblock %}