-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser_form.html
More file actions
62 lines (50 loc) · 2.44 KB
/
Copy pathuser_form.html
File metadata and controls
62 lines (50 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{% load actionkit_tags switchcase %}
{% filter remove_blank_lines %}
{% comment %}
To change which fields show, edit {% hide_by_default %} below and set
individual pages' required fields in the page admin, or activate the
User Fields customization option in the page admin to override which
fields are visible and the order they're shown in.
Unhide or require the 'country' field to make the form international. To
geolocate more users outside the United States, unhide/require 'city'.
You can change label text in the language admin, change {% field_order %}
below, edit the CSS, or replace this form entirely with static HTML. See
the advanced template ref for more:
https://roboticdogs.actionkit.com/docs/manual/guide/advanced_templates.html
name email prefix first_name middle_name last_name suffix country address1 address2 city state zip region postal phone
Enjoy!
{% endcomment %}
{% field_order name email prefix first_name middle_name last_name suffix country address1 address2 city state zip region postal phone %}
{% hide_by_default prefix first_name middle_name last_name suffix country phone address1 address2 city state region postal %}
{% for field in user_fields %}
<div id="ak-fieldbox-{{ field.field_name }}" {% if field.field_name|is_in:context.required %}class="required"{% endif %}>
<label for="id_{{ field.field_name }}">
{{ field.label_text }}{% if field.field_name|is_in:context.required %}<span class="ak-required-flag">*</span>{% endif %}
</label>
{% switch field.field_name %}
{% case 'country' %}
{% include "./country_select.html" %}
{% case 'state' %}
{% include "./state_select.html" %}
{% else %}
{{ field.input_html }}
{% endswitch %}
</div>
{% endfor %}
{% if 'country'|is_in:fields %}
<input type="hidden" name="auto_country" value="1">
<style type="text/css">
/* Ensure that, if there's no JavaScript, and there are both
* global-friendly and US-only fields, the global-friendly
* fields show rather than the US-only ones */
{% if 'postal'|is_in:fields %}
#ak-fieldbox-zip { display: none; }
{% endif %}
{% if 'region'|is_in:fields %}
#ak-fieldbox-state { display: none; }
{% endif %}
</style>
{% else %}
<input type="hidden" name="country" value="United States">
{% endif %}
{% endfilter %}