add respo mu
This commit is contained in:
parent
bbff984513
commit
bd42fe6fb9
10 changed files with 66 additions and 31 deletions
|
@ -23,7 +23,7 @@
|
|||
<a href="{% url "partitions:listepart" partition.nom partition.auteur %}"
|
||||
class="fichier">{{ partition.nom }} - {{ partition.auteur }}</a>
|
||||
{% endif %}
|
||||
{% if user.profile.is_chef %}
|
||||
{% if user.profile.is_chef or user.profile.is_chef_mu %}
|
||||
<a href="{% url "partitions:conf_delete_morc" partition.nom partition.auteur %}"
|
||||
class="supprimer">Supprimer</a>
|
||||
{% endif %}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
{% endif %}
|
||||
|
||||
<div class="info_part">
|
||||
{% if user.profile.is_chef %}
|
||||
{% if user.profile.is_chef or user.profile.is_chef_mu %}
|
||||
<form action="{% url "partitions:listepart" nom auteur %}" id="chef-edit-form" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
|
@ -40,7 +40,7 @@
|
|||
<a href="{% url "partitions:download" nom auteur p.id %}" class="telecharger">Télécharger</a>
|
||||
{% endif %}
|
||||
|
||||
{% if user.profile.is_chef %}
|
||||
{% if user.profile.is_chef or user.profile.is_chef_mu %}
|
||||
<a href="{% url "partitions:conf_delete" nom auteur p.pk %}" class="supprimer">Supprimer</a>
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
{% if user.is_authenticated %}
|
||||
<td> <a href="{% url "partitions:download" nom auteur p.id %}" class="button icon fa-download">{% trans "Télécharger" %}</a></td>
|
||||
{% endif %}
|
||||
{% if user.profile.is_chef %} <td>
|
||||
{% if user.profile.is_chef or user.profile.is_chef_mu %} <td>
|
||||
<a href="{% url "partitions:conf_delete" nom auteur p.pk %}" class="button icon fa-deleate">{% trans "Supprimer" %}</a></td>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
@ -54,7 +54,7 @@
|
|||
{% if user.is_authenticated %}
|
||||
<td> <a href="{% url "partitions:download" nom auteur p.id %}" class="button icon fa-download">{% trans "Télécharger" %}</a></td>
|
||||
{% endif %}
|
||||
{% if user.profile.is_chef %} <td>
|
||||
{% if user.profile.is_chef or user.profile.is_chef_mu %} <td>
|
||||
<a href="{% url "partitions:conf_delete" nom auteur p.pk %}" class="button icon fa-deleate">{% trans "Supprimer" %}</a></td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
|
@ -65,7 +65,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
|
||||
{% if user.profile.is_chef %}
|
||||
{% if user.profile.is_chef or user.profile.is_chef_mu %}
|
||||
<p><a href="{% url "partitions:upload" p.nom p.auteur %}" class='button'>{% trans "Ajouter un média" %}</a></p>
|
||||
|
||||
{% if infos or infos_en %}
|
||||
|
@ -86,7 +86,7 @@
|
|||
<p></p>
|
||||
</div>
|
||||
<div class="6u 12u$(small)">
|
||||
{% if user.profile.is_chef %}
|
||||
{% if user.profile.is_chef or user.profile.is_chef_mu %}
|
||||
<form action="{% url "partitions:listepart" nom auteur %}" id="chef-edit-form" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<div class="icon fa-copyright" style="color:#000000"> Lucas Gierzack</div></div>
|
||||
{% endif %}
|
||||
</span>
|
||||
{% if user.profile.is_chef %}
|
||||
{% if user.profile.is_chef or user.profile.is_chef_mu %}
|
||||
<a href="{% url "partitions:ajouter_morceau" %}" class="button alt big">{% trans "Ajouter un morceau" %}</a>   <a href="{% url "partitions:download_musecores" %}" class="button alt big">{% trans "Télécharger tous les musecores actifs" %}</a>
|
||||
{% elif user.is_authenticated %}
|
||||
<a href="{% url "partitions:download_musecores" %}" class="button alt big">{% trans "Télécharger tous les musecores actifs" %}</a>
|
||||
|
@ -80,7 +80,7 @@
|
|||
<td> <u><a href="{% url "partitions:listepart" partition.nom partition.auteur %}"
|
||||
class="fichier">{{ partition.nom }}</a> </td>
|
||||
<td> {{ partition.auteur }} </a></u> </td>
|
||||
{% if user.profile.is_chef %}<td>
|
||||
{% if user.profile.is_chef or user.profile.is_chef_mu %}<td>
|
||||
|
||||
<a href="{% url "partitions:conf_delete_morc" partition.nom partition.auteur %}"
|
||||
class="button small icon fa-trash">{% trans "Supprimer" %}</a></td>
|
||||
|
|
|
@ -14,7 +14,7 @@ from django.utils.translation import gettext_lazy as _
|
|||
from django.views.generic import (CreateView, DeleteView, ListView,
|
||||
TemplateView, UpdateView)
|
||||
|
||||
from gestion.mixins import ChefRequiredMixin
|
||||
from gestion.mixins import ChefMuRequiredMixin
|
||||
from gestion.models import Photo
|
||||
from partitions.forms import UploadFileForm, UploadMorceauForm
|
||||
from partitions.models import Category, Partition, PartitionSet, SetList
|
||||
|
@ -128,7 +128,7 @@ class Morceau(LoginRequiredMixin, TemplateView):
|
|||
return render(request, self.template_name, context)
|
||||
|
||||
|
||||
class Upload(ChefRequiredMixin, TemplateView):
|
||||
class Upload(ChefMuRequiredMixin, TemplateView):
|
||||
form_class = UploadFileForm
|
||||
template_name = "partitions/upload.html"
|
||||
|
||||
|
@ -208,7 +208,7 @@ def see(request, nom, auteur, partition_id):
|
|||
return redirect("login")
|
||||
|
||||
|
||||
class DeletePart(ChefRequiredMixin, TemplateView):
|
||||
class DeletePart(ChefMuRequiredMixin, TemplateView):
|
||||
model = PartitionSet
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
|
@ -225,7 +225,7 @@ class DeletePart(ChefRequiredMixin, TemplateView):
|
|||
)
|
||||
|
||||
|
||||
class CreateMorc(ChefRequiredMixin, TemplateView):
|
||||
class CreateMorc(ChefMuRequiredMixin, TemplateView):
|
||||
form_class = UploadMorceauForm
|
||||
template_name = "partitions/new.html"
|
||||
|
||||
|
@ -270,7 +270,7 @@ class CreateMorc(ChefRequiredMixin, TemplateView):
|
|||
return render(request, self.template_name, context)
|
||||
|
||||
|
||||
class ConfDelete(ChefRequiredMixin, TemplateView):
|
||||
class ConfDelete(ChefMuRequiredMixin, TemplateView):
|
||||
template_name = "partitions/conf_delete.html"
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
|
@ -281,7 +281,7 @@ class ConfDelete(ChefRequiredMixin, TemplateView):
|
|||
return context
|
||||
|
||||
|
||||
class DeleteMorc(ChefRequiredMixin, TemplateView):
|
||||
class DeleteMorc(ChefMuRequiredMixin, TemplateView):
|
||||
model = PartitionSet
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
|
@ -295,7 +295,7 @@ class DeleteMorc(ChefRequiredMixin, TemplateView):
|
|||
return redirect("partitions:liste")
|
||||
|
||||
|
||||
class ConfDeleteMorc(ChefRequiredMixin, TemplateView):
|
||||
class ConfDeleteMorc(ChefMuRequiredMixin, TemplateView):
|
||||
template_name = "partitions/conf_delete_morc.html"
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
|
@ -326,25 +326,25 @@ def download(request, nom, auteur, partition_id):
|
|||
return redirect("login")
|
||||
|
||||
|
||||
class SetListListView(ChefRequiredMixin, ListView):
|
||||
class SetListListView(ChefMuRequiredMixin, ListView):
|
||||
model = SetList
|
||||
|
||||
def get_queryset(self):
|
||||
return SetList.objects.all().order_by("-date")
|
||||
|
||||
|
||||
class SetListCreate(ChefRequiredMixin, CreateView):
|
||||
class SetListCreate(ChefMuRequiredMixin, CreateView):
|
||||
model = SetList
|
||||
fields = ["date", "morceaux", "is_current"]
|
||||
success_url = reverse_lazy("partitions:list_setlist")
|
||||
|
||||
|
||||
class SetListUpdate(ChefRequiredMixin, UpdateView):
|
||||
class SetListUpdate(ChefMuRequiredMixin, UpdateView):
|
||||
model = SetList
|
||||
fields = ["date", "morceaux", "is_current"]
|
||||
success_url = reverse_lazy("partitions:list_setlist")
|
||||
|
||||
|
||||
class SetListDelete(ChefRequiredMixin, DeleteView):
|
||||
class SetListDelete(ChefMuRequiredMixin, DeleteView):
|
||||
model = SetList
|
||||
success_url = reverse_lazy("partitions:list_setlist")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue