From 094f2e0fdc9b2353f08e4c3bb1165d0b0a0c3878 Mon Sep 17 00:00:00 2001 From: Markus Scheller <scheller_m@live.de> Date: Sun, 25 Feb 2018 12:09:45 +0100 Subject: [PATCH] Add row to view the selected LaTeX template The row will only be shown when different templates are set up in config.py and available. protokollsystem/proto3#170 Bugfix: Replaced ethernet_part with etherpad_part in line 221 to ensure that this part will only be shwon when the systems consumes the etherpad --- views/tables.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/views/tables.py b/views/tables.py index 48842b1..8b59ea0 100644 --- a/views/tables.py +++ b/views/tables.py @@ -193,12 +193,13 @@ class ProtocolTypeTable(SingleValueTable): network_headers = ["Netzwerke einschränken", "Erlaubte Netzwerke"] action_headers = ["Aktion"] feed_headers = [] + latex_template_headers = ["LaTeX Vorlage"] if getattr(config, "LATEX_TEMPLATES", None) is not None else [] if self.value.has_public_anonymous_view_right(): feed_headers = [Markup("<img height=\"18px\" src=\"{}\" /> Feed".format( url_for("static", filename="images/feed-icon.svg")))] return (general_headers + etherpad_headers + mail_headers + printing_headers + wiki_headers + calendar_headers - + network_headers + feed_headers + action_headers) + + network_headers + latex_template_headers + feed_headers + action_headers) def row(self): user = current_user() @@ -217,7 +218,7 @@ class ProtocolTypeTable(SingleValueTable): Table.bool(self.value.non_reproducible_pad_links) ] if not config.ETHERPAD_ACTIVE: - ethernet_part = [] + etherpad_part = [] mail_part = [ self.value.private_mail, self.value.public_mail, @@ -242,6 +243,11 @@ class ProtocolTypeTable(SingleValueTable): network_part.append(", ".join(map(str.strip, self.value.allowed_networks.split(",")))) else: network_part.append("") + _latex_templates = getattr(config, "LATEX_TEMPLATES", None) + if _latex_templates is not None: + latex_template_part = [_latex_templates[self.value.latex_template]['name'] if self.value.latex_template is not (None or "") else "Standardvorlage"] + else: + latex_template_part = [] feed_part = [] if self.value.has_public_anonymous_view_right(): feed_part = [Markup(", ".join([ @@ -260,7 +266,7 @@ class ProtocolTypeTable(SingleValueTable): if not self.value.has_admin_right(user): action_part = [""] return (general_part + etherpad_part + mail_part + printing_part - + wiki_part + calendar_part + network_part + feed_part + + wiki_part + calendar_part + network_part + latex_template_part + feed_part + action_part) class DefaultTOPsTable(Table): -- GitLab