diff --git a/static/images/feed-icon.svg b/static/images/feed-icon.svg new file mode 100644 index 0000000000000000000000000000000000000000..b32514942e1532e61f956aee9d89b81998ebbadb --- /dev/null +++ b/static/images/feed-icon.svg @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="128px" height="128px" id="RSSicon" viewBox="0 0 256 256"> +<defs> +<linearGradient x1="0.085" y1="0.085" x2="0.915" y2="0.915" id="RSSg"> +<stop offset="0.0" stop-color="#E3702D"/><stop offset="0.1071" stop-color="#EA7D31"/> +<stop offset="0.3503" stop-color="#F69537"/><stop offset="0.5" stop-color="#FB9E3A"/> +<stop offset="0.7016" stop-color="#EA7C31"/><stop offset="0.8866" stop-color="#DE642B"/> +<stop offset="1.0" stop-color="#D95B29"/> +</linearGradient> +</defs> +<rect width="256" height="256" rx="55" ry="55" x="0" y="0" fill="#CC5D15"/> +<rect width="246" height="246" rx="50" ry="50" x="5" y="5" fill="#F49C52"/> +<rect width="236" height="236" rx="47" ry="47" x="10" y="10" fill="url(#RSSg)"/> +<circle cx="68" cy="189" r="24" fill="#FFF"/> +<path d="M160 213h-34a82 82 0 0 0 -82 -82v-34a116 116 0 0 1 116 116z" fill="#FFF"/> +<path d="M184 213A140 140 0 0 0 44 73 V 38a175 175 0 0 1 175 175z" fill="#FFF"/> +</svg> diff --git a/templates/type-show.html b/templates/type-show.html index 474bebbe6dfe6eaceebc94d3965a5059fb69ec2c..98f16f0a78222dfafdef9f3cf5ad78d7bff4fc72 100644 --- a/templates/type-show.html +++ b/templates/type-show.html @@ -2,6 +2,13 @@ {% from "macros.html" import render_table, render_single_table %} {% block title %}Protokolltyp {{protocoltype.short_name}}{% endblock %} +{% block additional_js %} + <link rel="alternate" type="application/rss+xml" href="{{url_for("feed_protocols_rss", protocoltype_id=protocoltype.id)}}" title="Protokolle" /> + <link rel="alternate" type="application/atom+xml" href="{{url_for("feed_protocols_atom", protocoltype_id=protocoltype.id)}}" title="Protokolle" /> + <link rel="alternate" type="application/rss+xml" href="{{url_for("feed_appointments_rss", protocoltype_id=protocoltype.id)}}" title="Sitzungen" /> + <link rel="alternate" type="application/atom+xml" href="{{url_for("feed_appointments_atom", protocoltype_id=protocoltype.id)}}" title="Sitzungen" /> +{% endblock %} + {% block content %} <div class="container"> {{render_single_table(protocoltype_table)}} diff --git a/views/tables.py b/views/tables.py index 75592bfa8f4c6f635ab46be5dd5d1c55a5547cba..cc1a1d35834f5c877a0c44ff3545e7b83f079be7 100644 --- a/views/tables.py +++ b/views/tables.py @@ -178,9 +178,13 @@ class ProtocolTypeTable(SingleValueTable): calendar_headers = [] network_headers = ["Netzwerke einschränken", "Erlaubte Netzwerke"] action_headers = ["Aktion"] + feed_headers = [] + 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 + action_headers) + + network_headers + feed_headers + action_headers) def row(self): user = current_user() @@ -224,11 +228,24 @@ class ProtocolTypeTable(SingleValueTable): network_part.append(", ".join(map(str.strip, self.value.allowed_networks.split(",")))) else: network_part.append("") + feed_part = [] + if self.value.has_public_anonymous_view_right(): + feed_part = [Markup(", ".join([ + Table.link(url_for("feed_protocols_rss", + protocoltype_id=self.value.id), "Protokolle (RSS)"), + Table.link(url_for("feed_protocols_atom", + protocoltype_id=self.value.id), "Protokolle (Atom)"), + Table.link(url_for("feed_appointments_rss", + protocoltype_id=self.value.id), "Sitzungen (RSS)"), + Table.link(url_for("feed_appointments_atom", + protocoltype_id=self.value.id), "Sitzungen (Atom)"), + ]))] action_part = [Table.link(url_for("delete_type", protocoltype_id=self.value.id), "Löschen", confirm="Bist du dir sicher, dass du den Protokolltype {} löschen möchtest?".format(self.value.name))] 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 + action_part) + + wiki_part + calendar_part + network_part + feed_part + + action_part) class DefaultTOPsTable(Table): def __init__(self, tops, protocoltype=None):