8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-28 07:32:25 +00:00

Move useradmin in a separate app

This commit is contained in:
Alexandre Iooss 2019-02-26 09:55:57 +01:00
parent a086c5784f
commit 74a0ed4a5d
25 changed files with 299 additions and 251 deletions

View file

@ -55,6 +55,9 @@ LOGIN_URL = '/login/' # The URL for login page
LOGIN_REDIRECT_URL = '/' # The URL for redirecting after login
# Application definition
CUSTOM_ADMIN = (
'useradmin',
)
DJANGO_CONTRIB_APPS = (
'django.contrib.admin',
'django.contrib.auth',
@ -79,6 +82,7 @@ LOCAL_APPS = (
'logs',
)
INSTALLED_APPS = (
CUSTOM_ADMIN +
DJANGO_CONTRIB_APPS +
EXTERNAL_CONTRIB_APPS +
LOCAL_APPS +

View file

@ -48,7 +48,7 @@ from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views
from .admin import user_admin_site
from useradmin.admin import user_admin_site
from .views import index, about_page, contact_page
handler500 = 're2o.views.handler500'

View file

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 2.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-25 20:36+0100\n"
"POT-Creation-Date: 2019-02-26 09:52+0100\n"
"PO-Revision-Date: 2018-03-31 16:09+0002\n"
"Last-Translator: Laouen Fernet <laouen.fernet@supelec.fr>\n"
"Language-Team: \n"
@ -30,237 +30,14 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: templates/admin/actions.html:5
msgid "Run the selected action"
msgstr ""
#: templates/admin/actions.html:5
msgid "Go"
msgstr ""
#: templates/admin/actions.html:11
msgid "Click here to select the objects across all pages"
msgstr ""
#: templates/admin/actions.html:11
#, python-format
msgid "Select all %(total_count)s %(module_name)s"
msgstr ""
#: templates/admin/actions.html:13
msgid "Clear selection"
msgstr ""
#: templates/admin/app_index.html:10 templates/admin/change_form.html:19
#: templates/admin/change_list.html:32
#: templates/admin/delete_confirmation.html:15
#: templates/admin/delete_selected_confirmation.html:15
#: templates/admin/object_history.html:7 templates/base.html:72
msgid "Home"
msgstr ""
#: templates/admin/base_site.html:7
msgid "Django administration"
msgstr "Administration Django"
#: templates/admin/change_form.html:22 templates/admin/change_list.html:50
#, python-format
msgid "Add %(name)s"
msgstr ""
#: templates/admin/change_form.html:34 templates/admin/object_history.html:11
#: templates/buttons/history.html:26 templates/buttons/history.html:27
msgid "History"
msgstr ""
#: templates/admin/change_form.html:36
#: templates/admin/edit_inline/stacked.html:22
#: templates/admin/edit_inline/tabular.html:36
msgid "View on site"
msgstr ""
#: templates/admin/change_form.html:48 templates/admin/change_list.html:59
msgid "Please correct the error below."
msgstr ""
#: templates/admin/change_form.html:48 templates/admin/change_list.html:59
msgid "Please correct the errors below."
msgstr ""
#: templates/admin/change_list.html:70
msgid "Filter"
msgstr ""
#: templates/admin/change_list_results.html:18
msgid "Remove from sorting"
msgstr ""
#: templates/admin/change_list_results.html:19
#, python-format
msgid "Sorting priority: %(priority_number)s"
msgstr ""
#: templates/admin/change_list_results.html:20
msgid "Toggle sorting"
msgstr ""
#: templates/admin/delete_confirmation.html:19
#: templates/admin/submit_line.html:12 templates/admin/submit_line.html:15
#: templates/buttons/suppr.html:27
msgid "Delete"
msgstr ""
#: templates/admin/delete_confirmation.html:25
#, python-format
msgid ""
"Deleting the %(object_name)s '%(escaped_object)s' would result in deleting "
"related objects, but your account doesn't have permission to delete the "
"following types of objects:"
msgstr ""
#: templates/admin/delete_confirmation.html:32
#, python-format
msgid ""
"Deleting the %(object_name)s '%(escaped_object)s' would require deleting the "
"following protected related objects:"
msgstr ""
#: templates/admin/delete_confirmation.html:39
#, python-format
msgid ""
"Are you sure you want to delete the %(object_name)s \"%(escaped_object)s\"? "
"All of the following related items will be deleted:"
msgstr ""
#: templates/admin/delete_confirmation.html:41
#: templates/admin/delete_selected_confirmation.html:40
msgid "Objects"
msgstr ""
#: templates/admin/delete_confirmation.html:48
#: templates/admin/delete_selected_confirmation.html:51
msgid "Yes, I'm sure"
msgstr ""
#: templates/admin/delete_confirmation.html:49
#: templates/admin/delete_selected_confirmation.html:52
msgid "No, take me back"
msgstr ""
#: templates/admin/delete_selected_confirmation.html:18
msgid "Delete multiple objects"
msgstr ""
#: templates/admin/delete_selected_confirmation.html:24
#, python-format
msgid ""
"Deleting the selected %(objects_name)s would result in deleting related "
"objects, but your account doesn't have permission to delete the following "
"types of objects:"
msgstr ""
#: templates/admin/delete_selected_confirmation.html:31
#, python-format
msgid ""
"Deleting the selected %(objects_name)s would require deleting the following "
"protected related objects:"
msgstr ""
#: templates/admin/delete_selected_confirmation.html:38
#, python-format
msgid ""
"Are you sure you want to delete the selected %(objects_name)s? All of the "
"following objects and their related items will be deleted:"
msgstr ""
#: templates/admin/edit_inline/tabular.html:21
msgid "Delete?"
msgstr ""
#: templates/admin/index.html:19
#, python-format
msgid "Models in the %(name)s application"
msgstr ""
#: templates/admin/index.html:34
msgid "You don't have permission to edit anything."
msgstr ""
#: templates/admin/object_history.html:23
msgid "Date/time"
msgstr ""
#: templates/admin/object_history.html:24
msgid "User"
msgstr ""
#: templates/admin/object_history.html:25
msgid "Action"
msgstr ""
#: templates/admin/object_history.html:39
msgid ""
"This object doesn't have a change history. It probably wasn't added via this "
"admin site."
msgstr ""
#: templates/admin/pagination.html:11 templates/admin/search_form.html:13
msgid "Show all"
msgstr ""
#: templates/admin/pagination.html:12 templates/admin/submit_line.html:5
#: templates/admin/submit_line.html:7
msgid "Save"
msgstr ""
#: templates/admin/related_widget_wrapper.html:10
#, python-format
msgid "Change selected %(model)s"
msgstr ""
#: templates/admin/related_widget_wrapper.html:17
#, python-format
msgid "Add another %(model)s"
msgstr ""
#: templates/admin/related_widget_wrapper.html:24
#, python-format
msgid "Delete selected %(model)s"
msgstr ""
#: templates/admin/search_form.html:6 templates/admin/search_form.html:8
#: templates/base.html:169
msgid "Search"
msgstr ""
#: templates/admin/search_form.html:13
#, python-format
msgid "%(counter)s result"
msgid_plural "%(counter)s results"
msgstr[0] ""
msgstr[1] ""
#: templates/admin/search_form.html:13
#, python-format
msgid "%(full_result_count)s total"
msgstr ""
#: templates/admin/submit_line.html:19 templates/admin/submit_line.html:21
msgid "Save as new"
msgstr ""
#: templates/admin/submit_line.html:25 templates/admin/submit_line.html:28
msgid "Save and add another"
msgstr ""
#: templates/admin/submit_line.html:32 templates/admin/submit_line.html:35
msgid "Save and continue editing"
msgstr ""
#: templates/base.html:44 templates/errors/404.html:35
msgid "Networking managing website endorsed by FedeRez."
msgstr "Site de gestion de réseau soutenu par FedeRez."
#: templates/base.html:72
msgid "Home"
msgstr ""
#: templates/base.html:96
msgid "Users"
msgstr "Utilisateurs"
@ -326,6 +103,10 @@ msgstr "S'inscrire"
msgid "Log in"
msgstr "Se connecter"
#: templates/base.html:169
msgid "Search"
msgstr ""
#: templates/base.html:188
msgid "My profile"
msgstr "Mon profil"
@ -351,59 +132,59 @@ msgstr "Accès Internet"
msgid "Until %(end_access_date)s"
msgstr "Jusqu'au %(end_access_date)s"
#: templates/base.html:246
#: templates/base.html:245
msgid "Disabled"
msgstr "Désactivé"
#: templates/base.html:251
#: templates/base.html:250
msgid "Membership"
msgstr "Adhésion"
#: templates/base.html:255
#: templates/base.html:254
#, python-format
msgid "Until %(end_adhesion_date)s"
msgstr "Jusqu'au %(end_adhesion_date)s"
#: templates/base.html:258
#: templates/base.html:256
msgid "Non member"
msgstr "Non adhérent"
#: templates/base.html:267
#: templates/base.html:265
msgid "View my profile"
msgstr "Voir mon profil"
#: templates/base.html:272
#: templates/base.html:270
msgid "You are not logged in."
msgstr "Vous n'êtes pas connecté."
#: templates/base.html:279
#: templates/base.html:277
#, python-format
msgid "%(nb)s active machine"
msgid_plural "%(nb)s active machines"
msgstr[0] "%(nb)s machine active"
msgstr[1] "%(nb)s machines actives"
#: templates/base.html:289
#: templates/base.html:287
msgid "View my machines"
msgstr "Voir mes machines"
#: templates/base.html:302
#: templates/base.html:300
msgid "Back to top"
msgstr "Retour en haut"
#: templates/base.html:304
#: templates/base.html:302
msgid "powered by"
msgstr "propulsé par"
#: templates/base.html:306
#: templates/base.html:304
msgid "Brought to you with <i class=\"fa fa-heart text-danger\"></i>."
msgstr "Codé avec <i class=\"fa fa-heart text-danger\"></i>."
#: templates/base.html:309
#: templates/base.html:307
msgid "About this website"
msgstr "À propos de ce site"
#: templates/base.html:312
#: templates/base.html:310
msgid ""
"This software is under the terms of the <a href=\"http://www.gnu.org/"
"licenses/gpl-2.0.txt\" target=\"_blank\" rel=\"nofollow\">GPLv2</a> License."
@ -419,6 +200,10 @@ msgstr "Ajouter"
msgid "Edit"
msgstr "Modifier"
#: templates/buttons/history.html:26 templates/buttons/history.html:27
msgid "History"
msgstr ""
#: templates/buttons/setlang.html:34
msgid "Translation in development"
msgstr "Traduction en développement"
@ -431,6 +216,10 @@ msgstr "Tri croissant"
msgid "Descending sort"
msgstr "Tri décroissant"
#: templates/buttons/suppr.html:27
msgid "Delete"
msgstr ""
#: templates/errors/404.html:39
msgid "404 error: page not found"
msgstr "Erreur 404 : page non trouvée"
@ -529,8 +318,3 @@ msgstr "Dernière page"
#: templates/registration/login.html:40
msgid "Forgotten password?"
msgstr "Mot de passe oublié ?"
#: templates/reversion/change_list.html:8
#, python-format
msgid "Recover deleted %(name)s"
msgstr "Récupérer des %(name)s supprimés"

View file

@ -0,0 +1,260 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-02-26 09:52+0100\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"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: useradmin/templates/admin/actions.html:5
msgid "Run the selected action"
msgstr ""
#: useradmin/templates/admin/actions.html:5
msgid "Go"
msgstr ""
#: useradmin/templates/admin/actions.html:11
msgid "Click here to select the objects across all pages"
msgstr ""
#: useradmin/templates/admin/actions.html:11
#, python-format
msgid "Select all %(total_count)s %(module_name)s"
msgstr ""
#: useradmin/templates/admin/actions.html:13
msgid "Clear selection"
msgstr ""
#: useradmin/templates/admin/app_index.html:10
#: useradmin/templates/admin/change_form.html:19
#: useradmin/templates/admin/change_list.html:32
#: useradmin/templates/admin/delete_confirmation.html:15
#: useradmin/templates/admin/delete_selected_confirmation.html:15
#: useradmin/templates/admin/object_history.html:7
msgid "Home"
msgstr ""
#: useradmin/templates/admin/base_site.html:7
msgid "Django administration"
msgstr "Administration Django"
#: useradmin/templates/admin/change_form.html:22
#: useradmin/templates/admin/change_list.html:50
#, python-format
msgid "Add %(name)s"
msgstr ""
#: useradmin/templates/admin/change_form.html:34
#: useradmin/templates/admin/object_history.html:11
msgid "History"
msgstr ""
#: useradmin/templates/admin/change_form.html:36
#: useradmin/templates/admin/edit_inline/stacked.html:22
#: useradmin/templates/admin/edit_inline/tabular.html:36
msgid "View on site"
msgstr ""
#: useradmin/templates/admin/change_form.html:48
#: useradmin/templates/admin/change_list.html:59
msgid "Please correct the error below."
msgstr ""
#: useradmin/templates/admin/change_form.html:48
#: useradmin/templates/admin/change_list.html:59
msgid "Please correct the errors below."
msgstr ""
#: useradmin/templates/admin/change_list.html:70
msgid "Filter"
msgstr ""
#: useradmin/templates/admin/change_list_results.html:18
msgid "Remove from sorting"
msgstr ""
#: useradmin/templates/admin/change_list_results.html:19
#, python-format
msgid "Sorting priority: %(priority_number)s"
msgstr ""
#: useradmin/templates/admin/change_list_results.html:20
msgid "Toggle sorting"
msgstr ""
#: useradmin/templates/admin/delete_confirmation.html:19
#: useradmin/templates/admin/submit_line.html:12
#: useradmin/templates/admin/submit_line.html:15
msgid "Delete"
msgstr ""
#: useradmin/templates/admin/delete_confirmation.html:25
#, python-format
msgid ""
"Deleting the %(object_name)s '%(escaped_object)s' would result in deleting "
"related objects, but your account doesn't have permission to delete the "
"following types of objects:"
msgstr ""
#: useradmin/templates/admin/delete_confirmation.html:32
#, python-format
msgid ""
"Deleting the %(object_name)s '%(escaped_object)s' would require deleting the "
"following protected related objects:"
msgstr ""
#: useradmin/templates/admin/delete_confirmation.html:39
#, python-format
msgid ""
"Are you sure you want to delete the %(object_name)s \"%(escaped_object)s\"? "
"All of the following related items will be deleted:"
msgstr ""
#: useradmin/templates/admin/delete_confirmation.html:41
#: useradmin/templates/admin/delete_selected_confirmation.html:40
msgid "Objects"
msgstr ""
#: useradmin/templates/admin/delete_confirmation.html:48
#: useradmin/templates/admin/delete_selected_confirmation.html:51
msgid "Yes, I'm sure"
msgstr ""
#: useradmin/templates/admin/delete_confirmation.html:49
#: useradmin/templates/admin/delete_selected_confirmation.html:52
msgid "No, take me back"
msgstr ""
#: useradmin/templates/admin/delete_selected_confirmation.html:18
msgid "Delete multiple objects"
msgstr ""
#: useradmin/templates/admin/delete_selected_confirmation.html:24
#, python-format
msgid ""
"Deleting the selected %(objects_name)s would result in deleting related "
"objects, but your account doesn't have permission to delete the following "
"types of objects:"
msgstr ""
#: useradmin/templates/admin/delete_selected_confirmation.html:31
#, python-format
msgid ""
"Deleting the selected %(objects_name)s would require deleting the following "
"protected related objects:"
msgstr ""
#: useradmin/templates/admin/delete_selected_confirmation.html:38
#, python-format
msgid ""
"Are you sure you want to delete the selected %(objects_name)s? All of the "
"following objects and their related items will be deleted:"
msgstr ""
#: useradmin/templates/admin/edit_inline/tabular.html:21
msgid "Delete?"
msgstr ""
#: useradmin/templates/admin/index.html:19
#, python-format
msgid "Models in the %(name)s application"
msgstr ""
#: useradmin/templates/admin/index.html:34
msgid "You don't have permission to edit anything."
msgstr ""
#: useradmin/templates/admin/object_history.html:23
msgid "Date/time"
msgstr ""
#: useradmin/templates/admin/object_history.html:24
msgid "User"
msgstr ""
#: useradmin/templates/admin/object_history.html:25
msgid "Action"
msgstr ""
#: useradmin/templates/admin/object_history.html:39
msgid ""
"This object doesn't have a change history. It probably wasn't added via this "
"admin site."
msgstr ""
#: useradmin/templates/admin/pagination.html:11
#: useradmin/templates/admin/search_form.html:13
msgid "Show all"
msgstr ""
#: useradmin/templates/admin/pagination.html:12
#: useradmin/templates/admin/submit_line.html:5
#: useradmin/templates/admin/submit_line.html:7
msgid "Save"
msgstr ""
#: useradmin/templates/admin/related_widget_wrapper.html:10
#, python-format
msgid "Change selected %(model)s"
msgstr ""
#: useradmin/templates/admin/related_widget_wrapper.html:17
#, python-format
msgid "Add another %(model)s"
msgstr ""
#: useradmin/templates/admin/related_widget_wrapper.html:24
#, python-format
msgid "Delete selected %(model)s"
msgstr ""
#: useradmin/templates/admin/search_form.html:6
#: useradmin/templates/admin/search_form.html:8
msgid "Search"
msgstr ""
#: useradmin/templates/admin/search_form.html:13
#, python-format
msgid "%(counter)s result"
msgid_plural "%(counter)s results"
msgstr[0] ""
msgstr[1] ""
#: useradmin/templates/admin/search_form.html:13
#, python-format
msgid "%(full_result_count)s total"
msgstr ""
#: useradmin/templates/admin/submit_line.html:19
#: useradmin/templates/admin/submit_line.html:21
msgid "Save as new"
msgstr ""
#: useradmin/templates/admin/submit_line.html:25
#: useradmin/templates/admin/submit_line.html:28
msgid "Save and add another"
msgstr ""
#: useradmin/templates/admin/submit_line.html:32
#: useradmin/templates/admin/submit_line.html:35
msgid "Save and continue editing"
msgstr ""
#: useradmin/templates/reversion/change_list.html:8
#, python-format
msgid "Recover deleted %(name)s"
msgstr "Récupérer des %(name)s supprimés"

View file

@ -7,9 +7,9 @@
<span class="action-counter label label-info" data-actions-icnt="{{ cl.result_list|length }}">{{ selection_note }}</span>
{% if cl.result_count != cl.result_list|length %}
<span class="all label label-info" style="display: none;">{{ selection_note_all }}</span>
<span class="question label label-primary" style="display: none;">
<a href="#" title="{% trans "Click here to select the objects across all pages" %}">{% blocktrans with cl.result_count as total_count %}Select all {{ total_count }} {{ module_name }}{% endblocktrans %}</a>
</span>
<a href="#" title="{% trans "Click here to select the objects across all pages" %}">
<span class="question label label-primary" style="display: none;">{% blocktrans with cl.result_count as total_count %}Select all {{ total_count }} {{ module_name }}{% endblocktrans %}</span>
</a>
<span class="clear label label-warning" style="display: none;"><a href="#">{% trans "Clear selection" %}</a></span>
{% endif %}
{% endif %}

View file

@ -32,7 +32,7 @@ from django.contrib.auth.models import Group
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from reversion.admin import VersionAdmin
from re2o.admin import user_admin_site
from useradmin.admin import user_admin_site
from .models import (
User,