aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzsloan2019-09-27 10:50:44 -0500
committerzsloan2019-09-27 10:50:44 -0500
commitdcdb588f736df433d3a09aedd0fe50cb9f80e794 (patch)
tree1ea566302ab98261ab062e4846b58ecd93cdedc6
parent3a5898afca1f3f00ff84e3d2eb310405df00e567 (diff)
downloadgenenetwork2-dcdb588f736df433d3a09aedd0fe50cb9f80e794.tar.gz
Added extra larger buttons to submit changes to news and other pages + fixed issue where encoding was sometimes weird for Authors in search result (still need to do this in other places)
-rw-r--r--wqflask/wqflask/templates/docedit.html8
-rw-r--r--wqflask/wqflask/templates/search_result_page.html9
-rw-r--r--wqflask/wqflask/views.py2
3 files changed, 15 insertions, 4 deletions
diff --git a/wqflask/wqflask/templates/docedit.html b/wqflask/wqflask/templates/docedit.html
index e8aa7da1..b87c5b41 100644
--- a/wqflask/wqflask/templates/docedit.html
+++ b/wqflask/wqflask/templates/docedit.html
@@ -5,20 +5,26 @@
{% block content %}
<div class="container">
<h3>Edit: {{title}}</h3>
- <form action="/update_text" method="post">
+ <form id="update_text" action="/update_text" method="post">
<input type="hidden" name="entry_type" value="{{ entry }}">
<input type="hidden" name="title" value="{{ title }}">
{% if editable is defined %}
<input type="hidden" name="edit" value="{{ editable }}">
{% endif %}
+ <button class="submit_changes" style="margin-bottom: 20px;">Submit Changes</button>
<textarea name="ckcontent" id="ckcontent">
{{content|safe}}
</textarea>
+ <button class="submit_changes" style="margin-top: 20px;">Submit Changes</button>
<script src="/static/packages/ckeditor/ckeditor.js"></script>
<script type="text/javascript">
CKEDITOR.replace('ckcontent', {
height: '650px',
});
+
+ $('.submit_changes').click(function() {
+ $('#update_text').submit();
+ })
</script>
</form>
</div>
diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html
index 2c67f6c3..262a563d 100644
--- a/wqflask/wqflask/templates/search_result_page.html
+++ b/wqflask/wqflask/templates/search_result_page.html
@@ -348,9 +348,14 @@
'render': function(data, type, row, meta) {
author_list = data.authors.split(",")
if (author_list.length >= 6) {
- return author_list.slice(0, 6).join(",") + ", et al."
+ author_string = author_list.slice(0, 6).join(",") + ", et al."
} else{
- return data.authors
+ author_string = data.authors
+ }
+ try {
+ return decodeURIComponent(escape(author_string))
+ } catch(err){
+ return escape(author_string)
}
}
},
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 70748040..bff9f9d2 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -307,7 +307,7 @@ def submit_trait_form():
@app.route("/create_temp_trait", methods=('POST',))
def create_temp_trait():
logger.info(request.url)
- print("REQUEST.FORM:", request.form)
+
#template_vars = submit_trait.SubmitTrait(request.form)
doc = docs.Docs("links")