Commit Graph

57 Commits

Author SHA1 Message Date
evazion
2cf929ad6e comments: show "undo vote" link by default on voted comments (fix #4143). 2019-08-20 21:17:02 -05:00
evazion
59b277ead1 users: drop id_to_name, name_to_id caching.
Changes:

* Drop Users.id_to_name.
* Don't cache Users.name_to_id.
* Replace calls to name_to_id with find_by_name when possible.
* Don't autodefine creator_name in belongs_to_creator.
* Don't autodefine updater_name in belongs_to_updater.
* Instead manually define creator_name / updater_name only on models that need
  to return these fields in the api.

id_to_name was cached to reduce the impact of N+1 query patterns in
certain places, especially in api responses that return creator_name /
updater_name fields. But it still meant we were doing N calls to
memcache. Using `includes` to prefetch users avoids this N+1 pattern.

name_to_id had no need be cached, it was never used in any performance-
sensitive contexts.

Avoiding caching also avoids the need to keep these caches consistent.
2019-08-18 11:24:42 -05:00
evazion
98d80a0cca Fix #4116: "Couldn't find template for digesting" errors.
Specify full path to shared partial to work around bug in the template
digesting system in Rails.
2019-08-03 17:40:45 -05:00
evazion
80f43f9a7c Fix #4038: Attempting to create an IP-ban bans the creator.
* Rename comments.ip_addr to comments.creator_ip_addr.
* Fix belongs_to_creator to not clobber ip_addr field.
2019-01-09 16:20:34 -06:00
evazion
d213173d3d Fix #4002: Always include "updated by" line when creator != updater 2018-12-08 11:30:11 -06:00
evazion
9ac59aeadd comments.js: clean up comment quoting.
Replace Comment.quote with a remote new.js.erb call.
2018-09-29 20:42:38 -05:00
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
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
85d1f18ba5 comments: make commenter ip addresses visible to mods. 2017-03-19 23:41:25 -05:00
Albert Yi
bdac591266 fixes #2838 2017-01-16 12:57:43 -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
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
Albert Yi
aef31d8d9b enable ragel parser for comments, add additional sql diagnostic queries 2016-12-09 14:59:33 -08:00
r888888888
8a63fb0f7c enable mention for comments #2466 2015-11-30 16:51:07 -08: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
r888888888
fad0ab7c93 fixes #2133 2014-04-16 17:43:34 -07:00
Toks
11984fe8ed #1902: Add forum/comment creator data 2013-08-07 20:15:35 -04:00
Toks
938e19f384 merge branch changeable-votes 2013-06-29 15:12:38 -04:00
Toks
badc3122f0 fixes #1263 for comments 2013-06-29 14:50:22 -04:00
Toks
7719cc2104 don't show comment updated by if the edit occurred within 5 minutes 2013-06-24 11:17:43 -04:00
Toks
4765ce11b6 name consistency (#1424) 2013-06-14 12:32:25 -04:00
Toks
739da4c4b9 fixes #1424 for comments 2013-06-14 12:23:10 -04:00
Toks
1d56f237a8 error msg consistency 2013-05-06 10:06:25 -04:00
Toks
8b33cac661 replace old user links with new format 2013-04-04 23:16:28 -04:00
Toks
4f42ab8bdb adds support for user level-dependent classes
all links to users should have their class attribute set to that user's
level_class
2013-03-30 12:04:58 -04:00
albert
9cdc2a7cd7 fixes #1014 2013-03-21 17:58:55 -07:00
小太
1a03a86592 Kill trailing whitespace in erb files 2013-03-19 23:11:58 +11:00
albert
04b18abc6e style updates 2013-03-17 23:48:06 -04:00
albert
28a40aeee4 fixes #925 2013-03-17 20:33:25 -04:00
albert
b9b92b6264 fixes #477 2013-03-02 19:21:39 -05:00
albert
9af5959629 show thumbnails for comment search 2013-02-21 16:47:12 -05:00
albert
c20cb34dea fix fetch all comment js 2013-02-21 14:28:20 -05:00
albert
5202ee42f6 fixes #450 2013-02-19 21:57:25 -05:00
albert
f119048493 increase font size for textareas 2013-02-19 21:51:13 -05:00
albert
86164c5200 link to post in comment searches 2013-02-19 21:45:43 -05:00
albert
9e6a25f844 add ubiquitous time tags 2013-01-22 15:28:12 -05:00
albert
57e93f8e69 fixes #279 2012-01-14 17:10:31 -05:00
albert
3136d3c74c fix for #168: No link to post in relation to the comment; 2011-11-01 17:57:33 -04:00
albert
1c8a893450 Fixes #19: Unable to delete my comments 2011-09-14 12:52:49 -04:00
albert
af9072d9ae style fixes for lists in comments 2011-09-13 19:43:47 -04:00
albert
13995cfd39 fixed comment quoting 2011-09-13 18:41:50 -04:00
albert
3395c97c65 fixed comment hiding 2011-09-11 16:40:58 -04:00
albert
9e287726e3 work 2011-05-29 03:47:06 -04:00
albert
f9c961cdc6 * Removed unapprovals, added post flags and post appeals (still need to update tests)
* Restyled text
2011-03-28 18:48:02 -04:00
albert
42627be1d3 moved out search pages 2011-03-15 19:19:49 -04:00
albert
9c0a961ab2 major refactoring of javascripts 2011-03-10 17:59:42 -05:00
albert
4af5c5c38f added comment edit 2011-03-08 18:26:10 -05:00