diff --git a/app/views/layouts/_block_right.html.haml b/app/views/layouts/_block_right.html.haml index b471101..c6fc398 100644 --- a/app/views/layouts/_block_right.html.haml +++ b/app/views/layouts/_block_right.html.haml @@ -1,2 +1,2 @@ -.border-solid.border.border-gray-200.p-2.pt-5.mr-0.ml-auto.h-full.flex.flex-col.rounded-md{class: 'basis-1/4 max-w-[300px]'} +.border-solid.border.border-gray-200.p-2.pt-5.mb-5.mr-0.flex.rounded-md.justify-between{class: 'basis-full lg:h-full lg:basis-1/4 lg:ml-auto lg:mb-0 lg:max-w-[300px] lg:flex-col lg:justify-normal'} = yield(:block_right) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 17aefa0..4d0b192 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -22,8 +22,8 @@ = render partial: "layouts/buttons" .text-xl.mb-5.mt-5 = yield(:menu_title) - .grow.flex.overflow-y-auto - %div.height-0.overflow-y-auto{class: 'basis-3/4'} + .grow.flex.overflow-y-auto.flex-wrap-reverse{class: 'lg:flex-nowrap'} + %div.height-0.overflow-y-auto.pr-5{class: 'basis-full lg:basis-3/4'} = yield = render partial: "layouts/block_right" = render partial: "layouts/footer" diff --git a/app/views/saved_scenarios/_block_right_menu.html.erb b/app/views/saved_scenarios/_block_right_menu.html.erb index 5d75db1..c3e6e58 100644 --- a/app/views/saved_scenarios/_block_right_menu.html.erb +++ b/app/views/saved_scenarios/_block_right_menu.html.erb @@ -1,97 +1,100 @@ <% content_for :block_right do %> - <%= render(SavedScenarios::NavItem::Component.new( - path: saved_scenario_path(saved_scenario), - title: t('scenario_bar.info'), - icon: 'information-circle', - active: controller_name == 'saved_scenarios' && action_name == 'show') - )%> - <%= render(SavedScenarios::NavItem::Component.new( - path: saved_scenario_path(saved_scenario), - title: t('scenario_bar.history'), - icon: 'clock', - active: controller_name == 'history') - )%> - <%= render(SavedScenarios::NavItem::Component.new( - path: saved_scenario_path(saved_scenario), - title: t('scenario_bar.manage_access'), - icon: 'user-group', - active: controller_name == 'saved_scenario_users') - )%> +
+ <%= render(SavedScenarios::NavItem::Component.new( + path: saved_scenario_path(saved_scenario), + title: t('scenario_bar.info'), + icon: 'information-circle', + active: controller_name == 'saved_scenarios' && action_name == 'show') + )%> + <%= render(SavedScenarios::NavItem::Component.new( + path: saved_scenario_path(saved_scenario), + title: t('scenario_bar.history'), + icon: 'clock', + active: controller_name == 'history') + )%> + <%= render(SavedScenarios::NavItem::Component.new( + path: saved_scenario_path(saved_scenario), + title: t('scenario_bar.manage_access'), + icon: 'user-group', + active: controller_name == 'saved_scenario_users') + )%> +
-
+
- <%= render(Hovercard::Component.new( - path: '', - text: t("scenario_bar.private.description.#{saved_scenario.private}") - )) do %> - <%= render(SavedScenarios::Publish::Component.new( - path_on: publish_saved_scenario_path(saved_scenario), - path_off: unpublish_saved_scenario_path(saved_scenario), - status: saved_scenario.private, - title: t("scenario_bar.private.#{saved_scenario.private}"), - icon_on:'eye-slash', - icon_off: 'eye', - available: saved_scenario.collaborator?(current_user) && !saved_scenario.discarded? - ))%> - <% end %> - <% if current_user&.admin? && !saved_scenario.discarded? %> - <%= render(Hovercard::Component.new( - path: '', - text: t("scenario_bar.featured.description.#{saved_scenario.featured?}") - )) do %> - <%= render(SavedScenarios::NavItem::Component.new( - path: saved_scenario_feature_path(saved_scenario), - title: t("scenario_bar.featured.#{saved_scenario.featured?}"), - icon: saved_scenario.featured? ? 'star' : 'sparkles', - active: controller_name == 'featured_scenarios', - static: true) - )%> - <% end %> - <% end %> - <% if - !(current_user&.admin? && saved_scenario.featured?) && - (saved_scenario.collaborator?(current_user) && !saved_scenario.discarded?)%> <%= render(Hovercard::Component.new( path: '', - text: t("scenario_bar.edit.description") + text: t("scenario_bar.private.description.#{saved_scenario.private}") )) do %> - <%= render(SavedScenarios::NavItem::Component.new( - path: edit_saved_scenario_path(saved_scenario), - title: t("scenario_bar.edit.title"), - icon: 'pencil', - static: true, - active: action_name == 'edit' - ))%> - <% end %> - <% end %> - <% if saved_scenario.collaborator?(current_user)%> - <%= render(Hovercard::Component.new( - path: '', - text: t("scenario_bar.discarded.description.#{saved_scenario.discarded?}") - )) do %> <%= render(SavedScenarios::Publish::Component.new( - path_on: undiscard_saved_scenario_path(saved_scenario), - path_off: discard_saved_scenario_path(saved_scenario), - status: saved_scenario.discarded?, - title: t("scenario_bar.discarded.#{saved_scenario.discarded?}"), - icon_on: 'arrow-uturn-up', - icon_off: 'trash', - available: saved_scenario.collaborator?(current_user) + path_on: publish_saved_scenario_path(saved_scenario), + path_off: unpublish_saved_scenario_path(saved_scenario), + status: saved_scenario.private, + title: t("scenario_bar.private.#{saved_scenario.private}"), + icon_on:'eye-slash', + icon_off: 'eye', + available: saved_scenario.collaborator?(current_user) && !saved_scenario.discarded? ))%> <% end %> - <% end %> - <% if saved_scenario.collaborator?(current_user) && saved_scenario.discarded? %> - <%= render(Hovercard::Component.new( - path: '', - text: t("scenario_bar.destroy.description") - )) do %> - <%= render(SavedScenarios::NavItem::Component.new( - path: confirm_destroy_saved_scenario_path(saved_scenario), - title: t("scenario_bar.destroy.title"), - icon: 'x-mark', - static: true, - data: { turbo_frame: 'modal' } - ))%> + <% if current_user&.admin? && !saved_scenario.discarded? %> + <%= render(Hovercard::Component.new( + path: '', + text: t("scenario_bar.featured.description.#{saved_scenario.featured?}") + )) do %> + <%= render(SavedScenarios::NavItem::Component.new( + path: saved_scenario_feature_path(saved_scenario), + title: t("scenario_bar.featured.#{saved_scenario.featured?}"), + icon: saved_scenario.featured? ? 'star' : 'sparkles', + active: controller_name == 'featured_scenarios', + static: true) + )%> + <% end %> + <% end %> + <% if + !(current_user&.admin? && saved_scenario.featured?) && + (saved_scenario.collaborator?(current_user) && !saved_scenario.discarded?)%> + <%= render(Hovercard::Component.new( + path: '', + text: t("scenario_bar.edit.description") + )) do %> + <%= render(SavedScenarios::NavItem::Component.new( + path: edit_saved_scenario_path(saved_scenario), + title: t("scenario_bar.edit.title"), + icon: 'pencil', + static: true, + active: action_name == 'edit' + ))%> + <% end %> + <% end %> + <% if saved_scenario.collaborator?(current_user)%> + <%= render(Hovercard::Component.new( + path: '', + text: t("scenario_bar.discarded.description.#{saved_scenario.discarded?}") + )) do %> + <%= render(SavedScenarios::Publish::Component.new( + path_on: undiscard_saved_scenario_path(saved_scenario), + path_off: discard_saved_scenario_path(saved_scenario), + status: saved_scenario.discarded?, + title: t("scenario_bar.discarded.#{saved_scenario.discarded?}"), + icon_on: 'arrow-uturn-up', + icon_off: 'trash', + available: saved_scenario.collaborator?(current_user) + ))%> + <% end %> + <% end %> + <% if saved_scenario.collaborator?(current_user) && saved_scenario.discarded? %> + <%= render(Hovercard::Component.new( + path: '', + text: t("scenario_bar.destroy.description") + )) do %> + <%= render(SavedScenarios::NavItem::Component.new( + path: confirm_destroy_saved_scenario_path(saved_scenario), + title: t("scenario_bar.destroy.title"), + icon: 'x-mark', + static: true, + data: { turbo_frame: 'modal' } + ))%> + <% end %> <% end %> - <% end %> +
<% end %>