mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-21 07:26:15 +08:00
Update empty states for smart annotation results and dismiss button
This commit is contained in:
parent
56322f1247
commit
d9a78d20d7
|
@ -138,6 +138,9 @@ var SmartAnnotation = (function() {
|
||||||
$(this).addClass('btn-primary').removeClass('btn-light');
|
$(this).addClass('btn-primary').removeClass('btn-light');
|
||||||
$(field).click().focus();
|
$(field).click().focus();
|
||||||
});
|
});
|
||||||
|
$currentAtWho.off().on('click', '.dismiss', function() {
|
||||||
|
$currentAtWho.hide();
|
||||||
|
});
|
||||||
|
|
||||||
if ($currentAtWho.find('.tab-pane.active').length === 0) {
|
if ($currentAtWho.find('.tab-pane.active').length === 0) {
|
||||||
let filterType = DEFAULT_SEARCH_FILTER.tag;
|
let filterType = DEFAULT_SEARCH_FILTER.tag;
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
.atwho-header-res {
|
.atwho-header-res {
|
||||||
.nav-tabs {
|
.nav-tabs {
|
||||||
|
align-items: center;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +24,14 @@
|
||||||
padding: .25em;
|
padding: .25em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dismiss {
|
||||||
|
@include font-button;
|
||||||
|
color: $color-silver-chalice;
|
||||||
|
flex-grow: 1;
|
||||||
|
padding-right: 10px;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
.repository-object {
|
.repository-object {
|
||||||
max-width: 250px;
|
max-width: 250px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
@ -36,6 +45,31 @@
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.atwho-no-results {
|
||||||
|
color: $color-silver-chalice;
|
||||||
|
padding: 22px 100px;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
.description {
|
||||||
|
@include font-main;
|
||||||
|
padding: 0 65px 38px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.atwho-header {
|
||||||
|
@include font-small;
|
||||||
|
border-bottom: $border-default;
|
||||||
|
color: $color-silver-chalice;
|
||||||
|
padding: .5em;
|
||||||
|
|
||||||
|
.dismiss {
|
||||||
|
@include font-button;
|
||||||
|
float: right;
|
||||||
|
padding-right: 4px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.atwho-footer {
|
.atwho-footer {
|
||||||
@include font-small;
|
@include font-small;
|
||||||
border-top: $border-default;
|
border-top: $border-default;
|
||||||
|
|
|
@ -1709,38 +1709,6 @@ th.custom-field .modal-tooltiptext {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
// AtWho (smart annotations)
|
|
||||||
|
|
||||||
// <Custom atwho style>
|
|
||||||
|
|
||||||
.atwho-user-container {
|
|
||||||
align-items: center;
|
|
||||||
display: inline-flex;
|
|
||||||
|
|
||||||
.global-avatar-container {
|
|
||||||
line-height: 30px;
|
|
||||||
margin: 0 2px 0 4px;
|
|
||||||
|
|
||||||
img {
|
|
||||||
position: relative;
|
|
||||||
top: -2px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.atwho-user-popover {
|
|
||||||
cursor: pointer;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.atwho-user-img-popover {
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
|
|
||||||
.atwho-no-results {
|
|
||||||
padding: 5px 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.popover {
|
.popover {
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
min-width: 450px;
|
min-width: 450px;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<div class="more-results"><%= t('atwho.more_results') %></div>
|
<div class="more-results"><%= t('atwho.more_results') %></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if experiments.empty? %>
|
<% if experiments.empty? %>
|
||||||
<%= render partial: 'shared/smart_annotation/no_results.html.erb' %>
|
<%= render partial: 'shared/smart_annotation/no_results.html.erb', locals: { object_type: 'experiments' } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<%= render partial: 'shared/smart_annotation/footer.html.erb' %>
|
<%= render partial: 'shared/smart_annotation/footer.html.erb' %>
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
<a class="tab-button sa-experiments" href="#exp-tab-<%= at_who_key %>" data-toggle="tab"><%= t('atwho.experiments') %></a>
|
<a class="tab-button sa-experiments" href="#exp-tab-<%= at_who_key %>" data-toggle="tab"><%= t('atwho.experiments') %></a>
|
||||||
<a class="tab-button sa-tasks" href="#tsk-tab-<%= at_who_key %>" data-toggle="tab"><%= t('atwho.tasks') %></a>
|
<a class="tab-button sa-tasks" href="#tsk-tab-<%= at_who_key %>" data-toggle="tab"><%= t('atwho.tasks') %></a>
|
||||||
<a class="tab-button sa-repositories" href="#rep-tab-<%= at_who_key %>" data-toggle="tab"><%= t('atwho.inventories') %></a>
|
<a class="tab-button sa-repositories" href="#rep-tab-<%= at_who_key %>" data-toggle="tab"><%= t('atwho.inventories') %></a>
|
||||||
|
<div class="dismiss"><span class="fas fa-times"></span></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div class="tab-pane" role="tabpanel" id="prj-tab-<%= at_who_key %>" data-object-type="PROJECT"></div>
|
<div class="tab-pane" role="tabpanel" id="prj-tab-<%= at_who_key %>" data-object-type="PROJECT"></div>
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
<div class="more-results"><%= t('atwho.more_results') %></div>
|
<div class="more-results"><%= t('atwho.more_results') %></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if my_modules.empty? %>
|
<% if my_modules.empty? %>
|
||||||
<%= render partial: 'shared/smart_annotation/no_results.html.erb' %>
|
<%= render partial: 'shared/smart_annotation/no_results.html.erb', locals: { object_type: 'my_modules' } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<%= render partial: 'shared/smart_annotation/footer.html.erb' %>
|
<%= render partial: 'shared/smart_annotation/footer.html.erb' %>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<div class="atwho-no-results">
|
<div class="atwho-no-results">
|
||||||
<span><%= t("atwho.no_results") %></span>
|
<h1><%= t("atwho.no_results.#{object_type}") %></h1>
|
||||||
|
<div class="description"><%= t("atwho.no_results.description") %></div>
|
||||||
<!-- "No results" hack for at.js -->
|
<!-- "No results" hack for at.js -->
|
||||||
<span style="display: none"><%= @query %></span>
|
<span style="display: none"><%= @query %></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<div class="more-results"><%= t('atwho.more_results') %></div>
|
<div class="more-results"><%= t('atwho.more_results') %></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if projects.empty? %>
|
<% if projects.empty? %>
|
||||||
<%= render partial: 'shared/smart_annotation/no_results.html.erb' %>
|
<%= render partial: 'shared/smart_annotation/no_results.html.erb', locals: { object_type: 'projects' } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<%= render partial: 'shared/smart_annotation/footer.html.erb' %>
|
<%= render partial: 'shared/smart_annotation/footer.html.erb' %>
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<div class="more-results"><%= t('atwho.more_results') %></div>
|
<div class="more-results"><%= t('atwho.more_results') %></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if repository_rows.empty? %>
|
<% if repository_rows.empty? %>
|
||||||
<%= render partial: 'shared/smart_annotation/no_results.html.erb' %>
|
<%= render partial: 'shared/smart_annotation/no_results.html.erb', locals: { object_type: 'repository_rows' } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<%= render partial: 'shared/smart_annotation/footer.html.erb' %>
|
<%= render partial: 'shared/smart_annotation/footer.html.erb' %>
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
<% limit_reached = users.length == Constants::ATWHO_SEARCH_LIMIT + 1 %>
|
<% limit_reached = users.length == Constants::ATWHO_SEARCH_LIMIT + 1 %>
|
||||||
|
<div class="atwho-header">
|
||||||
|
<span><%= t("atwho.users.header") %></span>
|
||||||
|
<div class="dismiss"><span class="fas fa-times"></span></div>
|
||||||
|
</div>
|
||||||
<div class="atwho-scroll-container">
|
<div class="atwho-scroll-container">
|
||||||
<% users.limit(Constants::ATWHO_SEARCH_LIMIT).each do |user| %>
|
<% users.limit(Constants::ATWHO_SEARCH_LIMIT).each do |user| %>
|
||||||
<li class="atwho-user" data-full-name="<%= user.full_name %>" data-id="<%= user.id.base62_encode %>" data-type="rep_item">
|
<li class="atwho-user" data-full-name="<%= user.full_name %>" data-id="<%= user.id.base62_encode %>" data-type="rep_item">
|
||||||
|
@ -13,7 +17,7 @@
|
||||||
<div class="more-results"><%= t('atwho.more_results') %></div>
|
<div class="more-results"><%= t('atwho.more_results') %></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if users.empty? %>
|
<% if users.empty? %>
|
||||||
<%= render partial: 'shared/smart_annotation/no_results.html.erb' %>
|
<%= render partial: 'shared/smart_annotation/no_results.html.erb', locals: { object_type: 'users' } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<%= render partial: 'shared/smart_annotation/footer.html.erb' %>
|
<%= render partial: 'shared/smart_annotation/footer.html.erb' %>
|
||||||
|
|
|
@ -2279,7 +2279,13 @@ en:
|
||||||
forbidden: 'You do not have permission to add files.'
|
forbidden: 'You do not have permission to add files.'
|
||||||
not_found: 'Element not found.'
|
not_found: 'Element not found.'
|
||||||
atwho:
|
atwho:
|
||||||
no_results: "No results found"
|
no_results:
|
||||||
|
projects: "Projects with this name were not found"
|
||||||
|
experiments: "Experiments with this name were not found"
|
||||||
|
my_modules: "Tasks with this name were not found"
|
||||||
|
repository_rows: "Items with this name were not found"
|
||||||
|
users: "Users with this name were not found"
|
||||||
|
description: "Please make sure there are no typos, or erase letters one by one unless you see some results"
|
||||||
projects: PROJECTS
|
projects: PROJECTS
|
||||||
experiments: EXPERIMENTS
|
experiments: EXPERIMENTS
|
||||||
tasks: TASKS
|
tasks: TASKS
|
||||||
|
@ -2287,6 +2293,7 @@ en:
|
||||||
more_results: To get other results, please type more
|
more_results: To get other results, please type more
|
||||||
users:
|
users:
|
||||||
title: "People"
|
title: "People"
|
||||||
|
header: "Type the name or email of the user you want to mention (they will be notified)"
|
||||||
help: "Navigate: ↑ ↓ • Submit: Enter / Tab • Dismiss: Esc"
|
help: "Navigate: ↑ ↓ • Submit: Enter / Tab • Dismiss: Esc"
|
||||||
popover_html: "<span class='silver'>Team:</span> %{team} <br> <span class='silver'>Role:</span> %{role} <br> <span class='silver'>Joined:</span> %{time}"
|
popover_html: "<span class='silver'>Team:</span> %{team} <br> <span class='silver'>Role:</span> %{role} <br> <span class='silver'>Joined:</span> %{time}"
|
||||||
res:
|
res:
|
||||||
|
|
Loading…
Reference in a new issue