예제 #1
0
def render_render_registration_form(context,form_action=None):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, '__anon_0x7f71681b4710')._populate(_import_ns, [u'render_msg'])
        username = _import_ns.get('username', context.get('username', UNDEFINED))
        redirect = _import_ns.get('redirect', context.get('redirect', UNDEFINED))
        user_type_form_definition = _import_ns.get('user_type_form_definition', context.get('user_type_form_definition', UNDEFINED))
        h = _import_ns.get('h', context.get('h', UNDEFINED))
        len = _import_ns.get('len', context.get('len', UNDEFINED))
        user_type_fd_id_select_field = _import_ns.get('user_type_fd_id_select_field', context.get('user_type_fd_id_select_field', UNDEFINED))
        widgets = _import_ns.get('widgets', context.get('widgets', UNDEFINED))
        subscribe_checked = _import_ns.get('subscribe_checked', context.get('subscribe_checked', UNDEFINED))
        t = _import_ns.get('t', context.get('t', UNDEFINED))
        cntrller = _import_ns.get('cntrller', context.get('cntrller', UNDEFINED))
        trans = _import_ns.get('trans', context.get('trans', UNDEFINED))
        email = _import_ns.get('email', context.get('email', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 31
        __M_writer(u'\n\n    ')
        # SOURCE LINE 33

        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' )
            
        
        # SOURCE LINE 38
        __M_writer(u'\n\n    <div class="toolForm">\n        <form name="registration" id="registration" action="')
        # SOURCE LINE 41
        __M_writer(unicode(form_action))
        __M_writer(u'" method="post" >\n            <div class="toolFormTitle">Create account</div>\n            <div class="form-row">\n                <label>Email address:</label>\n                <input type="text" name="email" value="')
        # SOURCE LINE 45
        __M_writer(filters.html_escape(unicode(email )))
        __M_writer(u'" size="40"/>\n                <input type="hidden" name="redirect" value="')
        # SOURCE LINE 46
        __M_writer(filters.html_escape(unicode(redirect )))
        __M_writer(u'" size="40"/>\n            </div>\n            <div class="form-row">\n                <label>Password:</label>\n                <input type="password" name="password" value="" size="40"/>\n            </div>\n            <div class="form-row">\n                <label>Confirm password:</label>\n                <input type="password" name="confirm" value="" size="40"/>\n            </div>\n            <div class="form-row">\n                <label>Public name:</label>\n                <input type="text" name="username" size="40" value="')
        # SOURCE LINE 58
        __M_writer(filters.html_escape(unicode(username )))
        __M_writer(u'"/>\n')
        # SOURCE LINE 59
        if t.webapp.name == 'galaxy':
            # SOURCE LINE 60
            __M_writer(u'                    <div class="toolParamHelp" style="clear: both;">\n                        Your public name is an identifier that will be used to generate addresses for information\n                        you share publicly. Public names must be at least four characters in length and contain only lower-case\n                        letters, numbers, and the \'-\' character.\n                    </div>\n')
            # SOURCE LINE 65
        else:
            # SOURCE LINE 66
            __M_writer(u'                    <div class="toolParamHelp" style="clear: both;">\n                        Your public name provides a means of identifying you publicly within this tool shed. Public\n                        names must be at least four characters in length and contain only lower-case letters, numbers,\n                        and the \'-\' character.  You cannot change your public name after you have created a repository\n                        in this tool shed.\n                    </div>\n')
            pass
        # SOURCE LINE 73
        __M_writer(u'            </div>\n')
        # SOURCE LINE 74
        if trans.app.config.smtp_server:
            # SOURCE LINE 75
            __M_writer(u'                <div class="form-row">\n                    <label>Subscribe to mailing list:</label>\n')
            # SOURCE LINE 77
            if subscribe_checked:
                # SOURCE LINE 78
                __M_writer(u'                        ')
                subscribe_check_box.checked = True 
                
                __M_writer(u'\n')
                pass
            # SOURCE LINE 80
            __M_writer(u'                    ')
            __M_writer(unicode(subscribe_check_box.get_html()))
            __M_writer(u'\n                    <p>See <a href="http://galaxyproject.org/wiki/Mailing%20Lists" target="_blank">\n                    all Galaxy project mailing lists</a>.</p>\n                </div>\n')
            pass
        # SOURCE LINE 85
        if user_type_fd_id_select_field and len( user_type_fd_id_select_field.options ) > 1:
            # SOURCE LINE 86
            __M_writer(u'                <div class="form-row">\n                    <label>User type</label>\n                    ')
            # SOURCE LINE 88
            __M_writer(unicode(user_type_fd_id_select_field.get_html()))
            __M_writer(u'\n                </div>\n')
            pass
        # SOURCE LINE 91
        if user_type_form_definition:
            # SOURCE LINE 92
            for field in widgets:
                # SOURCE LINE 93
                __M_writer(u'                    <div class="form-row">\n                        <label>')
                # SOURCE LINE 94
                __M_writer(unicode(field['label']))
                __M_writer(u'</label>\n                        ')
                # SOURCE LINE 95
                __M_writer(unicode(field['widget'].get_html()))
                __M_writer(u'\n                        <div class="toolParamHelp" style="clear: both;">\n                            ')
                # SOURCE LINE 97
                __M_writer(unicode(field['helptext']))
                __M_writer(u'\n                        </div>\n                        <div style="clear: both"></div>\n                    </div>\n')
                pass
            # SOURCE LINE 102
            if not user_type_fd_id_select_field:
                # SOURCE LINE 103
                __M_writer(u'                    <input type="hidden" name="user_type_fd_id" value="')
                __M_writer(unicode(trans.security.encode_id( user_type_form_definition.id )))
                __M_writer(u'"/>\n')
                pass
            pass
        # SOURCE LINE 106
        __M_writer(u'            <div class="form-row">\n                <input type="submit" name="create_user_button" value="Submit"/>\n            </div>\n        </form>\n    </div>\n\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
def render_render_registration_form(context, form_action=None):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, '__anon_0x5b10f90')._populate(
            _import_ns, [u'render_msg'])
        redirect = _import_ns.get('redirect',
                                  context.get('redirect', UNDEFINED))
        username = _import_ns.get('username',
                                  context.get('username', UNDEFINED))
        trans = _import_ns.get('trans', context.get('trans', UNDEFINED))
        user_type_form_definition = _import_ns.get(
            'user_type_form_definition',
            context.get('user_type_form_definition', UNDEFINED))
        confirm = _import_ns.get('confirm', context.get('confirm', UNDEFINED))
        h = _import_ns.get('h', context.get('h', UNDEFINED))
        len = _import_ns.get('len', context.get('len', UNDEFINED))
        user_type_fd_id_select_field = _import_ns.get(
            'user_type_fd_id_select_field',
            context.get('user_type_fd_id_select_field', UNDEFINED))
        widgets = _import_ns.get('widgets', context.get('widgets', UNDEFINED))
        subscribe_checked = _import_ns.get(
            'subscribe_checked', context.get('subscribe_checked', UNDEFINED))
        cntrller = _import_ns.get('cntrller',
                                  context.get('cntrller', UNDEFINED))
        webapp = _import_ns.get('webapp', context.get('webapp', UNDEFINED))
        password = _import_ns.get('password',
                                  context.get('password', UNDEFINED))
        email = _import_ns.get('email', context.get('email', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 24
        __M_writer(u'\n\n    ')
        # SOURCE LINE 26

        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')

        # SOURCE LINE 31
        __M_writer(
            u'\n\n    <div class="toolForm">\n        <form name="registration" id="registration" action="'
        )
        # SOURCE LINE 34
        __M_writer(unicode(form_action))
        __M_writer(
            u'" method="post" >\n            <div class="toolFormTitle">Create account</div>\n            <div class="form-row">\n                <label>Email address:</label>\n                <input type="text" name="email" value="'
        )
        # SOURCE LINE 38
        __M_writer(unicode(email))
        __M_writer(
            u'" size="40"/>\n                <input type="hidden" name="webapp" value="'
        )
        # SOURCE LINE 39
        __M_writer(unicode(webapp))
        __M_writer(
            u'" size="40"/>\n                <input type="hidden" name="redirect" value="'
        )
        # SOURCE LINE 40
        __M_writer(unicode(redirect))
        __M_writer(
            u'" size="40"/>\n            </div>\n            <div class="form-row">\n                <label>Password:</label>\n                <input type="password" name="password" value="'
        )
        # SOURCE LINE 44
        __M_writer(unicode(password))
        __M_writer(
            u'" size="40"/>\n            </div>\n            <div class="form-row">\n                <label>Confirm password:</label>\n                <input type="password" name="confirm" value="'
        )
        # SOURCE LINE 48
        __M_writer(unicode(confirm))
        __M_writer(
            u'" size="40"/>\n            </div>\n            <div class="form-row">\n                <label>Public name:</label>\n                <input type="text" name="username" size="40" value="'
        )
        # SOURCE LINE 52
        __M_writer(unicode(username))
        __M_writer(u'"/>\n')
        # SOURCE LINE 53
        if webapp == 'galaxy':
            # SOURCE LINE 54
            __M_writer(
                u'                    <div class="toolParamHelp" style="clear: both;">\n                        Your public name is an identifier that will be used to generate addresses for information\n                        you share publicly. Public names must be at least four characters in length and contain only lower-case\n                        letters, numbers, and the \'-\' character.\n                    </div>\n'
            )
            # SOURCE LINE 59
        else:
            # SOURCE LINE 60
            __M_writer(
                u'                    <div class="toolParamHelp" style="clear: both;">\n                        Your public name provides a means of identifying you publicly within this tool shed. Public\n                        names must be at least four characters in length and contain only lower-case letters, numbers,\n                        and the \'-\' character.  You cannot change your public name after you have created a repository\n                        in this tool shed.\n                    </div>\n'
            )
            pass
        # SOURCE LINE 67
        __M_writer(u'            </div>\n')
        # SOURCE LINE 68
        if trans.app.config.smtp_server:
            # SOURCE LINE 69
            __M_writer(
                u'                <div class="form-row">\n                    <label>Subscribe to mailing list:</label>\n'
            )
            # SOURCE LINE 71
            if subscribe_checked:
                # SOURCE LINE 72
                __M_writer(u'                        ')
                subscribe_check_box.checked = True

                __M_writer(u'\n')
                pass
            # SOURCE LINE 74
            __M_writer(u'                    ')
            __M_writer(unicode(subscribe_check_box.get_html()))
            __M_writer(
                u'\n                    <p>See <a href="http://galaxyproject.org/wiki/Mailing%20Lists" target="_blank">\n                    all Galaxy project mailing lists</a>.</p>\n                </div>\n'
            )
            pass
        # SOURCE LINE 79
        if user_type_fd_id_select_field and len(
                user_type_fd_id_select_field.options) > 1:
            # SOURCE LINE 80
            __M_writer(
                u'                <div class="form-row">\n                    <label>User type</label>\n                    '
            )
            # SOURCE LINE 82
            __M_writer(unicode(user_type_fd_id_select_field.get_html()))
            __M_writer(u'\n                </div>\n')
            pass
        # SOURCE LINE 85
        if user_type_form_definition:
            # SOURCE LINE 86
            for field in widgets:
                # SOURCE LINE 87
                __M_writer(
                    u'                    <div class="form-row">\n                        <label>'
                )
                # SOURCE LINE 88
                __M_writer(unicode(field['label']))
                __M_writer(u'</label>\n                        ')
                # SOURCE LINE 89
                __M_writer(unicode(field['widget'].get_html()))
                __M_writer(
                    u'\n                        <div class="toolParamHelp" style="clear: both;">\n                            '
                )
                # SOURCE LINE 91
                __M_writer(unicode(field['helptext']))
                __M_writer(
                    u'\n                        </div>\n                        <div style="clear: both"></div>\n                    </div>\n'
                )
                pass
            # SOURCE LINE 96
            if not user_type_fd_id_select_field:
                # SOURCE LINE 97
                __M_writer(
                    u'                    <input type="hidden" name="user_type_fd_id" value="'
                )
                __M_writer(
                    unicode(
                        trans.security.encode_id(
                            user_type_form_definition.id)))
                __M_writer(u'"/>\n')
                pass
            pass
        # SOURCE LINE 100
        __M_writer(
            u'            <div class="form-row">\n                <input type="submit" name="create_user_button" value="Submit"/>\n            </div>\n        </form>\n    </div>\n\n'
        )
        return ''
    finally:
        context.caller_stack._pop_frame()
def render_render_registration_form(context,form_action=None):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, '__anon_0x28802690')._populate(_import_ns, [u'render_msg'])
        username = _import_ns.get('username', context.get('username', UNDEFINED))
        redirect = _import_ns.get('redirect', context.get('redirect', UNDEFINED))
        user_type_form_definition = _import_ns.get('user_type_form_definition', context.get('user_type_form_definition', UNDEFINED))
        h = _import_ns.get('h', context.get('h', UNDEFINED))
        registration_warning_message = _import_ns.get('registration_warning_message', context.get('registration_warning_message', UNDEFINED))
        len = _import_ns.get('len', context.get('len', UNDEFINED))
        user_type_fd_id_select_field = _import_ns.get('user_type_fd_id_select_field', context.get('user_type_fd_id_select_field', UNDEFINED))
        widgets = _import_ns.get('widgets', context.get('widgets', UNDEFINED))
        subscribe_checked = _import_ns.get('subscribe_checked', context.get('subscribe_checked', UNDEFINED))
        t = _import_ns.get('t', context.get('t', UNDEFINED))
        cntrller = _import_ns.get('cntrller', context.get('cntrller', UNDEFINED))
        trans = _import_ns.get('trans', context.get('trans', UNDEFINED))
        email = _import_ns.get('email', context.get('email', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 31
        __M_writer(u'\n\n    ')
        # SOURCE LINE 33

        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' )
            
        
        # SOURCE LINE 38
        __M_writer(u'\n\n<script type="text/javascript">\n\t$(document).ready(function() {\n\n\t\tfunction validateString(test_string, type) { \n\t\t\tvar mail_re = /^(([^<>()[\\]\\\\.,;:\\s@\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\"]+)*)|(\\".+\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n\t\t\t//var mail_re_RFC822 = /^([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x22)(\\x2e([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x22))*\\x40([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x5d)(\\x2e([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x5d))*$/;\n\t\t\tvar username_re = /^[a-z0-9\\-]{3,255}$/;\n\t\t\tif (type === \'email\') {\n\t\t\t\treturn mail_re.test(test_string);\n\t\t\t} else if (type === \'username\'){\n\t\t\t\treturn username_re.test(test_string);\n\t\t\t}\n\t\t} \n\n\t\tfunction renderError(message) {\n\t\tif ($(".errormessage").length === 1) {\n\t\t\t$(".errormessage").html(message)\n\t\t} else {\n\t\t\tvar div = document.createElement("div");\n\t\t\tdiv.className = "errormessage";\n\t\t\tdiv.innerHTML = message;\n\t\t\tdocument.body.insertBefore(div, document.body.firstChild);\n\t\t\t}\n\t\t}\n\n\t\t$(\'#registration\').bind(\'submit\', function(e) {\n\t\t\t$(\'#send\').attr(\'disabled\', \'disabled\');\n            \n            // we need this value to detect submitting at backend\n\t\t\tvar hidden_input = \'<input type="hidden" id="create_user_button" name="create_user_button" value="Submit"/>\';\n\t\t\t$("#email_input").before(hidden_input);\n\n\t\t\tvar error_text_email= \'Please enter your valid email address\';\n\t\t\tvar error_text_email_long= \'Email cannot be more than 255 characters in length\';\n\t\t\tvar error_text_username_characters = \'Public name must contain only lowercase letters, numbers and "-". It also has to be shorter than 255 characters but longer than 3.\';\n\t\t\tvar error_text_password_short = \'Please use a password of at least 6 characters\';\n\t\t\tvar error_text_password_match = "Passwords don\'t match";\n\n\t\t    var validForm = true;\n\t\t    \n\t\t    var email = $(\'#email_input\').val();\n\t\t    var name = $(\'#name_input\').val();\n\t\t    if (email.length > 255){ renderError(error_text_email_long); validForm = false;}\n\t\t    else if (!validateString(email,"email")){ renderError(error_text_email); validForm = false;}\n\t\t    else if (!($(\'#password_input\').val() === $(\'#password_check_input\').val())){ renderError(error_text_password_match); validForm = false;}\n\t\t    else if ($(\'#password_input\').val().length < 6 ){ renderError(error_text_password_short); validForm = false;}\n\t\t    else if (name && !(validateString(name,"username"))){ renderError(error_text_username_characters); validForm = false;}\n\n\t   \t\tif (!validForm) { \n\t\t        e.preventDefault();\n\t\t        // reactivate the button if the form wasn\'t submitted\n\t\t        $(\'#send\').removeAttr(\'disabled\');\n\t\t        }\n\t\t\t});\n\t});\n\n</script>\n    <div class="toolForm">\n        <form name="registration" id="registration" action="')
        # SOURCE LINE 98
        __M_writer(unicode(form_action))
        __M_writer(u'" method="post" >\n            <div class="toolFormTitle">Create account</div>\n            <div class="form-row">\n                <label>Email address:</label>\n                <input id="email_input" type="text" name="email" value="')
        # SOURCE LINE 102
        __M_writer(filters.html_escape(unicode(email )))
        __M_writer(u'" size="40"/>\n                <input type="hidden" name="redirect" value="')
        # SOURCE LINE 103
        __M_writer(filters.html_escape(unicode(redirect )))
        __M_writer(u'" size="40"/>\n            </div>\n            <div class="form-row">\n                <label>Password:</label>\n                <input id="password_input" type="password" name="password" value="" size="40"/>\n            </div>\n            <div class="form-row">\n                <label>Confirm password:</label>\n                <input id="password_check_input" type="password" name="confirm" value="" size="40"/>\n            </div>\n            <div class="form-row">\n                <label>Public name:</label>\n                <input id="name_input" type="text" name="username" size="40" value="')
        # SOURCE LINE 115
        __M_writer(filters.html_escape(unicode(username )))
        __M_writer(u'"/>\n')
        # SOURCE LINE 116
        if t.webapp.name == 'galaxy':
            # SOURCE LINE 117
            __M_writer(u'                    <div class="toolParamHelp" style="clear: both;">\n                        Your public name is an identifier that will be used to generate addresses for information\n                        you share publicly. Public names must be at least four characters in length and contain only lower-case\n                        letters, numbers, and the \'-\' character.\n                    </div>\n')
            # SOURCE LINE 122
        else:
            # SOURCE LINE 123
            __M_writer(u'                    <div class="toolParamHelp" style="clear: both;">\n                        Your public name provides a means of identifying you publicly within this tool shed. Public\n                        names must be at least four characters in length and contain only lower-case letters, numbers,\n                        and the \'-\' character.  You cannot change your public name after you have created a repository\n                        in this tool shed.\n                    </div>\n')
            pass
        # SOURCE LINE 130
        __M_writer(u'            </div>\n')
        # SOURCE LINE 131
        if trans.app.config.smtp_server:
            # SOURCE LINE 132
            __M_writer(u'                <div class="form-row">\n                    <label>Subscribe to mailing list:</label>\n')
            # SOURCE LINE 134
            if subscribe_checked:
                # SOURCE LINE 135
                __M_writer(u'                        ')
                subscribe_check_box.checked = True 
                
                __M_writer(u'\n')
                pass
            # SOURCE LINE 137
            __M_writer(u'                    ')
            __M_writer(unicode(subscribe_check_box.get_html()))
            __M_writer(u'\n                    <p>See <a href="http://galaxyproject.org/wiki/Mailing%20Lists" target="_blank">\n                    all Galaxy project mailing lists</a>.</p>\n                </div>\n')
            pass
        # SOURCE LINE 142
        if user_type_fd_id_select_field and len( user_type_fd_id_select_field.options ) >= 1:
            # SOURCE LINE 143
            __M_writer(u'                <div class="form-row">\n                    <label>User type</label>\n                    ')
            # SOURCE LINE 145
            __M_writer(unicode(user_type_fd_id_select_field.get_html()))
            __M_writer(u'\n                </div>\n')
            pass
        # SOURCE LINE 148
        if user_type_form_definition:
            # SOURCE LINE 149
            for field in widgets:
                # SOURCE LINE 150
                __M_writer(u'                    <div class="form-row">\n                        <label>')
                # SOURCE LINE 151
                __M_writer(unicode(field['label']))
                __M_writer(u'</label>\n                        ')
                # SOURCE LINE 152
                __M_writer(unicode(field['widget'].get_html()))
                __M_writer(u'\n                        <div class="toolParamHelp" style="clear: both;">\n                            ')
                # SOURCE LINE 154
                __M_writer(unicode(field['helptext']))
                __M_writer(u'\n                        </div>\n                        <div style="clear: both"></div>\n                    </div>\n')
                pass
            # SOURCE LINE 159
            if not user_type_fd_id_select_field:
                # SOURCE LINE 160
                __M_writer(u'                    <input type="hidden" name="user_type_fd_id" value="')
                __M_writer(unicode(trans.security.encode_id( user_type_form_definition.id )))
                __M_writer(u'"/>\n')
                pass
            pass
        # SOURCE LINE 163
        __M_writer(u'            <div id="for_bears">\n            If you see this, please leave following field blank. \n            <input type="text" name="bear_field" size="1" value=""/>\n            </div>\n            <div class="form-row">\n                <input type="submit" id="send" name="create_user_button" value="Submit"/>\n            </div>\n        </form>\n')
        # SOURCE LINE 171
        if registration_warning_message:
            # SOURCE LINE 172
            __M_writer(u'        <div class="alert alert-danger" style="margin: 30px 12px 12px 12px;">\n            ')
            # SOURCE LINE 173
            __M_writer(unicode(registration_warning_message))
            __M_writer(u'           \n        </div>\n')
            pass
        # SOURCE LINE 176
        __M_writer(u'    </div>\n\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #4
0
def render_render_registration_form(context, form_action=None):
    __M_caller = context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, '__anon_0x7f295c474e50')._populate(
            _import_ns, [u'render_msg'])
        username = _import_ns.get('username',
                                  context.get('username', UNDEFINED))
        redirect = _import_ns.get('redirect',
                                  context.get('redirect', UNDEFINED))
        h = _import_ns.get('h', context.get('h', UNDEFINED))
        registration_warning_message = _import_ns.get(
            'registration_warning_message',
            context.get('registration_warning_message', UNDEFINED))
        subscribe_checked = _import_ns.get(
            'subscribe_checked', context.get('subscribe_checked', UNDEFINED))
        t = _import_ns.get('t', context.get('t', UNDEFINED))
        cntrller = _import_ns.get('cntrller',
                                  context.get('cntrller', UNDEFINED))
        trans = _import_ns.get('trans', context.get('trans', UNDEFINED))
        email = _import_ns.get('email', context.get('email', UNDEFINED))
        __M_writer = context.writer()
        __M_writer(u'\n\n    ')

        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')

        __M_writer(
            u'\n\n    <script type="text/javascript">\n        $(document).ready(function() {\n\n            function validateString(test_string, type) {\n                var mail_re = /^(([^<>()[\\]\\\\.,;:\\s@\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\"]+)*)|(\\".+\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n                //var mail_re_RFC822 = /^([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x22)(\\x2e([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x22))*\\x40([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x5d)(\\x2e([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x5d))*$/;\n                var username_re = /^[a-z0-9._\\-]{3,255}$/;\n                if (type === \'email\') {\n                    return mail_re.test(test_string);\n                } else if (type === \'username\'){\n                    return username_re.test(test_string);\n                }\n            }\n\n            function renderError(message) {\n                if (!$(".errormessage").size()) {\n                    $(\'<div/>\').addClass(\'errormessage\').insertBefore(\'#registrationForm\');\n                }\n                console.debug( $( \'#registrationForm\' ) );\n                console.debug( \'.errormessage:\', $( \'.errormessage\' ) );\n                $(".errormessage").html(message);\n            }\n\n            $("[name=\'password\']").complexify({\'minimumChars\':6}, function(valid, complexity){\n                var progressBar = $(\'.progress-bar\');\n                var color = valid ? \'lightgreen\' : \'red\';\n\n                progressBar.css(\'background-color\', color);\n                progressBar.css({\'width\': complexity + \'%\'});\n            });\n\n            $(\'#registration\').bind(\'submit\', function(e) {\n                $(\'#send\').attr(\'disabled\', \'disabled\');\n\n                // we need this value to detect submitting at backend\n                var hidden_input = \'<input type="hidden" id="create_user_button" name="create_user_button" value="Submit"/>\';\n                $("#email_input").before(hidden_input);\n\n                var error_text_email = \'The format of the email address is not correct.\';\n                var error_text_email_long = \'Email address cannot be more than 255 characters in length.\';\n                var error_text_username_characters = "Public name must contain only lowercase letters, numbers, \'.\', \'_\' and \'-\'. It also has to be between 3 and 255 characters in length.";\n                var error_text_password_short = \'Use a password of at least 6 characters\';\n                var error_text_password_match = "Passwords don\'t match";\n\n                var validForm = true;\n\n                var email = $(\'#email_input\').val();\n                var name = $(\'#name_input\').val();\n                if (email.length > 255){ renderError(error_text_email_long); validForm = false;}\n                else if (!validateString(email,"email")){ renderError(error_text_email); validForm = false;}\n                else if (!($(\'#password_input\').val() === $(\'#password_check_input\').val())){ renderError(error_text_password_match); validForm = false;}\n                else if ($(\'#password_input\').val().length < 6 ){ renderError(error_text_password_short); validForm = false;}\n                else if (name && !(validateString(name,"username"))){ renderError(error_text_username_characters); validForm = false;}\n\n                   if (!validForm) {\n                    e.preventDefault();\n                    // reactivate the button if the form wasn\'t submitted\n                    $(\'#send\').removeAttr(\'disabled\');\n                    }\n                });\n        });\n    </script>\n\n    <div id="registrationForm" class="toolForm">\n        <form name="registration" id="registration" action="'
        )
        __M_writer(unicode(form_action))
        __M_writer(
            u'" method="post" >\n            <div class="toolFormTitle">Create account</div>\n            <div class="form-row">\n                <label>Email address:</label>\n                <input id="email_input" type="text" name="email" value="'
        )
        __M_writer(filters.html_escape(unicode(email)))
        __M_writer(
            u'" size="40"/>\n                <input type="hidden" name="redirect" value="'
        )
        __M_writer(filters.html_escape(unicode(redirect)))
        __M_writer(
            u'" size="40"/>\n            </div>\n            <div class="form-row">\n                <label>Password:</label>\n                <input id="password_input" type="password" name="password" value="" size="40"/>\n            </div>\n            <div class="progress">\n                <div id="complexity-bar" class="progress-bar" role="progressbar">\n                    Strength\n                </div>\n            </div>\n            <div class="form-row">\n                <label>Confirm password:</label>\n                <input id="password_check_input" type="password" name="confirm" value="" size="40"/>\n            </div>\n            <div class="form-row">\n                <label>Public name:</label>\n                <input id="name_input" type="text" name="username" size="40" value="'
        )
        __M_writer(filters.html_escape(unicode(username)))
        __M_writer(u'"/>\n')
        if t.webapp.name == 'galaxy':
            __M_writer(
                u'                    <div class="toolParamHelp" style="clear: both;">\n                        Your public name is an identifier that will be used to generate addresses for information\n                        you share publicly. Public names must be at least three characters in length and contain only\n                        lower-case letters, numbers, dots, underscores, and dashes (\'.\', \'_\', \'-\').\n                    </div>\n'
            )
        else:
            __M_writer(
                u'                    <div class="toolParamHelp" style="clear: both;">\n                        Your public name provides a means of identifying you publicly within this tool shed. Public\n                        names must be at least three characters in length and contain only lower-case letters, numbers,\n                        dots, underscores, and dashes (\'.\', \'_\', \'-\'). You cannot change your public name after you have\n                        created a repository in this Tool Shed.\n                    </div>\n'
            )
        __M_writer(u'            </div>\n')
        if trans.app.config.smtp_server and trans.app.config.mailing_join_addr:
            __M_writer(
                u'                <div class="form-row">\n                    <label>Subscribe to mailing list:</label>\n'
            )
            if subscribe_checked:
                __M_writer(u'                        ')
                subscribe_check_box.checked = True

                __M_writer(u'\n')
            __M_writer(u'                    ')
            __M_writer(unicode(subscribe_check_box.get_html()))
            __M_writer(
                u'\n                    <p>See <a href="http://galaxyproject.org/wiki/Mailing%20Lists" target="_blank">\n                    all Galaxy project mailing lists</a>.</p>\n                </div>\n'
            )
        __M_writer(
            u'            <div id="for_bears">\n            If you see this, please leave following field blank.\n            <input type="text" name="bear_field" size="1" value=""/>\n            </div>\n            <div class="form-row">\n                <input type="submit" id="send" name="create_user_button" value="Submit"/>\n            </div>\n        </form>\n'
        )
        if registration_warning_message:
            __M_writer(
                u'        <div class="alert alert-danger" style="margin: 30px 12px 12px 12px;">\n            '
            )
            __M_writer(unicode(registration_warning_message))
            __M_writer(u'\n        </div>\n')
        __M_writer(u'    </div>\n\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
def render_body(context,**pageargs):
    context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        _import_ns = {}
        _mako_get_namespace(context, '__anon_0x15b7f310')._populate(_import_ns, [u'render_msg'])
        status = _import_ns.get('status', context.get('status', UNDEFINED))
        render_msg = _import_ns.get('render_msg', context.get('render_msg', UNDEFINED))
        name = _import_ns.get('name', context.get('name', UNDEFINED))
        in_users = _import_ns.get('in_users', context.get('in_users', UNDEFINED))
        h = _import_ns.get('h', context.get('h', UNDEFINED))
        def render_select(name,options):
            return render_render_select(context.locals_(__M_locals),name,options)
        create_group_for_role_checked = _import_ns.get('create_group_for_role_checked', context.get('create_group_for_role_checked', UNDEFINED))
        out_groups = _import_ns.get('out_groups', context.get('out_groups', UNDEFINED))
        in_groups = _import_ns.get('in_groups', context.get('in_groups', UNDEFINED))
        out_users = _import_ns.get('out_users', context.get('out_users', UNDEFINED))
        message = _import_ns.get('message', context.get('message', UNDEFINED))
        description = _import_ns.get('description', context.get('description', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 1
        __M_writer(u'\n')
        # SOURCE LINE 2
        __M_writer(u'\n\n')
        # SOURCE LINE 11
        __M_writer(u'\n\n')
        # SOURCE LINE 19
        __M_writer(u'\n\n<script type="text/javascript">\n    $().ready(function() {  \n        $(\'#groups_add_button\').click(function() {\n            return !$(\'#out_groups option:selected\').remove().appendTo(\'#in_groups\');\n        });\n        $(\'#groups_remove_button\').click(function() {\n            return !$(\'#in_groups option:selected\').remove().appendTo(\'#out_groups\');\n        });\n        $(\'#users_add_button\').click(function() {\n            return !$(\'#out_users option:selected\').remove().appendTo(\'#in_users\');\n        });\n        $(\'#users_remove_button\').click(function() {\n            return !$(\'#in_users option:selected\').remove().appendTo(\'#out_users\');\n        });\n        $(\'form#associate_role_group_user\').submit(function() {\n            $(\'#in_groups option\').each(function(i) {\n                $(this).attr("selected", "selected");\n            });\n            $(\'#in_users option\').each(function(i) {\n                $(this).attr("selected", "selected");\n            });\n        });\n        //Temporary removal of select2 for inputs -- refactor this later.\n        $(\'select\').select2("destroy");\n    });\n</script>\n\n')
        # SOURCE LINE 48

        from galaxy.web.form_builder import CheckboxField
        create_group_for_role_checkbox = CheckboxField( 'create_group_for_role' )
        
        
        __M_locals_builtin_stored = __M_locals_builtin()
        __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin_stored[__M_key]) for __M_key in ['create_group_for_role_checkbox','CheckboxField'] if __M_key in __M_locals_builtin_stored]))
        # SOURCE LINE 51
        __M_writer(u'\n\n')
        # SOURCE LINE 53
        if message:
            # SOURCE LINE 54
            __M_writer(u'    ')
            __M_writer(unicode(render_msg( message, status )))
            __M_writer(u'\n')
            pass
        # SOURCE LINE 56
        __M_writer(u'\n<div class="toolForm">\n    <div class="toolFormTitle">Create Role</div>\n    <div class="toolFormBody">\n        <form name="associate_role_group_user" id="associate_role_group_user" action="')
        # SOURCE LINE 60
        __M_writer(unicode(h.url_for(controller='admin', action='create_role' )))
        __M_writer(u'" method="post" >\n            <div class="form-row">\n                <label>Name:</label>\n                <input  name="name" type="textfield" value="')
        # SOURCE LINE 63
        __M_writer(unicode(name))
        __M_writer(u'" size=40"/>\n            </div>\n            <div class="form-row">\n                <label>Description:</label>\n                <input  name="description" type="textfield" value="')
        # SOURCE LINE 67
        __M_writer(unicode(description))
        __M_writer(u'" size=40"/>\n            </div>\n            <div class="form-row">\n                <div style="float: left; margin-right: 10px;">\n                    <label>Groups associated with new role</label>\n                    ')
        # SOURCE LINE 72
        __M_writer(unicode(render_select( "in_groups", in_groups )))
        __M_writer(u'<br/>\n                    <input type="submit" id="groups_remove_button" value=">>"/>\n                </div>\n                <div>\n                    <label>Groups not associated with new role</label>\n                    ')
        # SOURCE LINE 77
        __M_writer(unicode(render_select( "out_groups", out_groups )))
        __M_writer(u'<br/>\n                    <input type="submit" id="groups_add_button" value="<<"/>\n                </div>\n            </div>\n            <div class="form-row">\n                <div style="float: left; margin-right: 10px;">\n                    <label>Users associated with new role</label>\n                    ')
        # SOURCE LINE 84
        __M_writer(unicode(render_select( "in_users", in_users )))
        __M_writer(u'<br/>\n                    <input type="submit" id="users_remove_button" value=">>"/>\n                </div>\n                <div>\n                    <label>Users not associated with new role</label>\n                    ')
        # SOURCE LINE 89
        __M_writer(unicode(render_select( "out_users", out_users )))
        __M_writer(u'<br/>\n                    <input type="submit" id="users_add_button" value="<<"/>\n                </div>\n            </div>\n            <div class="form-row">\n')
        # SOURCE LINE 94
        if create_group_for_role_checked:
            # SOURCE LINE 95
            __M_writer(u'                    ')
            create_group_for_role_checkbox.checked = True 
            
            __M_locals_builtin_stored = __M_locals_builtin()
            __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin_stored[__M_key]) for __M_key in [] if __M_key in __M_locals_builtin_stored]))
            __M_writer(u'\n')
            pass
        # SOURCE LINE 97
        __M_writer(u'                ')
        __M_writer(unicode(create_group_for_role_checkbox.get_html()))
        __M_writer(u' Create a new group of the same name for this role\n            </div>\n            <div class="form-row">\n                <input type="submit" name="create_role_button" value="Save"/>\n            </div>\n        </form>\n    </div>\n</div>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #6
0
def render_render_registration_form(context, form_action=None):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, '__anon_0x28802690')._populate(
            _import_ns, [u'render_msg'])
        username = _import_ns.get('username',
                                  context.get('username', UNDEFINED))
        redirect = _import_ns.get('redirect',
                                  context.get('redirect', UNDEFINED))
        user_type_form_definition = _import_ns.get(
            'user_type_form_definition',
            context.get('user_type_form_definition', UNDEFINED))
        h = _import_ns.get('h', context.get('h', UNDEFINED))
        registration_warning_message = _import_ns.get(
            'registration_warning_message',
            context.get('registration_warning_message', UNDEFINED))
        len = _import_ns.get('len', context.get('len', UNDEFINED))
        user_type_fd_id_select_field = _import_ns.get(
            'user_type_fd_id_select_field',
            context.get('user_type_fd_id_select_field', UNDEFINED))
        widgets = _import_ns.get('widgets', context.get('widgets', UNDEFINED))
        subscribe_checked = _import_ns.get(
            'subscribe_checked', context.get('subscribe_checked', UNDEFINED))
        t = _import_ns.get('t', context.get('t', UNDEFINED))
        cntrller = _import_ns.get('cntrller',
                                  context.get('cntrller', UNDEFINED))
        trans = _import_ns.get('trans', context.get('trans', UNDEFINED))
        email = _import_ns.get('email', context.get('email', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 31
        __M_writer(u'\n\n    ')
        # SOURCE LINE 33

        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')

        # SOURCE LINE 38
        __M_writer(
            u'\n\n<script type="text/javascript">\n\t$(document).ready(function() {\n\n\t\tfunction validateString(test_string, type) { \n\t\t\tvar mail_re = /^(([^<>()[\\]\\\\.,;:\\s@\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\"]+)*)|(\\".+\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n\t\t\t//var mail_re_RFC822 = /^([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x22)(\\x2e([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x22))*\\x40([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x5d)(\\x2e([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x5d))*$/;\n\t\t\tvar username_re = /^[a-z0-9\\-]{3,255}$/;\n\t\t\tif (type === \'email\') {\n\t\t\t\treturn mail_re.test(test_string);\n\t\t\t} else if (type === \'username\'){\n\t\t\t\treturn username_re.test(test_string);\n\t\t\t}\n\t\t} \n\n\t\tfunction renderError(message) {\n\t\tif ($(".errormessage").length === 1) {\n\t\t\t$(".errormessage").html(message)\n\t\t} else {\n\t\t\tvar div = document.createElement("div");\n\t\t\tdiv.className = "errormessage";\n\t\t\tdiv.innerHTML = message;\n\t\t\tdocument.body.insertBefore(div, document.body.firstChild);\n\t\t\t}\n\t\t}\n\n\t\t$(\'#registration\').bind(\'submit\', function(e) {\n\t\t\t$(\'#send\').attr(\'disabled\', \'disabled\');\n            \n            // we need this value to detect submitting at backend\n\t\t\tvar hidden_input = \'<input type="hidden" id="create_user_button" name="create_user_button" value="Submit"/>\';\n\t\t\t$("#email_input").before(hidden_input);\n\n\t\t\tvar error_text_email= \'Please enter your valid email address\';\n\t\t\tvar error_text_email_long= \'Email cannot be more than 255 characters in length\';\n\t\t\tvar error_text_username_characters = \'Public name must contain only lowercase letters, numbers and "-". It also has to be shorter than 255 characters but longer than 3.\';\n\t\t\tvar error_text_password_short = \'Please use a password of at least 6 characters\';\n\t\t\tvar error_text_password_match = "Passwords don\'t match";\n\n\t\t    var validForm = true;\n\t\t    \n\t\t    var email = $(\'#email_input\').val();\n\t\t    var name = $(\'#name_input\').val();\n\t\t    if (email.length > 255){ renderError(error_text_email_long); validForm = false;}\n\t\t    else if (!validateString(email,"email")){ renderError(error_text_email); validForm = false;}\n\t\t    else if (!($(\'#password_input\').val() === $(\'#password_check_input\').val())){ renderError(error_text_password_match); validForm = false;}\n\t\t    else if ($(\'#password_input\').val().length < 6 ){ renderError(error_text_password_short); validForm = false;}\n\t\t    else if (name && !(validateString(name,"username"))){ renderError(error_text_username_characters); validForm = false;}\n\n\t   \t\tif (!validForm) { \n\t\t        e.preventDefault();\n\t\t        // reactivate the button if the form wasn\'t submitted\n\t\t        $(\'#send\').removeAttr(\'disabled\');\n\t\t        }\n\t\t\t});\n\t});\n\n</script>\n    <div class="toolForm">\n        <form name="registration" id="registration" action="'
        )
        # SOURCE LINE 98
        __M_writer(unicode(form_action))
        __M_writer(
            u'" method="post" >\n            <div class="toolFormTitle">Create account</div>\n            <div class="form-row">\n                <label>Email address:</label>\n                <input id="email_input" type="text" name="email" value="'
        )
        # SOURCE LINE 102
        __M_writer(filters.html_escape(unicode(email)))
        __M_writer(
            u'" size="40"/>\n                <input type="hidden" name="redirect" value="'
        )
        # SOURCE LINE 103
        __M_writer(filters.html_escape(unicode(redirect)))
        __M_writer(
            u'" size="40"/>\n            </div>\n            <div class="form-row">\n                <label>Password:</label>\n                <input id="password_input" type="password" name="password" value="" size="40"/>\n            </div>\n            <div class="form-row">\n                <label>Confirm password:</label>\n                <input id="password_check_input" type="password" name="confirm" value="" size="40"/>\n            </div>\n            <div class="form-row">\n                <label>Public name:</label>\n                <input id="name_input" type="text" name="username" size="40" value="'
        )
        # SOURCE LINE 115
        __M_writer(filters.html_escape(unicode(username)))
        __M_writer(u'"/>\n')
        # SOURCE LINE 116
        if t.webapp.name == 'galaxy':
            # SOURCE LINE 117
            __M_writer(
                u'                    <div class="toolParamHelp" style="clear: both;">\n                        Your public name is an identifier that will be used to generate addresses for information\n                        you share publicly. Public names must be at least four characters in length and contain only lower-case\n                        letters, numbers, and the \'-\' character.\n                    </div>\n'
            )
            # SOURCE LINE 122
        else:
            # SOURCE LINE 123
            __M_writer(
                u'                    <div class="toolParamHelp" style="clear: both;">\n                        Your public name provides a means of identifying you publicly within this tool shed. Public\n                        names must be at least four characters in length and contain only lower-case letters, numbers,\n                        and the \'-\' character.  You cannot change your public name after you have created a repository\n                        in this tool shed.\n                    </div>\n'
            )
            pass
        # SOURCE LINE 130
        __M_writer(u'            </div>\n')
        # SOURCE LINE 131
        if trans.app.config.smtp_server:
            # SOURCE LINE 132
            __M_writer(
                u'                <div class="form-row">\n                    <label>Subscribe to mailing list:</label>\n'
            )
            # SOURCE LINE 134
            if subscribe_checked:
                # SOURCE LINE 135
                __M_writer(u'                        ')
                subscribe_check_box.checked = True

                __M_writer(u'\n')
                pass
            # SOURCE LINE 137
            __M_writer(u'                    ')
            __M_writer(unicode(subscribe_check_box.get_html()))
            __M_writer(
                u'\n                    <p>See <a href="http://galaxyproject.org/wiki/Mailing%20Lists" target="_blank">\n                    all Galaxy project mailing lists</a>.</p>\n                </div>\n'
            )
            pass
        # SOURCE LINE 142
        if user_type_fd_id_select_field and len(
                user_type_fd_id_select_field.options) >= 1:
            # SOURCE LINE 143
            __M_writer(
                u'                <div class="form-row">\n                    <label>User type</label>\n                    '
            )
            # SOURCE LINE 145
            __M_writer(unicode(user_type_fd_id_select_field.get_html()))
            __M_writer(u'\n                </div>\n')
            pass
        # SOURCE LINE 148
        if user_type_form_definition:
            # SOURCE LINE 149
            for field in widgets:
                # SOURCE LINE 150
                __M_writer(
                    u'                    <div class="form-row">\n                        <label>'
                )
                # SOURCE LINE 151
                __M_writer(unicode(field['label']))
                __M_writer(u'</label>\n                        ')
                # SOURCE LINE 152
                __M_writer(unicode(field['widget'].get_html()))
                __M_writer(
                    u'\n                        <div class="toolParamHelp" style="clear: both;">\n                            '
                )
                # SOURCE LINE 154
                __M_writer(unicode(field['helptext']))
                __M_writer(
                    u'\n                        </div>\n                        <div style="clear: both"></div>\n                    </div>\n'
                )
                pass
            # SOURCE LINE 159
            if not user_type_fd_id_select_field:
                # SOURCE LINE 160
                __M_writer(
                    u'                    <input type="hidden" name="user_type_fd_id" value="'
                )
                __M_writer(
                    unicode(
                        trans.security.encode_id(
                            user_type_form_definition.id)))
                __M_writer(u'"/>\n')
                pass
            pass
        # SOURCE LINE 163
        __M_writer(
            u'            <div id="for_bears">\n            If you see this, please leave following field blank. \n            <input type="text" name="bear_field" size="1" value=""/>\n            </div>\n            <div class="form-row">\n                <input type="submit" id="send" name="create_user_button" value="Submit"/>\n            </div>\n        </form>\n'
        )
        # SOURCE LINE 171
        if registration_warning_message:
            # SOURCE LINE 172
            __M_writer(
                u'        <div class="alert alert-danger" style="margin: 30px 12px 12px 12px;">\n            '
            )
            # SOURCE LINE 173
            __M_writer(unicode(registration_warning_message))
            __M_writer(u'           \n        </div>\n')
            pass
        # SOURCE LINE 176
        __M_writer(u'    </div>\n\n')
        return ''
    finally:
        context.caller_stack._pop_frame()
예제 #7
0
def render_render_registration_form(context,form_action=None):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, '__anon_0x6877ad0')._populate(_import_ns, [u'render_msg'])
        username = _import_ns.get('username', context.get('username', UNDEFINED))
        trans = _import_ns.get('trans', context.get('trans', UNDEFINED))
        user_type_form_definition = _import_ns.get('user_type_form_definition', context.get('user_type_form_definition', UNDEFINED))
        confirm = _import_ns.get('confirm', context.get('confirm', UNDEFINED))
        h = _import_ns.get('h', context.get('h', UNDEFINED))
        user_type_fd_id_select_field = _import_ns.get('user_type_fd_id_select_field', context.get('user_type_fd_id_select_field', UNDEFINED))
        widgets = _import_ns.get('widgets', context.get('widgets', UNDEFINED))
        subscribe_checked = _import_ns.get('subscribe_checked', context.get('subscribe_checked', UNDEFINED))
        referer = _import_ns.get('referer', context.get('referer', UNDEFINED))
        cntrller = _import_ns.get('cntrller', context.get('cntrller', UNDEFINED))
        webapp = _import_ns.get('webapp', context.get('webapp', UNDEFINED))
        password = _import_ns.get('password', context.get('password', UNDEFINED))
        email = _import_ns.get('email', context.get('email', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 24
        __M_writer(u'\n\n    ')
        # SOURCE LINE 26

        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' )
            
        
        # SOURCE LINE 31
        __M_writer(u'\n\n    <div class="toolForm">\n        <form name="registration" id="registration" action="')
        # SOURCE LINE 34
        __M_writer(unicode(form_action))
        __M_writer(u'" method="post" >\n            <div class="toolFormTitle">Create account</div>\n            <div class="form-row">\n                <label>Email address:</label>\n                <input type="text" name="email" value="')
        # SOURCE LINE 38
        __M_writer(unicode(email))
        __M_writer(u'" size="40"/>\n                <input type="hidden" name="webapp" value="')
        # SOURCE LINE 39
        __M_writer(unicode(webapp))
        __M_writer(u'" size="40"/>\n                <input type="hidden" name="referer" value="')
        # SOURCE LINE 40
        __M_writer(unicode(referer))
        __M_writer(u'" size="40"/>\n            </div>\n            <div class="form-row">\n                <label>Password:</label>\n                <input type="password" name="password" value="')
        # SOURCE LINE 44
        __M_writer(unicode(password))
        __M_writer(u'" size="40"/>\n            </div>\n            <div class="form-row">\n                <label>Confirm password:</label>\n                <input type="password" name="confirm" value="')
        # SOURCE LINE 48
        __M_writer(unicode(confirm))
        __M_writer(u'" size="40"/>\n            </div>\n            <div class="form-row">\n                <label>Public name:</label>\n                <input type="text" name="username" size="40" value="')
        # SOURCE LINE 52
        __M_writer(unicode(username))
        __M_writer(u'"/>\n                <div class="toolParamHelp" style="clear: both;">\n                    Your public name is an identifier that will be used to generate addresses for information\n                    you share publicly. Public names must be at least four characters in length and contain only lower-case\n                    letters, numbers, and the \'-\' character.\n                </div>\n            </div>\n')
        # SOURCE LINE 59
        if trans.app.config.smtp_server:
            # SOURCE LINE 60
            __M_writer(u'                <div class="form-row">\n                    <label>Subscribe to mailing list:</label>\n')
            # SOURCE LINE 62
            if subscribe_checked:
                # SOURCE LINE 63
                __M_writer(u'                        ')
                subscribe_check_box.checked = True 
                
                __M_writer(u'\n')
            # SOURCE LINE 65
            __M_writer(u'                    ')
            __M_writer(unicode(subscribe_check_box.get_html()))
            __M_writer(u'\n                </div>\n')
        # SOURCE LINE 68
        if user_type_fd_id_select_field:
            # SOURCE LINE 69
            __M_writer(u'                <div class="form-row">\n                    <label>User type</label>\n                    ')
            # SOURCE LINE 71
            __M_writer(unicode(user_type_fd_id_select_field.get_html()))
            __M_writer(u'\n                </div>\n')
        # SOURCE LINE 74
        if user_type_form_definition:
            # SOURCE LINE 75
            for field in widgets:
                # SOURCE LINE 76
                __M_writer(u'                    <div class="form-row">\n                        <label>')
                # SOURCE LINE 77
                __M_writer(unicode(field['label']))
                __M_writer(u'</label>\n                        ')
                # SOURCE LINE 78
                __M_writer(unicode(field['widget'].get_html()))
                __M_writer(u'\n                        <div class="toolParamHelp" style="clear: both;">\n                            ')
                # SOURCE LINE 80
                __M_writer(unicode(field['helptext']))
                __M_writer(u'\n                        </div>\n                        <div style="clear: both"></div>\n                    </div>\n')
            # SOURCE LINE 85
            if not user_type_fd_id_select_field:
                # SOURCE LINE 86
                __M_writer(u'                    <input type="hidden" name="user_type_fd_id" value="')
                __M_writer(unicode(trans.security.encode_id( user_type_form_definition.id )))
                __M_writer(u'"/>\n')
        # SOURCE LINE 89
        __M_writer(u'            <div class="form-row">\n                <input type="submit" name="create_user_button" value="Submit"/>\n            </div>\n        </form>\n    </div>\n\n')
        return ''
    finally:
        context.caller_stack._pop_frame()