Better formatting

This commit is contained in:
Citlali del Rey 2022-11-03 11:17:49 -07:00
parent 905e885041
commit c2c77adad6
Signed by: nullobsi
GPG Key ID: 933A1F44222C2634
2 changed files with 16 additions and 19 deletions

View File

@ -104,16 +104,15 @@ sub announcements ($self) {
$next_page = $page + 1;
}
my @chosen = (sort keys %announcements)[$start_index..$end_index];
my @items;
for my $key (@chosen) {
push @items, $announcements{$key};
}
$self->stash(
announcements => \%announcements,
total_items => $total_items,
items_per_page => $items_per_page,
page => $page,
start_index => $start_index,
end_index => $end_index,
next_page => $next_page,
next_page => $next_page,
items => \@items,
);
$self->render();
}

View File

@ -7,25 +7,23 @@
<p>
These announcements are also avaiable over RSS. Just add .rss to the path here.
<br>
Also, all announcements are signed with the following PGP key:
Also, all announcements are signed with the following <a href="/alpha.asc">PGP key</a>:
</p>
<pre>67A3 9437 8618 B72E B4D5 CC69 B0EB E117 49B9 9367 alpha@unix.dog</pre>
<p>
so you can verify their authenticity. When a new announcement is out, you should
also recieve an email if you're registered.
</p>
<% my @sorted = sort (keys %$announcements); %>
<% foreach my $key (@sorted[$start_index..$end_index]) { %>
<% my $value = $announcements->{$key}; %>
% foreach my $entry (@$items) {
<article>
<h2><%= $value->{"title"} %></h2>
<h2><%= $entry->{"title"} %></h2>
<p>
Posted <%= localtime($value->{"date"})->strftime() %>.
<a href="/announcement/<%= $value->{"filename"} %>">Download PGP signature.</a>
Posted <%= localtime($entry->{"date"})->strftime() %>.
<a href="/announcement/<%= $entry->{"filename"} %>">Download PGP signature.</a>
<p>
<pre><%= $value->{"text"} %></pre>
<pre><%= $entry->{"text"} %></pre>
</article>
<% } %>
<% if ($next_page != -1) { %>
% }
% if ($next_page != -1) {
<a href="/announcements?page=<%= $next_page %>">Next page...</a>
<% } %>
% }