Move common templates to shared folder

This commit is contained in:
Tom Hubrecht 2020-12-20 12:00:09 +01:00
parent 867e78e6d3
commit 0716af3925
21 changed files with 54 additions and 54 deletions

View file

@ -1,4 +1,4 @@
{% extends "elections/base.html" %}
{% extends "base.html" %}
{% load i18n %}

View file

@ -1,4 +1,4 @@
{% extends "elections/base.html" %}
{% extends "base.html" %}
{% load i18n %}
@ -106,18 +106,18 @@
{% for o in q.options.all %}
<div class="panel-block" id="o_{{ o.pk }}">
{% if election.start_date > current_time %}
<div class="tags has-addons">
<a class="tag is-danger" title="{% trans "Supprimer" %}" href="{% url 'election.del-option' o.pk %}">
<span class="tags has-addons mb-0">
<a class="tag is-danger mb-0" title="{% trans "Supprimer" %}" href="{% url 'election.del-option' o.pk %}">
<span class="icon">
<i class="fas fa-times"></i>
</span>
</a>
<a class="tag is-info" title="{% trans "Modifier" %}" href="{% url 'election.mod-option' o.pk %}">
<a class="tag is-info mb-0" title="{% trans "Modifier" %}" href="{% url 'election.mod-option' o.pk %}">
<span class="icon">
<i class="fas fa-edit"></i>
</span>
</a>
</div>
</span>
{% elif election.tallied %}
<span class="tag {% if o.nb_votes == q.max_votes %}is-success{% else %}is-primary{% endif %}">
<span class="icon">

View file

@ -1,4 +1,4 @@
{% extends "elections/base.html" %}
{% extends "base.html" %}
{% load i18n static %}
@ -34,7 +34,7 @@
<form action="" method="post">
{% csrf_token %}
{% include "elections/forms/form.html" with errors=False %}
{% include "forms/form.html" with errors=False %}
<div class="field">
<div class="control">

View file

@ -1,4 +1,4 @@
{% extends "elections/base.html" %}
{% extends "base.html" %}
{% load i18n %}

View file

@ -1,4 +1,4 @@
{% extends "elections/base.html" %}
{% extends "base.html" %}
{% load i18n static %}
@ -34,7 +34,7 @@
<form action="" method="post">
{% csrf_token %}
{% include "elections/forms/form.html" with errors=False %}
{% include "forms/form.html" with errors=False %}
<div class="field is-grouped is-centered">
<div class="control is-expanded">

View file

@ -1,33 +0,0 @@
{% load bulma_utils %}
<div class="field">
{% if field|is_checkbox %}
{% include "elections/forms/checkbox.html" with field=field %}
{% elif field|is_radio %}
{% include "elections/forms/radio.html" with field=field %}
{% elif field|is_input %}
{% include "elections/forms/input.html" with field=field %}
{% elif field|is_textarea %}
{% include "elections/forms/textarea.html" with field=field %}
{% elif field|is_select %}
{% include "elections/forms/select.html" with field=field %}
{% elif field|is_file %}
{% include "elections/forms/file.html" with field=field %}
{% else %}
{% include "elections/forms/other.html" with field=field %}
{% endif %}
</div>

View file

@ -1,4 +1,4 @@
{% extends "elections/base.html" %}
{% extends "base.html" %}
{% load i18n static %}
@ -16,7 +16,7 @@
<form action="" method="post">
{% csrf_token %}
{% include "elections/forms/form.html" with errors=False %}
{% include "forms/form.html" with errors=False %}
<div class="field is-grouped is-centered">
<div class="control is-expanded">

View file

@ -1,4 +1,4 @@
{% extends "elections/base.html" %}
{% extends "base.html" %}
{% load i18n static %}
@ -16,7 +16,7 @@
<form action="" method="post">
{% csrf_token %}
{% include "elections/forms/form.html" with errors=False %}
{% include "forms/form.html" with errors=False %}
<div class="field is-grouped is-centered">
<div class="control is-expanded">

View file

@ -1,4 +1,4 @@
{% extends "elections/base.html" %}
{% extends "base.html" %}
{% load i18n %}
@ -12,7 +12,7 @@
<form action="" method="post">
{% csrf_token %}
{% include "elections/forms/formset.html" %}
{% include "forms/formset.html" %}
<div class="field is-grouped is-centered">
<div class="control is-expanded">

View file

@ -52,7 +52,7 @@ ROOT_URLCONF = "kadenios.urls"
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
"DIRS": [BASE_DIR + "/shared/templates"],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [

View file

@ -0,0 +1,33 @@
{% load bulma_utils %}
<div class="field">
{% if field|is_checkbox %}
{% include "forms/checkbox.html" %}
{% elif field|is_radio %}
{% include "forms/radio.html" %}
{% elif field|is_input %}
{% include "forms/input.html" %}
{% elif field|is_textarea %}
{% include "forms/textarea.html" %}
{% elif field|is_select %}
{% include "forms/select.html" %}
{% elif field|is_file %}
{% include "forms/file.html" %}
{% else %}
{% include "forms/other.html" %}
{% endif %}
</div>

View file

@ -10,7 +10,7 @@
{{ field|bulmafy:'file-input' }}
<span class="file-cta">
<span class="file-icon">
<i class="fa fa-upload"></i>
<i class="fas fa-upload"></i>
</span>
<span class="file-label">
{% trans "Choisissez un fichier..." %}

View file

@ -18,5 +18,5 @@
{% endfor %}
{% for field in form.visible_fields %}
{% include 'elections/forms/field.html' %}
{% include 'forms/field.html' %}
{% endfor %}

View file

@ -1,4 +1,4 @@
{{ formset.management_form }}
{% for form in formset %}
{% include "elections/forms/form.html" %}
{% include 'forms/form.html' %}
{% endfor %}