decidim-admin 0.0.7 → 0.0.8.1

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
  SHA1:
3
- metadata.gz: d5dcba8b9274da7bdc3fe8d9700584b9351f009b
4
- data.tar.gz: 87a3f6dddf33cce35d81185d5e06c789f42836a3
3
+ metadata.gz: 9d431157faf89c91b9188a11cf7b300a290e20ff
4
+ data.tar.gz: 015526c7b495d558c20f4cdbe72bcfff2585b97e
5
5
  SHA512:
6
- metadata.gz: 261ba95b4b6d52d7df7bac1dd4a8bd6cd202a686886726b91a5fb4c699dfcd3be0aba7b4ee5aee938322c43b6464370105cbbf0c204b789cd339dec5e214aec1
7
- data.tar.gz: 113d19970d41766a6edfbb1efee5f2feb05cb2db0ba22c105a38f513bbabe89a15d3d815f8364688f156ea33b3b8308bad30e430a0f529eb77f661584e959e88
6
+ metadata.gz: 795021e0de6ca13a939b1ed310563299a72cb89aa771defd41b6d37e5dc8b94283a3dcb6ee751e790648c6e57e120df51aae0956cb1224a267fd830368a7414b
7
+ data.tar.gz: 11c8d98d61b644db36622cb799b0a141257e71c6eedd31305bbd958059520b936b8d4ab5a4d35086383930676d05e0a920d3194ab00f231ee7b5c4de1b94ab58
data/README.md CHANGED
@@ -47,7 +47,7 @@ are links to them inside the Decidim framework, see `Decidim::StaticPage` for
47
47
  the default list.
48
48
 
49
49
  ## Contributing
50
- See [Decidim](https://github.com/AjuntamentdeBarcelona/decidim).
50
+ See [Decidim](https://github.com/decidim/decidim).
51
51
 
52
52
  ## License
53
- See [Decidim](https://github.com/AjuntamentdeBarcelona/decidim).
53
+ See [Decidim](https://github.com/decidim/decidim).
@@ -6,14 +6,27 @@
6
6
  // = require html.sortable
7
7
  // = require ./sort_steps
8
8
  // = require ./tab_focus
9
+ // = require ./toggle_nav
9
10
  // = require decidim/editor
11
+ // = require foundation-datepicker
12
+ // = require form_datepicker
13
+ // = require moment.min
10
14
  // = require_self
11
15
 
16
+ window.Decidim = window.Decidim || {};
17
+
12
18
  const pageLoad = () => {
13
19
  $(document).foundation();
14
20
  sortSteps();
21
+
22
+ if (DecidimAdmin) {
23
+ DecidimAdmin.toggleNav();
24
+ }
15
25
  };
16
26
 
17
27
  $(() => {
18
28
  pageLoad();
29
+ if (window.Decidim.formDatePicker) {
30
+ window.Decidim.formDatePicker();
31
+ }
19
32
  });
@@ -0,0 +1,17 @@
1
+ ((exports) => {
2
+ const showHideNav = (evt) => {
3
+ const navMenu = document.querySelector(".layout-nav");
4
+
5
+ evt.preventDefault();
6
+ navMenu.classList.toggle("is-nav-open");
7
+ }
8
+
9
+ const toggleNav = () => {
10
+ const navTrigger = document.querySelector(".menu-trigger");
11
+
12
+ navTrigger.addEventListener("click", showHideNav);
13
+ }
14
+
15
+ exports.DecidimAdmin = exports.DecidimAdmin || {};
16
+ exports.DecidimAdmin.toggleNav = toggleNav;
17
+ })(window);
@@ -1,4 +1,3 @@
1
- //@import compass
2
1
  @import "variables";
3
2
  @import "utils/*";
4
3
 
@@ -0,0 +1,224 @@
1
+ $calendar-bg-color: $white;
2
+ $calendar-border: 1px solid rgba(0, 0, 0, 0.1);
3
+ $calendar-border-color: rgba(0, 0, 0, 0.1);
4
+ $calendar-active-color: $primary-color;
5
+ $calendar-bg-hover: $light-gray;
6
+ $calendar-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
7
+ $calendar-color-old: $medium-gray;
8
+ $calendar-color-disabled: $light-gray;
9
+ $calendar-radius: $global-radius;
10
+ $calendar-font-size: $global-font-size * .9;
11
+
12
+ .datepicker {
13
+ display: none;
14
+ position: absolute;
15
+ padding: 4px;
16
+ margin-top: 1px;
17
+ direction: ltr;
18
+ }
19
+
20
+ .datepicker.dropdown-menu {
21
+ position: absolute;
22
+ top: 100%;
23
+ left: 0;
24
+ z-index: 1000;
25
+ float: left;
26
+ display: none;
27
+ min-width: 160px;
28
+ list-style: none;
29
+ background-color: $calendar-bg-color;
30
+ border: $calendar-border;
31
+ border-radius: $calendar-radius;
32
+ box-shadow: $calendar-shadow;
33
+ background-clip: padding-box;
34
+ font-size: $calendar-font-size;
35
+ line-height: 18px;
36
+ }
37
+
38
+ .datepicker.dropdown-menu th {
39
+ padding: 4px 5px;
40
+ }
41
+
42
+ .datepicker.dropdown-menu td {
43
+ padding: 6px 9px;
44
+ }
45
+
46
+ .datepicker table {
47
+ border: 0;
48
+ margin: 0;
49
+ width: auto;
50
+ }
51
+
52
+ .datepicker table tr td span {
53
+ display: block;
54
+ width: 23%;
55
+ height: 54px;
56
+ line-height: 54px;
57
+ float: left;
58
+ margin: 1%;
59
+ cursor: pointer;
60
+ }
61
+
62
+ .datepicker td {
63
+ text-align: center;
64
+ width: 20px;
65
+ height: 20px;
66
+ border: 0;
67
+ font-size: $calendar-font-size;
68
+ padding: 4px 8px;
69
+ background: $calendar-bg-color;
70
+ cursor: pointer;
71
+ }
72
+
73
+ .datepicker td.active.day,
74
+ .datepicker td.active.year {
75
+ background: $calendar-active-color;
76
+ }
77
+
78
+ .datepicker .day:hover,
79
+ .datepicker .date-switch:hover,
80
+ .datepicker .prev:hover,
81
+ .datepicker .next:hover,
82
+ .datepicker .month:hover,
83
+ .datepicker .year:hover{
84
+ background-color: $calendar-bg-hover;
85
+ &.active{
86
+ background: $calendar-active-color;
87
+ }
88
+ }
89
+
90
+
91
+ .datepicker td.new,
92
+ .datepicker td.old {
93
+ color: $calendar-color-old;
94
+ }
95
+
96
+ .datepicker td span.active {
97
+ background: $calendar-active-color;
98
+ }
99
+
100
+ .datepicker td.day.disabled {
101
+ color: $calendar-color-disabled;
102
+ }
103
+
104
+ .datepicker td span.month.disabled,
105
+ .datepicker td span.year.disabled {
106
+ color: $calendar-color-disabled;
107
+ }
108
+
109
+ .datepicker th {
110
+ text-align: center;
111
+ width: 20px;
112
+ height: 20px;
113
+ border: 0;
114
+ font-size: $calendar-font-size;
115
+ padding: 4px 8px;
116
+ background: $calendar-bg-color;
117
+ cursor: pointer;
118
+ }
119
+
120
+ .datepicker th.active.day,
121
+ .datepicker th.active.year {
122
+ background: $calendar-active-color;
123
+ }
124
+
125
+ .datepicker th.date-switch {
126
+ width: 145px;
127
+ }
128
+
129
+ .datepicker th span.active {
130
+ background: $calendar-active-color;
131
+ }
132
+
133
+ .datepicker .cw {
134
+ font-size: 10px;
135
+ width: 12px;
136
+ padding: 0 2px 0 5px;
137
+ vertical-align: middle;
138
+ }
139
+
140
+ .datepicker.days div.datepicker-days {
141
+ display: block;
142
+ }
143
+
144
+ .datepicker.months div.datepicker-months {
145
+ display: block;
146
+ }
147
+
148
+ .datepicker.years div.datepicker-years {
149
+ display: block;
150
+ }
151
+
152
+ .datepicker thead tr:first-child th {
153
+ cursor: pointer;
154
+ }
155
+
156
+ .datepicker thead tr:first-child th.cw {
157
+ cursor: default;
158
+ background-color: transparent;
159
+ }
160
+
161
+ .datepicker tfoot tr:first-child th {
162
+ cursor: pointer;
163
+ }
164
+
165
+ .datepicker-inline {
166
+ width: 220px;
167
+ }
168
+
169
+ .datepicker-rtl {
170
+ direction: rtl;
171
+ }
172
+
173
+ .datepicker-rtl table tr td span {
174
+ float: right;
175
+ }
176
+
177
+ .datepicker-dropdown {
178
+ top: 0;
179
+ left: 0;
180
+ }
181
+
182
+ .datepicker-dropdown:before {
183
+ content: '';
184
+ display: inline-block;
185
+ border-left: 7px solid transparent;
186
+ border-right: 7px solid transparent;
187
+ border-bottom: 7px solid #ccc;
188
+ border-bottom-color: $calendar-border-color;
189
+ position: absolute;
190
+ top: -7px;
191
+ left: 6px;
192
+ }
193
+
194
+ .datepicker-dropdown:after {
195
+ content: '';
196
+ display: inline-block;
197
+ border-left: 6px solid transparent;
198
+ border-right: 6px solid transparent;
199
+ border-bottom: 6px solid $calendar-bg-color;
200
+ position: absolute;
201
+ top: -6px;
202
+ left: 7px;
203
+ }
204
+
205
+ .datepicker > div,
206
+ .datepicker-dropdown::after,
207
+ .datepicker-dropdown::before {
208
+ display: none;
209
+ }
210
+
211
+ .datepicker-close {
212
+ position: absolute;
213
+ top: -30px;
214
+ right: 0;
215
+ width: 15px;
216
+ height: 30px;
217
+ padding: 0;
218
+ display: none;
219
+ }
220
+
221
+ .table-striped .datepicker table tr td,
222
+ .table-striped .datepicker table tr th {
223
+ background-color: transparent;
224
+ }
@@ -11,6 +11,7 @@
11
11
  @import "user-login";
12
12
  @import "main-nav";
13
13
  @import "secondary-nav";
14
+ @import "datepicker";
14
15
 
15
16
  //Process
16
17
  @import "process-header";
@@ -28,7 +28,7 @@ module Decidim
28
28
  email = NewsletterMailer.newsletter(current_user, @newsletter)
29
29
  Premailer::Rails::Hook.perform(email)
30
30
 
31
- render html: email.html_part.body.decoded
31
+ render html: email.html_part.body.decoded.html_safe
32
32
  end
33
33
 
34
34
  def create
@@ -14,6 +14,15 @@ module Decidim
14
14
  validates :email, :role, presence: true
15
15
  validates :name, presence: true
16
16
  validates :role, inclusion: { in: ParticipatoryProcessUserRole::ROLES }
17
+
18
+ def roles
19
+ Decidim::Admin::ParticipatoryProcessUserRole::ROLES.map do |role|
20
+ [
21
+ I18n.t(role, scope: "decidim.admin.models.participatory_process_user_role.roles"),
22
+ role
23
+ ]
24
+ end
25
+ end
17
26
  end
18
27
  end
19
28
  end
@@ -22,6 +22,12 @@ module Decidim
22
22
  end
23
23
  end
24
24
  end
25
+
26
+ def foundation_datepicker_locale_tag
27
+ if I18n.locale != :en
28
+ javascript_include_tag "datepicker-locales/foundation-datepicker.#{I18n.locale}.js"
29
+ end
30
+ end
25
31
  end
26
32
  end
27
33
  end
@@ -14,7 +14,7 @@
14
14
  <table class="table-list">
15
15
  <thead>
16
16
  <tr>
17
- <th><%= t("models.category.fields.name", scope: "decidim.admin") %></th>
17
+ <th><%= t("activemodel.attributes.category.name") %></th>
18
18
  <th class="actions"></th>
19
19
  </tr>
20
20
  </thead>
@@ -18,7 +18,7 @@
18
18
  <% collection.each do |group| %>
19
19
  <tr>
20
20
  <td>
21
- <%= link_to translated_attribute(group.name), group %><br />
21
+ <%= link_to translated_attribute(group.name), ['edit', group] %><br />
22
22
  </td>
23
23
  <td class="table-list__actions">
24
24
  <% if can? :update, group %>
@@ -15,9 +15,8 @@
15
15
  </div>
16
16
  <div class="columns xlarge-4">
17
17
  <%= form.label :role %>
18
- <%= select :participatory_process_user_role, :role, Decidim::Admin::ParticipatoryProcessUserRole::ROLES, include_blank: false %>
18
+ <%= select :participatory_process_user_role, :role, @form.roles, include_blank: false %>
19
19
  </div>
20
20
  </div>
21
-
22
21
  </div>
23
- </div>
22
+ </div>
@@ -29,7 +29,7 @@
29
29
  <%= role.user.email %><br />
30
30
  </td>
31
31
  <td>
32
- <%= t(".#{role.role}", scope: "decidim.admin") %><br />
32
+ <%= t("#{role.role}", scope: "decidim.admin.models.participatory_process_user_role.roles") %><br />
33
33
  </td>
34
34
  <td class="table-list__actions">
35
35
  <% if can? :update, role %>
@@ -1,6 +1,6 @@
1
1
  <div class="card">
2
2
  <div class="card-divider">
3
- <h2 class="card-title"><%= t "decidim.admin.titles.static_pages" %> <%= link_to t("static_pages.new.title", scope: "decidim.admin"), ['new', 'static_page'], class: 'button tiny button--title new' %></h2>
3
+ <h2 class="card-title"><%= t "decidim.admin.titles.static_pages" %> <%= link_to t("static_pages.new.create", scope: "decidim.admin"), ['new', 'static_page'], class: 'button tiny button--title new' %></h2>
4
4
  </div>
5
5
  <div class="card-section">
6
6
  <div class="table-scroll">
@@ -16,7 +16,7 @@
16
16
  <% @pages.each do |page| %>
17
17
  <tr>
18
18
  <td>
19
- <%= link_to translated_attribute(page.title), page %><br />
19
+ <%= link_to translated_attribute(page.title), ['edit', page] %><br />
20
20
  </td>
21
21
  <td>
22
22
  <%= l page.created_at, format: :short %>
@@ -1,5 +1,5 @@
1
1
  <!doctype html>
2
- <html>
2
+ <html lang="<%= I18n.locale %>">
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
@@ -9,6 +9,7 @@
9
9
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
10
10
  <title><%= title %></title>
11
11
  <%= render partial: 'layouts/decidim/admin/header' %>
12
+ <%= foundation_datepicker_locale_tag %>
12
13
  </head>
13
14
  <body>
14
15
  <%= render partial: 'layouts/decidim/admin/template_top' %>
@@ -4,7 +4,7 @@
4
4
  <%= t "decidim.admin.titles.static_pages" %>
5
5
  </div>
6
6
  <div class="secondary-nav__actions">
7
- <%= link_to t("static_pages.new.title", scope: "decidim.admin"), ['new', 'static_page'], class: 'button expanded small new' %>
7
+ <%= link_to t("static_pages.new.create", scope: "decidim.admin"), ['new', 'static_page'], class: 'button expanded small new' %>
8
8
  </div>
9
9
  </div>
10
10
  <% end %>
@@ -96,6 +96,8 @@ ignore_unused:
96
96
  - decidim.admin.participatory_process_steps.default_title
97
97
  - activemodel.errors.messages.*
98
98
  - actions.confirm_destroy
99
+ - time.formats.*
100
+
99
101
  # - '{devise,kaminari,will_paginate}.*'
100
102
  # - 'simple_form.{yes,no}'
101
103
  # - 'simple_form.{placeholders,hints,labels}.*'
@@ -10,7 +10,7 @@ ca:
10
10
  category:
11
11
  description: Descripció
12
12
  name: Nom
13
- parent: Pare
13
+ parent_id: Superior
14
14
  feature:
15
15
  name: Nom
16
16
  weight: Pes
@@ -97,6 +97,9 @@ ca:
97
97
  subtitle: Subtítol
98
98
  target: A qui va dirigit?
99
99
  title: Títol
100
+ decidim/participatory_process_step:
101
+ end_date: Data de finalització
102
+ start_date: Data d'inici
100
103
  decidim/static_page:
101
104
  content: Contingut
102
105
  slug: Nom curt d'URL
@@ -111,7 +114,7 @@ ca:
111
114
  destroy: Eliminar
112
115
  edit: Editar
113
116
  manage: Gestionar
114
- new: Nou %{name}
117
+ new: Nou/va
115
118
  permissions: Permisos
116
119
  preview: Previsualitzar
117
120
  publish: Publicar
@@ -126,7 +129,7 @@ ca:
126
129
  success: L'adjunt s'ha eliminat correctament.
127
130
  edit:
128
131
  title: Edita arxiu adjunt
129
- update: Actualitza adjunt
132
+ update: Actualitzar
130
133
  form:
131
134
  current_file: Fitxer actual
132
135
  url: URL
@@ -145,7 +148,7 @@ ca:
145
148
  success: Categoria eliminada correctament.
146
149
  edit:
147
150
  title: Edita categoria
148
- update: Actualitza la categoria
151
+ update: Actualitzar
149
152
  new:
150
153
  create: Crea una categoria
151
154
  title: Nova categoria
@@ -168,8 +171,6 @@ ca:
168
171
  steps_title: Fases
169
172
  participatory_process_user_roles:
170
173
  index:
171
- admin: Administrador
172
- collaborator: Col·laborador
173
174
  process_admins_title: Usuaris del procés participatiu
174
175
  feature_permissions:
175
176
  edit:
@@ -234,8 +235,6 @@ ca:
234
235
  title: Títol
235
236
  name: Arxiu adjunt
236
237
  category:
237
- fields:
238
- name: Nom
239
238
  name: Categoria
240
239
  newsletter:
241
240
  fields:
@@ -267,6 +266,9 @@ ca:
267
266
  name: Nom
268
267
  role: Rol
269
268
  name: Usuari del procés
269
+ roles:
270
+ admin: Administrador
271
+ collaborator: Col·laborador
270
272
  scope:
271
273
  fields:
272
274
  created_at: Data de creació
@@ -326,7 +328,7 @@ ca:
326
328
  organization:
327
329
  edit:
328
330
  title: Edita organització
329
- update: Actualitza organització
331
+ update: Actualitzar
330
332
  form:
331
333
  current_image: Imatge actual
332
334
  facebook: Facebook
@@ -374,9 +376,9 @@ ca:
374
376
  success: La fase de procés participatiu s'ha eliminat correctament.
375
377
  edit:
376
378
  title: Editar fase de procés participatiu
377
- update: Actualitzar fase de procés participatiu
379
+ update: Actualitzar
378
380
  new:
379
- create: Crear fase de procés participatiu
381
+ create: Crear
380
382
  title: Nova fase de procés participatiu
381
383
  ordering:
382
384
  error: S'ha produït un error en la reordenació de les fases d'aquest procés participatiu.
@@ -405,7 +407,7 @@ ca:
405
407
  destroy:
406
408
  success: El procés participatiu s'ha eliminat correctament.
407
409
  edit:
408
- update: Actualitzar procés participatiu
410
+ update: Actualitzar
409
411
  form:
410
412
  current_image: imatge actual
411
413
  title: Informació general
@@ -414,7 +416,7 @@ ca:
414
416
  not_published: No publicat
415
417
  published: Publicat
416
418
  new:
417
- create: Crear procés participatiu
419
+ create: Crear
418
420
  title: Nou procés participatiu
419
421
  update:
420
422
  error: S'ha produït un error en l'actualització d'aquest procés participatiu.
@@ -431,7 +433,7 @@ ca:
431
433
  success: Àmbit eliminat amb èxit
432
434
  edit:
433
435
  title: Edita àmbit
434
- update: Actualitza àmbit
436
+ update: Actualitzar
435
437
  new:
436
438
  create: Crea àmbit
437
439
  title: Nou àmbit
@@ -448,9 +450,9 @@ ca:
448
450
  success: La pàgina s'ha eliminat correctament.
449
451
  edit:
450
452
  title: Editar pàgina
451
- update: Actualitzar pàgina
453
+ update: Actualitzar
452
454
  new:
453
- create: Crear pàgina
455
+ create: Nova
454
456
  title: Nova pàgina
455
457
  update:
456
458
  error: S'ha produït un error en l'actualització d'aquests pàgina.
@@ -516,4 +518,7 @@ ca:
516
518
  settings:
517
519
  title: Configuració
518
520
  users:
519
- title: Usuaris
521
+ title: Usuaris
522
+ time:
523
+ formats:
524
+ timepicker: "%d / %m / %Y %H:%M"