manager: add a "Today" button (#72326)
gitea-wip/chrono/pipeline/pr-main This commit looks good
Details
gitea-wip/chrono/pipeline/pr-main This commit looks good
Details
This commit is contained in:
parent
09a2f58807
commit
953118188d
|
@ -16,7 +16,7 @@
|
|||
</ul>
|
||||
{% endif %}
|
||||
{{ block.super }}
|
||||
<a href="{% url 'chrono-manager-agenda-month-redirect-view' pk=agenda.pk %}">{% trans 'Month view' %}</a>
|
||||
{% include "chrono/manager_agenda_view_buttons_fragment.html" with no_today=True no_opened=True %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
{% load i18n %}
|
||||
{% now "Y" as today_year %}
|
||||
{% now "m" as today_month %}
|
||||
{% now "j" as today_day %}
|
||||
{% if not no_opened and agenda.kind == 'events' %}
|
||||
<a href="{% url 'chrono-manager-agenda-open-events-view' pk=agenda.pk %}">{% trans 'Open events' %}</a>
|
||||
{% endif %}
|
||||
{% if not no_today %}
|
||||
<a href="{% url 'chrono-manager-agenda-day-view' pk=agenda.pk year=today_year month=today_month day=today_day %}">{% trans 'Today' %}</a>
|
||||
{% endif %}
|
||||
<span class="buttons-group">
|
||||
<a {% if active == 'day' %}class="active"{% endif%} href="{% url 'chrono-manager-agenda-day-view' pk=agenda.pk year=view.date|date:"Y"|default:today_year|default:today_year month=view.date|date:"m"|default:today_month day=view.date|date:"d"|default:today_day %}">{% trans 'Day' %}</a>
|
||||
<a {% if active == 'week' %}class="active"{% endif%} href="{% url 'chrono-manager-agenda-week-view' pk=agenda.pk year=view.date|date:"Y"|default:today_year|default:today_year month=view.date|date:"m"|default:today_month day=view.date|date:"d"|default:today_day %}">{% trans 'Week' %}</a>
|
||||
<a {% if active == 'month' %}class="active"{% endif%} href="{% url 'chrono-manager-agenda-month-view' pk=agenda.pk year=view.date|date:"Y"|default:today_year|default:today_year month=view.date|date:"m"|default:today_month day=view.date|date:"d"|default:today_day %}">{% trans 'Month' %}</a>
|
||||
</span>
|
|
@ -10,13 +10,7 @@
|
|||
{% endif %}
|
||||
</ul>
|
||||
{{ block.super }}
|
||||
<a href="{% url 'chrono-manager-agenda-open-events-view' pk=agenda.pk %}">{% trans 'Open events' %}</a>
|
||||
|
||||
<span class="buttons-group">
|
||||
<a class="active" href="{% url 'chrono-manager-agenda-day-view' pk=agenda.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Day' %}</a>
|
||||
<a href="{% url 'chrono-manager-agenda-week-view' pk=agenda.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Week' %}</a>
|
||||
<a href="{% url 'chrono-manager-agenda-month-view' pk=agenda.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Month' %}</a>
|
||||
</span>
|
||||
{% include "chrono/manager_agenda_view_buttons_fragment.html" with active='day' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
|
|
@ -10,13 +10,7 @@
|
|||
{% endif %}
|
||||
</ul>
|
||||
{{ block.super }}
|
||||
<a href="{% url 'chrono-manager-agenda-open-events-view' pk=agenda.pk %}">{% trans 'Open events' %}</a>
|
||||
|
||||
<span class="buttons-group">
|
||||
<a href="{% url 'chrono-manager-agenda-day-view' pk=agenda.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Day' %}</a>
|
||||
<a href="{% url 'chrono-manager-agenda-week-view' pk=agenda.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Week' %}</a>
|
||||
<a class="active" href="{% url 'chrono-manager-agenda-month-view' pk=agenda.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Month' %}</a>
|
||||
</span>
|
||||
{% include "chrono/manager_agenda_view_buttons_fragment.html" with active='month' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
|
|
@ -10,13 +10,7 @@
|
|||
{% endif %}
|
||||
</ul>
|
||||
{{ block.super }}
|
||||
<a href="{% url 'chrono-manager-agenda-open-events-view' pk=agenda.pk %}">{% trans 'Open events' %}</a>
|
||||
|
||||
<span class="buttons-group">
|
||||
<a href="{% url 'chrono-manager-agenda-day-view' pk=agenda.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Day' %}</a>
|
||||
<a class="active" href="{% url 'chrono-manager-agenda-week-view' pk=agenda.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Week' %}</a>
|
||||
<a href="{% url 'chrono-manager-agenda-month-view' pk=agenda.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Month' %}</a>
|
||||
</span>
|
||||
{% include "chrono/manager_agenda_view_buttons_fragment.html" with active='week' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
|
|
@ -3,11 +3,7 @@
|
|||
|
||||
{% block actions %}
|
||||
{{ block.super }}
|
||||
<span class="buttons-group">
|
||||
<a class="active" href="{% url 'chrono-manager-agenda-day-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Day' %}</a>
|
||||
<a href="{% url 'chrono-manager-agenda-week-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Week' %}</a>
|
||||
<a href="{% url 'chrono-manager-agenda-month-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Month' %}</a>
|
||||
</span>
|
||||
{% include "chrono/manager_agenda_view_buttons_fragment.html" with active='day' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
|
|
@ -3,11 +3,7 @@
|
|||
|
||||
{% block actions %}
|
||||
{{ block.super }}
|
||||
<span class="buttons-group">
|
||||
<a href="{% url 'chrono-manager-agenda-day-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Day' %}</a>
|
||||
<a href="{% url 'chrono-manager-agenda-week-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Week' %}</a>
|
||||
<a class="active" href="{% url 'chrono-manager-agenda-month-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Month' %}</a>
|
||||
</span>
|
||||
{% include "chrono/manager_agenda_view_buttons_fragment.html" with active='month' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
|
|
@ -3,11 +3,7 @@
|
|||
|
||||
{% block actions %}
|
||||
{{ block.super }}
|
||||
<span class="buttons-group">
|
||||
<a href="{% url 'chrono-manager-agenda-day-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Day' %}</a>
|
||||
<a class="active" href="{% url 'chrono-manager-agenda-week-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Week' %}</a>
|
||||
<a href="{% url 'chrono-manager-agenda-month-view' pk=agenda.id year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Month' %}</a>
|
||||
</span>
|
||||
{% include "chrono/manager_agenda_view_buttons_fragment.html" with active='week' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
|
|
@ -25,11 +25,7 @@
|
|||
</h2>
|
||||
{% endblock %}
|
||||
{% block appbar-extras %}
|
||||
<span class="buttons-group">
|
||||
<a class="active" href="{% url 'chrono-manager-resource-day-view' pk=resource.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Day' %}</a>
|
||||
<a href="{% url 'chrono-manager-resource-week-view' pk=resource.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Week' %}</a>
|
||||
<a href="{% url 'chrono-manager-resource-month-view' pk=resource.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Month' %}</a>
|
||||
</span>
|
||||
{% include "chrono/manager_resource_view_buttons_fragment.html" with active='day' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
|
|
@ -20,12 +20,7 @@
|
|||
<a rel="popup" href="{% url 'chrono-manager-resource-edit' pk=resource.pk %}">{% trans 'Edit' %}</a>
|
||||
<a rel="popup" href="{% url 'chrono-manager-resource-delete' pk=resource.pk %}">{% trans 'Delete' %}</a>
|
||||
{% endif %}
|
||||
{% now "Y" as today_year %}
|
||||
{% now "m" as today_month %}
|
||||
{% now "j" as today_day %}
|
||||
<a href="{% url 'chrono-manager-resource-month-view' pk=resource.pk year=today_year month=today_month day=today_day %}">{% trans 'Month view' %}</a>
|
||||
<a href="{% url 'chrono-manager-resource-week-view' pk=resource.pk year=today_year month=today_month day=today_day %}">{% trans 'Week view' %}</a>
|
||||
<a href="{% url 'chrono-manager-resource-day-view' pk=resource.pk year=today_year month=today_month day=today_day %}">{% trans 'Day view' %}</a>
|
||||
{% include "chrono/manager_resource_view_buttons_fragment.html" with no_today=True no_opened=True %}
|
||||
{% endblock %}
|
||||
</span>
|
||||
{% endblock %}
|
||||
|
|
|
@ -26,11 +26,7 @@
|
|||
</h2>
|
||||
{% endblock %}
|
||||
{% block appbar-extras %}
|
||||
<span class="buttons-group">
|
||||
<a href="{% url 'chrono-manager-resource-day-view' pk=resource.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Day' %}</a>
|
||||
<a href="{% url 'chrono-manager-resource-week-view' pk=resource.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Week' %}</a>
|
||||
<a class="active" href="{% url 'chrono-manager-resource-month-view' pk=resource.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Month' %}</a>
|
||||
</span>
|
||||
{% include "chrono/manager_resource_view_buttons_fragment.html" with active='month' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
{% load i18n %}
|
||||
{% now "Y" as today_year %}
|
||||
{% now "m" as today_month %}
|
||||
{% now "j" as today_day %}
|
||||
{% if not no_today %}
|
||||
<a href="{% url 'chrono-manager-resource-day-view' pk=resource.pk year=today_year month=today_month day=today_day %}">{% trans 'Today' %}</a>
|
||||
{% endif %}
|
||||
<span class="buttons-group">
|
||||
<a {% if active == 'day' %}class="active"{% endif%} href="{% url 'chrono-manager-resource-day-view' pk=resource.pk year=view.date|date:"Y"|default:today_year|default:today_year month=view.date|date:"m"|default:today_month day=view.date|date:"d"|default:today_day %}">{% trans 'Day' %}</a>
|
||||
<a {% if active == 'week' %}class="active"{% endif%} href="{% url 'chrono-manager-resource-week-view' pk=resource.pk year=view.date|date:"Y"|default:today_year|default:today_year month=view.date|date:"m"|default:today_month day=view.date|date:"d"|default:today_day %}">{% trans 'Week' %}</a>
|
||||
<a {% if active == 'month' %}class="active"{% endif%} href="{% url 'chrono-manager-resource-month-view' pk=resource.pk year=view.date|date:"Y"|default:today_year|default:today_year month=view.date|date:"m"|default:today_month day=view.date|date:"d"|default:today_day %}">{% trans 'Month' %}</a>
|
||||
</span>
|
|
@ -53,11 +53,7 @@
|
|||
</h2>
|
||||
{% endblock %}
|
||||
{% block appbar-extras %}
|
||||
<span class="buttons-group">
|
||||
<a href="{% url 'chrono-manager-resource-day-view' pk=resource.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Day' %}</a>
|
||||
<a class="active" href="{% url 'chrono-manager-resource-week-view' pk=resource.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Week' %}</a>
|
||||
<a href="{% url 'chrono-manager-resource-month-view' pk=resource.pk year=view.date|date:"Y" month=view.date|date:"m" day=view.date|date:"d" %}">{% trans 'Month' %}</a>
|
||||
</span>
|
||||
{% include "chrono/manager_resource_view_buttons_fragment.html" with active='week' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
|
|
@ -1453,7 +1453,9 @@ def test_agenda_open_events_view(app, admin_user, manager_user):
|
|||
assert 'Open events' in resp.text
|
||||
|
||||
resp = app.get('/manage/agendas/%s/events/open/' % agenda.pk)
|
||||
assert 'Month view' in resp.text
|
||||
assert '>Month<' in resp.text
|
||||
assert '>Week<' in resp.text
|
||||
assert '>Day<' in resp.text
|
||||
assert "This agenda doesn't have any open event configured." in resp.text
|
||||
|
||||
# create some events
|
||||
|
|
Loading…
Reference in New Issue