Cleaning up status partial

This commit is contained in:
Eugen Rochko 2016-03-26 14:42:05 +01:00
parent 6c480c8429
commit 882c94a6bf
3 changed files with 23 additions and 12 deletions

View file

@ -14,7 +14,7 @@
&.entry-predecessor, &.entry-successor { &.entry-predecessor, &.entry-successor {
background: #d9e1e8; background: #d9e1e8;
border-left-color: #d9e1e8; border-left-color: #d9e1e8;
border-bottom-color: darken(#d9e1e8, 15%); border-bottom-color: darken(#d9e1e8, 10%);
.header { .header {
.header__right { .header__right {
@ -25,6 +25,10 @@
} }
} }
&.entry-center {
border-bottom-color: darken(#d9e1e8, 10%);
}
&.entry-follow, &.entry-favourite { &.entry-follow, &.entry-favourite {
.content { .content {
padding-top: 10px; padding-top: 10px;

View file

@ -27,4 +27,8 @@ module StreamEntriesHelper
def favourited_by_me_class(status) def favourited_by_me_class(status)
user_signed_in? && current_user.account.favourited?(status) ? 'favourited' : '' user_signed_in? && current_user.account.favourited?(status) ? 'favourited' : ''
end end
def proper_status(status)
status.reblog? ? status.reblog : status
end
end end

View file

@ -1,6 +1,7 @@
- include_threads ||= false - include_threads ||= false
- is_predecessor ||= false - is_predecessor ||= false
- is_successor ||= false - is_successor ||= false
- centered = include_threads && !is_predecessor && !is_successor
- if status.reply? && include_threads - if status.reply? && include_threads
- status.ancestors.with_includes.with_counters.each do |status| - status.ancestors.with_includes.with_counters.each do |status|
@ -20,20 +21,22 @@
.entry__container__container .entry__container__container
.header .header
.header__left .header__left
= link_to url_for_target(status.reblog? ? status.reblog.account : status.account), class: 'name' do = link_to url_for_target(proper_status(status).account), class: 'name' do
%strong= display_name(status.reblog? ? status.reblog.account : status.account) %strong= display_name(proper_status(status).account)
= "@#{status.reblog? ? status.reblog.account.acct : status.account.acct}" = "@#{proper_status(status).account.acct}"
= link_to url_for_target(status.reblog? ? status.reblog : status), class: 'time' do = link_to url_for_target(proper_status(status)), class: 'time' do
%span{ title: status.reblog? ? status.reblog.created_at : status.created_at } %span{ title: proper_status(status).created_at }
= relative_time(status.reblog? ? status.reblog.created_at : status.created_at) = relative_time(proper_status(status).created_at)
.header__right .header__right
.counter-btn{ class: reblogged_by_me_class(status) } .counter-btn{ class: reblogged_by_me_class(proper_status(status)) }
%i.fa.fa-retweet %i.fa.fa-retweet
%span.counter-number= status.reblog? ? status.reblog.reblogs_count : status.reblogs_count %span.counter-number= proper_status(status).reblogs_count
.counter-btn{ class: favourited_by_me_class(status) } .counter-btn{ class: favourited_by_me_class(proper_status(status)) }
%i.fa.fa-star %i.fa.fa-star
%span.counter-number= status.reblog? ? status.reblog.favourites_count : status.favourites_count %span.counter-number= proper_status(status).favourites_count
.content= content_for_status(status.reblog? ? status.reblog : status)
.content= content_for_status(proper_status(status))
- if include_threads - if include_threads
- status.descendants.with_includes.with_counters.each do |status| - status.descendants.with_includes.with_counters.each do |status|