Commit Graph
100 Commits
Author SHA1 Message Date
evazion 19e91f438b bans: add test for logging in with expired ban. 2017-05-07 12:13:25 -05:00
evazion fd291c8b42 bans: fix exception when user with expired ban logs in.
`ban.destroy` fails because users have many `bans`, not a single `ban`.
Destroying the expired ban isn't necessary anyway.
2017-05-07 12:13:19 -05:00
evazion 1a058ebe9a delayed jobs: don't delete failed jobs. 2017-05-05 11:33:11 -05:00
evazion b17d564e9b /delayed_jobs: order by next-to-run first. 2017-05-05 11:33:11 -05:00
evazion 9c9bf28db4 /delayed_jobs: add run, cancel, retry, delete actions. 2017-05-05 11:33:10 -05:00
evazion 9404eeafa1 /delayed_jobs: reorganize columns; fix column sizes. 2017-05-05 11:33:10 -05:00
evazion cbb15b3e81 /delayed_jobs: add '#c-delayed-jobs #a-index' wrapper divs. 2017-05-05 11:33:10 -05:00
evazion 666381a582 time_ago_in_words_tagged: handle times set in the future. 2017-05-05 11:33:10 -05:00
evazion c1fa656bd2 posts: change flag borders from red to blue for non-approvers. 2017-05-04 17:40:17 -05:00
evazion 31a38ea39a flags: add flag cooldown test. 2017-05-04 17:37:59 -05:00
evazion 3b37bb6142 flags: add 3 day flagging cooldown period. 2017-05-04 16:51:49 -05:00
evazion 8638b7527b flags: don't set is_flagged twice.
PostFlag#update_post already sets is_flagged when the flag is created.
No need to set it again.
2017-05-04 16:51:49 -05:00
evazion 9f64857719 flags: move status locked check to post_flag.rb. 2017-05-04 16:51:49 -05:00
evazion 43ad3258e5 API: fix api limits being lowered when user doesn't have api key. 2017-05-04 12:57:20 -05:00
evazion 7b5ae5f8e0 Fix #3024: strip '?' from API attributes. 2017-05-04 12:19:51 -05:00
evazion 7ade3b6831 Fix #2352: return raw usernames in API instead of pretty names. 2017-05-03 22:16:38 -05:00
evazion db1fa60a43 Set pawoo sources to html page after upload. 2017-05-03 00:09:51 -05:00
evazion d6ca040198 /super_voters: remove in favor of /users?search[is_super_voter]=true search. 2017-05-02 23:15:19 -05:00
evazion 1dba314eda /users: add search options for approvers/super voters/contributors. 2017-05-02 23:15:19 -05:00
evazion 44b1a8dbf6 /users: convert search form to simple form. 2017-05-02 22:53:33 -05:00
evazion 002d54921e responsive layout: fix "More »" link from line-wrapping. 2017-05-02 22:30:56 -05:00
evazion 85f6590b1a responsive layout: fix <input> sizes and styling. 2017-05-02 22:30:56 -05:00
evazion 352a3e065f responsive layout: fix dropdown nav menu overlapping main content.
The culprit is `float: right;` but none of this other stuff is needed.
2017-05-02 22:30:56 -05:00
evazion 93c9b622a1 post_approval.rb: log correct post id when approving deleted posts. 2017-05-02 00:01:21 -05:00
evazion 1baffb31ff Link dA sources as http://$artist.deviantart.com/art/$title-$id in sidebar.
Previously we used 'http://$artist.deviantart.com/gallery/#/d$id'. This
relied on a javascript redirect on Deviantart's end, which didn't work
for people with javascript disabled.
2017-05-01 23:29:16 -05:00
evazion e10327219d /users/1234.json: include upload_limit/max_upload_limit/favorite_group_count. 2017-04-29 12:26:25 -05:00
evazion f7509433b1 /users.json: make private attributes visible to the user themselves (fix #1551). 2017-04-29 12:26:24 -05:00
evazion e31f8acc34 dmails: add title search test. 2017-04-29 11:50:26 -05:00
evazion 0652b907a9 dmails: inline search form on /dmails page. 2017-04-29 11:50:26 -05:00
evazion d1216f260e dmails: add search[title_matches] param. 2017-04-29 11:50:25 -05:00
evazion 27d6025425 dmails: convert search form to simple form. 2017-04-29 11:50:25 -05:00
evazion e8b9361226 notes: display error message when note saving fails. 2017-04-28 21:37:14 -05:00
evazion a3ecfdb79d notes: disallow blank note bodies. 2017-04-28 19:34:27 -05:00
evazion b48671f59f saved searches: drop unused name and category columns. 2017-04-28 17:22:25 -05:00
evazion 8e5491a536 saved searches: add query normalization tests. 2017-04-28 16:26:44 -05:00
evazion 0b63dd32d1 saved searches: don't change tag ordering within queries.
Normalize queries aside from the tag ordering when they're saved.
Normalize queries including ordering when they're sent to listbooru.

This way tag ordering within searches is kept in the /saved_searches listing.
2017-04-28 16:24:07 -05:00
evazion 3eef8a62cc Remove unused css. 2017-04-28 15:08:07 -05:00
evazion 7aae76d80a responsive layout: move sidebars beneath main content.
Incidentally fixes bug with notes being mispositioned on top of the
sidebar because the sidebar was declared as float: left.
2017-04-28 15:05:46 -05:00
evazion 25aaef5afe Add tests for noter:<any|none>, comm:<any|none> metatags. 2017-04-26 16:51:34 -05:00
evazion b0626a9124 Add commenter:<any|none> metatags. 2017-04-26 16:51:34 -05:00
evazion 69d9cf3927 Add noter:<any|none> metatags. 2017-04-26 16:51:34 -05:00
evazion ec895d6412 /artists: add URL/Creator/Active/Banned/Has Tag fields to search form. 2017-04-26 14:08:18 -05:00
evazion b61fdc2c6b /artists: convert search form to simple form. 2017-04-26 14:08:18 -05:00
evazion d1188d8184 /artists: add search params: has_tag, name/other_names/group_name/any_name/url_matches. 2017-04-26 14:08:18 -05:00
evazion 59a179fa15 /posts: add shift+F to unfavorite hotkey. 2017-04-25 01:50:14 -05:00
evazion 9a0bc6802b /post_appeals: add blank option to Resolved dropdown. 2017-04-24 22:45:02 -05:00
evazion 146dc116d6 /posts: remove tag subscriptions from navbar. 2017-04-24 21:44:40 -05:00
evazion 54db229094 comment_test.rb: add quote-stripping test. 2017-04-24 21:15:47 -05:00
evazion c586a66e1f dtext: recognize [QUOTE] tags when quoting comments, forum_posts.
Fixes a bug with capitalized [QUOTE] tags not being handled properly
when quoting comments or forum posts.
2017-04-24 21:15:47 -05:00
evazion 869f1610fc comments: use server-side quote-stripping instead of reimplementing in js. 2017-04-24 21:15:47 -05:00
evazion 18424531fa Merge mentions quote-stripping code into DText quote-stripping code. 2017-04-24 21:15:42 -05:00
evazion 8404064854 related_tag_calculator.rb: fix memcache lookup in inner loop.
Remove the category constraint option from RelatedTagCalculator.calculate_from_posts.
It slows things down and isn't used.

This method is used to calculate the related tags sidebar during
searches for single metatags. Using Tag.category_for in the inner loop
caused a memcache call on every iteration. At 100 posts per page and
20-30 tags per post, this led to up to 2000-3000 total memcache calls,
which significantly slowed pageloads.
2017-04-23 17:10:20 -05:00
evazion 30872ebb41 Fix #2990: Wiki Autocomplete Misses On Certain Meta-wikis
/wiki_pages?search[order]=post_count didn't include wiki pages that
didn't belong to a tag. This was due to doing an inner join on the tags
table instead of a left outer join.
2017-04-23 16:55:15 -05:00
evazion 808fe0411a /notes, /note_versions: fix N+1 queries on note creators, updaters. 2017-04-23 14:59:36 -05:00
evazion 989917cb07 /notes, /note_versions: use numbered paginator. 2017-04-23 14:59:36 -05:00
evazion e6d1842545 /notes: default to listing notes, not posts. Remove group_by=post.
The posts listing is replaced by a link to order:note.
2017-04-23 14:59:36 -05:00
evazion 4631262374 Fix broken tag autocomplete on multiple pages.
Mark all tag <input>s with a `data-autocomplete` attribute, instead of
hardcoding a list of html IDs to autocomplete in javascript.

This way should be less error prone. It fixes autocomplete in several places:

* Autocomplete for the search box on /posts didn't work in the
  responsive layout. This was because /posts has two search boxes that
  both have the id `tags`: one in the normal sidebar, and one in the
  responsive tag list. $("#tags") only initialized autocomplete on the
  first one.

* Autocomplete didn't work on the aliases or implications pages. This
  was due to selecting the wrong html ids.
2017-04-22 15:24:03 -05:00
evazion f403763d8b /tag_implications: convert to simple form. 2017-04-22 15:23:14 -05:00
evazion 738c14a8a3 /tag_aliases: convert to simple form. 2017-04-22 15:23:14 -05:00
evazion 2db3af56dd /tags: convert search form to simple form. 2017-04-22 15:23:14 -05:00
evazion 0ed0fb095b /notes/search: convert to simple form. 2017-04-22 13:04:04 -05:00
evazion d8fb4399cf /artist_commentaries/search: convert to simple form. 2017-04-22 13:04:04 -05:00
evazion 0b2493b2dd tag subscriptions: fix broken saved search migrations. 2017-04-21 22:48:52 -05:00
evazion f1552539f7 notes: allow <ruby> tags for marking up furigana. 2017-04-21 14:31:05 -05:00
evazion 5f9c423542 upload.rb: detect mp4s with an ftyp of avc1. 2017-04-20 23:08:34 -05:00
evazion fce8dcc97d /users: fix self-xss in favorite tags. 2017-04-20 20:33:56 -05:00
evazion 5303d1052f /posts: fix saved search dropdown for post show page. 2017-04-20 19:05:54 -05:00
evazion 94e548cfe1 /bans: add test for searching bans. 2017-04-19 17:56:26 -05:00
evazion f6fff16e75 /bans: avoid N+1 queries for user, banner.
Avoids an N+1 issue when rendering users with link_to_user.
2017-04-19 17:56:26 -05:00
evazion 9bf1c89357 /bans: add search form. 2017-04-19 17:56:25 -05:00
evazion 06f2ed685e /bans: add reason_matches, expired, order search params. 2017-04-19 17:56:25 -05:00
evazion 84c075e4bf /bans: add "»" links for narrowing search by user. 2017-04-19 17:56:25 -05:00
evazion 198b6db507 /bans: replace Expires column with Duration. 2017-04-19 17:56:25 -05:00
evazion 1bc4eda12b /bans: add Banner, Banned at columns. 2017-04-19 17:56:25 -05:00
evazion 715dcc491b /bans: size columns to avoid unnecessary wrapping.
Sizes columns such that they automatically shrink to fit. This fixes
problems with usernames and dates wrapping in the middle.
2017-04-19 17:56:25 -05:00
evazion 40fe0f595f /bans: color code expired/unexpired bans. 2017-04-19 17:56:24 -05:00
evazion 9816676bfd structure.sql: remove bank_balances, bank_transactions. 2017-04-19 17:08:28 -05:00
evazion fb0a8e8600 db: add reason index on post_flags, post_appeals. 2017-04-16 21:15:23 -05:00
evazion cf9b67efb7 db/structure.sql: add index_pools_on_name_trgm migration. 2017-04-16 21:15:23 -05:00
evazion 54b4a2e0c5 /post_{flags,appeals}: default to fulltext search for reason field. 2017-04-16 21:15:23 -05:00
evazion c0e5c400a7 tests: fix tests for Rails.cache. 2017-04-16 16:48:36 -05:00
evazion 192190a313 initializers/z_dalli.rb: initialize Rails.cache. 2017-04-16 16:48:36 -05:00
evazion 904abc2787 cache.rb: implement Cache in terms of Rails.cache. 2017-04-16 16:48:35 -05:00
evazion 941bcff743 cache.rb: remove unused incr, decr methods. 2017-04-16 16:48:35 -05:00
evazion 87b295b632 Fix exception on /post_flags/new, /post_appeals/new. 2017-04-15 23:15:17 -05:00
evazion b68cb174f5 tests: fix pixiv tests to use https://i.pixiv.net. 2017-04-15 23:14:41 -05:00
evazion 9b53d32b4c post_archive_test.rb: exercise pool metatag not saving bug (#2972). 2017-04-14 13:49:54 -05:00
evazion 18a2b2a221 dtext_field: use the field name as the label, not "Body".
For flags and appeals, the reason field should be labeled Reason, not Body.
2017-04-13 15:17:55 -05:00
evazion c90614272a /posts/:id - add dtext preview to flag/appeal dialogs. 2017-04-13 15:17:55 -05:00
evazion 1b572c592c wikis: disallow renaming unless tag is empty (fix #2964). 2017-04-10 16:40:42 -05:00
evazion 8d45bb6d52 /post_{flags,appeals}: allow searching by tags. 2017-04-07 19:37:26 -05:00
evazion f5e22ea235 /post_{flags,appeals}: convert search forms to simple form. 2017-04-07 19:37:26 -05:00
evazion 652e251040 /post_{flags,appeals}: add uploader, approver, flag/appeal count columns.
Also include '»' links next to uploader/approver names for drilling down
the search by a given user.
2017-04-07 19:37:26 -05:00
evazion 3ae8cc5586 post_flags.rb: add 'rejected' and 'deleted' categories.
Includes a category field in /post_flags.json.

Adds 'rejected' and 'deleted' search categories. Categories:

* unapproved - deleted after going unapproved in first three days
* rejected   - deleted after being manually flagged
* deleted    - either of the above
* banned     - artist requested removal
* normal     - none of the above (a "normal" manual flag)
2017-04-07 19:37:26 -05:00
evazion b9693827c3 /wiki_pages: sort autocomplete by post count.
* Add search[order]=post_count param to /wiki_pages.
* 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 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 fbba167f0c artist.rb: fix ambiguous column references.
Using `search[empty_only]=true` caused certain queries to throw an
exception due to ambiguous column references after joining on the tags
table.

Example:

    https://danbooru.donmai.us/artists?search[empty_only]=true&search[name]=hammer*

    PG::AmbiguousColumn exception raised
    ERROR: column reference "name" is ambiguous LINE 1: ...ags"."name" = "artists"."name" WHERE (true) AND ((name LIKE ... ^
    lib/danbooru/paginator/active_record_extension.rb:108:in `total_count'
    lib/danbooru/paginator/active_record_extension.rb:63:in `block in paginate_numbered'
    lib/danbooru/paginator/active_record_extension.rb:60:in `tap'
    lib/danbooru/paginator/active_record_extension.rb:60:in `paginate_numbered'
    lib/danbooru/paginator/active_record_extension.rb:15:in `paginate'
    app/controllers/artists_controller.rb:41:in `index'
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 1a63fd6ac7 /artists: filter deleted artists from autocomplete. 2017-04-07 18:25:30 -05:00
evazion 7f2859eb00 /pools: don't filter inactive pools from autocomplete.
The inactive flag marks series pools that are finished (no more posts
will be added), not pools that are deleted. Finished series should still
be autocompleted.
2017-04-07 18:25:30 -05:00