From 24646d57690ad36cf4caecab2eec5774bca7f699 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 26 Feb 2016 20:48:20 +0100 Subject: Adding views for the profile and entry pages --- app/views/layouts/application.html.haml | 3 ++- app/views/profile/_status.html.haml | 7 +++++++ app/views/profile/_status_footer.html.haml | 7 +++++++ app/views/profile/_status_header.html.haml | 8 ++++++++ app/views/profile/entry.html.haml | 2 ++ app/views/profile/show.html.haml | 10 ++++++++-- 6 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 app/views/profile/_status.html.haml create mode 100644 app/views/profile/_status_footer.html.haml create mode 100644 app/views/profile/_status_header.html.haml create mode 100644 app/views/profile/entry.html.haml (limited to 'app/views') diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 0cb4e96e8..c46fb0b33 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -7,4 +7,5 @@ = javascript_include_tag 'application' = csrf_meta_tags %body - = yield + .container + = yield diff --git a/app/views/profile/_status.html.haml b/app/views/profile/_status.html.haml new file mode 100644 index 000000000..39e70b69c --- /dev/null +++ b/app/views/profile/_status.html.haml @@ -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 } diff --git a/app/views/profile/_status_footer.html.haml b/app/views/profile/_status_footer.html.haml new file mode 100644 index 000000000..0c47ade90 --- /dev/null +++ b/app/views/profile/_status_footer.html.haml @@ -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 diff --git a/app/views/profile/_status_header.html.haml b/app/views/profile/_status_header.html.haml new file mode 100644 index 000000000..6f0e8748e --- /dev/null +++ b/app/views/profile/_status_header.html.haml @@ -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 diff --git a/app/views/profile/entry.html.haml b/app/views/profile/entry.html.haml new file mode 100644 index 000000000..8d0b23607 --- /dev/null +++ b/app/views/profile/entry.html.haml @@ -0,0 +1,2 @@ +%div.activity-stream + = render partial: @type, locals: { @type.to_sym => @entry.activity } diff --git a/app/views/profile/show.html.haml b/app/views/profile/show.html.haml index dcb5764ec..c84cb7e81 100644 --- a/app/views/profile/show.html.haml +++ b/app/views/profile/show.html.haml @@ -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 } -- cgit