decidim-assemblies 0.31.8 → 0.32.0.rc1
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.
- checksums.yaml +4 -4
- data/README.md +4 -12
- data/app/cells/decidim/assemblies/content_blocks/main_data_cell.rb +1 -0
- data/app/commands/decidim/assemblies/admin/create_assembly.rb +4 -4
- data/app/commands/decidim/assemblies/admin/duplicate_assembly.rb +2 -3
- data/app/commands/decidim/assemblies/admin/update_assembly.rb +3 -3
- data/app/controllers/concerns/decidim/assemblies/admin/filterable.rb +6 -2
- data/app/controllers/concerns/decidim/assemblies/assembly_breadcrumb.rb +0 -3
- data/app/controllers/decidim/assemblies/admin/assemblies_controller.rb +2 -2
- data/app/controllers/decidim/assemblies/admin/assembly_attachment_collections_controller.rb +0 -2
- data/app/controllers/decidim/assemblies/admin/assembly_attachments_controller.rb +0 -2
- data/app/controllers/decidim/assemblies/admin/assembly_duplicates_controller.rb +1 -1
- data/app/controllers/decidim/assemblies/admin/assembly_exports_controller.rb +0 -2
- data/app/controllers/decidim/assemblies/admin/assembly_imports_controller.rb +1 -1
- data/app/controllers/decidim/assemblies/admin/assembly_landing_page_controller.rb +2 -8
- data/app/controllers/decidim/assemblies/admin/assembly_share_tokens_controller.rb +0 -2
- data/app/controllers/decidim/assemblies/admin/assembly_user_roles_controller.rb +0 -2
- data/app/controllers/decidim/assemblies/admin/component_share_tokens_controller.rb +0 -2
- data/app/controllers/decidim/assemblies/admin/concerns/assembly_admin.rb +3 -5
- data/app/controllers/decidim/assemblies/admin/members_controller.rb +14 -0
- data/app/controllers/decidim/assemblies/admin/members_csv_imports_controller.rb +22 -0
- data/app/controllers/decidim/assemblies/{participatory_space_private_users_controller.rb → members_controller.rb} +2 -11
- data/app/forms/decidim/assemblies/admin/assembly_duplicate_form.rb +2 -1
- data/app/forms/decidim/assemblies/admin/assembly_form.rb +9 -7
- data/app/forms/decidim/assemblies/admin/assembly_import_form.rb +1 -1
- data/app/helpers/decidim/assemblies/assemblies_helper.rb +3 -3
- data/app/helpers/decidim/assemblies/filter_assemblies_helper.rb +2 -1
- data/app/models/decidim/assembly.rb +12 -15
- data/app/packs/src/decidim/assemblies/controllers/assembly_admin/assembly_admin.test.js +1 -130
- data/app/packs/src/decidim/assemblies/controllers/assembly_admin/controller.js +0 -28
- data/app/permissions/decidim/assemblies/permissions.rb +9 -9
- data/app/presenters/decidim/assemblies/admin_log/assembly_presenter.rb +1 -2
- data/app/presenters/decidim/assemblies/assembly_presenter.rb +0 -4
- data/app/queries/decidim/assemblies/admin/admin_users.rb +1 -1
- data/app/serializers/decidim/assemblies/assembly_importer.rb +12 -15
- data/app/serializers/decidim/assemblies/assembly_serializer.rb +1 -1
- data/app/serializers/decidim/assemblies/open_data_assembly_serializer.rb +2 -8
- data/app/views/decidim/assemblies/admin/assemblies/_assemblies_thead.html.erb +1 -1
- data/app/views/decidim/assemblies/admin/assemblies/_assembly_row.html.erb +6 -7
- data/app/views/decidim/assemblies/admin/assemblies/_form.html.erb +33 -17
- data/app/views/decidim/assemblies/admin/assemblies/edit.html.erb +3 -2
- data/app/views/decidim/assemblies/admin/assemblies/index.html.erb +2 -1
- data/app/views/decidim/assemblies/admin/assemblies/manage_trash.html.erb +2 -2
- data/app/views/decidim/assemblies/admin/assemblies/new.html.erb +2 -2
- data/app/views/decidim/assemblies/admin/assembly_duplicates/_form.html.erb +3 -0
- data/app/views/decidim/assemblies/admin/assembly_duplicates/new.html.erb +2 -2
- data/app/views/decidim/assemblies/admin/assembly_imports/new.html.erb +2 -2
- data/app/views/decidim/assemblies/admin/assembly_user_roles/edit.html.erb +2 -2
- data/app/views/decidim/assemblies/admin/assembly_user_roles/index.html.erb +2 -2
- data/app/views/decidim/assemblies/admin/assembly_user_roles/new.html.erb +2 -2
- data/app/views/decidim/assemblies/assemblies/show.html.erb +11 -5
- data/app/views/decidim/assemblies/members/index.html.erb +24 -0
- data/config/locales/ar.yml +0 -26
- data/config/locales/bg.yml +0 -26
- data/config/locales/bs-BA.yml +0 -8
- data/config/locales/ca-IT.yml +37 -36
- data/config/locales/ca.yml +38 -37
- data/config/locales/cs.yml +36 -35
- data/config/locales/de.yml +146 -160
- data/config/locales/el.yml +0 -26
- data/config/locales/en.yml +36 -34
- data/config/locales/es-MX.yml +36 -35
- data/config/locales/es-PY.yml +36 -35
- data/config/locales/es.yml +36 -35
- data/config/locales/eu.yml +53 -52
- data/config/locales/fi-plain.yml +36 -35
- data/config/locales/fi.yml +36 -35
- data/config/locales/fr-CA.yml +34 -41
- data/config/locales/fr.yml +35 -45
- data/config/locales/ga-IE.yml +0 -12
- data/config/locales/gl.yml +33 -232
- data/config/locales/he-IL.yml +3 -11
- data/config/locales/hu.yml +0 -26
- data/config/locales/id-ID.yml +0 -22
- data/config/locales/is-IS.yml +1 -10
- data/config/locales/it.yml +0 -28
- data/config/locales/ja.yml +23 -35
- data/config/locales/kaa.yml +0 -1
- data/config/locales/ko.yml +0 -9
- data/config/locales/lb.yml +0 -24
- data/config/locales/lt.yml +0 -25
- data/config/locales/lv.yml +0 -25
- data/config/locales/nl.yml +0 -26
- data/config/locales/no.yml +0 -26
- data/config/locales/pl.yml +0 -26
- data/config/locales/pt-BR.yml +9 -33
- data/config/locales/pt.yml +0 -28
- data/config/locales/ro-RO.yml +2 -25
- data/config/locales/ru.yml +0 -15
- data/config/locales/sk.yml +0 -374
- data/config/locales/sl.yml +0 -11
- data/config/locales/sq-AL.yml +0 -17
- data/config/locales/sr-CS.yml +0 -8
- data/config/locales/sv.yml +16 -35
- data/config/locales/tr-TR.yml +4 -30
- data/config/locales/uk.yml +0 -15
- data/config/locales/zh-CN.yml +0 -25
- data/config/locales/zh-TW.yml +0 -26
- data/db/data/20260104094930_remove_assemblies_types_references.rb +25 -0
- data/db/data/20260111185230_replace_legacy_fields_to_access_mode_for_assemblies.rb +25 -0
- data/db/data/20260210195653_move_announcement_to_content_block_on_assemblies.rb +40 -0
- data/db/migrate/20180226103942_add_parent_child_relation_to_assemblies.rb +4 -4
- data/db/migrate/20190215093700_reset_negative_children_count_counters.rb +6 -2
- data/db/migrate/20210310120444_add_followable_counter_cache_to_assemblies.rb +6 -2
- data/db/migrate/20251112114736_remove_legacy_images_from_assemblies_module.rb +8 -0
- data/db/migrate/20251205120000_add_has_members_to_decidim_assemblies.rb +7 -0
- data/db/migrate/20260104093601_remove_assemblies_types.rb +12 -0
- data/db/migrate/20260111120000_add_access_mode_to_assemblies.rb +11 -0
- data/decidim-assemblies.gemspec +8 -9
- data/lib/decidim/api/assembly_type.rb +1 -8
- data/lib/decidim/assemblies/admin_engine.rb +10 -4
- data/lib/decidim/assemblies/content_blocks/registry_manager.rb +5 -0
- data/lib/decidim/assemblies/engine.rb +26 -42
- data/lib/decidim/assemblies/menu.rb +5 -5
- data/lib/decidim/assemblies/participatory_space.rb +0 -2
- data/lib/decidim/assemblies/seeds.rb +1 -2
- data/lib/decidim/assemblies/test/factories.rb +8 -20
- data/lib/decidim/assemblies/version.rb +1 -1
- metadata +25 -30
- data/app/cells/decidim/assemblies/assembly_dropdown_metadata_cell.rb +0 -19
- data/app/commands/decidim/assemblies/admin/create_assemblies_type.rb +0 -17
- data/app/commands/decidim/assemblies/admin/update_assemblies_type.rb +0 -13
- data/app/controllers/decidim/assemblies/admin/participatory_space_private_users_controller.rb +0 -24
- data/app/controllers/decidim/assemblies/admin/participatory_space_private_users_csv_imports_controller.rb +0 -24
- data/app/forms/decidim/assemblies/admin/assemblies_type_form.rb +0 -17
- data/app/models/decidim/assemblies_type.rb +0 -27
- data/app/presenters/decidim/assemblies/admin_log/assemblies_type_presenter.rb +0 -43
- data/app/presenters/decidim/log/value_types/assembly_type_presenter.rb +0 -29
- data/app/queries/decidim/assemblies/filtered_assemblies.rb +0 -22
- data/app/views/decidim/assemblies/pages/user_profile/_member_of.html.erb +0 -9
- data/app/views/decidim/assemblies/participatory_space_private_users/index.html.erb +0 -25
|
@@ -363,7 +363,6 @@ describe("AssemblyAdminController", () => {
|
|
|
363
363
|
<div aria-disabled="false" aria-label="Choose date" class="wc-datepicker sc-wc-datepicker" role="group">
|
|
364
364
|
</div>
|
|
365
365
|
</wc-datepicker>
|
|
366
|
-
<button class="datepicker__pick-calendar button button__secondary button__xs" disabled="true" type="button">Select</button>
|
|
367
366
|
<button class="datepicker__close-calendar button button__transparent-secondary button__xs" type="button">Close</button>
|
|
368
367
|
</div>
|
|
369
368
|
</div>
|
|
@@ -388,7 +387,6 @@ describe("AssemblyAdminController", () => {
|
|
|
388
387
|
<div class="datepicker__container" style="display: none;">
|
|
389
388
|
<wc-datepicker id="assembly_included_at_date_datepicker" locale="en" class="sc-wc-datepicker-h sc-wc-datepicker-s hydrated">
|
|
390
389
|
</wc-datepicker>
|
|
391
|
-
<button class="datepicker__pick-calendar button button__secondary button__xs" disabled="true" type="button">Select</button>
|
|
392
390
|
<button class="datepicker__close-calendar button button__transparent-secondary button__xs" type="button">Close</button>
|
|
393
391
|
</div>
|
|
394
392
|
</div>
|
|
@@ -411,7 +409,6 @@ describe("AssemblyAdminController", () => {
|
|
|
411
409
|
</svg>
|
|
412
410
|
</button>
|
|
413
411
|
<div class="datepicker__container" style="display: none;">
|
|
414
|
-
<button class="datepicker__pick-calendar button button__secondary button__xs" disabled="true" type="button">Select</button>
|
|
415
412
|
<button class="datepicker__close-calendar button button__transparent-secondary button__xs" type="button">Close</button>
|
|
416
413
|
</div>
|
|
417
414
|
</div>
|
|
@@ -433,7 +430,6 @@ describe("AssemblyAdminController", () => {
|
|
|
433
430
|
</svg>
|
|
434
431
|
</button>
|
|
435
432
|
<div class="datepicker__container" style="display: none;">
|
|
436
|
-
<button class="datepicker__pick-calendar button button__secondary button__xs" disabled="true" type="button">Select</button>
|
|
437
433
|
<button class="datepicker__close-calendar button button__transparent-secondary button__xs" type="button">Close</button>
|
|
438
434
|
</div>
|
|
439
435
|
</div>
|
|
@@ -494,15 +490,6 @@ describe("AssemblyAdminController", () => {
|
|
|
494
490
|
<button id="assembly_hero_image_button" name="hero_image" class="button button__sm button__transparent-secondary" type="button" data-dialog-open="upload_c5515a82-b6d4-4c1c-a957-013c9679b956" data-upload="{"addAttribute":"hero_image","resourceName":"assembly","resourceClass":"Decidim::Assembly","required":false,"maxFileSize":10485760.0,"multiple":false,"titled":false,"formObjectClass":"Decidim::Assemblies::Admin::AssemblyForm"}" aria-haspopup="dialog">Add image</button>
|
|
495
491
|
</div>
|
|
496
492
|
</div>
|
|
497
|
-
<div class="columns">
|
|
498
|
-
<div class="upload-modal__files-container upload-container-for-banner_image ">
|
|
499
|
-
<div>
|
|
500
|
-
<label>Banner image</label>
|
|
501
|
-
<div class="upload-modal__files" data-active-uploads="upload_0d6b6c3f-3681-450e-dummy-2"></div>
|
|
502
|
-
</div>
|
|
503
|
-
<button id="assembly_banner_image_button" name="banner_image" class="button button__sm button__transparent-secondary" type="button" data-dialog-open="upload_0d6b6c3f-3681-450e-dummy-2" data-upload="{"addAttribute":"banner_image","resourceName":"assembly","resourceClass":"Decidim::Assembly","required":false,"maxFileSize":10485760.0,"multiple":false,"titled":false,"formObjectClass":"Decidim::Assemblies::Admin::AssemblyForm"}" aria-haspopup="dialog">Add image</button>
|
|
504
|
-
</div>
|
|
505
|
-
</div>
|
|
506
493
|
</div>
|
|
507
494
|
</div>
|
|
508
495
|
</div>
|
|
@@ -748,7 +735,7 @@ describe("AssemblyAdminController", () => {
|
|
|
748
735
|
<label for="assembly_private_space">
|
|
749
736
|
<input name="assembly[private_space]" type="hidden" value="0" autocomplete="off">
|
|
750
737
|
<input type="checkbox" value="1" name="assembly[private_space]" id="assembly_private_space">Private space </label>
|
|
751
|
-
<p class="help-text">You will be able to manage
|
|
738
|
+
<p class="help-text">You will be able to manage members after setting it as private</p>
|
|
752
739
|
</div>
|
|
753
740
|
<div class="row column" id="is_transparent">
|
|
754
741
|
<label for="assembly_is_transparent">
|
|
@@ -870,28 +857,6 @@ describe("AssemblyAdminController", () => {
|
|
|
870
857
|
it("should initialize the controller and set up event listeners", () => {
|
|
871
858
|
expect(controller).toBeDefined();
|
|
872
859
|
expect(element).toBeDefined();
|
|
873
|
-
|
|
874
|
-
// Test that initial state is set correctly
|
|
875
|
-
const isTransparentCheckbox = element.querySelector("#is_transparent input[type='checkbox']");
|
|
876
|
-
const specialFeatures = element.querySelector("#special_features");
|
|
877
|
-
|
|
878
|
-
expect(isTransparentCheckbox.disabled).toBe(true);
|
|
879
|
-
expect(specialFeatures.style.display).toBe("none");
|
|
880
|
-
});
|
|
881
|
-
|
|
882
|
-
it("should call assignBehavior for assembly_type and created_by fields", () => {
|
|
883
|
-
const assemblyType = element.querySelector("#assembly_assembly_type");
|
|
884
|
-
const createdBy = element.querySelector("#assembly_created_by");
|
|
885
|
-
|
|
886
|
-
expect(assemblyType).toBeDefined();
|
|
887
|
-
expect(createdBy).toBeDefined();
|
|
888
|
-
|
|
889
|
-
// Verify that event listeners are attached by triggering changes
|
|
890
|
-
// const assemblyTypeOther = element.querySelector("#assembly_type_other");
|
|
891
|
-
const createdByOther = element.querySelector("#created_by_other");
|
|
892
|
-
|
|
893
|
-
// expect(assemblyTypeOther.style.display).toBe("none");
|
|
894
|
-
expect(createdByOther.style.display).toBe("none");
|
|
895
860
|
});
|
|
896
861
|
});
|
|
897
862
|
|
|
@@ -931,16 +896,6 @@ describe("AssemblyAdminController", () => {
|
|
|
931
896
|
// Should hide initially if value is not "others"
|
|
932
897
|
expect(targetDiv.style.display).toBe("none");
|
|
933
898
|
});
|
|
934
|
-
|
|
935
|
-
it("should handle null elements gracefully", () => {
|
|
936
|
-
expect(() => {
|
|
937
|
-
controller.attachVisibility(null, null);
|
|
938
|
-
}).not.toThrow();
|
|
939
|
-
|
|
940
|
-
expect(() => {
|
|
941
|
-
controller.attachVisibility(element.querySelector("#assembly_assembly_type"), null);
|
|
942
|
-
}).not.toThrow();
|
|
943
|
-
});
|
|
944
899
|
});
|
|
945
900
|
|
|
946
901
|
describe("toggleDependsOnSelect", () => {
|
|
@@ -963,79 +918,6 @@ describe("AssemblyAdminController", () => {
|
|
|
963
918
|
|
|
964
919
|
expect(targetDiv.style.display).toBe("none");
|
|
965
920
|
});
|
|
966
|
-
|
|
967
|
-
it("should return early if target or showDiv is null", () => {
|
|
968
|
-
const select = element.querySelector("#assembly_assembly_type");
|
|
969
|
-
|
|
970
|
-
expect(() => {
|
|
971
|
-
controller.toggleDependsOnSelect(null, null);
|
|
972
|
-
}).not.toThrow();
|
|
973
|
-
|
|
974
|
-
expect(() => {
|
|
975
|
-
controller.toggleDependsOnSelect(select, null);
|
|
976
|
-
}).not.toThrow();
|
|
977
|
-
});
|
|
978
|
-
});
|
|
979
|
-
|
|
980
|
-
describe("toggleDisabledHiddenFields", () => {
|
|
981
|
-
it("should initially disable transparent checkbox and hide special features", () => {
|
|
982
|
-
controller.toggleDisabledHiddenFields();
|
|
983
|
-
|
|
984
|
-
const isTransparentCheckbox = element.querySelector("#is_transparent input[type='checkbox']");
|
|
985
|
-
const specialFeatures = element.querySelector("#special_features");
|
|
986
|
-
|
|
987
|
-
expect(isTransparentCheckbox.disabled).toBe(true);
|
|
988
|
-
expect(specialFeatures.style.display).toBe("none");
|
|
989
|
-
});
|
|
990
|
-
|
|
991
|
-
it("should enable transparent checkbox and show special features when private space is checked", () => {
|
|
992
|
-
const privateSpaceCheckbox = element.querySelector("#private_space input[type='checkbox']");
|
|
993
|
-
const isTransparentCheckbox = element.querySelector("#is_transparent input[type='checkbox']");
|
|
994
|
-
const specialFeatures = element.querySelector("#special_features");
|
|
995
|
-
|
|
996
|
-
// Check private space checkbox
|
|
997
|
-
privateSpaceCheckbox.checked = true;
|
|
998
|
-
|
|
999
|
-
controller.toggleDisabledHiddenFields();
|
|
1000
|
-
|
|
1001
|
-
expect(isTransparentCheckbox.disabled).toBe(false);
|
|
1002
|
-
expect(specialFeatures.style.display).toBe("block");
|
|
1003
|
-
});
|
|
1004
|
-
|
|
1005
|
-
it("should disable transparent checkbox and hide special features when private space is unchecked", () => {
|
|
1006
|
-
const privateSpaceCheckbox = element.querySelector("#private_space input[type='checkbox']");
|
|
1007
|
-
const isTransparentCheckbox = element.querySelector("#is_transparent input[type='checkbox']");
|
|
1008
|
-
const specialFeatures = element.querySelector("#special_features");
|
|
1009
|
-
|
|
1010
|
-
// Uncheck private space checkbox
|
|
1011
|
-
privateSpaceCheckbox.checked = false;
|
|
1012
|
-
|
|
1013
|
-
controller.toggleDisabledHiddenFields();
|
|
1014
|
-
|
|
1015
|
-
expect(isTransparentCheckbox.disabled).toBe(true);
|
|
1016
|
-
expect(specialFeatures.style.display).toBe("none");
|
|
1017
|
-
});
|
|
1018
|
-
|
|
1019
|
-
it("should handle missing elements gracefully", () => {
|
|
1020
|
-
// Remove elements to test graceful handling
|
|
1021
|
-
element.querySelector("#private_space").remove();
|
|
1022
|
-
element.querySelector("#is_transparent").remove();
|
|
1023
|
-
element.querySelector("#special_features").remove();
|
|
1024
|
-
|
|
1025
|
-
expect(() => {
|
|
1026
|
-
controller.toggleDisabledHiddenFields();
|
|
1027
|
-
}).not.toThrow();
|
|
1028
|
-
});
|
|
1029
|
-
|
|
1030
|
-
it("should handle missing checkbox inside transparent div", () => {
|
|
1031
|
-
// Remove checkbox from transparent div
|
|
1032
|
-
const isTransparent = element.querySelector("#is_transparent");
|
|
1033
|
-
isTransparent.innerHTML = "";
|
|
1034
|
-
|
|
1035
|
-
expect(() => {
|
|
1036
|
-
controller.toggleDisabledHiddenFields();
|
|
1037
|
-
}).not.toThrow();
|
|
1038
|
-
});
|
|
1039
921
|
});
|
|
1040
922
|
|
|
1041
923
|
describe("integration tests", () => {
|
|
@@ -1063,15 +945,4 @@ describe("AssemblyAdminController", () => {
|
|
|
1063
945
|
});
|
|
1064
946
|
});
|
|
1065
947
|
|
|
1066
|
-
describe("edge cases", () => {
|
|
1067
|
-
it("should handle elements with no checkbox inside", () => {
|
|
1068
|
-
// Replace private space with div that has no checkbox
|
|
1069
|
-
const privateSpace = element.querySelector("#private_space");
|
|
1070
|
-
privateSpace.innerHTML = "<div>No checkbox here</div>";
|
|
1071
|
-
|
|
1072
|
-
expect(() => {
|
|
1073
|
-
controller.toggleDisabledHiddenFields();
|
|
1074
|
-
}).not.toThrow();
|
|
1075
|
-
});
|
|
1076
|
-
});
|
|
1077
948
|
});
|
|
@@ -2,14 +2,6 @@ import { Controller } from "@hotwired/stimulus"
|
|
|
2
2
|
|
|
3
3
|
export default class extends Controller {
|
|
4
4
|
connect() {
|
|
5
|
-
const privateSpace = this.element.querySelector("#private_space");
|
|
6
|
-
|
|
7
|
-
if (privateSpace) {
|
|
8
|
-
privateSpace.addEventListener("change", this.toggleDisabledHiddenFields);
|
|
9
|
-
}
|
|
10
|
-
this.toggleDisabledHiddenFields();
|
|
11
|
-
|
|
12
|
-
this.assignBehavior("assembly_type");
|
|
13
5
|
this.assignBehavior("created_by");
|
|
14
6
|
}
|
|
15
7
|
|
|
@@ -39,24 +31,4 @@ export default class extends Controller {
|
|
|
39
31
|
showDiv.style.display = "block";
|
|
40
32
|
}
|
|
41
33
|
}
|
|
42
|
-
|
|
43
|
-
toggleDisabledHiddenFields() {
|
|
44
|
-
const privateSpace = document.getElementById("private_space");
|
|
45
|
-
const isTransparent = document.getElementById("is_transparent");
|
|
46
|
-
const specialFeatures = document.getElementById("special_features");
|
|
47
|
-
|
|
48
|
-
const enabledPrivateSpace = privateSpace?.querySelector("input[type='checkbox']")?.checked;
|
|
49
|
-
const isTransparentCheckbox = isTransparent?.querySelector("input[type='checkbox']");
|
|
50
|
-
|
|
51
|
-
if (isTransparentCheckbox) {
|
|
52
|
-
isTransparentCheckbox.disabled = (enabledPrivateSpace === false);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (specialFeatures) {
|
|
56
|
-
specialFeatures.style.display = enabledPrivateSpace
|
|
57
|
-
? "block"
|
|
58
|
-
: "none";
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
34
|
}
|
|
@@ -41,7 +41,7 @@ module Decidim
|
|
|
41
41
|
|
|
42
42
|
return permission_action unless assembly
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
user_can_read_members?
|
|
45
45
|
|
|
46
46
|
moderator_action?
|
|
47
47
|
collaborator_action?
|
|
@@ -53,9 +53,9 @@ module Decidim
|
|
|
53
53
|
|
|
54
54
|
private
|
|
55
55
|
|
|
56
|
-
def
|
|
57
|
-
return unless permission_action.subject == :
|
|
58
|
-
return unless assembly.
|
|
56
|
+
def user_can_read_members?
|
|
57
|
+
return unless permission_action.subject == :space_member
|
|
58
|
+
return unless assembly.has_members?
|
|
59
59
|
|
|
60
60
|
toggle_allow(user.admin? || can_manage_assembly?(role: :admin) || can_manage_assembly?(role: :collaborator))
|
|
61
61
|
end
|
|
@@ -108,7 +108,7 @@ module Decidim
|
|
|
108
108
|
[:assembly, :participatory_space].include?(permission_action.subject) &&
|
|
109
109
|
assembly
|
|
110
110
|
|
|
111
|
-
return disallow! unless
|
|
111
|
+
return disallow! unless can_view_restricted_space?
|
|
112
112
|
return allow! if user&.admin?
|
|
113
113
|
return allow! if assembly.published?
|
|
114
114
|
return allow! if user_can_preview_space?
|
|
@@ -116,11 +116,11 @@ module Decidim
|
|
|
116
116
|
toggle_allow(can_manage_assembly?)
|
|
117
117
|
end
|
|
118
118
|
|
|
119
|
-
def
|
|
120
|
-
return true unless assembly.
|
|
119
|
+
def can_view_restricted_space?
|
|
120
|
+
return true unless assembly.restricted?
|
|
121
121
|
return false unless user
|
|
122
122
|
|
|
123
|
-
user.admin || assembly.users.include?(user)
|
|
123
|
+
user.admin? || assembly.users.include?(user)
|
|
124
124
|
end
|
|
125
125
|
|
|
126
126
|
def public_list_members_action?
|
|
@@ -222,7 +222,7 @@ module Decidim
|
|
|
222
222
|
# Collaborators can read/preview everything inside their assembly.
|
|
223
223
|
def collaborator_action?
|
|
224
224
|
return unless can_manage_assembly?(role: :collaborator)
|
|
225
|
-
return if permission_action.subject == :
|
|
225
|
+
return if permission_action.subject == :space_member
|
|
226
226
|
|
|
227
227
|
allow! if permission_action.action == :read || permission_action.action == :preview
|
|
228
228
|
end
|
|
@@ -35,7 +35,6 @@ module Decidim
|
|
|
35
35
|
target: :i18n,
|
|
36
36
|
title: :i18n,
|
|
37
37
|
purpose_of_action: :i18n,
|
|
38
|
-
decidim_assemblies_type_id: :assembly_type,
|
|
39
38
|
creation_date: :date,
|
|
40
39
|
created_by: :string,
|
|
41
40
|
created_by_other: :i18n,
|
|
@@ -44,7 +43,7 @@ module Decidim
|
|
|
44
43
|
closing_date: :date,
|
|
45
44
|
closing_date_reason: :i18n,
|
|
46
45
|
internal_organisation: :i18n,
|
|
47
|
-
|
|
46
|
+
access_mode: :access_mode,
|
|
48
47
|
special_features: :i18n,
|
|
49
48
|
twitter_handler: :string,
|
|
50
49
|
facebook_handler: :string,
|
|
@@ -38,7 +38,6 @@ module Decidim
|
|
|
38
38
|
target: attributes["target"],
|
|
39
39
|
participatory_scope: attributes["participatory_scope"],
|
|
40
40
|
participatory_structure: attributes["participatory_structure"],
|
|
41
|
-
private_space: attributes["private_space"],
|
|
42
41
|
reference: attributes["reference"],
|
|
43
42
|
purpose_of_action: attributes["purpose_of_action"],
|
|
44
43
|
composition: attributes["composition"],
|
|
@@ -49,7 +48,6 @@ module Decidim
|
|
|
49
48
|
closing_date: attributes["closing_date"],
|
|
50
49
|
created_by_other: attributes["created_by_other"],
|
|
51
50
|
internal_organisation: attributes["internal_organisation"],
|
|
52
|
-
is_transparent: attributes["is_transparent"],
|
|
53
51
|
special_features: attributes["special_features"],
|
|
54
52
|
twitter_handler: attributes["twitter_handler"],
|
|
55
53
|
instagram_handler: attributes["instagram_handler"],
|
|
@@ -58,11 +56,9 @@ module Decidim
|
|
|
58
56
|
github_handler: attributes["github_handler"],
|
|
59
57
|
created_by: attributes["created_by"],
|
|
60
58
|
meta_scope: attributes["meta_scope"],
|
|
61
|
-
|
|
59
|
+
access_mode: resolve_access_mode(attributes)
|
|
62
60
|
)
|
|
63
61
|
import_hero_image(attributes["remote_hero_image_url"])
|
|
64
|
-
import_banner_image(attributes["remote_banner_image_url"])
|
|
65
|
-
|
|
66
62
|
@imported_assembly.save!
|
|
67
63
|
@imported_assembly
|
|
68
64
|
end
|
|
@@ -109,8 +105,8 @@ module Decidim
|
|
|
109
105
|
end
|
|
110
106
|
end
|
|
111
107
|
|
|
112
|
-
|
|
113
|
-
attachments["attachment_collections"]
|
|
108
|
+
unless attachments["attachment_collections"].empty?
|
|
109
|
+
attachments["attachment_collections"].map do |collection|
|
|
114
110
|
Decidim.traceability.perform_action!("create", AttachmentCollection, @user) do
|
|
115
111
|
create_attachment_collection(collection)
|
|
116
112
|
end
|
|
@@ -178,14 +174,6 @@ module Decidim
|
|
|
178
174
|
@warnings << I18n.t("decidim.assemblies.admin.imports.hero_image_error", error: format_error(e))
|
|
179
175
|
end
|
|
180
176
|
|
|
181
|
-
def import_banner_image(url)
|
|
182
|
-
return if url.blank?
|
|
183
|
-
|
|
184
|
-
@imported_assembly.attached_uploader(:banner_image).remote_url = url
|
|
185
|
-
rescue OpenURI::HTTPError, Errno::ENOENT, Errno::ECONNREFUSED, SocketError, Net::OpenTimeout, Net::ReadTimeout => e
|
|
186
|
-
@warnings << I18n.t("decidim.assemblies.admin.imports.banner_image_error", error: format_error(e))
|
|
187
|
-
end
|
|
188
|
-
|
|
189
177
|
def format_error(error)
|
|
190
178
|
return error.message unless error.respond_to?(:io) && error.io.respond_to?(:status)
|
|
191
179
|
|
|
@@ -197,6 +185,15 @@ module Decidim
|
|
|
197
185
|
message = message.presence || error.message
|
|
198
186
|
"#{code} #{message}"
|
|
199
187
|
end
|
|
188
|
+
|
|
189
|
+
def resolve_access_mode(attributes)
|
|
190
|
+
return attributes["access_mode"] if attributes["access_mode"].present?
|
|
191
|
+
|
|
192
|
+
return "transparent" if attributes["is_transparent"] == true
|
|
193
|
+
return "restricted" if attributes["private_space"] == true
|
|
194
|
+
|
|
195
|
+
"open"
|
|
196
|
+
end
|
|
200
197
|
end
|
|
201
198
|
end
|
|
202
199
|
end
|
|
@@ -14,7 +14,7 @@ module Decidim
|
|
|
14
14
|
attachment_collections: serialize_attachment_collections,
|
|
15
15
|
files: serialize_attachments
|
|
16
16
|
},
|
|
17
|
-
|
|
17
|
+
access_mode: resource.access_mode,
|
|
18
18
|
weight: resource.weight,
|
|
19
19
|
components: serialize_components
|
|
20
20
|
}
|
|
@@ -12,8 +12,6 @@ module Decidim
|
|
|
12
12
|
url: EngineRouter.main_proxy(resource).assembly_url(resource),
|
|
13
13
|
subtitle: resource.subtitle,
|
|
14
14
|
remote_hero_image_url: Decidim::ParticipatoryProcesses::ParticipatoryProcessPresenter.new(resource).hero_image_url,
|
|
15
|
-
remote_banner_image_url: Decidim::Assemblies::AssemblyPresenter.new(resource).banner_image_url,
|
|
16
|
-
announcement: resource.announcement,
|
|
17
15
|
developer_group: resource.developer_group,
|
|
18
16
|
local_area: resource.local_area,
|
|
19
17
|
meta_scope: resource.meta_scope,
|
|
@@ -39,18 +37,14 @@ module Decidim
|
|
|
39
37
|
creation_date: resource.creation_date,
|
|
40
38
|
closing_date_reason: resource.closing_date_reason,
|
|
41
39
|
internal_organisation: resource.internal_organisation,
|
|
42
|
-
|
|
40
|
+
access_mode: resource.access_mode,
|
|
43
41
|
special_features: resource.special_features,
|
|
44
42
|
twitter_handler: resource.twitter_handler,
|
|
45
43
|
instagram_handler: resource.instagram_handler,
|
|
46
44
|
facebook_handler: resource.facebook_handler,
|
|
47
45
|
youtube_handler: resource.youtube_handler,
|
|
48
46
|
github_handler: resource.github_handler,
|
|
49
|
-
created_by_other: resource.created_by_other
|
|
50
|
-
assembly_type: {
|
|
51
|
-
id: resource.assembly_type.try(:id),
|
|
52
|
-
title: resource.assembly_type.try(:title) || empty_translatable
|
|
53
|
-
}
|
|
47
|
+
created_by_other: resource.created_by_other
|
|
54
48
|
}
|
|
55
49
|
)
|
|
56
50
|
end
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<%= sort_link(query, :created_at, t("models.assembly.fields.created_at", scope: "decidim.admin"), default_order: :desc) %>
|
|
8
8
|
</th>
|
|
9
9
|
<th>
|
|
10
|
-
<%= sort_link(query, :
|
|
10
|
+
<%= sort_link(query, :access_mode, t("models.assembly.fields.access_mode", scope: "decidim.admin")) %>
|
|
11
11
|
</th>
|
|
12
12
|
<th class="table-list__actions">
|
|
13
13
|
<%= sort_link(query, :published_at, t("models.assembly.fields.published", scope: "decidim.admin")) %>
|
|
@@ -33,12 +33,11 @@
|
|
|
33
33
|
<td class="table-list__date" data-label="<%= t("models.assembly.fields.created_at", scope: "decidim.admin") %>">
|
|
34
34
|
<%= l(assembly.created_at, format: :short) %>
|
|
35
35
|
</td>
|
|
36
|
-
<td class="table-list__state" data-label="<%= t("models.assembly.fields.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<% end %>
|
|
36
|
+
<td class="table-list__state" data-label="<%= t("models.assembly.fields.access_mode", scope: "decidim.admin") %>">
|
|
37
|
+
<%# i18n-tasks-use t("decidim.admin.assemblies.index.access_modes.open") %>
|
|
38
|
+
<%# i18n-tasks-use t("decidim.admin.assemblies.index.access_modes.restricted") %>
|
|
39
|
+
<%# i18n-tasks-use t("decidim.admin.assemblies.index.access_modes.transparent") %>
|
|
40
|
+
<span><%= t(assembly.access_mode, scope: "decidim.admin.assemblies.index.access_modes") %></span>
|
|
42
41
|
</td>
|
|
43
42
|
<td class="table-list__state" data-label="<%= t("models.assembly.fields.published", scope: "decidim.admin") %>">
|
|
44
43
|
<% if assembly.published? %>
|
|
@@ -146,7 +145,7 @@
|
|
|
146
145
|
<% if assembly.published? %>
|
|
147
146
|
<li class="dropdown__item">
|
|
148
147
|
<div class="dropdown__button-disabled">
|
|
149
|
-
<%= with_tooltip t("tooltips.deleted_assemblies_info", scope: "decidim.admin")
|
|
148
|
+
<%= with_tooltip t("tooltips.deleted_assemblies_info", scope: "decidim.admin") do %>
|
|
150
149
|
<%= icon "delete-bin-line", class: "text-gray" %>
|
|
151
150
|
<span>
|
|
152
151
|
<%= t("actions.soft_delete", scope: "decidim.admin") %>
|
|
@@ -48,9 +48,6 @@
|
|
|
48
48
|
<%= form.translated :editor, :internal_organisation, aria: { label: :internal_organisation } %>
|
|
49
49
|
</div>
|
|
50
50
|
|
|
51
|
-
<div class="row column">
|
|
52
|
-
<%= form.translated :editor, :announcement, help_text: t(".announcement_help") %>
|
|
53
|
-
</div>
|
|
54
51
|
</div>
|
|
55
52
|
</div>
|
|
56
53
|
<div class="card" data-controller="accordion" id="accordion-duration">
|
|
@@ -101,10 +98,6 @@
|
|
|
101
98
|
<div class="columns">
|
|
102
99
|
<%= form.upload :hero_image, button_class: "button button__sm button__transparent-secondary" %>
|
|
103
100
|
</div>
|
|
104
|
-
|
|
105
|
-
<div class="columns">
|
|
106
|
-
<%= form.upload :banner_image, button_class: "button button__sm button__transparent-secondary" %>
|
|
107
|
-
</div>
|
|
108
101
|
</div>
|
|
109
102
|
</div>
|
|
110
103
|
</div>
|
|
@@ -176,6 +169,39 @@
|
|
|
176
169
|
</div>
|
|
177
170
|
</div>
|
|
178
171
|
|
|
172
|
+
<div class="card" data-controller="accordion access-mode" id="accordion-access">
|
|
173
|
+
<div class="card-divider">
|
|
174
|
+
<button class="card-divider-button" data-open="true" data-controls="panel-access" type="button">
|
|
175
|
+
<%= icon "arrow-right-s-line" %>
|
|
176
|
+
<h2 class="card-title" id="access">
|
|
177
|
+
<%= t("label", scope: "decidim.assemblies.admin.assemblies.form.access") %>
|
|
178
|
+
</h2>
|
|
179
|
+
</button>
|
|
180
|
+
</div>
|
|
181
|
+
<div id="panel-access" class="card-section">
|
|
182
|
+
<div class="row column" id="has_members">
|
|
183
|
+
<%= form.check_box :has_members, help_text: t(".has_members_help") %>
|
|
184
|
+
</div>
|
|
185
|
+
|
|
186
|
+
<fieldset class="row column" id="access_mode">
|
|
187
|
+
<legend>
|
|
188
|
+
<%= t("access.set_this_space_as", scope: "decidim.assemblies.admin.assemblies.form") %>
|
|
189
|
+
</legend>
|
|
190
|
+
<div class="radio-group">
|
|
191
|
+
<%# i18n-tasks-use t("decidim.assemblies.admin.assemblies.form.access.options.open") %>
|
|
192
|
+
<%# i18n-tasks-use t("decidim.assemblies.admin.assemblies.form.access.options.restricted") %>
|
|
193
|
+
<%# i18n-tasks-use t("decidim.assemblies.admin.assemblies.form.access.options.transparent") %>
|
|
194
|
+
<% Decidim::Assembly::ACCESS_MODES.keys.each do |mode| %>
|
|
195
|
+
<%= label_tag nil, class: "form__wrapper-checkbox-label" do %>
|
|
196
|
+
<%= form.radio_button :access_mode, mode %>
|
|
197
|
+
<span><%= t(mode, scope: "decidim.assemblies.admin.assemblies.form.access.options") %></span>
|
|
198
|
+
<% end %>
|
|
199
|
+
<% end %>
|
|
200
|
+
</div>
|
|
201
|
+
</fieldset>
|
|
202
|
+
</div>
|
|
203
|
+
</div>
|
|
204
|
+
|
|
179
205
|
<div class="card" data-controller="accordion" id="accordion-visibility">
|
|
180
206
|
<div class="card-divider">
|
|
181
207
|
<button class="card-divider-button" data-open="true" data-controls="panel-visibility" type="button">
|
|
@@ -185,7 +211,6 @@
|
|
|
185
211
|
</h2>
|
|
186
212
|
</button>
|
|
187
213
|
</div>
|
|
188
|
-
|
|
189
214
|
<div id="panel-visibility" class="card-section">
|
|
190
215
|
<% if params[:parent_id].present? %>
|
|
191
216
|
<%= form.hidden_field :parent_id, value: @form.parent_id %>
|
|
@@ -200,15 +225,6 @@
|
|
|
200
225
|
<div class="row column">
|
|
201
226
|
<%= form.check_box :promoted %>
|
|
202
227
|
</div>
|
|
203
|
-
|
|
204
|
-
<div class="row column" id="private_space">
|
|
205
|
-
<%= form.check_box :private_space %>
|
|
206
|
-
<p class="help-text"><%= t(".private_notice") %></p>
|
|
207
|
-
</div>
|
|
208
|
-
|
|
209
|
-
<div class="row column" id="is_transparent">
|
|
210
|
-
<%= form.check_box :is_transparent %>
|
|
211
|
-
</div>
|
|
212
228
|
</div>
|
|
213
229
|
</div>
|
|
214
230
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
<% add_decidim_page_title(t("
|
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
|
2
|
+
|
|
2
3
|
<div class="item_show__header">
|
|
3
4
|
<h1 class="item_show__header-title">
|
|
4
|
-
<%= t("
|
|
5
|
+
<%= t(".title") %>
|
|
5
6
|
</h1>
|
|
6
7
|
</div>
|
|
7
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<% add_decidim_page_title(t("
|
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
|
2
2
|
|
|
3
3
|
<div class="item_show__header">
|
|
4
4
|
<h1 class="item_show__header-title">
|
|
5
|
-
<%= t
|
|
5
|
+
<%= t(".title") %>
|
|
6
6
|
</h1>
|
|
7
7
|
</div>
|
|
8
8
|
<div class="card" id="assemblies">
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<% add_decidim_page_title(t("
|
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
|
2
2
|
|
|
3
3
|
<div class="item_show__header">
|
|
4
4
|
<h1 class="item_show__header-title">
|
|
5
|
-
<%= t
|
|
5
|
+
<%= t(".title") %>
|
|
6
6
|
</h1>
|
|
7
7
|
</div>
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<% add_decidim_page_title(t("
|
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
|
2
2
|
<div class="item_show__header">
|
|
3
3
|
<h1 class="item_show__header-title">
|
|
4
|
-
<%= t("
|
|
4
|
+
<%= t(".title") %>
|
|
5
5
|
</h1>
|
|
6
6
|
</div>
|
|
7
7
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<% add_decidim_page_title(t("
|
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
|
2
2
|
|
|
3
3
|
<div class="item_show__header">
|
|
4
4
|
<h1 class="item_show__header-title">
|
|
5
|
-
<%= t("
|
|
5
|
+
<%= t(".title") %>
|
|
6
6
|
</h1>
|
|
7
7
|
</div>
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<% add_decidim_page_title(t("
|
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
|
2
2
|
<div class="item_show__header">
|
|
3
3
|
<h1 class="item_show__header-title">
|
|
4
|
-
<%= t("
|
|
4
|
+
<%= t(".title") %>
|
|
5
5
|
</h1>
|
|
6
6
|
</div>
|
|
7
7
|
<div class="item__edit item__edit-1col">
|