vanilla-framework 4.32.1 → 4.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vanilla-framework",
3
- "version": "4.32.1",
3
+ "version": "4.33.0",
4
4
  "author": {
5
5
  "email": "webteam@canonical.com",
6
6
  "name": "Canonical Webteam"
@@ -9,13 +9,15 @@
9
9
  @param form_action: Action URL for the form submission, typically the form endpoint.
10
10
  @param return_url: URL to return to after form submission
11
11
  @param top_rule_variant (string) (optional): Variant of the top rule, default is "default". Options are "muted", "highlighted", "default", "none".
12
+ @param hide_newsletter_block_rule (boolean) (optional): Whether to hide the newsletter block rule on medium/small screens. Default is false.
12
13
 
13
14
  All Slots:
14
15
  @slot description: Description text, one or more paragraphs
15
16
  @slot addendum: Additional content to include in the form, such as a disclaimer or additional information
16
17
  @slot hidden_fields: Additional hidden fields to include in the form
18
+ @slot honeypot_fields: hidden honeypot fields for spam prevention
17
19
  #}
18
- {%- macro vf_newsletter_signup(form_id, return_url, title_text, form_action="https://ubuntu.com/marketo/submit", input_label="Work email", checkbox_id="canonicalUpdatesOptIn", checkbox_label="I agree to receive information about Canonical's products and services.", layout="25-75", top_rule_variant="default", caller=None) -%}
20
+ {%- macro vf_newsletter_signup(form_id, return_url, title_text, form_action="https://ubuntu.com/marketo/submit", input_label="Work email", checkbox_id="canonicalUpdatesOptIn", checkbox_label="I agree to receive information about Canonical's products and services.", layout="25-75", top_rule_variant="default", hide_newsletter_block_rule=false, caller=None) -%}
19
21
  {% set layout = layout | trim %}
20
22
  {% if layout not in ['50-50', '25-75', '2-col', '4-col'] %}
21
23
  {% set layout = "25-75" %}
@@ -27,6 +29,7 @@
27
29
  {% set description = caller('description') %}
28
30
  {% set addendum = caller('addendum') %}
29
31
  {% set hidden_fields = caller('hidden_fields') %}
32
+ {% set honeypot_fields = caller('honeypot_fields') %}
30
33
  {% set is_section_level = layout in ['50-50', '25-75'] %}
31
34
  {% set is_grid_level = layout in ['2-col', '4-col'] %}
32
35
  {% set heading_level = 'h2' if is_section_level else 'h3' %}
@@ -49,7 +52,7 @@
49
52
  {%- endfor -%}
50
53
  {% endif %}
51
54
  <div class="grid-col{% if layout == '4-col' %}-4{% endif %} {% if is_grid_level %}p-newsletter-signup--{{ layout }}{% endif %}">
52
- {%- if is_grid_level -%}
55
+ {%- if is_grid_level and not hide_newsletter_block_rule -%}
53
56
  <hr class="p-rule--muted u-hide--large {% if layout == '2-col' %}u-hide--medium{% endif %}" />
54
57
  {%- endif -%}
55
58
  <{{ heading_level }}>{{ title_text }}</{{ heading_level }}>
@@ -151,6 +154,28 @@
151
154
  maxlength="255"
152
155
  value="" />
153
156
  {% endif %}
157
+ {% if honeypot_fields %}
158
+ {{ honeypot_fields | safe }}
159
+ {% else %}
160
+ <div class="u-off-screen">
161
+ <label class="website" for="website">Website:</label>
162
+ <input name="website"
163
+ type="text"
164
+ class="website"
165
+ autocomplete="off"
166
+ value=""
167
+ id="website"
168
+ tabindex="-1" />
169
+ <label class="name" for="name">Name:</label>
170
+ <input name="name"
171
+ type="text"
172
+ class="name"
173
+ autocomplete="off"
174
+ value=""
175
+ id="name"
176
+ tabindex="-1" />
177
+ </div>
178
+ {% endif %}
154
179
  </form>
155
180
  </div>
156
181
  </div>