From 40ce98990085093b03795627ad3f98b10091f41e Mon Sep 17 00:00:00 2001 From: Anon Ray Date: Sat, 7 Sep 2013 00:07:23 +0530 Subject: [PATCH] Fix JS config and path relate issues --- mouchak/server.py | 17 +++++++++-------- mouchak/static/js/editor.js | 2 +- mouchak/static/js/models.js | 2 +- mouchak/templates/editor.html | 2 +- mouchak/templates/index.html | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/mouchak/server.py b/mouchak/server.py index 4846c5a..531591f 100644 --- a/mouchak/server.py +++ b/mouchak/server.py @@ -95,14 +95,15 @@ def updatePage(_id): return flask.jsonify(error=res['err'], status='error') -#@app.route('/menu', methods=['POST']) -#def insertMenu(): -# newmenu = flask.request.json -# print newmenu -# res = siteMenu.insert(newmenu) -# print res -# return flask.jsonify(status='success')#, content=getContent()) -# +@app.route('/menu', methods=['POST']) +def insertMenu(): + #newmenu = flask.request.json + #print newmenu + #res = siteMenu.insert(newmenu) + #print res + #return flask.jsonify(status='success')#, content=getContent()) + return '200 OK' + @app.route('/menu/<_id>', methods=['PUT']) def updateMenu(_id): diff --git a/mouchak/static/js/editor.js b/mouchak/static/js/editor.js index c17b685..90bff69 100644 --- a/mouchak/static/js/editor.js +++ b/mouchak/static/js/editor.js @@ -91,7 +91,7 @@ var Pages = Backbone.Collection.extend({ model: M.types.model.Page, - url: M.PageURL() + url: M.PageURL() + '/' }); /* view to manage each page and their properties - change page properties, diff --git a/mouchak/static/js/models.js b/mouchak/static/js/models.js index 8b81422..b2793c2 100644 --- a/mouchak/static/js/models.js +++ b/mouchak/static/js/models.js @@ -117,7 +117,7 @@ customMenu: false }, url: function() { - return M.MenuURL() + this.id; + return M.MenuURL() + '/' + this.id; }, initialize: function() { this.id = this.get('id'); diff --git a/mouchak/templates/editor.html b/mouchak/templates/editor.html index e032587..02cd183 100644 --- a/mouchak/templates/editor.html +++ b/mouchak/templates/editor.html @@ -38,7 +38,7 @@