Skip to content
Snippets Groups Projects
Commit 347a93f4 authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

Upgrade to (django) bootstrap 5

Bump django-bootstrap to version 5
Exchange bootstrap files (js & css)
Adapt settings
Migrate to new version/resolve breaking changes
Move layout adaptions previously included in bootstrap.css into custom.css
parent 097569ba
No related branches found
No related tags found
No related merge requests found
Showing
with 45 additions and 42 deletions
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
} }
.dashboard-box { .dashboard-box {
display: block;
padding: 2em; padding: 2em;
margin-right: 1em; margin-right: 1em;
min-width: 15em; min-width: 15em;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
{% load fontawesome_5 %} {% load fontawesome_5 %}
<h2><a href="{% url 'dashboard:dashboard_event' slug=event.slug %}">{{ event.name }}</a></h2> <h2><a href="{% url 'dashboard:dashboard_event' slug=event.slug %}">{{ event.name }}</a></h2>
<div class="row"> <div class="mt-2">
{% if 'AKSubmission'|check_app_installed %} {% if 'AKSubmission'|check_app_installed %}
<a class="dashboard-box btn btn-primary" <a class="dashboard-box btn btn-primary"
href="{% url 'submit:ak_list' event_slug=event.slug %}"> href="{% url 'submit:ak_list' event_slug=event.slug %}">
...@@ -67,4 +67,3 @@ ...@@ -67,4 +67,3 @@
</a> </a>
{% endfor %} {% endfor %}
</div> </div>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{% load tags_AKModel %} {% load tags_AKModel %}
{% load i18n %} {% load i18n %}
{% load bootstrap4 %} {% load django_bootstrap5 %}
{% load fontawesome_5 %} {% load fontawesome_5 %}
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<form method="post">{% csrf_token %} <form method="post">{% csrf_token %}
{% bootstrap_form form %} {% bootstrap_form form %}
<div class="float-right"> <div class="float-end">
<button type="submit" class="save btn btn-success" value="Submit"> <button type="submit" class="save btn btn-success" value="Submit">
{% fa5_icon "check" 'fas' %} {% trans "Confirm" %} {% fa5_icon "check" 'fas' %} {% trans "Confirm" %}
</button> </button>
......
...@@ -2,12 +2,13 @@ ...@@ -2,12 +2,13 @@
{% load tags_AKModel %} {% load tags_AKModel %}
{% load i18n admin_urls %} {% load i18n admin_urls %}
{% load static %} {% load static %}
{% load bootstrap4 %} {% load django_bootstrap5 %}
{% load tz %} {% load tz %}
{% block extrahead %} {% block extrahead %}
{{ block.super }} {{ block.super }}
{% bootstrap_javascript jquery='slim' %} {% bootstrap_javascript %}
<script src="{% static 'common/vendor/jquery/jquery-3.3.1.min.js' %}"></script>
{% include "AKModel/load_fullcalendar_availabilities.html" %} {% include "AKModel/load_fullcalendar_availabilities.html" %}
<script> <script>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{% load tags_AKModel %} {% load tags_AKModel %}
{% load i18n %} {% load i18n %}
{% load bootstrap4 %} {% load django_bootstrap5 %}
{% load fontawesome_5 %} {% load fontawesome_5 %}
{% load tz %} {% load tz %}
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<form method="post">{% csrf_token %} <form method="post">{% csrf_token %}
{% bootstrap_form form %} {% bootstrap_form form %}
<div class="float-right"> <div class="float-end">
<button type="submit" class="save btn btn-success" value="Submit"> <button type="submit" class="save btn btn-success" value="Submit">
{% fa5_icon "check" 'fas' %} {% trans "Finish" %} {% fa5_icon "check" 'fas' %} {% trans "Finish" %}
</button> </button>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{% load tags_AKModel %} {% load tags_AKModel %}
{% load i18n %} {% load i18n %}
{% load bootstrap4 %} {% load django_bootstrap5 %}
{% load fontawesome_5 %} {% load fontawesome_5 %}
{% load tz %} {% load tz %}
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<form method="post">{% csrf_token %} <form method="post">{% csrf_token %}
{% bootstrap_form form %} {% bootstrap_form form %}
<div class="float-right"> <div class="float-end">
<a href="{% url 'admin:new_event_wizard_activate' event.slug %}" class="btn btn-info"> <a href="{% url 'admin:new_event_wizard_activate' event.slug %}" class="btn btn-info">
{% fa5_icon "forward" 'fas' %} {% trans "Skip Import" %} {% fa5_icon "forward" 'fas' %} {% trans "Skip Import" %}
</a> </a>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{% load tags_AKModel %} {% load tags_AKModel %}
{% load i18n %} {% load i18n %}
{% load bootstrap4 %} {% load django_bootstrap5 %}
{% load fontawesome_5 %} {% load fontawesome_5 %}
{% load tz %} {% load tz %}
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<h5>{% trans "Congratulations. Everything is set up!" %}</h5> <h5>{% trans "Congratulations. Everything is set up!" %}</h5>
<a href="{% url 'admin:event_status' event.slug %}" class="btn btn-info float-right"> <a href="{% url 'admin:event_status' event.slug %}" class="btn btn-info float-end">
{% fa5_icon "info" 'fas' %}&nbsp;{% trans "Status" %} {% fa5_icon "info" 'fas' %}&nbsp;{% trans "Status" %}
</a> </a>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{% load tags_AKModel %} {% load tags_AKModel %}
{% load i18n %} {% load i18n %}
{% load bootstrap4 %} {% load django_bootstrap5 %}
{% load fontawesome_5 %} {% load fontawesome_5 %}
{% load tz %} {% load tz %}
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<form method="post">{% csrf_token %} <form method="post">{% csrf_token %}
{% bootstrap_form form %} {% bootstrap_form form %}
<button type="submit" class="save btn btn-success float-right" value="Submit"> <button type="submit" class="save btn btn-success float-end" value="Submit">
{% fa5_icon "check" 'fas' %} {% trans "Continue" %} {% fa5_icon "check" 'fas' %} {% trans "Continue" %}
</button> </button>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{% load tags_AKModel %} {% load tags_AKModel %}
{% load i18n %} {% load i18n %}
{% load bootstrap4 %} {% load django_bootstrap5 %}
{% load fontawesome_5 %} {% load fontawesome_5 %}
{% load tz %} {% load tz %}
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<form method="post">{% csrf_token %} <form method="post">{% csrf_token %}
{% bootstrap_form form %} {% bootstrap_form form %}
<button type="submit" class="save btn btn-success float-right" value="Submit"> <button type="submit" class="save btn btn-success float-end" value="Submit">
{% fa5_icon "check" 'fas' %} {% trans "Continue" %} {% fa5_icon "check" 'fas' %} {% trans "Continue" %}
</button> </button>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{% load tags_AKModel %} {% load tags_AKModel %}
{% load i18n %} {% load i18n %}
{% load bootstrap4 %} {% load django_bootstrap5 %}
{% load fontawesome_5 %} {% load fontawesome_5 %}
{% block title %}{% trans "New event wizard" %}: {{ wizard_step_text }}{% endblock %} {% block title %}{% trans "New event wizard" %}: {{ wizard_step_text }}{% endblock %}
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<form method="post" action="{% url 'admin:new_event_wizard_settings' %}">{% csrf_token %} <form method="post" action="{% url 'admin:new_event_wizard_settings' %}">{% csrf_token %}
{% bootstrap_form form %} {% bootstrap_form form %}
<button type="submit" class="save btn btn-success float-right" value="Submit"> <button type="submit" class="save btn btn-success float-end" value="Submit">
{% fa5_icon "check" 'fas' %} {% trans "Continue" %} {% fa5_icon "check" 'fas' %} {% trans "Continue" %}
</button> </button>
......
<table class="table table-striped"> <table class="table table-striped">
{% for message in ak_messages %} {% for message in ak_messages %}
<tr><td> <tr><td>
<span class="text-secondary float-right"> <span class="text-secondary float-end">
{{ message.timestamp|date:"Y-m-d H:i:s" }} {{ message.timestamp|date:"Y-m-d H:i:s" }}
</span> </span>
<h5><a href="{% url 'submit:ak_detail' event_slug=message.ak.event.slug pk=message.ak.pk %}">{{ message.ak }}</a></h5> <h5><a href="{% url 'submit:ak_detail' event_slug=message.ak.event.slug pk=message.ak.pk %}">{{ message.ak }}</a></h5>
......
...@@ -22,12 +22,12 @@ ...@@ -22,12 +22,12 @@
<tr> <tr>
<td>{{ ak }}</td> <td>{{ ak }}</td>
{% if "AKSubmission"|check_app_installed %} {% if "AKSubmission"|check_app_installed %}
<td class="text-right"> <td class="text-end">
<a href="{% url 'submit:ak_detail' event_slug=ak.event.slug pk=ak.pk %}" data-toggle="tooltip" <a href="{% url 'submit:ak_detail' event_slug=ak.event.slug pk=ak.pk %}" data-bs-toggle="tooltip"
title="{% trans 'Details' %}" title="{% trans 'Details' %}"
class="btn btn-primary">{% fa5_icon 'info' 'fas' %}</a> class="btn btn-primary">{% fa5_icon 'info' 'fas' %}</a>
{% if event.active %} {% if event.active %}
<a href="{% url 'submit:ak_edit' event_slug=event.slug pk=ak.pk %}" data-toggle="tooltip" <a href="{% url 'submit:ak_edit' event_slug=event.slug pk=ak.pk %}" data-bs-toggle="tooltip"
title="{% trans 'Edit' %}" title="{% trans 'Edit' %}"
class="btn btn-success">{% fa5_icon 'pencil-alt' 'fas' %}</a> class="btn btn-success">{% fa5_icon 'pencil-alt' 'fas' %}</a>
{% endif %} {% endif %}
......
{% extends "admin/change_form.html" %} {% extends "admin/change_form.html" %}
{% load i18n admin_urls %} {% load i18n admin_urls %}
{% load static %} {% load static %}
{% load bootstrap4 %} {% load django_bootstrap5 %}
{% load tz %} {% load tz %}
{% block extrahead %} {% block extrahead %}
{{ block.super }} {{ block.super }}
{% bootstrap_javascript jquery='slim' %} {% bootstrap_javascript %}
<script src="{% static 'common/vendor/jquery/jquery-3.3.1.min.js' %}"></script>
{% if original.event %} {% if original.event %}
{% include "AKModel/load_fullcalendar_availabilities.html" %} {% include "AKModel/load_fullcalendar_availabilities.html" %}
......
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
<h2><a href="{% url 'admin:AKModel_event_change' event.pk %}">{{event}}</a></h2> <h2><a href="{% url 'admin:AKModel_event_change' event.pk %}">{{event}}</a></h2>
<h5>{{ event.start }} - {{ event.end }}</h5> <h5>{{ event.start }} - {{ event.end }}</h5>
<div class="custom-control custom-switch mt-2 mb-2"> <div class="form-check form-switch mt-2 mb-2">
<input type="checkbox" class="custom-control-input" id="planPublishedSwitch" <input type="checkbox" class="form-check-input" id="planPublishedSwitch"
{% if not event.plan_hidden %}checked{% endif %} {% if not event.plan_hidden %}checked{% endif %}
onclick="location.href='{% if event.plan_hidden %}{% url 'admin:plan-publish' %}{% else %}{% url 'admin:plan-unpublish' %}{% endif %}?pks={{event.pk}}';"> onclick="location.href='{% if event.plan_hidden %}{% url 'admin:plan-publish' %}{% else %}{% url 'admin:plan-unpublish' %}{% endif %}?pks={{event.pk}}';">
<label class="custom-control-label" for="planPublishedSwitch">{% trans "Plan published?" %}</label> <label class="form-check-label" for="planPublishedSwitch">{% trans "Plan published?" %}</label>
</div> </div>
<div class="row"> <div class="row">
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
href="{% url 'admin:schedule' event_slug=event.slug %}">{% trans "Scheduling" %}</a> href="{% url 'admin:schedule' event_slug=event.slug %}">{% trans "Scheduling" %}</a>
{% if "AKScheduling | is_installed" %} {% if "AKScheduling | is_installed" %}
<a class="btn btn-success" <a class="btn btn-success"
href="{% url 'admin:constraint-violations' slug=event.slug %}">{% trans "Constraint Violations" %} <span class="badge badge-secondary">{{ event.constraintviolation_set.count }}</span></a> href="{% url 'admin:constraint-violations' slug=event.slug %}">{% trans "Constraint Violations" %} <span class="badge bg-secondary">{{ event.constraintviolation_set.count }}</span></a>
<a class="btn btn-success" <a class="btn btn-success"
href="{% url 'admin:special-attention' slug=event.slug %}">{% trans "AKs requiring special attention" %}</a> href="{% url 'admin:special-attention' slug=event.slug %}">{% trans "AKs requiring special attention" %}</a>
<a class="btn btn-success" <a class="btn btn-success"
......
...@@ -76,9 +76,12 @@ class BasicViewTests: ...@@ -76,9 +76,12 @@ class BasicViewTests:
self.client.force_login(self.staff_user) self.client.force_login(self.staff_user)
for view_name in self.VIEWS_STAFF_ONLY: for view_name in self.VIEWS_STAFF_ONLY:
view_name_with_prefix, url = self._name_and_url(view_name) view_name_with_prefix, url = self._name_and_url(view_name)
response = self.client.get(url) try:
self.assertEqual(response.status_code, 200, response = self.client.get(url)
msg=f"{view_name_with_prefix} ({url}) should be accessible for staff (but isn't)") self.assertEqual(response.status_code, 200,
msg=f"{view_name_with_prefix} ({url}) should be accessible for staff (but isn't)")
except Exception as e:
self.fail(f"An error occurred during rendering of {view_name_with_prefix} ({url}):\n\n{traceback.format_exc()}")
self.client.force_login(self.deactivated_user) self.client.force_login(self.deactivated_user)
for view_name in self.VIEWS_STAFF_ONLY: for view_name in self.VIEWS_STAFF_ONLY:
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
// No header, not buttons // No header, not buttons
headerToolbar: false, headerToolbar: false,
aspectRatio: 2.5, aspectRatio: 2.5,
themeSystem: 'bootstrap', themeSystem: 'bootstrap5',
// Only show calendar view for the dates of the connected event // Only show calendar view for the dates of the connected event
visibleRange: { visibleRange: {
start: '{{ ak.event.start | timezone:ak.event.timezone | date:"Y-m-d H:i:s" }}', start: '{{ ak.event.start | timezone:ak.event.timezone | date:"Y-m-d H:i:s" }}',
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
right: '' right: ''
}, },
aspectRatio: 2, aspectRatio: 2,
themeSystem: 'bootstrap', themeSystem: 'bootstrap5',
// Only show calendar view for the dates of the connected event // Only show calendar view for the dates of the connected event
visibleRange: { visibleRange: {
start: '{{ event.start | timezone:event.timezone | date:"Y-m-d H:i:s" }}', start: '{{ event.start | timezone:event.timezone | date:"Y-m-d H:i:s" }}',
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
center: 'title', center: 'title',
right: 'resourceTimelineDay,resourceTimelineEvent' right: 'resourceTimelineDay,resourceTimelineEvent'
}, },
themeSystem: 'bootstrap', themeSystem: 'bootstrap5',
// Adapt to user selected locale // Adapt to user selected locale
locale: '{{ LANGUAGE_CODE }}', locale: '{{ LANGUAGE_CODE }}',
initialView: 'resourceTimelineEvent', initialView: 'resourceTimelineEvent',
...@@ -79,11 +79,11 @@ ...@@ -79,11 +79,11 @@
{% block content %} {% block content %}
<div class="float-right"> <div class="float-end">
<ul class="nav nav-pills"> <ul class="nav nav-pills">
{% if rooms|length > 0 %} {% if rooms|length > 0 %}
<li class="nav-item dropdown"> <li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button"
aria-haspopup="true" aria-haspopup="true"
aria-expanded="false">{% trans "Rooms" %}</a> aria-expanded="false">{% trans "Rooms" %}</a>
<div class="dropdown-menu" style=""> <div class="dropdown-menu" style="">
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
{% endif %} {% endif %}
{% if tracks|length > 0 %} {% if tracks|length > 0 %}
<li class="nav-item dropdown"> <li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button"
aria-haspopup="true" aria-haspopup="true"
aria-expanded="false">{% trans "Tracks" %}</a> aria-expanded="false">{% trans "Tracks" %}</a>
<div class="dropdown-menu"> <div class="dropdown-menu">
......
...@@ -43,10 +43,10 @@ ...@@ -43,10 +43,10 @@
{% block content %} {% block content %}
<div class="float-right"> <div class="float-end">
<ul class="nav nav-pills"> <ul class="nav nav-pills">
<li class="nav-item dropdown"> <li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">{% trans "Rooms" %}</a> <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">{% trans "Rooms" %}</a>
<div class="dropdown-menu" style=""> <div class="dropdown-menu" style="">
{% for r in event.room_set.all %} {% for r in event.room_set.all %}
<a class="dropdown-item" href="{% url "plan:plan_room" event_slug=event.slug pk=r.pk %}">{{ r }}</a> <a class="dropdown-item" href="{% url "plan:plan_room" event_slug=event.slug pk=r.pk %}">{{ r }}</a>
......
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
{% block content %} {% block content %}
<div class="float-right"> <div class="float-end">
<ul class="nav nav-pills"> <ul class="nav nav-pills">
<li class="nav-item dropdown"> <li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">{% trans "Tracks" %}</a> <a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">{% trans "Tracks" %}</a>
<div class="dropdown-menu"> <div class="dropdown-menu">
{% for t in event.aktrack_set.all %} {% for t in event.aktrack_set.all %}
<a class="dropdown-item" href="{% url "plan:plan_track" event_slug=event.slug pk=t.pk %}">{{ t }}</a> <a class="dropdown-item" href="{% url "plan:plan_track" event_slug=event.slug pk=t.pk %}">{{ t }}</a>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment