Commit graph

43 commits

Author SHA1 Message Date
Andrey Chernih fc52db5424 Refactor HomeController 2014-07-09 22:25:39 +04:00
joshua stein 9554423d4f tag pages should be ordered by created_at, not hotness 2014-06-30 11:56:40 -05:00
joshua stein 73b8df5eb7 implement story merging
closes #137
2014-04-08 17:51:12 -05:00
joshua stein 9d2253a010 heavily downvoted stories should never be on the home page 2014-04-06 20:43:16 -05:00
joshua stein 025558f6ad add support for /top and things like /top/3m and /top/2w
not linked to from anywhere yet

closes #95
2014-04-03 13:20:24 -05:00
joshua stein 3993e10109 HomeController: sort methods 2014-04-03 10:26:10 -05:00
joshua stein 6cab668a2f simplify rss <link> generation 2014-03-12 17:50:51 -05: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 0d6f4ed60c fix story pagination and caching for logged-out users
use a file store so each unicorn process can share the same set of
files (using redis would probably be cleaner)

put page number into how hash when creating the cache key
2014-02-16 09:57:05 -06:00
joshua stein 2da624e592 use Rails.env.development? 2014-02-05 21:01:49 -06:00
joshua stein 9fb9a6f116 fix /recent behavior when there aren't enough stories to fill the list
keep walking back a day at a time
(might want to do this quicker though)
2014-02-01 03:39:58 -06:00
joshua stein df75c8f787 revert to previous /newest behavior, use new stuff for /recent
/recent is not yet linked to from anywhere
2014-01-25 11:14:21 -06:00
joshua stein 8dbc0e4724 simplify story finding 2014-01-25 10:38:07 -06:00
joshua stein 35f43ea10c start experiment with /newest page
on the first page of /newest, shift out stories that got enough
traction that they're probably on the front page (currently 5
points)

then take the bottom half of the list and fill it with random,
unpopular stories from the past few days (currently 3)
2014-01-24 13:55:21 -06:00
joshua stein d578482e3b move story comment counts out of keystore
it would be nice to use AR's built-in counter cache, but the
comments count has to reflect something custom so stick with what
was there
2014-01-08 22:20:56 -06:00
joshua stein 1452e1c34d rip out default filtered tags 2014-01-07 11:42:21 -06:00
Serge Paquet 9b0294c471 upgrade to rails v4.0.2 2013-12-30 17:40:52 -05:00
Serge Paquet b42189f45b replace some raw sql with database-agnostic activerecord queries 2013-12-30 16:23:59 -05:00
Serge Paquet 8fbf76b484 use activerecord query interface instead of deprecated finder methods 2013-12-25 16:43:50 -05:00
joshua stein aeb25d22b6 add a footer link bar, add /privacy and /about
if these templates (ignored by git) are not present, just show some
text rather than raise an error
2013-10-18 15:55:20 -05:00
joshua stein 249dd85ec3 allow non-logged-in users to define tag filters
when not logged in, store the filters in a long-lasting cookie and
do not cache the home page

for that one guy on hacker news that complained about lobste.rs not
having this
2013-08-05 02:19:55 -05:00
joshua stein 04218c8f6c explicitly to_s the tag description before sending to CGI.escape
fixes a problem with tags with no description, raised in issue 50
2013-03-29 16:20:52 -05:00
joshua stein d0459974cd so long whitespace 2013-02-13 18:50:51 -06:00
joshua stein 95cdd886a1 fix tag filtering
a story with tags [c, go] with a user's tag filter of [go] was just
removing the [go] tag from the story, not removing it from the list
completely
2013-02-07 17:35:20 -06:00
joshua stein 14ed917baa show rss <link> header on /comments 2013-01-13 21:39:52 -06:00
joshua stein d108158d15 add json views to /newest.json and /hottest.json for issue #42 2012-12-16 20:05:27 -06:00
joshua stein 3bba719cd9 explicitly prevent caching in development mode, triggers some kind of bug
throws "undefined class/module Story" after changing the model in
between refreshes
2012-12-16 20:03:01 -06: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 1987a24a2a properly set @title/@heading everywhere 2012-09-07 09:18:15 -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 6ae36ea492 route /newest/:user to show all stories by that user 2012-09-03 17:29:10 -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 d6255916e8 fix story hiding when downvoted; don't count comment votes 2012-08-29 08:48:57 -05:00
joshua stein b01f9e9027 fixup header current page stuff 2012-08-24 11:41:36 -05:00
joshua stein 75f026b182 do some short caching for guest views of story indexes 2012-08-24 11:41:36 -05:00
joshua stein c2206f46cd fix appearance of other tags when viewing single tag
don't just pull taggings where the tag id matches, pull all stories
where the id is in the list of stories tagged with that tag
2012-08-24 11:41:36 -05:00
joshua stein 40bc2003ab fit more on a page 2012-08-24 11:41:35 -05:00
joshua stein 6e17272e9d story pagination 2012-08-24 11:41:35 -05:00
joshua stein b5b2c92779 show newest in rss url 2012-08-24 10:57:42 -05:00
joshua stein 7b3cbdddee rss feeds! 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 578c96d653 more work 2012-06-30 14:14:35 -05:00
joshua stein 093747b796 initial work on conversion from php tree 2012-06-16 20:15:46 -05:00