From 079910ad68e58106d10edd2b5bfa9281cfc51b84 Mon Sep 17 00:00:00 2001 From: swag Date: Tue, 9 May 2023 20:07:28 -0400 Subject: [PATCH] Some template cleanup and semantic HTML changes --- README.md | 3 ++ assets/css/PostText.css | 68 +---------------------------- templates/layouts/default.html.ep | 21 +++++---- templates/moderator/flagged.html.ep | 14 +++--- templates/moderator/hidden.html.ep | 14 +++--- templates/moderator/index.html.ep | 4 -- templates/page/about.html.ep | 19 ++++---- templates/page/rules.html.ep | 5 ++- templates/remark/by_id.html.ep | 30 +++++++------ templates/remark/create.html.ep | 32 ++++++++------ templates/thread/by_id.html.ep | 56 +++++++++++++----------- templates/thread/by_page.html.ep | 12 ++--- 12 files changed, 115 insertions(+), 163 deletions(-) delete mode 100644 templates/moderator/index.html.ep diff --git a/README.md b/README.md index 815bacc..a4c4f52 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,9 @@ Run the tests locally (against development environment): ## TODOs +1. Show `bump_tally` and `remark_count` in single thread view +1. Rename `remark_count` to `remark_tally` +1. Redirect mod/admin back to hidden/flagged where it makes sense 1. CSS 1. "All new posts flagged" mode (require approval for new posts) 1. Tests for mod-only user? diff --git a/assets/css/PostText.css b/assets/css/PostText.css index f062871..1d90822 100644 --- a/assets/css/PostText.css +++ b/assets/css/PostText.css @@ -13,74 +13,10 @@ border-collapse: collapse; } -.thread .id, .remark .id, .thread .flag, nav .login { +.thread .id, .remark .id, nav .flag, nav .login { float: right; } -code { +pre { white-space: pre-wrap; } - -/* - * For the custom Markdown

-

- */ - -span.head1 { - display: block; - font-size: 2em; - margin-top: 0.67em; - margin-bottom: 0.67em; - margin-left: 0; - margin-right: 0; - font-weight: bold; -} - -span.head2 { - display: block; - font-size: 1.5em; - margin-top: 0.83em; - margin-bottom: 0.83em; - margin-left: 0; - margin-right: 0; - font-weight: bold; -} - -span.head3 { - display: block; - font-size: 1.17em; - margin-top: 1em; - margin-bottom: 1em; - margin-left: 0; - margin-right: 0; - font-weight: bold; -} - -span.head4 { - display: block; - font-size: 1em; - margin-top: 1.33em; - margin-bottom: 1.33em; - margin-left: 0; - margin-right: 0; - font-weight: bold; - } - -span.head5 { - display: block; - font-size: .83em; - margin-top: 1.67em; - margin-bottom: 1.67em; - margin-left: 0; - margin-right: 0; - font-weight: bold; - } - -span.head6 { - display: block; - font-size: .67em; - margin-top: 2.33em; - margin-bottom: 2.33em; - margin-left: 0; - margin-right: 0; - font-weight: bold; -} diff --git a/templates/layouts/default.html.ep b/templates/layouts/default.html.ep index 4fbebf2..4c4d373 100644 --- a/templates/layouts/default.html.ep +++ b/templates/layouts/default.html.ep @@ -5,9 +5,9 @@ <%= asset 'main.css' %> -

Post::Text

- <% if (is_mod) { =%> -
+
+ <% } =%> <% if (is_admin) { =%> -
+
+ <% } =%> - +
<% if (flash 'error') { =%>

<%= flash 'error' %>

@@ -49,8 +49,7 @@ <% } =%> <% if (flash 'info') { =%>

<%= flash 'info' %>

-<% } =%> -<% if (stash 'info') { =%> +<% } elsif (stash 'info') { =%>

<%= stash 'info' %>

<% } =%> <%= content =%> diff --git a/templates/moderator/flagged.html.ep b/templates/moderator/flagged.html.ep index f6aae75..f8b91ff 100644 --- a/templates/moderator/flagged.html.ep +++ b/templates/moderator/flagged.html.ep @@ -1,10 +1,12 @@ % layout 'default'; % title 'Flagged Posts';

<%= title %>

-<% if ($post_links->[0]) { =%> - -<% } =%> + diff --git a/templates/moderator/hidden.html.ep b/templates/moderator/hidden.html.ep index 0f21808..1b45644 100644 --- a/templates/moderator/hidden.html.ep +++ b/templates/moderator/hidden.html.ep @@ -1,10 +1,12 @@ % layout 'default'; % title 'Hidden Posts';

<%= title %>

-<% if ($post_links->[0]) { =%> - -<% } =%> + diff --git a/templates/moderator/index.html.ep b/templates/moderator/index.html.ep deleted file mode 100644 index 5690044..0000000 --- a/templates/moderator/index.html.ep +++ /dev/null @@ -1,4 +0,0 @@ -% layout 'default'; -% title 'Top Secret'; -

<%= title %>

-

For mods only!!

diff --git a/templates/page/about.html.ep b/templates/page/about.html.ep index 9185688..3d585d8 100644 --- a/templates/page/about.html.ep +++ b/templates/page/about.html.ep @@ -1,12 +1,13 @@ % layout 'default'; % title 'About Post::Text';

<%= title %>

-
-

Post::Text is a textboard a bit like 2channel. You - can post whatever you want anonymously just please mind the <%= - link_to rules => 'rules_page' %>. Markdown is supported for - formatting posts using the +

+

Post::Text is a + textboard + a bit like 2channel. You can post whatever you want anonymously + just please mind the <%= link_to rules => 'rules_page' %>. + Markdown is supported for formatting posts using the + original implementation from The Daring Fireball. For example, back-ticks are for inline code while indentation should be used if you want an entire code bock:

@@ -28,7 +29,7 @@ This is correct for a multi-line code block:

You can use an actual tab character or four spaces to indent. Only Markdown is supported, HTML will be filtered out.

-

There is a button for users to 'flag' a post for review by a +

There is a button for users to 'flag' a post for review by a moderator. If you need further assistance you can reach out to the webmaster. There is also a 'bump' button you're free to use and abuse to your heart's @@ -36,5 +37,5 @@ This is correct for a multi-line code block: email client you can check out the <%= link_to 'RSS feed', threads_feed => {format => 'rss'} %>.

Click 'New' in the top navigation bar to start a new thread and - make some enemies friends!

-
+ make some enemies friends!

+ diff --git a/templates/page/rules.html.ep b/templates/page/rules.html.ep index 41e9093..978a572 100644 --- a/templates/page/rules.html.ep +++ b/templates/page/rules.html.ep @@ -1,7 +1,7 @@ % layout 'default'; % title 'The Rules™';

<%= title %>

-
+

The rules here are pretty simple:

  • No hate speech (e.g. racism, sexism, homophobia, transphobia, etc.)
  • @@ -19,4 +19,5 @@ should download your own copy of that content.
  • You are liable for what you post, and we are not liable for it.
  • We may modifiy these rules at any time.
  • -
+ + diff --git a/templates/remark/by_id.html.ep b/templates/remark/by_id.html.ep index 22e9cbf..53dda84 100644 --- a/templates/remark/by_id.html.ep +++ b/templates/remark/by_id.html.ep @@ -1,24 +1,26 @@ % layout 'default'; % title "Remark #$remark->{'id'}";

<%= title %>

-
+
-

<%= $remark->{'date'} %>

<%= $remark->{'author'} %>
<%== markdown $remark->{'body'} =%>
+ + <% if (is_mod) { =%> + + <% } =%>
-
- -<% if (is_mod) { =%> - -<% } =%> + diff --git a/templates/remark/create.html.ep b/templates/remark/create.html.ep index c866c13..7cdb36a 100644 --- a/templates/remark/create.html.ep +++ b/templates/remark/create.html.ep @@ -27,34 +27,40 @@ <%= submit_button 'Post', class => 'post button' %> -
+

Thread

- -

<%= $thread->{'title'} %>

+ +

<%= $thread->{'date'} %>

<%= $thread->{'author'} %>
<%== markdown $thread->{'body'} =%>
-
+ <% if (my $last_remark_id = $last_remark->{'id'}) { =%> -
+

Last Remark

- -

<%= $last_remark->{'date'} %>

+

+ <%= $last_remark->{'date'} %> + + <%= link_to "#$last_remark_id", + single_remark => {remark_id => $last_remark_id} %> + +

<%= $last_remark->{'author'} %>
<%== markdown $last_remark->{'body'} =%>
-
+ <% } =%> diff --git a/templates/thread/by_id.html.ep b/templates/thread/by_id.html.ep index 1a3a5ce..1e4cfc6 100644 --- a/templates/thread/by_id.html.ep +++ b/templates/thread/by_id.html.ep @@ -1,7 +1,7 @@ % layout 'default'; % title "Thread #$thread->{'id'}";

<%= title %>

-
+

<%= $thread->{'title'} %>

<%= $thread->{'date'} %>

@@ -9,43 +9,47 @@
<%== markdown $thread->{'body'} =%>
+ + <% if (is_mod) { =%> + + <% } =%>
-
- -<% if (is_mod) { =%> - -<% } =%> + <% if (my $first_remark = $remarks->[0]) { =%> -
+

Remarks

<% for my $remark (@{$remarks}) { =%>
- -

<%= $remark->{'date'} %>

+

+ <%= $remark->{'date'} %> + + <%= link_to "#$remark->{'id'}", + single_remark => {remark_id => $remark->{'id'}} %> + +

<%= $remark->{'author'} %>
<%== markdown $remark->{'body'} =%>
-
<% } =%> -
- + <% } =%> - + <% if ($last_page && $last_page != 1) { =%>