diff --git a/r2/Makefile b/r2/Makefile index 4e1d96842..885431292 100644 --- a/r2/Makefile +++ b/r2/Makefile @@ -23,7 +23,7 @@ # Jacascript files to be compressified js_targets = jquery.js jquery.json.js jquery.reddit.js reddit.js # CSS targets -css_targets = reddit.css reddit-ie6-hax.css reddit-ie7-hax.css mobile.css +css_targets = reddit.css reddit-ie6-hax.css reddit-ie7-hax.css mobile.css spreadshirt.css SED=sed diff --git a/r2/example.ini b/r2/example.ini index 891ac7848..d891edf16 100644 --- a/r2/example.ini +++ b/r2/example.ini @@ -144,6 +144,13 @@ agents = feedback_email = abuse@localhost +# t-shirt stuff +spreadshirt_url = +spreadshirt_vendor_id = +spreadshirt_min_font = 42 +spreadshirt_max_width = 620 +spreadshirt_test_font = + [server:main] use = egg:Paste#http diff --git a/r2/r2/config/routing.py b/r2/r2/config/routing.py index 715bd55e4..beb92f9b7 100644 --- a/r2/r2/config/routing.py +++ b/r2/r2/config/routing.py @@ -99,6 +99,8 @@ def make_map(global_conf={}, app_conf={}): action = 'details', title=None) mc('/traffic/:article/:title', controller='front', action = 'traffic', title=None) + mc('/shirt/:article/:title', controller='front', + action = 'shirt', title=None) mc('/comments/:article/:title/:comment', controller='front', action = 'comments', title=None, comment = None) mc('/duplicates/:article/:title', controller = 'front', diff --git a/r2/r2/controllers/api.py b/r2/r2/controllers/api.py index 8e8eaf856..8595509eb 100644 --- a/r2/r2/controllers/api.py +++ b/r2/r2/controllers/api.py @@ -32,12 +32,12 @@ import r2.models.thing_changes as tc from r2.lib.utils import get_title, sanitize_url, timeuntil, set_last_modified from r2.lib.utils import query_string, to36, timefromnow, link_from_url -from r2.lib.wrapped import Wrapped from r2.lib.pages import FriendList, ContributorList, ModList, \ BannedList, BoringPage, FormPage, NewLink, CssError, UploadedImage, \ ClickGadget from r2.lib.pages.things import wrap_links, default_thing_wrapper +from r2.lib import spreadshirt from r2.lib.menus import CommentSortMenu from r2.lib.normalized_hot import expire_hot from r2.lib.captcha import get_iden @@ -1460,3 +1460,19 @@ class ApiController(RedditController): wrapped = wrap_links(link) wrapped = list(wrapped)[0] return spaceCompress(websafe(wrapped.link_child.content())) + + @validatedForm(link = VByName('name', thing_cls = Link, multiple = False), + color = VOneOf('color', spreadshirt.ShirtPane.colors), + style = VOneOf('style', spreadshirt.ShirtPane.styles), + size = VOneOf("size", spreadshirt.ShirtPane.sizes), + quantity = VInt("quantity", min = 1)) + def POST_shirt(self, form, jquery, link, color, style, size, quantity): + if not g.spreadshirt_url: + return self.abort404() + else: + res = spreadshirt.shirt_request(link, color, style, size, quantity) + if res: + form.set_html(".status", _("redirecting...")) + jquery.redirect(res) + else: + form.set_html(".status", _("error (sorry)")) diff --git a/r2/r2/controllers/front.py b/r2/r2/controllers/front.py index 397944c7e..a2fbbc2d1 100644 --- a/r2/r2/controllers/front.py +++ b/r2/r2/controllers/front.py @@ -131,6 +131,13 @@ class FrontController(RedditController): return DetailsPage(link = article).render() + @validate(article = VLink('article')) + def GET_shirt(self, article): + if g.spreadshirt_url: + from r2.lib.spreadshirt import ShirtPage + return ShirtPage(link = article).render() + return self.abort404() + @validate(article = VLink('article'), comment = VCommentID('comment'), context = VInt('context', min = 0, max = 8), diff --git a/r2/r2/lib/menus.py b/r2/r2/lib/menus.py index 98fe4d2be..06408bfbb 100644 --- a/r2/r2/lib/menus.py +++ b/r2/r2/lib/menus.py @@ -118,6 +118,7 @@ menu = MenuHandler(hot = _('hot'), related = _("related"), details = _("details"), duplicates = _("other discussions (%(num)s)"), + shirt = _("shirt"), traffic = _("traffic"), # reddits diff --git a/r2/r2/lib/pages/pages.py b/r2/r2/lib/pages/pages.py index ec04a6758..78d30243f 100644 --- a/r2/r2/lib/pages/pages.py +++ b/r2/r2/lib/pages/pages.py @@ -88,6 +88,7 @@ class Reddit(Templated): enable_login_cover = True site_tracking = True show_firsttext = True + additional_css = None def __init__(self, space_compress = True, nav_menus = None, loginbox = True, infotext = '', content = None, title = '', robots = None, @@ -624,6 +625,9 @@ class LinkInfoPage(Reddit): if c.user_is_sponsor: if self.link.promoted is not None: buttons += [info_button('traffic')] + if len(self.link.title) < 200 and g.spreadshirt_url: + buttons += [info_button('shirt')] + toolbar = [NavMenu(buttons, base_path = "", type="tabmenu")] diff --git a/r2/r2/lib/spreadshirt.py b/r2/r2/lib/spreadshirt.py new file mode 100644 index 000000000..2687dfa4c --- /dev/null +++ b/r2/r2/lib/spreadshirt.py @@ -0,0 +1,145 @@ +from pylons import g, c +import sha, base64, time, re, urllib, socket +import ImageFont +from r2.lib.wrapped import Templated +from r2.lib.pages import LinkInfoPage +from r2.models import * +from httplib import HTTPConnection +from urlparse import urlparse +from BeautifulSoup import BeautifulStoneSoup + +colors = (("black",2), ("white", 1), ("navy",4), ("heather",231), ("red",5)) +sizes = (("small",2), ("medium",3), ("large",4), ("xlarge", 5), ("xxlarge",6)) + +articles = {"women": + dict(black = 4604645, + heather = 4604654, + navy = 4737035, + red = 4604670, + white = 4604694, + ), + "men" : + dict(black = 4589785, + heather = 4599883, + navy = 4737029, + red = 4589762, + white = 4589259, + ) } + + +spreadshirt_url = urlparse(g.spreadshirt_url) +try: + test_font = ImageFont.truetype(g.spreadshirt_test_font, + int(g.spreadshirt_min_font)) +except IOError: + test_font = None + +word_re = re.compile(r"\w*\W*", re.UNICODE) +def layout_text(text, max_width = None): + if test_font: + words = list(reversed(word_re.findall(text))) + lines = [""] + while words: + word = words.pop() + w = test_font.getsize(lines[-1] + word)[0] + if w < max_width: + lines[-1] += word + else: + lines.append(word) + lines = [x.strip() for x in filter(None, lines)] + return all(test_font.getsize(x)[0] < max_width for x in lines), lines + return None, [] + +def spreadshirt_validation(s): + t = str(int(time.time())) + return t, base64.b64encode(sha.new(s+t+g.spreadshirt_vendor_id).digest()) + +def shirt_request(link, color, style, size, quantity): + article = articles.get(style, {}).get(color) + size = dict(sizes).get(size) + color = dict(colors).get(color) + + # load up previous session id (if there was one) + sessionid = c.cookies.get("spreadshirt") + sessionid = sessionid.value if sessionid else "" + + if link and color and size and quantity and article: + # try to layout the text + text = ShirtPane.make_text(link) + if text: + author = Account._byID(link.author_id) + request_dict = dict(color = color, + quantity = quantity, + sessionId = sessionid, + size = size, + article_id = article) + for i, t in enumerate(text): + request_dict["textrow_%d" % (i+1)] = t + request_dict["textrow_6"] = "submitted by %s" % author.name + request_dict["textrow_7"] = link._date.strftime("%B %e, %Y") + text.extend([request_dict["textrow_6"], request_dict["textrow_7"]]) + + t, code = spreadshirt_validation("".join(text)) + request_dict['timestamp'] = t + request_dict['hash'] = code + + params = urllib.urlencode(request_dict) + headers = {"Content-type": "application/x-www-form-urlencoded", + "Accept": "text/plain"} + data = None + try: + conn = HTTPConnection(spreadshirt_url.hostname) + conn.request("POST", spreadshirt_url.path, params, headers) + response = conn.getresponse() + if int(response.status) == 200: + data = BeautifulStoneSoup(response.read()) + conn.close() + except socket.error: + return + + if data: + if not data.find("error"): + session_id = data.sessionid.contents[0] + data = data.basketurl.contents[0] + # set session id before redirecting + c.cookies.add("spreadshirt", session_id) + else: + g.log.error("Spreadshirt Error:\n" ) + g.log.error(data.prettify() + '\n') + g.log.error("POST and params: " + g.spreadshirt_url) + g.log.error(params) + data = None + + return data + + +class ShirtPage(LinkInfoPage): + extension_handling= False + additional_css = "spreadshirt.css" + def __init__(self, *a, **kw): + kw['show_sidebar'] = False + LinkInfoPage.__init__(self, *a, **kw) + + def content(self): + return self.content_stack((self.link_listing, + ShirtPane(self.link))) + +class ShirtPane(Templated): + default_color = "white" + default_size = "large" + default_style = "men" + + colors = [x for x, y in colors] + styles = ("men", "women") + sizes = [x for x, y in sizes] + + def __init__(self, link, **kw): + Templated.__init__(self, link = link, text = self.make_text(link), **kw) + + @classmethod + def make_text(cls, link): + fit, text = layout_text(link.title, + int(g.spreadshirt_max_width)) + if len(text) > 5 or not fit: + text = [] + return text diff --git a/r2/r2/public/static/css/reddit-ie6-hax.css b/r2/r2/public/static/css/reddit-ie6-hax.css index fc5d84eb3..daaff143f 100644 --- a/r2/r2/public/static/css/reddit-ie6-hax.css +++ b/r2/r2/public/static/css/reddit-ie6-hax.css @@ -91,4 +91,56 @@ div.cover { div.popup { position: absolute; top: expression( ( 40 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); -} \ No newline at end of file +} + +.shirt .shirt-container .red { + background-image: url(/static/spreadshirt/red.gif); +} +.shirt .shirt-container .white { + background-image: url(/static/spreadshirt/white.gif); +} +.shirt .shirt-container .navy { + background-image: url(/static/spreadshirt/navy.gif); +} +.shirt .shirt-container .heather { + background-image: url(/static/spreadshirt/heather.gif); +} +.shirt .shirt-container .black { + background-image: url(/static/spreadshirt/black.gif); +} + +.shirt .shirt-container .main .caption #layout { + height: 5em; + background-image: url(/static/spreadshirt/spreadshirt-arrows.gif); +} + +.shirt .shirt-container .main.navy .caption #layout, +.shirt .shirt-container .main.black .caption #layout { + background-image:url(/static/spreadshirt/spreadshirt-arrows-white.gif); +} +.shirt .shirt-container .main.red .caption #layout { + background-image:url(/static/spreadshirt/spreadshirt-arrows-red.gif); +} + +.shirt .shirt-container .main .caption .byline { + background-image: url(/static/spreadshirt/spreadshirt-header.gif); +} +.shirt .shirt-container .main.navy .caption .byline, +.shirt .shirt-container .main.black .caption .byline { + background-image:url(/static/spreadshirt/spreadshirt-header-white.gif); +} +.shirt .shirt-container .main.red .caption .byline { + background-image:url(/static/spreadshirt/spreadshirt-header-red.gif); +} + +.shirt .shirt-container .main .caption.big .byline { + background-image: none; +} + +.shirt .shirt-container .main.navy .caption.big .byline, +.shirt .shirt-container .main.black .caption.big .byline { + background-image: none; +} +.shirt .shirt-container .main.red .caption.big .byline { + background-image: non; +} diff --git a/r2/r2/public/static/css/spreadshirt.css b/r2/r2/public/static/css/spreadshirt.css new file mode 100644 index 000000000..736ae1f44 --- /dev/null +++ b/r2/r2/public/static/css/spreadshirt.css @@ -0,0 +1,161 @@ +.shirt { + margin-left: 30px; + width: 600px; + } +.shirt h2 { + margin: 30px; + text-align: center; + font-size: large; + color: gray; + } +.shirt .shirt-container { margin: 10px; } +.shirt .shirt-container .left { + border: 1px solid #5f99cf; + background-color: #EFF7FF; + margin-top: 10px; + float:left; +} +.shirt .shirt-container .left h4 { + color: #336699; + margin: 2px; +} +.shirt .shirt-container .left input[type=submit] { + background-color: #5f99cf; + width: 95px; + color: white; + text-transform: uppercase; + font-size: larger; + font-weight: bold; + border-width: 1px; + border-color: black black black black; +} +.shirt .shirt-container .left input[type=radio] { + margin: 0 2px; + vertical-align: bottom; +} +.shirt .shirt-container .left input[type=text] { + border: 1px solid #AAA; + margin: 5px; +} + +.shirt select { margin-left: 5px; } + +.shirt .shirt-container .main.white.men { + background-image: url(/static/spreadshirt/white.png); +} +.shirt .shirt-container .main.heather.men { + background-image: url(/static/spreadshirt/heather.png); +} +.shirt .shirt-container .main.navy.men { + background-image: url(/static/spreadshirt/navy.png); +} +.shirt .shirt-container .main.black.men { + background-image: url(/static/spreadshirt/black.png); +} +.shirt .shirt-container .main.red.men { + background-image: url(/static/spreadshirt/red.png); +} +.shirt .shirt-container .main.white.women { + background-image: url(/static/spreadshirt/white-womens.png); +} +.shirt .shirt-container .main.navy.women { + background-image: url(/static/spreadshirt/navy-womens.png); +} +.shirt .shirt-container .main.heather.women { + background-image: url(/static/spreadshirt/heather-womens.png); +} +.shirt .shirt-container .main.black.women { + background-image: url(/static/spreadshirt/black-womens.png); +} +.shirt .shirt-container .main.red.women { + background-image: url(/static/spreadshirt/red-womens.png); +} + +.shirt .shirt-container .main.black .caption #layout, +.shirt .shirt-container .main.black .caption .byline, +.shirt .shirt-container .main.navy .caption #layout, +.shirt .shirt-container .main.navy .caption .byline, +.shirt .shirt-container .main.red .caption #layout, +.shirt .shirt-container .main.red .caption .byline + { + color: white; + } + + + +.shirt .shirt-container .main { + background-image: url(/static/spreadshirt/white.png); + background-repeat: no-repeat; + background-position: center center; + border: 1px solid #5f99cf; + width: 450px; + height: 350px; + margin-left: 96px; + position: relative; + margin-bottom: 75px; + } + +.shirt .shirt-container .main .caption { + width: 160px; + margin-top: 80px; + margin-left: auto; + margin-right: auto; + font-family: verdana; + font-size: 9px; + text-align: left; +} +.shirt .shirt-container .main .caption #layout { + padding-left: 17px; + background-image: url(/static/spreadshirt/spreadshirt-arrows.png); + background-repeat: no-repeat; + background-position: top left; + min-height: 30px; +} +.shirt .shirt-container .main.navy .caption #layout, +.shirt .shirt-container .main.black .caption #layout { + background-image:url(/static/spreadshirt/spreadshirt-arrows-white.png); +} +.shirt .shirt-container .main.red .caption #layout { + background-image:url(/static/spreadshirt/spreadshirt-arrows-red.png); +} + + +.shirt .shirt-container .main .caption .byline { + margin-top: 5px; + border: none; + text-align: right; + font-weight: bold; + font-size: 4pt; + margin-left: 12px; + padding-bottom: 20px; + background-image: url(/static/spreadshirt/spreadshirt-header.png); + background-repeat: no-repeat; + background-position: bottom left; +} +.shirt .shirt-container .main.navy .caption .byline, +.shirt .shirt-container .main.black .caption .byline { + background-image:url(/static/spreadshirt/spreadshirt-header-white.png); +} +.shirt .shirt-container .main.red .caption .byline { + background-image:url(/static/spreadshirt/spreadshirt-header-red.png); +} + +.shirt .shirt-container .main .caption.big { + font-family: verdana; + width: 340px; + padding: 10px; + border: 3px solid #369; + font-size: 20px; + background-color: white; + position: absolute; + top: 250px; + left: 45px; + margin: 0px; +} + +.shirt .shirt-container .main .caption.big .byline { + font-size: x-small; + background: none; + color: black; +} + diff --git a/r2/r2/public/static/spreadshirt/black-womens.gif b/r2/r2/public/static/spreadshirt/black-womens.gif new file mode 100644 index 000000000..a699bf3d6 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/black-womens.gif differ diff --git a/r2/r2/public/static/spreadshirt/black-womens.png b/r2/r2/public/static/spreadshirt/black-womens.png new file mode 100644 index 000000000..1f52d605d Binary files /dev/null and b/r2/r2/public/static/spreadshirt/black-womens.png differ diff --git a/r2/r2/public/static/spreadshirt/black.gif b/r2/r2/public/static/spreadshirt/black.gif new file mode 100644 index 000000000..97917fccb Binary files /dev/null and b/r2/r2/public/static/spreadshirt/black.gif differ diff --git a/r2/r2/public/static/spreadshirt/black.png b/r2/r2/public/static/spreadshirt/black.png new file mode 100644 index 000000000..9d638af50 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/black.png differ diff --git a/r2/r2/public/static/spreadshirt/heather-womens.gif b/r2/r2/public/static/spreadshirt/heather-womens.gif new file mode 100644 index 000000000..db0d8d745 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/heather-womens.gif differ diff --git a/r2/r2/public/static/spreadshirt/heather-womens.png b/r2/r2/public/static/spreadshirt/heather-womens.png new file mode 100644 index 000000000..3ea422e7f Binary files /dev/null and b/r2/r2/public/static/spreadshirt/heather-womens.png differ diff --git a/r2/r2/public/static/spreadshirt/heather.gif b/r2/r2/public/static/spreadshirt/heather.gif new file mode 100644 index 000000000..5faa45223 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/heather.gif differ diff --git a/r2/r2/public/static/spreadshirt/heather.png b/r2/r2/public/static/spreadshirt/heather.png new file mode 100644 index 000000000..b08ee07b3 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/heather.png differ diff --git a/r2/r2/public/static/spreadshirt/navy-womens.gif b/r2/r2/public/static/spreadshirt/navy-womens.gif new file mode 100644 index 000000000..0f248f7df Binary files /dev/null and b/r2/r2/public/static/spreadshirt/navy-womens.gif differ diff --git a/r2/r2/public/static/spreadshirt/navy-womens.png b/r2/r2/public/static/spreadshirt/navy-womens.png new file mode 100644 index 000000000..5503d6d61 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/navy-womens.png differ diff --git a/r2/r2/public/static/spreadshirt/navy.gif b/r2/r2/public/static/spreadshirt/navy.gif new file mode 100644 index 000000000..20bb5f18c Binary files /dev/null and b/r2/r2/public/static/spreadshirt/navy.gif differ diff --git a/r2/r2/public/static/spreadshirt/navy.png b/r2/r2/public/static/spreadshirt/navy.png new file mode 100644 index 000000000..0b3d99010 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/navy.png differ diff --git a/r2/r2/public/static/spreadshirt/red-womens.gif b/r2/r2/public/static/spreadshirt/red-womens.gif new file mode 100644 index 000000000..bd36eabea Binary files /dev/null and b/r2/r2/public/static/spreadshirt/red-womens.gif differ diff --git a/r2/r2/public/static/spreadshirt/red-womens.png b/r2/r2/public/static/spreadshirt/red-womens.png new file mode 100644 index 000000000..b80db1893 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/red-womens.png differ diff --git a/r2/r2/public/static/spreadshirt/red.gif b/r2/r2/public/static/spreadshirt/red.gif new file mode 100644 index 000000000..a41041272 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/red.gif differ diff --git a/r2/r2/public/static/spreadshirt/red.png b/r2/r2/public/static/spreadshirt/red.png new file mode 100644 index 000000000..209cf517d Binary files /dev/null and b/r2/r2/public/static/spreadshirt/red.png differ diff --git a/r2/r2/public/static/spreadshirt/spreadshirt-arrows-red.gif b/r2/r2/public/static/spreadshirt/spreadshirt-arrows-red.gif new file mode 100644 index 000000000..26d6ea3a9 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/spreadshirt-arrows-red.gif differ diff --git a/r2/r2/public/static/spreadshirt/spreadshirt-arrows-red.png b/r2/r2/public/static/spreadshirt/spreadshirt-arrows-red.png new file mode 100644 index 000000000..7d6d89826 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/spreadshirt-arrows-red.png differ diff --git a/r2/r2/public/static/spreadshirt/spreadshirt-arrows-white.gif b/r2/r2/public/static/spreadshirt/spreadshirt-arrows-white.gif new file mode 100644 index 000000000..69f2bcf20 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/spreadshirt-arrows-white.gif differ diff --git a/r2/r2/public/static/spreadshirt/spreadshirt-arrows-white.png b/r2/r2/public/static/spreadshirt/spreadshirt-arrows-white.png new file mode 100644 index 000000000..4a52b7461 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/spreadshirt-arrows-white.png differ diff --git a/r2/r2/public/static/spreadshirt/spreadshirt-arrows.gif b/r2/r2/public/static/spreadshirt/spreadshirt-arrows.gif new file mode 100644 index 000000000..8989349ee Binary files /dev/null and b/r2/r2/public/static/spreadshirt/spreadshirt-arrows.gif differ diff --git a/r2/r2/public/static/spreadshirt/spreadshirt-arrows.png b/r2/r2/public/static/spreadshirt/spreadshirt-arrows.png new file mode 100644 index 000000000..0dc10cfc4 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/spreadshirt-arrows.png differ diff --git a/r2/r2/public/static/spreadshirt/spreadshirt-header-red.gif b/r2/r2/public/static/spreadshirt/spreadshirt-header-red.gif new file mode 100644 index 000000000..047532e25 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/spreadshirt-header-red.gif differ diff --git a/r2/r2/public/static/spreadshirt/spreadshirt-header-red.png b/r2/r2/public/static/spreadshirt/spreadshirt-header-red.png new file mode 100644 index 000000000..affd9daa8 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/spreadshirt-header-red.png differ diff --git a/r2/r2/public/static/spreadshirt/spreadshirt-header-white.gif b/r2/r2/public/static/spreadshirt/spreadshirt-header-white.gif new file mode 100644 index 000000000..7361ce155 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/spreadshirt-header-white.gif differ diff --git a/r2/r2/public/static/spreadshirt/spreadshirt-header-white.png b/r2/r2/public/static/spreadshirt/spreadshirt-header-white.png new file mode 100644 index 000000000..d52a8aec6 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/spreadshirt-header-white.png differ diff --git a/r2/r2/public/static/spreadshirt/spreadshirt-header.gif b/r2/r2/public/static/spreadshirt/spreadshirt-header.gif new file mode 100644 index 000000000..186cb6470 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/spreadshirt-header.gif differ diff --git a/r2/r2/public/static/spreadshirt/spreadshirt-header.png b/r2/r2/public/static/spreadshirt/spreadshirt-header.png new file mode 100644 index 000000000..0b3af7fbd Binary files /dev/null and b/r2/r2/public/static/spreadshirt/spreadshirt-header.png differ diff --git a/r2/r2/public/static/spreadshirt/white-womens.gif b/r2/r2/public/static/spreadshirt/white-womens.gif new file mode 100644 index 000000000..e3a73d3bb Binary files /dev/null and b/r2/r2/public/static/spreadshirt/white-womens.gif differ diff --git a/r2/r2/public/static/spreadshirt/white-womens.png b/r2/r2/public/static/spreadshirt/white-womens.png new file mode 100644 index 000000000..e24f10d43 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/white-womens.png differ diff --git a/r2/r2/public/static/spreadshirt/white.gif b/r2/r2/public/static/spreadshirt/white.gif new file mode 100644 index 000000000..95d19a406 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/white.gif differ diff --git a/r2/r2/public/static/spreadshirt/white.png b/r2/r2/public/static/spreadshirt/white.png new file mode 100644 index 000000000..8d2ec58d5 Binary files /dev/null and b/r2/r2/public/static/spreadshirt/white.png differ diff --git a/r2/r2/templates/reddit.html b/r2/r2/templates/reddit.html index 8d87cb1d7..de00cbcba 100644 --- a/r2/r2/templates/reddit.html +++ b/r2/r2/templates/reddit.html @@ -67,6 +67,10 @@ %endif %endif %endif + %if getattr(thing, "additional_css", None): + + %endif diff --git a/r2/r2/templates/shirtpane.html b/r2/r2/templates/shirtpane.html new file mode 100644 index 000000000..b70038fbc --- /dev/null +++ b/r2/r2/templates/shirtpane.html @@ -0,0 +1,86 @@ + + +%if not thing.text: +
+ ${_("sorry. That title is too long to fit on a t-shirt.")} +
+%else: + +