Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
re2o
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nounous
re2o
Commits
46e1b784
Commit
46e1b784
authored
Oct 21, 2017
by
Maël Kervella
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajoute les sorts sur les bans et les whitelists
parent
95ad603a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
21 deletions
+45
-21
re2o/utils.py
re2o/utils.py
+19
-5
users/templates/users/aff_bans.html
users/templates/users/aff_bans.html
+4
-4
users/templates/users/aff_users.html
users/templates/users/aff_users.html
+4
-4
users/templates/users/aff_whitelists.html
users/templates/users/aff_whitelists.html
+4
-4
users/views.py
users/views.py
+14
-4
No files found.
re2o/utils.py
View file @
46e1b784
...
@@ -151,11 +151,25 @@ class SortTable:
...
@@ -151,11 +151,25 @@ class SortTable:
# to use as order field in the request. A 'default' might be provided to
# to use as order field in the request. A 'default' might be provided to
# specify what to do if the requested col doesn't match any keys.
# specify what to do if the requested col doesn't match any keys.
USERS_INDEX
=
{
USERS_INDEX
=
{
'prenom'
:
'name'
,
'name'
:
'name'
,
'nom'
:
'surname'
,
'surname'
:
'surname'
,
'pseudo'
:
'pseudo'
,
'pseudo'
:
'pseudo'
,
'chamber'
:
'room'
,
'room'
:
'room'
,
'default'
:
'pseudo'
'default'
:
'pseudo'
}
USERS_INDEX_BAN
=
{
'user'
:
'user__pseudo'
,
'reason'
:
'raison'
,
'start'
:
'date_start'
,
'end'
:
'date_end'
,
'default'
:
'date_end'
}
USERS_INDEX_WHITE
=
{
'user'
:
'user__pseudo'
,
'reason'
:
'raison'
,
'start'
:
'date_start'
,
'end'
:
'date_end'
,
'default'
:
'date_end'
}
}
@
staticmethod
@
staticmethod
...
...
users/templates/users/aff_bans.html
View file @
46e1b784
...
@@ -29,10 +29,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
...
@@ -29,10 +29,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<table
class=
"table table-striped"
>
<table
class=
"table table-striped"
>
<thead>
<thead>
<tr>
<tr>
<th>
Utilisateur
</th>
<th>
{% include "buttons/sort.html" with col="user" text="Utilisateur" %}
</th>
<th>
Raison
</th>
<th>
{% include "buttons/sort.html" with col="reason" text="Raison" %}
</th>
<th>
Date de début
</th>
<th>
{% include "buttons/sort.html" with col="start" text="Date de début" %}
</th>
<th>
Date de fin
</th>
<th>
{% include "buttons/sort.html" with col="end" text="Date de fin" %}
</th>
<th></th>
<th></th>
</tr>
</tr>
</thead>
</thead>
...
...
users/templates/users/aff_users.html
View file @
46e1b784
...
@@ -29,10 +29,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
...
@@ -29,10 +29,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<table
class=
"table table-striped"
>
<table
class=
"table table-striped"
>
<thead>
<thead>
<tr>
<tr>
<th>
{% include "buttons/sort.html" with col="
prenom
" text="Prénom" %}
</th>
<th>
{% include "buttons/sort.html" with col="
name
" text="Prénom" %}
</th>
<th>
Nom
</th>
<th>
{% include "buttons/sort.html" with col="surname" text="Nom" %}
</th>
<th>
Pseudo
</th>
<th>
{% include "buttons/sort.html" with col="pseudo" text="Pseudo" %}
</th>
<th>
Chambre
</th>
<th>
{% include "buttons/sort.html" with col="room" text="Chambre" %}
</th>
<th>
Fin de cotisation le
</th>
<th>
Fin de cotisation le
</th>
<th>
Connexion
</th>
<th>
Connexion
</th>
<th>
Profil
</th>
<th>
Profil
</th>
...
...
users/templates/users/aff_whitelists.html
View file @
46e1b784
...
@@ -29,10 +29,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
...
@@ -29,10 +29,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<table
class=
"table table-striped"
>
<table
class=
"table table-striped"
>
<thead>
<thead>
<tr>
<tr>
<th>
Utilisateur
</th>
<th>
{% include "buttons/sort.html" with col="user" text="Utilisateur" %}
</th>
<th>
Raison
</th>
<th>
{% include "buttons/sort.html" with col="reason" text="Raison" %}
</th>
<th>
Date de début
</th>
<th>
{% include "buttons/sort.html" with col="start" text="Date de début" %}
</th>
<th>
Date de fin
</th>
<th>
{% include "buttons/sort.html" with col="end" text="Date de fin" %}
</th>
<th></th>
<th></th>
</tr>
</tr>
</thead>
</thead>
...
...
users/views.py
View file @
46e1b784
...
@@ -601,8 +601,13 @@ def index_ban(request):
...
@@ -601,8 +601,13 @@ def index_ban(request):
""" Affiche l'ensemble des ban, need droit cableur """
""" Affiche l'ensemble des ban, need droit cableur """
options
,
_created
=
GeneralOption
.
objects
.
get_or_create
()
options
,
_created
=
GeneralOption
.
objects
.
get_or_create
()
pagination_number
=
options
.
pagination_number
pagination_number
=
options
.
pagination_number
ban_list
=
Ban
.
objects
.
order_by
(
'date_start'
)
\
ban_list
=
Ban
.
objects
.
select_related
(
'user'
)
.
select_related
(
'user'
).
reverse
()
ban_list
=
SortTable
.
sort
(
ban_list
,
request
.
GET
.
get
(
'col'
),
request
.
GET
.
get
(
'order'
),
SortTable
.
USERS_INDEX_BAN
)
paginator
=
Paginator
(
ban_list
,
pagination_number
)
paginator
=
Paginator
(
ban_list
,
pagination_number
)
page
=
request
.
GET
.
get
(
'page'
)
page
=
request
.
GET
.
get
(
'page'
)
try
:
try
:
...
@@ -622,8 +627,13 @@ def index_white(request):
...
@@ -622,8 +627,13 @@ def index_white(request):
""" Affiche l'ensemble des whitelist, need droit cableur """
""" Affiche l'ensemble des whitelist, need droit cableur """
options
,
_created
=
GeneralOption
.
objects
.
get_or_create
()
options
,
_created
=
GeneralOption
.
objects
.
get_or_create
()
pagination_number
=
options
.
pagination_number
pagination_number
=
options
.
pagination_number
white_list
=
Whitelist
.
objects
.
select_related
(
'user'
)
\
white_list
=
Whitelist
.
objects
.
select_related
(
'user'
)
.
order_by
(
'date_start'
)
white_list
=
SortTable
.
sort
(
white_list
,
request
.
GET
.
get
(
'col'
),
request
.
GET
.
get
(
'order'
),
SortTable
.
USERS_INDEX_BAN
)
paginator
=
Paginator
(
white_list
,
pagination_number
)
paginator
=
Paginator
(
white_list
,
pagination_number
)
page
=
request
.
GET
.
get
(
'page'
)
page
=
request
.
GET
.
get
(
'page'
)
try
:
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment