diff options
-rw-r--r-- | web/images/edit.png | bin | 0 -> 4322 bytes | |||
-rwxr-xr-x | wqflask/wqflask/docs.py | 1 | ||||
-rwxr-xr-x | wqflask/wqflask/templates/docedit.html (renamed from wqflask/wqflask/templates/testhtmleditor.html) | 8 | ||||
-rwxr-xr-x | wqflask/wqflask/templates/docs.html | 5 | ||||
-rwxr-xr-x | wqflask/wqflask/views.py | 7 |
5 files changed, 14 insertions, 7 deletions
diff --git a/web/images/edit.png b/web/images/edit.png Binary files differnew file mode 100644 index 00000000..dda50521 --- /dev/null +++ b/web/images/edit.png diff --git a/wqflask/wqflask/docs.py b/wqflask/wqflask/docs.py index 65255987..07b0b81a 100755 --- a/wqflask/wqflask/docs.py +++ b/wqflask/wqflask/docs.py @@ -11,5 +11,6 @@ class Docs(object): WHERE Docs.entry LIKE '%s' """ result = g.db.execute(sql % (entry)).fetchone() + self.entry = entry self.title = result[0] self.content = result[1] diff --git a/wqflask/wqflask/templates/testhtmleditor.html b/wqflask/wqflask/templates/docedit.html index 1d258d0e..1a9e8ca8 100755 --- a/wqflask/wqflask/templates/testhtmleditor.html +++ b/wqflask/wqflask/templates/docedit.html @@ -1,18 +1,18 @@ {% extends "base.html" %} -{% block title %}Test html editor{% endblock %} +{% block title %}Edit: {{title}}{% endblock %} {% block content %} <div class="container"> - <h2>Test HTML Editor</h2> + <h3>Edit: {{title}}</h3> <form> <textarea name="ckcontent" id="ckcontent"> - Test HTML + {{content|safe}} </textarea> <script type="text/javascript" src="/static/packages/ckeditor/ckeditor.js"></script> <script type="text/javascript"> CKEDITOR.replace('ckcontent', { - height: '500px', + height: '650px', }); </script> </form> diff --git a/wqflask/wqflask/templates/docs.html b/wqflask/wqflask/templates/docs.html index cbaf1e70..08f95721 100755 --- a/wqflask/wqflask/templates/docs.html +++ b/wqflask/wqflask/templates/docs.html @@ -5,6 +5,11 @@ {% block content %} <div class="container"> <h3>{{title}}</h3> + <div style="text-align: right;"> + <a href="docedit?entry={{entry}}"> + <img style="width: 25px;" src="/static/images/edit.png"> + </a> + </div> {{content|safe}} </div> {% endblock %} diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index cdf93147..deb566ba 100755 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -134,9 +134,10 @@ def search_page(): else: return render_template("search_result_page.html", **result) -@app.route("/testhtmleditor") -def testhtmleditor_page(): - return render_template("testhtmleditor.html") +@app.route("/docedit") +def docedit(): + doc = docs.Docs(request.args['entry']) + return render_template("docedit.html", **doc.__dict__) @app.route("/help") def help(): |