Commit Graph

94 Commits

Author SHA1 Message Date
evazion
63f675b7d6 config: remove enable_post_search_counts option.
Enable by default if reportbooru is configured, otherwise disable.
2020-06-02 14:41:06 -05:00
evazion
ea400296d4 Fix #4455: Two tag search gives option to create wiki page when one is a metatag. 2020-05-12 17:52:41 -05:00
evazion
a2814364ee presenters: merge PostSetPresenter into PostSet.
Reduce indirection. PostSet is basically a collection of helper methods
for rendering the post index page. PostSetPresenter was a set of helper
methods for rendering the tag list on the post index page. These don't
need to be separated.
2020-05-10 19:28:45 -05:00
evazion
67aab0236d search: apply aliases after parsing searches.
Make PostQueryBuilder apply aliases earlier, immediately after parsing
the search.

On the post index page there are multiple places where we need to apply
aliases:

* When running the search with PostQueryBuilder#build.
* When calculating the search count with PostQueryBuilder#fast_count.
* When calculating the related tags for the sidebar.
* When tracking missed searches and popular searches for Reportbooru.
* When looking up wiki excerpts.

Applying aliases after parsing ensures we only have to apply aliases
once for all of these things.

We also normalize the order of tags in searches and strip repeated tags.
This is so that we have consistent cache keys for fast_count.

* Fixes searches for aliased tags being counted as missed searches (fixes #4433).
* Fixes wiki excerpts not showing up when searching for aliased tags.
2020-05-07 13:53:35 -05:00
evazion
b1c494aa34 posts/index: fix bad call to post_search_count_js. 2020-04-28 01:04:17 -05:00
evazion
abda687345 posts/index: fix search count tracking.
* Eliminate "&ms=1" url param.
* Only track simple single-tag searches (not multi-tag searches,
  metatags, negated tags, etc).
2020-04-27 19:12:16 -05:00
evazion
35824c9e45 posts: remove AddThis widget.
AddThis apparently pulls in a script from z.moatads.com now. Fuck that.
2020-04-23 13:38:24 -05:00
evazion
dd0d9dff4a search: move misc search parsing helpers to PostQueryBuilder.
* Move various search parser helper methods (`has_metatag?`,
  `is_single_tag?` et al) from PostSets and the Tag model to
  PostQueryBuilder.

* Fix various minor bugs stemming from trying to check if a search query
  contains certain metatags using regexes or other adhoc techniques.
2020-04-23 01:51:30 -05:00
evazion
a5418abb31 pundit: convert posts to pundit. 2020-03-20 18:03:01 -05: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
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
052008ee5d addthis: update script, hide when not enabled.
* Hide 'Share' section from sidebar when Addthis isn't enabled.
* Don't show popup menu until click.
2020-01-06 20:29:18 -06:00
evazion
83538b8105 /posts: fix duplicate share box id. 2019-09-30 12:01:42 -05:00
evazion
5818c367fd css: add .mobile-only, .desktop-only classes. 2019-09-30 00:58:34 -05:00
evazion
960e5d4ae0 views: factor out sidebar layout template.
* Factor out common sidebar layout template.
* Convert wiki pages and posts to use this template.
* Add data-layout attribute to <body> element indicating the current layout.
2019-09-28 17:50:10 -05:00
evazion
d0d71fcdc8 posts/index: disable next page prefetching.
This causes the browser to prefetch the next page in a search, which may
make browsing seem faster to the end user, but it effectively doubles
the load on the server.
2019-08-12 18:17:04 -05:00
evazion
14da425564 search: reduce queries in single tag searches (#4120).
Avoid some queries used in wiki page excerpts:

* Only try to load the artist if the tag is an artist tag.
* Avoid using `exists?` queries for wiki pages.
* Bugfix: don't show wiki excerpts for deleted wikis.
2019-08-12 13:38:45 -05:00
Albert Yi
261cc8d993 remove index/show mixpanel events 2018-10-23 11:02:30 -07:00
Albert Yi
9ce419b692 fix user editing 2018-10-22 17:35:59 -07:00
Albert Yi
464596fbb4 disable some props 2018-10-22 17:28:04 -07:00
Albert Yi
f4cafebd0f fix escaping 2018-10-22 17:25:14 -07:00
Albert Yi
11e75aec2a add referer prop 2018-10-22 17:21:26 -07:00
Albert Yi
1b9e3d687d add events for posts pages 2018-10-22 17:19:32 -07:00
Albert Yi
08e3051d31 add mixpanel events for signup page 2018-10-22 17:05:05 -07:00
r888888888
0ab6e9f94d refactor share buttons 2018-10-20 19:11:16 -07:00
r888888888
192ac128cd add additional meta tags for seo 2018-10-20 17:15:29 -07:00
Albert Yi
3696fb10a0 add rating meta tag 2018-10-12 11:56:54 -07:00
evazion
99632d5e8a TagSetPresenter: refactor to pass options explicitly.
Refactor tag_list_html, split_tag_list_html, and inline_tag_list_html to
take the `show_extra_links` and `current_query` options explicitly,
rather than implicitly relying on CurrentUser or taking `params[:tags]`
from the template.
2018-09-30 21:52:24 -05:00
Albert Yi
05dfb5de60 disable prefetch 2018-09-27 16:49:52 -07:00
evazion
3f7b1e0b13 html: fix invalid </meta>, </link>, </input> closing tags. 2018-08-17 18:41:48 -05:00
Albert Yi
64446d49e1 add image cropping support 2018-06-22 14:41:57 -07:00
evazion
88f4a56890 Fix #3497: Invalid DText denial of service attack. 2018-01-14 16:14:18 -06:00
evazion
f9ffa2b47a Fix #3484: /posts: don't show wiki tab for metatags. 2017-12-31 12:25:17 -06:00
BrokenEagle
5cdd8d8f67 Standardize position of page title and secondary links
- Removed path specification for secondary links where unneeded
2017-12-28 10:20:27 -08:00
r888888888
c0ddf266fc move save search button to sidebar 2017-11-17 16:51:38 -08:00
r888888888
354247e3c7 disable common searches 2017-11-10 15:26:56 -08:00
BrokenEagle
1410a8dae3 Added searchbox link to responsive view 2017-10-11 17:45:55 -07:00
r888888888
d883de258c add rel meta links for prev and next page 2017-10-11 15:31:13 -07:00
r888888888
4905d035b7 tweak viewport 2017-10-10 18:14:44 -07:00
r888888888
b7f207180c eliminate responsive tag list 2017-04-26 12:26:51 -07:00
evazion
5303d1052f /posts: fix saved search dropdown for post show page. 2017-04-20 19:05:54 -05:00
r888888888
da06bee0ab revamp saved search implementation 2017-03-15 15:36:48 -07:00
r888888888
c3b78b1752 add user searches 2016-08-23 18:20:21 -07:00
r888888888
8551d37109 always show wiki tab for post listing 2016-02-16 16:47:31 -08:00
r888888888
1047d1fd2b add more meta descriptions to more pages 2016-02-09 14:25:23 -08:00
r888888888
e04a62b962 more crawler constraints 2016-02-05 14:17:26 -08:00
r888888888
1207a39b66 hide pages from crawler for degenerate queries 2016-02-04 14:10:44 -08:00
r888888888
fe4cb7f3ba track searches that return no results 2016-02-02 16:25:14 -08:00
r888888888
f87c71cf23 remove post view counts, add search counts 2015-07-27 17:27:40 -07:00
Toks
68d4300f9c Fix Q shortcut in chrome
fixes #2354
2015-07-16 15:19:46 -04:00