Skip to content
Closed
6 changes: 5 additions & 1 deletion lib/GADS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2675,13 +2675,17 @@ prefix '/:layout_name' => sub {

if (query_parameters->get('curval_record_id'))
{
my $curval = schema->resultset('Layout')->find(query_parameters->get('curval_layout_id'));
$params->{curval_layout_id} = query_parameters->get('curval_layout_id');
$params->{curval_record_id} = query_parameters->get('curval_record_id');
$params->{parent_record_id} = query_parameters->get('parent_record_id');
$params->{parent_field_name} = $curval->name;
$params->{hide_view_menu} = 1;
}

my $records = GADS::Records->new(%params);

$records->view($view);
$records->view(query_parameters->get('curval_record_id') ? undef : $view);
$records->rows($rows);
$records->page($page);
$records->sort(session 'sort');
Expand Down
2 changes: 1 addition & 1 deletion lib/GADS/API.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ sub _get_records {
my $sheetname = param 'sheet';
my $user = logged_in_user;
my $layout = var('instances')->layout_by_shortname($sheetname); # borks on not found
my $view = current_view($user, $layout);
my $view = query_parameters->get('curval_record_id') ? undef : current_view($user, $layout);

# Allow parameters to be passed by URL query or in the body. Flatten into
# one parameters object
Expand Down
4 changes: 4 additions & 0 deletions src/frontend/css/stylesheets/base/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,7 @@ table.table-bordered {
margin: 0 auto;
}
}

.text-primary {
color: $brand-secundary !important;
}
16 changes: 13 additions & 3 deletions views/navigation/records_top_bar.tt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
<div class="content-block__navigation-left">
<div class="list list--horizontal">
<ul class="list__items">
[% IF hide_view_menu %]
<li class="list__item text-primary font-weight-bold">
<p>Records from field "[% parent_field_name | html %]" on record [% parent_record_id | html %]</p>
</li>
[% ELSE %]
<li class="list__item ">
[% INCLUDE navigation/dropdown_select_view.tt %]
</li>
[% END %]

<li class="list__item ">
[%
Expand Down Expand Up @@ -49,14 +55,18 @@
INCLUDE navigation/dropdown_view_limits.tt;
END;

INCLUDE navigation/dropdown_manage_views.tt;
UNLESS hide_view_menu;
INCLUDE navigation/dropdown_manage_views.tt;
END;

IF viewtype == "graph";
INCLUDE navigation/dropdown_manage_graphs.tt;
END;

INCLUDE navigation/dropdown_actions.tt;

UNLESS hide_view_menu;
INCLUDE navigation/dropdown_actions.tt;
END;

IF page == "data_timeline" AND ! layout.no_download_pdf;
INCLUDE navigation/dropdown_download_timeline.tt;
END;
Expand Down
4 changes: 2 additions & 2 deletions views/snippets/datum.tt
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
[% ELSE %]
[% curval.links.size %]
[% END %]
row[%IF curval.links.size != 1%]s[%END%].</em>
<a href="/[% curval.parent_layout_identifier %]/data?curval_record_id=[% curval.record_id %]&curval_layout_id=[% curval.column_id %]" target="_blank">view all</a>)</p>
row[%IF curval.links.size != 1%]s[%END%].</em>|
<a href="/[% curval.parent_layout_identifier %]/data?curval_record_id=[% curval.record_id %]&curval_layout_id=[% curval.column_id %]&parent_record_id=[% cur_id %]" target="_blank">view all</a>)</p>
[% END %]
[% END %]

Expand Down