mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 11:57:16 +08:00
Small task inventories corrections
This commit is contained in:
parent
78b4067c50
commit
ce1540aaa9
9 changed files with 62 additions and 20 deletions
|
@ -15,6 +15,7 @@ var MyModuleRepositories = (function() {
|
||||||
var repositoriesContainer = $('#assigned-items-container');
|
var repositoriesContainer = $('#assigned-items-container');
|
||||||
$.get(repositoriesContainer.data('repositories-list-url'), function(result) {
|
$.get(repositoriesContainer.data('repositories-list-url'), function(result) {
|
||||||
repositoriesContainer.html(result.html);
|
repositoriesContainer.html(result.html);
|
||||||
|
$('.assigned-items-title').attr('data-assigned-items-count', result.assigned_rows_count);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,17 @@
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
margin: 10px 0;
|
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 {
|
.repositories-dropdown-menu {
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
.repository {
|
.repository {
|
||||||
@include font-button;
|
@include font-button;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
|
@ -136,11 +136,8 @@
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
|
||||||
.fas {
|
.full-screen:hover {
|
||||||
cursor: pointer;
|
background: $color-alto;
|
||||||
line-height: 36px;
|
|
||||||
text-align: center;
|
|
||||||
width: 36px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
32
app/assets/stylesheets/shared_styles/elements/dropdown.scss
Normal file
32
app/assets/stylesheets/shared_styles/elements/dropdown.scss
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -85,7 +85,10 @@ class MyModuleRepositoriesController < ApplicationController
|
||||||
|
|
||||||
def repositories_list_html
|
def repositories_list_html
|
||||||
@assigned_repositories = @my_module.live_and_snapshot_repositories_list
|
@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
|
end
|
||||||
|
|
||||||
def full_view_table
|
def full_view_table
|
||||||
|
|
|
@ -47,12 +47,12 @@
|
||||||
<div class="task-section-header">
|
<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">
|
<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>
|
<i class="fas fa-caret-right"></i>
|
||||||
<span class="task-section-title">
|
<span class="task-section-title ">
|
||||||
<h2><%= t('my_modules.assigned_items.title') %></h2>
|
<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>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<div class="actions-block">
|
<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">
|
<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 class="fas fa-file-signature"></span>
|
||||||
<span><%= t('my_modules.assigned_items.assign_from') %></span>
|
<span><%= t('my_modules.assigned_items.assign_from') %></span>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<% protocol_editable = can_manage_protocol_in_module?(@protocol) %>
|
<% 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) %>
|
<% 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">
|
<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 class="fas fa-wrench"></span>
|
||||||
<span><%= t('my_modules.protocol.options_dropdown.title') %></span>
|
<span><%= t('my_modules.protocol.options_dropdown.title') %></span>
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
<%= repository.name %>
|
<%= repository.name %>
|
||||||
</span>
|
</span>
|
||||||
<div class="action-buttons">
|
<div class="action-buttons">
|
||||||
<i class="fas fa-expand full-screen" data-table-url="<%= assigned_repository_full_view_table_path(@my_module, repository) %>">
|
<button class="btn btn-light icon-btn full-screen" data-table-url="<%= assigned_repository_full_view_table_path(@my_module, repository) %>">
|
||||||
</i>
|
<i class="fas fa-expand"></i>
|
||||||
<i class="fas fa-trash unassign-repository"></i>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<div class="collapse assigned-repository-container"
|
<div class="collapse assigned-repository-container"
|
||||||
|
|
|
@ -623,8 +623,8 @@ en:
|
||||||
export: "Export protocol"
|
export: "Export protocol"
|
||||||
save_to_repo: "Save to repository"
|
save_to_repo: "Save to repository"
|
||||||
buttons:
|
buttons:
|
||||||
complete: "Complete Task"
|
complete: "Complete task"
|
||||||
uncomplete: "Uncomplete Task"
|
uncomplete: "Uncomplete task"
|
||||||
complete_modal:
|
complete_modal:
|
||||||
description: 'You have completed all steps in the task. Would you like to mark entire task as completed?'
|
description: 'You have completed all steps in the task. Would you like to mark entire task as completed?'
|
||||||
leave_uncompleted: 'Leave task in progress'
|
leave_uncompleted: 'Leave task in progress'
|
||||||
|
@ -1966,7 +1966,7 @@ en:
|
||||||
uncompleted: 'Uncompleted'
|
uncompleted: 'Uncompleted'
|
||||||
expand_label: "Expand All"
|
expand_label: "Expand All"
|
||||||
collapse_label: "Collapse All"
|
collapse_label: "Collapse All"
|
||||||
new_step: "New Step"
|
new_step: "New step"
|
||||||
subtitle: "Protocol Steps"
|
subtitle: "Protocol Steps"
|
||||||
no_steps: "Protocol has no steps."
|
no_steps: "Protocol has no steps."
|
||||||
published_on: "Published on <em>%{timestamp}</em> by <em>%{user}</em>"
|
published_on: "Published on <em>%{timestamp}</em> by <em>%{user}</em>"
|
||||||
|
@ -1987,8 +1987,8 @@ en:
|
||||||
edit_title: "Edit step"
|
edit_title: "Edit step"
|
||||||
delete_title: "Delete step"
|
delete_title: "Delete step"
|
||||||
duplicate_title: "Duplicate step"
|
duplicate_title: "Duplicate step"
|
||||||
complete_title: "Complete Step"
|
complete_title: "Complete step"
|
||||||
uncomplete_title: "Uncomplete Step"
|
uncomplete_title: "Uncomplete step"
|
||||||
attachments:
|
attachments:
|
||||||
modified_label: "Modified:"
|
modified_label: "Modified:"
|
||||||
sort:
|
sort:
|
||||||
|
|
Loading…
Add table
Reference in a new issue