Adding views for the profile and entry pages
This commit is contained in:
parent
f16b31f077
commit
24646d5769
13 changed files with 177 additions and 7 deletions
|
@ -7,4 +7,5 @@
|
|||
= javascript_include_tag 'application'
|
||||
= csrf_meta_tags
|
||||
%body
|
||||
= yield
|
||||
.container
|
||||
= yield
|
||||
|
|
7
app/views/profile/_status.html.haml
Normal file
7
app/views/profile/_status.html.haml
Normal 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 }
|
7
app/views/profile/_status_footer.html.haml
Normal file
7
app/views/profile/_status_footer.html.haml
Normal 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
|
8
app/views/profile/_status_header.html.haml
Normal file
8
app/views/profile/_status_header.html.haml
Normal 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
|
2
app/views/profile/entry.html.haml
Normal file
2
app/views/profile/entry.html.haml
Normal file
|
@ -0,0 +1,2 @@
|
|||
%div.activity-stream
|
||||
= render partial: @type, locals: { @type.to_sym => @entry.activity }
|
|
@ -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 }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue