Skip to content

Commit

Permalink
replaced ' with \' in names of models and projects closes #559 and cl…
Browse files Browse the repository at this point in the history
…oses #570
  • Loading branch information
Matthew Letter committed Feb 1, 2016
1 parent c0712b6 commit 9590159
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions packages/slycat/web/server/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def get_project(pid):
context["slycat-css-bundle"] = css_bundle()
context["slycat-js-bundle"] = js_bundle()
context["slycat-project"] = project
context["slycat-project-name"] = project.get("name", "").replace("'", "\\'")
return slycat.web.server.template.render("slycat-project.html", context)

def get_remote_host_dict():
Expand Down Expand Up @@ -435,8 +436,13 @@ def get_model(mid, **kwargs):
context["slycat-server-root"] = cherrypy.request.app.config["slycat-web-server"]["server-root"]
context["slycat-marking-before-html"] = marking["badge"] if marking["page-before"] is None else marking["page-before"]
context["slycat-marking-after-html"] = marking["badge"] if marking["page-after"] is None else marking["page-after"]

context["slycat-model"] = model
context["slycat-model-name"] = model.get("name","").replace("'", "\\'")

context["slycat-project"] = project
context["slycat-project-name"] = project.get("name", "").replace("'", "\\'")

context["slycat-css-bundle"] = css_bundle()
context["slycat-js-bundle"] = js_bundle()
context["slycat-model-type"] = mtype
Expand Down
2 changes: 1 addition & 1 deletion web-server/templates/slycat-model-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</head>

<body>
<slycat-navbar params="project_id:'{{slycat-project._id}}', project_name:'{{slycat-project.name}}', model_id:'{{slycat-model._id}}', model_name:'{{slycat-model.name}}', model_marking:'{{slycat-model.marking}}', model_type:'{{slycat-model.model-type}}'"></slycat-navbar>
<slycat-navbar params="project_id:'{{slycat-project._id}}', project_name:'{{slycat-project-name}}', model_id:'{{slycat-model._id}}', model_name:'{{slycat-model-name}}', model_marking:'{{slycat-model.marking}}', model_type:'{{slycat-model.model-type}}'"></slycat-navbar>
<div class="slycat-content">
{{{slycat-marking-before-html}}}
{{{slycat-page-html}}}
Expand Down
2 changes: 1 addition & 1 deletion web-server/templates/slycat-project.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</head>

<body>
<slycat-navbar params="project_id:'{{slycat-project._id}}', project_name:'{{slycat-project.name}}'"></slycat-navbar>
<slycat-navbar params="project_id:'{{slycat-project._id}}', project_name:'{{slycat-project-name}}'"></slycat-navbar>

<div id="slycat-project" class="bootstrap-styles slycat-content">
<div class="container">
Expand Down

0 comments on commit 9590159

Please sign in to comment.