mirror of
				https://gitlab.crans.org/mediatek/med.git
				synced 2025-11-04 16:02:29 +01:00 
			
		
		
		
	Fix droits
This commit is contained in:
		@@ -36,8 +36,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 | 
			
		||||
        {% for auteur in auteurs_list %}
 | 
			
		||||
        <tr>
 | 
			
		||||
            <td>{{ auteur.nom }}</td>
 | 
			
		||||
            <td>{% include 'buttons/edit.html' with href='media:edit-auteur' id=auteur.id %}
 | 
			
		||||
            {% include 'buttons/suppr.html' with href='media:del-auteur' id=auteur.id %}
 | 
			
		||||
            <td>{% if is_perm %}{% include 'buttons/edit.html' with href='media:edit-auteur' id=auteur.id %}
 | 
			
		||||
            {% include 'buttons/suppr.html' with href='media:del-auteur' id=auteur.id %}{% endif %}
 | 
			
		||||
            {% include 'buttons/history.html' with href='media:history' name='auteur' id=auteur.id %}</td>
 | 
			
		||||
        </tr>
 | 
			
		||||
        {% endfor %}
 | 
			
		||||
 
 | 
			
		||||
@@ -46,7 +46,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 | 
			
		||||
            </td>
 | 
			
		||||
            <td>{{ emprunt.date_emprunt }}</td>
 | 
			
		||||
            <td>{{ emprunt.permanencier_emprunt }}</td>
 | 
			
		||||
            <td>{% if not emprunt.date_rendu %}<a class="btn btn-primary btn-sm" role="button" href="{% url 'media:retour-emprunt' emprunt.id  %}"><i class="glyphicon glyphicon-ok"></i> Retour</a>{% else %}{{ emprunt.date_rendu }}{% endif %}</td>
 | 
			
		||||
            <td>{% if not emprunt.date_rendu %}{% if is_perm %}<a class="btn btn-primary btn-sm" role="button" href="{% url 'media:retour-emprunt' emprunt.id  %}"><i class="glyphicon glyphicon-ok"></i> Retour</a>{% endif %}{% else %}{{ emprunt.date_rendu }}{% endif %}</td>
 | 
			
		||||
            <td>{{ emprunt.permanencier_rendu }}</td>
 | 
			
		||||
            <td>
 | 
			
		||||
             <div class="dropdown">
 | 
			
		||||
@@ -57,8 +57,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 | 
			
		||||
             <ul class="dropdown-menu" aria-labelledby="editionemprunt">
 | 
			
		||||
                 {% if is_perm %}
 | 
			
		||||
                 <li><a href="{% url 'media:edit-emprunt' emprunt.id %}"><i class="glyphicon glyphicon-edit"></i> Editer</a></li>
 | 
			
		||||
                 {% endif %}
 | 
			
		||||
                 {% if is_bureau %}
 | 
			
		||||
                 <li><a href="{% url 'media:del-emprunt' emprunt.id %}"><i class="glyphicon glyphicon-trash"></i> Supprimer</a></li>
 | 
			
		||||
                 {% endif %}
 | 
			
		||||
                 <li><a href="{% url 'media:history' 'emprunt' emprunt.id %}"><i class="glyphicon glyphicon-time"></i> Historique</a></li>
 | 
			
		||||
 
 | 
			
		||||
@@ -46,8 +46,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 | 
			
		||||
            <td>{{ jeu.nombre_joueurs_min }}</td>
 | 
			
		||||
            <td>{{ jeu.nombre_joueurs_max }}</td>
 | 
			
		||||
            <td>{{ jeu.comment }}</td>
 | 
			
		||||
            <td>{% include 'buttons/edit.html' with href='media:edit-jeu' id=jeu.id %}
 | 
			
		||||
            {% include 'buttons/suppr.html' with href='media:del-jeu' id=jeu.id %}
 | 
			
		||||
            <td>{% if is_perm %}{% include 'buttons/edit.html' with href='media:edit-jeu' id=jeu.id %}
 | 
			
		||||
            {% include 'buttons/suppr.html' with href='media:del-jeu' id=jeu.id %}{% endif %}
 | 
			
		||||
            {% include 'buttons/history.html' with href='media:history' name='jeu' id=jeu.id %}</td>
 | 
			
		||||
        </tr>
 | 
			
		||||
        {% endfor %}
 | 
			
		||||
 
 | 
			
		||||
@@ -40,8 +40,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 | 
			
		||||
            <td>{{ media.titre }}</td>
 | 
			
		||||
            <td>{% for aut in media.auteur.all %}{{ aut }}, {% endfor %}</td>
 | 
			
		||||
            <td>{{ media.cote }}</td>
 | 
			
		||||
            <td>{% include 'buttons/edit.html' with href='media:edit-media' id=media.id %}
 | 
			
		||||
            {% include 'buttons/suppr.html' with href='media:del-media' id=media.id %}
 | 
			
		||||
            <td>{% if is_perm %}{% include 'buttons/edit.html' with href='media:edit-media' id=media.id %}
 | 
			
		||||
            {% include 'buttons/suppr.html' with href='media:del-media' id=media.id %}{% endif %}
 | 
			
		||||
            {% include 'buttons/history.html' with href='media:history' name='media' id=media.id %}</td>
 | 
			
		||||
        </tr>
 | 
			
		||||
        {% endfor %}
 | 
			
		||||
 
 | 
			
		||||
@@ -210,7 +210,7 @@ def edit_emprunt(request, empruntid):
 | 
			
		||||
    return form({'mediaform': emprunt}, 'media/media.html', request)
 | 
			
		||||
 | 
			
		||||
@login_required
 | 
			
		||||
@permission_required('bureau')
 | 
			
		||||
@permission_required('perm')
 | 
			
		||||
def retour_emprunt(request, empruntid):
 | 
			
		||||
    try:
 | 
			
		||||
        emprunt_instance = Emprunt.objects.get(pk=empruntid)
 | 
			
		||||
@@ -226,7 +226,7 @@ def retour_emprunt(request, empruntid):
 | 
			
		||||
    return redirect("/media/index_emprunts/")
 | 
			
		||||
 | 
			
		||||
@login_required
 | 
			
		||||
@permission_required('bureau')
 | 
			
		||||
@permission_required('perm')
 | 
			
		||||
def del_emprunt(request, empruntid):
 | 
			
		||||
    try:
 | 
			
		||||
        emprunt_instance = Emprunt.objects.get(pk=empruntid)
 | 
			
		||||
@@ -261,7 +261,7 @@ def index_jeux(request):
 | 
			
		||||
 | 
			
		||||
@login_required
 | 
			
		||||
def index_auteurs(request):
 | 
			
		||||
    auteurs_list = Auteur.objects.all()
 | 
			
		||||
    auteurs_list = Auteur.objects.all().order_by('nom')
 | 
			
		||||
    paginator = Paginator(auteurs_list, PAGINATION_NUMBER)
 | 
			
		||||
    page = request.GET.get('page')
 | 
			
		||||
    try:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user