Commit graph

352 commits

Author SHA1 Message Date
joshua stein d0459974cd so long whitespace 2013-02-13 18:50:51 -06:00
joshua stein 464b3c3f80 add support for viewing sent private messages 2013-01-24 14:21:22 -06:00
Jon Evans 08a8165fa9 Use new ShortId class to generate short id 2013-01-22 23:32:45 -07:00
Jon Evans 0a48959cda Pull short id generation into separate class 2013-01-22 23:15:05 -07:00
joshua stein 10abf0bd7b don't deliver mention or reply notifications to posting user 2013-01-07 16:29:00 -06:00
joshua stein 11385d6b65 add json view of story, including comments
for issue #42
2012-12-30 12:17:59 -06:00
joshua stein 048c614590 Story: make update_comment_count factor in deleted comments/threads 2012-12-30 12:12:24 -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 d64f713054 User: don't export id to json; consumers should use username as pk 2012-12-18 17:26:29 -06:00
joshua stein 109718ba90 expose User and Story created_at to json 2012-12-18 17:16:02 -06:00
joshua stein cb5e1592b0 Story: export comment_count and score to json 2012-12-17 18:19:19 -06:00
joshua stein a4e5684994 moderation log: fix tag change summary; fixes issue #43 2012-12-16 20:27:54 -06:00
joshua stein 175ff9d2b1 add some custom as_json output to Story and User 2012-12-16 20:00:41 -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 e5a0b671b8 story: simplify tags malarky and just use mark_for_destruction on associated objects 2012-11-26 13:39:16 -06:00
joshua stein fd4a278d3b fix duplicate description= definition 2012-11-13 11:39:50 -06:00
joshua stein 6deadc731a designate certain tags as media types, require a tag other than those
just tagging something "video" doesn't make it appropriate for
submission, it still requires a categorization tag
2012-11-12 11:02:18 -06:00
joshua stein 9ece6666bf add stupid temporary hack to strip out utf8mb4 chars that are screwing up mysql
4-byte utf8 chars like emoji are passed around in ruby fine, but
when they are put into mysql queries, strings get truncated at the
first mb4 character.  to prevent truncation, strip out mb4
characters in most user-controlled fields like comments, story
descriptions and titles, and messages.

to properly support utf8mb4, mysql server 5.5 is needed, the table
encodings need to be changed to utf8mb4, and the mysql2 gem needs to
be upgraded once it supports utf8mb4:

https://github.com/brianmario/mysql2/issues/249
2012-11-07 21:58:10 -06:00
joshua stein 47f1c44fc9 do incremented_value_for in a transaction to make sure we get the right key back
do sqlite checks based on Keystore.connection.adapter_name rather
than assuming one environment uses sqlite and the others don't
2012-10-24 14:55:14 -05:00
joshua stein d07c555595 comments can be deleted or moderated to be considered gone 2012-10-24 11:53:43 -05:00
joshua stein d495e9472a move hotness window back to 48 hours 2012-10-09 11:06:43 -05:00
joshua stein 24ed0e1f6f only count downvotes in downvote summary 2012-10-09 11:04:53 -05:00
joshua stein 468a0cbe60 no need to make a delta for seconds, just use created_at 2012-10-09 11:04:53 -05:00
joshua stein c4f1a5e756 we're not doing comment flagging, remove 2012-10-09 11:04:43 -05:00
joshua stein c0ba39834b only do new tag check for new stories 2012-10-07 01:44:33 -05:00
joshua stein 6cb466bc83 shrink story hotness window down to 24 hours as we are growing 2012-09-20 11:00:11 -05:00
joshua stein 39bb9b77de minor cleanup 2012-09-20 10:53:11 -05:00
Robert J Samson 45d87069dd Check that user has appropriate permissions on tags before_save 2012-09-19 22:13:20 -04:00
Robert J Samson f3eb44972b Check to make sure a user isn't improperly using a privileged tag when saving a Story. 2012-09-19 20:57:45 -04:00
Robert J Samson 7fd75a7f3a More descriptive method and attribute names 2012-09-19 20:28:09 -04:00
Robert J Samson 5ada55f10d Add a 'private' attribute to tags to allow for admin / mod specific tags
Private tags would allow admins to create tags that only admins could
use, and that regular users could not filter. The best example use case
for this is an 'announements' tag for site announements that all users
should see.
2012-09-19 16:44:57 -04:00
joshua stein 0663ea0fed show how many users are filtering each tag 2012-09-19 12:25:11 -05:00
joshua stein b2315a5728 add private rss feeds for logged-out users by passing a token
create a random rss_token for each user and append it to the rss
urls.  when adding the user-specific feed url to a feed reader, the
user's tag filters will be applied before generating the rss view,
giving the same list of stories that the user sees while logged in.
2012-09-18 10:43:05 -05:00
joshua stein 7c8db7269d wrap 2012-09-18 10:22:59 -05:00
joshua stein 42150c8a56 fix karma adjustment when not upvoting 2012-09-17 19:24:33 -05:00
joshua stein b7e5447c1d allow embedded images in story text, but still not in comments 2012-09-17 13:24:29 -05:00
joshua stein cb5e05c461 minor cleanups after last merge 2012-09-16 15:51:25 -05:00
joshua stein 17d8213bc7 merge @username mentions and notifications from @rjsamson 2012-09-16 15:41:21 -05:00
joshua stein dae138cddd show in a user profile who the user was invited by 2012-09-16 15:16:32 -05:00
joshua stein 45a498ea51 comments have an initial upvote of 1, which has a non-zero confidence 2012-09-14 15:54:45 -05:00
Robert J Samson ec1bcb9704 Added mentions in comments using @username convention. @username is linked to user profile in comment text, and notifications are available via email and pushover (with notification preferences) when a user is mention. 2012-09-10 13:40:33 -04:00
joshua stein af5b00572c whenever a story/comment is moderated, send a message to the user 2012-09-08 18:32:56 -05:00
Robert J Samson 6554983fd7 Add average karma to user profiles 2012-09-07 13:25:59 -04:00
joshua stein ea143e6fbb reject email addresses with spaces 2012-09-07 09:25:00 -05:00
joshua stein f0bc4e7c8d reject email addresses with spaces, catch mailer delivery errors 2012-09-07 09:24:29 -05:00
joshua stein c093431898 allow tags to be filtered by default for new and non-logged-in users 2012-09-06 13:44:42 -05:00
joshua stein 6be5150bb0 cleanup 2012-09-04 20:59:51 -05:00
Maxwell Swadling 3c65a3332f Fixed the sqlite FIXME for keystore 2012-09-05 09:01:59 +10:00
joshua stein b91a637535 Story#url has a custom validator, remove duplicate 2012-09-03 16:53:58 -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 0691235882 suppress deleted messages from message list since they're not actually wiped out until both parties delete 2012-09-03 11:25:14 -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 88894a66fc catch sphinx errors 2012-09-01 22:56:07 -05:00
joshua stein 776bf89dea implement /comments.rss 2012-08-24 11:41:37 -05:00
joshua stein edcee1bddd << strikes again 2012-08-24 11:41:37 -05:00
joshua stein c945f29040 add similar-url check for www\d*\., rewrite checker to be simpler 2012-08-24 11:41:37 -05:00
joshua stein 70db7a5879 short ids in urls should be case insensitive, so make them that way anyway 2012-08-24 11:41:37 -05:00
joshua stein 33e6eee4e0 don't count deleted comments for stories, update comment counts after comment del/undel 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 7dd4b99ac2 escape slashes in search queries 2012-08-24 11:41:37 -05:00
joshua stein fd8ec36608 story previews 2012-08-24 11:41:37 -05:00
joshua stein abb8392c16 search engine! 2012-08-24 11:41:36 -05:00
joshua stein 389b4c61ec do better at finding near-similar urls already posted recently
http -> https, trailing slash, etc.
2012-08-24 11:41:36 -05:00
joshua stein da5c04504a fix voting on stories where the user previously commented on 2012-08-24 11:41:36 -05:00
joshua stein 88f01210d3 enable activerecord attribute whitelisting just in case 2012-08-24 11:41:36 -05:00
joshua stein c17ea7b638 while we're slow, allow upvoted stories to stick around longer 2012-08-24 11:41:36 -05:00
joshua stein b9c8f1d371 oops, confidence desc 2012-08-24 11:41:36 -05:00
joshua stein f664734a40 fix markdown links that have trailing punctuation inside the url 2012-08-24 11:41:36 -05:00
joshua stein 911bc2d088 only rstrip comments to preserve leading spaces for <pre> wrapping 2012-08-24 11:41:35 -05:00
joshua stein c63d35a65d use a common class for rdiscount options, filter out <h#> tags, add rel=nofollow 2012-08-24 11:41:35 -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 cd568eaa38 fix deleting/undeleting stories for users and moderators 2012-08-24 11:41:35 -05:00
joshua stein b5fc3d2e1f allow admins to edit everything forever 2012-08-24 11:41:35 -05:00
joshua stein 28cd5f8432 fix story edit bug, only check url at new time 2012-08-24 11:41:34 -05:00
joshua stein a2705a835e add tag filters 2012-08-24 11:41:34 -05:00
joshua stein fc1c474fb3 implement private messages 2012-08-24 11:41:34 -05:00
joshua stein 95ef42d872 move confidence and hotness into sql tables for proper sorting 2012-08-24 11:41:34 -05:00
joshua stein e535a1387f make linking to specific comments work 2012-08-24 11:41:34 -05:00
joshua stein d9b95b2a1d email and pushover reply notifications 2012-08-24 11:41:30 -05:00
joshua stein 9de30a870f use a story's short id url as the rss guid since the title can change 2012-08-24 10:57:42 -05:00
joshua stein 6258cb7f75 remove leading and trailing underscores from title_as_url 2012-08-24 10:57:42 -05:00
joshua stein c38fb2ed95 fixes 2012-08-24 10:57:42 -05:00
joshua stein 6b76eadcec sqlite is only in test 2012-08-24 10:57:42 -05:00
joshua stein c961bd6546 catch no title 2012-08-24 10:57:42 -05:00
joshua stein 73916d6636 going to have to do this sqlite-specific anyway 2012-08-24 10:57:42 -05:00
joshua stein 8dd109c49f drop custom markdowner for rdiscount 2012-08-24 10:57:42 -05:00
joshua stein 3bfea45145 shorter random string to not wrap in email 2012-08-24 10:57:41 -05:00
joshua stein 282f505cf2 pass around root_url from view/controller into model when needed 2012-08-24 10:57:41 -05:00
joshua stein d85aed9475 value_for 2012-08-24 10:57:41 -05:00
joshua stein 909feb49cb note submitters in keystore 2012-08-24 10:57:41 -05:00
joshua stein ada1571a53 invitation system, user settings 2012-08-24 10:57:11 -05:00
joshua stein f6560d37ad shorten stories to /s/ instead of /p/ 2012-08-24 10:57:11 -05:00
joshua stein bbaa8f554f fix markdown help display on story submission 2012-08-24 10:57:11 -05:00
joshua stein 7b3cbdddee rss feeds! 2012-08-24 10:57:10 -05:00
joshua stein 13a584854e stories must have at least one tag 2012-08-24 10:57:10 -05:00
joshua stein 473a026a0e how did all of these tabs get here 2012-08-24 10:57:10 -05:00
joshua stein f801932a03 use nokogiri to get doc titles 2012-08-24 10:57:10 -05:00
joshua stein cb4f0f9b4e Utils.random_str 2012-06-30 16:43:18 -05:00
joshua stein 578c96d653 more work 2012-06-30 14:14:35 -05:00
joshua stein 95b4906e6e working voting/scoring, threaded comments 2012-06-30 11:18:36 -05:00
joshua stein 093747b796 initial work on conversion from php tree 2012-06-16 20:15:46 -05:00