Commit Graph

2414 Commits

Author SHA1 Message Date
evazion
896f144eb6 views: refactor quick search forms. 2019-09-10 21:10:09 -05:00
evazion
372fd7df1b /pool_versions: fix exception in pool diffs.
https://danbooru.donmai.us/forum_topics/9127?page=280#forum_post_159633
2019-09-10 15:13:06 -05:00
evazion
e815f46d2a /meta_searches/tags: fix tag_alias_correction_path reference.
Tag alias corrections were removed in #4130. Fixes exception on /meta_searches/tags.
2019-09-10 14:59:27 -05:00
evazion
a1b48f5e3f views: migrate search forms to use simple form.
Migrate various forms to be built using simple form instead of raw html.
Also adds autocomplete="off" to these forms (#4162).
2019-09-10 14:33:18 -05:00
evazion
1743f3797f views: factor out search_form_for helper.
Refactor search forms to use `search_form_for` so that we can set common
options on all search forms, such as autocomplete="off" (#4162).
2019-09-10 14:31:19 -05:00
evazion
49d38d6256 views: fix positioning of form hints.
Position <span class="hint"> elements to the right of normal <input>
elements and underneath <textarea> elements. Fixes form hints being
badly positioned on some pages.
2019-09-10 14:30:49 -05:00
evazion
347aa4b835 Add error pages for tag limit and pagination errors. 2019-09-09 17:43:30 -05:00
evazion
62b89e1f9a user upgrades: make upgrade page visible to logged out users. 2019-09-09 17:42:46 -05:00
evazion
6595a9f87e users: raise max posts per page to 200. 2019-09-08 23:34:49 -05:00
evazion
8198c610cc /pool_versions: add '»' drilldown links.
Add '»' drilldown links for pool names, users, and post ids.
2019-09-08 23:28:02 -05:00
evazion
964a073ec3 Fix #4159: Add pool history to post show pages. 2019-09-08 23:28:02 -05:00
evazion
b202985eaa posts/show: make post history pages visible to all. 2019-09-08 23:28:02 -05:00
evazion
5729d92c8e posts/show: make 'download', 'find similar' links visible to all. 2019-09-08 23:28:02 -05:00
evazion
57a61ca586 posts/show: avoid extra queries when rendering pool list. 2019-09-07 22:30:04 -05:00
evazion
886ee16911 pools: allow searching pools by post tags.
Find all pools containing at least one post tagged 'translated':

    https://danbooru.donmai.us/pools?search[post_tags_match]=translated
2019-09-06 17:54:07 -05:00
evazion
fc3b822bdf artists: reduce queries in artist summaries.
Avoid a few queries when searching for single artist tags.
2019-09-05 00:00:15 -05:00
evazion
59d92b448e /artists: remove /artists/new from navbar for anon users.
Fixes the logs being flooded with 403 errors because of bots and logged
out users trying to access the new artist page.
2019-09-04 16:42:24 -05:00
evazion
d5a2ed65f8 saved searches: add 'created' and 'posts' columns to index page. 2019-09-02 22:27:25 -05:00
evazion
05d8a05106 saved searches: add 'last refreshed' column to index page. 2019-09-02 22:10:16 -05:00
evazion
4abffc7faa saved searches: paginate index page + add search form. 2019-09-02 22:10:03 -05:00
evazion
ffc693ef37 profiles: temp disable saved searches on profile pages. 2019-09-02 13:43:05 -05:00
evazion
95b8420ba2 Drop unused common_searches code. 2019-09-01 15:54:00 -05:00
evazion
dacb21b085 Drop unused users/_login_header template. 2019-09-01 15:54:00 -05:00
evazion
5b468444e7 Tweak signin / signup pages.
* Link to the signup page on the signin page.
* Clarify that emails are optional on the signup page.
2019-09-01 15:54:00 -05:00
evazion
fe4d90c5e0 settings page: add help text, rearrange settings.
* Remove 'Change password' and 'Delete account' tabs.
* Put 'Change password' under the Basic section.
* Put 'Deactivate account' under the Advanced section.
* Add help text to various settings.
2019-09-01 15:53:59 -05:00
evazion
f673552743 users: add /settings page.
Add /settings page and link to it instead of /users/:id/edit.
2019-09-01 15:00:27 -05:00
evazion
ff92b32f02 users: add /profile page (fix #4151).
* Add /profile, /profile.json endpoints.
* Make "My Account" link to /profile.
* Add 'User ID' field to profile page.
2019-09-01 15:00:23 -05:00
evazion
b77eebf136 /favorites: replace favorites view with ordfav: search.
Make /favorites redirect to a ordfav:<user> search instead of having a
separate view just for favorites. This duplicated a lot of code for no
good reason.
2019-08-31 19:58:38 -05:00
evazion
ee77b101af comments: change 'Show all comments' to 'Show N hidden comments'. 2019-08-31 16:32:15 -05:00
evazion
be36968b6d Fix #3351: Mod+: Treat deleted comments as below score threshold.
Comments have three states: visible, hidden, and invisible. Visible
comments are always shown. Hidden comments are not shown until the user
clicks 'Show all comments'. Invisible comments are never shown to the
user. Deleted comments are treated as hidden for moderators and
invisible for normal users. Thresholded comments are treated as hidden
for all users.
2019-08-31 16:24:44 -05:00
evazion
836ec02265 Fix #4147: Remove non-relevant bookmarklet info. 2019-08-30 22:19:20 -05:00
evazion
c3ad7f6112 Model#search: factor out username search. 2019-08-29 20:44:27 -05:00
evazion
a3d748e300 Fix #4145: Unable to view deleted comments from post page.
Bug: if all the comments on a post were deleted then the deleted
comments wouldn't be visible to moderators.

This was because we assumed that if `last_commented_at` was nil it meant
that the post had no comments, but this was wrong. `last_commented_at`
only counts undeleted comments. It's reset to nil if all the commnets
have been deleted.
2019-08-26 13:50:42 -05:00
evazion
e147a34664 pool orders: disable drag-and-drop ordering for pools with >100 posts.
Previously if a pool had >100 posts then the 'Order' link wouldn't
appear in the navbar, but it was still possible to visit the pool order
page directly. If a user did so, only the first 100 posts in the pool
would be shown in the drag-and-drop widget. If they tried to reorder the
pool anyway, then everything beyond the first 100 posts would be
silently removed from the pool.

Now we always show the 'Order' link, but we disable the drag-and-drop
reordering widget when the pool has >100 posts to prevent posts from
being silently removed.
2019-08-25 21:28:32 -05:00
evazion
edc0c9df32 Fix exception in /pools/:id/order/edit. 2019-08-25 21:06:16 -05:00
evazion
86fa502c71 login page: remove 'sign in securely' link.
This link is unnecessary since Danbooru is now HTTPS-only.
2019-08-25 20:32:25 -05:00
evazion
62875eabb2 /posts.atom: fix banned posts being visible to Members.
Bug: /posts.atom only hid loli/shota, not banned posts and not unsafe
posts when safe mode was on.
2019-08-25 20:29:32 -05:00
evazion
c7f8fbbec2 app controller: standardize access denied error handling.
Refactor to use `render_error_page` to handle User::PrivilegeError
exceptions. This way these exceptions are logged to New Relic.

Changes:

* Anonymous users aren't automatically redirected to the login page.
  Instead they're taken to the access denied page, which links to the
  login/signup pages.

* JSON/XML error responses return `message` instead of `reason`.
2019-08-24 23:10:22 -05:00
evazion
491cae6c60 app controller: standardize api limit error handling.
* Refactor api_check to use render_error_page so that api limit errors
  get logged to New Relic for analysis.

* Also standardize json error responses to return the error message in
  `message` instead of `reason`.
2019-08-24 22:55:36 -05:00
evazion
f151285038 views: standardize page titles. 2019-08-24 22:55:35 -05:00
evazion
bb82011bb2 helpers: drop fast_link_to. 2019-08-22 23:33:58 -05:00
evazion
4f5d80bb60 forum post votes: fix conflicting scope name.
Fixes a conflict with `Enumerable#excluding` in Rails 6.

    Rename Array#without and Enumerable#without to Array#excluding and
    Enumerable#excluding. Old method names are retained as aliases.
2019-08-22 21:28:56 -05:00
evazion
7cc31b97c9 pools/show: fix pagination to respect user's posts-per-page setting. 2019-08-21 14:31:58 -05:00
evazion
b283281e5e comments: minimize sql queries.
Certain parts of comment rendering triggered sql queries that we didn't
really need to do. Rework things to avoid this.

* Preload comment creators in order to display commenter names with link_to_user.

* Preload comment votes in order to display "undo vote" links. Only preload
  votes for members since anonymous users can't vote and don't have "undo
  vote" links.

* Rework various conditionals to do the filtering in Ruby so that we
  avoid issuing any extra queries in sql.

* Avoid issuing any queries at all when the post doesn't have any
  comments (when last_commented_at is blank).
2019-08-20 21:55:25 -05:00
evazion
2cf929ad6e comments: show "undo vote" link by default on voted comments (fix #4143). 2019-08-20 21:17:02 -05:00
evazion
6e708dec18 /artists/new: fix artist name input box sizing.
In production the name input is really big because the artist name
column in the production db is `text` rather than `character varying`,
and simpleform treats text columns as textbox inputs.
2019-08-19 19:49:31 -05:00
evazion
782d9f3d61 comment votes: fix error handling.
Return the comment itself and a standard error response on failure.
2019-08-19 17:22:36 -05:00
evazion
d4a243c8d1 footer: abbreviate git hash. 2019-08-19 00:46:31 -05:00
evazion
13f4dee59f footer: only show keyboard shortcuts link on desktop. 2019-08-19 00:46:31 -05:00
evazion
a586916cb3 /wiki_page_versions: various usability improvements.
Changes to the /wiki_page_versions global listing:

* Add "diff" links that show you what changed in the given edit.
* Add "?" links that take you to the current version of the wiki.
* Add "»" links next to wiki page titles that take you to the wiki's full edit history.
* Add "»" links next to usernames that take you to the user's full edit history.
* Add a "Status" column that shows whether the wiki page was created,
  deleted, undeleted, or renamed.
* Link to /wiki_page_versions in sidebar, not /wiki_pages?order=time.
2019-08-18 17:08:35 -05:00