Commit Graph

234 Commits

Author SHA1 Message Date
evazion
1c2042285f css: replace more css with tailwind-style classes. 2022-12-11 21:29:19 -06:00
evazion
33e4cbeb8d Fix #5179: Add wiki page versions to wiki page secondary links plus standardization
* Call it "Changes" when referring to the global list of changes (pool changes, artist changes, etc).
* Call it "History" when referring to the history of a single item (pool history, artist history, etc).
* Put the artist history search form on the /artist_versions page, and remove the /artist_versions/search endpoint.
2022-11-13 00:58:11 -06:00
evazion
a399ab1060 comments: don't nest search form under div.list-of-comments. 2022-09-26 14:41:27 -05:00
evazion
dff27e3a3a comments: put search form on same page as search results.
* Remove the /comment/search page. Instead put the comment search form
  on the same page as the search results, so you don't have to go back
  and forth to update your search.
* Add an "Edited?" search option, for finding comments that have been edited.
* Add options for sorting by oldest comments and lowest scoring comments.
2022-09-22 20:56:10 -05:00
evazion
e04892fb38 posts: use 180x180 thumbnails in place of 150x150 thumbnails.
For small thumbnails, use 180x180 thumbnails scaled down to 150x150.
This is so we can get rid of 150x150 images and just use 180x180 for
both small and medium size thumbnails.

Also fix RSS feeds, XML sitemaps, and Discord embeds to use 360x360
thumbnails instead of 150x150 thumbnails.
2021-12-13 05:23:38 -06:00
evazion
00befc96f0 /comments: add vote buttons beneath thumbnails on /comments page.
Also fix an N+1 queries problem.
2021-11-21 18:04:52 -06:00
evazion
d8a55bd62b comments: fix video duration not being shown on thumbnails
Fix the video duration not being shown on thumbnails on the
https://danbooru.donmai.us/comments page.

BUG: this introduces duplicate HTML ids on the comments page. Post
thumbnails and post comment containers both have the same html ID.
2021-11-02 03:46:48 -05:00
evazion
fee7ed506b comments: put sticky option in popup menu instead of in edit form.
Put the option to sticky a comment in the "..." popup menu instead of
in the comment edit form. This makes it more consistent with deleting or
undeleting a comment.

Also fix a bug where the comment undelete icon didn't show up due to a
typo.
2021-03-07 20:13:38 -06:00
evazion
cde76e66f6 forms: fix form validation error messages.
* Fix it so that all edit forms show an error banner if the form
  has validation errors. Previously forms had to manually call
  `error_messages_for`, which not all forms did.

* Fix it so that the full validation error message is shown next to each
  input attribute that had errors. Also update the styling of these
  error messages to look better.
2021-02-22 02:38:26 -06: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
e14bc77249 comments: rename "Post as moderator" to "Sticky" 2021-01-23 00:27:40 -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
40bf74220c comments: add score to search form. 2021-01-19 05:48:41 -06:00
evazion
e1e3604f46 comments: rework deleted comments.
Let users see when a post has deleted comments. Show normal users a
'[deleted]' placeholder when a comment is deleted. Show the full comment
to moderators.

Also fix it so that the comment creator can't edit or undelete deleted
comments, and users can't vote on or report deleted comments.

Finally, hide the creator_id, updater_id, and body of deleted comments
in the API.
2021-01-19 04:34:51 -06:00
evazion
07bdc6eab0 comments: rework thresholded comments.
Previously thresholded comments were hidden completely. You had to click
the "Show X hidden comments" button to unhide all hidden comments in a
thread. Now it works like this:

* When a comment is below your threshold, the comment text is hidden and
  replaced by a `[hidden]` link, which you can click to unhide the comment.

* When a comment is at half your threshold (for example, your threshold
  is -8 but the comment is at -4), then the comment is greyed out.

This means that comments aren't completely hidden, they're just
collapsed, so you can see the commenter and the score without unhiding
the comment. It also means you don't have to scroll back up to unhide a
comment, and threads aren't disrupted by comments being secretly
hidden (which is confusing when people are replying to hidden comments,
which forces you to go back up and unhide to find).
2021-01-19 04:07:33 -06:00
evazion
b4530183f4 Fix #4525: Show mod report notices next to reported content. 2021-01-16 01:02:42 -06:00
evazion
724d87f68a comments: refactor to use ViewComponent. 2021-01-16 01:02:42 -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
5bad5c6012 comments: fix visible method conflict.
Fix the `Comment#visible` method conflicting with the base class
`visible` method defined in ApplicationRecord.
2020-08-18 15:34:12 -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
0b52b1622f posts: bring back uploader names. 2020-07-13 19:25:29 -05:00
evazion
63ca421f3e comments: fix exception in /comments/new page.
Fix regression from 804a2ef9a.
2020-06-27 13:05:36 -05:00
evazion
804a2ef9a5 Fix #4535: Comment edit forms contain duplicate IDs.
Prefix comment form IDs with `post_<id>_comment_<id>` to ensure
uniqueness.
2020-06-26 14:57:19 -05:00
evazion
883856d4af simple form: refactor DText form fields to use SimpleForm.
* Refactors DText form fields to use a custom SimpleForm input instead
  of manually generated html. This fixes it so that DText fields use the
  same markup as normal SimpleForm fields, which lets us apply browser
  maxlength validations to DText input fields.

* Fixes autocomplete for @-mentions only working in comments and forum posts.
  Now @-mention autocomplete works in all DText fields, including dmails.
  Known bug: it applies in artist commentary fields when it shouldn't.
2020-06-25 16:28:09 -05:00
evazion
3e792019e5 comments: link votes page in subnav for mods. 2020-04-03 15:43:01 -05:00
evazion
557c15123b comments: fix exception with group_by=comment param. 2020-03-27 01:34:54 -05:00
evazion
50b0b79891 comments: adjust link to howto:comment.
Replace the giant banner about reading the comment guidelines with a
smaller link to howto:comment beneath the comment text box.
2020-03-24 18:32:30 -05:00
evazion
94aff2c777 moderation reports: pass CurrentUser to visible explicitly.
This is for consistency with how `visible` works in other models.
2020-03-21 23:06:42 -05:00
evazion
a5418abb31 pundit: convert posts to pundit. 2020-03-20 18:03:01 -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
9242bf522b pundit: convert moderation reports to pundit. 2020-03-20 18:03:01 -05:00
evazion
a0c4617057 pundit: convert comments to pundit. 2020-03-20 18:03:00 -05:00
evazion
874a4118ea comments/index: show pretty ratings. 2020-03-03 03:25:51 -06:00
evazion
af044c45db mod reports: enable reporting for members, add dmail reporting.
* Add ability to report dmails.
* Enable reports for comments, forum posts, and dmails.
* Allow Members to send reports.
* Don't allow users to report the same thing twice.
2020-01-27 17:12:39 -06:00
evazion
c36c0b9e7a views: refactor atom feed links.
* Fix comment & forum feeds to include search params.
* Remove global post feeds (only include post feeds on post index).
2020-01-26 19:16:38 -06:00
evazion
815703a922 views: adjust more <meta> descriptions.
* Add <meta> descriptions to more pages.
* Adjust wiki/pool/forum pages to use an excerpt of the first paragraph.
2020-01-26 19:16:38 -06:00
BrokenEagle
5f746c1a34 Made recommended changes to moderator reports (see #4267) 2020-01-21 01:38:08 +00:00
BrokenEagle
29e8b89c93 Use better method for querying moderation reports on posts and topics
- Also moved the control logic out of the views and into the models
2020-01-19 20:16:22 +00:00
BrokenEagle
16100ecfe6 Use better method of querying the moderation reports for an instance
The use of any? and count was forcing new SQL requests for each statement.
Instead, present? and length were used which act on the reports once loaded.
Although unneeded, the comment and forum views were changed as well for consistency.
2020-01-19 00:09:51 +00:00
BrokenEagle
a3e889bdf5 Added highlighting and notices for moderators
- Posts and topics have an added moderation_reports function
-- This is so all moderation reports can be loaded in a single query
- Those moderation reports are passed into the render functions separately
-- This is so the individual comments/posts don't have to be queried
2020-01-18 21:10:50 +00:00
BrokenEagle
4cef0e45c2 Create the ability to send reports to moderators
- Limited to Builders+
-- Moderator+ can also use as they may be too busy ATM
- Only on users, comments, and forum posts
- Multiple reports can be generated per instance
- Primarily posts to a moderator-only topic for viewability
- Secondarily has a table for searchability
-- Viewable only by moderators
2020-01-18 06:40:20 +00:00
evazion
c86c61c9a4 Fix #4162: Remove browser autocomplete from most inputs. 2020-01-10 16:08:34 -06:00
evazion
d0d3da08e5 views: remove IP addresses from most pages.
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.
2020-01-09 16:55:09 -06:00
evazion
cc6ae7792a comments: fix delete comment ajax call.
Broken because the markup changed and because it doesn't change the
delete link to undelete. Easier to just reload.
2019-12-30 23:00:53 -06:00
evazion
e02a145da2 comments: add reply/vote links to comment search page (#4236). 2019-12-30 23:00:53 -06:00
evazion
5422db1c3c Standardize links to wiki help pages.
* Fix inconsistencies in how wiki pages were linked.

* Link directly to the wiki instead of to a title search that is expected
  to redirect to the wiki.
2019-10-31 19:04:18 -05:00
evazion
d3165f78aa comment votes: add index page. 2019-10-28 14:12:40 -05:00
evazion
f4376fc7a3 post votes: add index page. 2019-10-28 03:21:18 -05:00