Commit Graph

24 Commits

Author SHA1 Message Date
nonamethanks
1a990d5ab9 Allow post disapprovals to be edited 2022-04-11 21:05:44 +02:00
nonamethanks
5b5f61c2ea Modqueue: support variable size thumbnails 2022-03-10 20:39:45 +01:00
evazion
698d732667 Fix #4878: Disapproval messages appear out of order.
Display disapproval messages in oldest-to-newest order.
2022-01-11 12:27:56 -06:00
evazion
8841de68ac posts: add adjustable thumbnail sizes (#4932).
Add a menu in the top right of the post index page that lets you select
the thumbnail size.

This menu is currently hidden until the new thumbnails have been generated.

On desktop, there are five thumbnail sizes:

* Small:    150x150 (https://danbooru.donmai.us/posts?size=150)
* Medium:   180x180 (https://danbooru.donmai.us/posts?size=180)
* Large:    225x225 (https://danbooru.donmai.us/posts?size=225)
* Huge:     270x270 (https://danbooru.donmai.us/posts?size=270)
* Gigantic: 360x360 (https://danbooru.donmai.us/posts?size=360)

On mobile, there are four sizes:

* Small:  150x150 / 3 posts per row (https://danbooru.donmai.us/posts?size=150)
* Medium: 180x180 / 2 posts per row (https://danbooru.donmai.us/posts?size=180)
* Large:  225x225 / 2 posts per row (https://danbooru.donmai.us/posts?size=225)
* Huge:   360x360 / 1 posts per row (https://danbooru.donmai.us/posts?size=360)

There are two extra sizes that aren't listed in the menu:

* 225x360 (https://danbooru.donmai.us/posts?size=225w)
* 270x360 (https://danbooru.donmai.us/posts?size=270w)

These sizes are good for tall thumbnails, but not so much for wide
thumbnails. They aren't listed because in practice they're a bit too big.

The 225x225 and 270x270 sizes are really just 360x360 thumbnails scaled
down in HTML. This means 225x225 and 360x360 thumbnails both use the
same amount of bandwidth.

Thumbnail size is currently a per-search option, not a persistent
account-level setting.

This changes the HTML structure of thumbnails somewhat, so this may
break userscripts and custom CSS.
2021-12-04 06:30:29 -06:00
evazion
206a4b5de5 docker: avoid rebuilding CSS/JS assets on every commit.
Restructure the Dockerfile and the CSS/JS files so that we only rebuild
the CSS and JS when they change, not on every commit.

Before it took several minutes to rebuild the Docker image after every
commit, even when the JS/CSS files didn't change. This also made pulling
images slower.

This requires refactoring the CSS and JS to not use embedded Ruby (ERB)
templates, since this made the CSS and JS dependent on the Ruby
codebase, which is why we had to rebuild the assets after every Ruby
change.
2021-10-13 02:48:30 -05:00
evazion
1f637867a4 tags: refactor tag lists to use ViewComponent. 2021-02-05 02:37:02 -06:00
evazion
ffdd5e6128 posts: make post votes work the same way as comment votes.
Change post votes to work the same way as comment votes:

* Make the upvote arrow blue if you've upvoted the post, or grey if you
  haven't. Likewise for the downvote arrow.
* Make it so you can click the upvote or downvote arrows to undo the vote.
* Don't show any notices when you vote on a post.

Also fix it so that votes work the same way on the posts page, the
comments page, and in the modqueue. Before it wasn't possible to undo
votes on the comments page or in the modqueue.
2021-01-29 02:21:08 -06:00
evazion
63e3b4b447 views: factor out FontAwesome icons.
Factor out FontAwesome icons into a set of helpers. This is so that it's
easier to keep track of which icons we're using and easier to change
icons globally.
2021-01-21 07:58:50 -06:00
evazion
1b30b71a07 posts: refactor post previews to use ViewComponent.
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.
2021-01-14 21:17:57 -06:00
Aaron Franke
6cdafdf136 Remove trailing space characters
Trailing space characters do nothing except take up disk space, they should be removed
2020-10-04 05:15:02 -04:00
evazion
df19cbfd55 modqueue: show appealed posts in sidebar. 2020-08-16 15:41:30 -05:00
evazion
317cfe19b4 flags: only show current flag on flagged posts.
* Only show the current pending flag on flagged posts. Don't show old flags.

* Don't show both the "This post was flagged for review" and the "This
  post was flagged and is pending" notices.
2020-08-16 14:31:47 -05:00
evazion
7eb9f0b75e appeals: only show current appeal on appealed posts.
* Only show the current pending appeal in the "This post was appealed"
  notice. Don't show old appeals.

* Don't show both the "This post was deleted" and the "This post was
  appealed" notice on appealed posts. Only show the "This post was
  appealed" notice.

* Show "no reason" if no appeal reason was given.
2020-08-16 14:31:47 -05:00
evazion
0a0a85ee70 Fix #4568: Send appealed posts back to the mod queue
* Include appealed posts in the modqueue.

* Add `status` field to appeals. Appeals start out as `pending`, then
  become `rejected` if the post isn't approved within three days. If the
  post is approved, the appeal's status becomes `succeeded`.

* Add `status` field to flags. Flags start out as `pending` then become
  `rejected` if the post is approved within three days. If the post
  isn't approved, the flag's status becomes `succeeded`.

* Leave behind a "Unapproved in three days" dummy flag when an appeal
  goes unapproved, just like when a pending post is unapproved.

* Only allow deleted posts to be appealed. Don't allow flagged posts to be appealed.

* Add `status:appealed` metatag. `status:appealed` is separate from `status:pending`.

* Include appealed posts in `status:modqueue`. Search `status:modqueue order:modqueue`
  to view the modqueue as a normal search.

* Retroactively set old flags and appeals as succeeded or rejected. This
  may not be correct for posts that were appealed or flagged multiple
  times. This is difficult to set correctly because we don't have
  approval records for old posts, so we can't tell the actual outcome of
  old flags and appeals.

* Deprecate the `is_resolved` field on post flags. A resolved flag is a
  flag that isn't pending.

* Known bug: appealed posts have a black border instead of a blue
  border. Checking whether a post has been appealed would require either
  an extra query on the posts/index page, or an is_appealed flag on
  posts, neither of which are very desirable.

* Known bug: you can't use `status:appealed` in blacklists, for the same
  reason as above.
2020-08-06 20:55:45 -05:00
evazion
3a3d456bd2 html: standardize font sizes and heading tags.
Standardize font sizes and heading tags (<h1>-<h6>) to be more
consistent across the site.

Changes:

* Introduce font size CSS variables and start replacing hardcoded font
  sizes with standard sizes.
* Change header tags to use only one <h1> per page. One <h1> per page is
  recommended for SEO purposes. Usually this is for the page title, like
  in forum threads or wiki pages.
* Standardize on <h2> for section headers in sidebars and <h3> for
  smaller subsection headers. Don't use <h4>-<h6>.
* In DText, make h1-h4 headers all the same size. Standard wiki style is
  to ignore h1-h3 and start at h4.
* In DText, make h4-h6 the same size as the h1-h3 tags outside of DText.
* In the tag list, change the <h1> and <h2> tag category headers to <h3>.
* Make usernames in comments and forum posts smaller. Also change the
  <h4> tag for the commenter name to <div class="author-name">.
* Make the tag list, paginator, and nav menu smaller on mobile.
* Change h1#app-name-header to a#app-name-header.
2020-07-23 17:34:17 -05:00
evazion
ab4d596ac2 Fix #4405: Post version table css doesn't keep ratio at smaller resolutions.
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
2020-04-17 01:46:14 -05:00
evazion
c6354b2504 modqueue: add links to flags, appeals, approvals, deletions in subnav. 2020-04-04 00:13:43 -05:00
evazion
415d9591c5 pundit: convert post votes to pundit.
Side effects:

* The data-current-user-is-voter <body> attribute has been removed.
* {{upvote:self}} no longer works. {{upvote:<name>}} should be used instead.
2020-03-20 18:03:01 -05:00
evazion
85f1674618 modqueue: highlight bad tags instead of entire post.
Change it so that when a post contains bad tags, the tags themselves are
highlighted rather than the entire post.

This also adds a data-tag-name attribute to tags in tag lists.
2020-03-03 03:25:51 -06:00
evazion
b0e2ffbe7d modqueue: remove highlighting of high/low scoring posts. 2020-03-03 03:25:51 -06:00
evazion
fc97ea3c8e modqueue: rework post display.
Rework how posts are displayed in the modqueue:

* Rearrange post info to take up less space and to be consistent with
  how posts are shown on the comments index.
* Reduce font size of approve / reject options.
* Reduce empty space around thumbnails and between posts.
* Add size info beneath thumbnails.
* Allow voting on posts.
* Use PostPresenter.preview to standardize rendering of thumbnails. This
  adds parent/child borders, tooltips, and data attributes.
2020-03-03 03:25:51 -06:00
evazion
04b69954eb modqueue: add order options; change default order to newest first.
* Add options for changing the order of the modqueue (newest first,
  oldest first, highest scoring first, lowest scoring first).

* Change the default order from oldest posts first to most recently
  flagged or uploaded posts first.

* Add an order:modqueue metatag to order by most recently flagged or
  uploaded in standard searches.
2020-03-03 03:25:51 -06:00
evazion
9ddf408ec5 modqueue: add sidebar.
Add a sidebar to the modqueue page that shows the following information:

* Number of pending and flagged posts.
* Number of posts disapproved for poor quality or breaking rules.
* Top uploaders in the queue.
* Top artist, copyright, and character tags in the queue.
2020-03-02 13:47:54 -06:00
evazion
475d6ae7cf modqueue: move url from /moderator/post/queue to /modqueue. 2020-02-29 17:46:58 -06:00