Commit 28dcf705 authored by dario's avatar dario

web/templates/list_common: indicate internal-only pdfs

parent afafec7d
{% macro single_entry(entry, edit) %}
<li style="margin-right: 20px;">
{% if entry.comment %}
{% if entry.you_are_external %}
<!-- TODO: onmouseover disallow-cursor -->
<a>
{% elif entry.comment %}
<a href="/show/{{entry.id}}/">
{%- else -%}
<a href="{{entry.pdf_url}}" download="{{entry.semester.1|e}}{{"%02d"|format(entry.semester.0)|e}} - {{entry.lecture|e}} - {{entry.lecture_type|capitalize|e}} - {{entry.name|e}}.pdf">
......@@ -8,6 +11,9 @@
{{ caller() }}
{% if edit == False %}
(<a style="display:inline; border: none;" href="{{entry|univislink|escape}}"><img src="https://univis.uni-erlangen.de/img/anew/univis_96_20.gif" alt="UnivIS" style="height: .8em;" /></a>)
{% if entry.you_are_external %}
<span class="state">[nur intern]</span>
{% endif %}
{% else %}
<span class="state"><a style="display:inline; border: none; background: none;" href="{{moddir}}/edit/{{entry.id}}">Editieren</a></span>
{% endif %}
......
......@@ -55,6 +55,7 @@ def overview(request, edit):
searchAttributes = config.searchableAttributes
pageEntries = OrderedDict()
is_internal = remote_is_internal_network(request)
for entry in public_pdf_db.orderBy(entryAttribute, comparator=entryOrderBy):
if not searchAttributes == None:
......@@ -83,6 +84,10 @@ def overview(request, edit):
if not searchHit:
continue
if entry.metadata.get('internal_net_only', False) and not \
is_internal:
entry["you_are_external"] = True
key = entry[entryAttribute]
if "semester" == entryAttribute:
key = "%s%02d" % (key[1], key[0])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment