Commit Graph

343 Commits

Author SHA1 Message Date
evazion
869142ed1b Fix #4314: Favorite/vote modes give generic error messages.
Refactor tag scripts to fix multiple issues:

* Errors during tag scripting didn't show the actual error message, just
  a generic "There was an error updating post #NNN" message.
* The quick edit form didn't show any error messages at all on failure.
* Thumbnails didn't have all their data attributes properly updated
  after the post was updated.

This changes it so that thumbnails have their html fully replaced after
updating. This has the side effect of removing event handlers bound
directly to the thumbnail. A `danbooru:post-preview-updated` event is
fired in case userscripts need to detect when thumbnails are updated.
2020-02-27 19:23:48 -06:00
evazion
4b9a29743a Revert "Fix post resize image control"
This reverts commit 2affd4a3b5.
2020-02-27 00:19:09 -06:00
BrokenEagle
f671a5528d Adapt which note body corner is used for note box rotations
Beforehand it was always using the left corner, which was causing
the note body to be to the right of the note box whenever the bottom
angle of the note box was descending. Now it selects the left or
the right corner depending on the angle, which keeps the note body
in a better position right beneath the note box.
2020-02-25 17:16:32 +00:00
evazion
928c7f8a0a Merge pull request #4281 from BrokenEagle/embedded-notes-improvements
Add embedded notes improvements
2020-02-24 01:13:13 -06:00
evazion
463b1b734e Add curated posts page.
Add a curated posts page at /explore/posts/curated. Curated posts are
the most favorited posts by contributor-level users (users with
unlimited upload permissions).

Also add an order:curated tag using for use in regular searches.
2020-02-23 17:52:38 -06:00
evazion
1ce01df3db Merge pull request #4302 from BrokenEagle/fix-nonembedded-note-resizing
Restrict note container resizing to embedded notes
2020-02-23 01:01:44 -06:00
BrokenEagle
2b0d52b5bb Restrict note container resizing to embedded notes 2020-02-21 20:07:19 +00:00
evazion
9b58cb7b42 mode menu: remove approve option.
Remove the approve option from the post mode menu. Mass approving posts
is rarely needed. The javascript was also buggy (it didn't update the
data attributes correctly when undeleting a post).

The replacement for this feature is to use a tagscript with the
status:active tag.
2020-02-20 17:43:33 -06:00
evazion
f47c56d976 approvals: move post approval endpoint to /post_approvals.
Move the post approval endpoint from `POST /moderator/post/approval` to
`POST /post_approvals`.
2020-02-20 15:49:18 -06:00
evazion
610ad9e119 mode menu: refactor favorite and vote options. 2020-02-20 03:42:07 -06:00
evazion
c89c7ccc63 mode menu: remove post ban, rating lock, note lock options. 2020-02-20 03:42:07 -06:00
BrokenEagle
e4ff641c9a Fix autocomplete insert completion
It was removing line returns, even when line returns are important,
such as in the blacklist and frequent tags input fields. Besides those,
it was also causing confusion when editing tags on a post, as those
are divided into categories, but adding an additional tag for a category
at the end of a group causes groups of tags to be combined.
2020-02-18 00:00:58 +00:00
evazion
7e67d3dd9c views: replace .category-N css classes with .tag-type-N
* Replace the .category-N CSS classes on tags with .tag-type-N. Before
  we were inconsistent about whether tag colors were indicated with
  .category-N or .tag-type-N. Now it's always .tag-type-N.

* Fix various places to not use Tag.category_for. Tag.category_for does
  one Redis call per tag lookup, which leads to N Redis calls on many
  pages. This was inefficient because usually we either already had the
  tags from the database, or we could fetch them easily.
2020-02-16 04:35:37 -06:00
evazion
caf54fe45a blacklists: remove ability for mods to blacklist uploaders by name. 2020-02-16 04:00:42 -06:00
BrokenEagle
2affd4a3b5 Fix post resize image control
It was resizing images to the original width and height, even if
they were currently being shown in their large image format (850px).
This was causing excessive blur and artifacts in some cases.
2020-02-14 20:49:37 +00:00
BrokenEagle
115355ab7b Fix dialogue text for new notes
It was showing "Editing note #xx" and so on for all new notes past the first initial new note.
2020-02-14 20:49:17 +00:00
BrokenEagle
44f32a1e5e Add ability to copy certain style attributes to the outer note boxes
- Attributes are pulled from the first element with class "note-box-attributes"
- Transform is note box only to prevent applying the same transform twice
-- Only rotations are allowed to prevent excessive scaling of note boxes
-- Note box positions are adjusted after drag/nudge/resize to prevent out-of-bounds
-- The note body is placed on the lowest box corner that is farthest left
- Background color is inner box only since the note box is already transparent
-- Backgrounds with any transparency aren't allowed as they would interfere with the text below
- Border radius is both since they both have borders
- Add full namespaces to all event removes to prevent bad removes
2020-02-11 04:56:27 +00:00
BrokenEagle
c082a258c7 Add note key resize function
- Same as using the key nudge, however it's used with the shift key
2020-02-11 04:56:26 +00:00
BrokenEagle
9fbeb5ec3a Add note key nudge function
- Notes must be clicked in order to engage the nudge function for that note
-- This status is indicated by a green border around the note
-- Clicking the note or another note will turn off nudging for that note
- Also prevent notes from being nudged outside of the image borders
2020-02-11 04:56:26 +00:00
BrokenEagle
e0e60a9546 Remove dead embedded code 2020-02-10 17:23:27 -06:00
BrokenEagle
778619301e Resize font and other size parameters when the image resizes
- Each element has the size style elements scaled to the font size with "em"
-- The font size of the element is scaled in percentage to the parent element
- All sizes are then scaled by changing the font size of the note container
- The scale resize calculation uses the large image size
-- Since this is the assumed default size for a user
- Preview sets the font size of the inner box to the base font size
-- This allows the calculations to be performed correctly
2020-02-10 17:22:27 -06:00
BrokenEagle
44bcef03e1 Add additional styles for embedded notes
- Use CSS classes instead of applying the styles to the elements.
-- Allows a user to override any of the default styles being applied.
- Remove the borders and handles when not hovering over the box.
- Increase the opacity for embedded notes to full to avoid conflicts with
  the text underneath.
- Decrease the opacity a little when editing embedded notes.
-- Allows for better seeing of the text underneath while still being able
   to see the translation text above.
-- Compensated for by showing full opacity when hovering over the note box.
2020-02-10 17:20:56 -06:00
evazion
3ef4d9c7ac artists/summary: link other names to artist searches.
* Link other names to artist searches instead of to the new artist page.
* Remove the asterisk next to other names indicating the name isn't used
  as the primary name of another artist. This is almost always the case.
2020-02-10 17:11:38 -06:00
BrokenEagle
8ff00cfc7d Rework post version view
- Added a changes column explicitly listing all of the changes
-- This makes it more in line with the other views now
2020-02-08 22:57:30 +00:00
BrokenEagle
de1324098d Rework wiki page versions index/diff views
- Changed to using the diff-body CSS class
-- Removed unnecessary elements from the CSS style file
- Does a symmetric difference on the array fields to detect differences
- Add more descriptors to the status/changes column
- Specifically add <br> to statuses to cause line breaks
2020-02-08 22:57:29 +00:00
BrokenEagle
ede7167bb8 Rework pool versions index/diff views
- Changed to using the diff-body CSS class
-- Removed unneeded CSS style file
- Removed trailing whitespace after the >>> link
-- It was causing artifact line-throughs to appear after the link
- Changed the diff link to only render when a text field has changed
-- Because the post changes are already shown on the index view
- Specifically add <br> to statuses to cause line breaks
2020-02-08 22:57:29 +00:00
BrokenEagle
d62f7e786e Revise display on artist commentary versions index
- All text fields are now shown in their non-rendered form
-- This allows changes to be highlighted with the diff builder
-- The different fields were labeled and separated for easier discernment
-- Fields are only shown if they have text in either the current or previous versions
- Various changes are also verbalized for easier discovery
- The date and the user columns were combined
-- This is more in line with other indexes, plus it saves on space
- The revert listing was changed to use a thumbnail instead of post ID links
-- This makes it more in line with the post versions index
2020-02-08 22:57:28 +00:00
BrokenEagle
154849a501 Added/modified common stylesheets
- Added a generalized diff-body class
- Added a generalized versions stylesheet
2020-02-08 22:57:27 +00:00
evazion
9322c596e2 Fix #4279: Very long tags break forum post format.
* Enable word breaks for all DText-formatted text. Ensures extremely
  long strings in comments get broken.

* Fix the author column on comments/forum posts to use a fixed 12em
  width (except on the mobile layout). Using flex-basis was wrong because
  it allowed the author column to shrink if the other column was too wide.
2020-02-05 16:49:04 -06:00
evazion
aeec46b212 views: move inline javascript to app bundle. 2020-01-26 19:16:38 -06:00
evazion
2265721cb2 forum: move inline css to stylesheet. 2020-01-26 19:16:38 -06:00
BrokenEagle
d9e5b94838 Added search for posts with the embedded flag enabled 2020-01-23 03:30:38 +00:00
evazion
9d71c77524 autocomplete: fix favgroup:<name> returning favgroups for other users.
* Fix favgroup:<name> autocompletion to only return favgroups for the
  current user.
* Add favgroup autocomplete to the /favorite_groups search form.
2020-01-22 11:21:16 -06:00
evazion
0a3d038df9 autocomplete: fix broken wiki page autocomplete.
Fix breakage from 34368272e.
2020-01-21 18:44:02 -06:00
BrokenEagle
5f746c1a34 Made recommended changes to moderator reports (see #4267) 2020-01-21 01:38:08 +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
evazion
ab325c5d2b favgroups: convert post_ids from string to array. 2020-01-17 00:19:20 -06:00
evazion
09833e9b61 Merge pull request #4259 from BrokenEagle/upload-commentary-enhancements
Add upload commentary enhancements
2020-01-17 00:18:17 -06:00
evazion
1ce628c31f favgroups: fix add to favgroup not working.
Fix the Add to Favgroup button not working when the user only has 1
favgroup.
2020-01-15 13:17:04 -06:00
BrokenEagle
82b621d87d Added upload commentary enhancements
- Can now translate commentary from the upload page
- Can now add commentary tags with a checkbox
2020-01-14 23:59:27 +00:00
evazion
b3eeb170cb explore/posts/intro: remove page.
This was an alternate frontpage that contained a list of previews of the
most popular tags. This page was never linked from anywhere and it was
unknown by most users.
2020-01-12 23:01:04 -06:00
evazion
90b94adee8 /wiki_page_versions/diff: use SetDiff to diff other_names.
Use SetDiff instead of DiffBuilder to generate diffs for wiki page other
names. SetDiff is what we use for artist other names.
2020-01-12 16:31:23 -06:00
evazion
56faf701f3 Merge pull request #4254 from BrokenEagle/copyable-note-number
Move note number to the body so that it can be copied
2020-01-10 20:22:07 -06:00
evazion
afa4a2c985 js: fixup issues with @rails/ujs.
Fix a couple regressions caused by the migration from jquery-ujs to
@rails/ujs in 9f4ac4c96:

* Add authenticity tokens to all remote forms. By default, Rails doesn't
  doesn't include authenticity tokens in remote forms because it can cause
  problems with fragment caching. This was fine with jquery-ujs because it
  would insert the authenticity token when the remote form was
  submitted, but apparently @rails/ujs doesn't do this. This broke
  certain remote forms nested inside of jquery UI dialogs.

* Fix dialogs to trigger remote form submissions through @rails/ujs
  instead of through jquery. This fixes a problem where remote forms that
  returned a javascript response displayed the response as plaintext
  instead of executing the returned javascript.
2020-01-10 19:16:27 -06:00
evazion
3ca4f4f32c posts: convert post edit form to simple form. 2020-01-10 12:08:28 -06:00
evazion
9f4ac4c96a js: replace jquery-ujs with @rails/ujs. 2020-01-09 22:15:18 -06:00
BrokenEagle
4a873626c8 Moved note title to the body so that it can be copied
- Adjusted the title text for new notes
- Adjusted the starting dialog sizes to fit the new text
2020-01-09 22:14:01 +00:00
evazion
e119524f20 Merge pull request #4247 from BrokenEagle/pool-version-enhancements
Add pool version enhancements
2020-01-08 19:34:25 -06:00
evazion
0b31a6f491 Merge pull request #4249 from BrokenEagle/artist-wiki-links
Have artist wiki links go to artist page
2020-01-08 11:27:37 -06:00
evazion
11411ab778 Merge pull request #4251 from BrokenEagle/tag-script-storage
Change tag script storage
2020-01-08 11:21:08 -06:00