This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Messaging/commenting

===
 - add confidence sorting to comments
   * common values are precomputed for speedier response
   * best is made the default sort on comment pages
 - messages will now be delivered once one is moderator/contributor/banned
 - UI updates to messaging page, including added show parent functionality to messages
 - Remove the rate-limit on comments on your own self-posts
 - Give users some leeway in editing their comments: don't show an edit star if the edit is within the first few minutes of a comment's lifetime
 - Office Assistant will help users when they write to admins

Backend
===
 - Replace the postgres-based query_queue with an AMQP based one
   * Set up amqp queues for async tasks such as search updates and the scrapers
   * service monitor updates, adding queue-tracking support
 - Allow find_recent_broken_things to specify both from_time and to_time
 - add a ini file parameter to disallow db writes (to create read-only reddit instances for crawlers)

New features
===
 - self-serve advertisement:
   * complete overhaul of sponsored link code
   * functions for talking with authorize.net
   * added pay domain and https support
   * added ability to share traffic from sponsored links
   * auto-reject promotions that are too old and unpaid for
 - awards
 - allow widget to have its links to have a target (in case it is iframed)
 - automatic_reddits:
   * Don't show automatic_reddits in the horizontal topbar
 - Listing numbers are always in order with no gaps
 - add support for sprites for common (r2.lib.contrib.nymph)

Admin
===
 - added a takedown page for dealing with DMCA requests properly
   * status code 404 on takedown pages
   * JSON returns same string as in the explanation text
   * nofollow on markdown in explanation
   * title and image optional
 - Added /c/(comment_id) for admins
 - updates to JS to rate-limit voting, commenting, and anything else that could be just as easily done by a script-kiddie to cheat.
 - make ad frame dynamic and add tracking pixel
 - add the ability to add a sponsored banner to the rightbox of a reddit
 - add the ability to show custom css on cnamed and/or non-cnamed versions of a reddit
 - allow us to ignore reports from report-spammers.

Bugfixes
===
 - Fix sorting of duplicate links (patch by Chromakode)
 - fix traffic bug on main traffic page when it is the first of the month.
 - toolbar redirects to comments page on self posts rather than generating the frame
 - half-assed unicode handling in menus giving us bugs again.  Switched to the whole-ass approach
 - added Thing._byID36
 - Support /help/foo/bar
  • Loading branch information...
KeyserSosa committed Dec 1, 2009
1 parent 1f1f060 commit bf9f43ccacc4ee7933629c621f97d6ff0ddd11b8
Showing with 17,248 additions and 3,174 deletions.
  1. +11 −7 r2/Makefile
  2. +87 −0 r2/draw_load.py
  3. +34 −3 r2/example.ini
  4. +5 −1 r2/r2/config/middleware.py
  5. +31 −4 r2/r2/config/routing.py
  6. +2 −0 r2/r2/config/templates.py
  7. +2 −0 r2/r2/controllers/__init__.py
  8. +243 −206 r2/r2/controllers/api.py
  9. +54 −0 r2/r2/controllers/awards.py
  10. +7 −3 r2/r2/controllers/embed.py
  11. +6 −1 r2/r2/controllers/error.py
  12. +10 −2 r2/r2/controllers/errors.py
  13. +11 −5 r2/r2/controllers/feedback.py
  14. +85 −20 r2/r2/controllers/front.py
  15. +52 −0 r2/r2/controllers/health.py
  16. +27 −8 r2/r2/controllers/listingcontroller.py
  17. +10 −3 r2/r2/controllers/post.py
  18. +393 −27 r2/r2/controllers/promotecontroller.py
  19. +28 −3 r2/r2/controllers/reddit_base.py
  20. +3 −1 r2/r2/controllers/toolbar.py
  21. +347 −39 r2/r2/controllers/validator/validator.py
  22. +777 −693 r2/r2/i18n/r2.pot
  23. +211 −0 r2/r2/lib/amqp.py
  24. +35 −7 r2/r2/lib/app_globals.py
  25. +22 −0 r2/r2/lib/authorize/__init__.py
  26. +589 −0 r2/r2/lib/authorize/api.py
  27. +176 −0 r2/r2/lib/authorize/interaction.py
  28. +2 −0 r2/r2/lib/base.py
  29. +93 −0 r2/r2/lib/contrib/nymph.py
  30. +7 −6 r2/r2/lib/cssfilter.py
  31. +45 −18 r2/r2/lib/db/queries.py
  32. +41 −107 r2/r2/lib/db/query_queue.py
  33. +26 −1 r2/r2/lib/db/sorts.py
  34. +9 −5 r2/r2/lib/db/tdb_sql.py
  35. +22 −2 r2/r2/lib/db/thing.py
  36. +118 −82 r2/r2/lib/emailer.py
  37. +0 −1 r2/r2/lib/filters.py
  38. +5 −3 r2/r2/lib/jsonresponse.py
  39. +19 −4 r2/r2/lib/jsontemplates.py
  40. +43 −54 r2/r2/lib/media.py
  41. +32 −15 r2/r2/lib/menus.py
  42. +102 −0 r2/r2/lib/migrate.py
  43. +1 −1 r2/r2/lib/normalized_hot.py
  44. +12 −27 r2/r2/lib/organic.py
  45. +4 −1 r2/r2/lib/pages/admin_pages.py
  46. +4 −4 r2/r2/lib/pages/graph.py
  47. +597 −148 r2/r2/lib/pages/pages.py
  48. +23 −5 r2/r2/lib/pages/things.py
  49. +445 −64 r2/r2/lib/promote.py
  50. +52 −17 r2/r2/lib/services.py
  51. +48 −45 r2/r2/lib/solrsearch.py
  52. +1 −1 r2/r2/lib/spreadshirt.py
  53. +22 −7 r2/r2/lib/strings.py
  54. +59 −29 r2/r2/lib/template_helpers.py
  55. +12 −2 r2/r2/lib/tracking.py
  56. +9 −1 r2/r2/lib/traffic.py
  57. +5 −5 r2/r2/lib/translation.py
  58. +0 −72 r2/r2/lib/user_stats.py
  59. +80 −25 r2/r2/lib/utils/utils.py
  60. +14 −3 r2/r2/lib/workqueue.py
  61. +2 −3 r2/r2/lib/wrapped.py
  62. +2 −0 r2/r2/models/__init__.py
  63. +56 −5 r2/r2/models/account.py
  64. +48 −5 r2/r2/models/admintools.py
  65. +106 −0 r2/r2/models/award.py
  66. +442 −0 r2/r2/models/bidding.py
  67. +19 −44 r2/r2/models/builder.py
  68. +96 −45 r2/r2/models/link.py
  69. +52 −15 r2/r2/models/mail_queue.py
  70. +0 −4 r2/r2/models/populatedb.py
  71. +1 −1 r2/r2/models/printable.py
  72. +41 −14 r2/r2/models/subreddit.py
  73. +5 −80 r2/r2/models/thing_changes.py
  74. +4 −4 r2/r2/models/vote.py
  75. BIN r2/r2/public/static/alien-clippy.png
  76. BIN r2/r2/public/static/award.png
  77. BIN r2/r2/public/static/bg-button-add.png
  78. BIN r2/r2/public/static/bg-button-remove.png
  79. BIN r2/r2/public/static/cclogo.png
  80. BIN r2/r2/public/static/clippy-bullet.png
  81. +20 −0 r2/r2/public/static/css/reddit-ie6-hax.css
  82. +8 −0 r2/r2/public/static/css/reddit-ie7-hax.css
  83. +1,042 −258 r2/r2/public/static/css/reddit.css
  84. +10 −6 r2/r2/public/static/css/spreadshirt.css
  85. BIN r2/r2/public/static/dragonage/bgfinal.jpg
  86. BIN r2/r2/public/static/dragonage/topb.jpg
  87. BIN r2/r2/public/static/gagged-alien.png
  88. BIN r2/r2/public/static/gradient-button-hover.png
  89. BIN r2/r2/public/static/gradient-button.png
  90. BIN r2/r2/public/static/gradient-nub-hover.png
  91. BIN r2/r2/public/static/gradient-nub.png
  92. +4,241 −0 r2/r2/public/static/js/jquery-1.3.1.js
  93. +19 −0 r2/r2/public/static/js/jquery-1.3.1.min.js
  94. +1 −1 r2/r2/public/static/js/jquery.js
  95. +34 −2 r2/r2/public/static/js/jquery.reddit.js
  96. +77 −11 r2/r2/public/static/js/reddit.js
  97. +64 −0 r2/r2/public/static/js/sponsored.js
  98. +519 −0 r2/r2/public/static/js/ui.core.js
  99. +1,630 −0 r2/r2/public/static/js/ui.datepicker.js
  100. BIN r2/r2/public/static/reddit_ban.png
  101. BIN r2/r2/public/static/reddit_edit.png
  102. BIN r2/r2/public/static/reddit_reported.png
  103. BIN r2/r2/public/static/reddit_spam.png
  104. BIN r2/r2/public/static/reddit_traffic.png
  105. BIN r2/r2/public/static/redditaddict/appsbar/barbg.png
  106. BIN r2/r2/public/static/redditaddict/appsbar/buttonbg.png
  107. BIN r2/r2/public/static/redditaddict/appsbar/nub.png
  108. BIN r2/r2/public/static/redditaddict/badge/AIRInstallBadge.swf
  109. BIN r2/r2/public/static/redditaddict/badge/badgeimage.jpg
  110. BIN r2/r2/public/static/redditaddict/badge/expressinstall.swf
  111. +8 −0 r2/r2/public/static/redditaddict/badge/swfobject.js
  112. BIN r2/r2/public/static/redditaddict/images/arrows.png
  113. BIN r2/r2/public/static/redditaddict/images/bg.png
  114. BIN r2/r2/public/static/redditaddict/images/black50.png
  115. BIN r2/r2/public/static/redditaddict/images/c-caps.png
  116. BIN r2/r2/public/static/redditaddict/images/c-tile.png
  117. BIN r2/r2/public/static/redditaddict/images/close.png
  118. BIN r2/r2/public/static/redditaddict/images/reddit-head.png
  119. BIN r2/r2/public/static/redditaddict/images/ss-graph.jpg
  120. BIN r2/r2/public/static/redditaddict/images/ss-main.jpg
  121. BIN r2/r2/public/static/redditaddict/images/star-blue.png
  122. BIN r2/r2/public/static/redditaddict/images/star-orangered.png
  123. BIN r2/r2/public/static/redditaddict/images/star-white.png
  124. BIN r2/r2/public/static/redditaddict/images/support.png
  125. BIN r2/r2/public/static/redditaddict/images/thumbsup3.png
  126. BIN r2/r2/public/static/redditaddict/images/w-bot.png
  127. BIN r2/r2/public/static/redditaddict/images/w-mid.png
  128. BIN r2/r2/public/static/redditaddict/images/w-top.png
  129. +533 −0 r2/r2/public/static/redditaddict/index.html
  130. BIN r2/r2/public/static/socialite/appsbar/barbg.png
  131. BIN r2/r2/public/static/socialite/appsbar/buttonbg.png
  132. BIN r2/r2/public/static/socialite/appsbar/nub.png
  133. +329 −113 r2/r2/public/static/socialite/index.html
  134. BIN r2/r2/public/static/socialite/socialitelogo.png
  135. +84 −0 r2/r2/templates/adminawardgive.html
  136. +96 −0 r2/r2/templates/adminawards.html
  137. +35 −34 r2/r2/templates/{userstats.html → adminawardwinners.html}
  138. +1 −1 r2/r2/templates/admintranslations.html
  139. +27 −7 r2/r2/templates/ads.html
  140. +32 −3 r2/r2/templates/appservicemonitor.html
  141. +15 −3 r2/r2/templates/base.htmllite
  142. +1 −5 r2/r2/templates/clickgadget.html
  143. +5 −2 r2/r2/templates/comment.html
  144. +6 −2 r2/r2/templates/comment.htmllite
  145. +6 −2 r2/r2/templates/comment.mobile
  146. +252 −178 r2/r2/templates/createsubreddit.html
  147. +51 −0 r2/r2/templates/dart_ad.html
  148. +2 −1 r2/r2/templates/link.html
  149. +20 −3 r2/r2/templates/link.htmllite
  150. +5 −1 r2/r2/templates/link.mobile
  151. +1 −1 r2/r2/templates/link.wired
  152. +35 −14 r2/r2/templates/linkinfobar.html
  153. +11 −16 r2/r2/templates/linkpromoteinfobar.html
  154. +15 −2 r2/r2/templates/message.html
  155. +78 −6 r2/r2/templates/messagecompose.html
  156. +2 −1 r2/r2/templates/morechildren.html
  157. +209 −0 r2/r2/templates/paymentform.html
  158. +5 −0 r2/r2/templates/prefoptions.html
  159. +33 −4 r2/r2/templates/prefupdate.html
  160. +1 −52 r2/r2/templates/printable.html
  161. +67 −8 r2/r2/templates/printablebuttons.html
  162. +79 −61 r2/r2/templates/profilebar.html
  163. +118 −0 r2/r2/templates/promo_email.email
  164. +276 −0 r2/r2/templates/promote_graph.html
  165. +49 −24 r2/r2/templates/promotedlink.html
  166. +0 −83 r2/r2/templates/promotedlinks.html
  167. +44 −14 r2/r2/templates/promotedtraffic.html
  168. +368 −95 r2/r2/templates/promotelinkform.html
  169. +14 −14 r2/r2/templates/reddit.html
  170. +1 −1 r2/r2/templates/redditfooter.html
  171. +6 −0 r2/r2/templates/redditheader.html
  172. +2 −2 r2/r2/templates/reddittraffic.html
  173. +35 −0 r2/r2/templates/selfserveblurb.html
  174. +3 −2 r2/r2/templates/share.email
  175. +11 −0 r2/r2/templates/shirtpane.html
  176. +7 −1 r2/r2/templates/sidebox.html
  177. +35 −0 r2/r2/templates/sidecontentbox.html
  178. +41 −0 r2/r2/templates/sponsorshipbox.html
  179. +4 −4 r2/r2/templates/subreddit.html
  180. +65 −60 r2/r2/templates/subredditinfobar.html
  181. +9 −15 r2/r2/templates/subredditstylesheet.html
  182. +0 −1 r2/r2/templates/subscriptionbox.html
  183. +35 −0 r2/r2/templates/takedownpane.html
  184. +3 −3 r2/r2/templates/translatedstring.html
  185. +85 −0 r2/r2/templates/trophycase.html
  186. +2 −1 r2/r2/templates/uploadedimage.html
  187. +62 −0 r2/r2/templates/userawards.html
  188. +19 −12 r2/r2/templates/userlist.html
  189. +1 −1 r2/r2/templates/usertableitem.html
  190. +5 −5 r2/r2/templates/usertext.html
  191. +44 −25 r2/r2/templates/utils.html
  192. +31 −0 r2/r2/templates/verifyemail.email
  193. +66 −0 r2/r2/templates/wrappeduser.html
  194. +10 −1 r2/setup.py
  195. +4 −4 r2/supervise_watcher.py
View
@@ -21,11 +21,14 @@
################################################################################
# Jacascript files to be compressified
-js_targets = jquery.js jquery.json.js jquery.reddit.js reddit.js
+js_targets = jquery.js jquery.json.js jquery.reddit.js reddit.js ui.core.js ui.datepicker.js sponsored.js
# CSS targets
-css_targets = reddit.css reddit-ie6-hax.css reddit-ie7-hax.css mobile.css spreadshirt.css
+main_css = reddit.css
+css_targets = reddit-ie6-hax.css reddit-ie7-hax.css mobile.css spreadshirt.css
SED=sed
+CAT=cat
+CSS_COMPRESS = $(SED) -e 's/ \+/ /' -e 's/\/\*.*\*\///g' -e 's/: /:/' | grep -v "^ *$$"
package = r2
static_dir = $(package)/public/static
@@ -41,7 +44,8 @@ PRIVATEREPOS = $(shell python -c 'exec "try: import r2admin; print r2admin.__pat
JSTARGETS := $(foreach js, $(js_targets), $(static_dir)/$(js))
CSSTARGETS := $(foreach css, $(css_targets), $(static_dir)/$(css))
-RTLCSS = $(CSSTARGETS:.css=-rtl.css)
+MAINCSS := $(foreach css, $(main_css), $(static_dir)/$(css))
+RTLCSS = $(CSSTARGETS:.css=-rtl.css) $(MAINCSS:.css=-rtl.css)
MD5S = $(JSTARGETS:=.md5) $(CSSTARGETS:=.md5)
@@ -67,10 +71,10 @@ $(JSTARGETS): $(static_dir)/%.js : $(static_dir)/js/%.js
$(JSCOMPRESS) < $< > $@
$(CSSTARGETS): $(static_dir)/%.css : $(static_dir)/css/%.css
- $(SED) -e 's/ \+/ /' \
- -e 's/\/\*.*\*\///g' \
- -e 's/: /:/' \
- $< | grep -v "^ *$$" > $@
+ $(CAT) $< | $(CSS_COMPRESS) > $@
+
+$(MAINCSS): $(static_dir)/%.css : $(static_dir)/css/%.css
+ python r2/lib/contrib/nymph.py $< | $(CSS_COMPRESS) > $@
$(RTLCSS): %-rtl.css : %.css
$(SED) -e "s/left/>####</g" \
View
@@ -0,0 +1,87 @@
+from __future__ import with_statement
+import Image, ImageDraw
+
+colors = [
+ "#FFFFFF", "#f0f5FF",
+ "#E2ECFF", "#d6f5cb",
+ "#CAFF98", "#e4f484",
+ "#FFEA71", "#ffdb81",
+ "#FF9191", "#FF0000"]
+
+def get_load_level(host, nlevels = 8):
+ # default number of cpus shall be 1
+ ncpus = getattr(host, "ncpu", 1)
+ # color code in nlevel levels
+ return _load_int(host.load(), ncpus, nlevels = 8)
+
+def _load_int(current, max_val, nlevels = 8):
+ i = min(max(int(nlevels*current/max_val+0.4), 0),nlevels+1)
+ return colors[i]
+
+def draw_load(row_size = 12, width = 200, out_file = "/tmp/load.png"):
+ from r2.lib import services
+
+ a = services.AppServiceMonitor()
+ hosts = list(a)
+
+ number = (len([x for x in hosts if x.services]) +
+ len([x for x in hosts if x.database]) +
+ sum(len(x.queue.queues) for x in hosts if x.queue)) + 3
+
+ im = Image.new("RGB", (width, number * row_size + 2))
+ draw = ImageDraw.Draw(im)
+ def draw_box(label, color, center = False):
+ ypos = draw_box.ypos
+ xpos = 1
+ if center:
+ w, h = draw.textsize(label)
+ xpos = (width - w) / 2
+ draw.rectangle(((1, ypos), (width-2, ypos + row_size)), color)
+ draw.text((xpos,ypos+1), label, fill = "#000000")
+ draw_box.ypos += row_size
+ draw_box.ypos = 0
+
+ draw_box(" ==== DATABASES ==== ", "#BBBBBB", center = True)
+ for host in hosts:
+ if host.database:
+ draw_box(" %s load: %s" % (host.host, host.load()),
+ get_load_level(host))
+
+ draw_box(" ==== SERVICES ==== ", "#BBBBBB", center = True)
+ for host in hosts:
+ if host.services:
+ draw_box(" %s load: %s" % (host.host, host.load()),
+ get_load_level(host))
+
+ draw_box(" ==== QUEUES ==== ", "#BBBBBB", center = True)
+ for host in hosts:
+ if host.queue:
+ for name, data in host.queue:
+ max_len = host.queue.max_length(name)
+ draw_box(" %16s: %5s / %5s" % (name, data(), max_len),
+ _load_int(data(), max_len))
+
+ with open(out_file, 'w') as handle:
+ im.save(handle, "PNG")
+
+
+def merge_images(out_file, file_names):
+ images = []
+ width = 0
+ height = 0
+ for f in file_names:
+ images.append(Image.open(f))
+ w, h = images[-1].size
+ width = max(w, width)
+ height += h
+
+ total = Image.new("RGB", (width, height))
+ height = 0
+ for im in images:
+ total.paste(im, (0, height))
+ w, h = im.size
+ height += h
+
+ with open(out_file, 'w') as handle:
+ total.save(out_file)
+
View
@@ -18,12 +18,33 @@ memcaches = 127.0.0.1:11211
permacaches = 127.0.0.1:11211
rendercaches = 127.0.0.1:11211
rec_cache = 127.0.0.1:11311
+
+# site tracking urls. All urls are assumed to be to an image unless
+# otherwise noted:
tracker_url =
adtracker_url =
+adframetracker_url =
+# for tracking clicks. Should be the url of a redirector
clicktracker_url =
traffic_url =
-databases = main, comment, vote, change, email, query_queue
+# for sponsored links:
+payment_domain = https://pay.localhost/
+authorizenetname =
+authorizenetkey =
+authorizenetapi =
+min_promote_bid = 20
+max_promote_bid = 9999
+min_promote_future = 2
+
+
+
+amqp_host = localhost:5672
+amqp_user = guest
+amqp_pass = guest
+amqp_virtual_host = /
+
+databases = main, comment, vote, change, email, authorize, award
#db name db host user, pass
main_db = newreddit, 127.0.0.1, ri, password
@@ -32,7 +53,8 @@ comment2_db = newreddit, 127.0.0.1, ri, password
vote_db = newreddit, 127.0.0.1, ri, password
change_db = changed, 127.0.0.1, ri, password
email_db = email, 127.0.0.1, ri, password
-query_queue_db = query_queue, 127.0.0.1, ri, password
+authorize_db = authorize, 127.0.0.1, ri, password
+award_db = award, 127.0.0.1, ri, password
db_app_name = reddit
db_create_tables = True
@@ -65,6 +87,10 @@ db_table_report_account_comment = relation, account, comment, comment
db_table_report_account_message = relation, account, message, main
db_table_report_account_subreddit = relation, account, subreddit, main
+db_table_award = thing, award
+db_table_trophy = relation, account, award, award
+
+disallow_db_writes = False
###
# Other magic settings
@@ -88,16 +114,22 @@ allowed_css_linked_domains = my.domain.com, my.otherdomain.com
css_killswitch = False
max_sr_images = 20
+show_awards = False
+
login_cookie = reddit_session
domain = localhost
domain_prefix =
media_domain = localhost
default_sr = localhost
+automatic_reddits =
+
admins =
sponsors =
+paid_sponsors =
page_cache_time = 30
static_path = /static/
useragent = Mozilla/5.0 (compatible; bot/1.0; ChangeMe)
+allow_shutdown = False
solr_url =
solr_cache_time = 300
@@ -124,7 +156,6 @@ MODWINDOW = 2
HOT_PAGE_AGE = 1
#
-media_period = 10 minutes
rising_period = 12 hours
new_incubation = 90 seconds
@@ -60,6 +60,8 @@ def error_mapper(code, message, environ, global_conf=None, **kw):
d['cnameframe'] = 1
if environ.get('REDDIT_NAME'):
d['srname'] = environ.get('REDDIT_NAME')
+ if environ.get('REDDIT_TAKEDOWN'):
+ d['takedown'] = environ.get('REDDIT_TAKEDOWN')
#preserve x-sup-id when 304ing
if code == 304:
@@ -288,7 +290,7 @@ def __call__(self, environ, start_response):
sr_redirect = None
for sd in list(sub_domains):
# subdomains to disregard completely
- if sd in ('www', 'origin', 'beta'):
+ if sd in ('www', 'origin', 'beta', 'pay'):
continue
# subdomains which change the extension
elif sd == 'm':
@@ -297,6 +299,7 @@ def __call__(self, environ, start_response):
environ['reddit-domain-extension'] = sd
elif (len(sd) == 2 or (len(sd) == 5 and sd[2] == '-')) and self.lang_re.match(sd):
environ['reddit-prefer-lang'] = sd
+ environ['reddit-domain-prefix'] = sd
else:
sr_redirect = sd
sub_domains.remove(sd)
@@ -357,6 +360,7 @@ class ExtensionMiddleware(object):
'mobile' : ('mobile', 'text/html; charset=UTF-8'),
'png' : ('png', 'image/png'),
'css' : ('css', 'text/css'),
+ 'csv' : ('csv', 'text/csv; charset=UTF-8'),
'api' : (api_type(), 'application/json; charset=UTF-8'),
'json' : (api_type(), 'application/json; charset=UTF-8'),
'json-html' : (api_type('html'), 'application/json; charset=UTF-8')}
View
@@ -34,6 +34,7 @@ def make_map(global_conf={}, app_conf={}):
mc('/login', controller='front', action='login')
mc('/logout', controller='front', action='logout')
+ mc('/verify', controller='front', action='verify')
mc('/adminon', controller='front', action='adminon')
mc('/adminoff', controller='front', action='adminoff')
mc('/submit', controller='front', action='submit')
@@ -51,6 +52,7 @@ def make_map(global_conf={}, app_conf={}):
mc('/reddits/create', controller='front', action='newreddit')
mc('/reddits/search', controller='front', action='search_reddits')
+ mc('/reddits/login', controller='front', action='login')
mc('/reddits/:where', controller='reddits', action='listing',
where = 'popular',
requirements=dict(where="popular|new|banned"))
@@ -69,8 +71,9 @@ def make_map(global_conf={}, app_conf={}):
mc('/widget', controller='buttons', action='widget_demo_page')
mc('/bookmarklets', controller='buttons', action='bookmarklets')
- mc('/stats', controller='front', action='stats')
+ mc('/awards', controller='front', action='awards')
+ mc('/i18n', controller='feedback', action='i18n')
mc('/feedback', controller='feedback', action='feedback')
mc('/ad_inq', controller='feedback', action='ad_inq')
@@ -79,6 +82,10 @@ def make_map(global_conf={}, app_conf={}):
mc('/admin/i18n/:action', controller='i18n')
mc('/admin/i18n/:action/:lang', controller='i18n')
+ mc('/admin/awards', controller='awards')
+ mc('/admin/awards/:awardcn/:action', controller='awards',
+ requirements=dict(action="give|winners"))
+
mc('/admin/:action', controller='admin')
mc('/user/:username/about', controller='user', action='about',
@@ -115,8 +122,20 @@ def make_map(global_conf={}, app_conf={}):
mc('/framebuster/:what/:blah',
controller='front', action = 'framebuster')
- mc('/promote/edit_promo/:link', controller='promote', action = 'edit_promo')
- mc('/promote/:action', controller='promote')
+ mc('/promoted/edit_promo/:link',
+ controller='promote', action = 'edit_promo')
+ mc('/promoted/pay/:link',
+ controller='promote', action = 'pay')
+ mc('/promoted/graph',
+ controller='promote', action = 'graph')
+ mc('/promoted/:action', controller='promote',
+ requirements = dict(action = "new_promo"))
+ mc('/promoted/:sort', controller='promote', action = "listing")
+ mc('/promoted/', controller='promoted', action = "listing",
+ sort = "")
+
+ mc('/health', controller='health', action='health')
+ mc('/shutdown', controller='health', action='shutdown')
mc('/', controller='hot', action='listing')
@@ -137,21 +156,25 @@ def make_map(global_conf={}, app_conf={}):
requirements=dict(action="password|random|framebuster"))
mc('/:action', controller='embed',
requirements=dict(action="help|blog"))
- mc('/help/:anything', controller='embed', action='help')
+ mc('/help/*anything', controller='embed', action='help')
mc('/goto', controller='toolbar', action='goto')
mc('/tb/:id', controller='toolbar', action='tb')
mc('/toolbar/:action', controller='toolbar',
requirements=dict(action="toolbar|inner|login"))
mc('/toolbar/comments/:id', controller='toolbar', action='comments')
+ mc('/c/:comment_id', controller='front', action='comment_by_id')
+
mc('/s/*rest', controller='toolbar', action='s')
# additional toolbar-related rules just above the catchall
mc('/d/:what', controller='api', action='bookmarklet')
mc('/resetpassword/:key', controller='front',
action='resetpassword')
+ mc('/verification/:key', controller='front',
+ action='verify_email')
mc('/resetpassword', controller='front',
action='resetpassword')
@@ -165,6 +188,8 @@ def make_map(global_conf={}, app_conf={}):
requirements=dict(action="login|register"))
mc('/api/gadget/click/:ids', controller = 'api', action='gadget', type='click')
mc('/api/gadget/:type', controller = 'api', action='gadget')
+ mc('/api/:action', controller='promote',
+ requirements=dict(action="promote|unpromote|new_promo|link_thumb|freebie|promote_note|update_pay|refund|traffic_viewer|rm_traffic_viewer"))
mc('/api/:action', controller='api')
mc('/captcha/:iden', controller='captcha', action='captchaimg')
@@ -184,6 +209,8 @@ def make_map(global_conf={}, app_conf={}):
mc('/authorize_embed', controller = 'front', action = 'authorize_embed')
+ mc("/ads/", controller = "front", action = "ad")
+ mc("/ads/:reddit", controller = "front", action = "ad")
# This route handles displaying the error page and
# graphics used in the 404/500
# error pages. It should likely stay at the top
@@ -33,6 +33,7 @@ def api(type, cls):
# class specific overrides
api('link', LinkJsonTemplate)
+api('promotedlink', PromotedLinkJsonTemplate)
api('comment', CommentJsonTemplate)
api('message', MessageJsonTemplate)
api('subreddit', SubredditJsonTemplate)
@@ -46,3 +47,4 @@ def api(type, cls):
api('organiclisting', OrganicListingJsonTemplate)
api('reddittraffic', TrafficJsonTemplate)
+api('takedownpane', TakedownJsonTemplate)
@@ -37,13 +37,15 @@
from feedback import FeedbackController
from front import FrontController
+from health import HealthController
from buttons import ButtonsController
from captcha import CaptchaController
from embed import EmbedController
from error import ErrorController
from post import PostController
from toolbar import ToolbarController
from i18n import I18nController
+from awards import AwardsController
from promotecontroller import PromoteController
from mediaembed import MediaembedController
Oops, something went wrong.

0 comments on commit bf9f43c

Please sign in to comment.