Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wotwizard-ui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
wotwizard-ui
Commits
5ba4436f
Commit
5ba4436f
authored
3 years ago
by
Pierre-Jean CHANCELLIER
Browse files
Options
Downloads
Patches
Plain Diff
pouvoir trier les certifications sur la page d'un membre
parent
03187ecd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/certif/List.vue
+82
-3
82 additions, 3 deletions
components/certif/List.vue
pages/membres/_hash.vue
+1
-1
1 addition, 1 deletion
pages/membres/_hash.vue
with
83 additions
and
4 deletions
components/certif/List.vue
+
82
−
3
View file @
5ba4436f
<
template
>
<div
class=
"table-responsive"
>
<table
class=
"table table-striped table-hover"
>
<thead>
<th
@
click=
"sort('uid')"
>
{{
$t
(
'
membres
'
)
}}
<div
class=
"d-inline-block position-absolute ml-2"
>
<div
class=
"up"
:class=
"
{
'sorted' : currentSortDir == 'asc'
&&
currentSort == 'uid',
'invisible' : currentSortDir == 'desc'
&&
currentSort == 'uid'
}">▲
</div>
<div
class=
"down"
:class=
"
{
'sorted' : currentSortDir == 'desc'
&&
currentSort == 'uid',
'invisible' : currentSortDir == 'asc'
&&
currentSort == 'uid'
}">▼
</div>
</div>
</th>
<th
@
click=
"sort('expires_on')"
>
{{
$t
(
'
expire
'
)
}}
<div
class=
"d-inline-block position-absolute ml-2"
>
<div
class=
"up"
:class=
"
{
'sorted' : currentSortDir == 'asc'
&&
currentSort == 'expires_on',
'invisible' : currentSortDir == 'desc'
&&
currentSort == 'expires_on'
}">▲
</div>
<div
class=
"down"
:class=
"
{
'sorted' : currentSortDir == 'desc'
&&
currentSort == 'expires_on',
'invisible' : currentSortDir == 'asc'
&&
currentSort == 'expires_on'
}">▼
</div>
</div>
</th>
</thead>
<tbody>
<tr
v-for=
"certif in certifsTriees"
:key=
"getNeighbor(certif).uid"
<tr
v-for=
"certif in certifsTriees"
:key=
"getNeighbor(certif).uid
+ certif.expires_on
"
@
click=
"$router.push(localePath(
{name:'membres-hash', params: {hash: getNeighbor(certif).hash}}))">
<th
scope=
"row"
class=
"py-1"
>
<div>
...
...
@@ -26,6 +54,12 @@
<
script
>
export
default
{
data
()
{
return
{
currentSort
:
'
expires_on
'
,
currentSortDir
:
'
asc
'
}
},
props
:
{
certifs
:
Array
,
type
:
{
...
...
@@ -40,15 +74,60 @@ export default {
methods
:
{
getNeighbor
(
certif
)
{
return
this
.
type
==
"
received
"
?
certif
.
from
:
certif
.
to
},
sort
:
function
(
s
)
{
if
(
s
===
this
.
currentSort
)
{
this
.
currentSortDir
=
this
.
currentSortDir
===
'
asc
'
?
'
desc
'
:
'
asc
'
;
}
this
.
currentSort
=
s
;
}
},
computed
:
{
certifsTriees
()
{
return
this
.
certifs
.
sort
(
(
a
,
b
)
=>
a
.
expires_on
-
b
.
expires_on
(
a
,
b
)
=>
{
let
modifier
=
this
.
currentSortDir
===
'
desc
'
?
-
1
:
1
if
(
this
.
currentSort
==
'
expires_on
'
)
{
if
(
a
[
'
expires_on
'
]
<
b
[
'
expires_on
'
])
return
-
1
*
modifier
if
(
a
[
'
expires_on
'
]
>
b
[
'
expires_on
'
])
return
1
*
modifier
}
else
if
(
this
.
type
==
'
received
'
)
{
if
(
a
[
'
from
'
][
'
uid
'
]
<
b
[
'
from
'
][
'
uid
'
])
return
-
1
*
modifier
if
(
a
[
'
from
'
][
'
uid
'
]
>
b
[
'
from
'
][
'
uid
'
])
return
1
*
modifier
}
else
if
(
this
.
type
==
'
sent
'
)
{
if
(
a
[
'
to
'
][
'
uid
'
]
<
b
[
'
to
'
][
'
uid
'
])
return
-
1
*
modifier
if
(
a
[
'
to
'
][
'
uid
'
]
>
b
[
'
to
'
][
'
uid
'
])
return
1
*
modifier
}
return
0
}
)
}
}
}
</
script
>
\ No newline at end of file
</
script
>
<
style
lang=
"scss"
scoped
>
thead
th
{
position
:
relative
;
cursor
:pointer
;
background
:
var
(
--
background-color-secondary
);
&
:last-child
{
padding-right
:
1
.5rem
;
text-align
:
right
;
}
}
.up
,
.down
{
line-height
:
10px
;
font-size
:
1
.1rem
;
transform
:
scale
(
1
.5
,
1
);
opacity
:
.3
;
}
.sorted
{
opacity
:
1
;
}
</
style
>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pages/membres/_hash.vue
+
1
−
1
View file @
5ba4436f
...
...
@@ -8,7 +8,7 @@
<div
v-if=
"idFromHash"
>
<div
class=
"container-md"
>
<div
class=
"row"
>
<div
class=
"col-lg-9 col-xl-8 mx-auto m
t
-3"
>
<div
class=
"col-lg-9 col-xl-8 mx-auto m
y
-3"
>
<MemberCard
:hash=
"idFromHash"
/>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment