diff --git a/sourcing/templates/view.html b/sourcing/templates/view.html index e96fc2b..3c65d7e 100644 --- a/sourcing/templates/view.html +++ b/sourcing/templates/view.html @@ -8,9 +8,9 @@ div#text { font-family: Courier; }

{{ title }} - {% if doc.user == current_user %} + {# {% if doc.user == current_user %} #} edit - {% endif %} + {# {% endif %} #} {% if doc.type == 'xanadoc' %} fulfil {% endif %} @@ -23,7 +23,9 @@ div#text { font-family: Courier; }

{% for i in line %} {%- if i.highlight -%} - {{- i.highlight -}} + {% if i.highlight != '\n' and i.highlight != '\r\n' %} + {{- i.highlight -}} + {% endif %} {%- else -%} {{- i.text -}} {%- endif -%} @@ -32,6 +34,8 @@ div#text { font-family: Courier; } {%- endfor -%} {% else %} {%- for start, line in iter_lines(doc.text) if line -%} + {#

{% if line != "\n" and line != "\r\n" %}{{ line }}{% else %} {% endif +%}

#}

{{ line }}

{%- endfor -%} {% endif %} diff --git a/sourcing/view.py b/sourcing/view.py index d6dd6d2..902c316 100644 --- a/sourcing/view.py +++ b/sourcing/view.py @@ -166,7 +166,7 @@ def view_item(username, hashid, raw=False): @bp.route('///edit', methods=['GET', 'POST']) def edit_item(username, hashid): - obj = get_item(current_user.username, hashid) + obj = get_item(username, hashid) form = SourceDocForm(obj=obj) if form.validate_on_submit(): form.populate_obj(obj)