Commit Graph

664 Commits

Author SHA1 Message Date
BrokenEagle
ffc57b6cfa Use alternate iterators which have better performance 2020-03-07 08:13:14 +00:00
BrokenEagle
8c1f6020ba Adjust how blacklist classes get added
- Rename class for links as it was a misnomer
2020-03-07 08:13:14 +00:00
BrokenEagle
161e776cf7 Add utility regexp split function for non-whitespace words 2020-03-07 08:13:14 +00:00
BrokenEagle
d1aed303fd Fix blacklist code executing muliple times
- When enabling/disabling all, it was executing on every single blacklist line
- When starting out disabled, it was executing several times
2020-03-07 08:13:13 +00:00
BrokenEagle
d84150b232 Fix posts not being processed by blacklist after post updates
- Blacklisting individual posts was moved into its own function
- Fixed Javascript variables being leaked into the user environment
- Fixed post qTips being orphaned by replacements by destroying them first
- Moved edit form check into post success to avoid repeating post check
2020-03-07 08:13:08 +00:00
evazion
967d398c8e search: move query parsing code from tag model to post query builder. 2020-03-06 23:23:38 -06:00
evazion
a271ddcc29 views: reduce font size of Danbooru link in header. 2020-03-06 23:23:34 -06:00
evazion
9960290666 views: reduce font size of footer. 2020-03-06 19:56:53 -06:00
evazion
39ad0d2210 settings: rename "disable responsive mode" to "enable desktop mode"
Desktop mode is a better description. Most users don't know what responsive mode means.
2020-03-06 19:37:11 -06:00
evazion
32bad825e1 tags.scss: remove unused banned tag styling. 2020-03-06 15:14:25 -06:00
evazion
4c11e339bd artists: rename is_active flag to is_deleted.
Rename is_active to is_deleted. This is for better consistency with
other models, and to reduce confusion over what "active" means for
artists. Sometimes users think active is for whether the artist is
actively producing work.
2020-03-06 14:50:21 -06:00
BrokenEagle
20bad0ec53 Remove the standard line-height attribute from <br> elements
This is because it was messing with using line-height on the outer
element. In order to get around this, the line height had to be set
individually on every single <br> element used.
2020-03-04 08:21:12 +00:00
BrokenEagle
7a81fd03ef Make clicking the box hide the popup note box in responsive mode
- This is because the note body of one note box could hide another note box
- The only option to hide the note body previously was to double tap the image
2020-03-04 00:35:45 +00:00
BrokenEagle
a206c9d6ac Added a view large link to facilitate switching between image sizes
- The link is placed in the Options section
-- In the same place as the now defunct "Resize to image" link
-- This was so that it doesn't interfere with the image when in full size
2020-03-04 00:35:45 +00:00
BrokenEagle
e844a06e61 Convert notes to use percentages instead of exact coordinates
- This allows for the note boxes to be easily resized
-- Now resizing the note container resizes all of the note boxes
-- The z-index and position values had to be adjusted for this
--- So that the note/preview boxes were still visible
--- So that the image was selectable with right clicks
- All of the inner box styles have been moved to the outer box
-- Now the inner box is only a container for the note body
- The always resize image option has been removed from user settings
-- The value still exists on the model for future rename/reuse
- The max width is set at 100% for responsive mode to fit the screen
2020-03-04 00:35:42 +00: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
475d6ae7cf modqueue: move url from /moderator/post/queue to /modqueue. 2020-02-29 17:46:58 -06:00
evazion
b232470248 search: change behavior of disapproval:<reason> metatag.
* Change the `disapproval:<reason>` metatag to `disapproved:<reason>`.

* Change `disapproved:<reason>` to show all posts disapproved for a
  given reason, not just those disapproved by the current user.

* Allow searching for your own disapprovals with `disapproved:<my_name>`.

* Drop the `disapproved:<any|none>` metatags. `disapproved:any` is
  equivalent to `disapproved:<my_name>` and `disapproved:none` is
  equivalent to `-disapproved:<my_name>`.

These changes are so that you can search e.g. disapproved:poor_quality
to find all posts disapproved for poor quality.
2020-02-29 17:46:57 -06:00
evazion
cded0f763b approvers: remove "you haven't moderated in awhile" notice.
Remove the nag message when an approver hasn't approved anything
recently. Also remove the modqueue random posts page. As of 3d410398a,
inactive approvers are now warned via dmails.
2020-02-28 14:28:08 -06:00
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