Skip to content

Commit 5376c00

Browse files
committed
Make select only usable by curator role (still working and testing)
1 parent 52fe996 commit 5376c00

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

Diff for: mason/image/print_images.mas

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ $image_objects => undef
5050
$selected_image_id => undef
5151
$stock_id => undef
5252
$stock_image_flag => undef
53+
$curator => undef
5354

5455
</%args>
5556

@@ -76,6 +77,7 @@ if ($image_objects) { # don't display anything for empty list of images
7677
} else {
7778
$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>|;
7879
}
80+
print "<div>check_curator_role: $stock_image_flag</div>";
7981
my $i = 0;
8082
foreach my $image_ob (@$image_objects) {
8183
$count++;

Diff for: mason/page/detail_page_2_col_section.mas

+8-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ $info_section_title => "A title"
1313
$info_section_subtitle => "A subtitle"
1414
$buttons_html => undef
1515
$locations_by_program_json => undef
16+
$curator => undef
17+
$stock_image_flag => undef
1618

1719
#Trying to find the right one
1820
$project_id => undef
@@ -320,9 +322,13 @@ $field_headers => ()
320322

321323
% if ($info_section_id eq 'stock_images_section'){
322324
<& /image/compare_images.mas, stock_id => $stock_id &>
323-
325+
<%perl>
326+
if ($curator == 1) {
327+
$stock_image_flag = '1';
328+
}
329+
</%perl>
324330
<&| /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' &>
331+
<& /image/print_images.mas , stock_id=>$stock_id , images=>$image_ids , dbh=>$dbh, additional_image_button_id=>'stock_images', stock_image_flag=>$stock_image_flag , curator=>$curator &>
326332
</&>
327333

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

Diff for: mason/stock/index.mas

+2-2
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 $curator</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>| &>
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)