diff --git a/r2/r2/config/routing.py b/r2/r2/config/routing.py index eef0fcce7..7f58ceb63 100644 --- a/r2/r2/config/routing.py +++ b/r2/r2/config/routing.py @@ -82,6 +82,8 @@ def make_map(global_conf={}, app_conf={}): mc('/admin/:action', controller='admin') + mc('/user/:username/about', controller='user', action='about', + where='overview') mc('/user/:username/:where', controller='user', action='listing', where='overview') diff --git a/r2/r2/config/templates.py b/r2/r2/config/templates.py index a5a2c8d0f..7960ed7d6 100644 --- a/r2/r2/config/templates.py +++ b/r2/r2/config/templates.py @@ -42,6 +42,7 @@ api('reddit', RedditJsonTemplate) api('panestack', PanestackJsonTemplate) api('listing', ListingJsonTemplate) api('usertableitem', UserItemJsonTemplate) +api('account', AccountJsonTemplate) api('organiclisting', OrganicListingJsonTemplate) api('reddittraffic', TrafficJsonTemplate) diff --git a/r2/r2/controllers/listingcontroller.py b/r2/r2/controllers/listingcontroller.py index ca6dae3a4..c16c4f8e7 100644 --- a/r2/r2/controllers/listingcontroller.py +++ b/r2/r2/controllers/listingcontroller.py @@ -34,6 +34,7 @@ from r2.lib.db.thing import Query, Merge, Relations from r2.lib.db import queries from r2.lib.strings import Score from r2.lib import organic +from r2.lib.jsontemplates import is_api from r2.lib.solrsearch import SearchQuery from r2.lib.utils import iters, check_cheating, timeago from r2.lib import sup @@ -453,6 +454,11 @@ class UserController(ListingController): return ListingController.GET_listing(self, **env) + @validate(vuser = VExistingUname('username')) + def GET_about(self, vuser): + if not is_api() or not vuser: + return self.abort404() + return Reddit(content = Wrapped(vuser)).render() class MessageController(ListingController): show_sidebar = False diff --git a/r2/r2/lib/jsontemplates.py b/r2/r2/lib/jsontemplates.py index cdf84a900..7945e3588 100644 --- a/r2/r2/lib/jsontemplates.py +++ b/r2/r2/lib/jsontemplates.py @@ -185,6 +185,11 @@ class SubredditJsonTemplate(ThingJsonTemplate): over18 = "over_18", description = "description") +class AccountJsonTemplate(ThingJsonTemplate): + _data_attrs_ = ThingJsonTemplate.data_attrs(name = "name", + link_karma = "safe_karma", + comment_karma = "comment_karma") + class LinkJsonTemplate(ThingJsonTemplate): _data_attrs_ = ThingJsonTemplate.data_attrs(ups = "upvotes", downs = "downvotes", @@ -249,6 +254,12 @@ class CommentJsonTemplate(ThingJsonTemplate): from r2.models import Comment return make_typename(Comment) + def raw_data(self, thing): + d = ThingJsonTemplate.raw_data(self, thing) + if c.profilepage: + d['link_title'] = thing.link.title + return d + def rendered_data(self, wrapped): d = ThingJsonTemplate.rendered_data(self, wrapped) d['replies'] = self.thing_attr(wrapped, 'child') diff --git a/r2/r2/public/static/iphone/iReddit-thumb.png b/r2/r2/public/static/iphone/iReddit-thumb.png new file mode 100644 index 000000000..ace291ee6 Binary files /dev/null and b/r2/r2/public/static/iphone/iReddit-thumb.png differ diff --git a/r2/r2/public/static/iphone/iRedditFree-thumb.png b/r2/r2/public/static/iphone/iRedditFree-thumb.png new file mode 100644 index 000000000..97f949259 Binary files /dev/null and b/r2/r2/public/static/iphone/iRedditFree-thumb.png differ diff --git a/r2/r2/public/static/iphone/index.html b/r2/r2/public/static/iphone/index.html index b848fc3ef..c943bcf9a 100644 --- a/r2/r2/public/static/iphone/index.html +++ b/r2/r2/public/static/iphone/index.html @@ -1,5 +1,6 @@ - - + + + - - - - - + +
@@ -183,24 +182,31 @@ h2 { The best of the web is in your hand.
And you can even shake it
- - + +
for a random, cool link.

- - +
+

-Buy the iReddit app for $1.99 and you'll never see an ad on it. -
-If you're more patient, we'll be releasing an ad-supported free version in the future. +Buy the iReddit app for just $.99 and you'll never see an ad on it. It comes with a ton of sound effects for your shaking pleasure and will let you aggregate up to 500 reddit subscriptions.

+ +
+ +
+

+Feeling hesitant? Try the free version of iReddit. You just get one sound effect, though it is cool, and you can aggregate only 100 of your reddit subscriptions. +

+ +
-

not convinced? watch the commercial

-
+

not convinced? watch the commercial

+
@@ -213,7 +219,7 @@ If you're more patient, we'll be releasing an ad-supported free version in the f

the feature list

-
    +
    • all the reddit sort options; view links by hotness, newness, top-score-ness, and controversy
    • baked-in browser means you can vote without leaving the page and easily jump to comments or move up/down the listings
    • commenting has never been easier, or sexier, on a mobile device
    • @@ -223,6 +229,11 @@ If you're more patient, we'll be releasing an ad-supported free version in the f
    • alien loading animation improves load time by 500% (that is, makes the waiting suck 5x less)
    • pro-tip: enable sounds in preferences and savor the awe of your peers
    +full-version only: +
      +
    • 7 different awesome sounds to choose from
    • +
    • aggregates up to 500 of your subscribed reddits (free version maxes out at 100)
    • +
@@ -230,21 +241,38 @@ If you're more patient, we'll be releasing an ad-supported free version in the f

-While in Serendipity mode, you will keep getting fed random stories to view/vote on every time you hit the "Hit me" button or shake the iPhone. Clicking "No More!!!" will take you back to regular mode. Much like UrbanSpoon, I could see this Serendipity mode becoming addicting. It's a bit like a completely random StumbleUpon (a website discovery tool), but again, using the iPhone's accelerometer. +I have been captivated by the updated iReddit. It's so much better than prev versions. +

+

+→ @simonpickles, on Twitter +

+
+ + +
+

+While in Serendipity mode, you will keep getting fed random stories to +view/vote on every time you hit the "Hit me" button or shake the +iPhone. Clicking "No More!!!" will take you back to regular mode. Much +like UrbanSpoon, I could see this Serendipity mode becoming addicting. It's a bit like a completely random StumbleUpon (a website discovery tool), but again, using the iPhone's accelerometer.

Such a feature seems perfect for a social voting site, where users are often looking for new and interesting stories.

-→ VentureBeat +→ VentureBeat

-Not only does iReddit has all your favorite Reddit functionality: view stories, vote, comment, share, explore different subreddits, and save links for later, it also lets you 'shake' to get a new story; an idea, Ohanian says, that has been "floating around ever since I saw the Urbanspoon app."

+Not only does iReddit has all your favorite Reddit functionality: +view stories, vote, comment, share, explore different subreddits, and +save links for later, it also lets you 'shake' to get a new story; an +idea, Ohanian says, that has been "floating around ever since I saw the +Urbanspoon app."

-→ ReadWriteWeb +→ ReadWriteWeb

@@ -254,7 +282,7 @@ Not only does iReddit has all your favorite Reddit function $1.99? I've spent more on worse on the iPhone. Sold.

-→ bvttf, on HackerNews +→ bvttf, on HackerNews

@@ -263,42 +291,54 @@ $1.99? I've spent more on worse on the iPhone. Sold. iphone reddit app. life = over.

-→ seeandyspin, on twitter +→ @seeandyspin, on twitter

-A particularly interesting feature is the Serendipity mode, which lets you you browse random Reddit stories without clicking; simply shake the iPhone and you'll be served a brand new link.

+iphone reddit app. life = over. +

-→ Mashable +→ @seeandyspin, on twitter +

+
+ + +
+

+A particularly interesting feature is the Serendipity mode, +which lets you you browse random Reddit stories without clicking; +simply shake the iPhone and you'll be served a brand new link.

+

+→ Mashable

- +
iReddit on the AppStore   |   iReddit Free on the AppStore
+
- + - + + - - + diff --git a/r2/r2/public/static/iphone/random.js b/r2/r2/public/static/iphone/random.js index 6c13064f4..12c74adc1 100644 --- a/r2/r2/public/static/iphone/random.js +++ b/r2/r2/public/static/iphone/random.js @@ -5,6 +5,10 @@ quoteList[5] = "(like a mystery present)"; quoteList[6] = "(like a monkey with a puzzle)"; quoteList[7] = "(like a tiny Etch-A-Sketch)"; quoteList[8] = "(like a British nanny)"; +quoteList[9] = "(with gusto!)"; +quoteList[10] = "(like you're trying to get the last crumbs from the Doritos bag)"; +quoteList[11] = "(instead of going to the gym)"; +quoteList[12] = "(like Shakira)"; //randomization var now = new Date(); var secs = now.getSeconds(); var raw_random_number = Math.random(secs); var random_number = Math.round(raw_random_number * (quoteList.length)); if (random_number == quoteList.length){random_number = 0} //set quote var quote = quoteList[random_number]; \ No newline at end of file