1
0
mirror of https://gitlab.com/depesz/explain.depesz.com.git synced 2025-02-21 19:48:37 +02:00
Hubert depesz Lubaczewski f4fb153c41 Allow embedding results in other pages (iframe)
To do it, simply:

  <iframe src="https://explain.depesz.com/i/<ID>"></iframe>
2019-12-03 21:31:29 +01:00

95 lines
3.8 KiB
Plaintext
Executable File

<!doctype html>
%# We don't want to allow iframe for whole site
<% $c->res->headers->header( 'X-Frame-Options' => 'deny' ); %>
<html lang="en">
%= include 'includes/layout_head'
<body class="<%= $self->match->endpoint->name %>">
% my $full_hostname = $self->config->{'title'} // $self->req->url->to_abs->host;
% my @hostname_parts = split( /\./, $full_hostname, 2 );
<!-- wrapper -->
<div id="wrapper">
<header>
<hgroup>
<h1>
% if ( $self->match->endpoint->name eq 'new-explain' ) {
<span><strong><%= $hostname_parts[0] %></strong>.<%= $hostname_parts[1] %></span>
% } else {
<a href="<%= url_for 'new-explain' %>" title="link to: new explain" rel="permalink"><strong><%= $hostname_parts[0] %></strong>.<%= $hostname_parts[1] %></a>
% }
</h1>
<h2><span>PostgreSQL's explain analyze made readable</span></h2>
</hgroup>
</header>
<nav>
<ul>
% for my $item ( qw( new-explain history help ) ) {
<li class="item item-<%= $item %>">
% my $name = $item;
% $name =~ s/\-/ /;
% if ( $self->match->endpoint->name eq $item ) {
<span><%= $name =%></span>
% } else {
<a href="<%= url_for $item %>" title="link to: <%= $name %>" rel="permalink"><%= $name =%></a>
% }
</li>
% }
<li class="item item-about">
<a href="http://www.depesz.com/index.php/tag/explaindepeszcom/" title="about explain.depesz.com" rel="permalink">about</a>
</li>
% for my $item ( qw( contact ) ) {
<li class="item item-<%= $item %>">
% my $name = $item;
% $name =~ s/\-/ /;
% if ( $self->match->endpoint->name eq $item ) {
<span><%= $name =%></span>
% } else {
<a href="<%= url_for $item %>" title="link to: <%= $name %>" rel="permalink"><%= $name =%></a>
% }
</li>
% }
</ul>
<ul class="right">
% if ( session('user') ) {
<li>
% if ( $self->match->endpoint->name eq "user" ) {
<span>user: <%= session('user') %></span>
% } else {
<a href="<%= url_for 'user' %>" title="link to: user page" rel="permalink">user: <%= session('user') %></a>
% }
</li>
<li>
% if ( $self->match->endpoint->name eq "user-history" ) {
<span>plans</span>
% } else {
<a href="<%= url_for 'user-history' %>" title="link to: user plans" rel="permalink">plans</a>
% }
</li>
% } else {
<li>
% if ( $self->match->endpoint->name eq "login" ) {
<span>login</span>
% } else {
<a href="<%= url_for 'login' %>" title="link to: login/register" rel="permalink">login</a>
% }
</li>
% }
</ul>
</nav>
<section>
<%= content %>
</section>
%= include 'includes/layout_footer'
</div>
<!-- /wrapper -->
</body>
</html>