Display locations on mobile devices
This commit is contained in:
parent
5d39461443
commit
6fafa731e6
7 changed files with 47 additions and 34 deletions
|
|
@ -10,7 +10,7 @@
|
|||
@import "mobile/tags";
|
||||
@import "mobile/conversations";
|
||||
@import "mobile/settings";
|
||||
@import "mobile/polls";
|
||||
@import "mobile/stream_element";
|
||||
|
||||
a {
|
||||
color: #2489ce;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
16
app/assets/stylesheets/mobile/stream_element.scss
Normal file
16
app/assets/stylesheets/mobile/stream_element.scss
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
25
app/views/status_messages/_poll.mobile.haml
Normal file
25
app/views/status_messages/_poll.mobile.haml
Normal 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}%"
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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."
|
||||
|
|
|
|||
Loading…
Reference in a new issue