Added a lil link for plain/raw text

This commit is contained in:
swagg boi 2023-06-27 20:55:41 -04:00
parent 65d9ec84e5
commit b548b209e3
5 changed files with 11 additions and 5 deletions

View file

@ -61,7 +61,7 @@ tests locally:
## TODOs
1. Probably gotta add a link to the 'raw' txt view somewhere
1. CAPTCHA
1. "All new posts flagged" mode (require approval for new posts)
1. Tests for mod-only user?

View file

@ -17,7 +17,8 @@ my %invalid_remark = (
subtest 'View single remark', sub {
$t->get_ok('/remark/single/1')->status_is(200)
->text_like(h2 => qr/Remark #1/)
->element_exists('a[href$="/remark/post/1/1"]');
->element_exists('a[href$="/remark/post/1/1"]')
->element_exists('h2 sup a[href$=".txt"]');
$t->get_ok('/remark/single/65536')->status_is(404)
->text_like(p => qr/Remark not found/);

View file

@ -35,7 +35,8 @@ subtest 'List threads by page', sub {
subtest 'View single thread', sub {
$t->get_ok('/thread/single/1')->status_is(200)
->text_like(h2 => qr/Thread #1/);
->text_like(h2 => qr/Thread #1/)
->element_exists('h2 sup a[href$=".txt"]');
$t->get_ok('/thread/single/65536')->status_is(404)
->text_like(p => qr/Thread not found/);

View file

@ -1,6 +1,8 @@
% layout 'default';
% title my $remark_id = $remark->{'id'} ? "Remark #$remark_id" : '?';
<h2 class="page-title"><%= title %></h2>
<h2 class="page-title">
<%= title %> <sup><%= link_to txt => url_for . '.txt' %></sup>
</h2>
<% if (keys %{$remark}) { =%>
<% content_for open_graph => begin %>
<meta property="og:type" content="article">

View file

@ -1,6 +1,8 @@
% layout 'default';
% title my $thread_id = $thread->{'id'} ? "Thread #$thread_id" : '?';
<h2 class="page-title"><%= title %></h2>
<h2 class="page-title">
<%= title %> <sup><%= link_to txt => url_for . '.txt' %></sup>
</h2>
<% if (keys %{$thread}) { =%>
<% content_for open_graph => begin %>
<meta property="og:type" content="article">