Skip to content
Snippets Groups Projects
Commit 403dd2d6 authored by Robin Sonnabend's avatar Robin Sonnabend
Browse files

Make todos internal

parent 151641e8
No related branches found
No related tags found
No related merge requests found
...@@ -193,16 +193,24 @@ class Tag: ...@@ -193,16 +193,24 @@ class Tag:
if self.name == "url": if self.name == "url":
return r"\url{{{}}}".format(self.values[0]) return r"\url{{{}}}".format(self.values[0])
elif self.name == "todo": elif self.name == "todo":
if not show_private:
return ""
return self.todo.render_latex(current_protocol=protocol) return self.todo.render_latex(current_protocol=protocol)
return r"\textbf{{{}:}} {}".format(escape_tex(self.name.capitalize()), escape_tex(self.values[0])) return r"\textbf{{{}:}} {}".format(escape_tex(self.name.capitalize()), escape_tex(self.values[0]))
elif render_type == RenderType.plaintext: elif render_type == RenderType.plaintext:
if self.name == "url": if self.name == "url":
return self.values[0] return self.values[0]
elif self.name == "todo":
if not show_private:
return ""
return self.values[0]
return "{}: {}".format(self.name.capitalize(), self.values[0]) return "{}: {}".format(self.name.capitalize(), self.values[0])
elif render_type == RenderType.wikitext: elif render_type == RenderType.wikitext:
if self.name == "url": if self.name == "url":
return "[{0} {0}]".format(self.values[0]) return "[{0} {0}]".format(self.values[0])
elif self.name == "todo": elif self.name == "todo":
if not show_private:
return ""
return self.todo.render_wikitext(current_protocol=protocol) return self.todo.render_wikitext(current_protocol=protocol)
return "'''{}:''' {}".format(self.name.capitalize(), self.values[0]) return "'''{}:''' {}".format(self.name.capitalize(), self.values[0])
else: else:
...@@ -303,6 +311,8 @@ class Fork(Element): ...@@ -303,6 +311,8 @@ class Fork(Element):
def render(self, render_type, show_private, level, protocol=None): def render(self, render_type, show_private, level, protocol=None):
name_line = self.name if self.name is not None and len(self.name) > 0 else "" name_line = self.name if self.name is not None and len(self.name) > 0 else ""
if level == 0 and self.name == "Todos" and not show_private:
return ""
if render_type == RenderType.latex: if render_type == RenderType.latex:
begin_line = r"\begin{itemize}" begin_line = r"\begin{itemize}"
end_line = r"\end{itemize}" end_line = r"\end{itemize}"
......
...@@ -687,8 +687,8 @@ def _get_page(): ...@@ -687,8 +687,8 @@ def _get_page():
return 0 return 0
@app.route("/todos/list") @app.route("/todos/list")
@login_required
def list_todos(): def list_todos():
is_logged_in = check_login()
user = current_user() user = current_user()
protocoltype = None protocoltype = None
protocoltype_id = None protocoltype_id = None
......
...@@ -30,7 +30,9 @@ ...@@ -30,7 +30,9 @@
<li><a href="{{url_for("new_protocol")}}">Neues Protokoll</a></li> <li><a href="{{url_for("new_protocol")}}">Neues Protokoll</a></li>
{% endif %} {% endif %}
<li><a href="{{url_for("list_protocols")}}">Protokolle</a></li> <li><a href="{{url_for("list_protocols")}}">Protokolle</a></li>
{% if check_login() %}
<li><a href="{{url_for("list_todos")}}">Todos</a></li> <li><a href="{{url_for("list_todos")}}">Todos</a></li>
{% endif %}
<li><a href="{{url_for("list_decisions")}}">Beschlüsse</a></li> <li><a href="{{url_for("list_decisions")}}">Beschlüsse</a></li>
{% if check_login() %} {% if check_login() %}
<li><a href="{{url_for("list_types")}}">Typen</a></li> <li><a href="{{url_for("list_types")}}">Typen</a></li>
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
{% endif %} {% endif %}
</div> </div>
<div id="right-column" class="col-lg-6"> <div id="right-column" class="col-lg-6">
{% if protocol.is_done() %} {% if protocol.is_done() and has_public_view_right and logged_in %}
<h3>Todos dieser Sitzung <a href="{{url_for("list_todos")}}">Aktuelle Todos</a></h3> <h3>Todos dieser Sitzung <a href="{{url_for("list_todos")}}">Aktuelle Todos</a></h3>
<ul> <ul>
{% if protocol.get_originating_todos()|length > 0 %} {% if protocol.get_originating_todos()|length > 0 %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment