diff --git a/r2/r2/controllers/listingcontroller.py b/r2/r2/controllers/listingcontroller.py index a8adba1d6..ebe028eee 100644 --- a/r2/r2/controllers/listingcontroller.py +++ b/r2/r2/controllers/listingcontroller.py @@ -158,10 +158,6 @@ class ListingController(RedditController): w.render_class = PromotedLink w.rowstyle = 'promoted link' - elif c.user.pref_compress: - w.render_class = LinkCompressed - w.score_fmt = Score.points - return w def GET_listing(self, **env): diff --git a/r2/r2/models/link.py b/r2/r2/models/link.py index 865ac5135..7d7f50890 100644 --- a/r2/r2/models/link.py +++ b/r2/r2/models/link.py @@ -420,17 +420,6 @@ class PromotedLink(Link): # keep the template from trying to read it item.promoted_by = None -class LinkCompressed(Link): - _nodb = True - - @classmethod - def add_props(cls, user, wrapped): - Link.add_props(user, wrapped) - - for item in wrapped: - item.score_fmt = Score.points - - class Comment(Thing, Printable): _data_int_props = Thing._data_int_props + ('reported',) _defaults = dict(reported = 0, diff --git a/r2/r2/public/static/css/reddit.css b/r2/r2/public/static/css/reddit.css index b9f2caa05..661d7317e 100644 --- a/r2/r2/public/static/css/reddit.css +++ b/r2/r2/public/static/css/reddit.css @@ -493,10 +493,6 @@ before enabling */ color: #336699; } -.linkcompressed .media-button .option.active { - padding-right: 15px; -} - .embededmedia { margin-top: 5px; margin-left: 60px; } .thing .title { color: blue; padding: 0px; overflow: hidden; } @@ -557,12 +553,6 @@ before enabling */ margin-bottom: 0px; } -.organic-listing .linkcompressed { - background-color: #F8F8F8; - padding: 5px 7em 10px 0; - margin-bottom: 0px; - } - .organic-listing .nextprev { margin: 0px; position: absolute; @@ -733,6 +723,12 @@ a.star { text-decoration: none; color: #ff8b60 } text-align: right; } +.compressed { margin-bottom: 5px; } +.compressed .rank { margin-top: 10px; } +.compressed .title { margin: -2px 0 } +.compressed .score { color: #888888 } +.compressed .score-placeholder { height: 3px } + /* display the right score based on whether they've voted */ .score.likes, .score.dislikes {display: none;} .likes .score, .dislikes .score {display: none;} @@ -741,45 +737,6 @@ a.star { text-decoration: none; color: #ff8b60 } .likes div.score.likes {display: block;} .dislikes div.score.dislikes {display: block;} -/* compressed links */ -.linkcompressed { margin: 4px 0; overflow: hidden; margin-top: 9px; } -.linkcompressed .title {margin-bottom: 5px; font-size:medium; font-weight: normal;} -.linkcompressed .child h3 { - margin: 15px; - text-transform: none; - font-size: medium; -} - -.linkcompressed .score.likes { color: #FF8B60; } -.linkcompressed .score.dislikes { color: #9494FF; } -.linkcompressed .rank { - margin-top: 9px; - float:left; - color: #c6c6c6; - font-family: arial; - font-size: medium; - text-align: right; -} -.linkcompressed .arrow.down, .linkcompressed .arrow.downmod { - margin-top: 5px; -} - -.linkcompressed .tagline { display: inline; margin-top: 0px; margin-bottom: 1px; } -.linkcompressed .flat-list { display: inline } - -/* compressed buttons */ -.linkcompressed .entry .buttons li { padding: 2px; background-color: transparent; } -.linkcompressed .entry .buttons li.first {padding-left: .5em;} -.linkcompressed .entry .buttons li a { - padding: 0 2px; - background-color: #fdfdfd; - font-weight: bold -} - -.linkcompressed .midcol { width: 15px; } -.linkcompressed .entry .buttons li a:hover { text-decoration: underline} -.linkcompressed .expando-button {display: none} - .warm-entry .rank { color: #EDA179; } .hot-entry .rank { color: #E47234; } @@ -2148,8 +2105,7 @@ ul.tabmenu.formtab { /******** self text stuff ****/ -.link .usertext .md, -.linkcompressed .usertext .md { +.link .usertext .md { padding: 0 5px; background-color: #fafafa; border: 1px solid #369; diff --git a/r2/r2/public/static/js/reddit.js b/r2/r2/public/static/js/reddit.js index ceea205a0..89d8f147d 100644 --- a/r2/r2/public/static/js/reddit.js +++ b/r2/r2/public/static/js/reddit.js @@ -471,7 +471,7 @@ function updateEventHandlers(thing) { .filter(":visible").trigger("onshow"); /* click on a title.. */ - $(thing).filter(".link, .linkcompressed") + $(thing).filter(".link") .find("a.title, a.comments").mousedown(function() { /* the site is either stored in the sr dict, or we are on * an sr and it is the current one */ diff --git a/r2/r2/templates/link.html b/r2/r2/templates/link.html index ee8a123c9..6db73f359 100644 --- a/r2/r2/templates/link.html +++ b/r2/r2/templates/link.html @@ -131,10 +131,16 @@ %def> <%def name="midcol(display=True, cls = '')"> + %if c.user.pref_compress: +