Commit graph

196 commits

Author SHA1 Message Date
Andrey Chernih fc52db5424 Refactor HomeController 2014-07-09 22:25:39 +04:00
joshua stein 270939b5a4 Story: return true from recalculate_all_hotnesses!
this is usually called from the console, and true is better than a
giant array of every Story object
2014-07-02 10:09:03 -05:00
joshua stein 78f4da6699 Search: escape " when sending to sphinx 2014-06-24 20:08:15 -05:00
joshua stein 023f8282ea as noted earlier, URI.parse is not very lenient
trying to use it in Story#domain but not in validate can ruin things
2014-06-05 07:54:48 -05:00
joshua stein 56774913c0 Story: experiment with making comment counts affect hotness 2014-05-06 21:32:17 -05:00
joshua stein aab34a9936 embed timestamp in password reset token, only work for 24 hours 2014-04-15 00:46:14 -05:00
joshua stein 73b8df5eb7 implement story merging
closes #137
2014-04-08 17:51:12 -05:00
joshua stein 9848cf5e47 Story: export tags in json view
closes #143
2014-04-03 10:23:37 -05:00
joshua stein eec85db1f8 bump up max edit times for stories and comments
not really any harm in letting people correct mistakes
2014-04-02 13:14:08 -05:00
joshua stein 7fb75af7fe simplify Story.find_similar_by_url arel, only pull undeleted stories 2014-03-28 10:45:01 -05:00
joshua stein bb9c9c5353 don't include hiders in story vote summary 2014-03-24 10:26:07 -05:00
joshua stein 6f30d99581 shrink story hotness window to 24 hours 2014-03-24 10:26:07 -05:00
joshua stein c09542a80a enforce a maximum username length of 25 2014-03-24 10:26:07 -05:00
joshua stein 7f9c227ed0 bring back story downvoting, remove low quality option
story hiding is still here, so hopefully this will result in less
bogus story downvotes
2014-03-24 10:26:06 -05:00
joshua stein 00eda60fdc Story#is_downvotable? is gone 2014-03-14 18:55:46 -05:00
joshua stein 8b60e5fd63 show story hider count on story detail page 2014-03-13 10:51:12 -05:00
joshua stein efe1353b87 update a user's unread message count after bulk-delete
only count messages that are both unread and undeleted
2014-03-06 15:27:13 -06:00
joshua stein 285fd82c16 check story tag permissions on editor, not creator 2014-03-06 13:54:30 -06:00
joshua stein 9535b05490 remove story downvoting, add story hiding
stories should either be reported for spam (coming later), upvoted,
or left alone rather than being downvoted for being uninteresting.
since users don't like leaving uninteresting things alone, they can
now hide stories from their view without affecting the story's
score.

hiding is implemented as a Vote with its vote set to 0 and the
reason set to "H"

add a /hidden url which shows all of a user's hidden stories

while i'm here, simplify Vote guts and add some tests to make sure
all the flip-flopping stuff works right
2014-03-03 17:20:21 -06:00
joshua stein 99c551cbfe move initial upvote of submitted story to Story model 2014-03-03 17:13:00 -06:00
joshua stein 888c80eb83 reserve "moderator" and "moderators" usernames 2014-02-21 11:41:47 -06:00
joshua stein 3a60d3abba show story downvoting usernames to moderators to detect problems
such as voting rings or users downvoting things instead of filtering
tags
2014-02-21 11:29:19 -06:00
joshua stein 95202f21b2 add Tag.active scope to deprecate tags without removing them 2014-02-21 10:57:30 -06: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 9d16898477 User: move "new account" age into constant 2014-02-17 10:09:08 -06:00
joshua stein 1d5b004a36 Story: alpha sort methods, no functional changes 2014-02-17 10:07:36 -06:00
joshua stein 9918660ab4 Comment: alpha sort methods, no functional changes 2014-02-17 10:01:44 -06:00
Serge Paquet 519427586a use Rails4-style strong parameters mass assignment protection 2014-02-02 15:41:38 -05:00
joshua stein 20cf2bab65 show how many stories have been tagged with each on filters page
closes #93
closes #114
2014-01-24 13:53:10 -06:00
joshua stein fe83a5b780 use false instead of 0 for boolean column in where clause
fixes #113
2014-01-21 20:53:29 -06:00
joshua stein 71eeb6c7d2 be a good pushover user and let the user specify a sound
- move pushover particulars into User model
- Pushover class rescues errors, don't need to do it from User
2014-01-21 01:21:02 -06:00
joshua stein 00f8e9c189 use one of gravatar's default avatars rather than our own 2014-01-21 00:22:40 -06:00
joshua stein 3c7393c6a3 give tedu his karma back
fix bug introduced in 3757b279 that gave comment vote karma to the
voter rather than the commenter
2014-01-20 20:22:45 -06:00
joshua stein 27caa0a7a6 Merge pull request #106 from srgpqt/recent_threads
fix User#recent_threads for postgresql
2014-01-20 17:27:03 -08:00
Serge Paquet 79b64c3883 use standard create/update comment routes 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 577ce2307b fix User#recent_threads for postgresql 2014-01-16 21:33:00 -05:00
joshua stein dd860f06e3 also escape ~ char before sending to sphinx 2014-01-14 21:53:46 -06:00
Serge Paquet d74a2c448f add postgresql support 2014-01-14 21:42:27 -05: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 be2c706c06 fix Tag.accessible_to to allow moderators to use privileged tags 2014-01-14 11:39:56 -06: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 1ef58d6496 search: fix busted scope introduced in sphinx update 2014-01-13 00:59:37 -06:00
joshua stein 65a9a77104 Merge pull request #92 from srgpqt/filters
simplify and optimize Filters controller and template
2014-01-12 22:34:09 -08:00
joshua stein 4cfa2dae27 Merge pull request #86 from srgpqt/master
refactor Comment#ordered_for_story_or_thread_for_user method
2014-01-12 22:30:27 -08:00
joshua stein f1f6b3c7e0 alert the user when submitting a long-ago-submitted story
show the user a link to the previous story and let them know they
can submit it again if they want to (just by submitting the form
again)
2014-01-13 00:10:31 -06: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 0989d6b30b also log a moderation when a user is banned 2014-01-12 19:22:08 -06:00
joshua stein 287be48187 add stuff to deal with banning users 2014-01-12 15:09:32 -06:00