Make changes to inventory list in navigation based on new mockup

This commit is contained in:
Mojca Lorber 2019-07-19 16:25:14 +02:00 committed by Urban Rotnik
parent cac7dab440
commit 15432ac851
6 changed files with 25 additions and 34 deletions

View file

@ -107,3 +107,14 @@
}
}
}
#repo-tree {
li .fas {
float: right;
font-size: 11pt;
}
li:not(.active) {
color: $color-silver-chalice;
}
}

View file

@ -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;

View file

@ -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

View file

@ -1,23 +1,23 @@
<%= content_for :sidebar do %>
<div id="slide-panel" class="visible">
<div class="tree">
<div id="repo-tree" class="tree">
<ul>
<% repositories.each do |repository| %>
<%= render partial: "repositories/sidebar_list.html.erb",
locals: { repository: repository } %>
<% end %>
<li class="<%= 'active parent_li' if current_page?(repository_path(repository)) %>" >
<span class="tree-link line-wrap no-indent">
<% if current_page?(repository_path(repository)) %>
<span title="<%= repository.name %>"><%= repository.name %></span>
<% else %>
<%= link_to repository.name,
repository_path(repository),
data: { 'no-turbolink' => 'true' } %>
<% end %>
<% if @team.team_repositories.any? %>
<li >
<span id="shared-repos" class="tree-link line-wrap no-indent">
<%= t('left_menu_bar.repositories_extra.shared_repos') %>
<% if repository.team_repositories.where(team: current_team).any? %>
<i class="fas fa-user-friends"></i>
<% end %>
</span>
</li>
<% @team.shared_repositories.each do |repository| %>
<%= render partial: "repositories/sidebar_list.html.erb",
locals: { repository: repository } %>
<% end %>
<% end %>
</ul>
</div>

View file

@ -1,11 +0,0 @@
<li class="<%= 'active parent_li' if current_page?(repository_path(repository)) %>" >
<span class="tree-link line-wrap no-indent">
<% if current_page?(repository_path(repository)) %>
<span title="<%= repository.name %>"><%= repository.name %></span>
<% else %>
<%= link_to repository.name,
repository_path(repository),
data: { 'no-turbolink' => 'true' } %>
<% end %>
</span>
</li>

View file

@ -127,8 +127,6 @@ en:
left_menu_bar:
projects: "Projects"
repositories: "Inventories"
repositories_extra:
shared_repos: "Shared Inventories"
templates: "Protocols"
reports: "Reports"
settings: "Settings"