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

Add links to Feeds

ref #173
parent 8ff2a9d6
No related branches found
No related tags found
No related merge requests found
<?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>
......@@ -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)}}
......
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment