Commit 40ce98990085093b03795627ad3f98b10091f41e
Fix JS config and path relate issues
| | | | 95 | return flask.jsonify(error=res['err'], status='error') | 95 | return flask.jsonify(error=res['err'], status='error') |
---|
96 | | 96 | |
---|
97 | | 97 | |
---|
98 | #@app.route('/menu', methods=['POST']) | | #@app.route('/menu', methods=['POST']) |
---|
99 | #def insertMenu(): | | #def insertMenu(): |
---|
100 | # newmenu = flask.request.json | | # newmenu = flask.request.json |
---|
101 | # print newmenu | | # print newmenu |
---|
102 | # res = siteMenu.insert(newmenu) | | # res = siteMenu.insert(newmenu) |
---|
103 | # print res | | # print res |
---|
104 | # return flask.jsonify(status='success')#, content=getContent()) | | # 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 | @app.route('/menu/<_id>', methods=['PUT']) | 108 | @app.route('/menu/<_id>', methods=['PUT']) |
---|
108 | def updateMenu(_id): | 109 | def updateMenu(_id): |
---|
| | | | 91 | | 91 | |
---|
92 | var Pages = Backbone.Collection.extend({ | 92 | var Pages = Backbone.Collection.extend({ |
---|
93 | model: M.types.model.Page, | 93 | model: M.types.model.Page, |
---|
94 | url: M.PageURL() | | url: M.PageURL() |
---|
| | 94 | url: M.PageURL() + '/' | 95 | }); | 95 | }); |
---|
96 | | 96 | |
---|
97 | /* view to manage each page and their properties - change page properties, | 97 | /* view to manage each page and their properties - change page properties, |
---|
| | | | 117 | customMenu: false | 117 | customMenu: false |
---|
118 | }, | 118 | }, |
---|
119 | url: function() { | 119 | url: function() { |
---|
120 | return M.MenuURL() + this.id; | | return M.MenuURL() + this.id; |
---|
| | 120 | return M.MenuURL() + '/' + this.id; | 121 | }, | 121 | }, |
---|
122 | initialize: function() { | 122 | initialize: function() { |
---|
123 | this.id = this.get('id'); | 123 | this.id = this.get('id'); |
---|
| | | | 38 | <script> | 38 | <script> |
---|
39 | // initialize editor | 39 | // initialize editor |
---|
40 | window.M = window.M || {}; | 40 | window.M = window.M || {}; |
---|
41 | M.MenuURL = function() { return "{{ url_for('updateMenu') }}"}; | | M.MenuURL = function() { return "{{ url_for('updateMenu') }}"}; |
---|
| | 41 | M.MenuURL = function() { return "{{ url_for('insertMenu') }}"}; | 42 | M.PageURL = function() { return "{{ url_for('insertPage') }}"}; | 42 | M.PageURL = function() { return "{{ url_for('insertPage') }}"}; |
---|
43 | M.site_content = {{ content|tojson|safe }}; | 43 | M.site_content = {{ content|tojson|safe }}; |
---|
44 | window.onload = function() { | 44 | window.onload = function() { |
---|
| | | | 34 | <script> | 34 | <script> |
---|
35 | //Code to initialize the framework | 35 | //Code to initialize the framework |
---|
36 | window.M = window.M || {}; | 36 | window.M = window.M || {}; |
---|
37 | M.MenuURL = function() { return "{{ url_for('updateMenu') }}"}; | | M.MenuURL = function() { return "{{ url_for('updateMenu') }}"}; |
---|
| | 37 | M.MenuURL = function() { return "{{ url_for('insertMenu') }}"}; | 38 | M.PageURL = function() { return "{{ url_for('insertPage') }}"; }; | 38 | M.PageURL = function() { return "{{ url_for('insertPage') }}"; }; |
---|
39 | M.site_content = {{ content|tojson|safe }}; | 39 | M.site_content = {{ content|tojson|safe }}; |
---|
40 | window.onload = function() { | 40 | window.onload = function() { |
---|