Skip to content

Commit f75e86a

Browse files
committed
chore: registration form
1 parent 4e09ced commit f75e86a

3 files changed

Lines changed: 31 additions & 3 deletions

File tree

ckanext/theming/themes/bare/macros/ui/form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
{%- if label -%}
3939
<label for="{{ id }}">{{ label }}</label>
4040
{%- endif %}
41-
<input {{ ui.util.attrs(kwargs) }} name="{{ name }}" id="{{ id }}" type="{{ type }}" value="{{ value }}" />
41+
<input {{ ui.util.attrs(kwargs) }} name="{{ name }}" id="{{ id }}" type="{{ type }}" value="{{ value }}" {{ "required" if required }}/>
4242
{%- if errors -%}
4343
{%- for error in errors -%}
4444
<span>{{ error }}</span><br/>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
{%- call ui.form_block("POST", enctype="multipart/form-data") %}
3+
{{ ui.form_errors(error_summary) }}
4+
5+
{{ ui.input("name", label=_("Username"), value=data.name, error=errors.name, required=true) }}<br/>
6+
{{ ui.input("fullname", label=_("Full Name"), value=data.fullname, errors=errors.fullname) }}<br/>
7+
{{ ui.input("email", label=_("Email"), type="email", value=data.email, errors=errors.email, required=true) }}<br/>
8+
{{ ui.input("password1", label=_("Password"), type="password", value=data.password1, errors=errors.password1, required=true) }}<br/>
9+
{{ ui.input("password2", label=_("Confirm"), type="password", value=data.password2, errors=errors.password2, required=true) }}<br/>
10+
11+
12+
13+
{{ ui.input("image_url", label=_("Profile picture URL"), type="url", value=data.image_url, error=errors.image_url) }}<br/>
14+
15+
{%- if h.uploads_enabled() %}
16+
{{ ui.input("image_upload", label=_("Profile picture"), type="file") }} <br/>
17+
18+
{%- if data.image_url and not data.image_url.startswith('http') %}
19+
{{ ui.checkbox("clear_upload", label=_('Clear Upload')) }} <br/>
20+
{%- endif %}
21+
22+
{%- endif %}
23+
24+
25+
26+
{%- call ui.form_actions_wrapper() -%}
27+
{{ ui.button(_("Create Account"), type="submit", attrs={"name": "save"}) }}
28+
{%- endcall %}
29+
{%- endcall %}

ckanext/theming/themes/bare/user/login.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
{%- block primary_content_inner %}
99
{%- call ui.form_block("POST") %}
1010

11-
{{ error_summary }}
12-
{{ ui.form_errors(errors=error_summary) }}
11+
{{ ui.form_errors(error_summary) }}
1312

1413
{{ ui.input("login", label=_("Username or Email"), error=username_error) }} <br/>
1514
{{ ui.input("password", label=_("Password"), type="password", error=password_error) }} <br/>

0 commit comments

Comments
 (0)