decidim-design 0.28.3 → 0.29.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/app/helpers/decidim/design/activities_helper.rb +23 -23
  3. data/app/helpers/decidim/design/address_helper.rb +45 -20
  4. data/app/helpers/decidim/design/announcement_helper.rb +45 -21
  5. data/app/helpers/decidim/design/application_helper.rb +28 -9
  6. data/app/helpers/decidim/design/author_helper.rb +57 -35
  7. data/app/helpers/decidim/design/buttons_helper.rb +67 -11
  8. data/app/helpers/decidim/design/cards_helper.rb +504 -64
  9. data/app/helpers/decidim/design/colors_helper.rb +33 -29
  10. data/app/helpers/decidim/design/follow_helper.rb +6 -17
  11. data/app/helpers/decidim/design/report_helper.rb +6 -13
  12. data/app/helpers/decidim/design/share_helper.rb +6 -13
  13. data/app/helpers/decidim/design/tab_panels_helper.rb +57 -13
  14. data/app/helpers/decidim/design/typography_helper.rb +4 -3
  15. data/app/packs/entrypoints/decidim_design.js +1 -0
  16. data/app/packs/stylesheets/_datepicker.scss +9 -0
  17. data/app/packs/stylesheets/design.scss +6 -0
  18. data/app/views/decidim/design/components/accordions.html.erb +19 -17
  19. data/app/views/decidim/design/components/activities/_static-activities.html.erb +1 -1
  20. data/app/views/decidim/design/components/activities/_static-activity.html.erb +1 -1
  21. data/app/views/decidim/design/components/activities.html.erb +1 -1
  22. data/app/views/decidim/design/components/address.html.erb +1 -1
  23. data/app/views/decidim/design/components/announcement.html.erb +1 -1
  24. data/app/views/decidim/design/components/author.html.erb +1 -1
  25. data/app/views/decidim/design/components/buttons.html.erb +2 -2
  26. data/app/views/decidim/design/components/cards/_static-card-l-extra-data-2.html.erb +1 -1
  27. data/app/views/decidim/design/components/cards/_static-card-l-image.html.erb +1 -1
  28. data/app/views/decidim/design/components/cards/_static-card-l.html.erb +1 -1
  29. data/app/views/decidim/design/components/cards.html.erb +1 -1
  30. data/app/views/decidim/design/components/dialogs.html.erb +21 -21
  31. data/app/views/decidim/design/components/dropdowns.html.erb +14 -14
  32. data/app/views/decidim/design/components/follow.html.erb +1 -1
  33. data/app/views/decidim/design/components/forms.html.erb +35 -21
  34. data/app/views/decidim/design/components/report.html.erb +1 -1
  35. data/app/views/decidim/design/components/share.html.erb +1 -1
  36. data/app/views/decidim/design/components/tab_panels.html.erb +1 -1
  37. data/app/views/decidim/design/components/tooltips.html.erb +104 -0
  38. data/app/views/decidim/design/foundations/accessibility.html.erb +41 -41
  39. data/app/views/decidim/design/foundations/color.html.erb +6 -3
  40. data/app/views/decidim/design/foundations/iconography.html.erb +4 -3
  41. data/app/views/decidim/design/foundations/layout.html.erb +31 -30
  42. data/app/views/decidim/design/foundations/typography.html.erb +2 -2
  43. data/app/views/decidim/design/home/index.html.erb +6 -6
  44. data/app/views/decidim/design/shared/_cell_call_textarea.html.erb +5 -0
  45. data/app/views/decidim/design/shared/_cell_snippet.html.erb +1 -3
  46. data/app/views/decidim/design/shared/_cell_table.html.erb +12 -0
  47. data/app/views/decidim/design/shared/_table.html.erb +1 -1
  48. data/config/locales/am-ET.yml +1 -0
  49. data/config/locales/ar.yml +7 -0
  50. data/config/locales/bg.yml +309 -0
  51. data/config/locales/ca.yml +309 -0
  52. data/config/locales/cs.yml +258 -0
  53. data/config/locales/da.yml +1 -0
  54. data/config/locales/de.yml +309 -0
  55. data/config/locales/el.yml +1 -0
  56. data/config/locales/en.yml +309 -0
  57. data/config/locales/eo.yml +1 -0
  58. data/config/locales/es-MX.yml +309 -0
  59. data/config/locales/es-PY.yml +309 -0
  60. data/config/locales/es.yml +309 -0
  61. data/config/locales/et.yml +1 -0
  62. data/config/locales/eu.yml +309 -0
  63. data/config/locales/fa-IR.yml +1 -0
  64. data/config/locales/fi-plain.yml +309 -0
  65. data/config/locales/fi.yml +309 -0
  66. data/config/locales/fr-CA.yml +309 -0
  67. data/config/locales/fr.yml +309 -0
  68. data/config/locales/ga-IE.yml +1 -0
  69. data/config/locales/gl.yml +1 -0
  70. data/config/locales/gn-PY.yml +1 -0
  71. data/config/locales/he-IL.yml +1 -0
  72. data/config/locales/hr.yml +1 -0
  73. data/config/locales/hu.yml +1 -0
  74. data/config/locales/id-ID.yml +1 -0
  75. data/config/locales/is-IS.yml +1 -0
  76. data/config/locales/it.yml +1 -0
  77. data/config/locales/ja.yml +309 -0
  78. data/config/locales/ka-GE.yml +1 -0
  79. data/config/locales/kaa.yml +1 -0
  80. data/config/locales/ko.yml +1 -0
  81. data/config/locales/lb.yml +1 -0
  82. data/config/locales/lo-LA.yml +1 -0
  83. data/config/locales/lt.yml +1 -0
  84. data/config/locales/lv.yml +1 -0
  85. data/config/locales/mt.yml +1 -0
  86. data/config/locales/nl.yml +1 -0
  87. data/config/locales/no.yml +9 -0
  88. data/config/locales/oc-FR.yml +1 -0
  89. data/config/locales/om-ET.yml +1 -0
  90. data/config/locales/pl.yml +309 -0
  91. data/config/locales/pt-BR.yml +1 -0
  92. data/config/locales/pt.yml +1 -0
  93. data/config/locales/ro-RO.yml +45 -0
  94. data/config/locales/ru.yml +1 -0
  95. data/config/locales/si-LK.yml +1 -0
  96. data/config/locales/sk.yml +1 -0
  97. data/config/locales/sl.yml +1 -0
  98. data/config/locales/so-SO.yml +1 -0
  99. data/config/locales/sq-AL.yml +1 -0
  100. data/config/locales/sr-CS.yml +1 -0
  101. data/config/locales/sv.yml +1 -0
  102. data/config/locales/sw-KE.yml +1 -0
  103. data/config/locales/th-TH.yml +1 -0
  104. data/config/locales/ti-ER.yml +1 -0
  105. data/config/locales/tr-TR.yml +78 -0
  106. data/config/locales/uk.yml +1 -0
  107. data/config/locales/val-ES.yml +1 -0
  108. data/config/locales/vi.yml +1 -0
  109. data/config/locales/zh-CN.yml +1 -0
  110. data/config/locales/zh-TW.yml +1 -0
  111. data/decidim-design.gemspec +1 -1
  112. data/lib/decidim/design/version.rb +1 -1
  113. metadata +77 -18
  114. data/app/views/decidim/design/components/address/_static-address-online.html.erb +0 -26
  115. data/app/views/decidim/design/components/address/_static-address-person.html.erb +0 -25
  116. data/app/views/decidim/design/components/author/_static-avatar.html.erb +0 -38
  117. data/app/views/decidim/design/components/author/_static-compact.html.erb +0 -46
  118. data/app/views/decidim/design/components/author/_static-default.html.erb +0 -35
  119. data/app/views/decidim/design/components/follow/_static-follow-default.html.erb +0 -4
  120. data/app/views/decidim/design/components/follow/_static-follow-unfollow.html.erb +0 -4
  121. data/app/views/decidim/design/components/report/_static-report.html.erb +0 -34
@@ -1,45 +1,45 @@
1
1
  <% content_for :heading do %>
2
- Dialogs
2
+ <%= t(".title") %>
3
3
  <% end %>
4
4
 
5
5
  <% content_for :description do %>
6
- Dialogs are a javascript feature available thanks to an external library called <a href="https://github.com/jonathanlevaillant/a11y-dialog-component" target="_blank" rel="noopener noreferrer">a11y-dialog-component</a>.
6
+ <%= t(".dialogs_description_html") %>
7
7
  <% end %>
8
8
 
9
9
  <% content_for :toc do %>
10
- <a href="#example">Demo</a>
11
- <a href="#usage">Usage</a>
12
- <a href="#html">HTML tips</a>
10
+ <a href="#example"><%= t("decidim.design.helpers.demo") %></a>
11
+ <a href="#usage"><%= t("decidim.design.helpers.usage") %></a>
12
+ <a href="#html"><%= t("decidim.design.helpers.html_tips") %></a>
13
13
  <% end %>
14
14
 
15
15
  <section id="demo" class="design__section">
16
- <h2>Demo</h2>
16
+ <h2><%= t("decidim.design.helpers.demo") %></h2>
17
17
 
18
- <p>The dialogs, or modal components, are implemented thorugh the rails helper <code>decidim_modal</code>. </p>
18
+ <p><%= t(".dialog_demo_description_html") %></p>
19
19
 
20
20
  <button data-dialog-open="example" class="button button__lg button__secondary">
21
21
  Show modal
22
22
  </button>
23
23
 
24
24
  <%= decidim_modal id: "example" do %>
25
- I am a modal
25
+ I am a modal
26
26
  <% end %>
27
27
  </section>
28
28
 
29
29
  <section id="usage" class="design__section">
30
- <h2>Usage</h2>
30
+ <h2><%= t("decidim.design.helpers.usage") %></h2>
31
31
 
32
- <p>An dialog requires two elements:</p>
32
+ <p><%= t(".usage_description") %></p>
33
33
 
34
- <p>1. A user actionable element, with the data-attribute <code>data-dialog-open="example"</code>, where example is the <code>id</code> of the modal.</p>
34
+ <p><%= t(".usage_description_html") %></p>
35
35
 
36
- <p>2. A modal element, whose <code>id</code> matches the data-target value the trigger refers to.</p>
36
+ <p><%= t(".usage_description_2_html") %></p>
37
37
 
38
38
  <div class="design__section-snippet" style="margin-top: inherit;">
39
- <p>Source code on GitHub: <%= link_to("decidim-core/app/packs/src/decidim/a11y.js", "https://github.com/decidim/decidim/blob/develop/decidim-core/app/packs/src/decidim/a11y.js", target: "_blank", rel: "noopener noreferrer") %></p>
39
+ <p><%= t("decidim.design.home.index.github_source") %>: <%= link_to("decidim-core/app/packs/src/decidim/a11y.js", "https://github.com/decidim/decidim/blob/develop/decidim-core/app/packs/src/decidim/a11y.js", target: "_blank", rel: "noopener noreferrer") %></p>
40
40
 
41
41
  <code>
42
- <textarea rows="7">
42
+ <textarea spellcheck="false" rows="7">
43
43
  &lt;button data-dialog-open=&quot;example&quot; class=&quot;button button__lg button__secondary&quot;&gt;
44
44
  Show modal
45
45
  &lt;/button&gt;
@@ -53,24 +53,24 @@
53
53
  </section>
54
54
 
55
55
  <section id="html" class="design__section">
56
- <h2>HTML tips</h2>
56
+ <h2><%= t("decidim.design.helpers.html_tips") %></h2>
57
57
 
58
- <p>In order to display a complex modal, matching up the styles, do the following markup:</p>
58
+ <p><%= t(".tips_description") %></p>
59
59
 
60
- <p>Pay attention to the <i>data-attributes</i> and the <i>ids</i>. For instance, the <code>[data-dialog-title]</code>'s id starts with <i>dialog-title</i> plus the <i>modal id</i>.</p>
60
+ <p><%= t(".tips_description_html") %></p>
61
61
 
62
62
  <div class="design__section-snippet" style="margin-top: inherit;">
63
63
  <code>
64
- <textarea rows="20">
64
+ <textarea spellcheck="false" rows="20">
65
65
  &#60;%= decidim_modal id: "example" do %&#62;
66
66
  <div data-dialog-container>
67
- &#60;%= icon "icon_identificator" %&#62; // ... pick a desired icon
67
+ &#60;%= icon "icon_identifier" %&#62; // ... pick a desired icon
68
68
  <h3 id="dialog-title-example" tabindex="-1" data-dialog-title>
69
69
  Modal title
70
70
  </h3>
71
71
  <div>
72
72
  <p id="dialog-desc-example">
73
- Modal description (optional)
73
+ Modal description (optional)
74
74
  </p>
75
75
 
76
76
  // ... add more HTML
@@ -78,7 +78,7 @@
78
78
  </div>
79
79
  <div data-dialog-actions>
80
80
  <button data-dialog-close="example">
81
- Close modal
81
+ Close modal
82
82
  </button>
83
83
  // ... add more buttons
84
84
  </div>
@@ -1,24 +1,24 @@
1
1
  <% content_for :heading do %>
2
- Dropdowns
2
+ <%= t("decidim.design.helpers.dropdowns") %>
3
3
  <% end %>
4
4
 
5
5
  <% content_for :description do %>
6
- Dropdowns are a javascript feature available thanks to an external library called <a href="https://github.com/jonathanlevaillant/a11y-dropdown-component" target="_blank" rel="noopener noreferrer">a11y-dropdown-component</a>.
6
+ <%= t("decidim.design.helpers.dropdowns_description_html", link: link_to(t("decidim.design.helpers.ally_link"), "https://github.com/jonathanlevaillant/a11y-dropdown-component", target: "_blank", rel: "noopener noreferrer")) %>
7
7
  <% end %>
8
8
 
9
9
  <% content_for :toc do %>
10
- <a href="#example">Demo</a>
11
- <a href="#usage">Usage</a>
10
+ <a href="#example"><%= t("decidim.design.helpers.demo") %></a>
11
+ <a href="#usage"><%= t("decidim.design.helpers.usage") %></a>
12
12
  <% end %>
13
13
 
14
14
  <section id="demo" class="design__section">
15
- <h2>Demo</h2>
15
+ <h2><%= t("decidim.design.helpers.demo") %></h2>
16
16
 
17
- <p>The dropdowns are used along the application in order to collapse large, easy-readable menus for desktop devices, but too wordy for mobile devices.</p>
17
+ <p><%= t("decidim.design.helpers.dropdowns_demo_description") %></p>
18
18
 
19
- <p>This javascript feature is enhanced with a small css, through the naming: the hideable content MUST HAVE an <code>id</code> starting with <i>dropdown-menu</i>.</p>
19
+ <p><%= t("decidim.design.helpers.dropdowns_demo_description_html") %></p>
20
20
 
21
- <p>The following example will not be noticeable in desktop, but mobile:</p>
21
+ <p><%= t("decidim.design.helpers.dropdowns_demo_1_description") %></p>
22
22
 
23
23
  <button id="dropdown-trigger-element" data-component="dropdown" data-target="dropdown-menu-element" data-auto-close="true">
24
24
  <span><%= t("decidim.searches.filters.jump_to") %></span>
@@ -36,19 +36,19 @@
36
36
  </section>
37
37
 
38
38
  <section id="usage" class="design__section">
39
- <h2>Usage</h2>
39
+ <h2><%= t("decidim.design.helpers.usage") %></h2>
40
40
 
41
- <p>An dropdown requires two elements:</p>
41
+ <p><%= t("decidim.design.helpers.dropdowns_usage_description") %></p>
42
42
 
43
- <p>1. A user actionable element, with the data-attributes <code>data-component="dropdown" data-target="dropdown-menu-element"</code>.</p>
43
+ <p><%= t("decidim.design.helpers.dropdowns_usage_description_html") %></p>
44
44
 
45
- <p>2. A hideable element, whose <code>id</code> matches the data-target value the trigger refers to.</p>
45
+ <p><%= t("decidim.design.helpers.dropdowns_usage_1_description") %></p>
46
46
 
47
47
  <div class="design__section-snippet" style="margin-top: inherit;">
48
- <p>Source code on GitHub: <%= link_to("decidim-core/app/packs/src/decidim/a11y.js", "https://github.com/decidim/decidim/blob/develop/decidim-core/app/packs/src/decidim/a11y.js", target: "_blank", rel: "noopener noreferrer") %></p>
48
+ <p><%= t("decidim.design.home.index.github_source") %>: <%= link_to("decidim-core/app/packs/src/decidim/a11y.js", "https://github.com/decidim/decidim/blob/develop/decidim-core/app/packs/src/decidim/a11y.js", target: "_blank", rel: "noopener noreferrer") %></p>
49
49
 
50
50
  <code>
51
- <textarea rows="8">
51
+ <textarea spellcheck="false" rows="8">
52
52
  &lt;button id=&quot;dropdown-trigger-element&quot; data-component=&quot;dropdown&quot; data-target=&quot;dropdown-menu-element&quot;&gt;
53
53
  Trigger
54
54
  &lt;/button&gt;
@@ -1,5 +1,5 @@
1
1
  <% content_for :heading do %>
2
- Follow
2
+ <%= t(".title") %>
3
3
  <% end %>
4
4
 
5
5
  <% content_for :toc do %>
@@ -1,21 +1,22 @@
1
1
  <% content_for :heading do %>
2
- <%= cell "decidim/announcement", "This page comes from a legacy view. Content is outdated.", callout_class: "alert" %>
3
- Forms
2
+ <%= cell "decidim/announcement", t(".header_alert"), callout_class: "alert" %>
3
+ <%= t(".title") %>
4
4
  <% end %>
5
5
 
6
6
  <% content_for :toc do %>
7
- <a href="#common">HTML regular inputs</a>
8
- <a href="#helps">Help texts</a>
9
- <a href="#disabled">Disabled</a>
10
- <a href="#error">Errors</a>
11
- <a href="#length">Min/Max length</a>
12
- <a href="#emoji">Emojis</a>
7
+ <a href="#common"><%= t(".html_regular_inputs") %></a>
8
+ <a href="#helps"><%= t(".help_texts") %></a>
9
+ <a href="#disabled"><%= t(".disabled") %></a>
10
+ <a href="#error"><%= t(".errors") %></a>
11
+ <a href="#length"><%= t(".min_max_length") %></a>
12
+ <a href="#emoji"><%= t(".emojis") %></a>
13
+ <a href="#multiselect"><%= t(".multiselect") %></a>
13
14
  <% end %>
14
15
 
15
16
  <%
16
17
  text_types = [
17
18
  "date",
18
- # "datetime-local",
19
+ "datetime_local",
19
20
  # "email",
20
21
  # "month",
21
22
  "number",
@@ -32,15 +33,15 @@
32
33
  %>
33
34
 
34
35
  <section id="common-panel" class="design__section">
35
- <h2 class="h2">HTML regular inputs</h2>
36
+ <h2 class="h2"><%= t(".html_regular_inputs") %></h2>
36
37
 
37
38
  <div class="form__wrapper">
38
- <%= cell "decidim/announcement", "Only displays common types, full available list: date, datetime-local, email, month, number, password, search, tel, text, time, url, week" %>
39
+ <%= cell "decidim/announcement", t(".regular_inputs_description") %>
39
40
 
40
41
  <% text_types.each do |element| %>
41
42
  <label>
42
43
  input type="<%= element %>"
43
- <input type="<%= element %>">
44
+ <input type="<%= element %>" <% if %w(datetime-local date).include?(element) %> hide_help="true" <% end %>>
44
45
  </label>
45
46
  <% end %>
46
47
 
@@ -74,7 +75,7 @@
74
75
  </section>
75
76
 
76
77
  <section id="helps" class="design__section">
77
- <h2 class="h2">Help texts</h2>
78
+ <h2 class="h2"><%= t(".help_texts") %></h2>
78
79
 
79
80
  <div class="form__wrapper">
80
81
  <% text_types.each do |element| %>
@@ -118,7 +119,7 @@
118
119
  </section>
119
120
 
120
121
  <section id="disabled" class="design__section">
121
- <h2 class="h2">Disabled</h2>
122
+ <h2 class="h2"><%= t(".disabled") %></h2>
122
123
 
123
124
  <div class="form__wrapper">
124
125
  <% text_types.each do |element| %>
@@ -158,10 +159,10 @@
158
159
  </section>
159
160
 
160
161
  <section id="error" class="design__section">
161
- <h2 class="h2">Errors</h2>
162
+ <h2 class="h2"><%= t(".errors") %></h2>
162
163
 
163
164
  <div class="form__wrapper">
164
- <%= cell "decidim/announcement", "Does not apply for select" %>
165
+ <%= cell "decidim/announcement", t(".errors_description") %>
165
166
 
166
167
  <% text_types.each do |element| %>
167
168
  <label>
@@ -186,7 +187,7 @@
186
187
  <% end %>
187
188
 
188
189
  <label>
189
- textarea required
190
+ <%= t(".textarea_required") %>
190
191
  <textarea cols="30" rows="10" required></textarea>
191
192
  <div class="form-error">Lorem ipsum dolor sit amet.</div>
192
193
  </label>
@@ -194,10 +195,10 @@
194
195
  </section>
195
196
 
196
197
  <section id="length" class="design__section">
197
- <h2 class="h2">Min/Max length</h2>
198
+ <h2 class="h2"><%= t(".min_max_length") %></h2>
198
199
 
199
200
  <div class="form__wrapper">
200
- <%= cell "decidim/announcement", "Only works for input type='text' and textarea" %>
201
+ <%= cell "decidim/announcement", t(".min_max_length_description") %>
201
202
 
202
203
  <label>
203
204
  input type="text" maxlength="20"
@@ -222,10 +223,10 @@
222
223
  </section>
223
224
 
224
225
  <section id="emoji" class="design__section">
225
- <h2 class="h2">Emojis</h2>
226
+ <h2 class="h2"><%= t(".emojis") %></h2>
226
227
 
227
228
  <div class="form__wrapper">
228
- <%= cell "decidim/announcement", "Only works for textarea" %>
229
+ <%= cell "decidim/announcement", t(".emojis_description") %>
229
230
 
230
231
  <label>
231
232
  textarea data-input-emoji="true"
@@ -233,3 +234,16 @@
233
234
  </label>
234
235
  </div>
235
236
  </section>
237
+
238
+ <section id="multiselect" class="design__section">
239
+ <h2 class="h2"><%= t(".multiselect") %></h2>
240
+
241
+ <div class="form__wrapper">
242
+ <p><%= t(".multiselect_description_html") %></p>
243
+
244
+ <label>
245
+ input type="text" class="js-tags-container" value="abc, 123"
246
+ <input type="text" class="js-tags-container" value="abc, 123">
247
+ </label>
248
+ </div>
249
+ </section>
@@ -1,5 +1,5 @@
1
1
  <% content_for :heading do %>
2
- Report
2
+ <%= t(".title") %>
3
3
  <% end %>
4
4
 
5
5
  <% content_for :toc do %>
@@ -1,5 +1,5 @@
1
1
  <% content_for :heading do %>
2
- Share
2
+ <%= t(".title") %>
3
3
  <% end %>
4
4
 
5
5
  <% content_for :toc do %>
@@ -1,5 +1,5 @@
1
1
  <% content_for :heading do %>
2
- Tab Panels
2
+ <%= t(".title") %>
3
3
  <% end %>
4
4
 
5
5
  <% content_for :toc do %>
@@ -0,0 +1,104 @@
1
+ <% content_for :heading do %>
2
+ <%= t(".title") %>
3
+ <% end %>
4
+
5
+ <% content_for :description do %>
6
+ <%= t(".description") %>
7
+ <% end %>
8
+
9
+ <% content_for :toc do %>
10
+ <a href="#demo"><%= t(".demo") %></a>
11
+ <a href="#usage"><%= t(".usage") %></a>
12
+ <% end %>
13
+
14
+ <section id="demo" class="design__section">
15
+ <h2><%= t(".demo") %></h2>
16
+
17
+ <p><%= t(".demo_description") %></p>
18
+
19
+ <table class="design__table">
20
+ <thead>
21
+ <th><%= t(".demo") %></th>
22
+ <th><%= t(".usage") %></th>
23
+ </thead>
24
+ <tbody>
25
+ <tr>
26
+ <td>
27
+ <%= with_tooltip("Hello world", class: :top) do %>
28
+ <span>Hover me</span>
29
+ <% end %>
30
+ </td>
31
+ <td>
32
+ class: :top
33
+ </td>
34
+ </tr>
35
+ <tr>
36
+ <td>
37
+ <%= with_tooltip("Hello world", class: :bottom) do %>
38
+ <span>Hover me</span>
39
+ <% end %>
40
+ </td>
41
+ <td>
42
+ class: :bottom
43
+ </td>
44
+ </tr>
45
+ <tr>
46
+ <td>
47
+ <%= with_tooltip("Hello world", class: :left) do %>
48
+ <span>Hover me</span>
49
+ <% end %>
50
+ </td>
51
+ <td>
52
+ class: :left
53
+ </td>
54
+ </tr>
55
+ <tr>
56
+ <td>
57
+ <%= with_tooltip("Hello world", class: :right) do %>
58
+ <span>Hover me</span>
59
+ <% end %>
60
+ </td>
61
+ <td>
62
+ class: :right
63
+ </td>
64
+ </tr>
65
+ </tbody>
66
+ </table>
67
+ </section>
68
+
69
+ <section id="usage" class="design__section">
70
+ <h2><%= t(".usage") %></h2>
71
+
72
+ <p><%= t(".usage_p") %></p>
73
+
74
+ <p><%= t(".usage_p_1_html") %></p>
75
+
76
+ <p><%= t(".usage_p_2_html") %></p>
77
+
78
+ <p><%= t(".usage_p_3_html") %></p>
79
+
80
+ <div class="design__section-snippet" style="margin-top: inherit;">
81
+ <% github_link = "https://github.com/decidim/decidim/blob/develop/decidim-core/app/packs/src/decidim/tooltips.js" %>
82
+ <p><%= t(".github_source_html", github_link: link_to("decidim-core/app/packs/src/decidim/tooltips.js", github_link, target: "_blank", rel: "noopener noreferrer")) %></p>
83
+
84
+ <code>
85
+ <textarea spellcheck="false" rows="16">
86
+ <%%= with_tooltip("Hello world", class: :top) do %>
87
+ <span>Hover me</span>
88
+ <%% end %>
89
+
90
+ <%%= with_tooltip("Hello world", class: :bottom) do %>
91
+ <span>Hover me</span>
92
+ <%% end %>
93
+
94
+ <%%= with_tooltip("Hello world", class: :right) do %>
95
+ <span>Hover me</span>
96
+ <%% end %>
97
+
98
+ <%%= with_tooltip("Hello world", class: :left) do %>
99
+ <span>Hover me</span>
100
+ <%% end %>
101
+ </textarea>
102
+ </code>
103
+ </div>
104
+ </section>
@@ -1,99 +1,99 @@
1
1
  <% content_for :heading do %>
2
- Accessibility
2
+ <%= t(".accessibility_title") %>
3
3
  <% end %>
4
4
 
5
5
  <% content_for :description do %>
6
- <p>Decidim follows the <u>Web Content Accessibility Guidelines (WCAG) 2.1</u>.</p>
6
+ <p><%= t(".decidim_follows_html") %></p>
7
7
  <% end %>
8
8
 
9
9
  <% content_for :toc do %>
10
- <a href="#heading-order">Illogical heading order</a>
11
- <a href="#unique-h1">Unique H1</a>
12
- <a href="#one-heading">Heading on important sections</a>
13
- <a href="#color-contrast">Color contrast</a>
14
- <a href="#links-buttons">Links and buttons</a>
15
- <a href="#a11y-labels">Accessibility labels</a>
16
- <a href="#adjacent-links">Adjacent links</a>
17
- <a href="#aria">Use ARIA</a>
18
- <a href="#elements-hidden">Elements hidden</a>
10
+ <a href="#heading-order"><%= t(".illogical_heading_order") %></a>
11
+ <a href="#unique-h1"><%= t(".unique_h1") %></a>
12
+ <a href="#one-heading"><%= t(".heading_on") %></a>
13
+ <a href="#color-contrast"><%= t(".color_contrast") %></a>
14
+ <a href="#links-buttons"><%= t(".links_and_buttons") %></a>
15
+ <a href="#a11y-labels"><%= t(".accessibility_labels") %></a>
16
+ <a href="#adjacent-links"><%= t(".adjacent_links") %></a>
17
+ <a href="#aria"><%= t(".use_aria") %></a>
18
+ <a href="#elements-hidden"><%= t(".elements_hidden") %></a>
19
19
  <% end %>
20
20
 
21
21
  <section id="heading-order" class="design__section">
22
- <h2>Illogical heading order</h2>
22
+ <h2><%= t(".illogical_heading_order") %></h2>
23
23
 
24
- <p>Every page should have a logical heading order when using the &#60;h1&#62;, &#60;h2&#62;, &#60;h3&#62;, &#60;h4&#62;, &#60;h5&#62; and &#60;h6&#62; heading elements.</p>
24
+ <p><%= t(".illogical_heading_paragraph") %></p>
25
25
 
26
- <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_illogical_heading_order" target="_blank" rel="noopener noreferrer">here</a></p>
26
+ <p><%= t(".see_further_info_html", link: link_to(t(".here_link"), "https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_illogical_heading_order", target: "_blank", rel: "noopener noreferrer")) %></p>
27
27
  </section>
28
28
 
29
29
  <section id="unique-h1" class="design__section">
30
- <h2>Unique H1</h2>
30
+ <h2><%= t(".unique_h1") %></h2>
31
31
 
32
- <p>Every page should have a unique H1 heading on it</p>
32
+ <p><%= t(".unique_h1_paragraph") %></p>
33
33
 
34
- <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_unique_h1_on_every_page" target="_blank" rel="noopener noreferrer">here</a></p>
34
+ <p><%= t(".see_further_info_html", link: link_to(t(".here_link"), "https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_unique_h1_on_every_page", target: "_blank", rel: "noopener noreferrer")) %></p>
35
35
  </section>
36
36
 
37
37
  <section id="one-heading" class="design__section">
38
- <h2>Heading on important sections</h2>
38
+ <h2><%= t(".important_sections_heading") %></h2>
39
39
 
40
- <p>It is highly important that each important section of the page has a heading to make it easier to understand what important sections are on the page just by browsing through its headings.</p>
40
+ <p><%= t(".important_sections_paragraph") %></p>
41
41
 
42
- <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_heading_on_important_sections" target="_blank" rel="noopener noreferrer">here</a></p>
42
+ <p><%= t(".see_further_info_html", link: link_to(t(".here_link"), "https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_heading_on_important_sections", target: "_blank", rel: "noopener noreferrer")) %></p>
43
43
  </section>
44
44
 
45
45
  <section id="color-contrast" class="design__section">
46
- <h2>Color contrast</h2>
46
+ <h2><%= t(".color_contrast") %></h2>
47
47
 
48
- <p>When creating user interfaces or modifying the colors, always make sure that you are not breaking accessibility with your changes. You can use the Color contrast checker to ensure that your colors have enough contrast against the background color where they are displayed at.</p>
48
+ <p><%= t(".color_contrast_paragraph") %></p>
49
49
 
50
- <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_color_contrast " target="_blank" rel="noopener noreferrer">here</a></p>
50
+ <p><%= t(".see_further_info_html", link: link_to(t(".here_link"), "https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_color_contrast ", target: "_blank", rel: "noopener noreferrer")) %></p>
51
51
  </section>
52
52
 
53
53
  <section id="links-buttons" class="design__section">
54
- <h2>Links and buttons</h2>
54
+ <h2><%= t(".links_and_buttons") %></h2>
55
55
 
56
- <p>The anchor elements (i.e. links) are meant to link to different pages or to anchor positions within the page. If the element is supposed to e.g. open some hidden item on that page, you should use the &#60;button&#62; element instead.</p>
56
+ <p><%= t(".links_and_buttons_paragraph") %></p>
57
57
 
58
- <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_links_and_buttons" target="_blank" rel="noopener noreferrer">here</a></p>
58
+ <p><%= t(".see_further_info_html", link: link_to(t(".here_link"), "https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_links_and_buttons", target: "_blank", rel: "noopener noreferrer")) %></p>
59
59
  </section>
60
60
 
61
61
  <section id="a11y-labels" class="design__section">
62
- <h2>Accessibility labels</h2>
62
+ <h2><%= t(".accessibility_labels") %></h2>
63
63
 
64
- <p>When defining elements, always make sure they make sense for screen reader users.</p>
64
+ <p><%= t(".accessibility_labels_paragraph") %></p>
65
65
 
66
- <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_accessibility_labels" target="_blank" rel="noopener noreferrer">here</a></p>
66
+ <p><%= t(".see_further_info_html", link: link_to(t(".here_link"), "https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_accessibility_labels", target: "_blank", rel: "noopener noreferrer")) %></p>
67
67
  </section>
68
68
 
69
69
  <section id="adjacent-links" class="design__section">
70
- <h2>Adjacent links for the same resource</h2>
70
+ <h2><%= t(".adjacent_links_header") %></h2>
71
71
 
72
- <p>If the same resource has multiple adjacent links pointing to it, it makes it difficult for such users to glance through the page because they might need to go through multiple links to get to the next resource.</p>
72
+ <p><%= t(".adjacent_links_paragraph") %></p>
73
73
 
74
- <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_adjacent_links_for_the_same_resource" target="_blank" rel="noopener noreferrer">here</a></p>
74
+ <p><%= t(".see_further_info_html", link: link_to(t(".here_link"), "https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_adjacent_links_for_the_same_resource", target: "_blank", rel: "noopener noreferrer")) %></p>
75
75
  </section>
76
76
 
77
77
  <section id="dynamic-changes" class="design__section">
78
- <h2>Dynamic functionality changes the page context unintuitively</h2>
78
+ <h2><%= t(".dynamic_changes_header") %></h2>
79
79
 
80
- <p>Changes in the form inputs should not change the context of the page automatically.</p>
80
+ <p><%= t(".dynamic_changes_paragraph") %></p>
81
81
 
82
- <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_dynamic_functionality_changes_the_page_context_unintuitively" target="_blank" rel="noopener noreferrer">here</a></p>
82
+ <p><%= t(".see_further_info_html", link: link_to(t(".here_link"), "https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_dynamic_functionality_changes_the_page_context_unintuitively", target: "_blank", rel: "noopener noreferrer")) %></p>
83
83
  </section>
84
84
 
85
85
  <section id="aria" class="design__section">
86
- <h2>Use ARIA attributes where possible</h2>
86
+ <h2><%= t(".use_aria_header") %></h2>
87
87
 
88
- <p>Many elements that provide interactive functionality on the website require ARIA attributes on them to make them accessible.</p>
88
+ <p><%= t(".use_aria_paragraph") %></p>
89
89
 
90
- <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_use_aria_attributes_where_possible" target="_blank" rel="noopener noreferrer">here</a></p>
90
+ <p><%= t(".see_further_info_html", link: link_to(t(".here_link"), "https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_use_aria_attributes_where_possible", target: "_blank", rel: "noopener noreferrer")) %></p>
91
91
  </section>
92
92
 
93
93
  <section id="elements-hidden" class="design__section">
94
- <h2>Elements hidden from the accessibility API</h2>
94
+ <h2><%= t(".elements_hidden_header") %></h2>
95
95
 
96
- <p>To hide an element from assistive technologies, use the aria-hidden="true" attribute on it.</p>
96
+ <p><%= t(".elements_hidden_paragraph") %></p>
97
97
 
98
- <p>See further info <a href="https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_elements_hidden_from_the_accessibility_api" target="_blank" rel="noopener noreferrer">here</a></p>
98
+ <p><%= t(".see_further_info_html", link: link_to(t(".here_link"), "https://docs.decidim.org/en/develop/develop/guide_accessibility.html#_elements_hidden_from_the_accessibility_api", target: "_blank", rel: "noopener noreferrer")) %></p>
99
99
  </section>
@@ -1,10 +1,13 @@
1
1
  <% content_for :heading do %>
2
- Color
2
+ <%= t(".color_header") %>
3
3
  <% end %>
4
4
 
5
5
  <% content_for :description do %>
6
- <p>We provide a Base palette with few colors so simple customizations are easy. You can modify the Base palette either in the Administration area or in the Tailwind configuration file if you need more advanced customization.</p>
7
- <p>When customizing your colors, have in mind the <%= link_to "WCAG 2.1 AA compliant contrast ratios", "https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html" %>. You can check the contrast of your choosing with <%= link_to "WebAIM Contrast Checker", "https://webaim.org/resources/contrastchecker" %> or other similar tools.</p>
6
+ <p><%= t(".description_p1") %></p>
7
+ <p><%= t(".description_p2_html",
8
+ contrast_link: link_to(t(".wcag_compliant_rations"), "https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html", target: "_blank", rel: "noopener noreferrer"),
9
+ checker_link: link_to(t(".wcag_contrast_checker"), "https://webaim.org/resources/contrastchecker", target: "_blank", rel: "noopener noreferrer")
10
+ ) %></p>
8
11
  <% end %>
9
12
 
10
13
  <% content_for :toc do %>
@@ -1,10 +1,11 @@
1
1
  <% content_for :heading do %>
2
- Iconography
2
+ <%= t(".title") %>
3
3
  <% end %>
4
4
 
5
5
  <% content_for :description do %>
6
- <p>We use icons to reinforce the meaning of actions, titles, etc.</p>
7
- <p>We use the Remixicon open source library: <a href="https://remixicon.com" target="_blank" rel="noopener noreferrer">https://remixicon.com</a></p>
6
+ <p><%= t(".description_iconography") %></p>
7
+ <% iconography_link_url = "https://remixicon.com" %>
8
+ <p><%= t(".description_iconography_html", iconography_link: link_to(iconography_link_url, iconography_link_url, target: "_blank", rel: "noopener noreferrer")) %></p>
8
9
  <% end %>
9
10
 
10
11
  <% content_for :toc do %>