Skip to content

Commit 3d18043

Browse files
committed
Only show set display image option to curator role
1 parent 52fe996 commit 3d18043

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

mason/image/print_images.mas

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@ if ($images && !$image_objects) {
7171
###print qq{ <script src="jquery.colorbox-min.js"></script> };
7272

7373
if ($image_objects) { # don't display anything for empty list of images
74-
if ($stock_image_flag == '1') { # Only include 'Set as Display Image' column for images of this stock, not for images of related stock table
74+
if ($curator && $stock_image_flag == '1') { # Only include 'Set as Display Image' column for images of this stock, not for images of related stock table
7575
$image_html .= qq|<table class="table table-bordered"><thead><tr><th><button class="btn btn-sm btn-default" id="print_images_multi_image_view">View Selected</button></th><th>Image</th><th>Description</th><th>Type</th><th>Set as Display Image</th></tr></thead><tbody>|;
7676
} else {
7777
$image_html .= qq|<table class="table table-bordered"><thead><tr><th><button class="btn btn-sm btn-default" id="print_images_multi_image_view">View Selected</button></th><th>Image</th><th>Description</th><th>Type</th></tr></thead><tbody>|;
7878
}
79+
7980
my $i = 0;
8081
foreach my $image_ob (@$image_objects) {
8182
$count++;
@@ -102,9 +103,9 @@ if ($image_objects) { # don't display anything for empty list of images
102103
. $image_description
103104
. "</td><td>"
104105
. $images->[$i]->[1]
105-
. "</td><td>"
106-
. $set_button
107-
. "</td></tr>";
106+
. "</td>"
107+
. ($curator == 1 ? "<td>$set_button</td>" : "")
108+
. "</tr>";
108109
if ( $count < 3 ) { $image_html .= $fhtml; }
109110
else {
110111
push @more_is, $fhtml;

mason/page/detail_page_2_col_section.mas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ $field_headers => ()
322322
<& /image/compare_images.mas, stock_id => $stock_id &>
323323

324324
<&| /page/info_section.mas, title=>"Images of This Stock(" . scalar(@$image_ids) . ")", collapsible=>1, collapsed=>0 &>
325-
<& /image/print_images.mas , stock_id=>$stock_id , images=>$image_ids , dbh=>$dbh, additional_image_button_id=>'stock_images', stock_image_flag=>'1' &>
325+
<& /image/print_images.mas , stock_id=>$stock_id , images=>$image_ids , dbh=>$dbh, additional_image_button_id=>'stock_images', stock_image_flag=>'1' , curator=>$curator &>
326326
</&>
327327

328328
<&| /page/info_section.mas, title=>"Images of Related Stock(s) (" . scalar(@$related_image_ids) . ")", collapsible=>1, collapsed=>0 &>

mason/stock/index.mas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ function jqueryStuff() {
391391
<& /page/detail_page_2_col_section.mas, stock_id => $stock_id, info_section_title => "<h4 style='display:inline'>Related Stocks</h4>", info_section_subtitle => 'View any plots, plants, tissue_sample, and/or accessions that are linked to this stock.', icon_class => "glyphicon glyphicon-retweet", info_section_id => "stock_related_stock_section", stock_uniquename => $uniquename, type_name => $type_name &>
392392

393393
% }
394-
395-
<& /page/detail_page_2_col_section.mas, stock_id => $stock_id, info_section_title => "<h4 style='display:inline'>Images</h4>", info_section_subtitle => 'View and add images of this stock and of related stocks.', icon_class => "glyphicon glyphicon-camera", info_section_id => "stock_images_section", image_ids => $image_ids, related_image_ids => $related_image_ids, dbh => $dbh, buttons_html => qq|<a id="add_new_image_button" class="btn btn-sm btn-default" style="margin:3px" href="/image/add?type_id=$stock_id&action=new&type=stock&refering_page=$this_page">Add new image</a><a class="btn btn-sm btn-default" style="margin:3px" id="stock_images_section_compare_images_button">Compare Images</a>| &>
394+
395+
<& /page/detail_page_2_col_section.mas, stock_id => $stock_id, info_section_title => "<h4 style='display:inline'>Images</h4>", info_section_subtitle => 'View and add images of this stock and of related stocks.', icon_class => "glyphicon glyphicon-camera", info_section_id => "stock_images_section", image_ids => $image_ids, related_image_ids => $related_image_ids, dbh => $dbh, curator =>$curator, buttons_html => qq|<a id="add_new_image_button" class="btn btn-sm btn-default" style="margin:3px" href="/image/add?type_id=$stock_id&action=new&type=stock&refering_page=$this_page">Add new image</a><a class="btn btn-sm btn-default" style="margin:3px" id="stock_images_section_compare_images_button">Compare Images</a>| &>
396396

397397
<& /page/detail_page_2_col_section.mas, stock_id => $stock_id, info_section_title => "<h4 style='display:inline'>Upload Data Files</h4>", info_section_subtitle => 'Upload any additional files for this Accession.', icon_class => "glyphicon glyphicon-cloud-upload", info_section_id => "stock_upload_files" &>
398398

0 commit comments

Comments
 (0)