Move common templates to shared folder
This commit is contained in:
parent
867e78e6d3
commit
0716af3925
21 changed files with 54 additions and 54 deletions
|
@ -1,4 +1,4 @@
|
||||||
{% extends "elections/base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends "elections/base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
|
|
||||||
|
@ -106,18 +106,18 @@
|
||||||
{% for o in q.options.all %}
|
{% for o in q.options.all %}
|
||||||
<div class="panel-block" id="o_{{ o.pk }}">
|
<div class="panel-block" id="o_{{ o.pk }}">
|
||||||
{% if election.start_date > current_time %}
|
{% if election.start_date > current_time %}
|
||||||
<div class="tags has-addons">
|
<span class="tags has-addons mb-0">
|
||||||
<a class="tag is-danger" title="{% trans "Supprimer" %}" href="{% url 'election.del-option' o.pk %}">
|
<a class="tag is-danger mb-0" title="{% trans "Supprimer" %}" href="{% url 'election.del-option' o.pk %}">
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
<i class="fas fa-times"></i>
|
<i class="fas fa-times"></i>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</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">
|
<span class="icon">
|
||||||
<i class="fas fa-edit"></i>
|
<i class="fas fa-edit"></i>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</span>
|
||||||
{% elif election.tallied %}
|
{% elif election.tallied %}
|
||||||
<span class="tag {% if o.nb_votes == q.max_votes %}is-success{% else %}is-primary{% endif %}">
|
<span class="tag {% if o.nb_votes == q.max_votes %}is-success{% else %}is-primary{% endif %}">
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends "elections/base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load i18n static %}
|
{% load i18n static %}
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
||||||
{% include "elections/forms/form.html" with errors=False %}
|
{% include "forms/form.html" with errors=False %}
|
||||||
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<div class="control">
|
<div class="control">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends "elections/base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends "elections/base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load i18n static %}
|
{% load i18n static %}
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
{% csrf_token %}
|
{% 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="field is-grouped is-centered">
|
||||||
<div class="control is-expanded">
|
<div class="control is-expanded">
|
||||||
|
|
|
@ -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>
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends "elections/base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load i18n static %}
|
{% load i18n static %}
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
{% csrf_token %}
|
{% 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="field is-grouped is-centered">
|
||||||
<div class="control is-expanded">
|
<div class="control is-expanded">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends "elections/base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load i18n static %}
|
{% load i18n static %}
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
{% csrf_token %}
|
{% 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="field is-grouped is-centered">
|
||||||
<div class="control is-expanded">
|
<div class="control is-expanded">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% extends "elections/base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
||||||
{% include "elections/forms/formset.html" %}
|
{% include "forms/formset.html" %}
|
||||||
|
|
||||||
<div class="field is-grouped is-centered">
|
<div class="field is-grouped is-centered">
|
||||||
<div class="control is-expanded">
|
<div class="control is-expanded">
|
||||||
|
|
|
@ -52,7 +52,7 @@ ROOT_URLCONF = "kadenios.urls"
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
||||||
"DIRS": [],
|
"DIRS": [BASE_DIR + "/shared/templates"],
|
||||||
"APP_DIRS": True,
|
"APP_DIRS": True,
|
||||||
"OPTIONS": {
|
"OPTIONS": {
|
||||||
"context_processors": [
|
"context_processors": [
|
||||||
|
|
33
shared/templates/forms/field.html
Normal file
33
shared/templates/forms/field.html
Normal 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>
|
|
@ -10,7 +10,7 @@
|
||||||
{{ field|bulmafy:'file-input' }}
|
{{ field|bulmafy:'file-input' }}
|
||||||
<span class="file-cta">
|
<span class="file-cta">
|
||||||
<span class="file-icon">
|
<span class="file-icon">
|
||||||
<i class="fa fa-upload"></i>
|
<i class="fas fa-upload"></i>
|
||||||
</span>
|
</span>
|
||||||
<span class="file-label">
|
<span class="file-label">
|
||||||
{% trans "Choisissez un fichier..." %}
|
{% trans "Choisissez un fichier..." %}
|
|
@ -18,5 +18,5 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% for field in form.visible_fields %}
|
{% for field in form.visible_fields %}
|
||||||
{% include 'elections/forms/field.html' %}
|
{% include 'forms/field.html' %}
|
||||||
{% endfor %}
|
{% endfor %}
|
|
@ -1,4 +1,4 @@
|
||||||
{{ formset.management_form }}
|
{{ formset.management_form }}
|
||||||
{% for form in formset %}
|
{% for form in formset %}
|
||||||
{% include "elections/forms/form.html" %}
|
{% include 'forms/form.html' %}
|
||||||
{% endfor %}
|
{% endfor %}
|
Loading…
Reference in a new issue