Build subscribe checkbox in register mako without html backend helper

This commit is contained in:
guerler
2017-12-05 16:33:48 -05:00
parent da9d9bf61c
commit 47a91eae67
2 changed files with 2 additions and 6 deletions
+1
View File
@@ -74,6 +74,7 @@ class CheckboxField(BaseField):
def is_checked(value):
if value in [True, "true"]:
return True
return False
def to_dict(self):
d = super(CheckboxField, self).to_dict()
+1 -6
View File
@@ -59,8 +59,6 @@ def inherit(context):
<%
if form_action is None:
form_action = h.url_for( controller='user', action='create', cntrller=cntrller )
from galaxy.web.form_builder import CheckboxField
subscribe_check_box = CheckboxField( 'subscribe' )
%>
<script type="text/javascript">
@@ -169,10 +167,7 @@ def inherit(context):
%if trans.app.config.smtp_server and trans.app.config.mailing_join_addr:
<div class="form-row">
<label>Subscribe to mailing list:</label>
%if subscribe_checked:
<% subscribe_check_box.checked = True %>
%endif
${subscribe_check_box.get_html()}
<input type="checkbox" id="subscribe" name="subscribe" value="true" ${"checked" if subscribe_checked else ""} >
<p>See <a href="https://galaxyproject.org/mailing-lists/" target="_blank">
all Galaxy project mailing lists</a>.</p>
</div>