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; } <div class="row"> <div class="col-xs-12"> <h1>{{ title }} - {% if doc.user == current_user %} + {# {% if doc.user == current_user %} #} <a href="{{ doc.edit_url }}" class="btn btn-default">edit</a> - {% endif %} + {# {% endif %} #} {% if doc.type == 'xanadoc' %} <a href="{{ doc.url }}" class="btn btn-default">fulfil</a> {% endif %} @@ -23,7 +23,9 @@ div#text { font-family: Courier; } <p data-start="{{ start }}"> {% for i in line %} {%- if i.highlight -%} - <span class="highlight">{{- i.highlight -}}</span> + {% if i.highlight != '\n' and i.highlight != '\r\n' %} + <span class="highlight">{{- i.highlight -}}</span> + {% 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 -%} + {# <p data-start="{{ start }}">{% if line != "\n" and line != "\r\n" %}{{ line }}{% else %} {% endif +%}</p>#} <p data-start="{{ start }}">{{ line }}</p> {%- 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('/<username>/<hashid>/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)