mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-03 11:13:06 +08:00
Merge pull request #2542 from mlorb/ml-sci-4582
Task details description corrections and some changes of locales [SCI-4582]
This commit is contained in:
commit
384ec40c4e
13 changed files with 108 additions and 59 deletions
|
@ -275,7 +275,7 @@ function initTagsSelector() {
|
|||
}
|
||||
return `<span class="my-module-tags-color"></span>
|
||||
${data.label + ' '}
|
||||
<span class="my-module-tags-create-new"> (${I18n.t('my_modules.module_header.create_new_tag')})</span>`;
|
||||
<span class="my-module-tags-create-new"> (${I18n.t('my_modules.details.create_new_tag')})</span>`;
|
||||
},
|
||||
onOpen: function() {
|
||||
$('.select-container .edit-button-container').removeClass('hidden');
|
||||
|
|
|
@ -147,6 +147,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
.empty-label {
|
||||
color: $color-silver-chalice;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.datetime-container {
|
||||
align-items: center;
|
||||
display: inline-flex;
|
||||
|
@ -206,8 +211,8 @@
|
|||
|
||||
&:hover {
|
||||
.date-text[data-editable=true] {
|
||||
border-color: $color-silver;
|
||||
border-radius: 3px;
|
||||
background-color: $color-concrete;
|
||||
border-radius: 4px;
|
||||
|
||||
.clear-date {
|
||||
display: inline;
|
||||
|
@ -253,7 +258,7 @@
|
|||
|
||||
&:not(.view-mode):hover {
|
||||
.input-field {
|
||||
border: 1px solid $color-gainsboro;
|
||||
border: 1px solid $color-alto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -269,7 +274,7 @@
|
|||
display: inline-block;
|
||||
font-size: 14px;
|
||||
line-height: 32px;
|
||||
width: 37px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.select-container {
|
||||
|
@ -331,16 +336,24 @@
|
|||
}
|
||||
|
||||
.task-assigned-users {
|
||||
height: 33px;
|
||||
align-items: center;
|
||||
border-radius: 17px;
|
||||
display: flex;
|
||||
|
||||
&.empty {
|
||||
border-radius: 4px;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: $color-concrete;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
.assign-new-user {
|
||||
background-color: $color-concrete;
|
||||
color: $color-silver-chalice;
|
||||
background-color: $color-alto;
|
||||
color: $color-volcano;
|
||||
text-align: center;
|
||||
|
||||
.fa-plus {
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
}
|
||||
|
||||
.task-assigned-users .global-avatar-container {
|
||||
margin: 2px;
|
||||
|
||||
img {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
<% elsif my_module.due_date %>
|
||||
<%= l(my_module.due_date, format: :full) %>
|
||||
<% else %>
|
||||
<em><%= t('experiments.canvas.full_zoom.no_due_date') %></em>
|
||||
<span class="empty-label">
|
||||
<%= t('my_modules.details.no_due_date_placeholder') %>
|
||||
</span>
|
||||
<% end %>
|
||||
</span>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="task-details-popover">
|
||||
<div class="row row-v-margin">
|
||||
<div class="col-xs-3">
|
||||
<%= t('my_modules.module_header.details_popover.project_label') %>
|
||||
<%= t('my_modules.details.info_popover.project_label') %>
|
||||
</div>
|
||||
<div class="col-xs-9 task-details-value">
|
||||
<%= @my_module.experiment.project.name.truncate(Constants::MAX_NAME_TRUNCATION) %>
|
||||
|
@ -9,7 +9,7 @@
|
|||
</div>
|
||||
<div class="row row-v-margin">
|
||||
<div class="col-xs-3">
|
||||
<%= t('my_modules.module_header.details_popover.experiment_label') %>
|
||||
<%= t('my_modules.details.info_popover.experiment_label') %>
|
||||
</div>
|
||||
<div class="col-xs-9 task-details-value">
|
||||
<%= @my_module.experiment.name.truncate(Constants::MAX_NAME_TRUNCATION) %>
|
||||
|
@ -17,16 +17,16 @@
|
|||
</div>
|
||||
<div class="row row-v-margin">
|
||||
<div class="col-xs-3">
|
||||
<%= t('my_modules.module_header.details_popover.creator_label') %>
|
||||
<%= t('my_modules.details.info_popover.creator_label') %>
|
||||
</div>
|
||||
<div class="col-xs-9 task-details-value">
|
||||
<%= @my_module.created_by&.full_name&.truncate(Constants::MAX_NAME_TRUNCATION) %>
|
||||
<%= t('my_modules.module_header.details_popover.creator_same_user_label') if current_user == @my_module.created_by %>
|
||||
<%= @my_module.created_by&.full_name&.truncate(Constants::MAX_NAME_TRUNCATION) %>
|
||||
<%= t('my_modules.details.info_popover.creator_same_user_label') if current_user == @my_module.created_by %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row row-v-margin">
|
||||
<div class="col-xs-3">
|
||||
<%= t('my_modules.module_header.details_popover.created_label') %>
|
||||
<%= t('my_modules.details.info_popover.created_label') %>
|
||||
</div>
|
||||
<div class="col-xs-9 task-details-value">
|
||||
<%= l(@my_module.created_at, format: :full_date) %>
|
||||
|
@ -34,15 +34,15 @@
|
|||
</div>
|
||||
<div class="row row-v-margin">
|
||||
<div class="col-xs-3">
|
||||
<%= t('my_modules.module_header.details_popover.modified_label') %>
|
||||
<%= t('my_modules.details.info_popover.modified_label') %>
|
||||
</div>
|
||||
<div class="col-xs-9 task-details-value">
|
||||
<% if @my_module.last_modified_by.present? %>
|
||||
<%= t('my_modules.module_header.details_popover.modified_value',
|
||||
<%= t('my_modules.details.info_popover.modified_value',
|
||||
date: l(@my_module.updated_at, format: :full_date),
|
||||
full_name: @my_module.last_modified_by.full_name.truncate(Constants::MAX_NAME_TRUNCATION)) %>
|
||||
<% else %>
|
||||
<%= t('my_modules.module_header.details_popover.modified_value_without_user',
|
||||
<%= t('my_modules.details.info_popover.modified_value_without_user',
|
||||
date: l(@my_module.updated_at, format: :full_date)) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
data-toggle='date-time-picker'
|
||||
class="form-control calendar-input"
|
||||
readonly
|
||||
placeholder="<%= t('experiments.canvas.full_zoom.no_due_date') %>"
|
||||
placeholder="<%= t('my_modules.details.no_due_date_placeholder') %>"
|
||||
data-date-format="<%= datetime_picker_format_full %>"
|
||||
data-date-locale="<%= I18n.locale %>"
|
||||
data-date-use-current="false"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
data-toggle='date-time-picker'
|
||||
class="form-control calendar-input"
|
||||
readonly
|
||||
placeholder="<%= t('my_modules.module_header.no_start_date_placeholder') %>"
|
||||
placeholder="<%= t('my_modules.details.no_start_date_placeholder') %>"
|
||||
data-date-format="<%= datetime_picker_format_full %>"
|
||||
data-date-locale="<%= I18n.locale %>"
|
||||
data-date-use-current="false"
|
||||
|
|
|
@ -1,16 +1,20 @@
|
|||
<% my_module_editable = can_manage_module?(@my_module) %>
|
||||
|
||||
<div class="flex-block date-block">
|
||||
<span class="fas block-icon fa-calendar-alt"></span>
|
||||
<span class="hidden-xs hidden-sm hidden-md"><%= t('my_modules.module_header.start_date') %></span>
|
||||
<div class="flex-block-label">
|
||||
<span class="fas block-icon fa-calendar-alt"></span>
|
||||
<span class="hidden-xs hidden-sm hidden-md"><%= t('my_modules.details.start_date') %></span>
|
||||
</div>
|
||||
<div id="startDateContainer" class="datetime-container" data-update-url="<%= my_module_path(@my_module, format: :json) %>">
|
||||
<%= render partial: "module_header_start_date.html.erb", locals: { my_module: @my_module } %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-block date-block" >
|
||||
<span class="fas block-icon fa-calendar-alt"></span>
|
||||
<span class="hidden-xs hidden-sm hidden-md"><%= t('my_modules.module_header.due_date') %></span>
|
||||
<div class="flex-block-label">
|
||||
<span class="fas block-icon fa-calendar-day"></span>
|
||||
<span class="hidden-xs hidden-sm hidden-md"><%= t('my_modules.details.due_date') %></span>
|
||||
</div>
|
||||
<div id="dueDateContainer" class="datetime-container" data-update-url="<%= my_module_path(@my_module, format: :json) %>">
|
||||
<%= render partial: "module_header_due_date.html.erb", locals: { my_module: @my_module } %>
|
||||
</div>
|
||||
|
@ -30,7 +34,7 @@
|
|||
<div class="flex-block">
|
||||
<div class="flex-block-label">
|
||||
<span class="fas block-icon fa-users"></span>
|
||||
<%= t('my_modules.details.assigned_users') %>
|
||||
<span class="hidden-xs hidden-sm"><%= t('my_modules.details.assigned_users') %></span>
|
||||
</div>
|
||||
<%= render partial: "user_my_modules/index" %>
|
||||
</div>
|
||||
|
@ -38,7 +42,7 @@
|
|||
<div class="module-tags">
|
||||
<div id="module-tags" data-module-tags-url="<%= my_module_my_module_tags_url(@my_module, format: :json) %>">
|
||||
<span class="fas block-icon fa-tags"></span>
|
||||
<span class="hidden-xs hidden-sm tags-title"><%=t "my_modules.module_header.tags" %></span>
|
||||
<span class="hidden-xs hidden-sm tags-title"><%=t "my_modules.details.tags" %></span>
|
||||
<%= render partial: "my_modules/tags", locals: { my_module: @my_module, editable: my_module_editable } %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
21
app/views/my_modules/_recent_protocol_dropdown.html.erb
Normal file
21
app/views/my_modules/_recent_protocol_dropdown.html.erb
Normal file
|
@ -0,0 +1,21 @@
|
|||
<% display_status = protocol.description.blank? && protocol.steps.count.zero? %>
|
||||
<% if @recent_protcols_positive %>
|
||||
<div class="my-module-recent-protocols"
|
||||
style="display: <%= display_status ? '' : 'none' %>"
|
||||
data-update-url="<%= load_from_repository_protocol_path(protocol) %>"
|
||||
>
|
||||
<div class="btn-group">
|
||||
<div class="title"><%= t('my_modules.details.recent_protocols_from_repository') %></div>
|
||||
<div
|
||||
class="dropdown-button"
|
||||
title="Recent protocols"
|
||||
data-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false">
|
||||
<span class="caret"></span>
|
||||
</div>
|
||||
<ul class="dropdown-menu">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
|
@ -2,6 +2,8 @@
|
|||
<% if my_module.started_on.present? %>
|
||||
<strong><%= l(my_module.started_on, format: :full) %></strong>
|
||||
<% else %>
|
||||
<%= t('my_modules.module_header.no_start_date') %>
|
||||
<span class="empty-label">
|
||||
<%= t('my_modules.details.no_start_date_placeholder') %>
|
||||
</span>
|
||||
<% end %>
|
||||
</span>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="edit-button-container hidden">
|
||||
<a class="edit-tags-link" data-remote="true" href="<%= my_module_tags_edit_path(@my_module, format: :json) %>">
|
||||
<i class="fas fa-cog"></i>
|
||||
<span class="hidden-xs"><%= t("my_modules.module_header.manage_tags") %></span>
|
||||
<span class="hidden-xs"><%= t("my_modules.details.manage_tags") %></span>
|
||||
</a>
|
||||
</div>
|
||||
<%= select_tag "activity",
|
||||
|
@ -17,7 +17,7 @@
|
|||
id: 'module-tags-selector',
|
||||
'data-module-id': my_module.id,
|
||||
'data-project-id': my_module.experiment.project_id,
|
||||
'data-placeholder': t("my_modules.module_header.no_tags"),
|
||||
'data-placeholder': t("my_modules.details.no_tags"),
|
||||
'data-tags-create-url': project_tags_path(project_id: my_module.experiment.project_id),
|
||||
'data-ajax-url': search_tags_my_module_my_module_tags_path(@my_module),
|
||||
'data-update-module-tags-url': my_module_my_module_tags_path(@my_module),
|
||||
|
|
|
@ -1,19 +1,25 @@
|
|||
<% user_my_modules = @my_module.user_my_modules %>
|
||||
<% if can_manage_users_in_module?(@my_module) %>
|
||||
<a class="task-assigned-users manage-users-link"
|
||||
<a class="task-assigned-users manage-users-link <%= 'empty' unless user_my_modules.present? %>"
|
||||
data-remote="true"
|
||||
href="<%= my_module_users_edit_path(@my_module, format: :json) %>"
|
||||
data-module-id="<%= @my_module.id %>"
|
||||
data-module-users-url="<%= my_module_user_my_modules_url(@my_module, format: :json) %>">
|
||||
<% user_my_modules.each do |user_my_module| %>
|
||||
<% user = user_my_module.user %>
|
||||
<span class='global-avatar-container'>
|
||||
<%= image_tag avatar_path(user, :icon_small) %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% if @my_module.unassigned_users.any? %>
|
||||
<span class='global-avatar-container assign-new-user'>
|
||||
<i class="fas fa-plus"></i>
|
||||
<% if user_my_modules.present? %>
|
||||
<% user_my_modules.each do |user_my_module| %>
|
||||
<% user = user_my_module.user %>
|
||||
<span class='global-avatar-container'>
|
||||
<%= image_tag avatar_path(user, :icon_small) %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% if @my_module.unassigned_users.any? %>
|
||||
<span class='global-avatar-container assign-new-user'>
|
||||
<i class="fas fa-plus"></i>
|
||||
</span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<span class="empty-label">
|
||||
<%= t('my_modules.details.no_assigned_users') %>
|
||||
</span>
|
||||
<% end %>
|
||||
</a>
|
||||
|
|
|
@ -606,7 +606,26 @@ en:
|
|||
my_modules:
|
||||
details:
|
||||
title: "Details"
|
||||
info_popover:
|
||||
project_label: "Project"
|
||||
experiment_label: "Experiment"
|
||||
creator_label: "Creator"
|
||||
creator_same_user_label: "(you)"
|
||||
created_label: "Created"
|
||||
modified_label: "Modified"
|
||||
modified_value: "%{date} by %{full_name}"
|
||||
modified_value_without_user: "%{date}"
|
||||
start_date: "Start date:"
|
||||
no_start_date_placeholder: "+ Add starting date"
|
||||
due_date: "Due date:"
|
||||
no_due_date_placeholder: "+ Add due date"
|
||||
assigned_users: "Assigned users:"
|
||||
no_assigned_users: "+ Assign user to task"
|
||||
tags: "Tags:"
|
||||
no_tags: "+ Add tags"
|
||||
manage_tags: "Manage tags"
|
||||
create_new_tag: "create new"
|
||||
recent_protocols_from_repository: "Recent protocols from the Repository"
|
||||
notes:
|
||||
title: "Notes"
|
||||
no_description: "No task description"
|
||||
|
@ -654,26 +673,6 @@ en:
|
|||
no_archived_results: "No archived results!"
|
||||
archive_timelabel: "archived on %{date}"
|
||||
restored_flash: "Task %{module} restored successfully!"
|
||||
module_header:
|
||||
details_label: "Details"
|
||||
details_popover:
|
||||
project_label: "Project"
|
||||
experiment_label: "Experiment"
|
||||
creator_label: "Creator"
|
||||
creator_same_user_label: "(you)"
|
||||
created_label: "Created"
|
||||
modified_label: "Modified"
|
||||
modified_value: "%{date} by %{full_name}"
|
||||
modified_value_without_user: "%{date}"
|
||||
start_date: "Start date:"
|
||||
no_start_date: "not set"
|
||||
no_start_date_placeholder: "+ Add starting date"
|
||||
due_date: "Due date:"
|
||||
tags: "Tags:"
|
||||
no_tags: "Add new Task Tags (optional)"
|
||||
manage_tags: "Manage tags"
|
||||
create_new_tag: "create new"
|
||||
recent_protocols_from_repository: "Recent protocols from the Repository"
|
||||
protocols:
|
||||
head_title: "%{project} | %{module} | Protocols"
|
||||
protocol_status_bar:
|
||||
|
|
Loading…
Reference in a new issue