Display locations on mobile devices

This commit is contained in:
Steffen van Bergerem 2015-07-23 15:52:59 +02:00
parent 5d39461443
commit 6fafa731e6
7 changed files with 47 additions and 34 deletions

View file

@ -10,7 +10,7 @@
@import "mobile/tags";
@import "mobile/conversations";
@import "mobile/settings";
@import "mobile/polls";
@import "mobile/stream_element";
a {
color: #2489ce;

View file

@ -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;
}
}

View file

@ -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;
}
}
}

View file

@ -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)

View file

@ -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}%"

View file

@ -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

View file

@ -985,6 +985,7 @@ en:
presenter:
title: "A post from %{name}"
show:
location: "Posted from: %{location}"
destroy: "Delete"
permalink: "Permalink"
not_found: "Sorry, we couldnt find that post."