From 15432ac851feecca68f4449558b91b10ff4faa1b Mon Sep 17 00:00:00 2001 From: Mojca Lorber Date: Fri, 19 Jul 2019 16:25:14 +0200 Subject: [PATCH] Make changes to inventory list in navigation based on new mockup --- .../stylesheets/partials/_tree_view.scss | 11 ++++++++ app/assets/stylesheets/repositories.scss | 7 ----- app/controllers/repositories_controller.rb | 2 +- app/views/repositories/_sidebar.html.erb | 26 +++++++++---------- app/views/repositories/_sidebar_list.html.erb | 11 -------- config/locales/en.yml | 2 -- 6 files changed, 25 insertions(+), 34 deletions(-) delete mode 100644 app/views/repositories/_sidebar_list.html.erb diff --git a/app/assets/stylesheets/partials/_tree_view.scss b/app/assets/stylesheets/partials/_tree_view.scss index 93cb6d3a4..0fffdaad0 100644 --- a/app/assets/stylesheets/partials/_tree_view.scss +++ b/app/assets/stylesheets/partials/_tree_view.scss @@ -107,3 +107,14 @@ } } } + +#repo-tree { + li .fas { + float: right; + font-size: 11pt; + } + + li:not(.active) { + color: $color-silver-chalice; + } +} diff --git a/app/assets/stylesheets/repositories.scss b/app/assets/stylesheets/repositories.scss index 62cbf9156..90fff0398 100644 --- a/app/assets/stylesheets/repositories.scss +++ b/app/assets/stylesheets/repositories.scss @@ -1,12 +1,5 @@ @import "constants"; -#shared-repos { - background-color: $color-concrete; - font-size: 14px; - font-weight: bolder; - padding: 5px 10px; -} - .repositories-dropdown-menu { height: auto; max-height: 400px; diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index ee7fd5266..5106ebd0d 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -303,7 +303,7 @@ class RepositoriesController < ApplicationController def load_parent_vars @team = current_team render_404 unless @team - @repositories = @team.repositories.order(created_at: :asc) + @repositories = (@team.repositories + @team.shared_repositories).uniq.sort_by(&:created_at) end def check_team diff --git a/app/views/repositories/_sidebar.html.erb b/app/views/repositories/_sidebar.html.erb index 1734927ca..7f50339cd 100644 --- a/app/views/repositories/_sidebar.html.erb +++ b/app/views/repositories/_sidebar.html.erb @@ -1,23 +1,23 @@ <%= content_for :sidebar do %>
-
+
    <% repositories.each do |repository| %> - <%= render partial: "repositories/sidebar_list.html.erb", - locals: { repository: repository } %> - <% end %> +
  • + + <% if current_page?(repository_path(repository)) %> + <%= repository.name %> + <% else %> + <%= link_to repository.name, + repository_path(repository), + data: { 'no-turbolink' => 'true' } %> + <% end %> - <% if @team.team_repositories.any? %> -
  • - - <%= t('left_menu_bar.repositories_extra.shared_repos') %> + <% if repository.team_repositories.where(team: current_team).any? %> + + <% end %>
  • - - <% @team.shared_repositories.each do |repository| %> - <%= render partial: "repositories/sidebar_list.html.erb", - locals: { repository: repository } %> - <% end %> <% end %>
diff --git a/app/views/repositories/_sidebar_list.html.erb b/app/views/repositories/_sidebar_list.html.erb deleted file mode 100644 index 32f792aff..000000000 --- a/app/views/repositories/_sidebar_list.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -
  • - - <% if current_page?(repository_path(repository)) %> - <%= repository.name %> - <% else %> - <%= link_to repository.name, - repository_path(repository), - data: { 'no-turbolink' => 'true' } %> - <% end %> - -
  • diff --git a/config/locales/en.yml b/config/locales/en.yml index 626fdd66c..7da81cce0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -127,8 +127,6 @@ en: left_menu_bar: projects: "Projects" repositories: "Inventories" - repositories_extra: - shared_repos: "Shared Inventories" templates: "Protocols" reports: "Reports" settings: "Settings"