diff --git a/app/assets/stylesheets/mobile/mobile.scss b/app/assets/stylesheets/mobile/mobile.scss index ec9031692..f2d094d62 100644 --- a/app/assets/stylesheets/mobile/mobile.scss +++ b/app/assets/stylesheets/mobile/mobile.scss @@ -10,7 +10,7 @@ @import "mobile/tags"; @import "mobile/conversations"; @import "mobile/settings"; -@import "mobile/polls"; +@import "mobile/stream_element"; a { color: #2489ce; diff --git a/app/assets/stylesheets/mobile/polls.scss b/app/assets/stylesheets/mobile/polls.scss deleted file mode 100644 index 3cf2748c8..000000000 --- a/app/assets/stylesheets/mobile/polls.scss +++ /dev/null @@ -1,8 +0,0 @@ -.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/assets/stylesheets/mobile/stream_element.scss b/app/assets/stylesheets/mobile/stream_element.scss new file mode 100644 index 000000000..13734c6a9 --- /dev/null +++ b/app/assets/stylesheets/mobile/stream_element.scss @@ -0,0 +1,16 @@ +.stream_element { + .location { + color: $text-grey; + font-size: $font-size-small; + white-space: normal; + } + + .poll { + border-top: 1px solid $border-grey; + margin-top: 20px; + padding-top: 10px; + .poll-head .question { + font-weight: bold; + } + } +} diff --git a/app/views/shared/_post_info.mobile.haml b/app/views/shared/_post_info.mobile.haml index fa262d27e..03d6aa504 100644 --- a/app/views/shared/_post_info.mobile.haml +++ b/app/views/shared/_post_info.mobile.haml @@ -30,3 +30,6 @@ = t('public') - else = t('limited') + - if !post.is_a?(Reshare) and post.location + .location + = t("posts.show.location", location: post.location.address) diff --git a/app/views/status_messages/_poll.mobile.haml b/app/views/status_messages/_poll.mobile.haml new file mode 100644 index 000000000..30dec659f --- /dev/null +++ b/app/views/status_messages/_poll.mobile.haml @@ -0,0 +1,25 @@ +.poll + .poll-head + .poll-stats.pull-right + = t("polls.votes", count: poll.participation_count) + .question + = poll.question + .poll-content + - poll.poll_answers.each do |answer| + .result-row + .result-head + - percentage = 0 + - if poll.participation_count > 0 + - percentage = (answer.vote_count / 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}%" diff --git a/app/views/status_messages/_status_message.mobile.haml b/app/views/status_messages/_status_message.mobile.haml index 774d2da54..52f60ba74 100644 --- a/app/views/status_messages/_status_message.mobile.haml +++ b/app/views/status_messages/_status_message.mobile.haml @@ -17,31 +17,7 @@ %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}%" + = render "status_messages/poll", poll: post.poll - if post.o_embed_cache != o_embed_html post.o_embed_cache - if post.open_graph_cache diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 85e597c7e..20f166c0c 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -985,6 +985,7 @@ en: presenter: title: "A post from %{name}" show: + location: "Posted from: %{location}" destroy: "Delete" permalink: "Permalink" not_found: "Sorry, we couldn’t find that post."