decidim-core 0.16.1 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


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

Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/decidim/decidim-logo.svg +69 -60
  3. data/app/assets/javascripts/decidim.js.es6 +1 -0
  4. data/app/assets/javascripts/decidim/core/bundle.js +2 -0
  5. data/app/assets/javascripts/decidim/core/bundle.js.map +1 -0
  6. data/app/assets/javascripts/decidim/data_picker.js.es6 +6 -0
  7. data/app/assets/stylesheets/decidim/_variables.scss +17 -0
  8. data/app/assets/stylesheets/decidim/extras/_leaflet.scss +2 -2
  9. data/app/assets/stylesheets/decidim/layouts/_highlighted_banner.scss +0 -4
  10. data/app/assets/stylesheets/decidim/layouts/_home.scss +2 -2
  11. data/app/assets/stylesheets/decidim/modules/_address.scss +1 -1
  12. data/app/assets/stylesheets/decidim/modules/_author-avatar.scss +3 -2
  13. data/app/assets/stylesheets/decidim/modules/_badges.scss +7 -7
  14. data/app/assets/stylesheets/decidim/modules/_buttons.scss +52 -14
  15. data/app/assets/stylesheets/decidim/modules/_callout.scss +5 -5
  16. data/app/assets/stylesheets/decidim/modules/_cards.scss +9 -23
  17. data/app/assets/stylesheets/decidim/modules/_conference-nav.scss +1 -1
  18. data/app/assets/stylesheets/decidim/modules/_filters.scss +1 -1
  19. data/app/assets/stylesheets/decidim/modules/_horizontal-tabs.scss +2 -2
  20. data/app/assets/stylesheets/decidim/modules/_loading-spinner.scss +1 -1
  21. data/app/assets/stylesheets/decidim/modules/_main-container.scss +1 -1
  22. data/app/assets/stylesheets/decidim/modules/_map.scss +3 -3
  23. data/app/assets/stylesheets/decidim/modules/_navbar.scss +3 -3
  24. data/app/assets/stylesheets/decidim/modules/_omnipresent_banner.scss +1 -1
  25. data/app/assets/stylesheets/decidim/modules/_order-by.scss +1 -1
  26. data/app/assets/stylesheets/decidim/modules/_process-header.scss +1 -1
  27. data/app/assets/stylesheets/decidim/modules/_process-nav.scss +8 -8
  28. data/app/assets/stylesheets/decidim/modules/_process-phase.scss +4 -4
  29. data/app/assets/stylesheets/decidim/modules/_status-labels.scss +2 -2
  30. data/app/assets/stylesheets/decidim/modules/_timeline.scss +1 -1
  31. data/app/assets/stylesheets/decidim/modules/_typography.scss +2 -2
  32. data/app/assets/stylesheets/decidim/modules/_wizard-steps.scss +3 -3
  33. data/app/assets/stylesheets/decidim/utils/_mixins.scss +7 -1
  34. data/app/assets/stylesheets/decidim/vizzs/_areachart.scss +3 -7
  35. data/app/cells/decidim/activities_cell.rb +0 -2
  36. data/app/cells/decidim/card_m_cell.rb +3 -1
  37. data/app/cells/decidim/content_blocks/footer_sub_hero_cell.rb +0 -1
  38. data/app/cells/decidim/content_blocks/hero_cell.rb +0 -2
  39. data/app/cells/decidim/content_blocks/highlighted_content_banner_cell.rb +0 -2
  40. data/app/cells/decidim/content_blocks/last_activity_cell.rb +0 -2
  41. data/app/cells/decidim/content_blocks/metrics_cell.rb +0 -2
  42. data/app/cells/decidim/content_blocks/stats_cell.rb +0 -2
  43. data/app/cells/decidim/content_blocks/sub_hero_cell.rb +0 -2
  44. data/app/cells/decidim/follow_button_cell.rb +0 -4
  45. data/app/cells/decidim/pad_iframe_cell.rb +0 -4
  46. data/app/commands/decidim/create_omniauth_registration.rb +1 -1
  47. data/app/commands/decidim/create_report.rb +1 -1
  48. data/app/controllers/concerns/decidim/action_authorization.rb +6 -4
  49. data/app/controllers/concerns/decidim/locale_switcher.rb +14 -0
  50. data/app/controllers/concerns/decidim/participatory_space_context.rb +5 -6
  51. data/app/controllers/decidim/application_controller.rb +1 -1
  52. data/app/controllers/decidim/authorization_modals_controller.rb +5 -5
  53. data/app/controllers/decidim/static_map_controller.rb +2 -0
  54. data/app/frontend/entry.ts +1 -0
  55. data/app/helpers/decidim/cells_helper.rb +0 -1
  56. data/app/helpers/decidim/filters_helper.rb +10 -1
  57. data/app/helpers/decidim/layout_helper.rb +5 -0
  58. data/app/mailers/concerns/decidim/localised_mailer.rb +1 -1
  59. data/app/models/decidim/user.rb +1 -1
  60. data/app/permissions/decidim/permissions.rb +11 -11
  61. data/app/presenters/decidim/resource_locator_presenter.rb +13 -0
  62. data/app/queries/decidim/metrics/users_metric_manage.rb +2 -2
  63. data/app/services/decidim/action_authorizer.rb +51 -26
  64. data/app/services/decidim/email_notification_generator.rb +11 -0
  65. data/app/views/decidim/account/show.html.erb +2 -1
  66. data/app/views/decidim/authorization_modals/_content.html.erb +45 -0
  67. data/app/views/decidim/authorization_modals/show.html.erb +1 -41
  68. data/app/views/decidim/notification_mailer/event_received.html.erb +1 -1
  69. data/app/views/layouts/decidim/_application.html.erb +1 -0
  70. data/app/views/layouts/decidim/_organization_colors.html.erb +5 -0
  71. data/app/views/layouts/decidim/_wrapper.html.erb +3 -1
  72. data/config/locales/ar-SA.yml +180 -10
  73. data/config/locales/ca.yml +118 -120
  74. data/config/locales/cs-CZ.yml +3 -3
  75. data/config/locales/cs.yml +1282 -0
  76. data/config/locales/de.yml +29 -31
  77. data/config/locales/en.yml +148 -149
  78. data/config/locales/es-MX.yml +28 -30
  79. data/config/locales/es-PY.yml +28 -30
  80. data/config/locales/es.yml +124 -126
  81. data/config/locales/eu.yml +28 -30
  82. data/config/locales/fi-pl.yml +1 -1
  83. data/config/locales/fi-plain.yml +1260 -0
  84. data/config/locales/fi.yml +95 -97
  85. data/config/locales/fr.yml +28 -30
  86. data/config/locales/gl.yml +28 -30
  87. data/config/locales/hu.yml +44 -46
  88. data/config/locales/id-ID.yml +28 -30
  89. data/config/locales/it.yml +32 -34
  90. data/config/locales/nl.yml +29 -31
  91. data/config/locales/pl.yml +28 -30
  92. data/config/locales/pt-BR.yml +28 -30
  93. data/config/locales/pt.yml +28 -30
  94. data/config/locales/ru.yml +1 -2
  95. data/config/locales/sv.yml +29 -31
  96. data/config/locales/tr-TR.yml +28 -30
  97. data/config/locales/uk.yml +1 -2
  98. data/db/migrate/20190220023422_add_colors_to_decidim_organization.rb +7 -0
  99. data/lib/decidim/content_renderers/user_renderer.rb +4 -6
  100. data/lib/decidim/core.rb +10 -1
  101. data/lib/decidim/core/test.rb +1 -0
  102. data/lib/decidim/core/test/shared_examples/amendable/amendment_accepted_event_examples.rb +3 -3
  103. data/lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb +3 -3
  104. data/lib/decidim/core/test/shared_examples/amendable/amendment_promoted_event_examples.rb +3 -3
  105. data/lib/decidim/core/test/shared_examples/amendable/amendment_rejected_event_examples.rb +3 -3
  106. data/lib/decidim/core/test/shared_examples/uncommentable_component_examples.rb +21 -0
  107. data/lib/decidim/core/version.rb +1 -1
  108. data/lib/decidim/data_portability_file_zipper.rb +12 -3
  109. data/lib/decidim/form_builder.rb +3 -9
  110. data/lib/decidim/has_resource_permission.rb +43 -0
  111. data/lib/decidim/settings_manifest.rb +5 -0
  112. data/lib/decidim/view_model.rb +2 -0
  113. data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.ca.js +6 -6
  114. data/vendor/assets/javascripts/datepicker-locales/foundation-datepicker.cs.js +14 -0
  115. data/vendor/assets/javascripts/foundation-datepicker.js +2 -10
  116. metadata +18 -7
@@ -14,13 +14,13 @@ $card-margin-bottom: map-get($grid-column-gutter, medium);
14
14
 
15
15
  $card-footer-bg: $light-gray-dark;
16
16
 
17
- $card-proposal: $proposals;
18
- $card-action: $actions;
19
- $card-debate: $debates;
20
- $card-meeting: $meetings;
21
- $card-spaces: $card-meeting;
17
+ $card-proposal: var(--proposals);
18
+ $card-action: var(--actions);
19
+ $card-debate: var(--debates);
20
+ $card-meeting: var(--meetings);
21
+ $card-spaces: var(--meetings);
22
22
 
23
- $datetime-bg: $primary;
23
+ $datetime-bg: var(--primary);
24
24
 
25
25
  /* Cards */
26
26
  .card{
@@ -77,11 +77,6 @@ $datetime-bg: $primary;
77
77
  @extend .heading5;
78
78
  }
79
79
 
80
- .card__title--strong{
81
- font-weight: bold;
82
- text-transform: uppercase;
83
- }
84
-
85
80
  .card__header{
86
81
  margin-bottom: $card-padding / 2;
87
82
 
@@ -175,7 +170,7 @@ $datetime-bg: $primary;
175
170
  font-weight: 600;
176
171
  display: flex;
177
172
  align-items: baseline;
178
- border-left: 4px solid $primary;
173
+ border-left: 4px solid var(--primary);
179
174
  background: $card-secondary-bg;
180
175
  line-height: 1;
181
176
  }
@@ -205,12 +200,6 @@ $datetime-bg: $primary;
205
200
  .card__content{
206
201
  display: flex;
207
202
  }
208
-
209
- &.card__footer--spaces{
210
- background: rgba($card-spaces, .2);
211
- border-top-color: rgba($card-spaces, .6);
212
- border-top-width: .25rem;
213
- }
214
203
  }
215
204
 
216
205
  .card__footer--transparent{
@@ -413,10 +402,6 @@ $datetime-bg: $primary;
413
402
  .card__link{
414
403
  color: $anchor-color;
415
404
 
416
- @include breakpoint(small only){
417
- word-break: break-all;
418
- }
419
-
420
405
  &:hover{
421
406
  color: $anchor-color;
422
407
  }
@@ -516,6 +501,7 @@ $datetime-bg: $primary;
516
501
  text-align: center;
517
502
  text-transform: uppercase;
518
503
  font-size: 85%;
504
+ min-width: 7rem;
519
505
  line-height: 1;
520
506
  color: $muted;
521
507
  padding: $card-padding-small;
@@ -815,7 +801,7 @@ $datetime-bg: $primary;
815
801
  }
816
802
 
817
803
  li:first-child{
818
- color: $primary;
804
+ color: var(--primary);
819
805
  flex: 0;
820
806
  }
821
807
 
@@ -20,7 +20,7 @@
20
20
  display: inline-block;
21
21
  width: 5px;
22
22
  height: $list-lineheight * 1rem;
23
- background-color: $primary;
23
+ background-color: var(--primary);
24
24
  position: absolute;
25
25
  top: 50%;
26
26
  left: -.5rem;
@@ -84,7 +84,7 @@ $filters-padding-y: 1rem;
84
84
 
85
85
  .section-title{
86
86
  text-transform: uppercase;
87
- color: $primary;
87
+ color: var(--primary);
88
88
  text-decoration: underline;
89
89
  margin-right: $global-margin;
90
90
  }
@@ -18,9 +18,9 @@
18
18
  &:focus,
19
19
  &[aria-selected='true']{
20
20
  background: transparent;
21
- color: $primary;
21
+ color: var(--primary);
22
22
  font-weight: 600;
23
- border-bottom: 3px solid $primary;
23
+ border-bottom: 3px solid var(--primary);
24
24
  }
25
25
 
26
26
  &:hover{
@@ -4,7 +4,7 @@
4
4
  text-align: center;
5
5
 
6
6
  &::before{
7
- @include spinner(25px, $medium-gray, $primary, 800ms);
7
+ @include spinner(25px, $medium-gray, var(--primary), 800ms);
8
8
 
9
9
  content: "";
10
10
  vertical-align: middle;
@@ -66,7 +66,7 @@ $container-padding-2y: 2rem;
66
66
  &.is-active > [role=tab],
67
67
  &.is-active > a{
68
68
  color: $anchor-color;
69
- box-shadow: inset 4px 0 0 $primary;
69
+ box-shadow: inset 4px 0 0 var(--primary);
70
70
  }
71
71
  }
72
72
  }
@@ -10,12 +10,12 @@
10
10
  }
11
11
 
12
12
  .map-info{
13
- background: $primary;
13
+ background: var(--primary);
14
14
  border-radius: $global-radius;
15
15
 
16
16
  > div:first-child{ //Map styles container
17
17
  > div:first-child{ //Triangle
18
- border-top-color: $primary !important;
18
+ border-top-color: var(--primary) !important;
19
19
  }
20
20
 
21
21
  > div:nth-child(2){
@@ -43,7 +43,7 @@
43
43
 
44
44
  .card__datetime{
45
45
  float: none;
46
- border-color: $primary;
46
+ border-color: var(--primary);
47
47
  display: flex;
48
48
  flex-direction: column;
49
49
  justify-content: center;
@@ -6,8 +6,8 @@ $navbar-color: rgba(white, .5);
6
6
  $navbar-color-hover: $white;
7
7
  $navbar-active-color: $white;
8
8
  $navbar-active-bg: $navbar-bg-hover;
9
- $navbar-active-shadow-small: inset 4px 0 0 0 $primary;
10
- $navbar-active-shadow-medium: inset 0 4px 0 0 $primary;
9
+ $navbar-active-shadow-small: inset 4px 0 0 0 var(--primary);
10
+ $navbar-active-shadow-medium: inset 0 4px 0 0 var(--primary);
11
11
 
12
12
  /* Navigation */
13
13
 
@@ -170,7 +170,7 @@ $navbar-active-shadow-medium: inset 0 4px 0 0 $primary;
170
170
 
171
171
  &:hover{
172
172
  cursor: pointer;
173
- background-color: rgba($secondary, .05);
173
+ background-color: rgba(var(--secondary), .05);
174
174
  }
175
175
  }
176
176
  }
@@ -1,5 +1,5 @@
1
1
  .omnipresent-banner{
2
- background-color: $primary;
2
+ background-color: var(--primary);
3
3
  color: $white;
4
4
  text-align: center;
5
5
  padding: 1rem;
@@ -4,7 +4,7 @@ $order-border: $border;
4
4
  /* Order by styles */
5
5
  .order-by{
6
6
  margin-bottom: 1rem;
7
- display: inline-flex;
7
+ display: flex;
8
8
  align-items: baseline;
9
9
  flex-wrap: wrap;
10
10
 
@@ -1,5 +1,5 @@
1
1
  .process-header{
2
- background-image: linear-gradient(to right, rgba($black, .8) 50%, $primary 50%);
2
+ background-image: linear-gradient(to right, rgba($black, .8) 50%, var(--primary) 50%);
3
3
 
4
4
  .heading2{
5
5
  font-weight: bold;
@@ -84,7 +84,7 @@ $nav-border-width: 3px;
84
84
  }
85
85
 
86
86
  &.is-active{
87
- box-shadow: inset 0 (-1 * ($nav-border-width + 1px)) 0 0 $primary;
87
+ box-shadow: inset 0 (-1 * ($nav-border-width + 1px)) 0 0 var(--primary);
88
88
 
89
89
  @include breakpoint(smallmedium down){
90
90
  display: none;
@@ -94,8 +94,8 @@ $nav-border-width: 3px;
94
94
 
95
95
  .process-nav__more{
96
96
  margin: 0;
97
- color: $primary;
98
- background-color: rgba($primary, .1);
97
+ color: var(--primary);
98
+ background-color: rgba(var(--primary), .1);
99
99
  text-transform: uppercase;
100
100
  font-weight: $global-weight-bold;
101
101
  font-size: rem-calc(14);
@@ -104,7 +104,7 @@ $nav-border-width: 3px;
104
104
  @include square(5px);
105
105
 
106
106
  border-radius: 100%;
107
- background-color: $primary;
107
+ background-color: var(--primary);
108
108
  display: inline-block;
109
109
  vertical-align: middle;
110
110
  margin-bottom: .1rem;
@@ -140,7 +140,7 @@ $nav-border-width: 3px;
140
140
  }
141
141
 
142
142
  .process-nav__link{
143
- color: $primary;
143
+ color: var(--primary);
144
144
  text-transform: uppercase;
145
145
  font-weight: $global-weight-bold;
146
146
  display: flex;
@@ -166,13 +166,13 @@ $nav-border-width: 3px;
166
166
 
167
167
  @include breakpoint(medium){
168
168
  .process-nav__link.is-active{
169
- color: $primary;
169
+ color: var(--primary);
170
170
 
171
171
  svg{
172
- fill: $primary;
172
+ fill: var(--primary);
173
173
 
174
174
  .stroked-shape{
175
- stroke: $primary;
175
+ stroke: var(--primary);
176
176
  }
177
177
  }
178
178
  }
@@ -88,11 +88,11 @@
88
88
 
89
89
  .phase-item--past{
90
90
  &::after{
91
- background-color: $primary;
91
+ background-color: var(--primary);
92
92
  }
93
93
 
94
94
  span{
95
- background-color: $primary;
95
+ background-color: var(--primary);
96
96
  opacity: 1;
97
97
  }
98
98
  }
@@ -105,7 +105,7 @@
105
105
  position: absolute;
106
106
  width: 0;
107
107
  border: 4px solid transparent;
108
- border-top-color: $primary;
108
+ border-top-color: var(--primary);
109
109
  top: -8px;
110
110
  left: calc(50% - 1px);
111
111
  z-index: 2;
@@ -156,7 +156,7 @@
156
156
 
157
157
  .process-header__button{
158
158
  .button{
159
- border-color: $primary;
159
+ border-color: var(--primary);
160
160
  text-transform: uppercase;
161
161
  }
162
162
  }
@@ -3,11 +3,11 @@
3
3
  }
4
4
 
5
5
  .label--highlight{
6
- background-color: $secondary;
6
+ background-color: var(--secondary);
7
7
  }
8
8
 
9
9
  .label--admin{
10
- background-color: $primary;
10
+ background-color: var(--primary);
11
11
  }
12
12
 
13
13
  .proposal-status,
@@ -1,7 +1,7 @@
1
1
 
2
2
  /* Variables */
3
3
 
4
- $timeline-color: $primary;
4
+ $timeline-color: var(--primary);
5
5
  $timeline-inactive-color: $medium-gray;
6
6
 
7
7
  $timeline-padding: 1rem;
@@ -83,7 +83,7 @@ hr{
83
83
  display: inline-block;
84
84
  width: 4px;
85
85
  height: .8em;
86
- background-color: $primary;
86
+ background-color: var(--primary);
87
87
  margin-right: .5rem;
88
88
  margin-bottom: -.1rem;
89
89
  }
@@ -133,7 +133,7 @@ hr{
133
133
  color: inherit;
134
134
 
135
135
  &:hover{
136
- color: $primary;
136
+ color: var(--primary);
137
137
  }
138
138
  }
139
139
  }
@@ -8,8 +8,8 @@
8
8
 
9
9
  li{
10
10
  border: none;
11
- color: $primary;
12
- border-left: 2px solid $primary;
11
+ color: var(--primary);
12
+ border-left: 2px solid var(--primary);
13
13
  box-sizing: border-box;
14
14
  border-radius: 0;
15
15
  padding: 1rem 0;
@@ -19,7 +19,7 @@
19
19
 
20
20
  li::before{
21
21
  border-radius: 50%;
22
- background-color: $primary;
22
+ background-color: var(--primary);
23
23
  content: "";
24
24
  display: inline-block;
25
25
  float: left;
@@ -41,7 +41,13 @@
41
41
  }
42
42
 
43
43
  // Status modifier mixin
44
- $palette: $foundation-palette;
44
+ $palette: (
45
+ primary: var(--primary),
46
+ secondary: var(--secondary),
47
+ success: var(--success),
48
+ warning: var(--warning),
49
+ alert: var(--alert),
50
+ );
45
51
 
46
52
  @mixin modifiers($vars, $colors: $palette){
47
53
  $map: map-merge($palette, $colors);
@@ -13,17 +13,17 @@
13
13
  }
14
14
 
15
15
  .area{
16
- fill: rgba($primary, .05);
16
+ fill: rgba(var(--primary), .05);
17
17
  }
18
18
 
19
19
  .line{
20
20
  fill: none;
21
- stroke: rgba($primary, .2);
21
+ stroke: rgba(var(--primary), .2);
22
22
  stroke-width: 4px;
23
23
  }
24
24
 
25
25
  .circle{
26
- fill: rgba($primary, .2);
26
+ fill: rgba(var(--primary), .2);
27
27
  }
28
28
 
29
29
  .tick{
@@ -62,10 +62,6 @@
62
62
  &.small{
63
63
  .sum{
64
64
  font-size: rem-calc(map-get(map-get(map-get($header-styles, medium), 'h3'), 'font-size'));
65
-
66
- @include breakpoint(medium down){
67
- font-size: rem-calc(map-get(map-get(map-get($header-styles, medium), 'h1'), 'font-size')) * 1.5;
68
- }
69
65
  }
70
66
  }
71
67
  }
@@ -8,8 +8,6 @@ module Decidim
8
8
  include Decidim::IconHelper
9
9
  include Decidim::Core::Engine.routes.url_helpers
10
10
 
11
- delegate :current_organization, to: :controller
12
-
13
11
  # Since we're rendering each activity separatedly we need to trigger
14
12
  # BatchLoader in order to accumulate all the ids to be found later.
15
13
  def show
@@ -97,13 +97,15 @@ module Decidim
97
97
  end
98
98
 
99
99
  def comments_count
100
+ return model.comments.not_hidden.count if model.comments.respond_to? :not_hidden
101
+
100
102
  model.comments.count
101
103
  end
102
104
 
103
105
  def statuses
104
106
  collection = [:creation_date]
105
107
  collection << :follow if model.is_a?(Decidim::Followable) && model != try(:current_user)
106
- collection << :comments_count if model.is_a?(Decidim::Comments::Commentable)
108
+ collection << :comments_count if model.is_a?(Decidim::Comments::Commentable) && model.commentable?
107
109
  collection
108
110
  end
109
111
 
@@ -5,7 +5,6 @@ module Decidim
5
5
  class FooterSubHeroCell < Decidim::ViewModel
6
6
  include Decidim::IconHelper
7
7
 
8
- delegate :current_organization, to: :controller
9
8
  delegate :current_user, to: :controller
10
9
  end
11
10
  end
@@ -6,8 +6,6 @@ module Decidim
6
6
  include Decidim::CtaButtonHelper
7
7
  include Decidim::SanitizeHelper
8
8
 
9
- delegate :current_organization, to: :controller
10
-
11
9
  # Needed so that the `CtaButtonHelper` can work.
12
10
  def decidim_participatory_processes
13
11
  Decidim::ParticipatoryProcesses::Engine.routes.url_helpers
@@ -9,8 +9,6 @@ module Decidim
9
9
  return unless current_organization.highlighted_content_banner_enabled
10
10
  render
11
11
  end
12
-
13
- delegate :current_organization, to: :controller
14
12
  end
15
13
  end
16
14
  end