Commit Graph
100 Commits
Author SHA1 Message Date
evazion 18affeb4e9 Add new upload limit system (fix #4234). 2020-01-27 00:47:35 -06:00
evazion 3d6084338c Raise statement timeout in development mode. 2020-01-27 00:47:35 -06:00
evazion 5925d3fa62 modqueue: fix typo in page_title. 2020-01-27 00:47:35 -06:00
evazion aa442121bb views: refactor open graph / twitter <meta> tags.
* Fix og:site to og:site_name.
* Fix open graph properties to use <meta property="...">, not <meta name="...">>
* Set og:type, og:site_name, twitter:site globally (not just on post pages).
* Set og:url.
* Remove unused always-resize-images, report-server <meta> tags from
  post show pages.
2020-01-27 00:47:24 -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
evazion c36c0b9e7a views: refactor atom feed links.
* Fix comment & forum feeds to include search params.
* Remove global post feeds (only include post feeds on post index).
2020-01-26 19:16:38 -06:00
evazion 815703a922 views: adjust more <meta> descriptions.
* Add <meta> descriptions to more pages.
* Adjust wiki/pool/forum pages to use an excerpt of the first paragraph.
2020-01-26 19:16:38 -06:00
evazion fbe39148cd users: remove opt_out_tracking account setting.
This setting doesn't do anything any more. It was only ever used to
disable tracking of some (but not all) data in Mixpanel, then later in
Matomo.
2020-01-26 19:16:38 -06:00
evazion e10bb0aab1 views: remove old matomo analytics code.
This is no longer used and shouldn't have been hardcoded anyway.
2020-01-26 19:16:38 -06:00
evazion 1a3ce17bf0 Merge pull request #4270 from BrokenEagle/universal-index-redirect
Add universal index redirect
2020-01-25 14:52:52 -06:00
evazion 688b0c5a2b Merge pull request #4271 from BrokenEagle/embedded-notes-search
Add search for embedded notes status
2020-01-25 13:40:52 -06:00
evazion fb9b2bb014 views: update seo title and description of post index page.
Change the title of the post index page to look like this:

    "Danbooru: Anime Image Board" (for the front page)
    "Kantai Collection Art | Danbooru" (for a tag search)

Change the meta description of the front page to look like this:

    Danbooru is the original anime image 'booru. Find over 3.75 million
    anime pictures categorized by over 100 million tags.

Change the meta description for a tag search to look like this:

    Find over 37,168 Azur Lane images on Danbooru. Azur Lane (碧蓝航线)
    (벽람항로) is a Chinese shipgirl-themed side-scrolling shoot 'em up
    mobile game developed by Shanghai Manjuu and Xiamen Yongshi...
2020-01-25 05:44:38 -06:00
evazion 9f40d31748 views: set twitter:title, og:title on all pages. 2020-01-25 05:10:12 -06:00
evazion 6a984de3d5 views: refactor page titles.
Refactor `page_title` helper to automatically include site name.
2020-01-25 01:52:18 -06:00
evazion 95e424ad80 views: remove unused artists/banned template. 2020-01-25 01:33:21 -06:00
evazion ec163f96a8 posts: remove unused appeal! method. 2020-01-24 23:51:37 -06:00
evazion a3e16c167f posts: remove unused undelete! method. 2020-01-24 04:08:56 -06:00
evazion fcb6f96979 forum: add /forum_topic_visits.{json,xml} endpoint.
For debugging purposes only.
2020-01-22 21:30:00 -06:00
evazion cc96f30e47 forum: fix topics being incorrectly marked as unread (again).
Second attempt at 71690cacc. Fix topics on page 2+ being still marked as
unread after the user has marked all topics as read.
2020-01-22 21:09:32 -06:00
evazion 22cb0ea322 models: replace raw LIKE queries with where_like. 2020-01-22 13:21:31 -06: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 edaf6323fd /favorite_groups: add search, creators, timestamps, edit/delete links. 2020-01-22 02:03:19 -06:00
evazion 1aadd19663 BURs: fix broken [bur:<id>] links in forum posts.
Fix bulk update requests generating invalid [bur:<id>] links in forum
posts. The id was missing because the BUR created the forum topic in a
before_create hook, which created the post before the BUR was saved so
the BUR didn't have an id yet. Fix regression caused by b4ce2d83.
2020-01-21 19:56:04 -06:00
evazion 0a3d038df9 autocomplete: fix broken wiki page autocomplete.
Fix breakage from 34368272e.
2020-01-21 18:44:02 -06:00
evazion 20b2c28126 posts/show: fix tag search in navbar not being bolded. 2020-01-21 17:30:57 -06:00
evazion 60bf21ff80 twitter: fix preview_urls when source url is a direct image.
Fix preview_urls returning an empty array when the source url is a
direct image from Twitter.

Also return preview_urls in /source.json.
2020-01-21 16:34:03 -06:00
evazion b60d988790 diff builder: fix bug in wiki page / pool diff generation.
Fixup for c2688e3af.
2020-01-21 15:02:02 -06:00
evazion 71690cacc1 forum: fix topics being incorrectly marked as unread.
This happened when the user marked all topics as read and so didn't have
any forum topic visits. The OR clause wasn't handled correctly for this
case.
2020-01-21 14:31:26 -06:00
evazion c7b30279b3 mod reports: temp hide ability to create reports.
Temp disable creating reports until we're ready to roll it out all the way.
2020-01-21 11:25:30 -06:00
evazion c1f2cd8d9d Update ruby gems. 2020-01-21 01:06:45 -06:00
evazion 8881edaf9f post replacements: fix dialog submit not working. 2020-01-21 00:54:07 -06:00
evazion f2f236c23a mod reports: remove use of belongs_to_creator macro.
Remove use of belongs_to_creator macro as per b4ce2d83a.
2020-01-21 00:25:29 -06:00
evazion b5603f0d39 forum: optimize unread forum topics on forum index.
Avoid doing one SQL query per topic when checking for new topics on the
forum index.

This also changes it so that forum topics aren't always marked as new
for anonymous users.
2020-01-21 00:12:03 -06:00
evazion 71cf1f65be forum: fix exception when viewing empty forum topics.
* https://danbooru.donmai.us/forum_topics?search[response_count]=0&search[is_deleted]=true
* https://danbooru.donmai.us/forum_topics/11313
2020-01-21 00:11:12 -06:00
evazion cca3f98765 forum: remove ability to merge forum topics.
* Rarely used (only used ~15 times in total, not used at all since 2015-2016).
* Merging topics didn't properly bump the new topic.
* Merging topics didn't log a modaction when the old topic was deleted.
* Merging topics broke the old topic. Moving all the posts from one topic
  to another leaves the old topic with zero posts. This normally can't
  happen and it causes exceptions when you try to view the empty topic.
* It was technically possible to merge a topic with itself. This would
  break the response_count.
* It was technically possible for a mod to merge a topic into an
  admin-only topic.
2020-01-21 00:10:21 -06:00
evazion 13528ac2d3 Drop forum subscriptions.
Few people used forum subscriptions (only around 100), and even fewer
people were subscribed to active threads. Most subscriptions were for
old threads that will never be bumped again. The implementation also had
a few problems:

* Unsubscribe links in emails didn't work (they unset the user's
  receive_email_notifications flag, but forum subscriptions didn't
  respect this flag).
* Some users had invalid email addresses, which caused notifications to
  bounce. There was no mechanism for preventing bounces.
* The implementation wasn't scalable. It involved a daily linear scan
  over _all_ forum subscriptions looking for any topics that had been updated.
2020-01-21 00:10:21 -06:00
evazion cae9a5d7e3 Drop dmail filters.
Few people used dmail filters (~900 users in 5 years) and even fewer
used them correctly. Most people used them to try to block dmail spam,
but usually they either blocked too much (by adding common words that
are present in nearly all dmails, causing all mails to them to be
filtered) or too little (blocking specific email addresses or urls,
which usually are never seen again after the spammer is banned).
Nowadays the spam detection system does a better job of filtering spam.
2020-01-21 00:10:20 -06:00
evazion c2688e3aff Fix #4263: Wiki page differences use the wrong order.
Standardize DiffBuilder to treat the first argument as the new item and
the second argument as the old item. This is the order used in most
other places.
2020-01-21 00:09:38 -06:00
evazion b62cdc4cfe test: move test/models/* to test/unit/*. 2020-01-21 00:09:38 -06:00
evazion 79015b4341 tests: fix various broken tests. 2020-01-21 00:09:38 -06:00
evazion cbbeac00df /saved_searches: fix duplicate input_html in label field. 2020-01-21 00:09:38 -06:00
evazion b4ce2d83a6 models: remove belongs_to_creator macro.
The belongs_to_creator macro was used to initialize the creator_id field
to the CurrentUser. This made tests complicated because it meant you had
to create and set the current user every time you wanted to create an
object, when lead to the current user being set over and over again. It
also meant you had to constantly be aware of what the CurrentUser was in
many different contexts, which was often confusing. Setting creators
explicitly simplifies everything greatly.
2020-01-21 00:09:38 -06:00
evazion 77bf9ac7f3 Merge pull request #4267 from BrokenEagle/add-report-function
Create the ability to send reports to moderators
2020-01-21 00:08:31 -06:00
evazion 1104f87b1f Merge pull request #4268 from BrokenEagle/universal-array-parameters
Add ability to search for multiple name values on the same field
2020-01-20 16:35:45 -06:00
evazion 4a7322b197 users: rework privacy mode into private favorites (fix #4257).
* Rename 'privacy mode' to 'private favorites'.
* Make the private favorites setting only hide favorites, not favgroups
  and not the user's uploads on their profile page.
* Make the favgroup is_public flag default to true instead of false and
  fix existing favgroups to be public if the user didn't have privacy mode
  enabled before.
* List _all_ public favgroups on the /favorite_groups index, not just
  favgroups belonging to the current user.
* Add a /users/<id>/favorite_groups endpoint.
2020-01-17 22:24:29 -06:00
evazion 2095dd3084 users: refactor bit_prefs search. 2020-01-17 22:13:12 -06:00
evazion b7350b8fe0 tests: fix various broken tests. 2020-01-17 19:21:20 -06:00
evazion 20f893161b favgroups: optimize favgroup:<name> search metatag.
The previous method resulted in a `WHERE posts.id IN (<list of ids>)`
clause, which turned into a huge list when the favgroup had a lot of
posts.
2020-01-17 13:38:51 -06:00
evazion e6ffdfdf81 favgroups: unify find by name methods.
Unify the `name_to_id`, `named`, and `find_by_name` methods into a
single `find_by_name_or_id` method that has consistent behavior in how
names are normalized.
2020-01-17 13:37:18 -06:00
evazion d461bb2ad0 post sets: refactor pool/favgroup methods.
Eliminate the `has_pool?` and `pool_name` methods in favor of the `pool`
method. Likewise for favgroups.
2020-01-17 02:16:13 -06:00
evazion d16756f186 post sets: remove unused methods. 2020-01-17 01:36:51 -06:00
evazion 9bce0b3743 post sets: eliminate PostSets::Base class. 2020-01-17 01:12:16 -06:00
evazion ed75db8d93 Merge pull request #4266 from BrokenEagle/fix-missing-blank-message
Remove posts not shown for blank message check
2020-01-17 01:08:32 -06:00
evazion 9ec30c85cf favgroups: prevent adding invalid posts to favgroups.
Prevent adding duplicate or nonexistent posts to favgroups. This was
possible by editing the post_ids field directly on the favgroup edit
page.
2020-01-17 00:19:23 -06:00
evazion ab325c5d2b favgroups: convert post_ids from string to array. 2020-01-17 00:19:20 -06:00
evazion eecd9a183d comments: add test for undeleting locked comments.
ref: #4258, #2728.
2020-01-17 00:18:29 -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 526998c4c2 Merge pull request #4256 from BrokenEagle/update-column-attributes
Update HTML table column attributes
2020-01-16 12:22:27 -06:00
evazion 8bc5ff635a Merge pull request #4258 from BrokenEagle/comment-updating-lock
Lock comments edited/deleted by moderators
2020-01-16 12:09:34 -06:00
evazion b03173d61e favgroups: fix favgroups with invalid post ids.
Fix favgroups containing post ids that don't exist. Most of these are from
typos or from old expunged posts that weren't properly removed from favgroups.
2020-01-15 23:32:51 -06:00
evazion e42881fbbf Fix #4262: Exception when using Twitter video image links. 2020-01-15 15:20:33 -06:00
evazion 617e1ca98a users/show: change favcount link to ordfav: search. 2020-01-15 13:22:30 -06:00
evazion 56817b9b09 /wiki_pages: add confirmation to delete option in subnav menu. 2020-01-15 13:20:40 -06:00
evazion 7d53af64c1 favgroups: add create new option to add to favgroup dialog.
Add option to create a new favgroup when the user opens the Add to
Favgroup dialog and they don't have any favgroups yet.
2020-01-15 13:18:25 -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
evazion 27bd94abec /dmails: fix column widths. 2020-01-14 23:56:55 -06:00
evazion 2ff7b30edc /dmails: fix incorrect To column. 2020-01-14 23:56:52 -06:00
evazion 5bde45f90d Update .gitignore. 2020-01-14 11:24:30 -06:00
evazion 0ff78e5f4a artist finder: fix false positives for pixiv fanbox urls. 2020-01-14 10:20:06 -06:00
evazion 79aff89573 maintenance: prune approvers monthly instead of weekly.
* Move approver pruning from a weekly task to a monthly task.
* Move weekly maintenance tasks from Wednesdays at 1:30am to Sundays at
  midnight (UTC).
2020-01-13 13:23:22 -06:00
evazion ec8c427ef3 reports/uploads: remove upload report page. 2020-01-13 12:58:20 -06:00
evazion 85676ddb74 upload limits: refactor deletion confidence calculation. 2020-01-13 12:53:44 -06:00
evazion 0b08f38b8b flags: remove uploader targeting restrictions.
Remove restrictions against flagging too many posts by the same
uploader. This had problems with preventing legitimate flags in some
cases, particularly with old legacy content. This will be policed
manually instead.
2020-01-13 12:39:16 -06:00
evazion 34c3df78d9 /sitemap.xml: exclude posts that aren't visible. 2020-01-12 23:01:37 -06:00
evazion 3a2c050c91 recommended posts: drop unused PostSets::Recommended class. 2020-01-12 23:01:31 -06: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 12a845de92 explore/posts/popular: refactor post previews. 2020-01-12 23:01:04 -06:00
evazion 74ce866890 explore/posts/viewed: refactor post previews. 2020-01-12 23:01:04 -06:00
evazion 083ce75c10 pools/gallery: refactor post previews. 2020-01-12 23:01:04 -06:00
evazion 76c4ba6f18 artists/show: refactor post previews. 2020-01-12 20:30:16 -06:00
evazion 8ddf7ee716 wiki pages: drop unused wiki page presenter. 2020-01-12 20:13:44 -06:00
evazion f2269d39a7 wiki_pages/show: fix <meta> description tag.
Use an excerpt of the first paragraph rather than the entire page.
2020-01-12 20:13:44 -06:00
evazion 50c6840be3 wiki_pages/show: refactor post previews.
* Increase number of previews from 4 to 8.
* Eliminate wiki page post set classes.
2020-01-12 20:13:44 -06:00
evazion 40711e1d4f posts/show: refactor parent/child notices.
* Convert notices from helpers to partials.
* Eliminate PostSets::PostRelationship class in favor of post_sets/posts template.
* Eliminate COUNT(*) queries when calculating the number of child posts.
* Eliminate redundant parent load and parent exists queries.
2020-01-12 18:38:38 -06:00
evazion ed5caba71c /wiki_page_versions: merge page and global listings. 2020-01-12 16:31:24 -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 95dd28fc52 /wiki_page_versions/diff: automatically fix comparison order.
Automatically fix it so that we always compare the newer version with
the wiki version, regardless of the order the pages are given in.
2020-01-12 15:28:07 -06:00
evazion 8dc69bef4b views: fix alias and implication list partial when tag is blank.
Fixup for abacc8ebb.
2020-01-12 13:54:29 -06:00
evazion 796efccbf4 Update ruby gems and yarn packages. 2020-01-12 13:13:03 -06:00
evazion 31e41b06ba pools: remove pool element destroy action.
This endpoint was for removing a single post from a pool. This wasn't
used anywhere within Danbooru.
2020-01-12 01:30:04 -06:00
evazion 1a9e4497da /pool_versions: fix is_deleted search option. 2020-01-12 01:23:35 -06:00
evazion 05da264d0d pools: remove pool list dropdown from add to pool dialog.
Autocomplete works better than trying to select the pool from a gigantic
dropdown.
2020-01-12 01:23:35 -06:00
evazion bebc4694dd pools: remove is_active flag.
Remove uses of the is_active flag. Keep column in database (for now).

The only purpose of this flag was to filter out pools from the pool list
in the Add to Pool dialog. This hasn't had much use since autocomplete
was added. Most pools didn't set the flag correctly anyway.
2020-01-12 01:23:35 -06:00
evazion 3fce17d8ae upload tags report: fix incorrect column name. 2020-01-12 00:42:23 -06:00
evazion 1e3c97e43b pools: remove recent pools from 'add to pool' dialog. 2020-01-11 20:11:35 -06:00
evazion abacc8ebb1 views: convert helpers to partials. 2020-01-11 20:01:14 -06:00
evazion 153a8339ab Inherit errors from StandardError instead of Exception. 2020-01-11 19:07:28 -06:00
evazion aff3d3b18f Fix various rubocop issues. 2020-01-11 19:01:40 -06:00
evazion bab656a873 config: remove more obsolete or unneeded config options.
Remove more config options that were either unused or that shouldn't
need to be configured by downstream users.
2020-01-11 01:31:29 -06:00