Commit graph

57 commits

Author SHA1 Message Date
joshua stein
270401db3f comment: show downvote summaries to moderators 2015-02-07 12:23:51 -06:00
joshua stein
5efe3ce6c3 make time_ago_in_words_label actually do what was intended 2015-01-06 14:08:15 -06:00
joshua stein
9f5e04bbba use _path for most things instead of _url
Instead of hard-coding the scheme and host everywhere, use _path
methods to show relative URLs.

Except that our previous setting of
Rails.application.routes.default_url_options in
config.after_initialize made this moot because Rails inserts that
host into all _path helpers for some reason.  So revert that
setting.

But then anything that wants an absolute URL doesn't know the
hostname and the root_url helper throws an exception.  So make a
Rails.application.root_url shortcut to pass the per-app settings in
Rails.application to root_url.

Now we can just use _path helpers most places but still use _url
ones where we need them, such as in RSS views and e-mail templates.
2015-01-02 17:02:55 -06:00
Serge Paquet
a1f5052f99 fix cancel button in comment forms 2014-12-14 01:24:18 -05:00
joshua stein
31d4e97858 implement hats
https://lobste.rs/s/bkeYe9/about_lobsters/comments/ZD2tL3#c_ZD2tL3
2014-11-14 14:12:29 -06:00
joshua stein
5b94406640 Comment: include page anchor in urls 2014-11-14 12:46:09 -06:00
joshua stein
8958ce76c2 for direct-comment links, just use an anchor instead of js to scroll
closes #156
2014-07-03 11:25:30 -05:00
joshua stein
416a5de6e4 fade out downvoted comments less dramatically 2014-06-30 17:13:07 -05:00
joshua stein
013662e50b only show comment downvote summary if its total score is <= 0
when a comment has a few upvotes and one downvote, users tend to
focus too much on the one downvote and edit or reply and debate the
downvote.  if more upvoted than downvoted, don't discourage the user
by pointing out the haters
2014-06-11 19:35:37 -05:00
joshua stein
993e1e84ae when not logged in, show comment box but disabled 2014-04-14 23:14:08 -05:00
joshua stein
73b8df5eb7 implement story merging
closes #137
2014-04-08 17:51:12 -05:00
joshua stein
67fc2cc75c set maximum time during which comments and stories can be downvoted
always allow a user to "unvote" if they're previously downvoted, but
after a certain number of days, don't accept new downvotes

there isn't really any benefit in downvoting old stuff that is
already off the front pages or on a dead comment thread, other than
to maliciously strip karma for particular users
2014-02-17 12:08:01 -06:00
joshua stein
a16e99c686 avoid leaking object ids in form_fors 2014-02-12 13:28:53 -06:00
joshua stein
354143e9c5 mobile story view: align things a bit better, shorter markdown help label 2014-02-08 14:41:36 -06:00
joshua stein
49a116a12e "edited by e-mail" doesn't make much sense 2014-02-03 14:37:31 -06:00
Serge Paquet
5bca469035 enable "reply" function on the "Comments" page 2014-01-20 21:04:54 -05:00
Serge Paquet
79b64c3883 use standard create/update comment routes 2014-01-20 16:52:19 -05:00
Serge Paquet
42ce1e3b4c rebuilt comment tree DOM structure as valid HTML 2014-01-20 16:52:19 -05:00
Serge Paquet
41c9dfad5d fix DOM structure when replying to or updating comments 2014-01-20 16:52:19 -05:00
Serge Paquet
02a30c66b1 optimize database queries for "Your Threads" page 2014-01-20 16:44:14 -05:00
joshua stein
8c3841331d when highlighting one comment, scroll to it
though i wonder with highlighting comments and now scrolling to
them, why we bother excluding all other threads.  we aren't
pagingating threads anyway.
2014-01-18 13:13:58 -06:00
joshua stein
5f6c13b26b Merge pull request #98 from srgpqt/master
remove redundant "story" variable in comment templates
2014-01-14 18:34:07 -08:00
joshua stein
e12d91cd43 allow users to delete their own accounts
not much can actually be deleted, but it can be put into a deleted
state
2014-01-13 10:12:17 -06:00
Serge Paquet
aabe4ceed7 remove redundant "story" variable in comment templates 2014-01-13 02:11:34 -05:00
joshua stein
22b77573a5 prevent new users from downvoting
don't show downvote arrows for logged-out and new users

color comments from new users in green like in the user tree,
and banned users in gray
2014-01-12 23:17:09 -06:00
joshua stein
ccae78bf34 if user is not logged in, prevent downloading application.js
saves a lot of time for users downloading and processing jquery and
other code that is never used when logged out
2014-01-12 13:28:07 -06:00
joshua stein
9bab78634e don't show endless comment link pages
stop when there are no more comments
2014-01-08 20:42:25 -06:00
joshua stein
e63e45af2b record and show which comments were posted by e-mail, for no particular reason 2013-12-28 12:00:29 -06:00
Serge Paquet
6dcb7bbf6b fixed mixed indent style (should be 2 soft spaces as per project guidelines) 2013-12-23 18:19:47 -05:00
joshua stein
a471eb180a don't hardcode "Lobsters" and "lobste.rs" everywhere, use Rails.application.{name,domain} 2013-06-30 01:50:23 -05:00
joshua stein
87cb2cb45b add time_ago_in_words_label helper that shows the real time as a label title 2013-02-22 11:22:39 -06:00
joshua stein
19ba94fd31 don't collapse moderated threads, remove them entirely 2012-12-30 12:11:47 -06:00
joshua stein
f7cac129b4 when comments are moderated, collapse their replies
also try to show which moderator deleted the comment and the reason
2012-12-18 21:36:32 -06:00
joshua stein
a9e169175b show story vote summaries to submitters and mods if it has any downvotes 2012-12-08 22:39:06 -06:00
joshua stein
3e689b1c35 check for show_story first 2012-11-21 22:13:50 -06:00
wilkie
e37053cea4 Removes link to reply on comment when not on a story page.
The reply link does not work on any page that isn't a story page because
it replies on the fact that a comment_form div exists on a page. That
form is the base comment field present on a story page. Therefore,
removing the link when the story is displayed next to the comment
selects for that case easily.

Closes #36 by virtue of removing the link.
2012-11-15 21:25:34 -05:00
joshua stein
64c6949edf paginate /comments 2012-09-19 13:40:02 -05:00
joshua stein
ad1d925c61 prevent double clicking of the post comment button from creating two comments 2012-09-14 16:17:45 -05:00
joshua stein
17ce13d49e move previewed/posted comment outside of <form>, fixes duplicate comment problem
a comment would get posted and then displayed inside the original
<form>.  when that comment would get edited, its <form> would be
nested inside the original one, and on webkit browsers, submitting
the inside form would submit the outside one.
2012-09-04 11:33:49 -05:00
joshua stein
5a72a9d6a7 if a comment is downvoted, show the comment's user a summary of its downvote reasons 2012-09-03 12:42:32 -05:00
joshua stein
e6c74e8251 add moderation logging
- add users.is_moderator and look at that for most things, not
is_admin

- make default user in readme be a moderator

- log moderator actions in story edits, comment
  deletions/undeletions (and later, user disabling).

- remove ability for moderators to edit comments, there's really no
  reason to.
2012-09-02 12:18:52 -05:00
joshua stein
776bf89dea implement /comments.rss 2012-08-24 11:41:37 -05:00
joshua stein
0c0aa465bb make /comments show latest comments 2012-08-24 11:41:37 -05:00
joshua stein
3640e1e7a3 comment deleting and undeleting 2012-08-24 11:41:37 -05:00
joshua stein
abb8392c16 search engine! 2012-08-24 11:41:36 -05:00
joshua stein
2ba78cc10e downcase vote reasons 2012-08-24 11:41:36 -05:00
joshua stein
43aa0047e9 simplify markdown help link 2012-08-24 11:41:36 -05:00
joshua stein
342d6ff911 move markeddown html into sql so it doesn't have to be generated every time
it's unlikely to change and if it does, we can just re-generate
everything in sql at once
2012-08-24 11:41:35 -05:00
joshua stein
f8dd75fde4 comment editing, looks weird for now but it works 2012-08-24 11:41:35 -05:00
joshua stein
cd568eaa38 fix deleting/undeleting stories for users and moderators 2012-08-24 11:41:35 -05:00