Skip to content

Commit

Permalink
Display a notice for admin for message to curators
Browse files Browse the repository at this point in the history
Refs #2808
  • Loading branch information
kimrutherford committed Mar 1, 2024
1 parent 9708b5f commit b9d6fd7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/Canto/Controller/Curs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ sub top : Chained('/') PathPart('curs') CaptureArgs(1)
$st->{submitter_email} = $submitter_email;
$st->{submitter_name} = $submitter_name;

$st->{message_to_curators} =
$self->get_metadata($schema, MESSAGE_FOR_CURATORS_KEY);
my $message_to_curators = $self->get_metadata($schema, MESSAGE_FOR_CURATORS_KEY);
$st->{message_to_curators} = $message_to_curators;

my $external_notes = $self->get_metadata($schema, Canto::Curs->EXTERNAL_NOTES_KEY);

Expand Down Expand Up @@ -258,6 +258,12 @@ sub top : Chained('/') PathPart('curs') CaptureArgs(1)
$st->{current_user_is_admin} = 0;
}

if ($st->{current_user_is_admin} &&
($state eq NEEDS_APPROVAL || $state eq APPROVAL_IN_PROGRESS || $state eq APPROVED) &&
defined $message_to_curators && $message_to_curators !~ /^\s*$/) {
push @{$st->{notice}}, qq|This session has a message to curators|;
}

if ($config->{canto_offline} && !$st->{read_only_curs} &&
(!defined $current_user || !$current_user->is_admin()) &&
$path !~ m:/(ws/\w+/list):) {
Expand Down

0 comments on commit b9d6fd7

Please sign in to comment.