Commit Graph

8392 Commits

Author SHA1 Message Date
evazion
c2a76840c9 tags: allow hovering over tag counts in sidebar to see exact counts. 2019-09-17 02:06:42 -05:00
evazion
3b831b8b50 css: fix member user color. 2019-09-17 01:56:30 -05:00
evazion
e3ae87cff7 Fix #4168: Ignore validations when rejecting tag changes.
* Only check for conflicts with existing aliases/implications when
  requests are created or approved, not when requests are rejected.

* Use `update!(status: "deleted")` instead of `update(status: "deleted")`
  so that if rejecting the request fails we fail immediately instead of
  continuing on and updating the forum topic.

* Wrap `reject!` and `TagChangeRequestPruner.reject_expired` in
  transactions so that if updating either the request or the forum
  fails, they both get rolled back.
2019-09-17 01:30:28 -05:00
evazion
6013b00fee Update gems. 2019-09-17 00:28:41 -05:00
evazion
7461372e07 css: standardize body text colors.
* Standardize on one shade of grey for all grey text.
* Use very dark grey instead of black for body text.
2019-09-17 00:28:41 -05:00
evazion
9c96557be8 css: standardize post notice css.
* Standardize post notice background colors.
* Replace .ui-state-highlight and .ui-corner-all classes with .post-notice.
* Rename post notice classes (e.g. .notice-parent -> .post-notice-parent).
* Remove hover effect from sequential search navbar.
2019-09-17 00:28:41 -05:00
evazion
e91e68c206 css: fix autocomplete colors. 2019-09-17 00:28:41 -05:00
evazion
4842728ed7 css: remove borders from around iqdb thumbnails. 2019-09-17 00:28:41 -05:00
evazion
c2bfd2ebe6 css: make forum post borders mobile-only.
* Remove box shadows around forum posts.
* Make borders around forum posts mobile only.
2019-09-17 00:28:41 -05:00
evazion
852c1cbb7c css: clean up file upload widget css.
* Standardize the upload widget background colors (light green for success,
  light red for error).
* Move the progress bar to the bottom of the upload widget.
* Change the progress bar color to blue.
* Hide the "drag and drop a file here" message after a file has
  already been uploaded.
2019-09-17 00:28:41 -05:00
evazion
e3406d1bc7 css: standardize success/error background colors.
Standardize background colors to light green or light red in several places:

* Modqueue positive/negative score backgrounds.
* Modqueue quality/sample warning backgrounds.
* User feedback positive/negative backgrounds.
* Ban expired/unexpired backgrounds.
* Flag resolved/unresolved backgrounds (removed; resolved flags no
  longer have a grey background because of inconsistencies in what
  resolved means).
2019-09-17 00:28:41 -05:00
evazion
31ebfa0a82 css: standardize styling of fineprint text.
Fineprint text was variously styled with `.info`, `.tn`, `.hint`, or
`.cost-footnote` css classes. Standardize on `.fineprint` instead. Use
`.hint` only for form hints and `.tn` only for <tn> tags in translation
notes.

Incidentally changes the font size of form hints to 0.8em (was 0.7em)
and the color of fineprint to #888 (was #AAA or #666).
2019-09-17 00:28:41 -05:00
evazion
c325bfa199 css: factor out colors from main css (#4158). 2019-09-17 00:28:41 -05:00
evazion
d203a543d0 css: remove 5px margin above page header.
The "Danbooru" link in the header had a 5px top margin, which created a
small gap above the page that caused mode menu backgrounds to show
through in an ugly way.
2019-09-17 00:28:41 -05:00
evazion
335fc2e872 css: fix blockquote margins in tables.
Don't remove the bottom margin from all <p> elements in tables. Instead
remove it only from the last element in dtext blocks. This way we don't
have to also kludge <blockquote> padding to work with zero-margin paragraphs.

Better fix for #1655.
2019-09-17 00:28:41 -05:00
evazion
73a4d675c0 css: ensure dtext is always wrapped in .prose container.
Ensure dtext is always wrapped in a `<div class="prose">` or
`<span class="prose">` (for inline dtext) container so that dtext css is
properly applied.
2019-09-17 00:28:41 -05:00
evazion
a5ef86bbe8 views: add html ids for main menu and subnav menu.
Also refactor secondary links to put the <menu> element in the default
layout instead of in each _secondary_links partial.
2019-09-17 00:28:41 -05:00
evazion
c85bbbf8c2 comments: fixup "show hidden comments" link.
Fixup for 896f144eb.
2019-09-17 00:28:40 -05:00
evazion
793c07341d Fix #4163: Remove reversion links outside of the proper context. 2019-09-12 22:37:32 -05:00
evazion
f8dd3eb72b Fix #4165: Add mechanism to test error responses.
https://danbooru.donmai.us/posts.json?error=500&message=testing
2019-09-12 22:37:32 -05:00
evazion
4915690c6d Fix #4166: Some metatags incorrectly showing tag results. 2019-09-12 22:37:32 -05:00
evazion
637e961f0a Fix #4167: Add more IDs to side menu elements. 2019-09-11 03:19:49 -05:00
evazion
a5043245b6 views: migrate related tags, mass edits to simple form. 2019-09-10 21:51:14 -05:00
evazion
896f144eb6 views: refactor quick search forms. 2019-09-10 21:10:09 -05:00
evazion
ffccc503f7 views: removed unused helpers. 2019-09-10 15:21:48 -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
93256c3ab2 Fix broken TagSubscription migration.
Disable old migration because TagSubscription model no longer exists
(should have been a fix script instead of a migration).
2019-09-09 17:03:28 -05:00
evazion
059e061b15 tests: fixup comment vote, post controller tests.
Use git clean to delete stale files from an earlier checkout. These
files interfered with various things (specifically, a comment vote test
failed because there was an old comment_votes/create.json.erb template
hanging around that changed the behavior of the POST /comment_votes endpoint).
2019-09-09 15:06:24 -05:00
evazion
d812a19902 tests: fixup tests. 2019-09-09 11:51:01 -05:00
evazion
efca48ee96 Set SameSite=Lax on session cookies.
https://web.dev/samesite-cookies-explained
2019-09-09 11:51:01 -05:00
evazion
312606bf98 Fix #4137: Share cookies across subdomains 2019-09-09 11:51:01 -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
763ac1a7e0 pools: stop maintaining pool category pseudotags in pool strings (#4160)
Stop maintaining pool category pseudo tags (pool:series, pool:collection)
in pool strings. They're no longer used and the changes to the
`Post#pools` method in dc4d2e54b caused issues with this.

Also allow Members to change the category of large pools again. This was
only restricted because maintaining these pseudotags forced us to update
every post in the pool whenever a pool's category was changed.
2019-09-08 23:28:02 -05:00
evazion
d0f060d8eb api: refactor api attribute declarations.
Replace the `method_attributes` and `hidden_attributes` methods with
`api_attributes`. `api_attributes` can be used as a class macro:

    # include only the given attributes.
    api_attributes :id, :created_at, :creator_name, ...

    # include all default attributes plus the `creator_name` method.
    api_attributes including: [:creator_name]

or as an instance method:

    def api_attributes
       [:id, :created_at, :creator_name, ...]
    end

By default, all attributes are included except for IP addresses and
tsvector columns.
2019-09-08 23:28:02 -05:00
evazion
19f2cc1e74 api: refactor only param. 2019-09-08 23:28:02 -05:00
evazion
24202d51f0 api: support the expires_in param on all GET requests.
`expires_in` is an alternative to `expiry` that supports durations other
than days:

* https://danbooru.donmai.us/posts.json?expires_in=30s
* https://danbooru.donmai.us/posts.json?expires_in=5min
* https://danbooru.donmai.us/posts.json?expires_in=1hour
* https://danbooru.donmai.us/posts.json?expires_in=1week
* https://danbooru.donmai.us/posts.json?expires_in=1month
2019-09-08 15:32:31 -05:00
evazion
22fd90eee9 api: support the expiry param on all GET requests. 2019-09-08 15:32:31 -05:00
evazion
3f7e05316d api: refactor default options for xml responses.
In xml responses, if the result is an empty array we want the response
to look like this:

   <posts type="array"/>

not like this (the default):

   <nil-classes type="array"/>

This refactors controllers so that this is done automatically instead of
having to manually call `@things.to_xml(root: "things")` everywhere. We
do this by overriding the behavior of `respond_with` in `ApplicationResponder`
to set the `root` option by default in xml responses.
2019-09-08 15:32:31 -05:00
evazion
32343303d2 forum posts: raise privilege error when viewing restricted topics.
Raise a privilege error when trying to view a restricted topic instead
of handling it in the controller. This way error handling is standardized.
2019-09-08 15:32:31 -05:00
evazion
31c7386b9e posts: fixup set_pool_category_pseudo_tags on new posts.
Calling set_pool_category_pseudo_tags before saving the post doesn't
work on new posts because they don't have an id yet, so trying to get
the pools by post id in `Post#pools` fails.
2019-09-08 15:32:31 -05:00