Meilleures url
On n'utilise plus des chemins du type `"calendrier.views.home"` sous forme de chaîne de caratères (déprécié).
This commit is contained in:
parent
37606b0910
commit
a206288bbe
32 changed files with 168 additions and 130 deletions
|
@ -77,9 +77,20 @@ DATABASES = {
|
|||
TEMPLATES = [{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [
|
||||
os.path.join(BASE_DIR, 'templates/gestion/'),
|
||||
os.path.join(BASE_DIR, 'templates/'),
|
||||
],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
'django.template.context_processors.debug',
|
||||
'django.template.context_processors.request',
|
||||
'django.contrib.auth.context_processors.auth',
|
||||
'django.contrib.messages.context_processors.messages',
|
||||
'django.template.context_processors.i18n',
|
||||
'django.template.context_processors.media',
|
||||
'django.template.context_processors.static',
|
||||
],
|
||||
}
|
||||
}]
|
||||
|
||||
|
||||
|
|
|
@ -1,36 +1,36 @@
|
|||
from django.conf.urls import patterns, include, url
|
||||
from django.conf.urls import include, url
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth import views as auth_views
|
||||
from django.conf.urls.static import static
|
||||
from django.conf import settings
|
||||
|
||||
urlpatterns = patterns(
|
||||
'',
|
||||
# Examples:
|
||||
url(r'^$', 'gestion.views.home', name='home'),
|
||||
# url(r'^blog/', include('blog.urls')),
|
||||
from gestion import views as gestion_views
|
||||
|
||||
url(r'^login/?$', 'gestion.views.login', ),
|
||||
url(r'^logout/?$', 'django.contrib.auth.views.logout', {'next_page': '/'}),
|
||||
url(r'^registration/?$', 'gestion.views.inscription_membre'),
|
||||
url(r'^change/?', 'gestion.views.change_membre'),
|
||||
url(r'^password/?', 'gestion.views.change_password'),
|
||||
url(r'^user/password/reset/$', 'django.contrib.auth.views.password_reset',
|
||||
urlpatterns = [
|
||||
url(r'^$', gestion_views.home, name='home'),
|
||||
url(r'^login/?$', gestion_views.login, name='login'),
|
||||
url(r'^logout/?$', auth_views.logout, {'next_page': '/'}, name='logout'),
|
||||
url(r'^registration/?$', gestion_views.inscription_membre,
|
||||
name='registration'),
|
||||
url(r'^change/?', gestion_views.change_membre, name='change_membre'),
|
||||
url(r'^password/?', gestion_views.change_password),
|
||||
url(r'^user/password/reset/$', auth_views.password_reset,
|
||||
{'post_reset_redirect': '/user/password/reset/done/'},
|
||||
name="password_reset"),
|
||||
url(r'^user/password/reset/done/$',
|
||||
'django.contrib.auth.views.password_reset_done'),
|
||||
auth_views.password_reset_done),
|
||||
url(r'^user/password/reset/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',
|
||||
'django.contrib.auth.views.password_reset_confirm',
|
||||
auth_views.password_reset_confirm,
|
||||
{'post_reset_redirect': '/user/password/done/'},
|
||||
name="password_reset_confirm"),
|
||||
url(r'^user/password/done/$',
|
||||
'django.contrib.auth.views.password_reset_complete'),
|
||||
auth_views.password_reset_complete),
|
||||
url(r'^admin/', include(admin.site.urls)),
|
||||
url(r'^partitions/', include('partitions.urls')),
|
||||
url(r'^pads/', include('pads.urls')),
|
||||
url(r'^calendar/', include('calendrier.urls')),
|
||||
url(r'^propositions/', include('propositions.urls')),
|
||||
url(r'^divers/', 'gestion.views.divers'),
|
||||
)
|
||||
url(r'^divers/', gestion_views.divers),
|
||||
]
|
||||
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
{% if success %}
|
||||
<p>Changement enregistré !</p>
|
||||
{% endif %}
|
||||
<form action="{% url 'calendrier.views.changename' %}" method="post">
|
||||
<form action="{% url 'change-doodle-name' %}" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" value="Valider" />
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
{% if erreur %}
|
||||
{{ erreur }}
|
||||
{% endif %}
|
||||
<form action="{% url 'calendrier.views.create_event' %}" method="post">
|
||||
<form action="{% url 'calendrier-create_event' %}" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" value="Enregistrer" />
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{% load translate %}
|
||||
|
||||
{% block extrahead %}
|
||||
<link rel="stylesheet" href={% static 'css/calend.css' %} />
|
||||
<link rel="stylesheet" href="{% static 'css/calend.css' %}" />
|
||||
{% endblock %}
|
||||
|
||||
{% block titre %}L'Ernestophone{% endblock %}
|
||||
|
@ -34,7 +34,7 @@ Fanfaron de passage, musicien intrigué, Ernestophoniste en quête de sensations
|
|||
{{Calendar|translate}}
|
||||
</div>
|
||||
{% if user.profile.is_chef %}
|
||||
<a href="{% url "calendrier.views.create_event" %}">Ajouter un évènement</a>
|
||||
<a href="{% url "calendrier-create_event" %}">Ajouter un évènement</a>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
{% if envoi %}<p>Votre réponse a été enregistrée !</p>{% endif %}
|
||||
|
||||
|
||||
<p><a href="{% url 'calendrier.views.view_eventbis' id %}">Retour à l'événement</a></p>
|
||||
<p><a href="{% url 'calendrier-view_event' id %}">Retour à l'événement</a></p>
|
||||
<div> Voulez vous participer à l'événement {{ ev.nom }}, le {{ ev.date }} à {{ ev.debut|time:"H:i" }} ?</div>
|
||||
|
||||
<form action="{% url 'calendrier.views.reponse' id %}" method="post">
|
||||
<form action="{% url 'calendrier-reponse' id %}" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" value="Valider" />
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
{% if erreur %}
|
||||
{{ erreur }}
|
||||
{% endif %}
|
||||
<form action="{% url 'calendrier.views.resend' id %}" method="post">
|
||||
<form action="{% url 'calendrier-resend' id %}" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p}}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" value="Renvoyer les mails" />
|
||||
<input type="hidden" name="next" value="/" />
|
||||
</form>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<p><a href="/calendar/supprimer/{{ev.id}}">Supprimer l'événement</a></p>
|
||||
<p><a href="/calendar/resend/{{ev.id}}">Renvoyer les mails</a></p>
|
||||
{% endif %}
|
||||
<p><a href="{% url "calendrier.views.changename" %}">Changer mon nom pour le doodle</a></p>
|
||||
<p><a href="{% url "change-doodle-name" %}">Changer mon nom pour le doodle</a></p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if user.is_authenticated %}
|
||||
|
@ -51,7 +51,7 @@
|
|||
Pas de réponse pour l'instant
|
||||
{% endfor %}
|
||||
</table>
|
||||
<p><a href="{% url 'calendrier.views.reponse' id %}">Répondre à l'événement</a></p>
|
||||
<p><a href="{% url 'calendrier-reponse' id %}">Répondre à l'événement</a></p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
from django.conf.urls import patterns, url
|
||||
from django.conf.urls import url
|
||||
|
||||
from calendrier import views
|
||||
from calendrier.views import EventUpdate, EventDelete
|
||||
|
||||
urlpatterns = patterns(
|
||||
'calendrier.views',
|
||||
url(r'^new$', 'create_event'),
|
||||
url(r'^$', 'home'),
|
||||
urlpatterns = [
|
||||
url(r'^new$', views.create_event, name='calendrier-create_event'),
|
||||
url(r'^$', views.home),
|
||||
url(r'^edition/(?P<pk>\d+)$', EventUpdate.as_view()),
|
||||
url(r'^supprimer/(?P<pk>\d+)$', EventDelete.as_view()),
|
||||
url(r'^resend/(?P<id>\d+)$', 'resend'),
|
||||
url(r'^changename/?$', 'changename'),
|
||||
url(r'(?P<id>\d+)/reponse/?', 'reponse'),
|
||||
url(r'(?P<codeus>\w{6})/(?P<codeev>\w{6})/oui', 'repouidir'),
|
||||
url(r'(?P<codeus>\w{6})/(?P<codeev>\w{6})/pe', 'reppedir'),
|
||||
url(r'(?P<codeus>\w{6})/(?P<codeev>\w{6})/non', 'repnondir'),
|
||||
url(r'(?P<pYear>\d+)/(?P<pMonth>\d+)/(?P<id>\d+)/?', 'view_event'),
|
||||
url(r'(?P<pYear>\d+)/(?P<pMonth>\d+)/?$', 'calendar'),
|
||||
url(r'(?P<id>\d+)/?', 'view_eventbis', name='view-event'),
|
||||
)
|
||||
url(r'^resend/(?P<id>\d+)$', views.resend, name='calendrier-resend'),
|
||||
url(r'^changename/?$', views.changename, name='change-doodle-name'),
|
||||
url(r'(?P<id>\d+)/reponse/?', views.reponse, name='calendrier-reponse'),
|
||||
url(r'(?P<codeus>\w{6})/(?P<codeev>\w{6})/oui', views.repouidir),
|
||||
url(r'(?P<codeus>\w{6})/(?P<codeev>\w{6})/pe', views.reppedir),
|
||||
url(r'(?P<codeus>\w{6})/(?P<codeev>\w{6})/non', views.repnondir),
|
||||
url(r'(?P<pYear>\d+)/(?P<pMonth>\d+)/(?P<id>\d+)/?', views.view_event),
|
||||
url(r'(?P<pYear>\d+)/(?P<pMonth>\d+)/?$', views.calendar),
|
||||
url(r'(?P<id>\d+)/?', views.view_eventbis, name='view-event'),
|
||||
]
|
||||
|
|
|
@ -19,18 +19,18 @@
|
|||
|
||||
<nav>
|
||||
<ul id="menu">
|
||||
<li><a href="{% url 'partitions.views.liste' %}">Partitions</a></li>
|
||||
<li><a href="{% url "partitions-liste" %}">Partitions</a></li>
|
||||
{% if user.is_authenticated %}
|
||||
{% if user.is_superuser %}
|
||||
<li><a href = '/admin/'>Administration</a></li>
|
||||
{% endif %}
|
||||
<li><a href='/divers/'>Divers</a></li>
|
||||
<li><a href="{% url 'gestion.views.change_membre' %}">Connecté en tant que {{user.username }}</a></li>
|
||||
<li><a href = '/logout/'>Déconnexion</a></li>
|
||||
<li><a href="{% url 'change_membre' %}">Connecté en tant que {{user.username }}</a></li>
|
||||
<li><a href="{% url 'logout' %}">Déconnexion</a></li>
|
||||
{% else %}
|
||||
<li><a href='/login/'>Connexion</a></li>
|
||||
<li><a href='/registration/'>Créer un compte</a></li>
|
||||
<li><a href='/user/password/reset/'>Mot de passe oublié</a></li>
|
||||
<li><a href="{% url 'login' %}">Connexion</a></li>
|
||||
<li><a href="{% url 'registration' %}">Créer un compte</a></li>
|
||||
<li><a href="{% url 'password_reset' %}">Mot de passe oublié</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
{% if success %}
|
||||
<p>Changements enregistrés !</p>
|
||||
{% endif %}
|
||||
<p><a href="{% url "gestion.views.change_password" %}">Changer mon mot de passe</a></p>
|
||||
<p><a href="{% url "calendrier.views.changename" %}">Changer mon nom pour les doodles</a></p>
|
||||
<form action="{% url 'gestion.views.change_membre' %}" method="post">
|
||||
<p><a href="{% url "change_password" %}">Changer mon mot de passe</a></p>
|
||||
<p><a href="{% url "change-doodle-name" %}">Changer mon nom pour les doodles</a></p>
|
||||
<form action="{% url 'change_membre' %}" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" value="Valider" />
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
{% if success %}
|
||||
<p>Changement enregistré !</p>
|
||||
{% endif %}
|
||||
<form action="{% url 'gestion.views.change_password' %}" method="post">
|
||||
<form action="{% url 'change_password' %}" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" value="Valider" />
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{% block content %}
|
||||
<h1>Divers</h1>
|
||||
<ul>
|
||||
<li><a href="{% url "propositions.views.liste" %}">Propositions de morceaux</a></li>
|
||||
<li><a href="{% url "pads.views.liste_pads" %}">Pads</a></li>
|
||||
<li><a href="{% url "propositions-liste" %}">Propositions de morceaux</a></li>
|
||||
<li><a href="{% url "pads-liste" %}">Pads</a></li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
{% if error %}
|
||||
<p>{{ error }}</p>
|
||||
{% endif %}
|
||||
<form method="post" action="{% url 'gestion.views.login' %}">
|
||||
<form method="post" action="{% url 'login' %}">
|
||||
{% csrf_token %}
|
||||
<table>
|
||||
<tr>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
{% if error %}
|
||||
<p>{{ error }}</p>
|
||||
{% endif %}
|
||||
<form action="{% url 'gestion.views.inscription_membre' %}" method="post">
|
||||
<form action="{% url 'registration' %}" method="post">
|
||||
{% csrf_token %}
|
||||
{{ user_form.as_p }}
|
||||
{{ comp_form.as_p }}
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
{%block titre %}Ajout d'un pad{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<p><a href="{% url "pads.views.liste_pads" %}">Retour à la liste</a></p>
|
||||
<p><a href="{% url "pads-liste" %}">Retour à la liste</a></p>
|
||||
{% if envoi %}<p>Ce pad a été enregistré.{% endif %}
|
||||
<form action="{% url 'pads.views.add_pad' %}" method="post">
|
||||
<form action="" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" value="Enregistrer" />
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{% block titre %}Suppression d'un pad{% endblock %}
|
||||
{% block content %}<form action="" method="post">
|
||||
{% csrf_token %}
|
||||
<p><a href="{% url "pads.views.liste_pads" %}">Retour aux pads</a></p>
|
||||
<p><a href="{% url "pads-liste" %}">Retour aux pads</a></p>
|
||||
<p>Voulez vous vraiment supprimer le pad {{ object }}?</p>
|
||||
<input type="submit" value="Oui" />
|
||||
</form>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<p>{{ error }}</p>
|
||||
{% endif %}
|
||||
{% if user.profile.is_chef %}
|
||||
<p><a href="{% url "pads.views.add_pad" %}">Ajouter un pad</a></p>
|
||||
<p><a href="{% url "pads-add" %}">Ajouter un pad</a></p>
|
||||
{% endif %}
|
||||
<ul class="filelist">
|
||||
{% for p in pads %}
|
||||
|
|
13
pads/urls.py
13
pads/urls.py
|
@ -1,11 +1,12 @@
|
|||
from django.conf.urls import patterns, url
|
||||
from django.conf.urls import url
|
||||
|
||||
from pads import views
|
||||
from pads.views import PadUpdate, PadDelete
|
||||
|
||||
|
||||
urlpatterns = patterns(
|
||||
'pads.views',
|
||||
url(r'^$', 'liste_pads'),
|
||||
url(r'^ajouter$', 'add_pad'),
|
||||
urlpatterns = [
|
||||
url(r'^$', views.liste_pads, name='pads-liste'),
|
||||
url(r'^ajouter$', views.add_pad, name='pads-add'),
|
||||
url(r'^edition/(?P<pk>\d+)$', PadUpdate.as_view()),
|
||||
url(r'^supprimer/(?P<pk>\d+)$', PadDelete.as_view()),
|
||||
)
|
||||
]
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
{% block titre %}Confirmation de suppression{% endblock %}
|
||||
{% block content %}<h1>Confirmation de suppression</h1>
|
||||
<p>Voulez-vous vraiment supprimer cette partition ?</p>
|
||||
<p><a href="{% url "partitions.views.delete" nom auteur id %}">Oui</a></p>
|
||||
<p><a href="{% url "partitions.views.listepart" nom auteur %}">Retour à la liste des partitions</a></p>
|
||||
<p><a href="{% url "partitions-delete" nom auteur id %}">Oui</a></p>
|
||||
<p><a href="{% url "partitions-listepart" nom auteur %}">Retour à la liste des partitions</a></p>
|
||||
{% endblock %}
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
{% block titre %}Confirmation de suppression{% endblock %}
|
||||
{% block content %}<h1>Confirmation de suppression</h1>
|
||||
<p>Voulez-vous vraiment supprimer {{ nom }}-{{ auteur }} et toutes les partitions qu'il contient ?</p>
|
||||
<p><a href="{% url "partitions.views.delete_morc" nom auteur %}">Oui</a></p>
|
||||
<p><a href="{% url "partitions.views.liste" %}">Retour à la liste des partitions</a></p>
|
||||
<p><a href="{% url "partitions-delete_morc" nom auteur %}">Oui</a></p>
|
||||
<p><a href="{% url "partitions-liste" %}">Retour à la liste des partitions</a></p>
|
||||
{% endblock %}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
{% endif %}
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
<h3><a href="{% url "partitions.views.ajouter_morceau" %}">Ajouter un morceau</a></h3>
|
||||
<h3><a href="{% url "partitions-ajouter_morceau" %}">Ajouter un morceau</a></h3>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
{{ part.nom }} - {{ part.auteur }}
|
||||
{% endif %}
|
||||
{% if user.is_authenticated %}
|
||||
<a href="{% url "partitions.views.listepart" part.nom part.auteur %}" class="fichier">{{ part.nom }} - {{ part.auteur }}</a>
|
||||
<a href="{% url "partitions-listepart" part.nom part.auteur %}" class="fichier">{{ part.nom }} - {{ part.auteur }}</a>
|
||||
{% endif %}
|
||||
{% if user.profile.is_chef %}
|
||||
<a href="{% url "partitions.views.conf_delete_morc" part.nom part.auteur %}" class="supprimer">Supprimer</a>
|
||||
<a href="{% url "partitions-conf_delete_morc" part.nom part.auteur %}" class="supprimer">Supprimer</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<div class="info_part">
|
||||
{% if user.profile.is_chef %}
|
||||
<form action="{% url "partitions.views.listepart" nom auteur %}" id="chef-edit-form" method="post">
|
||||
<form action="{% url "partitions-listepart" nom auteur %}" id="chef-edit-form" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" value="Enregister" />
|
||||
|
@ -29,19 +29,19 @@
|
|||
<ul class="filelist">
|
||||
{% for p in part %}
|
||||
{% if user.is_authenticated and ".pdf" in p.part.url %}
|
||||
<li><a href="{% url "partitions.views.see" nom auteur p.id %}" class="fichier">{{ p.nom }}</a>
|
||||
<li><a href="{% url "partitions-see" nom auteur p.id %}" class="fichier">{{ p.nom }}</a>
|
||||
{% elif user.is_authenticated and ".mp3" in p.part.url %}
|
||||
<li><a href="{% url "partitions.views.see" nom auteur p.id %}" class="fichier">{{ p.nom }}</a>
|
||||
<li><a href="{% url "partitions-see" nom auteur p.id %}" class="fichier">{{ p.nom }}</a>
|
||||
{% else %}
|
||||
<li>{{ p.nom }}
|
||||
{% endif %}
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
<a href="{% url "partitions.views.download" nom auteur p.id %}" class="telecharger">Télécharger</a>
|
||||
<a href="{% url "partitions-download" nom auteur p.id %}" class="telecharger">Télécharger</a>
|
||||
{% endif %}
|
||||
|
||||
{% if user.profile.is_chef %}
|
||||
<a href="{% url "partitions.views.conf_delete" nom auteur p.pk %}" class="supprimer">Supprimer</a>
|
||||
<a href="{% url "partitions-conf_delete" nom auteur p.pk %}" class="supprimer">Supprimer</a>
|
||||
{% endif %}
|
||||
|
||||
</li>
|
||||
|
@ -50,5 +50,5 @@
|
|||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<p><a href="{% url "partitions.views.upload" p.nom p.auteur %}">Ajouter un média</a></p>
|
||||
<p><a href="{% url "partitions-upload" p.nom p.auteur %}">Ajouter un média</a></p>
|
||||
{% endblock %}
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
<p> {{ error }}</p>
|
||||
{% endif %}
|
||||
<p>
|
||||
<form method="post" action="{% url 'partitions.views.ajouter_morceau' %}">
|
||||
<form method="post" action="{% url 'partitions-ajouter_morceau' %}">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" value="Ajouter"/>
|
||||
</form>
|
||||
</p>
|
||||
<p><a href="{% url 'partitions.views.liste' %}">Retour à la liste</a></p>
|
||||
<p><a href="{% url 'partitions-liste' %}">Retour à la liste</a></p>
|
||||
{% endblock %}
|
||||
|
|
|
@ -9,12 +9,12 @@
|
|||
{% endif %}
|
||||
<p>
|
||||
Le nom du fichier ne doit pas contenir d'accents
|
||||
<form method ="post" enctype="multipart/form-data" action="{% url 'partitions.views.upload' nom auteur %}">
|
||||
<form method ="post" enctype="multipart/form-data" action="{% url 'partitions-upload' nom auteur %}">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<p> <input type="submit" value="Enregistrer"/> </p>
|
||||
</form>
|
||||
</p>
|
||||
<p><a href="{% url "partitions.views.listepart" nom auteur %}">Retour aux partitions</a></p>
|
||||
<p><a href="{% url "partitions-listepart" nom auteur %}">Retour aux partitions</a></p>
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,19 +1,24 @@
|
|||
from django.conf.urls import patterns, url
|
||||
from django.conf.urls import url
|
||||
|
||||
urlpatterns = patterns(
|
||||
'partitions.views',
|
||||
url(r'^$', 'liste'),
|
||||
url(r'^(?P<nom>[^/]+)/(?P<auteur>[^/]+)/?$', 'listepart'),
|
||||
url(r'^(?P<nom>[^/]+)/(?P<auteur>[^/]+)/upload/?$', 'upload'),
|
||||
url(r'^(?P<nom>[^/]+)/(?P<auteur>[^/]+)/delete/?$', 'delete_morc'),
|
||||
url(r'^(?P<nom>[^/]+)/(?P<auteur>[^/]+)/conf/?$', 'conf_delete_morc'),
|
||||
from partitions import views
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', views.liste, name='partitions-liste'),
|
||||
url(r'^(?P<nom>[^/]+)/(?P<auteur>[^/]+)/?$', views.listepart,
|
||||
name='partitions-listepart'),
|
||||
url(r'^(?P<nom>[^/]+)/(?P<auteur>[^/]+)/upload/?$', views.upload,
|
||||
name='partitions-upload'),
|
||||
url(r'^(?P<nom>[^/]+)/(?P<auteur>[^/]+)/delete/?$', views.delete_morc,
|
||||
name='partitions-delete_morc'),
|
||||
url(r'^(?P<nom>[^/]+)/(?P<auteur>[^/]+)/conf/?$', views.conf_delete_morc,
|
||||
name='partitions-conf_delete_morc'),
|
||||
url(r'^(?P<nom>[^/]+)/(?P<auteur>[^/]+)/see/(?P<partition_id>\d+)/?$',
|
||||
'see'),
|
||||
views.see, name='partitions-see'),
|
||||
url(r'^(?P<nom>[^/]+)/(?P<auteur>[^/]+)/(?P<partition_id>\d+)/$',
|
||||
'download'),
|
||||
views.download, name='partitions-download'),
|
||||
url(r'^(?P<nom>[^/]+)/(?P<auteur>[^/]+)/(?P<id>[^/]+)/delete/?$',
|
||||
'delete'),
|
||||
views.delete, name='partitions-delete'),
|
||||
url(r'^(?P<nom>[^/]+)/(?P<auteur>[^/]+)/(?P<id>[^/]+)/conf/?$',
|
||||
'conf_delete'),
|
||||
url(r'^new/?$', 'ajouter_morceau'),
|
||||
)
|
||||
views.conf_delete, name='partitions-conf_delete'),
|
||||
url(r'^new/?$', views.ajouter_morceau, name='partitions-ajouter_morceau'),
|
||||
]
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
{%block titre %}Proposition de morceau{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<p><a href="{% url "propositions.views.liste" %}">Retour aux propositions</a></p>
|
||||
<p><a href="{% url "propositions-liste" %}">Retour aux propositions</a></p>
|
||||
{% if envoi %}<p>Votre proposition a été enregistrée.{% endif %}
|
||||
<form action="{% url 'propositions.views.create_prop' %}" method="post">
|
||||
<form action="{% url "propositions-create" %}" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" value="Enregistrer" />
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
{% block titre %}Suppression d'une proposition{% endblock %}
|
||||
{% block content %}<form action="" method="post">
|
||||
{% csrf_token %}
|
||||
<p><a href="{% url "propositions.views.liste" %}">Retour aux propositions</a></p>
|
||||
<p><a href="{% url "propositions-liste" %}">Retour aux propositions</a></p>
|
||||
<p>Voulez vous vraiment supprimer la proposition {{ object }}?</p>
|
||||
<input type="submit" value="Oui" />
|
||||
</form>
|
||||
|
|
|
@ -1,22 +1,40 @@
|
|||
{% extends "gestion/base.html" %}
|
||||
{% load getresponse %}
|
||||
{% block titre %}Propositions de morceau{% endblock %}
|
||||
{% block content %}<h1>Liste des propositions</h1>
|
||||
{% if error %}
|
||||
<p>{{ error }}</p>
|
||||
{% endif %}
|
||||
<p><a href="{% url "propositions.views.create_prop" %}">Proposer un morceau</a></p>
|
||||
{% if n > 0 %}
|
||||
<table>
|
||||
<tr><th></th><th>Oui</th><th>Non</th><th></th><th></th><th></th></tr>
|
||||
{% for p in props %}
|
||||
<tr class="prop"><td>{% if p.lien %}<a href={{p.lien}}>{% endif %}<b>{{ p.nom }}</b>{% if p.artiste %} - {{ p.artiste }}{% endif %}{% if p.lien %}</a>{% endif %}</td>
|
||||
<td>{{p.nboui }}</td><td>{{ p.nbnon }}</td><td><a href="{% url "propositions.views.repoui" p.id %}">Oui</a></td><td><a href="{% url "propositions.views.repnon" p.id %}">Non</a></td>
|
||||
{% getresponse request.user.profile p %}<td>{% if p.user == request.user.profile or request.user.profile.is_chef %}<a class="supprimer" href=/propositions/{{p.id}}/supprimer/>Supprimer</a>{% endif %}</td></tr>
|
||||
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
Pas de proposition pour le moment
|
||||
{% endif %}
|
||||
{% block titre %}Propositions de morceau{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Liste des propositions</h1>
|
||||
{% if error %}
|
||||
<p>{{ error }}</p>
|
||||
{% endif %}
|
||||
|
||||
<p><a href="{% url "propositions-create" %}">Proposer un morceau</a></p>
|
||||
|
||||
{% if n > 0 %}
|
||||
<table>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Oui</th>
|
||||
<th>Non</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
{% for p in props %}
|
||||
<tr class="prop">
|
||||
<td>
|
||||
{% if p.lien %}<a href={{ p.lien }}>{% endif %}<b>{{ p.nom }}</b>{% if p.artiste %} - {{ p.artiste }}{% endif %}{% if p.lien %}</a>{% endif %}</td>
|
||||
<td>{{ p.nboui }}</td>
|
||||
<td>{{ p.nbnon }}</td>
|
||||
<td><a href="{% url "propositions-oui" p.id %}">Oui</a></td>
|
||||
<td><a href="{% url "propositions-non" p.id %}">Non</a></td>
|
||||
{% getresponse request.user.profile p %}
|
||||
<td>{% if p.user == request.user.profile or request.user.profile.is_chef %}<a class="supprimer" href="{% url "propositions-delete" p.id %}">Supprimer</a>{% endif %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
Pas de proposition pour le moment
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
from django.conf.urls import patterns, url
|
||||
from propositions.views import PropDelete
|
||||
from django.conf.urls import url
|
||||
|
||||
urlpatterns = patterns(
|
||||
'propositions.views',
|
||||
url(r'^$', 'liste'),
|
||||
url(r'^new/?$', 'create_prop'),
|
||||
url(r'^(?P<id>\d+)/oui/?$', 'repoui'),
|
||||
url(r'^(?P<id>\d+)/non/?$', 'repnon'),
|
||||
url(r'^(?P<pk>\d+)/supprimer/?$', PropDelete.as_view()),
|
||||
)
|
||||
from propositions.views import PropDelete
|
||||
from propositions import views
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', views.liste, name='propositions-liste'),
|
||||
url(r'^new/?$', views.create_prop, name='propositions-create'),
|
||||
url(r'^(?P<id>\d+)/oui/?$', views.repoui, name='propositions-oui'),
|
||||
url(r'^(?P<id>\d+)/non/?$', views.repnon, name='propositions-non'),
|
||||
url(r'^(?P<pk>\d+)/supprimer/?$', PropDelete.as_view(),
|
||||
name='propositions-delete'),
|
||||
]
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
{% block branding %}
|
||||
<h1 id="site-name"><a href="{% url 'admin:index' %}">{{ site_header|default:_('Django administration') }}</a>
|
||||
-
|
||||
<a href="{% url 'gestion.views.home' %}">Accueil</a></h1>
|
||||
<a href="{% url 'home' %}">Accueil</a></h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block nav-global %}{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue