Commit graph

352 commits

Author SHA1 Message Date
joshua stein c602b01965 Story: revert cb300450f, using newest created_at of all merged
This behavior is confusing.
2016-08-19 00:00:18 -05:00
chaica 9506b1ce10 I18n moderations (#301)
* translate moderation view, controller and model

* support for i18n in the moderation controller

* support for i18n in the moderation model - use interpolation for variables inside strings

* support for i18n in controller model - localize time and date string format for printing time and date of the moderation action
2016-07-05 10:02:14 -05:00
joshua stein f2602432c9 separate can_invite? and banned_from_inviting? 2016-06-22 15:30:44 -05:00
joshua stein b2182f5ca7 Story: in checking for previous duplicates, fetch moderated ones
this will block a moderated story from being submitted again inside
the window

closes #291
2016-06-22 15:30:44 -05:00
joshua stein cb300450fb Story: use newest created_at of all merged stories for calculating hotness
we already take their points, but if they have a much newer
created_at and we've been moved off the front page, points won't
save us.  use their created_at to be fresher.

should fix #300
2016-06-22 15:30:44 -05:00
joshua stein d8c7f98cfd prevent users with much negative karma from submitting new stories 2016-06-22 15:30:44 -05:00
joshua stein 3bebdb80a7 User: clear deleted_at when unbanning, since we probably set it 2016-06-10 16:31:13 -05:00
joshua stein 30166dd120 Merge pull request #293 from nyanpasu/master
Allow admin/moderator to disable user from inviting
2016-06-10 17:20:48 -04:00
joshua stein d3a826d80e Story: fix saving old stories with inactive tags 2016-06-01 14:36:09 -05:00
nyanpasu 99f78ad10c Send pm instead of email on invite disable 2016-05-19 09:01:27 +08:00
nyanpasu 19526c2d3f Don't delete user after disabling invites 2016-05-19 09:01:27 +08:00
nyanpasu aa0ffeb37b Allow admin/moderator to disable user from inviting 2016-05-16 02:40:46 +08:00
joshua stein d1c9aeaaa3 Story: make title_as_url output shorter urls 2016-05-04 14:40:06 -05:00
joshua stein 4c5cf4a542 require a minimum karma to suggest story title/tag suggestions 2016-05-02 17:57:19 -05:00
joshua stein b204775e8f Story: don't allow a story to be merged into itself 2016-04-25 13:24:50 -05:00
joshua stein a7d426581d Story: shrink hotness window to 22 hours 2016-04-12 11:48:47 -05:00
joshua stein 1fb6eb6eb2 drop SUGGESTION_QUORUM to 2 2016-04-06 13:22:46 -05:00
joshua stein a5928b675d implement hats list and request/approval system
closes #281
2016-04-06 13:19:46 -05:00
joshua stein e85afa2425 StoryRepository: simplify 2016-03-28 17:14:55 -05:00
joshua stein 437124da4e StoryRepository: make positive_ranked honest 2016-03-28 17:14:43 -05:00
joshua stein 41ba0b20dd Hat: add css class of hat_(actual_hat_name) 2016-03-24 14:58:06 -05:00
joshua stein d54427df21 make 'link' on comments use very short url 2016-03-24 13:19:26 -05:00
joshua stein 2b5ba63087 Comment: if user is banned, make gone text reflect that 2016-02-10 16:12:11 -06:00
joshua stein 28bbc9c8f7 moderators have to provide a reason for deleting others' comments 2016-02-10 08:57:38 -06:00
joshua stein c3b62cc166 User#grant_moderatorship_by_user! 2016-02-10 08:39:10 -06:00
joshua stein e0b7c25758 comments: show usernames in vote summaries to moderators 2016-02-10 08:38:28 -06:00
joshua stein f53aced518 add a comment explaining why this code is so verbose 2016-01-21 11:58:54 -06:00
joshua stein d10f567a26 Search: just use Riddle.escape, sorry boolean 2016-01-21 11:58:54 -06:00
joshua stein 13df4537f3 make merged story points count towards the winning story
but not take them into its score, just its hotness value.  this way
when a new winning story takes over an upvoted story, the hotness
value will be near the losing one.
2015-12-31 09:14:09 -06:00
joshua stein 5129733b04 when showing another user's threads, don't include story threads 2015-12-18 10:51:01 -06:00
joshua stein ce8a148cbe Story: don't count comments towards hotness when tag hotness mods < 0 2015-12-15 12:35:18 -06:00
joshua stein 46ebed367d Comment, Story: crank MAX_EDIT_MINS to 6 hours 2015-12-09 11:52:48 -06:00
joshua stein 6b636ac8c5 add setting to show threads on a user's submitted stories in 'Your Threads'
closes #231
2015-12-07 12:27:09 -06:00
joshua stein 3850fa7d54 Story: reduce suggestion quorum to 3 2015-12-07 12:27:09 -06:00
joshua stein 9f9e608fc8 fix fetched_attributes fallout 2015-12-03 14:57:33 -06:00
joshua stein 4e94bc9e29 Comment: for emailed comments, show that in the message id used for mailing list 2015-12-02 13:46:19 -06:00
joshua stein 45b63935af Story: move fetched_* stuff into a single fetched_attributes 2015-12-02 13:46:19 -06:00
joshua stein c354485916 when a non-banned, deleted user logs in, reactivate their account 2015-11-18 12:08:45 -06:00
joshua stein a337ee850e take suggestions on moderator stories, just not those with privileged tags
also allow moderators to make tag suggestions, we're people too
2015-10-17 10:38:48 -05:00
joshua stein a4e3f04d2d Story: do automatic user suggestion promotion for story titles too
It's much less likely that users will all agree on an exact title
name, but try it anyway.
2015-10-16 18:28:57 -05:00
joshua stein 14bf26f339 for story comments by author of story, color blue as well 2015-10-16 13:08:05 -05:00
joshua stein e3c881b81a implement automatic tag changing in response to user suggestions
Right now it's just a simple check for SUGGESTION_QUORUM (currently
4) number of users agreeing on a set of new tags.

Log a moderation to the story submitter when this happens, and allow
moderations to be done by a non-specific user.

Issue #207
2015-10-15 10:04:23 -05:00
joshua stein 2ca2c94ef6 allow messages to come from system instead of a user 2015-10-15 10:01:42 -05:00
joshua stein 7974ab4090 don't take suggestions on moderator stories
This should probably only apply to stories with restricted tags,
though.
2015-10-15 09:38:26 -05:00
joshua stein 21927eccbe Story: always recalculate hotness after saving changes 2015-10-14 21:17:54 -05:00
joshua stein e940601a2f start on automated story title and tagging suggestions
Rather than keep "poorly titled" and "poorly tagged" as reasons for
flagging, make the user do the work of suggesting new ones.

At some point, suggested taggings will flip to real taggings once
they reach a certain count (to be determined later).  This also has
to take into account tagging sets that don't contain current tags,
for when they need to be removed.

For titles, I'm not yet sure how to handle this in an automated
fashion except for the (probably rare) case of multiple users
submitting the same exact thing, but at least collect them for now.

Issue #207
2015-10-14 20:32:24 -05:00
joshua stein 700c63b936 Story: extend MAX_EDIT_MINS to 3 hours 2015-10-14 18:23:06 -05:00
joshua stein 80f7d5b095 remove or fix failing tests
Many of these fail because they were written with fancy rspec
features that don't work properly anymore and I don't care enough
about testing everything to update them.

See issue #228
2015-10-11 13:00:34 -05:00
Basilio the cat 3743a41868 Keep the www\d* domain for some stories
When extracting story domain, keep the facing `www\d*` domain in cases
where it's the only non top level domain (e.g. www31337.tld).
2015-08-09 22:21:22 +02:00
joshua stein 0c4a88e284 export some more things through json 2015-08-04 09:58:47 -05:00
joshua stein 6dcf35dc25 my karma means nothing 2015-07-31 22:43:16 -05:00
Owen Marshall 8fae63929d Truncate at end-of-string, not at every EOL 2015-07-31 09:03:10 -04:00
joshua stein 09f65774c2 Story#description_or_story_cache: handle truncation properly 2015-07-30 18:12:57 -05:00
joshua stein 81b3be6165 add setting to show inline story previews in story list
Closes #148
2015-07-30 17:56:09 -05:00
joshua stein 0d61e0cf68 add "i am the author of this" checkbox for stories
Highlights username in a different color and says "authored by"
instead of just "by".

Move html class printing into a method in Story to use in the future
for friends, admin posts, etc.

Closes #171
2015-07-30 17:15:48 -05:00
joshua stein 8282181e49 Story: shrink hotness window to 24 hours 2015-07-24 00:51:11 -05:00
joshua stein 55bab8003d Story: validate url length according to db field length 2015-07-24 00:51:11 -05:00
joshua stein cbc1c50cd2 add user banning/unbanning from user view page 2015-07-24 00:51:11 -05:00
joshua stein 38ac6a4c3f Story: halve comment score weights in hotness 2015-07-24 00:51:11 -05:00
joshua stein 5989e9c808 Story: fix up bogus chars in title before saving, only 160 for now 2015-07-24 00:51:11 -05:00
joshua stein db63d22b83 use identicon for blank gravatars, makes conversations easier to follow 2015-07-24 00:51:11 -05:00
joshua stein 6cc5f196bf Tag: remove accessible_to, use valid_for?
They do the same thing now but a scope might be too limited in the
future so just pick one now.

Closes #100
2015-07-24 00:51:11 -05:00
joshua stein 434ad81752 Story: do url validation case insensitively 2015-07-24 00:51:10 -05:00
joshua stein 8f8ad57135 export a json version of user page, include karma and about text 2015-04-09 21:05:50 -05:00
joshua stein 88602f7535 StoriesPaginator: make per_page configurable 2015-04-03 12:58:14 -05:00
joshua stein fdf892e7f9 move user unread message count into a scope 2015-04-03 12:57:12 -05:00
joshua stein e9f005d83b User: a few more reserved usernames 2015-04-01 01:02:01 -05:00
joshua stein e974083413 Story: inactive tags that are marked for destruction are ok 2015-03-19 12:10:52 -05:00
joshua stein 26f17ae928 User: add some banned usernames from a long-ago comment by @kevinburke 2015-03-19 12:10:18 -05:00
joshua stein d286eab325 add option to show user avatars on stories and comments
just because
2015-03-12 23:23:15 -05:00
joshua stein 6695480fdb when auto-detecting story titles, try to find a canonical url and use it
should remedy duplicate stories being submitted under all of their
stupid blogspot.* domains instead of the canonical url represented
in the <link> tag
2015-03-10 17:41:40 -05:00
joshua stein 966579e596 Search: more sphinx chars to escape 2015-03-10 17:07:15 -05:00
joshua stein fd00205625 for admins, show some private info about users in user profiles 2015-02-17 11:47:27 -06:00
joshua stein 976eb522e8 Hat: provide a destroy method that can log a moderation 2015-02-17 11:47:26 -06:00
joshua stein 7f3adc0e9d fix some fallout from previous 2015-02-13 11:26:28 -06:00
joshua stein f9b309d342 separate story hiding from voting
A story downvote is considered a flag, just meaning the story has
problems and not necessarily that the user wants to ignore it.  By
moving hiding out of Vote and into a new HiddenStory model, a user
can now both downvote/flag and hide separately, or just one or the
other.
2015-02-11 11:37:03 -06:00
joshua stein 7d15b5db6d tldr, didn't comment 2015-02-09 23:11:25 -06:00
joshua stein 975e35d006 Search: escape @, it has special meaning to sphinx 2015-02-05 09:55:41 -06:00
joshua stein 8771afc5f5 try a bit harder at finding a submitted story's real title
Ignore the title presented by the user unless we couldn't find
anything, but start out by fetching the URL and trying some <meta>
tags first, then <title>, then use the title the user brought.
2015-02-03 11:20:07 -06:00
joshua stein a16150d8a5 allow searching stories by domain, link domain in story list to such a query 2015-01-29 10:16:46 -06:00
joshua stein 00d347c4f4 consolidate sql fragment to cast story/comment score 2015-01-28 15:02:40 -06:00
joshua stein bf928cf62b Story: take hotness window back down to 36, 48 is a bit stale 2015-01-27 12:14:26 -06:00
joshua stein 31df8973a8 Pushover: switch to subscriptions
users.pushover_device and users.pushover_sound columns can be
dropped once migrated
2015-01-15 13:23:31 -06:00
joshua stein f1cfe29b1f fix initial story hotness
Initial story hotness was zero, which excluded stories with no other
upvotes from the homepage.  Before creating, define initial hotness
to something.

Since this now makes very new stories show up on the homepage right
away, expand the window back to 48 hours.

This requires a Story.recalculate_all_hotnesses! to properly sort
things.
2015-01-13 13:00:55 -06:00
joshua stein 4b768e2f42 Search: clamp results to Sphinx's max_matches
Otherwise this will annoyingly raise an exception when fetching
results if offset exceeds max_matches
2015-01-11 12:59:41 -06:00
joshua stein 88709b5d04 move story tagging sorting into a function 2015-01-06 17:31:44 -06:00
joshua stein 9c73c87d28 add story cache showing for manually-specified unavailable stories 2015-01-06 17:31:09 -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
joshua stein c151fbeeb8 better tag hotness mod calculation 2015-01-01 10:25:14 -06:00
joshua stein 1cc16ecfbf tweak code formatting 2014-12-15 15:06:53 -06:00
joshua stein 606f5c9849 experiment with factoring comment scores into story hotness
might keep an active story alive on the front page and bury a story
with a "comment graveyard"
2014-12-15 15:06:53 -06:00
joshua stein 5c1cc0ae38 Hat: if link isn't a url, don't href to it (probably shouldn't call it link then) 2014-12-15 15:06:53 -06:00
joshua stein ddb9215aa0 log a moderation when hats are granted, since we're open and all that 2014-11-15 09:52:29 -06: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 9e8b89be1c cast story.{upvotes,downvotes} to signed on mysql, integer on postgres
old mysql doesn't support 'cast(1 as integer)', but new/mariadb does

postgres doesn't support 'cast(1 as signed)'

should fix #145
2014-10-06 14:07:53 -05:00
joshua stein 09bd0026d3 ignore a story's submitter's comments when calculating hotness 2014-09-16 10:53:25 -05:00
joshua stein dfe6db4849 revert 85cb7c20, give up on planet rss aggregation 2014-08-31 20:35:41 -05:00
joshua stein 962b7e8d59 add per-tag story hotness modifiers 2014-08-31 20:27:54 -05:00
joshua stein e252d2d66e StoryRepository: positive_ranked should end at -1 2014-08-25 17:57:26 -05:00