decidim-admin 0.0.8.1 → 0.1.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.

Potentially problematic release.


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

Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/decidim/admin/_decidim.scss +9 -2
  3. data/app/assets/stylesheets/decidim/admin/extra/_action-icon.scss +7 -0
  4. data/app/assets/stylesheets/decidim/admin/extra/_cards.scss +6 -0
  5. data/app/assets/stylesheets/decidim/admin/extra/_editor.scss +1 -0
  6. data/app/assets/stylesheets/decidim/admin/{_sidebar.scss → extra/_sidebar.scss} +0 -0
  7. data/app/assets/stylesheets/decidim/admin/modules/_action-icon.scss +23 -0
  8. data/app/assets/stylesheets/decidim/admin/modules/_cards.scss +0 -7
  9. data/app/assets/stylesheets/decidim/admin/modules/_icons.scss +4 -2
  10. data/app/assets/stylesheets/decidim/admin/modules/_modules.scss +0 -1
  11. data/app/assets/stylesheets/decidim/admin/{modules/_datepicker.scss → plugins/_foundation-datepicker.scss} +1 -1
  12. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/_constants.scss +5 -0
  13. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/_math.scss +45 -0
  14. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_acos.scss +12 -0
  15. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_asin.scss +12 -0
  16. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss +28 -0
  17. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan2.scss +37 -0
  18. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_cos.scss +13 -0
  19. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_cot.scss +9 -0
  20. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_csc.scss +9 -0
  21. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_exp.scss +12 -0
  22. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_fact.scss +18 -0
  23. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss +21 -0
  24. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_ldexp.scss +17 -0
  25. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_log.scss +34 -0
  26. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss +28 -0
  27. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sec.scss +9 -0
  28. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sin.scss +9 -0
  29. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss +16 -0
  30. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_tan.scss +9 -0
  31. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/helpers/_deg-to-rad.scss +4 -0
  32. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/helpers/_rad-to-deg.scss +4 -0
  33. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/helpers/_strip-unit.scss +8 -0
  34. data/app/assets/stylesheets/decidim/admin/vendor/mathsass/helpers/_unitless-rad.scss +13 -0
  35. data/app/commands/decidim/admin/create_participatory_process.rb +23 -17
  36. data/app/commands/decidim/admin/create_participatory_process_group.rb +1 -1
  37. data/app/controllers/decidim/admin/moderations_controller.rb +4 -4
  38. data/app/controllers/decidim/admin/participatory_processes_controller.rb +1 -1
  39. data/app/forms/decidim/admin/organization_form.rb +6 -2
  40. data/app/forms/decidim/admin/participatory_process_form.rb +5 -0
  41. data/app/helpers/decidim/admin/application_helper.rb +1 -1
  42. data/app/helpers/decidim/admin/attributes_display_helper.rb +1 -1
  43. data/app/views/decidim/admin/features/_feature.html.erb +5 -1
  44. data/app/views/decidim/admin/moderations/_report.html.erb +11 -0
  45. data/app/views/decidim/admin/moderations/index.html.erb +22 -24
  46. data/app/views/layouts/decidim/admin/participatory_process.html.erb +3 -0
  47. data/config/i18n-tasks.yml +1 -0
  48. data/config/locales/ca.yml +7 -3
  49. data/config/locales/en.yml +6 -2
  50. data/config/locales/es.yml +7 -3
  51. data/config/locales/eu.yml +4 -3
  52. data/config/locales/fi.yml +4 -3
  53. data/config/locales/fr.yml +389 -2
  54. data/config/locales/nl.yml +4 -1
  55. data/lib/decidim/admin/test/manage_attachments_examples.rb +2 -2
  56. metadata +39 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d431157faf89c91b9188a11cf7b300a290e20ff
4
- data.tar.gz: 015526c7b495d558c20f4cdbe72bcfff2585b97e
3
+ metadata.gz: 90e6f526c118a1adcc810170297e96011e1b9ab5
4
+ data.tar.gz: db85a15345011fe98a31a6f1a6039fa06da45d6f
5
5
  SHA512:
6
- metadata.gz: 795021e0de6ca13a939b1ed310563299a72cb89aa771defd41b6d37e5dc8b94283a3dcb6ee751e790648c6e57e120df51aae0956cb1224a267fd830368a7414b
7
- data.tar.gz: 11c8d98d61b644db36622cb799b0a141257e71c6eedd31305bbd958059520b936b8d4ab5a4d35086383930676d05e0a920d3194ab00f231ee7b5c4de1b94ab58
6
+ metadata.gz: 34c0af09a20a45cc803b6a1b8b526b8aa392334e368978ed950476f84eb6abda9605546be7d1e4f87b8bfabf85fa421146e7fab05aaeb6de1ae7be6b75fe145e
7
+ data.tar.gz: c0b7775043e657e980d5c274bf8b9c1a6b64d005f342b04e2b3aca466e9dcdfe1bb0a8fef85c8b665184abf48b5a0b868d03ef22d118a1131e46902023a32147
@@ -1,8 +1,15 @@
1
1
  @import "variables";
2
- @import "utils/*";
2
+
3
+ @import "utils/fontface";
4
+ @import "utils/helpers";
5
+ @import "utils/keyframes";
6
+ @import "utils/mixins";
7
+ @import "utils/settings";
8
+ @import "utils/toggle-expand";
3
9
 
4
10
  @import "foundation";
5
11
  @include foundation-everything();
6
- @import "decidim/editor";
12
+
13
+ @import "plugins/foundation-datepicker";
7
14
 
8
15
  @import "modules/modules";
@@ -0,0 +1,7 @@
1
+ .table-list__actions {
2
+ .action-icon {
3
+ &.action-icon--disabled {
4
+ color: rgba($muted, .3);
5
+ }
6
+ }
7
+ }
@@ -0,0 +1,6 @@
1
+ .card__filter{
2
+ margin-bottom: 0;
3
+ @include breakpoint(mediumlarge){
4
+ float: right;
5
+ }
6
+ }
@@ -0,0 +1 @@
1
+ @import "decidim/editor";
@@ -1,3 +1,12 @@
1
+ @import "../vendor/mathsass/math";
2
+
3
+ $action-icon-height: 24px;
4
+ $action-icon-width: $icon-size;
5
+
6
+ .action-icon {
7
+ height: $action-icon-height;
8
+ }
9
+
1
10
  .action-icon:not(:last-child){
2
11
  margin-right: 1rem;
3
12
  }
@@ -11,3 +20,17 @@
11
20
  .action-icon.action-icon--remove{
12
21
  color: $alert-color;
13
22
  }
23
+
24
+ .action-icon--hide{
25
+ position: relative;
26
+
27
+ &:before{
28
+ border-left: 1px solid;
29
+ bottom: 0;
30
+ content: "";
31
+ left: 50%;
32
+ position: absolute;
33
+ top: 0;
34
+ transform: rotate(rad-to-deg(atan2($action-icon-width, $action-icon-height)));
35
+ }
36
+ }
@@ -12,13 +12,6 @@
12
12
  }
13
13
  }
14
14
 
15
- .card__filter{
16
- margin-bottom: 0;
17
- @include breakpoint(mediumlarge){
18
- float: right;
19
- }
20
- }
21
-
22
15
  .card__icon-open{
23
16
  display: none;
24
17
  }
@@ -1,6 +1,8 @@
1
+ $icon-size: 14px;
2
+
1
3
  .icon{
2
- width: 14px;
3
- height: 14px;
4
+ width: $icon-size;
5
+ height: $icon-size;
4
6
  fill: currentColor;
5
7
  }
6
8
 
@@ -11,7 +11,6 @@
11
11
  @import "user-login";
12
12
  @import "main-nav";
13
13
  @import "secondary-nav";
14
- @import "datepicker";
15
14
 
16
15
  //Process
17
16
  @import "process-header";
@@ -221,4 +221,4 @@ $calendar-font-size: $global-font-size * .9;
221
221
  .table-striped .datepicker table tr td,
222
222
  .table-striped .datepicker table tr th {
223
223
  background-color: transparent;
224
- }
224
+ }
@@ -0,0 +1,5 @@
1
+ // Constants
2
+ $E: 2.718281828459045;
3
+ $PI: 3.141592653589793;
4
+ $LN2: 0.6931471805599453;
5
+ $SQRT2: 1.4142135623730951;
@@ -0,0 +1,45 @@
1
+ // MathSass v0.10.0
2
+ // https://github.com/terkel/mathsass
3
+ //
4
+ // Copyright (c) 2014 Takeru Suzuki - http://terkel.jp/
5
+ // Licensed under the MIT license - http://opensource.org/licenses/MIT
6
+
7
+ // Constants
8
+ @import "constants";
9
+
10
+ // Exponentiation
11
+ @import "functions/pow";
12
+
13
+ // Factorial
14
+ @import "functions/fact";
15
+
16
+ // Square root
17
+ @import "functions/sqrt";
18
+
19
+ // Exponential function
20
+ @import "functions/exp";
21
+ @import "functions/frexp";
22
+ @import "functions/ldexp";
23
+
24
+ // Logarithms
25
+ @import "functions/log";
26
+
27
+ // Trigonometric functions
28
+ @import "functions/sin";
29
+ @import "functions/cos";
30
+ @import "functions/tan";
31
+ @import "functions/csc";
32
+ @import "functions/sec";
33
+ @import "functions/cot";
34
+
35
+ // Inverse trigonometric functions
36
+ @import "functions/asin";
37
+ @import "functions/acos";
38
+ @import "functions/atan";
39
+ @import "functions/atan2";
40
+
41
+ // Helpers
42
+ @import "helpers/strip-unit";
43
+ @import "helpers/deg-to-rad";
44
+ @import "helpers/rad-to-deg";
45
+ @import "helpers/unitless-rad";
@@ -0,0 +1,12 @@
1
+ // Returns the arccosine of a number.
2
+ // @param {Number} $x A number between -1 and 1.
3
+ // @example
4
+ // acos(0.1) // 1.47063
5
+ // acos(-1) // 3.14159
6
+ @function acos ($x) {
7
+ @if $x > 1 or $x < -1 {
8
+ @warn "Argument for `acos()` must be a number between -1 and 1";
9
+ @return null;
10
+ }
11
+ @return $PI / 2 - asin($x);
12
+ }
@@ -0,0 +1,12 @@
1
+ // Returns the arcsine of a number.
2
+ // @param {Number} $x A number between -1 and 1.
3
+ // @example
4
+ // asin(0.1) // 0.10017
5
+ // asin(-1) // -1.5708
6
+ @function asin ($x) {
7
+ @if $x > 1 or $x < -1 {
8
+ @warn "Argument for `asin()` must be a number between -1 and 1";
9
+ @return null;
10
+ }
11
+ @return atan($x / sqrt(1 - $x * $x));
12
+ }
@@ -0,0 +1,28 @@
1
+ // Returns the arctangent of a number.
2
+ // @param {Number} $x
3
+ // @example
4
+ // atan(0.1) // 0.09967
5
+ // atan(-1) // -0.7854
6
+ @function atan ($x) {
7
+ $i: 24;
8
+ $sgn: 0;
9
+ $a: 0;
10
+ @if $x > 1 {
11
+ $sgn: 1;
12
+ $x: 1 / $x;
13
+ } @else if $x < -1 {
14
+ $sgn: -1;
15
+ $x: 1 / $x;
16
+ }
17
+ @while $i > 0 {
18
+ $a: ($i * $i * $x * $x) / (2 * $i + 1 + $a);
19
+ $i: $i - 1;
20
+ }
21
+ @if $sgn > 0 {
22
+ @return $PI / 2 - $x / (1 + $a);
23
+ } @else if $sgn < 0 {
24
+ @return -$PI / 2 - $x / (1 + $a);
25
+ } @else {
26
+ @return $x / (1 + $a);
27
+ }
28
+ }
@@ -0,0 +1,37 @@
1
+ // Returns the arctangent of the quotient of its arguments.
2
+ // @param {Number} $y
3
+ // @param {Number} $x
4
+ // @example
5
+ // atan2(0, 0) // 0
6
+ // atan2(0, -0.0) // 3.14159
7
+ // atan2(-0.0, 0) // 0
8
+ // atan2(-0.0, -0.0) // -3.14159
9
+ // atan2(0, 1) // 0
10
+ // atan2(0, -1) // 3.14159
11
+ @function atan2 ($y, $x) {
12
+ @if $x > 0 {
13
+ @return atan($y / $x);
14
+ } @else if $x < 0 {
15
+ @if $y < 0 {
16
+ @return atan($y / $x) - $PI;
17
+ } @else {
18
+ @return atan($y / $x) + $PI;
19
+ }
20
+ } @else {
21
+ @if $y < 0 {
22
+ @return - $PI / 2;
23
+ } @else if $y > 0 {
24
+ @return $PI / 2;
25
+ } @else {
26
+ @if 1 / $x == 1 / 0 {
27
+ @return 0;
28
+ } @else {
29
+ @if 1 / $y == 1 / 0 {
30
+ @return $PI;
31
+ } @else {
32
+ @return -$PI;
33
+ }
34
+ }
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,13 @@
1
+ // Returns the cosine of a number.
2
+ // @param {Number} $x A number in rad or deg. Assuming unitless number to be in rad.
3
+ // @example
4
+ // cos(0.7854) // 0.70711
5
+ // cos(45deg) // 0.70711
6
+ @function cos ($x) {
7
+ $x: unitless-rad($x) % ($PI * 2);
8
+ $ret: 0;
9
+ @for $n from 0 to 24 {
10
+ $ret: $ret + pow(-1, $n) * pow($x, 2 * $n) / fact(2 * $n);
11
+ }
12
+ @return $ret;
13
+ }
@@ -0,0 +1,9 @@
1
+ // Returns the cotangent of a number.
2
+ // @param {Number} $x A number in rad or deg. Assuming unitless number to be in rad.
3
+ // @example
4
+ // cot(0.5236) // 1.73205
5
+ // cot(30deg) // 1.73205
6
+ @function cot ($x) {
7
+ $x: unitless-rad($x);
8
+ @return 1 / tan($x);
9
+ }
@@ -0,0 +1,9 @@
1
+ // Returns the cosecant of a number.
2
+ // @param {Number} $x A number in rad or deg. Assuming unitless number to be in rad.
3
+ // @example
4
+ // csc(1.0472) // 1.1547
5
+ // csc(60deg) // 1.1547
6
+ @function csc ($x) {
7
+ $x: unitless-rad($x);
8
+ @return 1 / sin($x);
9
+ }
@@ -0,0 +1,12 @@
1
+ // Returns E^x, where x is the argument, and E is Euler's constant, the base of the natural logarithms.
2
+ // @param {Number} $x
3
+ // @example
4
+ // exp(1) // 2.71828
5
+ // exp(-1) // 0.36788
6
+ @function exp ($x) {
7
+ $ret: 0;
8
+ @for $n from 0 to 24 {
9
+ $ret: $ret + pow($x, $n) / fact($n);
10
+ }
11
+ @return $ret;
12
+ }
@@ -0,0 +1,18 @@
1
+ // Returns the factorial of a non-negative integer.
2
+ // @param {Number} $x A non-negative integer.
3
+ // @return {Number}
4
+ // @example
5
+ // fact(0) // 1
6
+ // fact(8) // 40320
7
+ @function fact ($x) {
8
+ @if $x < 0 or $x != floor($x) {
9
+ @warn "Argument for `fact()` must be a positive integer.";
10
+ @return null;
11
+ }
12
+ $ret: 1;
13
+ @while $x > 0 {
14
+ $ret: $ret * $x;
15
+ $x: $x - 1;
16
+ }
17
+ @return $ret;
18
+ }
@@ -0,0 +1,21 @@
1
+ // Returns a two-element list containing the normalized fraction and exponent of number.
2
+ // @param {Number} $x
3
+ // @return {List} fraction, exponent
4
+ @function frexp ($x) {
5
+ $exp: 0;
6
+ @if $x < 0 {
7
+ $x: $x * -1;
8
+ }
9
+ @if $x < 0.5 {
10
+ @while $x < 0.5 {
11
+ $x: $x * 2;
12
+ $exp: $exp - 1;
13
+ }
14
+ } @else if $x >= 1 {
15
+ @while $x >= 1 {
16
+ $x: $x / 2;
17
+ $exp: $exp + 1;
18
+ }
19
+ }
20
+ @return $x, $exp;
21
+ }
@@ -0,0 +1,17 @@
1
+ // Returns $x * 2^$exp
2
+ // @param {Number} $x
3
+ // @param {Number} $exp
4
+ @function ldexp ($x, $exp) {
5
+ $b: if($exp >= 0, 2, 1 / 2);
6
+ @if $exp < 0 {
7
+ $exp: $exp * -1;
8
+ }
9
+ @while $exp > 0 {
10
+ @if $exp % 2 == 1 {
11
+ $x: $x * $b;
12
+ }
13
+ $b: $b * $b;
14
+ $exp: floor($exp * 0.5);
15
+ }
16
+ @return $x;
17
+ }
@@ -0,0 +1,34 @@
1
+ // Returns the natural logarithm of a number.
2
+ // @param {Number} $x
3
+ // @param {Number} $b The base number
4
+ // @example
5
+ // log(2) // 0.69315
6
+ // log(10) // 2.30259
7
+ // log(2, 10) // 0.30103
8
+ @function log ($x, $b: null) {
9
+ @if $b == null {
10
+ @return _log($x);
11
+ } @else {
12
+ @return _log($x) / _log($b);
13
+ }
14
+ }
15
+
16
+ @function _log ($x) {
17
+ @if $x <= 0 {
18
+ @return 0 / 0;
19
+ }
20
+ $k: nth(frexp($x / $SQRT2), 2);
21
+ $x: $x / ldexp(1, $k);
22
+ $x: ($x - 1) / ($x + 1);
23
+ $x2: $x * $x;
24
+ $i: 1;
25
+ $s: $x;
26
+ $sp: null;
27
+ @while $sp != $s {
28
+ $x: $x * $x2;
29
+ $i: $i + 2;
30
+ $sp: $s;
31
+ $s: $s + $x / $i;
32
+ }
33
+ @return $LN2 * $k + 2 * $s;
34
+ }
@@ -0,0 +1,28 @@
1
+ // Returns base to the exponent power.
2
+ // @param {Number} $base The base number
3
+ // @param {Number} $exp The exponent to which to raise base
4
+ // @return {Number}
5
+ // @example
6
+ // pow(4, 2) // 16
7
+ // pow(4, -2) // 0.0625
8
+ // pow(4, 0.2) // 1.31951
9
+ @function pow ($base, $exp) {
10
+ @if $exp == floor($exp) {
11
+ $r: 1;
12
+ $s: 0;
13
+ @if $exp < 0 {
14
+ $exp: $exp * -1;
15
+ $s: 1;
16
+ }
17
+ @while $exp > 0 {
18
+ @if $exp % 2 == 1 {
19
+ $r: $r * $base;
20
+ }
21
+ $exp: floor($exp * 0.5);
22
+ $base: $base * $base;
23
+ }
24
+ @return if($s != 0, 1 / $r, $r);
25
+ } @else {
26
+ @return exp(log($base) * $exp);
27
+ }
28
+ }
@@ -0,0 +1,9 @@
1
+ // Returns the secant of a number.
2
+ // @param {Number} $x A number in rad or deg. Assuming unitless number to be in rad.
3
+ // @example
4
+ // sec(0.7854) // 1.41422
5
+ // sec(45deg) // 1.41422
6
+ @function sec ($x) {
7
+ $x: unitless-rad($x);
8
+ @return 1 / cos($x);
9
+ }
@@ -0,0 +1,9 @@
1
+ // Returns the sine of a number.
2
+ // @param {Number} $x A number in rad or deg. Assuming unitless number to be in rad.
3
+ // @example
4
+ // sin(1.0472) // 0.86603
5
+ // sin(60deg) // 0.86603
6
+ @function sin ($x) {
7
+ $x: unitless-rad($x);
8
+ @return cos($x - $PI / 2);
9
+ }
@@ -0,0 +1,16 @@
1
+ // Returns the square root of a number.
2
+ // @param {Number} $x
3
+ // @example
4
+ // sqrt(2) // 1.41421
5
+ // sqrt(5) // 2.23607
6
+ @function sqrt ($x) {
7
+ @if $x < 0 {
8
+ @warn "Argument for `sqrt()` must be a positive number.";
9
+ @return null;
10
+ }
11
+ $ret: 1;
12
+ @for $i from 1 through 24 {
13
+ $ret: $ret - (pow($ret, 2) - $x) / (2 * $ret);
14
+ }
15
+ @return $ret;
16
+ }
@@ -0,0 +1,9 @@
1
+ // Returns the tangent of a number.
2
+ // @param {Number} $x A number in rad or deg. Assuming unitless number to be in rad.
3
+ // @example
4
+ // tan(0.5236) // 0.57735
5
+ // tan(30deg) // 0.57735
6
+ @function tan ($x) {
7
+ $x: unitless-rad($x);
8
+ @return sin($x) / cos($x);
9
+ }
@@ -0,0 +1,4 @@
1
+ // Convert deg to rad
2
+ @function deg-to-rad ($deg, $unit: true) {
3
+ @return strip-unit($deg) * $PI / 180 * if($unit, 1rad, 1);
4
+ }
@@ -0,0 +1,4 @@
1
+ // Convert rad to deg
2
+ @function rad-to-deg ($rad, $unit: true) {
3
+ @return strip-unit($rad) * 180 / $PI * if($unit, 1deg, 1);
4
+ }
@@ -0,0 +1,8 @@
1
+ // Strip unit from a number
2
+ @function strip-unit ($number) {
3
+ @if unitless($number) {
4
+ @return $number;
5
+ } @else {
6
+ @return $number / ($number * 0 + 1);
7
+ }
8
+ }
@@ -0,0 +1,13 @@
1
+ // Convert to unitless rad
2
+ @function unitless-rad ($angle) {
3
+ @if unitless($angle) {
4
+ @return $angle;
5
+ } @else if unit($angle) == rad {
6
+ @return $angle / 1rad;
7
+ } @else if unit($angle) == deg {
8
+ @return deg-to-rad($angle, false);
9
+ } @else if type-of($angle) != number or not unitless($angle) {
10
+ @warn "#{ $angle } is not a valid number.";
11
+ @return $angle;
12
+ }
13
+ }
@@ -35,24 +35,30 @@ module Decidim
35
35
  attr_reader :form
36
36
 
37
37
  def create_participatory_process
38
- transaction do
39
- process = ParticipatoryProcess.new(
40
- title: form.title,
41
- subtitle: form.subtitle,
42
- slug: form.slug,
43
- hashtag: form.hashtag,
44
- description: form.description,
45
- short_description: form.short_description,
46
- hero_image: form.hero_image,
47
- banner_image: form.banner_image,
48
- promoted: form.promoted,
49
- meta_scope: form.meta_scope,
50
- scope: form.scope,
51
- organization: form.current_organization,
52
- participatory_process_group: form.participatory_process_group
53
- )
38
+ process = ParticipatoryProcess.new(
39
+ organization: form.current_organization,
40
+ title: form.title,
41
+ subtitle: form.subtitle,
42
+ slug: form.slug,
43
+ hashtag: form.hashtag,
44
+ description: form.description,
45
+ short_description: form.short_description,
46
+ hero_image: form.hero_image,
47
+ banner_image: form.banner_image,
48
+ promoted: form.promoted,
49
+ scope: form.scope,
50
+ developer_group: form.developer_group,
51
+ local_area: form.local_area,
52
+ target: form.target,
53
+ participatory_scope: form.participatory_scope,
54
+ participatory_structure: form.participatory_structure,
55
+ meta_scope: form.meta_scope,
56
+ end_date: form.end_date,
57
+ participatory_process_group: form.participatory_process_group
58
+ )
54
59
 
55
- return process unless process.valid?
60
+ return process unless process.valid?
61
+ transaction do
56
62
  process.save!
57
63
 
58
64
  process.steps.create!(
@@ -36,7 +36,7 @@ module Decidim
36
36
 
37
37
  def create_participatory_process_group
38
38
  transaction do
39
- group = ParticipatoryProcessGroup.create(
39
+ ParticipatoryProcessGroup.create(
40
40
  name: form.name,
41
41
  description: form.description,
42
42
  hero_image: form.hero_image,
@@ -48,10 +48,10 @@ module Decidim
48
48
  def moderations
49
49
  @moderations ||= begin
50
50
  moderations = Decidim::Moderation.where(participatory_process: participatory_process)
51
- moderations = if params[:hidden]
52
- moderations.where.not(hidden_at: nil)
53
- else
54
- moderations.where(hidden_at: nil)
51
+ if params[:hidden]
52
+ moderations.where.not(hidden_at: nil)
53
+ else
54
+ moderations.where(hidden_at: nil)
55
55
  end
56
56
  end
57
57
  end
@@ -26,7 +26,7 @@ module Decidim
26
26
  CreateParticipatoryProcess.call(@form) do
27
27
  on(:ok) do |participatory_process|
28
28
  flash[:notice] = I18n.t("participatory_processes.create.success", scope: "decidim.admin")
29
- redirect_to participatory_process_path(participatory_process)
29
+ redirect_to edit_participatory_process_path(participatory_process)
30
30
  end
31
31
 
32
32
  on(:invalid) do
@@ -32,8 +32,12 @@ module Decidim
32
32
  validates :default_locale, presence: true
33
33
  validates :default_locale, inclusion: { in: :available_locales }
34
34
 
35
- validates :official_img_header, file_size: { less_than_or_equal_to: ->(_record) { Decidim.maximum_attachment_size } }, file_content_type: { allow: ["image/jpeg", "image/png"] }
36
- validates :official_img_footer, file_size: { less_than_or_equal_to: ->(_record) { Decidim.maximum_attachment_size } }, file_content_type: { allow: ["image/jpeg", "image/png"] }
35
+ validates :official_img_header,
36
+ file_size: { less_than_or_equal_to: ->(_record) { Decidim.maximum_attachment_size } },
37
+ file_content_type: { allow: ["image/jpeg", "image/png"] }
38
+ validates :official_img_footer,
39
+ file_size: { less_than_or_equal_to: ->(_record) { Decidim.maximum_attachment_size } },
40
+ file_content_type: { allow: ["image/jpeg", "image/png"] }
37
41
 
38
42
  private
39
43
 
@@ -38,6 +38,11 @@ module Decidim
38
38
  validates :hero_image, file_size: { less_than_or_equal_to: ->(_record) { Decidim.maximum_attachment_size } }, file_content_type: { allow: ["image/jpeg", "image/png"] }
39
39
  validates :banner_image, file_size: { less_than_or_equal_to: ->(_record) { Decidim.maximum_attachment_size } }, file_content_type: { allow: ["image/jpeg", "image/png"] }
40
40
 
41
+ def map_model(model)
42
+ self.scope_id = model.decidim_scope_id
43
+ self.participatory_process_group_id = model.decidim_participatory_process_group_id
44
+ end
45
+
41
46
  def scope
42
47
  @scope ||= current_organization.scopes.where(id: scope_id).first
43
48
  end