diff --git a/app/assets/javascripts/my_modules.js b/app/assets/javascripts/my_modules.js index a8112fc47..bb2505b1a 100644 --- a/app/assets/javascripts/my_modules.js +++ b/app/assets/javascripts/my_modules.js @@ -275,7 +275,7 @@ function initTagsSelector() { } return ` ${data.label + ' '} - (${I18n.t('my_modules.module_header.create_new_tag')})`; + (${I18n.t('my_modules.details.create_new_tag')})`; }, onOpen: function() { $('.select-container .edit-button-container').removeClass('hidden'); diff --git a/app/assets/stylesheets/my_modules/protocols/index.scss b/app/assets/stylesheets/my_modules/protocols/index.scss index 9d70a66a2..c25da1795 100644 --- a/app/assets/stylesheets/my_modules/protocols/index.scss +++ b/app/assets/stylesheets/my_modules/protocols/index.scss @@ -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 { diff --git a/app/assets/stylesheets/shared/avatar.scss b/app/assets/stylesheets/shared/avatar.scss index 2b00fe636..6a9934721 100644 --- a/app/assets/stylesheets/shared/avatar.scss +++ b/app/assets/stylesheets/shared/avatar.scss @@ -21,6 +21,8 @@ } .task-assigned-users .global-avatar-container { + margin: 2px; + img { vertical-align: baseline; } diff --git a/app/views/my_modules/_due_date_label.html.erb b/app/views/my_modules/_due_date_label.html.erb index 01bd84101..d8f1835d2 100644 --- a/app/views/my_modules/_due_date_label.html.erb +++ b/app/views/my_modules/_due_date_label.html.erb @@ -14,6 +14,8 @@ <% elsif my_module.due_date %> <%= l(my_module.due_date, format: :full) %> <% else %> - <%= t('experiments.canvas.full_zoom.no_due_date') %> + + <%= t('my_modules.details.no_due_date_placeholder') %> + <% end %> diff --git a/app/views/my_modules/_module_header_details_popover.html.erb b/app/views/my_modules/_module_header_details_popover.html.erb index 1c06c69c2..ec48d2bb6 100644 --- a/app/views/my_modules/_module_header_details_popover.html.erb +++ b/app/views/my_modules/_module_header_details_popover.html.erb @@ -1,7 +1,7 @@
- <%= t('my_modules.module_header.details_popover.project_label') %> + <%= t('my_modules.details.info_popover.project_label') %>
<%= @my_module.experiment.project.name.truncate(Constants::MAX_NAME_TRUNCATION) %> @@ -9,7 +9,7 @@
- <%= t('my_modules.module_header.details_popover.experiment_label') %> + <%= t('my_modules.details.info_popover.experiment_label') %>
<%= @my_module.experiment.name.truncate(Constants::MAX_NAME_TRUNCATION) %> @@ -17,16 +17,16 @@
- <%= t('my_modules.module_header.details_popover.creator_label') %> + <%= t('my_modules.details.info_popover.creator_label') %>
- <%= @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 %>
- <%= t('my_modules.module_header.details_popover.created_label') %> + <%= t('my_modules.details.info_popover.created_label') %>
<%= l(@my_module.created_at, format: :full_date) %> @@ -34,15 +34,15 @@
- <%= t('my_modules.module_header.details_popover.modified_label') %> + <%= t('my_modules.details.info_popover.modified_label') %>
<% 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 %>
diff --git a/app/views/my_modules/_module_header_due_date.html.erb b/app/views/my_modules/_module_header_due_date.html.erb index 67668171d..326e1cf0d 100644 --- a/app/views/my_modules/_module_header_due_date.html.erb +++ b/app/views/my_modules/_module_header_due_date.html.erb @@ -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" diff --git a/app/views/my_modules/_module_header_start_date.html.erb b/app/views/my_modules/_module_header_start_date.html.erb index 943b1bb46..6c5653c08 100644 --- a/app/views/my_modules/_module_header_start_date.html.erb +++ b/app/views/my_modules/_module_header_start_date.html.erb @@ -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" diff --git a/app/views/my_modules/_my_module_details.html.erb b/app/views/my_modules/_my_module_details.html.erb index 025ae5046..e6d6b57aa 100644 --- a/app/views/my_modules/_my_module_details.html.erb +++ b/app/views/my_modules/_my_module_details.html.erb @@ -1,16 +1,20 @@ <% my_module_editable = can_manage_module?(@my_module) %>
- - +
+ + +
<%= render partial: "module_header_start_date.html.erb", locals: { my_module: @my_module } %>
- - +
+ + +
<%= render partial: "module_header_due_date.html.erb", locals: { my_module: @my_module } %>
@@ -30,7 +34,7 @@
- <%= t('my_modules.details.assigned_users') %> +
<%= render partial: "user_my_modules/index" %>
@@ -38,7 +42,7 @@
- + <%= render partial: "my_modules/tags", locals: { my_module: @my_module, editable: my_module_editable } %>
diff --git a/app/views/my_modules/_recent_protocol_dropdown.html.erb b/app/views/my_modules/_recent_protocol_dropdown.html.erb new file mode 100644 index 000000000..302bce80e --- /dev/null +++ b/app/views/my_modules/_recent_protocol_dropdown.html.erb @@ -0,0 +1,21 @@ +<% display_status = protocol.description.blank? && protocol.steps.count.zero? %> +<% if @recent_protcols_positive %> +
+
+
<%= t('my_modules.details.recent_protocols_from_repository') %>
+ + +
+
+<% end %> diff --git a/app/views/my_modules/_start_date_label.html.erb b/app/views/my_modules/_start_date_label.html.erb index 3b24433ae..f4e48c0fa 100644 --- a/app/views/my_modules/_start_date_label.html.erb +++ b/app/views/my_modules/_start_date_label.html.erb @@ -2,6 +2,8 @@ <% if my_module.started_on.present? %> <%= l(my_module.started_on, format: :full) %> <% else %> - <%= t('my_modules.module_header.no_start_date') %> + + <%= t('my_modules.details.no_start_date_placeholder') %> + <% end %> diff --git a/app/views/my_modules/_tags.html.erb b/app/views/my_modules/_tags.html.erb index 9417a2f35..158f26f17 100644 --- a/app/views/my_modules/_tags.html.erb +++ b/app/views/my_modules/_tags.html.erb @@ -2,7 +2,7 @@ <%= 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), diff --git a/app/views/user_my_modules/_index.html.erb b/app/views/user_my_modules/_index.html.erb index f34069125..d6afe3888 100644 --- a/app/views/user_my_modules/_index.html.erb +++ b/app/views/user_my_modules/_index.html.erb @@ -1,19 +1,25 @@ <% user_my_modules = @my_module.user_my_modules %> <% if can_manage_users_in_module?(@my_module) %> - - <% user_my_modules.each do |user_my_module| %> - <% user = user_my_module.user %> - - <%= image_tag avatar_path(user, :icon_small) %> - - <% end %> - <% if @my_module.unassigned_users.any? %> - - + <% if user_my_modules.present? %> + <% user_my_modules.each do |user_my_module| %> + <% user = user_my_module.user %> + + <%= image_tag avatar_path(user, :icon_small) %> + + <% end %> + <% if @my_module.unassigned_users.any? %> + + + + <% end %> + <% else %> + + <%= t('my_modules.details.no_assigned_users') %> <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index ac4247fcc..78b5d07e6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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: