Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hub
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
thomasDOTwtf
hub
Commits
a6a61ddc
Commit
a6a61ddc
authored
Aug 16, 2023
by
Roang
Browse files
Options
Downloads
Plain Diff
Merge branch 'weeman/event-now-anchor' into 'develop'
Anker für aktuelles Event See merge request
hub/hub!680
parents
274f7861
e971eb26
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plainui/jinja2/plainui/components/list_events.html
+28
-13
28 additions, 13 deletions
src/plainui/jinja2/plainui/components/list_events.html
src/plainui/jinja2/plainui/fahrplan.html
+1
-1
1 addition, 1 deletion
src/plainui/jinja2/plainui/fahrplan.html
with
29 additions
and
14 deletions
src/plainui/jinja2/plainui/components/list_events.html
+
28
−
13
View file @
a6a61ddc
...
@@ -10,11 +10,30 @@
...
@@ -10,11 +10,30 @@
{% macro list(events, my_favorite_events, my_scheduled_events, assembly_slug=None, msg_none=_("No entries available.")) -%}
{% macro list(events, my_favorite_events, my_scheduled_events, assembly_slug=None, msg_none=_("No entries available.")) -%}
{% if events %}
{% if events %}
<ul
class=
"list-unstyled d-flex flex-column gap-3 mb-0"
>
<ul
class=
"list-unstyled d-flex flex-column gap-3 mb-0"
>
{# using a list here to be able to set a value in the nested block #}
{% set first_now_done = [] %}
{% for event in events %}
{% for event in events %}
{{ list_el( event,
{% if event.schedule_end
<
now
%}
{%
set
event_when =
'past'
%}
{%
elif
event.schedule_start
>
now %}
{% set event_when = 'upcoming' %}
{% else %}
{% set event_when = 'now' %}
{% endif %}
{{ list_el(
event,
faved=true if event.id | safe in my_favorite_events,
faved=true if event.id | safe in my_favorite_events,
scheduled=true if event.id | safe in my_scheduled_events,
scheduled=true if event.id | safe in my_scheduled_events,
first=loop.first ) }}
first=loop.first,
event_when=event_when,
first_now=true if event_when == 'now' and not first_now_done[0]
) }}
{% if when == 'now' and not first_now_done[0] %}
{% set ignore = first_now_done.append(True) %}
{% endif %}
{% endfor %}
{% endfor %}
</ul>
</ul>
{% else %}
{% else %}
...
@@ -22,17 +41,13 @@
...
@@ -22,17 +41,13 @@
{% endif %}
{% endif %}
{%- endmacro %}
{%- endmacro %}
{% macro list_el(event, faved, scheduled, first) -%}
{% macro list_el(event, faved, scheduled, first
, event_when, first_now
) -%}
{% set link = url('plainui:event', event_slug=event.slug ) %}
{% set link = url('plainui:event', event_slug=event.slug ) %}
{% set color="transparent" if event.kind == "official" else "transparent" %}
{% set color="transparent" if event.kind == "official" else "transparent" %}
{% set is_past = event.schedule_end
<
now
%}
{%
set
is_upcomping =
event.schedule_start
>
now %}
{% set is_now = not is_past and not is_upcomping %}
<li
<li
class=
"hub-event rounded-3 px-3 py-2
class=
"hub-event rounded-3 px-3 py-2 hub-event--{{ event_when }}"
{% if is_past %}hub-event--past{% endif %}
{%
if
first_now
%}
id=
"now"
{%
endif
%}
{% if is_upcomping %}hub-event--upcoming{% endif %}"
>
>
<div
class=
"hub-event__day"
>
<div
class=
"hub-event__day"
>
{{ _(event.schedule_start | weekday_abbrev) }}
{{ _(event.schedule_start | weekday_abbrev) }}
...
@@ -47,7 +62,7 @@
...
@@ -47,7 +62,7 @@
{{ event.name }}
{{ event.name }}
</div>
</div>
</a>
</a>
{% if
is_
now %}
{% if
event_when == '
now
'
%}
<div
class=
"hub-event__now"
>
<div
class=
"hub-event__now"
>
{{ _('NOW') }}
{{ _('NOW') }}
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
src/plainui/jinja2/plainui/fahrplan.html
+
1
−
1
View file @
a6a61ddc
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
<a
href=
"#"
class=
"btn m-2"
>
{{ _("QR-Code") }}
</a>
<a
href=
"#"
class=
"btn m-2"
>
{{ _("QR-Code") }}
</a>
</div>
#}
</div>
#}
<form
method=
"GET"
class=
"p-3 mb-2 hub-fahrplan__filter-block bg-black"
>
<form
method=
"GET"
action=
"#now"
class=
"p-3 mb-2 hub-fahrplan__filter-block bg-black"
>
<input
type=
"hidden"
name=
"mode"
value=
"{{mode}}"
>
<input
type=
"hidden"
name=
"mode"
value=
"{{mode}}"
>
{% if show_day_filters %}
<input
type=
"hidden"
name=
"show_day_filters"
value=
"y"
>
{% endif %}
{% if show_day_filters %}
<input
type=
"hidden"
name=
"show_day_filters"
value=
"y"
>
{% endif %}
{% if show_assembly_filters %}
<input
type=
"hidden"
name=
"show_assembly_filters"
value=
"y"
>
{% endif %}
{% if show_assembly_filters %}
<input
type=
"hidden"
name=
"show_assembly_filters"
value=
"y"
>
{% endif %}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment