Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Add data attributes to usertext
Browse files Browse the repository at this point in the history
  • Loading branch information
Florence Yeun committed Nov 19, 2015
1 parent 10737c8 commit cdbd437
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions r2/r2/lib/pages/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -4638,6 +4638,7 @@ def __init__(self,
include_errors=True,
show_embed_help=False,
admin_takedown=False,
data_attrs={},
):

css_class = "usertext"
Expand Down Expand Up @@ -4677,6 +4678,7 @@ def __init__(self,
include_errors=include_errors,
show_embed_help=show_embed_help,
admin_takedown=admin_takedown,
data_attrs=data_attrs,
)

class MediaEmbedBody(CachedTemplate):
Expand Down
3 changes: 2 additions & 1 deletion r2/r2/templates/usertext.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
%>

<%namespace file="printablebuttons.html" import="toggle_button" />
<%namespace file="utils.html" import="error_field, md, _md"/>
<%namespace file="utils.html" import="data, error_field, md, _md"/>

<%def name="markhelp(show_embed_help=False)">
<div class="markhelp" style="display:none">
Expand Down Expand Up @@ -144,6 +144,7 @@
<textarea rows="1" cols="1"
name="${thing.name}"
class="${thing.textarea_class}"
${data(**thing.data_attrs)}
>${keep_space(thing.text)}</textarea>
</div>

Expand Down

0 comments on commit cdbd437

Please sign in to comment.