mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 11:45:18 +08:00
Merge branch 'master' into ai-sci-3239-add-localization-team-for-objects
This commit is contained in:
commit
8416d1ab1c
6 changed files with 53 additions and 7 deletions
|
@ -95,7 +95,7 @@ $(function() {
|
||||||
var dateContainer = $('.ga-side .date-selector.filter-block');
|
var dateContainer = $('.ga-side .date-selector.filter-block');
|
||||||
if (updateRunning) return false;
|
if (updateRunning) return false;
|
||||||
$('.ga-top .ga-tags').children().remove();
|
$('.ga-top .ga-tags').children().remove();
|
||||||
if (dateContainer[0].dataset.periodSelect && dateContainer[0].dataset.periodSelect !== 'null') {
|
if (dateContainer[0].dataset.periodSelect) {
|
||||||
$('<li class="select2-selection__choice">'
|
$('<li class="select2-selection__choice">'
|
||||||
+ dateContainer[0].dataset.periodLabel
|
+ dateContainer[0].dataset.periodLabel
|
||||||
+ $('.ga-side .date-selector.filter-block')[0].dataset.periodSelect
|
+ $('.ga-side .date-selector.filter-block')[0].dataset.periodSelect
|
||||||
|
@ -152,6 +152,12 @@ $(function() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resetHotButtonsBackgroundColor() {
|
||||||
|
$('.date-selector .hot-button').each(function() {
|
||||||
|
$(this).removeClass('selected');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Common selection intialize
|
// Common selection intialize
|
||||||
$.each(selectors, (index, e) => {
|
$.each(selectors, (index, e) => {
|
||||||
$('.ga-side .' + e + '-selector select').select2Multiple({ singleDisplay: true })
|
$('.ga-side .' + e + '-selector select').select2Multiple({ singleDisplay: true })
|
||||||
|
@ -182,7 +188,8 @@ $(function() {
|
||||||
$('.ga-side .subject-selector select').select2MultipleClearAll();
|
$('.ga-side .subject-selector select').select2MultipleClearAll();
|
||||||
$('#calendar-from-date').data('DateTimePicker').clear();
|
$('#calendar-from-date').data('DateTimePicker').clear();
|
||||||
$('#calendar-to-date').data('DateTimePicker').clear();
|
$('#calendar-to-date').data('DateTimePicker').clear();
|
||||||
$('.ga-side .date-selector.filter-block')[0].dataset.periodSelect = null;
|
$('.ga-side .date-selector.filter-block')[0].dataset.periodSelect = '';
|
||||||
|
|
||||||
updateRunning = false;
|
updateRunning = false;
|
||||||
GlobalActivitiesUpdateTopPaneTags();
|
GlobalActivitiesUpdateTopPaneTags();
|
||||||
reloadActivities();
|
reloadActivities();
|
||||||
|
@ -195,6 +202,7 @@ $(function() {
|
||||||
dateContainer[0].dataset.periodSelect = $('#calendar-from-date').val() + ' - ' + $('#calendar-to-date').val();
|
dateContainer[0].dataset.periodSelect = $('#calendar-from-date').val() + ' - ' + $('#calendar-to-date').val();
|
||||||
GlobalActivitiesUpdateTopPaneTags();
|
GlobalActivitiesUpdateTopPaneTags();
|
||||||
reloadActivities();
|
reloadActivities();
|
||||||
|
resetHotButtonsBackgroundColor();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -205,6 +213,7 @@ $(function() {
|
||||||
dateContainer[0].dataset.periodSelect = $('#calendar-from-date').val() + ' - ' + $('#calendar-to-date').val();
|
dateContainer[0].dataset.periodSelect = $('#calendar-from-date').val() + ' - ' + $('#calendar-to-date').val();
|
||||||
GlobalActivitiesUpdateTopPaneTags();
|
GlobalActivitiesUpdateTopPaneTags();
|
||||||
reloadActivities();
|
reloadActivities();
|
||||||
|
resetHotButtonsBackgroundColor();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -248,5 +257,8 @@ $(function() {
|
||||||
dateContainer[0].dataset.periodSelect = this.innerHTML;
|
dateContainer[0].dataset.periodSelect = this.innerHTML;
|
||||||
GlobalActivitiesUpdateTopPaneTags();
|
GlobalActivitiesUpdateTopPaneTags();
|
||||||
reloadActivities();
|
reloadActivities();
|
||||||
|
|
||||||
|
resetHotButtonsBackgroundColor();
|
||||||
|
$(this).addClass('selected');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
var link = $(obj).data('tooltiplink');
|
var link = $(obj).data('tooltiplink');
|
||||||
var textData = $(obj).data('tooltipcontent');
|
var textData = $(obj).data('tooltipcontent');
|
||||||
var customStyle = $(obj).data('tooltipstyle');
|
var customStyle = $(obj).data('tooltipstyle');
|
||||||
|
obj.dataset.tooltipId = i;
|
||||||
|
|
||||||
$(obj)
|
$(obj)
|
||||||
.popover({
|
.popover({
|
||||||
|
@ -26,7 +27,7 @@
|
||||||
content: 'popovers will not display if empty',
|
content: 'popovers will not display if empty',
|
||||||
template:
|
template:
|
||||||
'<div class="popover tooltip_' + i + '_window tooltip-open" '
|
'<div class="popover tooltip_' + i + '_window tooltip-open" '
|
||||||
+ 'role="tooltip" style="' + customStyle + '">'
|
+ 'role="tooltip" style="' + customStyle + '" data-popover-id="' + i + '">'
|
||||||
+ '<div class="popover-body" >' + textData + '</div>'
|
+ '<div class="popover-body" >' + textData + '</div>'
|
||||||
+ '<br><br><br>'
|
+ '<br><br><br>'
|
||||||
+ '<div class="popover-footer">'
|
+ '<div class="popover-footer">'
|
||||||
|
@ -59,7 +60,6 @@
|
||||||
clearTimeout(leaveTimeout);
|
clearTimeout(leaveTimeout);
|
||||||
enterTimeout = setTimeout(function() {
|
enterTimeout = setTimeout(function() {
|
||||||
var top;
|
var top;
|
||||||
|
|
||||||
if ($(obj).hover().length > 0) {
|
if ($(obj).hover().length > 0) {
|
||||||
$(obj).popover('show');
|
$(obj).popover('show');
|
||||||
$('.tooltip_' + i + '_window').removeClass('tooltip-enter');
|
$('.tooltip_' + i + '_window').removeClass('tooltip-enter');
|
||||||
|
@ -84,6 +84,33 @@
|
||||||
$('.help_tooltips').each(function(i, obj) {
|
$('.help_tooltips').each(function(i, obj) {
|
||||||
$(obj).popover('hide');
|
$(obj).popover('hide');
|
||||||
});
|
});
|
||||||
|
$('.popover.tooltip-open').each(function(i, obj) {
|
||||||
|
if ($('*[data-tooltip-id="' + obj.dataset.popoverId + '"]').length === 0) {
|
||||||
|
$(obj).remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$(document.body).on('mousemove', function(e) {
|
||||||
|
var mouse = { x: e.clientX, y: e.clientY };
|
||||||
|
$('.popover.tooltip-open').each(function(i, obj) {
|
||||||
|
var tooltipObj = '*[data-tooltip-id="' + obj.dataset.popoverId + '"]';
|
||||||
|
var objHeight = $(tooltipObj)[0].clientHeight;
|
||||||
|
var objWidth = $(tooltipObj)[0].clientWidth;
|
||||||
|
var objLeft = $(tooltipObj)[0].offsetLeft;
|
||||||
|
var objTop = $(tooltipObj)[0].offsetTop;
|
||||||
|
var objCorners = {
|
||||||
|
tl: { x: objLeft, y: objTop },
|
||||||
|
tr: { x: (objLeft + objWidth), y: objTop },
|
||||||
|
bl: { x: objLeft, y: (objTop + objHeight) },
|
||||||
|
br: { x: (objLeft + objWidth), y: (objTop + objHeight) }
|
||||||
|
};
|
||||||
|
if (
|
||||||
|
!(mouse.x > objCorners.tl.x && mouse.x < objCorners.br.x)
|
||||||
|
|| !(mouse.y > objCorners.tl.y && mouse.y < objCorners.br.y)
|
||||||
|
) {
|
||||||
|
$(tooltipObj).popover('hide');
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ $brand-primary-light: #dcedf6;
|
||||||
$brand-success-light: #e2eed8;
|
$brand-success-light: #e2eed8;
|
||||||
$brand-warning-light: #fcf7e4;
|
$brand-warning-light: #fcf7e4;
|
||||||
$brand-danger-light: #efdfdf;
|
$brand-danger-light: #efdfdf;
|
||||||
|
$brand-light-blue: #e3f1f9;
|
||||||
|
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
|
@ -128,6 +128,11 @@
|
||||||
text-align: left;
|
text-align: left;
|
||||||
width: calc(50% - 25px);
|
width: calc(50% - 25px);
|
||||||
|
|
||||||
|
&.selected {
|
||||||
|
background: $brand-light-blue;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
&:nth-child(even) {
|
&:nth-child(even) {
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,13 +6,14 @@ class GlobalActivitiesController < ApplicationController
|
||||||
selected_teams = if request.format.html?
|
selected_teams = if request.format.html?
|
||||||
current_team
|
current_team
|
||||||
elsif activity_filters[:teams].present?
|
elsif activity_filters[:teams].present?
|
||||||
@teams.where(id: activity_filters[:teams])
|
@teams.where(id: activity_filters[:teams]).order(name: :asc)
|
||||||
else
|
else
|
||||||
@teams
|
@teams.order(name: :asc)
|
||||||
end
|
end
|
||||||
@activity_types = Activity.activity_types_list
|
@activity_types = Activity.activity_types_list
|
||||||
@user_list = User.where(id: UserTeam.where(team: current_user.teams).select(:user_id))
|
@user_list = User.where(id: UserTeam.where(team: current_user.teams).select(:user_id))
|
||||||
.distinct
|
.distinct
|
||||||
|
.order(full_name: :asc)
|
||||||
.pluck(:full_name, :id)
|
.pluck(:full_name, :id)
|
||||||
@grouped_activities, @more_activities =
|
@grouped_activities, @more_activities =
|
||||||
ActivitiesService.load_activities(current_user, selected_teams, activity_filters)
|
ActivitiesService.load_activities(current_user, selected_teams, activity_filters)
|
||||||
|
|
Loading…
Reference in a new issue