Commit 2998a3dbf63e3f61cae27745a7c1375951901a03

  • avatar
  • arvind
  • Mon Jul 22 14:52:18 IST 2013
Bug fixes:
  - Closing ticket #5 http://trac.pantoto.org/mouchak/ticket/5.
	- Custom menu interface was not checking if the option for custom menu was checked or not.  Fixing that.
	- Adding virtualenv entries in .gitignore
  • Diff rendering mode:
  • inline
  • side by side

.gitignore

1
2*.*~1*.*~
3*.pyc2*.pyc
3# For virtual-env
4bin/
5lib/
6local/
7include/

static/js/editor.js

257 }));257 }));
258 // init the wysiwig editor258 // init the wysiwig editor
259 M.editor.wysiwig('#edit');259 M.editor.wysiwig('#edit');
260 }
260 }
261 else if(type === 'image' || type === 'video' || type === 'audio') {261 else if(type === 'image' || type === 'video' || type === 'audio') {
262 var template = _.template($('#media-template').html());262 var template = _.template($('#media-template').html());
263 $('#specific-content').html(template({263 $('#specific-content').html(template({
264 src: this.model.get('src')264 src: this.model.get('src')
265 }));265 }));
266
266
267 //provide the users a preview267 //provide the users a preview
268 /*var view = new M.types.view[type]({model: this.model});268 /*var view = new M.types.view[type]({model: this.model});
269 //$('#specific-content.preview').html();269 //$('#specific-content.preview').html();
359 this.showMenuOptions(this.model.get('customMenu'));359 this.showMenuOptions(this.model.get('customMenu'));
360 },360 },
361 saveMenu: function() {361 saveMenu: function() {
362 //console.log('saving menu..');
362 console.log('saving menu..');
363 // var menuHTML = $('#menu').val().trim();363 // var menuHTML = $('#menu').val().trim();
364 //this.model.set({'html': menuHTML});364 //this.model.set({'html': menuHTML});
365 //console.log(this.model.toJSON());365 //console.log(this.model.toJSON());
366 //alert('saveMenu called');366 //alert('saveMenu called');
367 /*this.model.save({}, {
367 var bool;
368 if($("custom-menu").is(":checked")){
369 bool = true;
370 }
371 else{
372 bool = false;
373 }
374 this.model.save({customMenu: bool}, {
368 success: function(model, response) {375 success: function(model, response) {
369 console.log(model, response);376 console.log(model, response);
370 },377 },
371 error: function(xhr, response) {378 error: function(xhr, response) {
372 }379 }
373 });*/
380 });
374 //alert('end of save menu');381 //alert('end of save menu');
375 }382 }
376 });383 });

templates/editor.html

28 <div id="footer">28 <div id="footer">
29 </div>29 </div>
30 </div>30 </div>
31
31
32 <script>32 <script>
33 // initialize editor33 // initialize editor
34 window.M = window.M || {};34 window.M = window.M || {};
54 <div class="page">54 <div class="page">
55 <div class="menu-config">55 <div class="menu-config">
56 <h4> Menu Config </h4>56 <h4> Menu Config </h4>
57 <form class="form-horizontal">
57 <!-- <form class="form-horizontal"> -->
58 <div class="control-group">58 <div class="control-group">
59 <input id="custom-menu" type="checkbox">59 <input id="custom-menu" type="checkbox">
60 <span class=""><strong> Custom Menu </strong></span>60 <span class=""><strong> Custom Menu </strong></span>
61 </div>61 </div>
62 <button id="updateMenu" type="submit" class="btn btn-primary pull-right"> Update </button>
62 <button id="updateMenu" class="btn btn-primary pull-right"> Update </button>
63 <div class="clearfix"></div>63 <div class="clearfix"></div>
64 <div class="menu-options" style="display: none;">64 <div class="menu-options" style="display: none;">
65 <div class="control-group">65 <div class="control-group">
74 <%= menu %>74 <%= menu %>
75 </div>75 </div>
76 </div>76 </div>
77 </form>
77 <!-- </form> -->
78 </div>78 </div>
79 </div>79 </div>
80 </script>80 </script>
124 <span class="add-on"> <strong>Children</strong> </span>124 <span class="add-on"> <strong>Children</strong> </span>
125 <input id="children" type="text" placeholder="csv of child pages"125 <input id="children" type="text" placeholder="csv of child pages"
126 value="<%= children %>">126 value="<%= children %>">
127 </div>
127 </div>
128 </div>128 </div>
129 <div class="control-group">129 <div class="control-group">
130 <div class="input-prepend">130 <div class="input-prepend">
146146
147 <script type="text/template" id="content-list-template">147 <script type="text/template" id="content-list-template">
148 <div class="content-item-wrapper">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="">
149 <span class="content-item" id="content-<%= no %>">
150 <span class="label label-info"> <%= type %> </span>
151 <span class="">
152 [ <small> <%= title %> <%= more %> </small> ]152 [ <small> <%= title %> <%= more %> </small> ]
153 </span>153 </span>
154 </span>154 </span>
173 <span class="add-on"> <b>Title</b> </span>173 <span class="add-on"> <b>Title</b> </span>
174 <input type="text" placeholder="title of the content" value="<%=174 <input type="text" placeholder="title of the content" value="<%=
175 title %>" m-data-target="title">175 title %>" m-data-target="title">
176 </div>
176 </div>
177 </div>177 </div>
178 <div class="control-group">178 <div class="control-group">
179 <div class="input-prepend">179 <div class="input-prepend">
180 <span class="add-on"> <strong>Tags</strong> </span>180 <span class="add-on"> <strong>Tags</strong> </span>
181 <input type="text" placeholder="csv of tags for this content"181 <input type="text" placeholder="csv of tags for this content"
182 value="<%= tags %>" m-data-target="tags">182 value="<%= tags %>" m-data-target="tags">
183 </div>
183 </div>
184 </div>184 </div>
185 </div>185 </div>
186 <div id="specific-content"></div>186 <div id="specific-content"></div>