Merge pull request #1099 from mlorb/ml-sci-2167

Remove breadcrumbs throughout application [SCI-2167]
This commit is contained in:
mlorb 2018-04-19 16:11:37 +02:00 committed by GitHub
commit d7eccac289
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 32 additions and 158 deletions

View file

@ -10,7 +10,7 @@
);
$('#wrapper').css('paddingLeft', '280px');
$('.navbar-secondary').css(
{ 'margin-left': '-280px', 'padding-left': '280px' }
{ 'margin-left': '-280px', 'padding-left': '295px' }
);
}
@ -23,7 +23,7 @@
$('#wrapper').css('paddingLeft', '0');
$('.navbar-secondary').css({
'margin-left': '0',
'padding-left': '0'
'padding-left': '15px'
});
}

View file

@ -222,7 +222,7 @@ a[data-toggle="tooltip"] {
#secondary-navigation {
white-space: nowrap;
overflow: hidden
overflow: hidden;
}
.panel-body {
@ -253,6 +253,19 @@ a[data-toggle="tooltip"] {
border-right: 0;
border-bottom: 4px solid $color-silver;
padding-right: 0;
padding-left: 0;
}
.navbar-toggle {
margin-right: 100px;
}
#secondary-menu {
padding-left: 0;
}
.nav-name {
padding: 15px 0;
}
ul.nav {
@ -409,13 +422,6 @@ a[data-toggle="tooltip"] {
}
/** Protocols management */
.breadcrumb-protocols-manager {
overflow: visible;
margin-top: 15px;
margin-bottom: 15px;
background-color: $color-white;
}
.tab-pane-protocols {
& > div.protocols-description {
margin-bottom: 15px;

View file

@ -55,4 +55,14 @@ module SecondaryNavigationHelper
def is_module_archive?
action_name == 'archive'
end
def title_element
if project_page?
@project
elsif experiment_page?
@experiment
elsif module_page?
@my_module
end
end
end

View file

@ -1,14 +0,0 @@
<ol class="breadcrumb breadcrumb-protocols-manager">
<% if action_name == "index" %>
<li><%= link_to current_team.name, projects_path(team: current_team) %></li>
<li class="active"><%= t("protocols.nav.breadcrumbs.manager") %></li>
<% else %>
<li><%= link_to current_team.name, projects_path(team: current_team) %></li>
<li><%= link_to t("protocols.nav.breadcrumbs.manager"), protocols_path(team: current_team, type: type) %></li>
<% end %>
<% if action_name == "edit" %>
<li class="active">
<%= t("protocols.nav.breadcrumbs.edit") %>
</li>
<% end %>
</ol>

View file

@ -1,10 +1,6 @@
<% provide(:head_title, t("protocols.edit.head_title")) %>
<%= render partial: 'shared/drag_n_drop_overlay' %>
<%= render partial: "protocols/breadcrumbs.html.erb",
locals: { teams: @teams,
current_team: @protocol.team,
type: @type } %>
<%= render partial: "protocols/header.html.erb" %>

View file

@ -2,7 +2,6 @@
<% provide(:head_title, t("protocols.index.head_title")) %>
<% if current_team %>
<%= render partial: "protocols/breadcrumbs.html.erb", locals: { teams: @teams, current_team: @current_team, type: @type } %>
<ul class="nav nav-tabs nav-settings">
<li role="presentation" class="<%= "active" if @type == :public %>">
<%= link_to t("protocols.index.navigation.public"), protocols_path(team: @current_team, type: :public) %>

View file

@ -1,4 +0,0 @@
<ol class="breadcrumb breadcrumb-protocols-manager">
<li><%= link_to current_team.name, projects_path(team: current_team) %></li>
<li class="active"><%= t("repositories.nav.breadcrumbs.repositories") %></li>
</ol>

View file

@ -10,58 +10,6 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Breadcrumbs, displayed on small screens -->
<ul class="breadcrumb hidden-sm hidden-md hidden-lg">
<li>
<% if can_read_team?(@project.team) %>
<a href="<%= projects_path :team => @project.team.id %>">
<span class="glyphicon glyphicon-folder-open"></span>
</a>
<% else %>
<span class="glyphicon glyphicon-folder-open"></span>
<% end %>
</li>
<% if project_page? ||
sample_types_page_project? ||
sample_groups_page_project? %>
<li class="active">
<span class="glyphicon glyphicon-blackboard"></span>
</li>
<% else %>
<li>
<% if can_read_project?(@project) %>
<a href="<%= project_url(@project) %>">
<span class="glyphicon glyphicon-blackboard"></span>
</a>
<% else %>
<span class="glyphicon glyphicon-blackboard"></span>
<% end %>
</li>
<% end %>
<% if experiment_page? %>
<li class="active">
<i class="fas fa-flask"></i>
</li>
<% elsif module_page? %>
<li>
<% if can_read_experiment?(@experiment) %>
<%= link_to canvas_experiment_path(@experiment) do %>
<i class="fas fa-flask"></i>
<% end %>
<% else %>
<i class="fas fa-flask"></i>
<% end %>
</li>
<li class="active">
<span class="glyphicon glyphicon-credit-card"></span>
</li>
<% elsif experiment_page? %>
<li class="active">
<i class="fas fa-flask"></i>
</li>
<% end %>
</ul>
</div>
<!-- buttons -->
@ -212,72 +160,12 @@
<% end %>
</ul>
<!-- Breadcrumbs, displayed on large screens -->
<ul class="breadcrumb hidden-xs">
<li>
<% if can_read_team?(@project.team) %>
<a href="<%= projects_path :team => @project.team.id %>">
<%= truncate(@project.team.name,
length: Constants::NAME_TRUNCATION_LENGTH) %>
</a>
<% else %>
<%= truncate(@project.team.name,
length: Constants::NAME_TRUNCATION_LENGTH) %>
<% end %>
</li>
<% if project_page? %>
<li class="active">
<%= truncate(@project.name,
length: Constants::NAME_TRUNCATION_LENGTH) %>
</li>
<% else %>
<li>
<% if can_read_project?(@project) %>
<a href="<%= project_url(@project) %>">
<%= truncate(@project.name,
length: Constants::NAME_TRUNCATION_LENGTH) %>
</a>
<% else %>
<%= truncate(@project.name,
length: Constants::NAME_TRUNCATION_LENGTH) %>
<% end %>
</li>
<% end %>
<% if experiment_page? ||
module_page? ||
sample_types_page_my_module? ||
sample_groups_page_my_module? ||
sample_groups_page_experiment? ||
sample_types_page_expermient? %>
<% if !module_page? &&
!sample_types_page_my_module? &&
!sample_groups_page_my_module? %>
<li class="active">
<%= truncate(@experiment.name,
length: Constants::NAME_TRUNCATION_LENGTH) %>
</li>
<% else %>
<li>
<% if can_read_experiment?(@experiment) %>
<%= link_to truncate(@experiment.name,
length: Constants::NAME_TRUNCATION_LENGTH),
canvas_experiment_path(@experiment) %>
<% else %>
<%= truncate(@experiment.name,
length: Constants::NAME_TRUNCATION_LENGTH) %>
<% end %>
</li>
<% end %>
<% end %>
<% if module_page? ||
sample_types_page_my_module? ||
sample_groups_page_my_module? %>
<li class="active">
<%= truncate(@my_module.name,
length: Constants::NAME_TRUNCATION_LENGTH) %>
</li>
<% end %>
</ul>
<!-- Secondary navigation title -->
<div class="nav-name">
<%= truncate(title_element.name,
length: Constants::NAME_TRUNCATION_LENGTH) %>
</div>
</div>
</div>
</nav>

View file

@ -917,9 +917,6 @@ en:
name_placeholder: "My inventory"
submit: "Create inventory"
success_flash: "Inventory <strong>%{name}</strong> successfully created."
nav:
breadcrumbs:
repositories: "Inventories"
table:
id: 'ID'
assigned: "Assigned"
@ -1449,10 +1446,6 @@ en:
leave_flash: "Successfuly left team %{team}."
protocols:
nav:
breadcrumbs:
manager: "Protocol management"
edit: "Edit protocol"
protocols_io_import:
title_too_long: "... Text is too long so we had to cut it off."
too_long: "... <span class='label label-warning'>Text is too long so we had to cut it off.</span>"