TT#81185 - Return only body when parameter 'framed' is sent

* Remove headers, menu, site title and footer if
	   parameter 'framed' is sent
	 * Persist 'framed' in the session once it's sent
	   and only restore header/footer once 'framed' is
	   sent again with the value 0

Change-Id: Ie1dcc698b901ea3c659a05391ffcdc882113ef13
changes/70/39970/3
Flaviu Mates 6 years ago
parent 722d3ad976
commit d31797c674

@ -344,6 +344,9 @@ sub auto :Private {
} }
$c->stash(topmenu => $topmenu_templates); $c->stash(topmenu => $topmenu_templates);
$c->session->{framed} = 1 if ($c->req->params->{framed} && $c->req->params->{framed} == 1);
$c->session->{framed} = 0 if (defined $c->req->params->{framed} && $c->req->params->{framed} == 0);
$c->stash(framed => $c->session->{framed}) if ($c->session->{framed} && $c->session->{framed} == 1);
$c->session->{created_objects} = {} unless(defined $c->session->{created_objects}); $c->session->{created_objects} = {} unless(defined $c->session->{created_objects});

@ -44,6 +44,12 @@
[% END -%] [% END -%]
</head> </head>
[% IF framed -%]
<div style="padding: 24px 24px 24px">
[% END -%]
[% content %] [% content %]
[% IF framed -%]
</div>
[% END -%]
</html> </html>
[% # vim: set tabstop=4 syntax=html expandtab: -%] [% # vim: set tabstop=4 syntax=html expandtab: -%]

@ -1,7 +1,7 @@
[% [%
IF template.name.match('^api|(\.html$|\.css$|\.js$|\.txt$)'); IF template.name.match('^api|(\.html$|\.css$|\.js$|\.txt$)');
content; content;
ELSIF template.name.match('^login\/login\.tt$'); ELSIF template.name.match('^login\/login\.tt$') || framed;
content WRAPPER html.tt; content WRAPPER html.tt;
ELSE; ELSE;
content WRAPPER html.tt + body.tt; content WRAPPER html.tt + body.tt;

@ -295,7 +295,7 @@ $(document).ready(function() {
[% IF (!back_created) || helper.top_buttons.size -%] [% IF (!back_created) || helper.top_buttons.size -%]
<div class="row"> <div class="row">
[% UNLESS back_created -%] [% UNLESS back_created || framed -%]
<span class="pull-left" style="margin:0 5px 0 5px;"> <span class="pull-left" style="margin:0 5px 0 5px;">
<a class="btn btn-primary btn-large" href="[% c.uri_for('/back') %]"><i class="icon-arrow-left"></i> [% c.loc("Back") %]</a> <a class="btn btn-primary btn-large" href="[% c.uri_for('/back') %]"><i class="icon-arrow-left"></i> [% c.loc("Back") %]</a>
</span> </span>

Loading…
Cancel
Save