Skip to content
Snippets Groups Projects
Commit fa90e632 authored by Julian Rother's avatar Julian Rother
Browse files

Replace newlines with <br>-tags in most fields (esp. description/comment)

parent d5e49b72
No related branches found
No related tags found
No related merge requests found
...@@ -123,6 +123,11 @@ def rfc3339(d): ...@@ -123,6 +123,11 @@ def rfc3339(d):
def get_announcements(minlevel=0): def get_announcements(minlevel=0):
return query('SELECT * FROM announcements WHERE NOT deleted AND (? OR visible) AND level >= ? ORDER BY level DESC', ismod(), minlevel) return query('SELECT * FROM announcements WHERE NOT deleted AND (? OR visible) AND level >= ? ORDER BY level DESC', ismod(), minlevel)
@app.template_filter()
def fixnl(s):
# To be remove, as soon as db schema is cleaned-up
return str(s).replace('\n', '<br>')
@app.route('/') @app.route('/')
@register_navbar('Home', icon='home') @register_navbar('Home', icon='home')
def index(): def index():
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
{% endif %} {% endif %}
</div> </div>
<div class="col-xs-4"> <div class="col-xs-4">
<div>{{ lecture['title'] }}</div> <div>{{ lecture['title']|fixnl|safe }}</div>
<p style="font-style: italic; color: #777;">{{ lecture['comment'] }}</p> <p style="font-style: italic; color: #777;">{{ lecture['comment']|fixnl|safe }}</p>
</div> </div>
</div> </div>
</a> </a>
...@@ -26,14 +26,14 @@ ...@@ -26,14 +26,14 @@
</li> </li>
{% if lecture['speaker'] %} {% if lecture['speaker'] %}
<li> <li>
<span class="small">Gehalten von {{ lecture['speaker'] }} </span> <span class="small">Gehalten von {{ lecture['speaker']|safe }} </span>
</li> </li>
{% endif %} {% endif %}
<li> <li>
{{ lecture['title'] }} {{ lecture['title']|fixnl|safe }}
</li> </li>
<li> <li>
<p style="font-style: italic; color: #777;">{{ lecture['comment'] }}</p> <p style="font-style: italic; color: #777;">{{ lecture['comment']|fixnl|safe }}</p>
</li> </li>
</ul> </ul>
</a> </a>
...@@ -169,7 +169,7 @@ $('#embedcodebtn').popover( ...@@ -169,7 +169,7 @@ $('#embedcodebtn').popover(
{% if ismod() %} {% if ismod() %}
<span class="modeditable" data-path="{{path|join('.')}}" ><a class="modeditablesign btn btn-default" tabindex="0" style="padding: 3px; margin-right: 5px;"><span class="glyphicon glyphicon-pencil"></span></a><span class="modeditablevalue">{{ value|safe }}</span></span> <span class="modeditable" data-path="{{path|join('.')}}" ><a class="modeditablesign btn btn-default" tabindex="0" style="padding: 3px; margin-right: 5px;"><span class="glyphicon glyphicon-pencil"></span></a><span class="modeditablevalue">{{ value|safe }}</span></span>
{% else %} {% else %}
{{value|safe}} {{value|fixnl|safe}}
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment