Commit 40ce98990085093b03795627ad3f98b10091f41e
- Diff rendering mode:
- inline
- side by side
mouchak/server.py
(9 / 8)
  | |||
95 | 95 | return flask.jsonify(error=res['err'], status='error') | |
96 | 96 | ||
97 | 97 | ||
98 | #@app.route('/menu', methods=['POST']) | ||
99 | #def insertMenu(): | ||
100 | # newmenu = flask.request.json | ||
101 | # print newmenu | ||
102 | # res = siteMenu.insert(newmenu) | ||
103 | # print res | ||
104 | # return flask.jsonify(status='success')#, content=getContent()) | ||
105 | # | ||
98 | @app.route('/menu', methods=['POST']) | ||
99 | def insertMenu(): | ||
100 | #newmenu = flask.request.json | ||
101 | #print newmenu | ||
102 | #res = siteMenu.insert(newmenu) | ||
103 | #print res | ||
104 | #return flask.jsonify(status='success')#, content=getContent()) | ||
105 | return '200 OK' | ||
106 | |||
106 | 107 | ||
107 | 108 | @app.route('/menu/<_id>', methods=['PUT']) | |
108 | 109 | def updateMenu(_id): |
mouchak/static/js/editor.js
(1 / 1)
  | |||
91 | 91 | ||
92 | 92 | var Pages = Backbone.Collection.extend({ | |
93 | 93 | model: M.types.model.Page, | |
94 | url: M.PageURL() | ||
94 | url: M.PageURL() + '/' | ||
95 | 95 | }); | |
96 | 96 | ||
97 | 97 | /* view to manage each page and their properties - change page properties, |
mouchak/static/js/models.js
(1 / 1)
  | |||
117 | 117 | customMenu: false | |
118 | 118 | }, | |
119 | 119 | url: function() { | |
120 | return M.MenuURL() + this.id; | ||
120 | return M.MenuURL() + '/' + this.id; | ||
121 | 121 | }, | |
122 | 122 | initialize: function() { | |
123 | 123 | this.id = this.get('id'); |
  | |||
38 | 38 | <script> | |
39 | 39 | // initialize editor | |
40 | 40 | window.M = window.M || {}; | |
41 | M.MenuURL = function() { return "{{ url_for('updateMenu') }}"}; | ||
41 | M.MenuURL = function() { return "{{ url_for('insertMenu') }}"}; | ||
42 | 42 | M.PageURL = function() { return "{{ url_for('insertPage') }}"}; | |
43 | 43 | M.site_content = {{ content|tojson|safe }}; | |
44 | 44 | window.onload = function() { |
mouchak/templates/index.html
(1 / 1)
  | |||
34 | 34 | <script> | |
35 | 35 | //Code to initialize the framework | |
36 | 36 | window.M = window.M || {}; | |
37 | M.MenuURL = function() { return "{{ url_for('updateMenu') }}"}; | ||
37 | M.MenuURL = function() { return "{{ url_for('insertMenu') }}"}; | ||
38 | 38 | M.PageURL = function() { return "{{ url_for('insertPage') }}"; }; | |
39 | 39 | M.site_content = {{ content|tojson|safe }}; | |
40 | 40 | window.onload = function() { |