Add sticky toolbar for projects page [SCI-5401] (#3108)

* Add sticky toolbar for projects page [SCI-5401]
This commit is contained in:
aignatov-bio 2021-01-25 15:36:23 +01:00 committed by GitHub
parent cea61a6bd2
commit 8396c086f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 437 additions and 401 deletions

View file

@ -762,8 +762,6 @@ li.module-hover {
} }
.projects-toolbar { .projects-toolbar {
margin-bottom: 1em;
.form-group { .form-group {
width: 100%; width: 100%;
} }
@ -1157,10 +1155,14 @@ li.module-hover {
display: flex; display: flex;
height: 3em; height: 3em;
padding: 0 .5em; padding: 0 .5em;
position: sticky;
position: -webkit-sticky;
top: 13em;
width: calc(100% + 1em);
z-index: 2;
&.select-all-checkboxes { &.select-all-checkboxes {
justify-content: center; justify-content: center;
position: relative;
} }
} }

View file

@ -31,11 +31,13 @@
#repository-toolbar { #repository-toolbar {
.title-row {
align-items: center; align-items: center;
background-color: $color-white; background-color: $color-white;
border: 0; border: 0;
display: flex; display: flex;
left: var(--repository-sidebar-margin); left: var(--repository-sidebar-margin);
margin-left: 0em;
padding: 0 2em; padding: 0 2em;
position: fixed; position: fixed;
transition: .4s $timing-function-sharp; transition: .4s $timing-function-sharp;
@ -45,8 +47,9 @@
.toolbar-delimiter { .toolbar-delimiter {
border-bottom: $border-tertiary; border-bottom: $border-tertiary;
bottom: 0; bottom: 0;
margin-left: -2em;
position: absolute; position: absolute;
width: calc(100% - 4em); width: 100%;
} }
.repository-share-icon { .repository-share-icon {
@ -94,6 +97,7 @@
} }
} }
} }
}
.repository-archived-title-name { .repository-archived-title-name {
@include font-h1; @include font-h1;

View file

@ -1,3 +1,6 @@
// scss-lint:disable SelectorDepth SelectorFormat
// scss-lint:disable NestingDepth QualifyingElement
.content-pane { .content-pane {
background-color: $color-white; background-color: $color-white;
margin: 20px 0; margin: 20px 0;
@ -9,10 +12,22 @@
} }
.content-header { .content-header {
&.sticky-header {
background: $color-white;
position: sticky;
position: -webkit-sticky;
top: var(--navbar-height);
z-index: 10;
}
.title-row {
align-items: center; align-items: center;
border-bottom: $border-tertiary; border-bottom: $border-tertiary;
display: flex; display: flex;
height: 5em; height: 5em;
margin-left: -2em;
padding-left: 2em;
width: calc(100% + 4em);
h1 { h1 {
flex-grow: 1; flex-grow: 1;
@ -25,9 +40,10 @@
.caret { .caret {
margin: 8px 0 8px 8px; margin: 8px 0 8px 8px;
} }
&.open { &.open {
.caret { .caret {
transform: rotateX(180deg) transform: rotateX(180deg);
} }
} }
@ -52,7 +68,12 @@
} }
} }
.content-body { .toolbar-row {
border-bottom: $border-tertiary;
margin-left: -2em;
padding: 1em 0;
padding-left: 2em;
width: calc(100% + 4em);
}
} }
} }

View file

@ -21,9 +21,7 @@
<%= render partial: 'projects/index/modals/export_projects' %> <%= render partial: 'projects/index/modals/export_projects' %>
<div class="projects-container"> <div class="projects-container">
<div id="toolbarWrapper"> <div class="cards-wrapper" id="cardsWrapper" data-projects-cards-url="<%= @current_folder ? project_folder_cards_url(@current_folder) : cards_projects_url %>">
</div>
<div class="cards-wrapper" id="cardsWrapper" data-projects-cards-url="<%= current_folder ? project_folder_cards_url(current_folder) : cards_projects_url %>">
<div class="table-header"> <div class="table-header">
<div class="table-header-cell select-all-checkboxes"> <div class="table-header-cell select-all-checkboxes">
<div class="sci-checkbox-container"> <div class="sci-checkbox-container">

View file

@ -1,4 +1,5 @@
<div class="content-header"> <div class="content-header sticky-header">
<div class="title-row">
<h1 data-view-mode="active"><%= t('projects.index.head_title') %></h1> <h1 data-view-mode="active"><%= t('projects.index.head_title') %></h1>
<h1 data-view-mode="archived"><i class="fas fa-archive"></i>&nbsp;<%= t('projects.index.head_title_archived') %></h1> <h1 data-view-mode="archived"><i class="fas fa-archive"></i>&nbsp;<%= t('projects.index.head_title_archived') %></h1>
@ -165,4 +166,7 @@
</ul> </ul>
</div> </div>
</div> </div>
</div>
<div id="toolbarWrapper" class="toolbar-row">
</div>
</div> </div>

View file

@ -1,4 +1,5 @@
<div class="content-header"> <div class="content-header">
<div class="title-row">
<h1 class="project-name"> <h1 class="project-name">
<% if @inline_editable_title_config.present? %> <% if @inline_editable_title_config.present? %>
<%= render partial: "shared/inline_editing", <%= render partial: "shared/inline_editing",
@ -32,4 +33,5 @@
</ul> </ul>
</div> </div>
</div> </div>
</div>
</div> </div>

View file

@ -10,6 +10,7 @@
<div class="content-pane flexible <%= params[:archived] ? :archived : :active %> repositories-index" <div class="content-pane flexible <%= params[:archived] ? :archived : :active %> repositories-index"
data-readonly="<%= !current_user.is_admin_of_team?(current_team) %>"> data-readonly="<%= !current_user.is_admin_of_team?(current_team) %>">
<div class="content-header"> <div class="content-header">
<div class="title-row">
<h1 data-view-mode="active"><%= t('libraries.index.head_title') %></h1> <h1 data-view-mode="active"><%= t('libraries.index.head_title') %></h1>
<h1 data-view-mode="archived"><i class="fas fa-archive"></i>&nbsp;<%= t('libraries.index.head_title_archived') %></h1> <h1 data-view-mode="archived"><i class="fas fa-archive"></i>&nbsp;<%= t('libraries.index.head_title_archived') %></h1>
<%= render layout: "shared/view_switch", locals: { disabled: false } do %> <%= render layout: "shared/view_switch", locals: { disabled: false } do %>
@ -23,6 +24,7 @@
</li> </li>
<% end %> <% end %>
</div> </div>
</div>
<div class="content-body"> <div class="content-body">
</div> </div>
</div> </div>

View file

@ -14,6 +14,7 @@
<div class="content-pane repository-show <%= @repository.active? ? "active" : "archived" %>" data-table-url="<%= load_table_repository_path(@repository) %>"> <div class="content-pane repository-show <%= @repository.active? ? "active" : "archived" %>" data-table-url="<%= load_table_repository_path(@repository) %>">
<div id="repository-toolbar" class="content-header"> <div id="repository-toolbar" class="content-header">
<div class="title-row">
<% if @repository.active? %> <% if @repository.active? %>
<div class="repository-title-name" data-view-mode="active"> <div class="repository-title-name" data-view-mode="active">
<h1 class="name-container"> <h1 class="name-container">
@ -139,9 +140,9 @@
</li> </li>
<% end %> <% end %>
</div> </div>
<div class="toolbar-delimiter"></div> <div class="toolbar-delimiter"></div>
</div> </div>
</div>
<!-- These buttons are appended to table in javascript, after table initialization --> <!-- These buttons are appended to table in javascript, after table initialization -->
<div class="toolbar-filter-buttons" style="display:none"> <div class="toolbar-filter-buttons" style="display:none">

View file

@ -5,8 +5,10 @@
<div class="content-pane active flexible user-settings"> <div class="content-pane active flexible user-settings">
<div class="content-header"> <div class="content-header">
<div class="title-row">
<h1><%=t "users.registrations.edit.title" %></h1> <h1><%=t "users.registrations.edit.title" %></h1>
</div> </div>
</div>
<div class="row settings-row"> <div class="row settings-row">
<div class="col-md-12"> <div class="col-md-12">
<% if not resource.errors.empty? %> <% if not resource.errors.empty? %>