mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 07:19:25 -05:00
Add data attributes for ups and downs on links and comments.
This commit is contained in:
@@ -33,6 +33,10 @@
|
||||
### specific fill-in functions for comment
|
||||
##################
|
||||
|
||||
<%def name="thing_data_attributes(what)" buffered="True">
|
||||
${parent.thing_data_attributes(what)} data-ups="${what.upvotes}" data-downs="${what.downvotes}"
|
||||
</%def>
|
||||
|
||||
<%def name="midcol(display=True, cls = '')">
|
||||
${parent.midcol(not thing.collapsed, cls = cls)}
|
||||
</%def>
|
||||
|
||||
@@ -156,6 +156,10 @@
|
||||
${parent.thing_css_class(what)} ${"over18" if thing.over_18 else ""}
|
||||
</%def>
|
||||
|
||||
<%def name="thing_data_attributes(what)" buffered="True">
|
||||
${parent.thing_data_attributes(what)} data-ups="${what.upvotes}" data-downs="${what.downvotes}"
|
||||
</%def>
|
||||
|
||||
<%def name="subreddit()" buffered="True">
|
||||
${plain_link(thing.subreddit.name, thing.subreddit_path, sr_path = False,
|
||||
cname = False, _class = "subreddit hover",
|
||||
|
||||
@@ -47,6 +47,8 @@ ${self.RenderPrintable()}
|
||||
|
||||
<%def name="thing_css_class(what)">thing id-${what._fullname}</%def>
|
||||
|
||||
<%def name="thing_data_attributes(what)">data-fullname="${what._fullname}"</%def>
|
||||
|
||||
<%def name="RenderPrintable()">
|
||||
<% cls = thing.lookups[0].__class__.__name__.lower() %>
|
||||
<%
|
||||
@@ -76,7 +78,8 @@ ${self.RenderPrintable()}
|
||||
rowclass += " hidden"
|
||||
%>
|
||||
<div class="${self.thing_css_class(thing)} ${rowclass} ${unsafe(cls)} ${selflink}"
|
||||
${thing.display} data-fullname="${thing._fullname}" onclick="click_thing(this)">
|
||||
${thing.display} onclick="click_thing(this)"
|
||||
${unsafe(self.thing_data_attributes(thing))}>
|
||||
<p class="parent">
|
||||
${self.ParentDiv()}
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user