diff --git a/r2/r2/templates/comment.html b/r2/r2/templates/comment.html index 7b2da2cc3..7b2b3cdf9 100644 --- a/r2/r2/templates/comment.html +++ b/r2/r2/templates/comment.html @@ -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> diff --git a/r2/r2/templates/link.html b/r2/r2/templates/link.html index dddf10fda..afd185bda 100644 --- a/r2/r2/templates/link.html +++ b/r2/r2/templates/link.html @@ -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", diff --git a/r2/r2/templates/printable.html b/r2/r2/templates/printable.html index 3d9b766e0..3ca66244a 100644 --- a/r2/r2/templates/printable.html +++ b/r2/r2/templates/printable.html @@ -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" %>
${self.ParentDiv()}