From 22ae1f6655db1067d691816a563f65288bfc8328 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 5 May 2020 04:31:15 +0200 Subject: [PATCH] Adjust navigation layout on main feed pages --- app/views/layouts/feed.haml | 2 +- app/views/shared/_sidebar.haml | 14 ++++---------- app/views/tabs/_feed.haml | 25 +++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 11 deletions(-) create mode 100644 app/views/tabs/_feed.haml diff --git a/app/views/layouts/feed.haml b/app/views/layouts/feed.haml index 3f373b6d..dff4d4f9 100644 --- a/app/views/layouts/feed.haml +++ b/app/views/layouts/feed.haml @@ -1,9 +1,9 @@ -= render 'navigation/feed' .container.container--main .row .col-md-3.col-sm-4.d-none.d-sm-block = render 'shared/sidebar' .col-md-9.col-xs-12.col-sm-8 = render 'layouts/messages' + = render 'tabs/feed' = yield .d-block.d-sm-none= render 'shared/links' \ No newline at end of file diff --git a/app/views/shared/_sidebar.haml b/app/views/shared/_sidebar.haml index 555d3079..205d49ad 100644 --- a/app/views/shared/_sidebar.haml +++ b/app/views/shared/_sidebar.haml @@ -8,18 +8,12 @@ = current_user.display_name .profile__screen-name = current_user.screen_name -.card - .list-group - = list_group_item t('views.general.timeline'), root_path - - if APP_CONFIG.dig(:features, :public, :enabled) - = list_group_item t('views.general.public'), public_timeline_path - - current_user.groups.each do |group| - = list_group_item group.display_name, group_timeline_path(group.name) - unless @group.nil? - .card.profile--panel - .card-header - %h3.card-title= t('views.group.members') + .card + .card-header= t('views.group.members') .card-body + - if @group.members.empty? + %p.text-muted No members yet! - @group.members.each do |member| %a{href: show_user_profile_path(member.user.screen_name), title: member.user.screen_name, data: { toggle: :tooltip, placement: :top }} %img.avatar-xs{src: member.user.profile_picture.url(:medium)} diff --git a/app/views/tabs/_feed.haml b/app/views/tabs/_feed.haml new file mode 100644 index 00000000..a5cd710d --- /dev/null +++ b/app/views/tabs/_feed.haml @@ -0,0 +1,25 @@ +.card + .list-group.list-group-horizontal-sm.text-center + = list_group_item t('views.general.timeline'), root_path + - if APP_CONFIG.dig(:features, :public, :enabled) + = list_group_item t('views.general.public'), public_timeline_path + .list-group-item.list-group-item-action.dropdown{class: "#{'active' if @group}"} + %a.dropdown-toggle{ type: 'button', data: { toggle: 'dropdown' }, aria: { haspopup: true, expanded: false }} + - if @group + = @group.display_name + - else + Groups + .dropdown-menu + - if current_user.groups.empty? + .p-3 + %p Looks like you don't have any groups yet! + %p + You can create groups and add users to them using the + %i.fa.fa-fw.fa-users + icon in the navigation on user profiles (that are not yours) + %p.mb-0 + Once you have done that, the groups will be listed here and + if selected, you'll get a timeline view of all users from + that group! + - current_user.groups.each do |group| + %a.dropdown-item{ href: group_timeline_path(group.name) }= group.display_name \ No newline at end of file