Skip to content
Snippets Groups Projects
Commit 63f87294 authored by Nadja Geisler's avatar Nadja Geisler :sunny:
Browse files

Merge branch 'dashboard-custom-buttons' into 'master'

Dashboard custom buttons

Closes #17

See merge request !9
parents 4fd99300 c30e8dca
No related branches found
No related tags found
1 merge request!9Dashboard custom buttons
Showing
with 194 additions and 63 deletions
# Register your models here. from django.contrib import admin
from AKDashboard.models import DashboardButton
@admin.register(DashboardButton)
class DashboardButtonAdmin(admin.ModelAdmin):
list_display = ['text', 'url', 'event']
list_filter = ['event']
search_fields = ['text', 'url']
list_display_links = ['text']
...@@ -8,7 +8,7 @@ msgid "" ...@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-01-09 00:07+0000\n" "POT-Creation-Date: 2020-01-13 11:43+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
...@@ -17,26 +17,73 @@ msgstr "" ...@@ -17,26 +17,73 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: models.py:10
msgid "Dashboard Button"
msgstr "Dashboard-Button"
#: models.py:11
msgid "Dashboard Buttons"
msgstr "Dashboard-Buttons"
#: models.py:21
msgid "Text"
msgstr "Text"
#: models.py:22
msgid "Text that will be shown on the button"
msgstr "Text, der auf dem Button angezeigt wird"
#: models.py:23
msgid "Link URL"
msgstr "Link URL"
#: models.py:23
msgid "URL this button links to"
msgstr "URL auf die der Button verweist"
#: models.py:24
msgid "Icon"
msgstr "Symbol"
#: models.py:26
msgid "Button Style"
msgstr "Stil des Buttons"
#: models.py:26
msgid "Style (Color) of this button (bootstrap class)"
msgstr "Stiel (Farbe) des Buttons (Bootstrap-Klasse)"
#: models.py:28
msgid "Event"
msgstr "Veranstaltung"
#: models.py:28
msgid "Event this button belongs to"
msgstr "Veranstaltung, zu der dieser Button gehört"
#: templates/AKDashboard/dashboard.html:31 #: templates/AKDashboard/dashboard.html:31
msgid "Current AKs" msgid "Current AKs"
msgstr "Aktuelle AKs" msgstr "Aktuelle AKs"
#: templates/AKDashboard/dashboard.html:36 #: templates/AKDashboard/dashboard.html:38
msgid "AK Wall" msgid "AK Wall"
msgstr "AK-Wall" msgstr "AK-Wall"
#: templates/AKDashboard/dashboard.html:44 #: templates/AKDashboard/dashboard.html:47
msgid "AK Submission" msgid "AK Submission"
msgstr "AK-Submission" msgstr "AK-Submission"
#: templates/AKDashboard/dashboard.html:51 #: templates/AKDashboard/dashboard.html:63
msgid "Write to organizers of this event for questions and comments" msgid "Write to organizers of this event for questions and comments"
msgstr "Kontaktiere die Organisator*innen des Events bei Fragen oder Kommentaren" msgstr ""
"Kontaktiere die Organisator*innen des Events bei Fragen oder Kommentaren"
#: templates/AKDashboard/dashboard.html:58 #: templates/AKDashboard/dashboard.html:70
msgid "Currently, there are no Events!" msgid "Currently, there are no Events!"
msgstr "Aktuell gibt es keine Events!" msgstr "Aktuell gibt es keine Events!"
#: templates/AKDashboard/dashboard.html:61 #: templates/AKDashboard/dashboard.html:73
msgid "Please contact an administrator if you want to use AKPlanning." msgid "Please contact an administrator if you want to use AKPlanning."
msgstr "Bitte kontaktiere eine*n Administrator*in, falls du AKPlanning verwenden möchtest." msgstr ""
"Bitte kontaktiere eine*n Administrator*in, falls du AKPlanning verwenden "
"möchtest."
# Generated by Django 2.2.6 on 2020-01-12 23:30
from django.db import migrations, models
import django.db.models.deletion
import fontawesome_5.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('AKModel', '0026_akslot_updated'),
]
operations = [
migrations.CreateModel(
name='DashboardButton',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('text', models.CharField(help_text='Text that will be shown on the button', max_length=50, verbose_name='Text')),
('url', models.URLField(help_text='URL this button links to', verbose_name='Link URL')),
('icon', fontawesome_5.fields.IconField(blank=True, default='external-link-alt', help_text='Symbol represeting this button.', max_length=60, verbose_name='Icon')),
('color', models.PositiveSmallIntegerField(choices=[(0, 'primary'), (1, 'success'), (2, 'info'), (3, 'warning'), (4, 'danger')], default=0, help_text='Style (Color) of this button (bootstrap class)', verbose_name='Button Style')),
('event', models.ForeignKey(help_text='Event this button belongs to', on_delete=django.db.models.deletion.CASCADE, to='AKModel.Event', verbose_name='Event')),
],
options={
'verbose_name': 'Dashboard Button',
'verbose_name_plural': 'Dashboard Buttons',
},
),
]
# Create your models here. from django.db import models
from django.utils.translation import gettext_lazy as _
from fontawesome_5.fields import IconField
from AKModel.models import Event
class DashboardButton(models.Model):
class Meta:
verbose_name = _("Dashboard Button")
verbose_name_plural = _("Dashboard Buttons")
COLOR_CHOICES = (
(0, "primary"),
(1, "success"),
(2, "info"),
(3, "warning"),
(4, "danger"),
)
text = models.CharField(max_length=50, blank=False, verbose_name=_("Text"),
help_text=_("Text that will be shown on the button"))
url = models.URLField(blank=False, verbose_name=_("Link URL"), help_text=_("URL this button links to"))
icon = IconField(default="external-link-alt", verbose_name=_("Icon"), help_text="Symbol represeting this button.")
color = models.PositiveSmallIntegerField(choices=COLOR_CHOICES, default=0, blank=False,
verbose_name=_("Button Style"), help_text=_("Style (Color) of this button (bootstrap class)"))
event = models.ForeignKey(to=Event, on_delete=models.CASCADE, blank=False, null=False,
verbose_name=_("Event"), help_text=_("Event this button belongs to"))
def __str__(self):
return f"{self.text} ({self.event})"
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
.dashboard-box { .dashboard-box {
display: block; display: block;
padding: 2em; padding: 2em;
margin-right: 1em;
} }
.dashboard-button { .dashboard-button {
......
{% extends 'base.html' %} {% extends 'base.html' %}
{% load fontawesome %} {% load fontawesome_5 %}
{% load i18n %} {% load i18n %}
{% load static %} {% load static %}
{% load tags_AKModel %} {% load tags_AKModel %}
...@@ -26,29 +26,41 @@ ...@@ -26,29 +26,41 @@
<a class="dashboard-box btn btn-primary" <a class="dashboard-box btn btn-primary"
href="{% url 'plan:ak_plan_current_next' event_slug=event.slug %}"> href="{% url 'plan:ak_plan_current_next' event_slug=event.slug %}">
<div class="col-sm-12 col-md-3 col-lg-2 dashboard-button"><span <div class="col-sm-12 col-md-3 col-lg-2 dashboard-button">
class="fa fa-list-ul"></span> <span <span class="fa fa-list-ul"></span>
class='text'>{% trans 'Current AKs' %}</span></div> <span class='text'>{% trans 'Current AKs' %}</span>
</div>
</a> </a>
<a class="dashboard-box btn btn-primary" <a class="dashboard-box btn btn-primary"
href="{% url 'plan:ak_plan_timeline' event_slug=event.slug %}"> href="{% url 'plan:ak_plan_timeline' event_slug=event.slug %}">
<div class="col-sm-12 col-md-3 col-lg-2 dashboard-button"><span <div class="col-sm-12 col-md-3 col-lg-2 dashboard-button">
class="fa fa-calendar"></span> <span class='text'>{% trans "AK Wall" %}</span></div> <span class="fa fa-calendar"></span>
<span class='text'>{% trans "AK Wall" %}</span>
</div>
</a> </a>
{% endif %} {% endif %}
{% 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:submission_overview' event_slug=event.slug %}"> href="{% url 'submit:submission_overview' event_slug=event.slug %}">
<div class="col-sm-12 col-md-3 col-lg-2 dashboard-button"><span <div class="col-sm-12 col-md-3 col-lg-2 dashboard-button">
class="fa fa-pencil-alt"></span> <span <span class="fa fa-pencil-alt"></span>
class='text'>{% trans 'AK Submission' %}</span></div> <span class='text'>{% trans 'AK Submission' %}</span>
</div>
</a> </a>
{% endif %} {% endif %}
{% for button in event.dashboardbutton_set.all %}
<a class="dashboard-box btn btn-{{ button.get_color_display }}"
href="{{ button.url }}">
<div class="col-sm-12 col-md-3 col-lg-2 dashboard-button">
{% if button.icon %}<span class="fa">{{ button.icon.as_html }}</span>{% endif %}
<span class='text'>{{ button.text }}</span>
</div>
</a>
{% endfor %}
</div> </div>
{% if event.contact_email %} {% if event.contact_email %}
<p> <p>
<a href="mailto:{{ event.contact_email }}">{% fontawesome_icon "envelope" %} {% trans "Write to organizers of this event for questions and comments" %}</a> <a href="mailto:{{ event.contact_email }}">{% fa5_icon "envelope" "fas" %} {% trans "Write to organizers of this event for questions and comments" %}</a>
</p> </p>
{% endif %} {% endif %}
</div> </div>
...@@ -62,4 +74,4 @@ ...@@ -62,4 +74,4 @@
</p> </p>
</div> </div>
{% endfor %} {% endfor %}
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -44,7 +44,7 @@ INSTALLED_APPS = [ ...@@ -44,7 +44,7 @@ INSTALLED_APPS = [
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'bootstrap4', 'bootstrap4',
'fontawesome', 'fontawesome_5',
] ]
MIDDLEWARE = [ MIDDLEWARE = [
...@@ -144,7 +144,8 @@ BOOTSTRAP4 = { ...@@ -144,7 +144,8 @@ BOOTSTRAP4 = {
} }
# Settings for FontAwesome # Settings for FontAwesome
FONTAWESOME_CSS_URL = "//cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css" FONTAWESOME_5_CSS_URL = "//cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css"
FONTAWESOME_5_PREFIX = "fa"
# Treat wishes as seperate category in submission views? # Treat wishes as seperate category in submission views?
WISHES_AS_CATEGORY = True WISHES_AS_CATEGORY = True
......
{% extends 'AKSubmission/submission_base.html' %} {% extends 'AKSubmission/submission_base.html' %}
{% load i18n %} {% load i18n %}
{% load fontawesome %} {% load fontawesome_5 %}
{% load tags_AKSubmission %} {% load tags_AKSubmission %}
...@@ -19,11 +19,11 @@ ...@@ -19,11 +19,11 @@
<div class="float-right"> <div class="float-right">
{% if ak.link != "" %} {% if ak.link != "" %}
<a href="{{ ak.link }}" class="btn btn-info">{% fontawesome_icon 'external-link-alt' %}</a> <a href="{{ ak.link }}" class="btn btn-info">{% fa5_icon 'external-link-alt' 'fas' %}</a>
{% endif %} {% endif %}
{% if ak.event.active %} {% if ak.event.active %}
<a href="{% url 'submit:ak_edit' event_slug=ak.event.slug pk=ak.pk %}" <a href="{% url 'submit:ak_edit' event_slug=ak.event.slug pk=ak.pk %}"
class="btn btn-success">{% fontawesome_icon 'pencil-alt' %}</a> class="btn btn-success">{% fa5_icon 'pencil-alt' 'fas' %}</a>
{% endif %} </div> {% endif %} </div>
<h2>{% if ak.wish %}{% trans "AK Wish" %}: {% endif %}{{ ak.name }}</h2> <h2>{% if ak.wish %}{% trans "AK Wish" %}: {% endif %}{{ ak.name }}</h2>
...@@ -79,9 +79,9 @@ ...@@ -79,9 +79,9 @@
<td> <td>
{% if not slot.start %} {% if not slot.start %}
<a href="{% url 'submit:akslot_edit' event_slug=ak.event.slug pk=slot.pk %}" <a href="{% url 'submit:akslot_edit' event_slug=ak.event.slug pk=slot.pk %}"
class="btn btn-success">{% fontawesome_icon 'pencil-alt' %}</a> class="btn btn-success">{% fa5_icon 'pencil-alt' 'fas' %}</a>
<a href="{% url 'submit:akslot_delete' event_slug=ak.event.slug pk=slot.pk %}" <a href="{% url 'submit:akslot_delete' event_slug=ak.event.slug pk=slot.pk %}"
class="btn btn-danger">{% fontawesome_icon 'times' %}</a> class="btn btn-danger">{% fa5_icon 'times' 'fas' %}</a>
{% endif %} {% endif %}
</td> </td>
</tr> </tr>
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
{% if ak.event.active %} {% if ak.event.active %}
<div class=""> <div class="">
<a href="{% url 'submit:akslot_add' event_slug=ak.event.slug pk=ak.pk %}" <a href="{% url 'submit:akslot_add' event_slug=ak.event.slug pk=ak.pk %}"
class="btn btn-success">{% fontawesome_icon 'plus' %} {% trans "Add another slot" %}</a> class="btn btn-success">{% fa5_icon 'plus' 'fas' %} {% trans "Add another slot" %}</a>
</div> </div>
{% endif %} {% endif %}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% load bootstrap4 %} {% load bootstrap4 %}
{% load fontawesome %} {% load fontawesome_5 %}
{% load staticfiles %} {% load staticfiles %}
{% block title %}{% trans "AKs" %}: {{ event.name }} - {% trans "Edit AK" %}: {{ ak.name }}{% endblock %} {% block title %}{% trans "AKs" %}: {{ event.name }} - {% trans "Edit AK" %}: {{ ak.name }}{% endblock %}
......
{% extends 'AKSubmission/submission_base.html' %} {% extends 'AKSubmission/submission_base.html' %}
{% load i18n %} {% load i18n %}
{% load fontawesome %} {% load fontawesome_5 %}
{% load tags_AKSubmission %} {% load tags_AKSubmission %}
......
{% load i18n %} {% load i18n %}
{% load fontawesome %} {% load fontawesome_5 %}
{% load tags_AKSubmission %} {% load tags_AKSubmission %}
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
<b>{{ ak.name }}</b> <b>{{ ak.name }}</b>
{% if ak.present %} {% if ak.present %}
<span class="badge badge-dark badge-pill" <span class="badge badge-dark badge-pill"
title="{% trans 'present this AK' %}">{% fontawesome_icon "bullhorn" %}</span> title="{% trans 'present this AK' %}">{% fa5_icon "bullhorn" 'fas' %}</span>
{% endif %} {% endif %}
{% if ak.reso %} {% if ak.reso %}
<span class="badge badge-dark badge-pill" <span class="badge badge-dark badge-pill"
title="{% trans 'Reso' %}">{% fontawesome_icon "scroll" %}</span> title="{% trans 'Reso' %}">{% fa5_icon "scroll" 'fas' %}</span>
{% endif %} {% endif %}
</td> </td>
<td> <td>
...@@ -38,13 +38,13 @@ ...@@ -38,13 +38,13 @@
<td>{% tag_list ak.tags.all event.slug %}</td> <td>{% tag_list ak.tags.all event.slug %}</td>
<td class="text-right"> <td class="text-right">
<a href="{% url 'submit:ak_detail' event_slug=ak.event.slug pk=ak.pk %}" <a href="{% url 'submit:ak_detail' event_slug=ak.event.slug pk=ak.pk %}"
class="btn btn-primary">{% fontawesome_icon 'info' %}</a> class="btn btn-primary">{% fa5_icon 'info' 'fas' %}</a>
{% if ak.link %} {% if ak.link %}
<a href="{{ ak.link }}" class="btn btn-info">{% fontawesome_icon 'external-link-alt' %}</a> <a href="{{ ak.link }}" class="btn btn-info">{% fa5_icon 'external-link-alt' 'fas' %}</a>
{% endif %} {% endif %}
{% if event.active %} {% if event.active %}
<a href="{% url 'submit:ak_edit' event_slug=event.slug pk=ak.pk %}" <a href="{% url 'submit:ak_edit' event_slug=event.slug pk=ak.pk %}"
class="btn btn-success">{% fontawesome_icon 'pencil-alt' %}</a> class="btn btn-success">{% fa5_icon 'pencil-alt' 'fas' %}</a>
{% endif %} {% endif %}
</td> </td>
</tr> </tr>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% load bootstrap4 %} {% load bootstrap4 %}
{% load fontawesome %} {% load fontawesome_5 %}
{% block title %}{% trans "AKs" %}: {{ event.name }} - {% trans "AK Owner" %}{% endblock %} {% block title %}{% trans "AKs" %}: {{ event.name }} - {% trans "AK Owner" %}{% endblock %}
...@@ -21,14 +21,14 @@ ...@@ -21,14 +21,14 @@
{% bootstrap_form form %} {% bootstrap_form form %}
{% buttons %} {% buttons %}
<button type="reset" class="btn btn-danger"> <button type="reset" class="btn btn-danger">
{% fontawesome_icon "undo-alt" %} {% trans "Reset" %} {% fa5_icon "undo-alt" 'fas' %} {% trans "Reset" %}
</button> </button>
<a href="{% url 'submit:submission_overview' event_slug=event.slug %}" class="btn btn-secondary"> <a href="{% url 'submit:submission_overview' event_slug=event.slug %}" class="btn btn-secondary">
{% fontawesome_icon "times" %} {% trans "Cancel" %} {% fa5_icon "times" 'fas' %} {% trans "Cancel" %}
</a> </a>
<button type="submit" class="save btn btn-primary float-right"> <button type="submit" class="save btn btn-primary float-right">
{% fontawesome_icon "check" %} {% trans "Continue" %} {% fa5_icon "check" 'fas' %} {% trans "Continue" %}
</button> </button>
{% endbuttons %} {% endbuttons %}
</form> </form>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% load bootstrap4 %} {% load bootstrap4 %}
{% load fontawesome %} {% load fontawesome_5 %}
{% block title %}{% trans "AKs" %}: {{ event.name }} - {% trans "AK Duration(s)" %}{% endblock %} {% block title %}{% trans "AKs" %}: {{ event.name }} - {% trans "AK Duration(s)" %}{% endblock %}
...@@ -23,14 +23,14 @@ ...@@ -23,14 +23,14 @@
{% bootstrap_form form %} {% bootstrap_form form %}
{% buttons %} {% buttons %}
<button type="reset" class="btn btn-danger"> <button type="reset" class="btn btn-danger">
{% fontawesome_icon "undo-alt" %} {% trans "Reset" %} {% fa5_icon "undo-alt" 'fas' %} {% trans "Reset" %}
</button> </button>
<a href="{% url 'submit:ak_detail' event_slug=event.slug pk=ak.pk %}" class="btn btn-secondary"> <a href="{% url 'submit:ak_detail' event_slug=event.slug pk=ak.pk %}" class="btn btn-secondary">
{% fontawesome_icon "times" %} {% trans "Cancel" %} {% fa5_icon "times" 'fas' %} {% trans "Cancel" %}
</a> </a>
<button type="submit" class="save btn btn-primary float-right"> <button type="submit" class="save btn btn-primary float-right">
{% fontawesome_icon "check" %} {% trans "Continue" %} {% fa5_icon "check" 'fas' %} {% trans "Continue" %}
</button> </button>
{% endbuttons %} {% endbuttons %}
</form> </form>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% load bootstrap4 %} {% load bootstrap4 %}
{% load fontawesome %} {% load fontawesome_5 %}
{% block title %}{% trans "AKs" %}: {{ event.name }} - {% trans "AK Duration(s)" %}{% endblock %} {% block title %}{% trans "AKs" %}: {{ event.name }} - {% trans "AK Duration(s)" %}{% endblock %}
...@@ -39,10 +39,10 @@ ...@@ -39,10 +39,10 @@
</table> </table>
{% buttons %} {% buttons %}
<a href="{% url 'submit:ak_detail' event_slug=event.slug pk=ak.pk %}" class="btn btn-secondary"> <a href="{% url 'submit:ak_detail' event_slug=event.slug pk=ak.pk %}" class="btn btn-secondary">
{% fontawesome_icon "times" %} {% trans "Cancel" %} {% fa5_icon "times" 'fas' %} {% trans "Cancel" %}
</a> </a>
<button type="submit" class="save btn btn-danger float-right" value="Confirm"> <button type="submit" class="save btn btn-danger float-right" value="Confirm">
{% fontawesome_icon "check" %} {% trans "Confirm" %} {% fa5_icon "check" 'fas' %} {% trans "Confirm" %}
</button> </button>
{% endbuttons %} {% endbuttons %}
</form> </form>
......
{% extends "base.html" %} {% extends "base.html" %}
{% load fontawesome %} {% load fontawesome_5 %}
{% load i18n %} {% load i18n %}
{% block breadcrumbs %} {% block breadcrumbs %}
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
{% block footer_custom %} {% block footer_custom %}
{% if event.contact_email %} {% if event.contact_email %}
<h4> <h4>
<a href="mailto:{{ event.contact_email }}">{% fontawesome_icon "envelope" %} {% trans "Write to organizers of this event for questions and comments" %}</a> <a href="mailto:{{ event.contact_email }}">{% fa5_icon "envelope" 'fas' %} {% trans "Write to organizers of this event for questions and comments" %}</a>
</h4> </h4>
{% endif %} {% endif %}
{% endblock %} {% endblock %}
{% extends 'AKSubmission/submission_base.html' %} {% extends 'AKSubmission/submission_base.html' %}
{% load i18n %} {% load i18n %}
{% load fontawesome %} {% load fontawesome_5 %}
{% block title %}{% trans "AKs" %}: {{ event.name }} - {% trans "AK Submission" %}{% endblock %} {% block title %}{% trans "AKs" %}: {{ event.name }} - {% trans "AK Submission" %}{% endblock %}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% load bootstrap4 %} {% load bootstrap4 %}
{% load fontawesome %} {% load fontawesome_5 %}
{% load staticfiles %} {% load staticfiles %}
{% block title %}{% trans "AKs" %}: {{ event.name }} - {% trans "New AK" %}{% endblock %} {% block title %}{% trans "AKs" %}: {{ event.name }} - {% trans "New AK" %}{% endblock %}
...@@ -31,14 +31,14 @@ ...@@ -31,14 +31,14 @@
{% bootstrap_form form %} {% bootstrap_form form %}
{% buttons %} {% buttons %}
<button type="reset" class="btn btn-danger"> <button type="reset" class="btn btn-danger">
{% fontawesome_icon "undo-alt" %} {% trans "Reset" %} {% fa5_icon "undo-alt" 'fas' %} {% trans "Reset" %}
</button> </button>
<a href="{% url 'submit:submission_overview' event_slug=event.slug %}" class="btn btn-secondary"> <a href="{% url 'submit:submission_overview' event_slug=event.slug %}" class="btn btn-secondary">
{% fontawesome_icon "times" %} {% trans "Cancel" %} {% fa5_icon "times" 'fas' %} {% trans "Cancel" %}
</a> </a>
<button type="submit" class="save btn btn-primary float-right"> <button type="submit" class="save btn btn-primary float-right">
{% fontawesome_icon "check" %} {% trans "Submit" %} {% fa5_icon "check" 'fas' %} {% trans "Submit" %}
</button> </button>
{% endbuttons %} {% endbuttons %}
</form> </form>
......
from django import template from django import template
from fontawesome.templatetags.fontawesome import fontawesome_icon from fontawesome_5.templatetags.fontawesome import fa5_icon
register = template.Library() register = template.Library()
...@@ -7,8 +7,8 @@ register = template.Library() ...@@ -7,8 +7,8 @@ register = template.Library()
@register.filter @register.filter
def bool_symbol(bool_val): def bool_symbol(bool_val):
if bool_val: if bool_val:
return fontawesome_icon("check") return fa5_icon("check", "fas")
return fontawesome_icon("times") return fa5_icon("times", "fas")
@register.inclusion_tag("AKSubmission/tags_list.html") @register.inclusion_tag("AKSubmission/tags_list.html")
......
{% load static %} {% load static %}
{% load i18n %} {% load i18n %}
{% load bootstrap4 %} {% load bootstrap4 %}
{% load fontawesome %} {% load fontawesome_5 %}
{% load tags_AKModel %} {% load tags_AKModel %}
<!DOCTYPE html> <!DOCTYPE html>
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
{# Load Bootstrap CSS and JavaScript as well as font awesome #} {# Load Bootstrap CSS and JavaScript as well as font awesome #}
{% bootstrap_css %} {% bootstrap_css %}
{% bootstrap_javascript jquery='slim' %} {% bootstrap_javascript jquery='slim' %}
{% fontawesome_stylesheet %} {% fontawesome_5_static %}
<link rel="stylesheet" href="{% static 'common/css/custom.css' %}"> <link rel="stylesheet" href="{% static 'common/css/custom.css' %}">
......
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