Commit 5b15f2ba authored by Hubert Lubaczewski's avatar Hubert Lubaczewski
Browse files

Various fixes:

1. Fix getting link to UpperCased guc docs
2. Change guc display to table
3. Fix index of "jump to"
parent 7ad05996
......@@ -395,6 +395,7 @@ sub get_all_diffs {
sub get_guc_doc_link {
my $self = shift;
my ( $version, $guc ) = @_;
$guc = lc $guc;
my $major = Pg::Version->new( $version )->major;
$self->load_guc_doc_links( $major );
my $C = $self->cache->{ ':guc-docs' }->{ $major };
......
......@@ -67,14 +67,6 @@ h2 {
color: #ddd;
}
h3 {
font-size: 24px;
font-weight: normal;
text-align: left;
padding-left: 40px;
text-decoration: underline;
}
h2#loc {
padding-left: 20px;
}
......@@ -258,25 +250,35 @@ p {
color: #ff0;
}
h3 {
margin-left: 2em;
font-weight: bold;
}
#config_changes {
margin-left: 2em;
margin-right: 2em;
padding: 0.5em;
}
#config_changes ul {
padding-top: 0.1em;
padding-bottom: 0.1em;
#config_changes table {
border: 1px solid #555;
margin-left: 4em;
}
#config_changes li {
margin-top: 0;
margin-left: 50px;
padding-left: 20px;
#config_changes th,
#config_changes td {
padding: 0 1em;
}
#config_changes .guc-value {
#config_changes td {
border-top: 1px dotted #555;
}
#config_changes th:not(:first-child),
#config_changes td:not(:first-child) {
border-left: 1px dotted #555;
}
#config_changes table thead {
background: #333;
padding: 1px 5px;
}
#config_changes .guc-value {
background: #282828;
font-family: "Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono",monospace,serif;
border: 1px dotted #888;
}
% layout 'default';
<div id="diff">
<div id="upIndex">
<p>Jump to...</p>
<p>Jump to:</p>
<ul>
% if (stash('security')) {
<li><a href="#security">Security fixes</a></li>
% }
% my $cc = stash('config_changes');
% if ($cc) {
<li>
<a href="#config_changes">Configuration changes</a>
<ul>
% if ( $cc->{'removed'} ) {
<li><a href="#cc_removed">Removed</a></li>
% }
% if ( $cc->{'added'} ) {
<li><a href="#cc_added">Added</a></li>
% }
% if ( $cc->{'modified'} ) {
<li><a href="#cc_modified">Changed default value</a></li>
% }
</ul>
</li>
% }
% if ( ( $cc ) || ( stash('security') ) ) {
<li><a href="#loc">List of changes</a></li>
% } else {
<li><a href="#diffList">List of changes</a></li>
% }
% for my $diff ( @{ stash('diffs') } ) {
<li><a href="#p<%= $diff->{'version'} %>">... to <%= $diff->{'version'} %> from <%= $diff->{'released'} %></a></li>
% }
......@@ -23,7 +48,7 @@
% if (stash('security')) {
<div id="security">
<h2>Security fixes:</h2>
<h2><a href="#top">⇑</a> Security fixes:</h2>
<ul id="secDiff">
% for my $item ( @{ stash('security') } ) {
<li><%== $item %></li>
......@@ -32,54 +57,96 @@
</div>
% }
% if (stash('config_changes')) {
% my $cc = stash('config_changes');
% if ($cc) {
<div id="config_changes">
<h2>Configuration changes:</h2>
<h2><a href="#top">⇑</a> Configuration changes:</h2>
% if ( $cc->{'removed'} ) {
<h3>Removed config parameters:</h3>
<ul id="cc_removed">
<h3><a href="#top">⇑</a> Removed config parameters:</h3>
<table id="cc_removed">
<thead>
<tr>
<th>Config parameter:</th>
<th>Default value:</th>
</tr>
</thead>
<tbody>
% for my $item ( @{ $cc->{'removed'} } ) {
% my $url = app->db->get_guc_doc_link( param('from'), $item->[0] );
<li><span class="guc-name">
<tr>
<td class="guc-name">
% if ( $url ) {
<a href="<%= $url %>"><%= $item->[0] %></a>
% } else {
<%= $item->[0] %>
% }
</span>, with default value of <span class="guc-value"><%= $item->[1] %></span></li>
</td>
<td class="guc-value">
<%= $item->[1] %>
</td>
</tr>
% }
</ul>
</tbody>
</table>
% }
% if ( $cc->{'added'} ) {
<h3>New config parameters:</h3>
<ul id="cc_added">
<h3><a href="#top">⇑</a> Added config parameters:</h3>
<table id="cc_added">
<thead>
<tr>
<th>Config parameter:</th>
<th>Default value:</th>
</tr>
</thead>
<tbody>
% for my $item ( @{ $cc->{'added'} } ) {
% my $url = app->db->get_guc_doc_link( param('to'), $item->[0] );
<li><span class="guc-name">
<tr>
<td class="guc-name">
% if ( $url ) {
<a href="<%= $url %>"><%= $item->[0] %></a>
% } else {
<%= $item->[0] %>
% }
</span>, with default value of <span class="guc-value"><%= $item->[1] %></span></li>
</td>
<td class="guc-value">
<%= $item->[1] %>
</td>
</tr>
% }
</ul>
</tbody>
</table>
% }
% if ( $cc->{'modified'} ) {
<h3>Config parameters with modified default value:</h3>
<ul id="cc_modified">
<h3><a href="#top">⇑</a> Config parameters with changed default value:</h3>
<table id="cc_modified">
<thead>
<tr>
<th>Config parameter:</th>
<th>Default value in Pg <%= param('from') %>:</th>
<th>Default value in Pg <%= param('to') %>:</th>
</tr>
</thead>
<tbody>
% for my $item ( @{ $cc->{'modified'} } ) {
% my $url = app->db->get_guc_doc_link( param('to'), $item->[0] );
<li><span class="guc-name">
<tr>
<td class="guc-name">
% if ( $url ) {
<a href="<%= $url %>"><%= $item->[0] %></a>
% } else {
<%= $item->[0] %>
% }
</span>, default value changes from <span class="guc-value"><%= $item->[1] %></span> to <span class="guc-value"><%= $item->[2] %></span></li>
</td>
<td class="guc-value">
<%= $item->[1] %>
</td>
<td class="guc-value">
<%= $item->[2] %>
</td>
</tr>
% }
</ul>
</tbody>
</table>
% }
</div>
% }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment