mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-23 20:03:11 +00:00
Vues cannoniques navbar et adresses de contact
This commit is contained in:
parent
a42624d0d9
commit
a0dcda6975
7 changed files with 49 additions and 5 deletions
|
@ -62,8 +62,10 @@ def context_optionnal_apps(request):
|
||||||
"""Fonction de context pour générer la navbar en fonction des
|
"""Fonction de context pour générer la navbar en fonction des
|
||||||
apps optionnels"""
|
apps optionnels"""
|
||||||
optionnal_apps = [import_module(app) for app in OPTIONNAL_APPS]
|
optionnal_apps = [import_module(app) for app in OPTIONNAL_APPS]
|
||||||
optionnal_templates_navbar_list = [app.views.navbar_user(request) for app in optionnal_apps]
|
optionnal_templates_navbar_user_list = [app.views.navbar_user(request) for app in optionnal_apps]
|
||||||
return {'optionnal_templates_navbar_list':optionnal_templates_navbar_list}
|
optionnal_templates_navbar_logout_list = [app.views.navbar_logout(request) for app in optionnal_apps]
|
||||||
|
return {'optionnal_templates_navbar_user_list':optionnal_templates_navbar_user_list,
|
||||||
|
'optionnal_templates_navbar_logout_list':optionnal_templates_navbar_logout_list}
|
||||||
|
|
||||||
|
|
||||||
def date_now(request):
|
def date_now(request):
|
||||||
|
|
|
@ -32,6 +32,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<h2>{% blocktrans %}Contact the organisation {{asso_name}}{% endblocktrans %}</h2>
|
<h2>{% blocktrans %}Contact the organisation {{asso_name}}{% endblocktrans %}</h2>
|
||||||
</br>
|
</br>
|
||||||
|
|
||||||
|
{% for template in optionnal_templates_contact_list %}
|
||||||
|
{{template}}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
{% for contact in contacts %}
|
{% for contact in contacts %}
|
||||||
|
|
||||||
<div class="panel panel-info">
|
<div class="panel panel-info">
|
||||||
|
|
|
@ -43,6 +43,8 @@ from preferences.models import (
|
||||||
)
|
)
|
||||||
|
|
||||||
from .contributors import CONTRIBUTORS
|
from .contributors import CONTRIBUTORS
|
||||||
|
from importlib import import_module
|
||||||
|
from re2o.settings_local import OPTIONNAL_APPS
|
||||||
|
|
||||||
|
|
||||||
def form(ctx, template, request):
|
def form(ctx, template, request):
|
||||||
|
@ -113,12 +115,16 @@ def contact_page(request):
|
||||||
"""
|
"""
|
||||||
address = MailContact.objects.all()
|
address = MailContact.objects.all()
|
||||||
|
|
||||||
|
optionnal_apps = [import_module(app) for app in OPTIONNAL_APPS]
|
||||||
|
optionnal_templates_contact_list = [app.views.contact(request) for app in optionnal_apps]
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
"re2o/contact.html",
|
"re2o/contact.html",
|
||||||
{
|
{
|
||||||
'contacts': address,
|
'contacts': address,
|
||||||
'asso_name': AssoOption.objects.first().name
|
'asso_name': AssoOption.objects.first().name,
|
||||||
|
'optionnal_templates_contact_list':optionnal_templates_contact_list,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<li><a href="{% url 'cotisations:index' %}"><i class="fa fa-eur"></i> {% trans "Manage the subscriptions" %}</a></li>
|
<li><a href="{% url 'cotisations:index' %}"><i class="fa fa-eur"></i> {% trans "Manage the subscriptions" %}</a></li>
|
||||||
{% acl_end %}
|
{% acl_end %}
|
||||||
|
|
||||||
{% for template in optionnal_templates_navbar_list%}
|
{% for template in optionnal_templates_navbar_user_list%}
|
||||||
{{ template }}
|
{{ template }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -140,6 +140,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
{% if not request.user.is_authenticated %}
|
{% if not request.user.is_authenticated %}
|
||||||
|
{% for template in optionnal_templates_navbar_logout_list %}
|
||||||
|
{{ template }}
|
||||||
|
{% endfor %}
|
||||||
{% if var_sa %}
|
{% if var_sa %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{% url 'users:new-user' %}">
|
<a href="{% url 'users:new-user' %}">
|
||||||
|
|
13
tickets/templates/tickets/contact.html
Normal file
13
tickets/templates/tickets/contact.html
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{% load i18n %}
|
||||||
|
|
||||||
|
<div class="panel panel-info">
|
||||||
|
<div class="panel-heading"><h4>Tickets</h4></div>
|
||||||
|
<div class="panel-body">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-9">
|
||||||
|
{% blocktrans %} Si vous rencontrez des problème concernant les services proposés par l'association {{ asso_name }}, il vous est possible d'ouvir un ticket qui sera traité par les membres actifs de l'association. Si vous souhaitez nous contacter pour une question autres qu'un problème technique, choisissez l'une des adresses mail ci-dessous. {% endblocktrans %}
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-3"><a class="btn btn-primary" href="{% url 'tickets:new-ticket' %}"><i class="fa fa-ticket"></i> {% trans "Ouvrir un ticket" %}</a></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
6
tickets/templates/tickets/navbar_logout.html
Normal file
6
tickets/templates/tickets/navbar_logout.html
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{% load i18n %}
|
||||||
|
<li>
|
||||||
|
<a href="{% url 'tickets:new-ticket' %}">
|
||||||
|
<i class="fa fa-ticket"></i> {% trans "Ouvrir un ticket" %}
|
||||||
|
</a>
|
||||||
|
</li>
|
|
@ -148,6 +148,16 @@ def preferences(request):
|
||||||
context = {'preferences':preferences}
|
context = {'preferences':preferences}
|
||||||
return render_to_string('tickets/preferences.html', context=context, request=request, using=None)
|
return render_to_string('tickets/preferences.html', context=context, request=request, using=None)
|
||||||
|
|
||||||
|
def contact(request):
|
||||||
|
"""Vue cannonique d'affichage d'une adresse dans la page contact.
|
||||||
|
Utilisée ici pour proposer l'ouverture d'un ticket"""
|
||||||
|
return render_to_string('tickets/contact.html')
|
||||||
|
|
||||||
def navbar_user(request):
|
def navbar_user(request):
|
||||||
"""Vue cannonique d'affichage des tickets dans la navbar"""
|
"""Vue cannonique d'affichage des tickets dans la navbar"""
|
||||||
return render_to_string('tickets/navbar.html')
|
return render_to_string('tickets/navbar.html')
|
||||||
|
|
||||||
|
def navbar_logout(request):
|
||||||
|
"""Vue cannonique d'affichage du lien de creation de ticket
|
||||||
|
lorsque l'utilisateur est déconnecté dans la navbar"""
|
||||||
|
return render_to_string('tickets/navbar_logout.html')
|
||||||
|
|
Loading…
Reference in a new issue