calendar: show playout path on icon

move icon generation from javascript to perl
This commit is contained in:
Milan
2020-05-23 23:26:15 +02:00
parent 877cc1a347
commit 380b167354
2 changed files with 22 additions and 21 deletions

View File

@@ -449,6 +449,7 @@ sub showCalendar {
$events_by_start->{ $date->{start} }->{rms_right} = $date->{rms_right} || 0;
$events_by_start->{ $date->{start} }->{playout_modified_at} = $date->{modified_at};
$events_by_start->{ $date->{start} }->{playout_updated_at} = $date->{updated_at};
$events_by_start->{ $date->{start} }->{file} = $date->{file};
}
push @$events, $date;
}
@@ -1504,7 +1505,27 @@ sub print_event {
}
if ($showIcons) {
$content = '<div class="text">' . $content . '</div><div class="icons"></div>';
my $attr = { map { $_ => undef } split( /\s+/, $class) };
my $file = $event->{file}
? 'playout: ' . $event->{file} =~ s/\'/\&apos;/gr
: 'playout';
my $icons='';
if ( exists $attr->{event} ){
$icons.='<i class="fas fa-microphone-alt" title="live"></i>'
if exists($attr->{live}) && exists($attr->{no_rerun});
$icons.='<i class="fas fa-microphone-slash" title="preproduced"></i>'
if exists($attr->{preproduced}) && exists($attr->{no_rerun});
$icons.='<i class="fas fa-redo" title="rerun"></i>'
if exists $attr->{rerun};
$icons.=qq{<i class="fas fa-play" title="$file" onmouseenter="console.log('$file');"></i>}
if exists $attr->{playout};
$icons.='<i class="fas fa-archive" title="archived"></i>'
if exists $attr->{archived};
}
$content = qq{<div class="text">$content</div><div class="icons">$icons</div>};
}
my $time = '';

View File

@@ -346,25 +346,6 @@ function checkStudio(){
return 1;
}
function setIcons(){
var img='';
img='<i class="fas fa-microphone-alt" title="live"></i>';
$('#calendar div.event.live.no_rerun div.icons').append(img);
img='<i class="fas fa-microphone-slash" title="preproduced"></i>';
$('#calendar div.event.preproduced.no_rerun div.icons').append(img);
img='<i class="fas fa-redo" title="rerun"></i>';
$('#calendar div.event.rerun div.icons').append(img);
img='<i class="fas fa-play" title="playout"></i>';
$('#calendar div.event.playout div.icons').append(img);
img='<i class="fas fa-archive" title="archived"></i>';
$('#calendar div.event.archived div.icons').append(img);
}
function show_not_assigned_to_series_dialog(){
$("#event_no_series").dialog({
resizable: false,
@@ -773,7 +754,6 @@ function updateTable(){
);
//set checkboxes from url parameters and update all urls
setIcons();
$('#calendar').show();
showMouse();