Adding views for the profile and entry pages

This commit is contained in:
Eugen Rochko 2016-02-26 20:48:20 +01:00
parent f16b31f077
commit 24646d5769
13 changed files with 177 additions and 7 deletions

View file

@ -7,4 +7,5 @@
= javascript_include_tag 'application'
= csrf_meta_tags
%body
= yield
.container
= yield

View file

@ -0,0 +1,7 @@
%div.entry
.header
= render partial: 'status_header', locals: { status: status.reblog? ? status.reblog : status }
.content
= status.content
.counters
= render partial: 'status_footer', locals: { status: status.reblog? ? status.reblog : status }

View file

@ -0,0 +1,7 @@
.counter.counter-retweets
%i.fa.fa-retweet
%span.num= status.reblogs.count
.counter.counter-favourites
%i.fa.fa-star
%span.num= status.favourites.count

View file

@ -0,0 +1,8 @@
= link_to (status.account.local? ? profile_url(name: status.account.username) : status.account.url), class: 'name' do
%strong= status.account.display_name.blank? ? status.account.username : status.account.display_name
= "@#{status.account.acct}"
= link_to status.local? ? status_url(name: status.account.username, id: status.stream_entry.id) : status.url, class: 'time' do
%span{ title: status.created_at }
= time_ago_in_words(status.created_at)
ago

View file

@ -0,0 +1,2 @@
%div.activity-stream
= render partial: @type, locals: { @type.to_sym => @entry.activity }

View file

@ -1,2 +1,8 @@
%h1 Profile#show
%p Find me in app/views/profile/show.html.haml
%div.card
%h1.name
= @account.display_name.blank? ? @account.username : @account.display_name
%small= "@#{@account.username}"
%div.activity-stream
- @account.statuses.order('id desc').each do |status|
= render partial: 'status', locals: { status: status }