Display polls on mobile devices
This commit is contained in:
parent
dce2101d9d
commit
5d39461443
4 changed files with 42 additions and 1 deletions
|
|
@ -10,6 +10,7 @@
|
||||||
@import "mobile/tags";
|
@import "mobile/tags";
|
||||||
@import "mobile/conversations";
|
@import "mobile/conversations";
|
||||||
@import "mobile/settings";
|
@import "mobile/settings";
|
||||||
|
@import "mobile/polls";
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: #2489ce;
|
color: #2489ce;
|
||||||
|
|
|
||||||
8
app/assets/stylesheets/mobile/polls.scss
Normal file
8
app/assets/stylesheets/mobile/polls.scss
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
.stream_element .poll {
|
||||||
|
border-top: 1px solid $border-grey;
|
||||||
|
margin-top: 20px;
|
||||||
|
padding-top: 10px;
|
||||||
|
.poll-head .question {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -16,8 +16,34 @@
|
||||||
|
|
||||||
%div{:class => direction_for(post.text)}
|
%div{:class => direction_for(post.text)}
|
||||||
!= post.message.markdownified
|
!= post.message.markdownified
|
||||||
|
- if post.poll
|
||||||
|
.poll
|
||||||
|
.poll-head
|
||||||
|
.poll-stats.pull-right
|
||||||
|
= t("polls.votes", count: post.poll.participation_count)
|
||||||
|
.question
|
||||||
|
= post.poll.question
|
||||||
|
.poll-content
|
||||||
|
- post.poll.poll_answers.each do |answer|
|
||||||
|
.result-row
|
||||||
|
.result-head
|
||||||
|
- percentage = 0
|
||||||
|
- if post.poll.participation_count > 0
|
||||||
|
- percentage = (answer.vote_count / post.poll.participation_count * 100).round
|
||||||
|
.percentage.pull-right
|
||||||
|
= "#{percentage}%"
|
||||||
|
.answer
|
||||||
|
= answer.answer
|
||||||
|
.progress
|
||||||
|
.progress-bar{role: "progressbar",
|
||||||
|
aria: {valuenow: "#{percentage}",
|
||||||
|
valuemin: "0",
|
||||||
|
valuemax: "100"},
|
||||||
|
style: "width: #{percentage}%;"}
|
||||||
|
%span.sr-only
|
||||||
|
= "#{percentage}%"
|
||||||
- if post.o_embed_cache
|
- if post.o_embed_cache
|
||||||
!= o_embed_html post.o_embed_cache
|
!= o_embed_html post.o_embed_cache
|
||||||
-if post.open_graph_cache
|
- if post.open_graph_cache
|
||||||
.opengraph
|
.opengraph
|
||||||
!= og_html post.open_graph_cache
|
!= og_html post.open_graph_cache
|
||||||
|
|
|
||||||
|
|
@ -975,6 +975,12 @@ en:
|
||||||
or_select_one_existing: "or select one from your already existing %{photos}"
|
or_select_one_existing: "or select one from your already existing %{photos}"
|
||||||
comment_email_subject: "%{name}’s photo"
|
comment_email_subject: "%{name}’s photo"
|
||||||
|
|
||||||
|
polls:
|
||||||
|
votes:
|
||||||
|
zero: "%{count} votes so far"
|
||||||
|
one: "%{count} vote so far"
|
||||||
|
other: "%{count} votes so far"
|
||||||
|
|
||||||
posts:
|
posts:
|
||||||
presenter:
|
presenter:
|
||||||
title: "A post from %{name}"
|
title: "A post from %{name}"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue