diff --git a/app/assets/stylesheets/mobile/mobile.scss b/app/assets/stylesheets/mobile/mobile.scss index 45f3fbe6b..ec9031692 100644 --- a/app/assets/stylesheets/mobile/mobile.scss +++ b/app/assets/stylesheets/mobile/mobile.scss @@ -10,6 +10,7 @@ @import "mobile/tags"; @import "mobile/conversations"; @import "mobile/settings"; +@import "mobile/polls"; a { color: #2489ce; diff --git a/app/assets/stylesheets/mobile/polls.scss b/app/assets/stylesheets/mobile/polls.scss new file mode 100644 index 000000000..3cf2748c8 --- /dev/null +++ b/app/assets/stylesheets/mobile/polls.scss @@ -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; + } +} diff --git a/app/views/status_messages/_status_message.mobile.haml b/app/views/status_messages/_status_message.mobile.haml index 5aba5358d..774d2da54 100644 --- a/app/views/status_messages/_status_message.mobile.haml +++ b/app/views/status_messages/_status_message.mobile.haml @@ -16,8 +16,34 @@ %div{:class => direction_for(post.text)} != 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 != o_embed_html post.o_embed_cache - -if post.open_graph_cache + - if post.open_graph_cache .opengraph != og_html post.open_graph_cache diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 969360426..85e597c7e 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -975,6 +975,12 @@ en: or_select_one_existing: "or select one from your already existing %{photos}" comment_email_subject: "%{name}’s photo" + polls: + votes: + zero: "%{count} votes so far" + one: "%{count} vote so far" + other: "%{count} votes so far" + posts: presenter: title: "A post from %{name}"