Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Daniel CAZAL
co2
Commits
18de7fe8
Commit
18de7fe8
authored
Feb 07, 2019
by
Clément Damiens
Browse files
Merged branch master into master
parents
9214208f
df5a6793
Changes
1
Hide whitespace changes
Inline
Side-by-side
assets/js/default/directory.js
View file @
18de7fe8
...
...
@@ -2703,15 +2703,28 @@ var directory = {
//SHOW HIDE VOTE BTNs
if
(
typeof
userId
!=
"
undefined
"
&&
userId
!=
null
&&
userId
!=
""
){
var
btnSize
=
(
params
.
status
==
"
amendementAndVote
"
)
?
"
6
"
:
"
12
"
;
voteCount
=
""
;
if
(
params
.
votes
){
var
vc
=
0
;
if
(
params
.
votes
.
up
)
vc
+=
Object
.
keys
(
params
.
votes
.
up
).
length
;
if
(
params
.
votes
.
down
)
vc
+=
Object
.
keys
(
params
.
votes
.
down
).
length
;
if
(
params
.
votes
.
uncomplet
)
vc
+=
Object
.
keys
(
params
.
votes
.
uncomplet
).
length
;
if
(
params
.
votes
.
white
)
vc
+=
Object
.
keys
(
params
.
votes
.
white
).
length
;
voteCount
=
"
(
"
+
vc
+
"
)
"
;
}
if
(
(
params
.
status
==
"
tovote
"
||
params
.
status
==
"
amendementAndVote
"
)
&&
params
.
hasVote
===
false
)
str
+=
'
<a href="javascript:;"
'
+
linkParams
+
'
data-coop-section="vote" class="bg-green openCoopPanelHtml btn col-sm-
'
+
btnSize
+
'
"><i class="fa fa-gavel"></i>
'
+
trad
.
Vote
+
'
</a>
'
;
str
+=
'
<a href="javascript:;"
'
+
linkParams
+
'
data-coop-section="vote" class="bg-green openCoopPanelHtml btn col-sm-
'
+
btnSize
+
'
"><i class="fa fa-gavel"></i>
'
+
trad
.
Vote
+
voteCount
+
'
</a>
'
;
//str += '<a href="javascript:" '+ linkParams + ' class="btn-openVoteDetail bg-green btn col-sm-'+btnSize+' "><i class="fa fa-gavel"></i> '+trad.Vote+'</a>';
else
if
(
(
params
.
status
==
"
tovote
"
||
params
.
status
==
"
amendementAndVote
"
)
&&
params
.
hasVote
!==
false
)
str
+=
'
<a href="javascript:;"
'
+
linkParams
+
'
data-coop-section="vote" class="openCoopPanelHtml btn btn-default col-sm-
'
+
btnSize
+
'
"><i class="fa fa-eye"></i>
'
+
trad
[
"
See votes
"
]
+
'
</a>
'
;
str
+=
'
<a href="javascript:;"
'
+
linkParams
+
'
data-coop-section="vote" class="openCoopPanelHtml btn btn-default col-sm-
'
+
btnSize
+
'
"><i class="fa fa-eye"></i>
'
+
trad
[
"
See votes
"
]
+
voteCount
+
'
</a>
'
;
}
else
{
var
btnSize
=
(
params
.
status
==
"
amendementAndVote
"
)
?
"
6
"
:
"
12
"
;
if
(
(
params
.
status
==
"
tovote
"
||
params
.
status
==
"
amendementAndVote
"
)
&&
params
.
hasVote
===
false
)
str
+=
'
<a href="javascript:" data-toggle="modal" data-target="#modalLogin" class="btn-menu-connect bg-green btn col-sm-
'
+
btnSize
+
'
"><i class="fa fa-gavel"></i>
'
+
trad
.
Vote
+
'
</a>
'
;
str
+=
'
<a href="javascript:" data-toggle="modal" data-target="#modalLogin" class="btn-menu-connect bg-green btn col-sm-
'
+
btnSize
+
'
"><i class="fa fa-gavel"></i>
'
+
trad
.
Vote
+
voteCount
+
'
</a>
'
;
}
if
(
(
params
.
status
==
"
amendementAndVote
"
||
params
.
status
==
"
amendable
"
)
){
...
...
@@ -2719,6 +2732,19 @@ var directory = {
str
+=
'
<a href="javascript:;"
'
+
linkParams
+
'
data-coop-section="amendments" class="openCoopPanelHtml btn btn-default text-purple col-sm-6 "><i class="fa fa-list"></i>
'
+
trad
.
Amendements
+
amendCount
+
'
</a>
'
;
}
if
(
params
.
votes
){
str
+=
"
<div class='col-sm-12 padding-10'>
"
;
if
(
params
.
votes
.
up
)
str
+=
"
<div class='col-sm-3 text-green'><i class='fa fa-thumbs-up'></i>
"
+
Object
.
keys
(
params
.
votes
.
up
).
length
+
"
</div>
"
;
if
(
params
.
votes
.
down
)
str
+=
"
<div class='col-sm-3 text-red'><i class='fa fa-thumbs-down'></i>
"
+
Object
.
keys
(
params
.
votes
.
down
).
length
+
"
</div>
"
;
if
(
params
.
votes
.
uncomplet
)
str
+=
"
<div class='col-sm-3 text-dark'><i class='fa fa-hand-grab-o'></i>
"
+
Object
.
keys
(
params
.
votes
.
uncomplet
).
length
+
"
</div>
"
;
if
(
params
.
votes
.
white
)
str
+=
"
<div class='col-sm-3 text-orange'><i class='fa fa-circle-o'></i>
"
+
Object
.
keys
(
params
.
votes
.
white
).
length
+
"
</div>
"
;
str
+=
"
</div>
"
;
}
...
...
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