Refactor CSS to use standard Tailwind-style utility classes instead of
ad-hoc rules. This eliminates a lot of single-purpose rules for specific
UI elements and standardizes margins to be more consistent throughout
the site.
Utility classes are defined manually on an as-needed basis instead of
importing Tailwind as a whole. Naming conventions mostly follow
Tailwind's conventions, otherwise they follow Bootstrap.
* https://tailwindcss.com/docs/
* https://getbootstrap.com/docs/5.0/utilities/spacing/
Refactor the post preview html to use the ViewComponent framework. This
lets us encapsulate all the HTML, CSS, and helper methods for a UI
component in a single place.
See https://viewcomponent.org.
Fix broken links on various pages:
* The 'History' link in the sidebar on the post index page.
* The 'History' links on the tags index page.
* The 'Tag History' link in the sidebar on the wiki show page.
This will facilitate users being able to monitor tag changes from
a list of tags they are interested in. Currently, the only way to
do this is 2 separate queries on the added_tags and removed_tags.
Bug: extremely long sources cause the Tags column to become extremely
wide. Caused by the source link not having the word-break property set.
Fix: use post_source_tag, which lets the `a[rel=external] { word-break: break-word; }`
rule take effect.
Example: https://danbooru.donmai.us/post_versions?search%5Bpost_id%5D=3809742
- Tag matches allows a user to search for a single tag
-- Since testing for multiple tags would require converting the "tags"
string to an array which would most likely fail even for single tags
- Is new for quick searching of uploads or not uploads
- "Current" is now most like the old format
-- It is therefore now the default for post versions
- Only show the actual edits in their own column
- Show the current state at that version in another column
- On the "previous" view, don't double-show full list of tags for
the first post versions, so leave edits blank
- The types are:
-- Previous: The default and the previously used type
-- Subsequent: Compares against the next version
-- Current: Compares against the current version
- Allow switching between comparison types in index and diff views
-- Have links vary depending upon current comparison type
- Diff view changes
-- Only show pool description changes in diff view
-- Conditionally render diff link when applicable values are changed
-- Conditionally show diff view sections when values are changed
- Show renames on index view
-- There is plenty of space
-- This wasn't shown at all for wikis
-- Having to navigate to an alternate page is unwieldy for pools
- Show "posts" as a status on pools
-- This is so all changes among versions are quantified as a status
- Standardize diff/index titles
- Fixes the extremely long class name on the post versions view
- Can now use one value instead of having to set th and td
- Added missing column classes on all tables
Removed IP addresses from comments and from most other listing pages.
IPs take up a lot of space in many places (especially IPv6 addresses),
and in most of these pages they're rarely useful for catching
sockpuppets.
Change calling convention to explicitly indicate whether the attributes
are for the <th> element or the <td> element. Fixes various cases where
the two were mixed up.
* Fix .col-expand classes not being set correctly on the /post_versions,
/pool_versions, and /notes pages.
* Fix .updater and .updated-at classes not being set correctly on the
/forum_topics page.
* Fix the name param being ignored (noticeable in the post count field
on the /tags page).
* Don't pass empty string when column has no name.
* Add search form above table.
* Move thumbnail to left of table when viewing history of single post.
* Remove unrelated links from subnav menu.
* Fix bugs with changed_tags search.
* Add thumbnails to /post_versions (when viewing history of a single
post, thumbnail is above table rather than in every table row).
* Combine user, date, and ip address columns into one column.
* Remove rating and parent columns (rating and parent changes are
already listed in the tags column).
* Add ability to search /post_versions by added tags, removed tags, or
changed tags (added or removed).
* Add 'History' link to the sidebar of the /posts index. This is a
shortcut for a /post_versions search of the current tag.
post_version.post.versions.first.id caused an extra query for each post version:
SELECT "post_versions".* FROM "post_versions" WHERE "post_versions"."post_id" = $1 ORDER BY updated_at ASC, id asc LIMIT 1
@post_versions.empty? caused this query:
SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM "post_versions" WHERE (true) LIMIT 20 OFFSET 0) subquery_for_count
which is unnecessary since @post_versions can be counted directly.