1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2025-06-29 22:31:10 +02:00

Continue to remove old perm system

This commit is contained in:
Alexandre Iooss
2019-08-08 19:16:54 +02:00
parent deb28aa93b
commit d0086c84e8
28 changed files with 423 additions and 695 deletions

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-08-02 14:47+0200\n"
"POT-Creation-Date: 2019-08-08 18:54+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -13,34 +13,106 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: models.py:13
#: models.py:17
msgid "author"
msgstr ""
msgstr "auteur"
#: models.py:14
#: models.py:18
msgid "authors"
msgstr ""
msgstr "auteurs"
#: models.py:26
#: models.py:30
msgid "medium"
msgstr ""
msgstr "medium"
#: models.py:27
#: models.py:31
msgid "media"
msgstr ""
msgstr "media"
#: models.py:44
#: models.py:60
msgid "borrowed item"
msgstr ""
msgstr "emprunt"
#: models.py:45
#: models.py:61
msgid "borrowed items"
msgstr ""
msgstr "emprunts"
#: models.py:68
#: models.py:85
msgid "game"
msgstr "jeu"
#: models.py:86
msgid "games"
msgstr "jeux"
#: templates/media/index.html:41
msgid "My profile"
msgstr "Mon profil"
#: templates/media/index.html:43
msgid "Edit"
msgstr "Éditer"
#: templates/media/index.html:47
msgid "username"
msgstr ""
#: models.py:69
msgid "games"
#: templates/media/index.html:48
msgid "email"
msgstr ""
#: templates/media/index.html:49
msgid "comment"
msgstr ""
#: templates/media/index.html:50
msgid "date joined"
msgstr ""
#: templates/media/index.html:51
msgid "last login"
msgstr ""
#: templates/media/index.html:52
msgid "address"
msgstr ""
#: templates/media/index.html:53
msgid "phone number"
msgstr ""
#: templates/media/index.html:54
msgid "groups"
msgstr ""
#: templates/media/index.html:55
msgid "maximum borrowed"
msgstr "emprunts maximal"
#: templates/media/index.html:57
msgid "membership for current year"
msgstr "membre pour cette année"
#: templates/media/index.html:59
msgid "yes"
msgstr "oui"
#: templates/media/index.html:61
msgid "no"
msgstr "non"
#: templates/media/index.html:66
msgid "Current borrowed items"
msgstr "Emprunts en cours"
#: templates/media/index.html:70
msgid "since"
msgstr "depuis"
#: templates/media/index.html:74
msgid "No current borrowed items."
msgstr "Pas d'emprunts en cours."
#: templates/media/index.html:77
msgid "You are not logged in."
msgstr "Vous n'êtes pas identifié."

View File

@ -1,25 +1,5 @@
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.
Copyright © 2017 Gabriel Détraz
Copyright © 2017 Goulven Kermarec
Copyright © 2017 Augustin Lemesle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% if auteurs_list.paginator %}
@ -37,14 +17,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
<td>{{ auteur.nom }}</td>
<td>
{% if is_perm %}
<a class="btn btn-primary btn-sm" role="button" title="Éditer"
href="{% url 'media:edit-auteur' auteur.id %}">
<i class="glyphicon glyphicon-edit"></i>
{% if perms.media.change_auteur %}
<a class="btn btn-primary btn-sm" href="{% url 'media:edit-auteur' auteur.id %}">
Éditer
</a>
<a class="btn btn-danger btn-sm" role="button" href="{% url 'media:del-auteur' auteur.id %}"
title="Supprimer">
<i class="glyphicon glyphicon-trash"></i>
{% endif %}
{% if perms.media.delete_auteur %}
<a class="btn btn-danger btn-sm" href="{% url 'media:del-auteur' auteur.id %}">
Supprimer
</a>
{% endif %}
</td>

View File

@ -1,44 +1,24 @@
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.
Copyright © 2017 Gabriel Détraz
Copyright © 2017 Goulven Kermarec
Copyright © 2017 Augustin Lemesle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% if emprunts_list.paginator %}
{% include "pagination.html" with list=emprunts_list %}
{% include "pagination.html" with list=emprunts_list %}
{% endif %}
<table class="table table-striped">
<thead>
<tr>
<th>Media</th>
<th>Utilisateur</th>
<th>Date emprunt</th>
<th>Permanencier emprunt</th>
<th>Date rendu</th>
<th>Permanencier rendu</th>
<th></th>
</tr>
</thead>
{% for emprunt in emprunts_list %}
<table class="table table-striped">
<thead>
<tr>
<th>Media</th>
<th>Utilisateur</th>
<th>Date emprunt</th>
<th>Permanencier emprunt</th>
<th>Date rendu</th>
<th>Permanencier rendu</th>
<th></th>
</tr>
</thead>
{% for emprunt in emprunts_list %}
<tr>
<td>{{ emprunt.media }}</td>
<td>
@ -46,23 +26,24 @@ 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 %}{% 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>
{% if not emprunt.date_rendu %}
{% if perms.media.change_emprunt %}
<a class="btn btn-primary btn-sm" href="{% url 'media:retour-emprunt' emprunt.id %}">Retour</a>
{% endif %}
{% else %}
{{ emprunt.date_rendu }}
{% endif %}
</td>
<td>{{ emprunt.permanencier_rendu }}</td>
<td>
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="editionemprunt" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Modifier
<span class="caret"></span>
</button>
<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>
<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>
</ul>
</div>
</td>
{% if perms.media.change_emprunt %}
<a href="{% url 'media:edit-emprunt' emprunt.id %}">Editer</a>
{% endif %}
{% if perms.media.delete_emprunt %}
<a href="{% url 'media:del-emprunt' emprunt.id %}">Supprimer</a>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{% endfor %}
</table>

View File

@ -1,44 +1,24 @@
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.
Copyright © 2017 Gabriel Détraz
Copyright © 2017 Goulven Kermarec
Copyright © 2017 Augustin Lemesle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% if jeux_list.paginator %}
{% include "pagination.html" with list=jeux_list %}
{% include "pagination.html" with list=jeux_list %}
{% endif %}
<table class="table table-striped">
<thead>
<tr>
<th>Nom</th>
<th>Proprietaire</th>
<th>Durée</th>
<th>Joueurs min</th>
<th>Joueurs max</th>
<th>Comment</th>
<th></th>
</tr>
</thead>
{% for jeu in jeux_list %}
<table class="table table-striped">
<thead>
<tr>
<th>Nom</th>
<th>Proprietaire</th>
<th>Durée</th>
<th>Joueurs min</th>
<th>Joueurs max</th>
<th>Comment</th>
<th></th>
</tr>
</thead>
{% for jeu in jeux_list %}
<tr>
<td>{{ jeu.nom }}</td>
<td>{{ jeu.proprietaire }}</td>
@ -47,17 +27,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ jeu.nombre_joueurs_max }}</td>
<td>{{ jeu.comment }}</td>
<td>
{% if is_perm %}
<a class="btn btn-primary btn-sm" role="button" title="Éditer"
href="{% url 'media:edit-jeu' jeu.id %}">
<i class="glyphicon glyphicon-edit"></i>
{% if perms.media.change_jeu %}
<a class="btn btn-primary btn-sm" href="{% url 'media:edit-jeu' jeu.id %}">
Éditer
</a>
<a class="btn btn-danger btn-sm" role="button" href="{% url 'media:del-jeu' jeu.id %}"
title="Supprimer">
<i class="glyphicon glyphicon-trash"></i>
{% endif %}
{% if perms.media.delete_jeu %}
<a class="btn btn-danger btn-sm" href="{% url 'media:del-jeu' jeu.id %}">
Supprimer
</a>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{% endfor %}
</table>

View File

@ -1,25 +1,5 @@
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.
Copyright © 2017 Gabriel Détraz
Copyright © 2017 Goulven Kermarec
Copyright © 2017 Augustin Lemesle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% if medias_list.paginator %}
@ -41,14 +21,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{% for aut in media.auteur.all %}{{ aut }}, {% endfor %}</td>
<td>{{ media.cote }}</td>
<td>
{% if is_perm %}
<a class="btn btn-primary btn-sm" role="button" title="Éditer"
href="{% url 'media:edit-media' media.id %}">
<i class="glyphicon glyphicon-edit"></i>
{% if perms.media.change_media %}
<a class="btn btn-primary btn-sm" href="{% url 'media:edit-media' media.id %}">
Éditer
</a>
<a class="btn btn-danger btn-sm" role="button" href="{% url 'media:del-media' media.id %}"
title="Supprimer">
<i class="glyphicon glyphicon-trash"></i>
{% endif %}
{% if perms.media.delete_media %}
<a class="btn btn-danger btn-sm" href="{% url 'media:del-media' media.id %}">
Supprimer
</a>
{% endif %}
</td>

View File

@ -1,26 +1,6 @@
{% extends "media/sidebar.html" %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.
Copyright © 2017 Gabriel Détraz
Copyright © 2017 Goulven Kermarec
Copyright © 2017 Augustin Lemesle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load bootstrap3 %}
@ -28,13 +8,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block title %}Création et modification de media{% endblock %}
{% block content %}
<form class="form" method="post">
{% csrf_token %}
<h4>Attention, voulez-vous vraiment supprimer cet objet {{ objet_name }} ( {{ objet }} ) ?</h4>
{% bootstrap_button "Confirmer" button_type="submit" icon="trash" %}
</form>
<br />
<br />
<br />
<form class="form" method="post">
{% csrf_token %}
<h4>Attention, voulez-vous vraiment supprimer cet objet {{ objet_name }} ( {{ objet }} ) ?</h4>
{% bootstrap_button "Confirmer" button_type="submit" icon="trash" %}
</form>
{% endblock %}

View File

@ -0,0 +1,81 @@
{% extends "admin/base_site.html" %}
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load i18n static %}
{% block title %}Base de donnée de la Mediatek{% endblock %}
{% block extrastyle %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}"/>
{% endblock %}
{% block coltype %}colMS{% endblock %}
{% block bodyclass %}{{ block.super }} dashboard{% endblock %}
{% block breadcrumbs %}{% endblock %}
{% block content %}
<div id="content-main">
<h1>Bienvenue sur la base de données de la Mediatek.</h1>
<h1>Welcome to procrastination heaven !</h1>
<p>
Le site va subir progressivement des mises à jour pendant ces vacances.
Si vous rencontrez des instabilités,
veuillez nous faire remonter les problèmes <a href="mailto:a@crans.org,club-med@crans.org">au webmaster</a>.
</p>
<img src="{% static "images/splash.png" %}" class="poulpy" alt="Poulpy">
</div>
{% endblock %}
{% block sidebar %}
<div id="content-related">
<div class="module" id="recent-actions-module">
{% if user.is_authenticated %}
<h2>{{ user.first_name }} {{ user.last_name }}</h2>
<h3>
{% trans 'My profile' %}
<small><a class="changelink" href="{% url 'users:edit-info' %}">
{% trans 'Edit' %}
</a></small>
</h3>
<ul>
<li><strong>{% trans 'username' %}</strong> : {{ user.username }}</li>
<li><strong>{% trans 'email' %}</strong> : {{ user.email }}</li>
<li><strong>{% trans 'comment' %}</strong> : {{ user.comment }}</li>
<li><strong>{% trans 'date joined' %}</strong> : {{ user.date_joined }}</li>
<li><strong>{% trans 'last login' %}</strong> : {{ user.last_login }}</li>
<li><strong>{% trans 'address' %}</strong> : {{ user.address }}</li>
<li><strong>{% trans 'phone number' %}</strong> : {{ user.telephone }}</li>
<li><strong>{% trans 'groups' %}</strong> : {% for g in user.groups.all %}{{ g.name }} {% endfor %}</li>
<li><strong>{% trans 'maximum borrowed' %}</strong> : {{ user.maxemprunt }}</li>
<li>
<strong>{% trans 'membership for current year' %}</strong> :
{% if user.is_adherent %}
<span style="color:green">{% trans 'yes' %}</span>
{% else %}
<span style="color:red">{% trans 'no' %}</span>
{% endif %}
</li>
</ul>
<h3>{% trans 'Current borrowed items' %}</h3>
{% if borrowed_items %}
<ul>
{% for emprunt in borrowed_items %}
<li>{{ emprunt.media }} ({% trans 'since' %} {{ emprunt.date_emprunt }})</li>
{% endfor %}
</ul>
{% else %}
<p>{% trans 'No current borrowed items.' %}</p>
{% endif %}
{% else %}
<p>{% trans 'You are not logged in.' %}</p>
{% endif %}
</div>
</div>
{% endblock %}

View File

@ -1,39 +1,14 @@
{% extends "media/sidebar.html" %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.
Copyright © 2017 Gabriel Détraz
Copyright © 2017 Goulven Kermarec
Copyright © 2017 Augustin Lemesle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load bootstrap3 %}
{% block title %}Auteurs{% endblock %}
{% block content %}
<h2>Liste des auteurs</h2>
{% if is_perm %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'media:add-auteur' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un auteur</a>
{% endif %}
{% include "media/aff_auteurs.html" with auteurs_list=auteurs_list %}
<br />
<br />
<br />
<h2>Liste des auteurs</h2>
{% if perms.media.add_auteur %}
<a class="btn btn-primary btn-sm" href="{% url 'media:add-auteur' %}">Ajouter un auteur</a>
{% endif %}
{% include "media/aff_auteurs.html" with auteurs_list=auteurs_list %}
{% endblock %}

View File

@ -1,36 +1,11 @@
{% extends "media/sidebar.html" %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.
Copyright © 2017 Gabriel Détraz
Copyright © 2017 Goulven Kermarec
Copyright © 2017 Augustin Lemesle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load bootstrap3 %}
{% block title %}Emprunts{% endblock %}
{% block content %}
<h2>Liste des emprunts</h2>
{% include "media/aff_emprunts.html" with emprunts_list=emprunts_list %}
<br />
<br />
<br />
{% include "media/aff_emprunts.html" with emprunts_list=emprunts_list %}
{% endblock %}

View File

@ -1,39 +1,14 @@
{% extends "media/sidebar.html" %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.
Copyright © 2017 Gabriel Détraz
Copyright © 2017 Goulven Kermarec
Copyright © 2017 Augustin Lemesle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load bootstrap3 %}
{% block title %}Jeux{% endblock %}
{% block content %}
<h2>Liste des jeux</h2>
{% if is_perm %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'media:add-jeu' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un jeu</a>
{% endif %}
{% include "media/aff_jeux.html" with jeux_list=jeux_list %}
<br />
<br />
<br />
<h2>Liste des jeux</h2>
{% if perms.media.add_jeu %}
<a class="btn btn-primary btn-sm" href="{% url 'media:add-jeu' %}">Ajouter un jeu</a>
{% endif %}
{% include "media/aff_jeux.html" with jeux_list=jeux_list %}
{% endblock %}

View File

@ -1,39 +1,14 @@
{% extends "media/sidebar.html" %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.
Copyright © 2017 Gabriel Détraz
Copyright © 2017 Goulven Kermarec
Copyright © 2017 Augustin Lemesle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load bootstrap3 %}
{% block title %}Media{% endblock %}
{% block content %}
<h2>Liste des medias</h2>
{% if is_perm %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'media:add-media' %}"><i class="glyphicon glyphicon-plus"></i> Ajouter un media</a>
{% endif %}
{% include "media/aff_medias.html" with medias_list=medias_list %}
<br />
<br />
<br />
<h2>Liste des medias</h2>
{% if perms.media.add_media %}
<a class="btn btn-primary btn-sm" href="{% url 'media:add-media' %}">Ajouter un media</a>
{% endif %}
{% include "media/aff_medias.html" with medias_list=medias_list %}
{% endblock %}

View File

@ -1,26 +1,6 @@
{% extends "media/sidebar.html" %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.
Copyright © 2017 Gabriel Détraz
Copyright © 2017 Goulven Kermarec
Copyright © 2017 Augustin Lemesle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load bootstrap3 %}
@ -28,15 +8,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block title %}Création et modification de media{% endblock %}
{% block content %}
{% bootstrap_form_errors mediaform %}
{% bootstrap_form_errors mediaform %}
<form class="form" method="post">
{% csrf_token %}
{% bootstrap_form mediaform %}
{% bootstrap_button "Créer ou modifier" button_type="submit" icon="star" %}
</form>
<br />
<br />
<br />
<form class="form" method="post">
{% csrf_token %}
{% bootstrap_form mediaform %}
{% bootstrap_button "Créer ou modifier" button_type="submit" icon="star" %}
</form>
{% endblock %}

View File

@ -1,29 +1,8 @@
{% extends "base.html" %}
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.
Copyright © 2017 Gabriel Détraz
Copyright © 2017 Goulven Kermarec
Copyright © 2017 Augustin Lemesle
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% block sidebar %}
<a class="list-group-item list-group-item-info" href="{% url "media:index" %}">
<i class="glyphicon glyphicon-list"></i>

View File

@ -30,6 +30,5 @@ urlpatterns = [
name='edit-emprunt'),
url(r'^del_emprunt/(?P<empruntid>[0-9]+)$', views.del_emprunt,
name='del-emprunt'),
url(r'^index_emprunts/$', views.index, name='index'),
url(r'^$', views.index, name='index'),
url(r'^index_emprunts/$', views.index_emprunt, name='index'),
]

View File

@ -38,7 +38,7 @@ def add_auteur(request):
@login_required
@permission_required('media.edit_auteur')
@permission_required('media.change_auteur')
def edit_auteur(request, auteurid):
try:
auteur_instance = Auteur.objects.get(pk=auteurid)
@ -90,7 +90,7 @@ def add_media(request):
@login_required
@permission_required('media.edit_media')
@permission_required('media.change_media')
def edit_media(request, mediaid):
try:
media_instance = Media.objects.get(pk=mediaid)
@ -142,7 +142,7 @@ def add_jeu(request):
@login_required
@permission_required('media.edit_jeu')
@permission_required('media.change_jeu')
def edit_jeu(request, jeuid):
try:
jeu_instance = Jeu.objects.get(pk=jeuid)
@ -209,7 +209,7 @@ def add_emprunt(request, userid):
@login_required
@permission_required('media.edit_emprunt')
@permission_required('media.change_emprunt')
def edit_emprunt(request, empruntid):
try:
emprunt_instance = Emprunt.objects.get(pk=empruntid)
@ -229,7 +229,7 @@ def edit_emprunt(request, empruntid):
@login_required
@permission_required('media.edit_emprunt')
@permission_required('media.change_emprunt')
def retour_emprunt(request, empruntid):
try:
emprunt_instance = Emprunt.objects.get(pk=empruntid)
@ -314,7 +314,7 @@ def index_medias(request):
@login_required
def index(request):
def index_emprunt(request):
if request.user.has_perms(['perm']):
emprunts_list = Emprunt.objects.all()
else:
@ -332,3 +332,17 @@ def index(request):
emprunts_list = paginator.page(paginator.num_pages)
return render(request, 'media/index_emprunts.html',
{'emprunts_list': emprunts_list})
def index(request):
"""
Home page with user's borrowed items
"""
if request.user.is_authenticated:
borrowed_items = Emprunt.objects.filter(user=request.user)
else:
borrowed_items = []
return render(request, 'media/index.html', {
'borrowed_items': borrowed_items,
})