Commit Graph

7456 Commits

Author SHA1 Message Date
evazion
bbabaffb07 /comment_votes: make visible to banned users.
Let banned users see their own comment votes.
2020-02-16 03:24:21 -06:00
evazion
a214989447 controllers: move /moderator/post/disapprovals to /post_disapprovals. 2020-02-15 07:10:45 -06:00
evazion
60ff2ae929 models: rename post/pool archives to post/pool versions. 2020-02-15 06:52:10 -06:00
evazion
51f3f7338a models: remove old post version and pool version models. 2020-02-15 06:21:00 -06:00
evazion
2564e885c8 controllers: refactor only param includes.
Add extra includes needed by the `only` param inside `respond_with`.
2020-02-15 06:17:22 -06:00
evazion
8649ff6dbe API: remove various associated fields included by default.
Remove various associated fields that were included by default on
certain endpoints. API users can use the only param to include the
full association if they need these fields.

* /artists.json: urls.
* /artist_urls.json: artist.
* /comments.json: creator_name and updater_name.
* /notes.json: creator_name.
* /pools.json: creator_name.
* /posts.json: uploader_name, children_ids, pixiv_ugoira_frame_data.
* /post_appeals.json: is_resolved.
* /post_versions.json: updater_name.
* /uploads.json: uploader_name.
2020-02-15 06:17:11 -06:00
evazion
c5bcfb962f parameter builder: remove binding.pry statement. 2020-02-14 17:35:02 -06:00
evazion
1e426a50f7 controllers: standardize request format checks. 2020-02-14 17:28:25 -06:00
BrokenEagle
e807326372 Use association on post flags instead of doing a new query
- Because associations can be preloaded in the controller
2020-02-12 23:58:55 +00:00
BrokenEagle
75f4af8991 Don't do unnecessary processing on posts when using the API 2020-02-12 23:58:54 +00:00
BrokenEagle
f7495f5e26 Removed unused controller code 2020-02-12 23:58:54 +00:00
BrokenEagle
63b3503bfc Add ability to use nested only parameter
- The only string works much the same as before with its comma separation
-- Nested includes are indicated with square brackets "[ ]"
-- The nested include is the value immediately preceding the square brackets
-- The only string is the comma separated string inside those brackets
- Default includes are split between format types when necessary
-- This prevents unnecessary includes from being added on page load
- Available includes are those items which are allowed to be accessible to the user
-- Some aren't because they are sensitive, such as the creator of a flag
-- Some aren't because the number of associated items is too large
- The amount of times the same model can be included to prevent recursions
-- One exception is the root model may include the same model once
--- e.g. the user model can include the inviter which is also the user model
-- Another exception is if the include is a has_many association
--- e.g. artist urls can include the artist, and then artist urls again
2020-02-12 23:58:53 +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
be66141074 artists/summary: show urls as bulleted list. 2020-02-10 17:11:38 -06:00
evazion
a6f11610bd artists/summary: remove list of top source domains.
Remove the list of most-used source domains from artist summaries. This
took up a lot of space and usually wasn't very useful. It was also slow.
We had to calculate this on every artist tag search so we could display
it in the Artist tab, even though usually the user didn't open the tab.
2020-02-10 17:11:38 -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
evazion
aaafd230e4 Merge pull request #4291 from BrokenEagle/rework-version-views
Rework version views
2020-02-10 16:46:42 -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
7b1efd1204 Rework artist versions index view
- Added a changes column explicitly listing all of the changes
-- This makes it more in line with the other version views now
- Does a symmetric difference on the array fields to detect changes
2020-02-08 22:57:29 +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
d8fd1c212e Revise display on note versions index
- Body now uses the diff builder to highlight changes
-- A generalized diff-body class was added instead of something specific
- The status changes are now verbalized instead of being shown with styles
- The position and sizes are now split up
-- Changes directly reference the previous version
- The date and user columns were combined
-- This is more in line with other indexes, plus it saves space
2020-02-08 22:57:27 +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
01e42b7063 Merge pull request #4277 from BrokenEagle/fix-pawoo-source
Fix Pawoo source
2020-02-08 16:56:10 -06:00
BrokenEagle
434e031faa Add additional helper methods 2020-02-08 22:49:07 +00:00
BrokenEagle
76dcccb7de Alter previous method on all versions models
This is to prevent redoing the same SQL query which wasn't being cached.
2020-02-08 16:14:51 +00:00
BrokenEagle
d2021256f0 Fix instances where a carriage return is replaced with another
- It was causing two <br> elements to be inserted
- Now the delete and insert paragraph marks are located next to each other
2020-02-08 07:01:39 +00:00
evazion
094b9e6d07 Fix #4287: Hide Dmail notice persistently shown even after closing 2020-02-05 20:47:55 -06:00
evazion
960ed8934b wiki_pages/new: fix exception in rendering html data attributes.
Fix exception when trying to get the category_name for the html data
attributes. The wiki title is nil here and Tag.category_for couldn't
handle a nil tag name.
2020-02-05 18:36:55 -06:00
evazion
69f653b0c4 forum_topics/show: fix N+1 query patterns. 2020-02-05 18:08:39 -06:00
evazion
db4c67ee86 Fix #4286: Mod dashboard: limit width of left column. 2020-02-05 16:59:54 -06: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
327bc46bd2 Fix #4283: Profile no longer viewable through API. 2020-02-05 15:39:53 -06:00
evazion
ccb87e13b1 Fix #4282: Related tag search no longer allows the JSON/XML formats. 2020-02-05 14:38:32 -06:00
evazion
2d0e0769cb /ip_addresses: add paginator to group_by=(user|ip_addr) pages. 2020-02-05 14:28:30 -06:00
evazion
089c304992 paginator: fix page counts for relations with group by clauses.
Fix an invalid SQL exception that occurs when the paginator tries to
do a COUNT(*) to calculate the page count of a relation that already
includes a GROUP BY + COUNT(*) clause. We need to nest the whole query
inside a `SELECT COUNT(*) FROM (...)` subquery so the inner COUNT(*)
doesn't mess up the outer COUNT(*).

Fixes #4285.
2020-02-05 14:27:48 -06:00
evazion
6b3c541a8a /ip_addresses: temp fix for exception when using group_by param.
Calling next_page here raises an exception when calculating the page
count because it can't handle SQL containing a GROUP BY clause. Swallow
the exception as a temp fix.
2020-02-04 03:59:10 -06:00
evazion
96b565f61d users: temp fix exception when is_banned is inconsistent.
Fix an exception when is_banned is true but the user doesn't have a ban
record.
2020-02-04 03:51:59 -06:00
evazion
fcfdd94fe9 controllers: temp fix exception in show actions.
Temp fix a regression caused by c7185724d.
2020-02-04 03:51:59 -06:00
evazion
6a729cf184 sessions/new: fix 'Missing partial static/_secondary_links' error. 2020-02-04 03:45:46 -06:00
evazion
6a3a04f6ec dmails: fix unread dmail notice when unread_dmail_count is inconsistent.
Fix an exception when the user's unread_dmail_count is nonzero but they
don't have any unread dmails. This normally shouldn't happen unless the
unread_dmail_count is inconsistent.
2020-02-04 03:45:27 -06:00
evazion
f87ec2509a modreports: fix reporting inaccessible dmails and forum posts.
* Fix it being possible to report dmails belonging to other users.
* Fix it being possible to report forum posts in mod-only threads.
2020-02-03 22:11:48 -06:00
evazion
a5ebbc04e8 dmails: fix shortlinks to include correct key. 2020-02-03 22:05:58 -06:00
evazion
0321b979d0 dmails: fix respond links being shown to non-owner on show page. 2020-02-03 22:05:58 -06:00
evazion
df2573359d mod reports: add show page redirect. 2020-02-03 22:05:58 -06:00
evazion
3c2a379d6f uploads: replace old upload limits with new upload limits. 2020-02-03 22:05:58 -06:00
evazion
24cb920608 mod reports: include reported user and message in forum post.
Also fix it so that reports against dmails include the key in the dmail
link so that mods can view the reported dmail.
2020-02-03 04:52:12 -06:00