Commit Graph

157 Commits

Author SHA1 Message Date
evazion
130570aa33 comments.js: fix thresholded comments.
* Restore behavior of thresholded comments being greyed out (lost in 6fa0ae2cf).

* Set the `below-threshold` class for thresholded comments in the html instead of in javascript.

* Remove `include_below_threshold` param; it was always true when clicking "Show all comments".
2018-08-09 14:45:26 -05:00
evazion
8e8a39af43 comments.js: fix forms flickering on page load.
Mark the edit form, new comment form, and unvote links as hidden in
html, instead of showing them by default then hiding them later in
Javascript. This eliminates flickering on page load.
2018-08-09 14:44:20 -05:00
evazion
abe8b9c071 Fix "Show all comments" link.
The second argument to `trigger` is supposed to be an array.

ref: https://danbooru.donmai.us/forum_topics/9127?page=250#forum_post_149379
2018-08-08 23:44:35 -05:00
Albert Yi
6fa0ae2cf1 Migrate assets to use Webpacker 2018-07-27 15:24:05 -07:00
Albert Yi
7b74f5caf6 switch to using thumbs for voting 2018-07-06 11:02:14 -07:00
Albert Yi
cd88a8df9f fixes #3620 2018-04-12 13:00:48 -07:00
r888888888
abce4d2551 Raise error on unpermitted params.
Fail loudly if we forget to whitelist a param instead of silently
ignoring it.

misc models: convert to strong params.

artist commentaries: convert to strong params.

* Disallow changing or setting post_id to a nonexistent post.

artists: convert to strong params.

* Disallow setting `is_banned` in create/update actions. Changing it
  this way instead of with the ban/unban actions would leave the artist in
  a partially banned state.

bans: convert to strong params.

* Disallow changing the user_id after the ban has been created.

comments: convert to strong params.

favorite groups: convert to strong params.

news updates: convert to strong params.

post appeals: convert to strong params.

post flags: convert to strong params.

* Disallow users from setting the `is_deleted` / `is_resolved` flags.

ip bans: convert to strong params.

user feedbacks: convert to strong params.

* Disallow users from setting `disable_dmail_notification` when creating feedbacks.
* Disallow changing the user_id after the feedback has been created.

notes: convert to strong params.

wiki pages: convert to strong params.

* Also fix non-Builders being able to delete wiki pages.

saved searches: convert to strong params.

pools: convert to strong params.

* Disallow setting `post_count` or `is_deleted` in create/update actions.

janitor trials: convert to strong params.

post disapprovals: convert to strong params.

* Factor out quick-mod bar to shared partial.
* Fix quick-mod bar to use `Post#is_approvable?` to determine visibility
  of Approve button.

dmail filters: convert to strong params.

password resets: convert to strong params.

user name change requests: convert to strong params.

posts: convert to strong params.

users: convert to strong params.

* Disallow setting password_hash, last_logged_in_at, last_forum_read_at,
  has_mail, and dmail_filter_attributes[user_id].

* Remove initialize_default_image_size (dead code).

uploads: convert to strong params.

* Remove `initialize_status` because status already defaults to pending
  in the database.

tag aliases/implications: convert to strong params.

tags: convert to strong params.

forum posts: convert to strong params.

* Disallow changing the topic_id after creating the post.
* Disallow setting is_deleted (destroy/undelete actions should be used instead).
* Remove is_sticky / is_locked (nonexistent attributes).

forum topics: convert to strong params.

* merges https://github.com/evazion/danbooru/tree/wip-rails-5.1
* lock pg gem to 0.21 (1.0.0 is incompatible with rails 5.1.4)
* switch to factorybot and change all references

Co-authored-by: r888888888 <r888888888@gmail.com>
Co-authored-by: evazion <noizave@gmail.com>

add diffs
2018-04-06 18:09:57 -07:00
Albert Yi
6c790c61d3 replace uploader information post previews and comment listing, rename tagger to top tagger 2018-03-27 10:49:41 -07:00
evazion
41a4ff15cd posts: remove unused file path / url methods.
* Remove file_path_for, cropped_file_url (dead code)
* Remove complete_preview_file_url (preview_file_url now returns absolute links)
* Remove `file_name` (only used for Download link in sidebar)
2018-03-20 19:49:55 -05: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
BrokenEagle
f346d6e35d Fix deleted comments visibility on partial index by comment 2017-12-01 16:30:44 -08:00
r888888888
0985f929cc style buttons for upload/post edit pages 2017-09-14 16:56:40 -07:00
r888888888
3ffd871e8a fixes #3291 2017-09-14 11:23:51 -07:00
evazion
7cb7c2fbab Remove ruby DText implementation (#3206). 2017-07-19 16:48:42 -05:00
evazion
1c06ae9f81 atom feeds: fix deprecation warnings in *_path helpers.
DEPRECATION WARNING: You are calling a `*_path` helper with the
`only_path` option explicitly set to `false`. This option will stop
working on path helpers in Rails 5. Use the corresponding `*_url` helper
instead.
2017-07-01 11:45:28 -05:00
evazion
d40acc4e25 /comments: add IDs differentiating group_by=post/group_by=comment (fixes #3152). 2017-06-18 22:36:20 -05:00
evazion
87da9ec873 /comments: break out index_by_post/index_by_comment into partials. 2017-06-18 22:32:51 -05:00
evazion
5c9b5cd21e blacklists: add missing blacklist controls on several pages (fix #3121). 2017-06-07 23:30:35 -05:00
r888888888
1478eff561 fixes #3098 2017-05-30 12:36:07 -07:00
evazion
ea80d51ecf /posts/$id: add feed discovery link for comments on post. 2017-05-24 16:10:56 -05:00
evazion
e68946e95d /comments.atom: add atom feed for comments. 2017-05-13 10:37:58 -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
85d1f18ba5 comments: make commenter ip addresses visible to mods. 2017-03-19 23:41:25 -05:00
evazion
b80976bce7 modqueue: link tags, like they are in /comments. 2017-02-24 21:03:14 -06:00
evazion
ecf22adc7d /comments/search: add more search params; style as inline form. 2017-01-23 22:13:00 -06:00
Albert Yi
bdac591266 fixes #2838 2017-01-16 12:57:43 -08:00
Albert Yi
094f30a44e Merge pull request #2819 from evazion/opt-favorited-users
Reduce SQL queries on /posts/:id
2017-01-03 16:29:20 -08:00
evazion
4e8006ae3b Optimize rendering of post commenter names.
Eager load post comments' creators and updaters. Fixes an N+1 queries
problem when rendering commenter names at:

    views/comments/partials/show/_comment.html.erb:6
    views/comments/partials/show/_comment.html.erb:20

while rendering /posts/:id pages.
2017-01-03 20:14:05 +00:00
evazion
469f48a118 Fix @mention autocomplete for comments & forum posts.
Fix comment autocomplete (broken in 1257639). Also fix forum post
autocomplete (didn't work when editing forum posts).
2017-01-02 12:53:30 -06:00
evazion
1257639109 Add 'post as moderator' option for comments.
* Add 'post as moderator' option to comment form. This creates a so-called sticky comment.
* Downvotes have no effect on stickied comments; they're always visible, regardless of comment thresholds.
* Only mods may sticky comments.
* Mods may sticky comments by other users.
2016-12-26 23:52:45 -06:00
evazion
7c838f8525 Delete unused /comments/index_all route and unused _threshold.html.erb template. 2016-12-26 23:52:27 -06:00
Albert Yi
aef31d8d9b enable ragel parser for comments, add additional sql diagnostic queries 2016-12-09 14:59:33 -08:00
r888888888
6d6d00b190 expose voting to non-gold supervoters 2016-03-14 16:52:49 -07:00
r888888888
8a63fb0f7c enable mention for comments #2466 2015-11-30 16:51:07 -08:00
r888888888
6b96032a4e fixes #2486: Blacklist indication/display across the site 2015-08-18 15:47:31 -07:00
r888888888
9fb68cee94 fixes #2451: /comments/search has two elements with id "group_by" 2015-07-24 13:53:48 -07:00
Toks
52c73efc28 Fix thumbnail appearing next to deleted comments 2015-07-23 09:57:13 -04:00
Toks
a4440514ff Allow undeleting comments 2015-07-11 13:26:55 -04:00
Toks
4f4fd8cb35 fixes #2428 2015-07-04 22:00:31 -04:00
evazion
b56d7bdfa8 Disable comment submit button to prevent double posting. 2014-10-07 13:52:28 -05:00
Toks
772003a55a fixes #2217 2014-07-06 12:03:48 -04:00
Toks
5f12a5e555 fixes #2165 2014-05-25 14:50:07 -04:00
r888888888
fad0ab7c93 fixes #2133 2014-04-16 17:43:34 -07:00
Toks
413ac0a491 Fix various bugs when clicking "Show all comments" 2014-03-21 16:25:58 -04:00
Toks
f1a4d816e7 fixes #2109 2014-03-13 14:04:26 -04:00
Toks
11984fe8ed #1902: Add forum/comment creator data 2013-08-07 20:15:35 -04:00
Toks
f3167f1f62 Allow #image-container to share data attributes with previews
Related to #1902
2013-08-07 20:07:47 -04:00
Toks
87478f3658 fixes #1913 2013-08-02 10:42:11 -04:00
r888888888
22bd07072a #1849: filter images for safebooru 2013-07-18 17:27:00 -07:00
Toks
ebcc465216 Refactor post preview attributes into one method 2013-07-11 16:52:42 -04:00