Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
342
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
27
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
TransFem.org
Sharkey
Commits
94120692
Commit
94120692
authored
7 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
wip
parent
43525c48
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/web/app/common/tags/poll.vue
+53
-57
53 additions, 57 deletions
src/web/app/common/tags/poll.vue
with
53 additions
and
57 deletions
src/web/app/common/tags/poll.vue
+
53
−
57
View file @
94120692
<
template
>
<div
:data-is-voted=
"isVoted"
>
<ul>
<li
v-for=
"choice in poll.choices"
:key=
"choice.id"
@
click=
"vote.bind(choice.id)"
:class=
"
{ voted: choice.voted }" :title="!
choice.
isVoted ? '%i18n:common.tags.mk-poll.vote-to%'.replace('{}', choice.text) : ''">
<li
v-for=
"choice in poll.choices"
:key=
"choice.id"
@
click=
"vote.bind(choice.id)"
:class=
"
{ voted: choice.voted }" :title="!isVoted ? '%i18n:common.tags.mk-poll.vote-to%'.replace('{}', choice.text) : ''">
<div
class=
"backdrop"
:style=
"
{ 'width:' + (result ? (choice.votes / total * 100) : 0) + '%' }">
</div>
<span>
<template
v-if=
"is_voted"
>
%fa:check%
</
template
>
<template
v-if=
"
choice.
is_voted"
>
%fa:check%
</
template
>
{{ text }}
<span
class=
"votes"
v-if=
"
parent.
result"
>
({{ '%i18n:common.tags.mk-poll.vote-count%'.replace('{}', votes) }})
</span>
<span
class=
"votes"
v-if=
"result"
>
({{ '%i18n:common.tags.mk-poll.vote-count%'.replace('{}',
choice.
votes) }})
</span>
</span>
</li>
</ul>
<p
v-if=
"total > 0"
>
<span>
{ '%i18n:common.tags.mk-poll.total-users%'.replace('{}', total) }
</span>
<span>
{
{
'%i18n:common.tags.mk-poll.total-users%'.replace('{}', total)
}
}
</span>
・
<a
v-if=
"!isVoted"
@
click=
"toggleResult"
>
{ result ? '%i18n:common.tags.mk-poll.vote%' : '%i18n:common.tags.mk-poll.show-result%' }
</a>
<a
v-if=
"!isVoted"
@
click=
"toggleResult"
>
{
{
result ? '%i18n:common.tags.mk-poll.vote%' : '%i18n:common.tags.mk-poll.show-result%'
}
}
</a>
<span
v-if=
"isVoted"
>
%i18n:common.tags.mk-poll.voted%
</span>
</p>
</div>
...
...
@@ -59,59 +59,55 @@
};
</
script
>
<mk-poll
data-is-voted=
{
isVoted
}
>
<
style
lang=
"stylus"
scoped
>
:scope
display block
<
style
lang=
"stylus"
scoped
>
:scope
> ul
display block
margin 0
padding 0
list-style none
>
u
l
> l
i
display block
margin 0
padding 0
list-style none
> li
display block
margin 4px 0
padding 4px 8px
width 100%
border solid 1px #eee
border-radius 4px
overflow hidden
cursor pointer
&:hover
background rgba(0, 0, 0, 0.05)
&:active
background rgba(0, 0, 0, 0.1)
> .backdrop
position absolute
top 0
left 0
height 100%
background $theme-color
transition width 1s ease
> .votes
margin-left 4px
> p
a
color inherit
&[data-is-voted]
> ul > li
cursor default
&:hover
background transparent
&:active
background transparent
</
style
>
</mk-poll>
margin 4px 0
padding 4px 8px
width 100%
border solid 1px #eee
border-radius 4px
overflow hidden
cursor pointer
&:hover
background rgba(0, 0, 0, 0.05)
&:active
background rgba(0, 0, 0, 0.1)
> .backdrop
position absolute
top 0
left 0
height 100%
background $theme-color
transition width 1s ease
> .votes
margin-left 4px
> p
a
color inherit
&[data-is-voted]
> ul > li
cursor default
&:hover
background transparent
&:active
background transparent
</
style
>
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