Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
osp
tools.ethertoff
Commits
888dc99f
Commit
888dc99f
authored
Dec 12, 2019
by
gijs
Browse files
Better display of tags and produsers on items.
parent
fe78900b
Changes
7
Hide whitespace changes
Inline
Side-by-side
generator/templates/event-with-programme-items.html
View file @
888dc99f
...
...
@@ -25,18 +25,7 @@
{{ event.location }}
<br
/>
{% endif %}
</p>
{% if event.participant or event.produser %}
<h4>
Participants
</h4>
<p>
{% for produser in event.produser.targets %}
<a
href=
"{{ produser.link }}"
class=
"produser"
>
{{ produser }}
</a>
{% endfor %}
{% for produser in event.produser.targets %}
<a
href=
"{{ produser.link }}"
class=
"produser"
>
{{ produser }}
</a>
{% if not forloop.last %},{% endif %}
{% endfor %}
</p>
{% endif %}
{% with item=event %}{% include "snippets/metadata.html" %}{% endwith %}
</section>
{{ event.summary }}
{{ event.content }}
...
...
@@ -79,21 +68,9 @@
{% endfor %}
</ul>
{% endif %}
{% with item=item %}{% include "snippets/metadata.html" %}{% endwith %}
</li>
{% endfor %}
{% if item.participant or item.produser %}
<h4>
Participants
</h4>
<p>
{% for produser in item.participant %}
<a
href=
"{{ produser.link }}"
class=
"produser"
>
{{ produser }}
</a>
{% if not forloop.last %},{% endif %}
{% endfor %}
{% for produser in item.participant %}
<a
href=
"{{ produser.link }}"
class=
"produser"
>
{{ produser }}
</a>
{% if not forloop.last %},{% endif %}
{% endfor %}
</p>
{% endif %}
{% endfor %}
</ul>
{% endblock %}
\ No newline at end of file
generator/templates/event.html
View file @
888dc99f
...
...
@@ -29,18 +29,7 @@
{% endfor %}
{% endif %}
</p>
{% if event.participant or event.produser %}
<h4>
Participants
</h4>
<p>
{% for produser in event.produser.targets %}
<a
href=
"{{ produser.link }}"
class=
"produser"
>
{{ produser }}
</a>
{% endfor %}
{% for produser in event.produser.targets %}
<a
href=
"{{ produser.link }}"
class=
"produser"
>
{{ produser }}
</a>
{% if not forloop.last %},{% endif %}
{% endfor %}
</p>
{% endif %}
{% with item=event %}{% include "snippets/metadata.html" %}{% endwith %}
</section>
{{ event.summary }}
{{ event.content }}
...
...
generator/templates/page.html
View file @
888dc99f
...
...
@@ -2,6 +2,10 @@
{% block title %}Caveat → events → {{ event.title|striptags }}{% endblock %}
{% if page.image %}
{% block sidebar_image %}{{ page.image }}{% endblock %}
{% endif %}
{% block content %}
<section
class=
"long-text"
>
<h1>
{{ page.title }}
</h1>
...
...
generator/templates/snippets/metadata.html
View file @
888dc99f
{% if item.tags and item.tags.targets %}
{% load generator_utils %}
{% combine_linkfields item.produser item.participant as produser_combined %}
{% if item.tags and item.tags|without_inline_links %}
<section
class=
"item--metadata item--tags"
>
<h4>
Tags
</h4>
<ul
class=
"inlinelist"
>
{% for tag in item.tags
.targets
%}
{% for tag in item.tags
|without_inline_links|link_target_iterator
%}
<li><a
href=
"{{ tag.link }}"
class=
"tag"
>
{{ tag }}
</a></li>
{% endfor %}
</ul>
</section>
{% endif %}
{% if
item.
produser
and item.produser.targets
%}
<section
class=
"item--produsers item--metadata
"
>
{% if produser
_combined
%}
<section
class=
"item--produsers item--metadata"
>
<h4>
Produsers
</h4>
<ul
class=
"inlinelist"
>
{% for produser in
item.
produser
.targets
%}
{% for produser in produser
_combined|link_target_iterator
%}
<li><a
class=
"produser"
href=
"{{ produser.link }}"
>
{{ produser }}
</a></li>
{% endfor %}
{% if item.participant %}
{% for participant in item.participant.targets %}
<li><a
class=
"produser"
href=
"{{ participant.link }}"
>
{{ participant }}
</a></li>
{% endfor %}
{% endif %}
</ul>
</section>
{% endif %}
\ No newline at end of file
generator/templates/static/styles.simple.css
View file @
888dc99f
...
...
@@ -861,7 +861,6 @@ div.footnote > ol > li {
}
sup
:target
,
.footnote
:target:marker
,
.footnote
:target::marker
{
color
:
var
(
--orange-karel
);
}
...
...
generator/templates/tag.html
View file @
888dc99f
...
...
@@ -3,6 +3,11 @@
{% block title %}
Caveat → {{ tag.tag|striptags }}
{% endblock %}
{% if tag.image %}
{% block sidebar_image %}{{ tag.image }}{% endblock %}
{% endif %}
{% block content %}
<nav
class=
"breadcrumbs"
>
<ul>
...
...
generator/templatetags/generator_utils.py
View file @
888dc99f
...
...
@@ -30,4 +30,24 @@ def link_target_iterator (field):
def
cut_from_start
(
value
,
arg
):
print
(
value
)
print
(
'should be removed'
,
arg
)
return
re
.
sub
(
'^'
+
str
(
arg
),
''
,
re
.
I
)
\ No newline at end of file
return
re
.
sub
(
'^'
+
str
(
arg
),
''
,
re
.
I
)
@
register
.
filter
def
without_inline_links
(
field
):
return
list
(
filter
(
lambda
l
:
not
l
.
inline
,
field
))
@
register
.
simple_tag
def
combine_linkfields
(
*
fields
):
combined
=
[]
targets
=
[]
for
field
in
fields
:
if
field
:
for
link
in
field
:
if
link
.
target
not
in
targets
:
combined
.
append
(
link
)
targets
.
append
(
link
.
target
)
return
combined
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment