Small task inventories corrections

This commit is contained in:
aignatov-bio 2020-05-08 17:01:55 +02:00
parent 78b4067c50
commit ce1540aaa9
9 changed files with 62 additions and 20 deletions

View file

@ -15,6 +15,7 @@ var MyModuleRepositories = (function() {
var repositoriesContainer = $('#assigned-items-container');
$.get(repositoriesContainer.data('repositories-list-url'), function(result) {
repositoriesContainer.html(result.html);
$('.assigned-items-title').attr('data-assigned-items-count', result.assigned_rows_count);
});
}

View file

@ -34,6 +34,17 @@
h2 {
margin: 10px 0;
&.assigned-items-title {
&::after {
@include font-h3;
color: $color-alto;
content: '[' attr(data-assigned-items-count) ']';
display: inline;
line-height: 22px;
padding-left: 5px;
}
}
}
}
@ -64,8 +75,6 @@
}
.repositories-dropdown-menu {
width: 100%;
.repository {
@include font-button;
cursor: pointer;

View file

@ -136,11 +136,8 @@
flex-shrink: 0;
text-align: right;
.fas {
cursor: pointer;
line-height: 36px;
text-align: center;
width: 36px;
.full-screen:hover {
background: $color-alto;
}
}
}

View file

@ -0,0 +1,32 @@
.sci-dropdown {
[data-toggle="dropdown"] {
&:focus {
box-shadow: none;
}
}
&.open {
[data-toggle="dropdown"] {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
border-color: $brand-focus;
.caret {
transform: rotateX(180deg)
}
}
.dropdown-menu {
border-top-left-radius: 0;
border-top-right-radius: 0;
box-shadow: $flyout-shadow;
margin-top: -1px;
width: 100%;
li:hover {
background: $color-concrete;
}
}
}
}

View file

@ -85,7 +85,10 @@ class MyModuleRepositoriesController < ApplicationController
def repositories_list_html
@assigned_repositories = @my_module.live_and_snapshot_repositories_list
render json: { html: render_to_string(partial: 'my_modules/repositories/repositories_list') }
render json: {
html: render_to_string(partial: 'my_modules/repositories/repositories_list'),
assigned_rows_count: @assigned_repositories.map{|i| i.assigned_rows_count}.sum
}
end
def full_view_table

View file

@ -47,12 +47,12 @@
<div class="task-section-header">
<a class="task-section-caret collapsed" role="button" data-toggle="collapse" href="#assigned-items-container" aria-expanded="false" aria-controls="assigned-items-container">
<i class="fas fa-caret-right"></i>
<span class="task-section-title">
<h2><%= t('my_modules.assigned_items.title') %></h2>
<span class="task-section-title ">
<h2 class="assigned-items-title" data-assigned-items-count="<%= @assigned_repositories.map{|i| i.assigned_rows_count}.sum %>"><%= t('my_modules.assigned_items.title') %></h2>
</span>
</a>
<div class="actions-block">
<div class="dropdown repositories-assign-container" data-repositories-url="<%= my_module_repositories_dropdown_list_path(@my_module) %>">
<div class="dropdown repositories-assign-container sci-dropdown" data-repositories-url="<%= my_module_repositories_dropdown_list_path(@my_module) %>">
<a href="#" id="repositories-assign-button" class="btn btn-secondary btn-block" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<span class="fas fa-file-signature"></span>
<span><%= t('my_modules.assigned_items.assign_from') %></span>

View file

@ -2,7 +2,7 @@
<% protocol_editable = can_manage_protocol_in_module?(@protocol) %>
<% protocol_savable_to_repo = can_read_protocol_in_module?(@protocol) && can_create_protocols_in_repository?(@protocol.team) %>
<div class="dropdown">
<div class="dropdown sci-dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownProtocolOptions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<span class="fas fa-wrench"></span>
<span><%= t('my_modules.protocol.options_dropdown.title') %></span>

View file

@ -11,9 +11,9 @@
<%= repository.name %>
</span>
<div class="action-buttons">
<i class="fas fa-expand full-screen" data-table-url="<%= assigned_repository_full_view_table_path(@my_module, repository) %>">
</i>
<i class="fas fa-trash unassign-repository"></i>
<button class="btn btn-light icon-btn full-screen" data-table-url="<%= assigned_repository_full_view_table_path(@my_module, repository) %>">
<i class="fas fa-expand"></i>
</button>
</div>
</a>
<div class="collapse assigned-repository-container"

View file

@ -623,8 +623,8 @@ en:
export: "Export protocol"
save_to_repo: "Save to repository"
buttons:
complete: "Complete Task"
uncomplete: "Uncomplete Task"
complete: "Complete task"
uncomplete: "Uncomplete task"
complete_modal:
description: 'You have completed all steps in the task. Would you like to mark entire task as completed?'
leave_uncompleted: 'Leave task in progress'
@ -1966,7 +1966,7 @@ en:
uncompleted: 'Uncompleted'
expand_label: "Expand All"
collapse_label: "Collapse All"
new_step: "New Step"
new_step: "New step"
subtitle: "Protocol Steps"
no_steps: "Protocol has no steps."
published_on: "Published on <em>%{timestamp}</em> by <em>%{user}</em>"
@ -1987,8 +1987,8 @@ en:
edit_title: "Edit step"
delete_title: "Delete step"
duplicate_title: "Duplicate step"
complete_title: "Complete Step"
uncomplete_title: "Uncomplete Step"
complete_title: "Complete step"
uncomplete_title: "Uncomplete step"
attachments:
modified_label: "Modified:"
sort: