Commit Graph

78 Commits

Author SHA1 Message Date
3bd97eb477 add banner and avatar for artist pages 2025-01-23 16:24:39 -06:00
Donovan Daniels
8a3e70e5ca
[AvoidPosting] Integrate the avoid posting list into the site (#582) 2024-08-03 14:15:26 -07:00
Donovan Daniels
41658607c5 [Artists] Normalize name in show & show_or_new (#636) 2024-08-03 02:25:41 -07:00
Cinder
28cb8ff19b
[Artists] Fix the edit permission quirks 2024-07-29 16:12:09 -07:00
Donovan Daniels
0346f86ac7
[Artists] Convert is_active into proper deletion (#660) 2024-07-20 11:45:36 -07:00
Earlopain
e3fdc5d61b
[Pools] Fix discrepancy between index page count and actual page count
One was using `user.per_page`, the other config.posts_per_page. Consolidate this
logic to `paginate_posts` to make it more obvious what's going on.
2024-04-04 22:52:49 +02:00
Earlopain
fc7d84affd
[RuboCop] Enable Style/FrozenStringLiteralComment
This reduces allocations on the posts page by about 5%, from basic testing
2024-02-25 18:15:55 +01:00
Earlopain
858c5d757f
[Artists] Fix bogus edit check 2023-06-12 21:50:17 +02:00
Donovan Daniels
42b9195ff7
[Artists] Respond with json for name lookup & deletion (#520)
* [Artists] Respond with json for name lookup & deletion

* Update app/controllers/artists_controller.rb

Co-authored-by: Earlopain <earlopain+github@protonmail.com>

---------

Co-authored-by: Earlopain <earlopain+github@protonmail.com>
2023-05-16 18:54:23 +02:00
Earlopain
33dba98cf5
[Cleanup] Simplify/Remove some post set code 2022-09-30 14:23:54 +02:00
Earlopain
332433882c
[Artists] Fix exception on show_or_new without name 2022-07-11 20:49:48 +02:00
Earlopain
0c213a260b
[Artists] Add /artists/name to show 2022-02-19 19:06:22 +01:00
Earlopain
e3728546c7
[Cleanup] Remove artist banning 2022-02-19 16:54:26 +01:00
Earlopain
2d94167fab
[Cleanup] Remove Artist.new_with_defaults 2022-02-19 16:04:33 +01:00
Kira
14b3224dd8 [Artists] Prevent editing locked/inactive artists 2021-03-04 16:18:50 -08:00
Kira
814db91046 [Artists] Allow locking artist pages 2021-01-17 11:33:21 -08:00
Kira
94db0a54c2 Allow displaying and editing linked user info for artists 2020-03-10 12:48:06 -07:00
Kira
c072f8090d Remove comment remote: true actions 2020-02-21 21:40:37 -08:00
Kira
d1750f938a Remove xml render special casing 2020-01-02 10:16:54 -08:00
Kira
cc71812fda Remove xml respond_to 2020-01-02 10:16:54 -08:00
Kira
4024108f1c Convert builder -> janitor for user rank 2019-06-29 12:58:28 -07:00
evazion
2170961f47 artists: improve prefilling of new artist form (#4028)
* When creating an artist by clicking the '?' next to the artist tag in
  the tag list, prefill the new artist form by finding the artist's last
  upload and fetching its source data.

  Previously we filled the urls with the source of the artist's last
  upload, which was wrong because it was usually a direct image URL (#3078).

* Fix the other names field not escaping spaces within names to underscores.

* Fix the other names field being potentially prefilled with duplicate names.
2018-12-27 15:03:11 -06:00
evazion
41ff05c121 artists: convert other_names to array (#3987). 2018-11-15 14:31:16 -06:00
evazion
10ca4dd3ad artists: replace artist finder with fetch source data.
* On posts, automatically trigger "Fetch source data" when clicking the
  Edit tab, instead of triggering the artist finder button. This way we
  find both the artist and the translated tags in one ajax call.

* Remove the "Artist" finder button next to the source field. This isn't
  necessary given that "Fetch source data" finds the artist itself.

* Remove the /artists/finder.json API endpoint. This is no longer used
  after removing the "Artist" finder button.
2018-09-11 20:09:25 -05:00
Albert Yi
c75f520055 fixes #3730 2018-06-05 14:48:09 -07:00
Albert Yi
c1725f6dc0 eliminate artist undelete action on controller 2018-06-05 13:16:28 -07:00
Albert Yi
da34c95da5 add expiry parameter 2018-05-22 14:57:46 -07:00
Albert Yi
72d72fd3d0 eliminate usage of localstorage to cache tag autocomplete results (fixes #3543) 2018-05-17 09:54:37 -07:00
r888888888
abce4d2551 Raise error on unpermitted params.
Fail loudly if we forget to whitelist a param instead of silently
ignoring it.

misc models: convert to strong params.

artist commentaries: convert to strong params.

* Disallow changing or setting post_id to a nonexistent post.

artists: convert to strong params.

* Disallow setting `is_banned` in create/update actions. Changing it
  this way instead of with the ban/unban actions would leave the artist in
  a partially banned state.

bans: convert to strong params.

* Disallow changing the user_id after the ban has been created.

comments: convert to strong params.

favorite groups: convert to strong params.

news updates: convert to strong params.

post appeals: convert to strong params.

post flags: convert to strong params.

* Disallow users from setting the `is_deleted` / `is_resolved` flags.

ip bans: convert to strong params.

user feedbacks: convert to strong params.

* Disallow users from setting `disable_dmail_notification` when creating feedbacks.
* Disallow changing the user_id after the feedback has been created.

notes: convert to strong params.

wiki pages: convert to strong params.

* Also fix non-Builders being able to delete wiki pages.

saved searches: convert to strong params.

pools: convert to strong params.

* Disallow setting `post_count` or `is_deleted` in create/update actions.

janitor trials: convert to strong params.

post disapprovals: convert to strong params.

* Factor out quick-mod bar to shared partial.
* Fix quick-mod bar to use `Post#is_approvable?` to determine visibility
  of Approve button.

dmail filters: convert to strong params.

password resets: convert to strong params.

user name change requests: convert to strong params.

posts: convert to strong params.

users: convert to strong params.

* Disallow setting password_hash, last_logged_in_at, last_forum_read_at,
  has_mail, and dmail_filter_attributes[user_id].

* Remove initialize_default_image_size (dead code).

uploads: convert to strong params.

* Remove `initialize_status` because status already defaults to pending
  in the database.

tag aliases/implications: convert to strong params.

tags: convert to strong params.

forum posts: convert to strong params.

* Disallow changing the topic_id after creating the post.
* Disallow setting is_deleted (destroy/undelete actions should be used instead).
* Remove is_sticky / is_locked (nonexistent attributes).

forum topics: convert to strong params.

* merges https://github.com/evazion/danbooru/tree/wip-rails-5.1
* lock pg gem to 0.21 (1.0.0 is incompatible with rails 5.1.4)
* switch to factorybot and change all references

Co-authored-by: r888888888 <r888888888@gmail.com>
Co-authored-by: evazion <noizave@gmail.com>

add diffs
2018-04-06 18:09:57 -07:00
evazion
58018aeb2b artists: move artist finding code from controller to model. 2017-11-14 23:27:47 -06:00
r888888888
d12f082f9a fixes #3300 2017-09-14 11:37:42 -07:00
evazion
10614d2152 artists: show success/error message when updating artists. 2017-07-29 01:44:05 -05:00
Albert Yi
1cc9abc2db Merge pull request #3204 from evazion/fix-3203
Fix #3203: Overly restrictive permissions
2017-07-07 18:59:13 -07:00
evazion
0c79d2f09e Removed unused controllers actions / routes (#3206). 2017-07-07 15:38:06 -05:00
evazion
cc54c16fac /artists/show_or_new: make public; add "artist doesn't exist" page.
* Fix access denied error when anonymous users open /artists/show_or_new.

* When the artist doesn't exist, take user to "artist doesn't exist"
  page instead of redirecting to /artists/new.
2017-07-06 18:37:13 -05:00
evazion
2c29a7ac19 /artists: only include domains in /artists/1234.json, not /artists.json. 2017-05-14 10:38:26 -05:00
r888888888
68f057e7ba refactor how artist notes are updated 2017-04-18 17:07:12 -07:00
evazion
6b462c865e /artists: sort autocomplete by post count.
* Add search[order]=post_count param to /artists.
* Make autocomplete do a prefix match ordered by post count, so that it
  works the same way that tag autocomplete does elsewhere.
2017-04-07 18:25:31 -05:00
evazion
674028588c /artists: avoid COUNT(*), avoid N+1 queries on artist urls.
* The /artists page issued a `SELECT count(*) FROM artists` because
  .paginate was missing search_count.

* /artists.json had an N+1 problem on artist urls. This slowed down
  autocomplete.
2017-04-07 18:25:30 -05:00
evazion
c46b31aa9c Prevent reverting to foreign versions (fixes #2711). 2016-10-11 06:57:46 +00:00
r888888888
fc7afd44ea refactor source pixiv test
refactor pixiv download tests
refactor upload test
refactor nico seiga test
refactor twitter tests
2016-09-28 11:25:29 -07:00
r888888888
b8f14b6fee hide more pages for banned artists #2132 2016-01-27 17:06:13 -08:00
Toks
f94d297149 #2404 fix artist finder 2015-06-12 12:07:50 -04:00
evazion
dcbe061809 Move normalize_for_artist_finder! into model.
Move the call to normalize_for_artist_finder! from the artist
controller into Artist#find_all_by_url. This makes testing easier.
It also makes it so that URLs are normalized when using the search
form on the artist listing page.
2014-10-05 14:11:32 -05:00
evazion
7f3b98969f Refactor normalize_for_artist_finder!
Refactors things such that Sources::Site has a normalize_for_artist_finder!
method that delegates to the strategy for the appropriate site. This way
any site that needs to normalize URLs for the artist finder can do so.
2014-10-05 14:11:31 -05:00
evazion
ec0f226f46 Make the artist finder work with new Pixiv URLs. 2014-10-04 12:45:37 -05:00
r888888888
0724f6ca06 fixes #1383 2014-03-07 16:42:20 -08:00
Toks
42b362d545 fixes #2081 2014-01-08 14:47:54 -05:00
Toks
3a9a6c6658 #1866: Normalize urls in artist finder 2013-12-25 12:43:54 -05:00
Toks
11871d88b6 fixes #1844
closes #1653
2013-10-26 00:08:37 -04:00