-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
92 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') | ||
)%> | ||
<div class="flex flex-col"> | ||
<%= 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') | ||
)%> | ||
</div> | ||
|
||
<div class="border-t border-solid border-gray-200 my-10"></div> | ||
<div class="border-l lg:border-l-0 lg:border-t flex flex-col border-solid border-gray-200 pr-5 lg:pr-0 lg:mt-10 lg:pt-10"> | ||
|
||
<%= 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 %> | ||
</div> | ||
<% end %> |