decidim-admin 0.26.2 → 0.26.3

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.

Potentially problematic release.


This version of decidim-admin might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97fdadb0f95fb35e376ce50f1993b01bacd1e48cd38c26833f3c05363dbe92dd
4
- data.tar.gz: 84c37c9fd8a1324d726a51a825226525b649f48662fc2a2aea1db4a94b113712
3
+ metadata.gz: a33b1f86d32bce28471d7e0cae6d58f3f0b8734e8588543b249f0eae9a187707
4
+ data.tar.gz: 5ade51348a77a2ba45c95cb747cdf31ea9f743ce2b36753f102ebd6399fc4789
5
5
  SHA512:
6
- metadata.gz: c1c93d628c2ad30b4638744ff0719df7272af2e86c4e69da2e0b06ce3d1618bb93a9cd0c55929ae412b5a2564f335e9256bd5828b043e86fbc87eec318005173
7
- data.tar.gz: 1d5dac5589f5e83dafab2850cf35daf48af6de7183ae9ce4a1e80c249afe29038091f643e1b31f7c868a92463a840f16314b3e859b3a9f6fb4324511f21f8c36
6
+ metadata.gz: 477ee263630fb1af968f73a922d899819908e60faa909e13ed3c585404b9e4c09fe4dd83bf4c458f1ff62a4e7844e6d663e28f32ed64ad9d7475f5ab5632b463
7
+ data.tar.gz: eaae371f50ec70b88bc4805a16157aee750bcc8a1b0edcc924f35ea8b4dd434759d36a33874147402c181bf87c6da60cd231bdf3fc97e2222f38cd53a7968412
@@ -30,11 +30,11 @@ module Decidim
30
30
  end
31
31
 
32
32
  def users
33
- search(current_organization.users)
33
+ search(current_organization.users.available)
34
34
  end
35
35
 
36
36
  def user_entities
37
- search(current_organization.user_entities)
37
+ search(current_organization.user_entities.available)
38
38
  end
39
39
 
40
40
  private
@@ -51,7 +51,7 @@ module Decidim
51
51
  query.where("email ILIKE ?", "%#{term}%")
52
52
  )
53
53
  end
54
- render json: query.all.collect { |u| { value: u.id, label: "#{u.name} (@#{u.nickname}) #{u.email}" } }
54
+ render json: query.all.collect { |u| { value: u.id, label: "#{u.name} (@#{u.nickname})" } }
55
55
  else
56
56
  render json: []
57
57
  end
@@ -83,7 +83,7 @@ module Decidim
83
83
  end
84
84
 
85
85
  def manifest_name
86
- @manifest_name ||= resource.manifest.name
86
+ @manifest_name ||= resource.resource_manifest.name
87
87
  end
88
88
 
89
89
  def permissions
@@ -18,16 +18,19 @@ module Decidim
18
18
  time: :datetime_field
19
19
  }.freeze
20
20
 
21
- # Public: Renders a form field that matches a settings attribute's
22
- # type.
21
+ # Renders a form field that matches a settings attribute's type.
22
+ # Besides the field itself, it also renders all the metadata (like the labels and help texts)
23
23
  #
24
- # form - The form in which to render the field.
25
- # attribute - The Settings::Attribute instance with the
26
- # description of the attribute.
27
- # name - The name of the field.
28
- # options - Extra options to be passed to the field helper.
29
- #
30
- # Returns a rendered form field.
24
+ # @param form [Decidim::Admin::FormBuilder] The form in which to render the field
25
+ # @param attribute [Decidim::SettingsManifest::Attribute] The Settings::Attribute instance with the
26
+ # description of the attribute.
27
+ # @param name [Symbol] The name of the field.
28
+ # @param i18n_scope [String] The scope where it'll find all the texts for the internationalization (locales)
29
+ # @param options [Hash] Extra options to be passed to the field helper.
30
+ # @option options [String] :tabs_prefix The type of the setting.
31
+ # It can be "global-settings" or "step-N-settings", where N is the number of the step.
32
+ # @option options [nil, Boolean] :readonly True if the input is readonly.
33
+ # @return [ActiveSupport::SafeBuffer] Rendered form field.
31
34
  def settings_attribute_input(form, attribute, name, i18n_scope, options = {})
32
35
  form_method = form_method_for_attribute(attribute)
33
36
 
@@ -62,6 +65,18 @@ module Decidim
62
65
 
63
66
  private
64
67
 
68
+ # Renders a select field collection input for the given attribute
69
+ #
70
+ # @param form (see #settings_attribute_input)
71
+ # @param attribute (see #settings_attribute_input)
72
+ # @param name (see #settings_attribute_input)
73
+ # @param i18n_scope (see #settings_attribute_input)
74
+ # @param options (see #settings_attribute_input)
75
+ # @option :tabs_prefix (see #settings_attribute_input)
76
+ # @option :readonly (see #settings_attribute_input)
77
+ # @option options [String] :label The label that this field has
78
+ # @option options [String] :help_text The help text shown after the input field
79
+ # @return (see #settings_attribute_input)
65
80
  def render_select_form_field(form, attribute, name, i18n_scope, options)
66
81
  html = form.select(
67
82
  name,
@@ -73,6 +88,17 @@ module Decidim
73
88
  end
74
89
 
75
90
  # Returns a radio buttons collection input for the given attribute
91
+ #
92
+ # @param form (see #settings_attribute_input)
93
+ # @param attribute (see #settings_attribute_input)
94
+ # @param name (see #settings_attribute_input)
95
+ # @param i18n_scope (see #settings_attribute_input)
96
+ # @param options (see #settings_attribute_input)
97
+ # @option :tabs_prefix (see #settings_attribute_input)
98
+ # @option :readonly (see #settings_attribute_input)
99
+ # @option :label (see #render_select_form_field)
100
+ # @option :help_text (see #render_select_form_field)
101
+ # @return (see #settings_attribute_input)
76
102
  def render_enum_form_field(form, attribute, name, i18n_scope, options)
77
103
  html = label_tag(name) do
78
104
  concat options[:label]
@@ -88,13 +114,25 @@ module Decidim
88
114
  html
89
115
  end
90
116
 
117
+ # Get the translation for a given attribute
91
118
  # Returns a translation or nil. If nil, ZURB Foundation won't add the help_text.
119
+ #
120
+ # @param name (see #settings_attribute_input)
121
+ # @param suffix [String] What suffix the i18n key has
122
+ # @param i18n_scope (see #settings_attribute_input)
123
+ # @return [String, nil]
92
124
  def text_for_setting(name, suffix, i18n_scope)
125
+ html_key = "#{i18n_scope}.#{name}_#{suffix}_html"
126
+ return t(html_key) if I18n.exists?(html_key)
127
+
93
128
  key = "#{i18n_scope}.#{name}_#{suffix}"
94
129
  return t(key) if I18n.exists?(key)
95
130
  end
96
131
 
97
- # Returns the FormBuilder's method used to render
132
+ # Which form method is being used for this attribute
133
+ #
134
+ # @param attribute [Decidim::SettingsManifest::Attribute]
135
+ # @return [Symbol] The FormBuilder's method used to render
98
136
  def form_method_for_attribute(attribute)
99
137
  return :editor if attribute.type.to_sym == :text && attribute.editor?
100
138
 
@@ -102,7 +140,9 @@ module Decidim
102
140
  end
103
141
 
104
142
  # Handles special cases.
105
- # Returns an empty Hash or a Hash with extra HTML options.
143
+ #
144
+ # @param input_type [Symbol]
145
+ # @return [Hash] Empty Hash or a Hash with extra HTML options.
106
146
  def extra_options_for_type(input_type)
107
147
  case input_type
108
148
  when :text_area
@@ -113,6 +153,12 @@ module Decidim
113
153
  end
114
154
 
115
155
  # Build options for enum attributes
156
+ # Get the translation for a given attribute of type choice
157
+ #
158
+ # @param name (see #settings_attribute_input)
159
+ # @param i18n_scope (see #settings_attribute_input)
160
+ # @param choices [Array<Symbol>]
161
+ # @return [Array<Array<String>>]
116
162
  def build_enum_choices(name, i18n_scope, choices)
117
163
  choices.map do |choice|
118
164
  [t("#{name}_choices.#{choice}", scope: i18n_scope), choice]
@@ -14,7 +14,7 @@ import "jquery.autocomplete"
14
14
  import "jquery-serializejson"
15
15
 
16
16
  import "src/decidim/admin/tab_focus"
17
- import "src/decidim/admin/choose_language"
17
+ import initLanguageChangeSelect from "src/decidim/admin/choose_language"
18
18
  import "src/decidim/admin/application"
19
19
  import "src/decidim/admin/resources_permissions"
20
20
  import "src/decidim/admin/welcome_notification"
@@ -40,3 +40,7 @@ import "entrypoints/decidim_admin.scss";
40
40
 
41
41
  // This needs to be loaded after confirm dialog to bind properly
42
42
  Rails.start()
43
+
44
+ window.addEventListener("DOMContentLoaded", () => {
45
+ initLanguageChangeSelect(document.querySelectorAll("select.language-change"));
46
+ });
@@ -1,12 +1,14 @@
1
1
  /* eslint-disable no-invalid-this */
2
+ /* eslint-disable require-jsdoc */
2
3
 
3
- $(() => {
4
- $("select.language-change").change(function () {
5
- let $select = $(this);
6
- let targetTabPaneSelector = $select.val();
7
- let $tabsContent = $select.parent().parent().siblings();
4
+ export default function initLanguageChangeSelect(elements) {
5
+ elements.forEach((select) => {
6
+ select.addEventListener("change", () => {
7
+ let targetTabPaneSelector = select.value;
8
+ let tabsContent = select.parentElement.parentElement.nextElementSibling;
8
9
 
9
- $tabsContent.children(".is-active").removeClass("is-active");
10
- $tabsContent.children(targetTabPaneSelector).addClass("is-active");
11
- })
12
- });
10
+ tabsContent.querySelector(".is-active").classList.remove("is-active");
11
+ tabsContent.querySelector(targetTabPaneSelector).classList.add("is-active");
12
+ })
13
+ });
14
+ }
@@ -70,6 +70,7 @@ class DynamicFieldsComponent {
70
70
  $(this).replaceAttribute("for", placeholder, value);
71
71
  $(this).replaceAttribute("tabs_id", placeholder, value);
72
72
  $(this).replaceAttribute("href", placeholder, value);
73
+ $(this).replaceAttribute("value", placeholder, value);
73
74
 
74
75
  return this;
75
76
  }
@@ -116,6 +116,12 @@ label,
116
116
  margin-bottom: $input-margin;
117
117
  }
118
118
 
119
+ .form-input-extra-before{
120
+ margin-bottom: $form-spacing * 1.5;
121
+ display: block;
122
+ margin-top: $form-spacing * -1;
123
+ }
124
+
119
125
  .custom-error{
120
126
  @extend .form-error;
121
127
  }
@@ -21,7 +21,7 @@
21
21
  <% if @component %>
22
22
  <div class="card-divider"><%= t("#{@component.manifest.name}.actions.#{action}", scope: "decidim.components") %></div>
23
23
  <% else %>
24
- <div class="card-divider"><%= t("#{resource.manifest.name}.actions.#{action}", scope: "decidim.resources") %></div>
24
+ <div class="card-divider"><%= t("#{resource.resource_manifest.name}.actions.#{action}", scope: "decidim.resources") %></div>
25
25
  <% end %>
26
26
 
27
27
  <div class="card-section">
@@ -185,7 +185,7 @@ cs:
185
185
  success: Skvělé! Přijali jste administrátorské podmínky použití.
186
186
  actions:
187
187
  accept: Souhlasím s následujícími podmínkami
188
- are_you_sure: Oravdu chcete odmítnout podmínky používání správce?
188
+ are_you_sure: Opravdu chcete odmítnout Podmínky použití pro správce?
189
189
  refuse: Odmítnout administrátorské podmínky
190
190
  title: Souhlasit s podmínkami používání
191
191
  required_review:
@@ -213,7 +213,7 @@ cs:
213
213
  error: Při vytváření nové oblasti došlo k chybě.
214
214
  success: Oblast byla úspěšně vytvořena.
215
215
  destroy:
216
- has_spaces: Tato oblast má závislé prostory. Před smazáním se prosím ujistěte, že žádný účatnický prostor neodkazuje na tuto oblast.
216
+ has_spaces: Tato oblast má závislé prostory. Před smazáním se prosím ujistěte, že žádný účastnický prostor neodkazuje na tuto oblast.
217
217
  success: Oblast úspěšně zničena
218
218
  edit:
219
219
  title: Upravit oblast
@@ -504,9 +504,9 @@ cs:
504
504
  example_error: Nelze vytvořit příklad pro daný typ
505
505
  new:
506
506
  accepted_mime_types:
507
- csv: csv
508
- json: json
509
- xlsx: xlsx
507
+ csv: CSV
508
+ json: JSON
509
+ xlsx: Excel (.xlsx)
510
510
  actions:
511
511
  back: Zpět
512
512
  download_example: Stáhnout příklad
@@ -591,11 +591,11 @@ cs:
591
591
  name: Participační prostor soukromého účastníka
592
592
  scope:
593
593
  fields:
594
- name: název
594
+ name: Název
595
595
  scope_type: Typ oblasti působnosti
596
596
  scope_type:
597
597
  fields:
598
- name: název
598
+ name: Název
599
599
  plural: Množné číslo
600
600
  share_token:
601
601
  fields:
@@ -614,7 +614,7 @@ cs:
614
614
  created_at: Datum vzniku
615
615
  email: E-mail
616
616
  last_sign_in_at: Datum posledního přihlášení
617
- name: název
617
+ name: Název
618
618
  role: Role
619
619
  roles:
620
620
  admin: Správce
@@ -625,7 +625,7 @@ cs:
625
625
  actions: Akce
626
626
  created_at: Vytvořeno v
627
627
  document_number: Číslo dokumentu
628
- name: název
628
+ name: Název
629
629
  phone: Telefon
630
630
  state: Stav
631
631
  users_count: Počet účastníků
@@ -741,15 +741,15 @@ cs:
741
741
  error: Při blokování uživatele došlo k chybě
742
742
  success: Uživatel byl úspěšně zablokován
743
743
  create:
744
- success: Uživatel úspěšně oficializován
744
+ success: Účastník úspěšně oficiálně zaregistrován
745
745
  destroy:
746
- success: Uživatel úspěšně zbaven oficializace
746
+ success: Uživatel úspěšně zbaven oficiální registrace
747
747
  index:
748
748
  actions: Akce
749
749
  badge: Odznak
750
750
  block: Zablokovat uživatele
751
751
  created_at: Vytvořeno na
752
- name: název
752
+ name: Název
753
753
  nickname: Přezdívka
754
754
  not_officialized: Neověřeno
755
755
  officialize: Ověřit
@@ -783,7 +783,7 @@ cs:
783
783
  facebook: Facebook
784
784
  github: GitHub
785
785
  instagram: Instagram
786
- rich_text_editor_in_public_views_help: V některých textových oblastech budou účastníci moci vložit některé HTML tagy pomocí textového editoru.
786
+ rich_text_editor_in_public_views_help: V některých textových polích budou účastníci moci vložit některé HTML tagy pomocí textového editoru.
787
787
  social_handlers: Sociální
788
788
  twitter: Twitter
789
789
  url: URL
@@ -977,7 +977,7 @@ cs:
977
977
  user_groups:
978
978
  index:
979
979
  state:
980
- pending: čekající
980
+ pending: Čekající
981
981
  rejected: Odmítnuto
982
982
  verified: Ověřeno
983
983
  verify_via_csv: Ověřit pomocí CSV
@@ -210,21 +210,21 @@ fr:
210
210
  success: Le type de périmètre d'assemblée a été mis à jour avec succès
211
211
  areas:
212
212
  create:
213
- error: Une erreur s'est produite lors de la création d'une nouvelle zone d'application.
214
- success: Zone d'application créée avec succès.
213
+ error: Une erreur s'est produite lors de la création d'un nouveau périmètre d'assemblée.
214
+ success: Périmètre d'assemblée créé avec succès.
215
215
  destroy:
216
- has_spaces: Des espaces dépendent de cette zone d'application. Veuillez vous assurer qu'aucun espace participatif n'est lié à cette zone avant de la supprimer.
217
- success: La zone d'application a bien été supprimée
216
+ has_spaces: Des espaces dépendent de ce périmètre d'assemblée. Veuillez vous assurer qu'aucun espace participatif n'est lié à périmètre avant de la supprimer.
217
+ success: Le périmètre d'assemblée a bien été supprimé
218
218
  edit:
219
- title: Modifier la zone d'application
219
+ title: Modifier le périmètre d'assemblée
220
220
  update: Mettre à jour
221
221
  new:
222
- create: Créer une zone d'application
223
- title: Nouvelle zone d'application
224
- no_areas: Aucune zone d'application
222
+ create: Créer un périmètre d'assemblée
223
+ title: Nouveau périmètre d'assemblée
224
+ no_areas: Aucun périmètre d'assemblée
225
225
  update:
226
- error: Une erreur s'est produite lors de la mise à jour de cette zone d'application.
227
- success: Zone d'application mise à jour avec succès
226
+ error: Une erreur s'est produite lors de la mise à jour de ce périmètre d'assemblée.
227
+ success: Périmètre d'assemblée mise à jour avec succès
228
228
  attachment_collections:
229
229
  create:
230
230
  error: Une erreur s'est produite lors de la création d'un nouveau dossier.
@@ -523,7 +523,7 @@ fr:
523
523
  admins: Administrateurs
524
524
  appearance: Apparence
525
525
  area_types: Types de périmètre d'assemblée
526
- areas: Zones d'application
526
+ areas: Périmètres d'assemblée
527
527
  configuration: Configuration
528
528
  dashboard: Tableau de bord
529
529
  external_domain_whitelist: Domaines externes autorisés
@@ -535,7 +535,7 @@ fr:
535
535
  participants: Participants
536
536
  reported_users: Utilisateurs signalés
537
537
  scope_types: Types de secteur
538
- scopes: Périmètres d’application
538
+ scopes: Secteurs
539
539
  settings: Paramètres
540
540
  static_pages: Pages
541
541
  user_groups: Groupes d'utilisateurs
@@ -942,7 +942,7 @@ fr:
942
942
  titles:
943
943
  admin_log: Journal d'administration
944
944
  area_types: Types de périmètre d'assemblée
945
- areas: Zones d'application
945
+ areas: Périmètres d'assemblée
946
946
  authorization_workflows: Méthodes de vérification
947
947
  dashboard: Tableau de bord
948
948
  impersonatable_users: Utilisateurs pouvant être représentés
@@ -951,7 +951,7 @@ fr:
951
951
  panel: Administrateur
952
952
  participants: Utilisateurs
953
953
  scope_types: Types de secteur
954
- scopes: Périmètres d'application
954
+ scopes: Secteurs
955
955
  static_pages: Pages
956
956
  statistics: Activité
957
957
  user_groups: Groupes d'utilisateurs