Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
third-party
Commits
3a3b4dc7
Commit
3a3b4dc7
authored
Nov 25, 2021
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enforce ordering in history table
parent
7a54c6fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
models.py
members_space/models.py
+1
-1
members-space-my-shifts.js
members_space/static/js/members-space-my-shifts.js
+15
-3
No files found.
members_space/models.py
View file @
3a3b4dc7
...
@@ -99,7 +99,7 @@ class CagetteMembersSpace(models.Model):
...
@@ -99,7 +99,7 @@ class CagetteMembersSpace(models.Model):
amnesty
[
'state'
]
=
''
amnesty
[
'state'
]
=
''
res
.
append
(
amnesty
)
res
.
append
(
amnesty
)
#
ordering
#
Ordering here is necessary for pagination
res
.
sort
(
key
=
lambda
x
:
datetime
.
datetime
.
strptime
(
x
[
'date_begin'
],
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
),
reverse
=
True
)
res
.
sort
(
key
=
lambda
x
:
datetime
.
datetime
.
strptime
(
x
[
'date_begin'
],
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
),
reverse
=
True
)
# Paginate
# Paginate
...
...
members_space/static/js/members-space-my-shifts.js
View file @
3a3b4dc7
...
@@ -96,18 +96,30 @@ function init_history() {
...
@@ -96,18 +96,30 @@ function init_history() {
data
:
partner_history
,
data
:
partner_history
,
columns
:
[
columns
:
[
{
{
data
:
"date_begin"
,
title
:
""
,
visible
:
false
},
{
data
:
"shift_name"
,
data
:
"shift_name"
,
title
:
"<spans class='dt-body-center'>Service</span>"
,
title
:
"<spans class='dt-body-center'>Service</span>"
,
width
:
"60%"
width
:
"60%"
,
orderable
:
false
},
},
{
{
data
:
"details"
,
data
:
"details"
,
title
:
"Détails"
,
title
:
"Détails"
,
className
:
"tablet-l desktop"
className
:
"tablet-l desktop"
,
orderable
:
false
}
}
],
],
iDisplayLength
:
-
1
,
iDisplayLength
:
-
1
,
ordering
:
false
,
order
:
[
[
0
,
"desc"
]
],
language
:
{
url
:
'/static/js/datatables/french.json'
},
language
:
{
url
:
'/static/js/datatables/french.json'
},
dom
:
"t"
,
dom
:
"t"
,
responsive
:
true
,
responsive
:
true
,
...
...
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