Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

made titles work

  • Loading branch information...
commit df23e3a6996bee51d9066140e01abf24001919f8 1 parent 0659fcc
@edwu edwu authored
View
11 r2/r2/controllers/api.py
@@ -1252,6 +1252,11 @@ def POST_upload_sr_img(self, file, header, sponsor, name, form_id, img_type):
link_urls_2 = VLength('link-url-2', max_length = 500),
link_urls_3 = VLength('link-url-3', max_length = 500),
link_urls_4 = VLength('link-url-4', max_length = 500),
+ link_urls_title_0 = VLength('link-url-title-0', max_length = 500),
+ link_urls_title_1 = VLength('link-url-title-1', max_length = 500),
+ link_urls_title_2 = VLength('link-url-title-2', max_length = 500),
+ link_urls_title_3 = VLength('link-url-title-3', max_length = 500),
+ link_urls_title_4 = VLength('link-url-title-4', max_length = 500),
)
@@ -1267,8 +1272,10 @@ def POST_site_admin(self, form, jquery, name, ip, sr,
'show_media', 'show_cname_sidebar', 'type', 'link_type', 'lang',
"css_on_cname", "header_title",
'allow_top', 'link_urls_0', 'link_urls_1',
- 'link_urls_2', 'link_urls_3', 'link_urls_4'))
- print kw
+ 'link_urls_2', 'link_urls_3', 'link_urls_4',
+ 'link_urls_title_0', 'link_urls_title_1',
+ 'link_urls_title_2', 'link_urls_title_3', 'link_urls_title_4',))
+
#if a user is banned, return rate-limit errors
if c.user._spam:
time = timeuntil(datetime.now(g.tz) + timedelta(seconds=600))
View
25 r2/r2/models/subreddit.py
@@ -78,6 +78,11 @@ class Subreddit(Thing, Printable):
link_urls_2 = None,
link_urls_3 = None,
link_urls_4 = None,
+ link_urls_title_0 = None,
+ link_urls_title_1 = None,
+ link_urls_title_2 = None,
+ link_urls_title_3 = None,
+ link_urls_title_4 = None,
# do we allow self-posts, links only, or any?
link_type = 'any', # one of ('link', 'self', 'any')
flair_enabled = True,
@@ -223,6 +228,26 @@ def link_urls_3(self):
def link_urls_4(self):
return self._base.link_urls_4 if self._base else ""
+ @property
+ def link_urls_title_0(self):
+ return self._base.link_urls_title_0 if self._base else ""
+
+ @property
+ def link_urls_title_1(self):
+ return self._base.link_urls_title_1 if self._base else ""
+
+ @property
+ def link_urls_title_2(self):
+ return self._base.link_urls_title_2 if self._base else ""
+
+ @property
+ def link_urls_title_3(self):
+ return self._base.link_urls_title_3 if self._base else ""
+
+ @property
+ def link_urls_title_4(self):
+ return self._base.link_urls_title_4 if self._base else ""
+
def has_custom_menu(self):
return not (self._base.link_urls_0 == "" or
self._base.link_urls_1 == "" or
View
16 r2/r2/public/static/css/reddit.css
@@ -75,6 +75,22 @@ input[type=checkbox], input[type=radio] { margin-top: .4em; }
/* forms */
+#menu-links .left{
+ float: left;
+}
+#menu-links .right{
+ float: right;
+}
+
+#link-url-0, #link-url-1,#link-url-2,#link-url-3,#link-url-4,
+#link-url-title-0, #link-url-title-1,#link-url-title-2,#link-url-title-3,#link-url-title-4{
+ width: 200px;
+}
+
+#menu-link .clear{
+ clear:both;
+}
+
label.disabled { color: gray; }
.wrong {color: red; font-weight: normal}
.attention {
View
44 r2/r2/templates/createsubreddit.html
@@ -277,35 +277,65 @@
i=0;
});
</script>
- <li>
+ <li class="left">
<input type="text" name="link-url-0" id="link-url-0"
value="${thing.site.link_urls_0}"
/>
</li>
- <li>
+
+ <li class="right">
+ <input type="text" name="link-url-title-0" id="link-url-title-0"
+ value="${thing.site.link_urls_title_0}"
+ />
+ </li>
+
+ <li class="left">
<input type="text" name="link-url-1" id="link-url-1"
value="${thing.site.link_urls_1}"
/>
</li>
- <li>
+ <li class="right">
+ <input type="text" name="link-url-title-1" id="link-url-title-1"
+ value="${thing.site.link_urls_title_1}"
+ />
+ </li>
+ <li class="left">
<input type="text" name="link-url-2" id="link-url-2"
value="${thing.site.link_urls_2}"
/>
</li>
- <li>
+ <li class="right">
+ <input type="text" name="link-url-title-2" id="link-url-title-2"
+ value="${thing.site.link_urls_title_2}"
+ />
+ </li>
+ <li class="left">
<input type="text" name="link-url-3" id="link-url-3"
value="${thing.site.link_urls_3}"
/>
</li>
- <li>
+ <li class="right">
+ <input type="text" name="link-url-title-3" id="link-url-title-3"
+ value="${thing.site.link_urls_title_3}"
+ />
+ </li>
+ <li class="left">
<input type="text" name="link-url-4" id="link-url-4"
value="${thing.site.link_urls_4}"
/>
</li>
+
+
+
+ <li class="right">
+ <input type="text" name="link-url-title-4" id="link-url-title-4"
+ value="${thing.site.link_urls_title_4}"
+ />
+ </li>
</ul>
- <button type="button" id="add-button" onclick="add()">Add link</button>
- <button type="button" id="remove-button" onclick="remove()">Remove link</button>
+ <div class="clear"></div>
+
</%utils:line_field>
%if c.user_is_admin:
View
19 r2/r2/templates/redditheader.html
@@ -67,14 +67,23 @@
link_url_3 = c.site.link_urls_3
if c.site.link_urls_4:
link_url_4 = c.site.link_urls_4
+ if c.site.link_urls_title_0:
+ link_url_title_0 = c.site.link_urls_title_0
+ if c.site.link_urls_title_1:
+ link_url_title_1 = c.site.link_urls_title_1
+ if c.site.link_urls_title_2:
+ link_url_title_2 = c.site.link_urls_title_2
+ if c.site.link_urls_title_3:
+ link_url_title_3 = c.site.link_urls_title_3
+ if c.site.link_urls_title_4:
+ link_url_title_4 = c.site.link_urls_title_4
%>
- %if c.site.link_urls_0:
- <a href="${c.site.link_urls_0}">TEST LINK</a>
+ %if c.site.link_urls_0 and c.site.link_urls_title_0:
+ <a href="${c.site.link_urls_0}" title="${c.site.link_urls_title_0}">TEST LINK</a>
%endif
- %if c.site.link_urls_1:
- <a href="${c.site.link_urls_1}">TEST LINK 2</a>
+ %if c.site.link_urls_1 and c.site.link_urls_title_1:
+ <a href="${c.site.link_urls_1}" title="${c.site.link_urls_title_1}">TEST LINK 2</a>
%endif
-
</ul>
%endif
Please sign in to comment.
Something went wrong with that request. Please try again.