decidim-debates 0.27.9 → 0.28.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/decidim/debates/debate_activity_cell.rb +1 -12
- data/app/cells/decidim/debates/debate_card_metadata_cell.rb +43 -0
- data/app/cells/decidim/debates/debate_cell.rb +6 -1
- data/app/cells/decidim/debates/debate_l_cell.rb +49 -0
- data/app/cells/decidim/debates/debate_s_cell.rb +21 -0
- data/app/commands/decidim/debates/admin/close_debate.rb +1 -1
- data/app/commands/decidim/debates/close_debate.rb +1 -1
- data/app/commands/decidim/debates/create_debate.rb +13 -4
- data/app/commands/decidim/debates/update_debate.rb +15 -2
- data/app/controllers/decidim/debates/admin/debate_closes_controller.rb +2 -2
- data/app/controllers/decidim/debates/admin/debates_controller.rb +5 -5
- data/app/controllers/decidim/debates/debates_controller.rb +7 -9
- data/app/events/decidim/debates/close_debate_event.rb +1 -1
- data/app/events/decidim/debates/create_debate_event.rb +15 -1
- data/app/forms/decidim/debates/admin/close_debate_form.rb +1 -1
- data/app/forms/decidim/debates/close_debate_form.rb +2 -2
- data/app/forms/decidim/debates/debate_form.rb +2 -2
- data/app/helpers/decidim/debates/application_helper.rb +42 -17
- data/app/jobs/decidim/debates/hide_all_created_by_author_job.rb +13 -0
- data/app/jobs/decidim/debates/settings_change_job.rb +2 -2
- data/app/models/decidim/debates/debate.rb +4 -10
- data/app/packs/entrypoints/decidim_debates.js +2 -0
- data/app/packs/images/decidim/gamification/badges/decidim_gamification_badges_commented_debates.svg +42 -1
- data/app/permissions/decidim/debates/permissions.rb +0 -6
- data/app/presenters/decidim/debates/admin_log/debate_presenter.rb +6 -2
- data/app/presenters/decidim/debates/admin_log/value_types/debate_title_description_presenter.rb +1 -1
- data/app/presenters/decidim/debates/log/resource_presenter.rb +18 -0
- data/app/views/decidim/debates/admin/debate_closes/edit.html.erb +26 -14
- data/app/views/decidim/debates/admin/debates/_form.html.erb +40 -39
- data/app/views/decidim/debates/admin/debates/edit.html.erb +16 -6
- data/app/views/decidim/debates/admin/debates/index.html.erb +60 -58
- data/app/views/decidim/debates/admin/debates/new.html.erb +16 -6
- data/app/views/decidim/debates/debates/_close_debate_modal.html.erb +22 -11
- data/app/views/decidim/debates/debates/_debates.html.erb +5 -6
- data/app/views/decidim/debates/debates/_form.html.erb +10 -19
- data/app/views/decidim/debates/debates/edit.html.erb +16 -20
- data/app/views/decidim/debates/debates/index.html.erb +19 -23
- data/app/views/decidim/debates/debates/index.js.erb +3 -4
- data/app/views/decidim/debates/debates/new.html.erb +16 -20
- data/app/views/decidim/debates/debates/show.html.erb +106 -109
- data/app/views/decidim/debates/versions/show.html.erb +15 -6
- data/config/locales/ar.yml +7 -17
- data/config/locales/bg.yml +0 -231
- data/config/locales/ca.yml +14 -35
- data/config/locales/cs.yml +13 -34
- data/config/locales/de.yml +14 -35
- data/config/locales/el.yml +10 -28
- data/config/locales/en.yml +13 -34
- data/config/locales/es-MX.yml +12 -33
- data/config/locales/es-PY.yml +13 -34
- data/config/locales/es.yml +15 -36
- data/config/locales/eu.yml +16 -37
- data/config/locales/fi-plain.yml +12 -33
- data/config/locales/fi.yml +14 -35
- data/config/locales/fr-CA.yml +14 -35
- data/config/locales/fr.yml +14 -35
- data/config/locales/ga-IE.yml +0 -15
- data/config/locales/gl.yml +7 -16
- data/config/locales/hu.yml +13 -32
- data/config/locales/id-ID.yml +7 -15
- data/config/locales/is-IS.yml +3 -9
- data/config/locales/it.yml +7 -31
- data/config/locales/ja.yml +13 -37
- data/config/locales/lb.yml +7 -25
- data/config/locales/lt.yml +14 -29
- data/config/locales/lv.yml +6 -17
- data/config/locales/nl.yml +7 -28
- data/config/locales/no.yml +7 -31
- data/config/locales/pl.yml +12 -38
- data/config/locales/pt-BR.yml +7 -39
- data/config/locales/pt.yml +7 -31
- data/config/locales/ro-RO.yml +10 -29
- data/config/locales/ru.yml +3 -12
- data/config/locales/sk.yml +6 -17
- data/config/locales/sl.yml +0 -3
- data/config/locales/sr-CS.yml +0 -6
- data/config/locales/sv.yml +34 -54
- data/config/locales/tr-TR.yml +6 -38
- data/config/locales/uk.yml +3 -12
- data/config/locales/zh-CN.yml +7 -29
- data/config/locales/zh-TW.yml +9 -28
- data/lib/decidim/debates/component.rb +4 -88
- data/lib/decidim/debates/engine.rb +29 -7
- data/lib/decidim/debates/seeds.rb +104 -0
- data/lib/decidim/debates/test/factories.rb +19 -14
- data/lib/decidim/debates/version.rb +1 -1
- metadata +29 -30
- data/app/cells/decidim/debates/debate_m/data.erb +0 -10
- data/app/cells/decidim/debates/debate_m/footer.erb +0 -10
- data/app/cells/decidim/debates/debate_m/multiple_dates.erb +0 -17
- data/app/cells/decidim/debates/debate_m/open_date.erb +0 -7
- data/app/cells/decidim/debates/debate_m/single_date.erb +0 -9
- data/app/cells/decidim/debates/debate_m/tags.erb +0 -1
- data/app/cells/decidim/debates/debate_m_cell.rb +0 -86
- data/app/controllers/decidim/debates/widgets_controller.rb +0 -29
- data/app/views/decidim/debates/debates/_count.html.erb +0 -1
- data/app/views/decidim/debates/debates/_filters.html.erb +0 -34
- data/app/views/decidim/debates/debates/_filters_small_view.html.erb +0 -18
- data/config/locales/he-IL.yml +0 -1
- data/decidim-debates.gemspec +0 -32
data/app/packs/images/decidim/gamification/badges/decidim_gamification_badges_commented_debates.svg
CHANGED
@@ -1 +1,42 @@
|
|
1
|
-
<svg
|
1
|
+
<svg width="540" height="540" viewBox="0 0 540 540" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M393.617 113.02H141.457C130.462 113.02 121.549 121.932 121.549 132.927V142.368L72.8867 172.742H121.549C121.549 183.736 130.462 192.649 141.457 192.649H393.617C404.612 192.649 413.524 183.736 413.524 172.742V132.927C413.525 121.932 404.612 113.02 393.617 113.02Z" stroke="#3E4C5C" stroke-width="8" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
3
|
+
<path d="M209.724 166.6C217.516 166.6 223.832 160.283 223.832 152.491C223.832 144.699 217.516 138.383 209.724 138.383C201.932 138.383 195.615 144.699 195.615 152.491C195.615 160.283 201.932 166.6 209.724 166.6Z" fill="#3E4C5C" fill-opacity="0.5"/>
|
4
|
+
<path d="M262.81 166.6C270.602 166.6 276.918 160.283 276.918 152.491C276.918 144.699 270.602 138.383 262.81 138.383C255.018 138.383 248.701 144.699 248.701 152.491C248.701 160.283 255.018 166.6 262.81 166.6Z" fill="#3E4C5C" fill-opacity="0.5"/>
|
5
|
+
<path d="M315.898 166.6C323.689 166.6 330.006 160.283 330.006 152.491C330.006 144.699 323.689 138.383 315.898 138.383C308.106 138.383 301.789 144.699 301.789 152.491C301.789 160.283 308.106 166.6 315.898 166.6Z" fill="#3E4C5C" fill-opacity="0.5"/>
|
6
|
+
<path d="M393.618 345.273H141.458C128.529 345.273 118.011 355.791 118.011 368.72V376.198L71.0132 405.533C69.6732 406.369 69.0502 407.991 69.4847 409.51C69.9197 411.027 71.3077 412.074 72.8872 412.074H118.277C119.988 423.33 129.731 431.981 141.457 431.981H393.618C406.546 431.981 417.064 421.463 417.064 408.534V368.72C417.064 355.791 406.547 345.273 393.618 345.273Z" fill="#3E4C5C" fill-opacity="0.25"/>
|
7
|
+
<path d="M209.726 402.393C217.518 402.393 223.834 396.076 223.834 388.284C223.834 380.492 217.518 374.176 209.726 374.176C201.934 374.176 195.617 380.492 195.617 388.284C195.617 396.076 201.934 402.393 209.726 402.393Z" fill="#3E4C5C" fill-opacity="0.5"/>
|
8
|
+
<path d="M262.812 402.393C270.604 402.393 276.92 396.076 276.92 388.284C276.92 380.492 270.604 374.176 262.812 374.176C255.02 374.176 248.703 380.492 248.703 388.284C248.703 396.076 255.02 402.393 262.812 402.393Z" fill="#3E4C5C" fill-opacity="0.5"/>
|
9
|
+
<path d="M315.898 402.393C323.689 402.393 330.006 396.076 330.006 388.284C330.006 380.492 323.689 374.176 315.898 374.176C308.106 374.176 301.789 380.492 301.789 388.284C301.789 396.076 308.106 402.393 315.898 402.393Z" fill="#3E4C5C" fill-opacity="0.5"/>
|
10
|
+
<path d="M468.548 287.695L417.949 254.609V247.082C417.949 234.203 411.065 227.598 398.042 227.598H145.88C132.47 227.598 118.895 234.158 118.895 247.082V286.897C118.895 299.865 133.018 314.305 145.88 314.305H398.041C409.551 314.305 419.442 305.458 421.208 294.398H466.611C468.176 294.398 469.556 293.268 470.003 291.768C470.45 290.267 469.858 288.551 468.548 287.695Z" fill="#3E4C5C"/>
|
11
|
+
<path d="M320.925 284.858C328.717 284.858 335.033 278.541 335.033 270.749C335.033 262.957 328.717 256.641 320.925 256.641C313.133 256.641 306.816 262.957 306.816 270.749C306.816 278.541 313.133 284.858 320.925 284.858Z" fill="white" fill-opacity="0.5"/>
|
12
|
+
<path d="M267.839 284.858C275.631 284.858 281.947 278.541 281.947 270.749C281.947 262.957 275.631 256.641 267.839 256.641C260.047 256.641 253.73 262.957 253.73 270.749C253.73 278.541 260.047 284.858 267.839 284.858Z" fill="white" fill-opacity="0.5"/>
|
13
|
+
<path d="M214.753 284.858C222.545 284.858 228.862 278.541 228.862 270.749C228.862 262.957 222.545 256.641 214.753 256.641C206.961 256.641 200.645 262.957 200.645 270.749C200.645 278.541 206.961 284.858 214.753 284.858Z" fill="white" fill-opacity="0.5"/>
|
14
|
+
<path d="M365.601 74.6773C365.601 67.3333 356.267 56.9998 347.924 56.9998C355.601 56.9998 365.601 46.8333 365.601 39.3223C365.601 46.8333 373.934 56.9998 383.278 56.9998C373.767 56.9998 365.601 67.3333 365.601 74.6773Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
15
|
+
<path d="M468.793 168.455C472.521 168.455 475.543 165.433 475.543 161.705C475.543 157.977 472.521 154.955 468.793 154.955C465.065 154.955 462.043 157.977 462.043 161.705C462.043 165.433 465.065 168.455 468.793 168.455Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
16
|
+
<path d="M460.544 153.337L449.938 142.73" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
17
|
+
<path d="M477.514 170.307L488.12 180.913" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
18
|
+
<path d="M477.16 153.69L487.767 143.084" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
19
|
+
<path d="M460.544 170.307L449.938 180.913" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
20
|
+
<path d="M84.9072 313.047L71.8262 326.129" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
21
|
+
<path d="M67.2299 330.725L54.1484 343.807" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
22
|
+
<path d="M84.5542 343.807L71.4727 330.725" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
23
|
+
<path d="M66.8764 326.129L53.7949 313.047" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
24
|
+
<path d="M279.709 482.737C279.709 482.737 268.926 484.754 266.451 487.228C263.977 489.702 261.96 500.486 261.96 500.486C261.96 500.486 259.943 489.703 257.469 487.228C254.995 484.754 244.211 482.737 244.211 482.737C244.211 482.737 255.249 480.464 257.469 478.246C259.688 476.027 261.96 464.988 261.96 464.988C261.96 464.988 263.977 475.77 266.451 478.246C268.925 480.72 279.709 482.737 279.709 482.737Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
25
|
+
<path d="M474.853 333.137C479.438 333.137 483.155 329.42 483.155 324.835C483.155 320.25 479.438 316.533 474.853 316.533C470.268 316.533 466.551 320.25 466.551 324.835C466.551 329.42 470.268 333.137 474.853 333.137Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
26
|
+
<path d="M456.902 328.05C458.678 328.05 460.119 326.61 460.119 324.834C460.119 323.057 458.678 321.617 456.902 321.617C455.126 321.617 453.686 323.057 453.686 324.834C453.686 326.61 455.126 328.05 456.902 328.05Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
27
|
+
<path d="M474.853 346C476.629 346 478.069 344.561 478.069 342.784C478.069 341.008 476.629 339.568 474.853 339.568C473.077 339.568 471.637 341.008 471.637 342.784C471.637 344.561 473.077 346 474.853 346Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
28
|
+
<path d="M492.802 328.05C494.579 328.05 496.019 326.61 496.019 324.834C496.019 323.057 494.579 321.617 492.802 321.617C491.026 321.617 489.586 323.057 489.586 324.834C489.586 326.61 491.026 328.05 492.802 328.05Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
29
|
+
<path d="M474.853 310.1C476.629 310.1 478.069 308.66 478.069 306.884C478.069 305.108 476.629 303.668 474.853 303.668C473.077 303.668 471.637 305.108 471.637 306.884C471.637 308.66 473.077 310.1 474.853 310.1Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
30
|
+
<path d="M157.475 39.4863L184.927 66.9388" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
31
|
+
<path d="M184.927 39.4863L157.475 66.9388" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
32
|
+
<path d="M162.102 53H148.602" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
33
|
+
<path d="M181.102 53H194.602" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
34
|
+
<path d="M171.602 62.5V76" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
35
|
+
<path d="M171.602 43.5V30" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
36
|
+
<path d="M53.1016 178V217.5" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
37
|
+
<path d="M72.6016 198H33.1016" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
38
|
+
<path d="M43.1015 211.269C45.0453 211.269 46.621 209.694 46.621 207.75C46.621 205.806 45.0453 204.23 43.1015 204.23C41.1578 204.23 39.582 205.806 39.582 207.75C39.582 209.694 41.1578 211.269 43.1015 211.269Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
39
|
+
<path d="M43.1015 191.269C45.0453 191.269 46.621 189.694 46.621 187.75C46.621 185.806 45.0453 184.23 43.1015 184.23C41.1578 184.23 39.582 185.806 39.582 187.75C39.582 189.694 41.1578 191.269 43.1015 191.269Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
40
|
+
<path d="M63.1015 211.269C65.0453 211.269 66.621 209.694 66.621 207.75C66.621 205.806 65.0453 204.23 63.1015 204.23C61.1578 204.23 59.582 205.806 59.582 207.75C59.582 209.694 61.1578 211.269 63.1015 211.269Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
41
|
+
<path d="M63.1015 191.269C65.0453 191.269 66.621 189.694 66.621 187.75C66.621 185.806 65.0453 184.23 63.1015 184.23C61.1578 184.23 59.582 185.806 59.582 187.75C59.582 189.694 61.1578 191.269 63.1015 191.269Z" fill="#EBC34B" stroke="#3E4C5C" stroke-width="2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
|
42
|
+
</svg>
|
@@ -21,8 +21,6 @@ module Decidim
|
|
21
21
|
can_endorse_debate?
|
22
22
|
when :close
|
23
23
|
can_close_debate?
|
24
|
-
when :embed
|
25
|
-
can_embed_debate?
|
26
24
|
end
|
27
25
|
|
28
26
|
permission_action
|
@@ -47,10 +45,6 @@ module Decidim
|
|
47
45
|
disallow!
|
48
46
|
end
|
49
47
|
|
50
|
-
def can_embed_debate?
|
51
|
-
allow!
|
52
|
-
end
|
53
|
-
|
54
48
|
def can_endorse_debate?
|
55
49
|
return disallow! if debate.closed?
|
56
50
|
|
@@ -6,8 +6,8 @@ module Decidim
|
|
6
6
|
# This class holds the logic to present a `Decidim::Debate`
|
7
7
|
# for the `AdminLog` log.
|
8
8
|
#
|
9
|
-
# Usage should be automatic and you
|
10
|
-
# directly, but here
|
9
|
+
# Usage should be automatic and you should not need to call this class
|
10
|
+
# directly, but here is an example:
|
11
11
|
#
|
12
12
|
# action_log = Decidim::ActionLog.last
|
13
13
|
# view_helpers # => this comes from the views
|
@@ -15,6 +15,10 @@ module Decidim
|
|
15
15
|
class DebatePresenter < Decidim::Log::BasePresenter
|
16
16
|
private
|
17
17
|
|
18
|
+
def resource_presenter
|
19
|
+
@resource_presenter ||= Decidim::Debates::Log::ResourcePresenter.new(action_log.resource, h, action_log.extra["resource"])
|
20
|
+
end
|
21
|
+
|
18
22
|
def diff_fields_mapping
|
19
23
|
{
|
20
24
|
description: "Decidim::Debates::AdminLog::ValueTypes::DebateTitleDescriptionPresenter",
|
data/app/presenters/decidim/debates/admin_log/value_types/debate_title_description_presenter.rb
CHANGED
@@ -10,7 +10,7 @@ module Decidim
|
|
10
10
|
def present
|
11
11
|
return unless value
|
12
12
|
|
13
|
-
renderer = Decidim::ContentRenderers::HashtagRenderer.new(h.
|
13
|
+
renderer = Decidim::ContentRenderers::HashtagRenderer.new(h.translated_attribute(value))
|
14
14
|
renderer.render(links: false).html_safe
|
15
15
|
end
|
16
16
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Debates
|
5
|
+
module Log
|
6
|
+
class ResourcePresenter < Decidim::Log::ResourcePresenter
|
7
|
+
private
|
8
|
+
|
9
|
+
# Private: Presents resource name.
|
10
|
+
#
|
11
|
+
# Returns an HTML-safe String.
|
12
|
+
def present_resource_name
|
13
|
+
Decidim::Debates::DebatePresenter.new(resource).title
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -1,17 +1,29 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
<% add_decidim_page_title(t(".title")) %>
|
2
|
+
<div class="item_show__header">
|
3
|
+
<h2 class="item_show__header-title">
|
4
|
+
<%= t(".title") %>
|
5
|
+
</h2>
|
6
|
+
</div>
|
7
|
+
<div class="item__edit item__edit-1col">
|
8
|
+
<div class="item__edit-form">
|
9
|
+
<%= decidim_form_for(@form, url: debate_debate_close_path(debate, @form), html: { class: "form form-defaults edit_close_debate" }) do |f| %>
|
10
|
+
<div class="form__wrapper">
|
11
|
+
<div class="card pt-4 pb-4">
|
6
12
|
|
7
|
-
|
8
|
-
|
9
|
-
|
13
|
+
<div class="card-section">
|
14
|
+
<div class="row column">
|
15
|
+
<%= f.translated :editor, :conclusions, autofocus: true, rows: 15 %>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
<div class="item__edit-sticky">
|
20
|
+
<div class="item__edit-sticky-container">
|
21
|
+
<%= f.submit t(".close"), class: "button button__sm button__secondary" %>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
<div class="form__wrapper-block flex-col-reverse md:flex-row justify-between">
|
25
|
+
</div>
|
10
26
|
</div>
|
11
|
-
|
27
|
+
<% end %>
|
12
28
|
</div>
|
13
|
-
|
14
|
-
<div class="button--double form-general-submit">
|
15
|
-
<%= f.submit t(".close") %>
|
16
|
-
</div>
|
17
|
-
<% end %>
|
29
|
+
</div>
|
@@ -1,53 +1,54 @@
|
|
1
|
-
<div class="
|
2
|
-
<div class="card-
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
<div class="row column hashtags__container">
|
8
|
-
<%= form.translated :text_field, :title, autofocus: true, class: "js-hashtags", hashtaggable: true %>
|
9
|
-
</div>
|
10
|
-
|
11
|
-
<div class="row column hashtags__container">
|
12
|
-
<%= form.translated :editor, :description, hashtaggable: true %>
|
13
|
-
</div>
|
1
|
+
<div class="form__wrapper">
|
2
|
+
<div class="card pt-4">
|
3
|
+
<div class="card-section debate-fields">
|
4
|
+
<div class="row column hashtags__container">
|
5
|
+
<%= form.translated :text_field, :title, autofocus: true, class: "js-hashtags", hashtaggable: true, aria: { label: :title } %>
|
6
|
+
</div>
|
14
7
|
|
15
|
-
|
16
|
-
|
17
|
-
|
8
|
+
<div class="row column hashtags__container">
|
9
|
+
<%= form.translated :editor, :description, hashtaggable: true, aria: { label: :description } %>
|
10
|
+
</div>
|
18
11
|
|
19
|
-
|
20
|
-
|
21
|
-
|
12
|
+
<div class="row column">
|
13
|
+
<%= form.translated :editor, :instructions, aria: { label: :instructions } %>
|
14
|
+
</div>
|
22
15
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
</div>
|
16
|
+
<div class="row column">
|
17
|
+
<%= form.translated :editor, :information_updates, aria: { label: :information_updates } %>
|
18
|
+
</div>
|
27
19
|
|
28
|
-
|
29
|
-
|
30
|
-
|
20
|
+
<div class="row column">
|
21
|
+
<%= label_tag :debate_type, t(".debate_type") %>
|
22
|
+
<div>
|
23
|
+
<%= form.collection_radio_buttons(:finite, [[t(".finite"), true], [t(".open"), false]], :last, :first) do |builder|
|
24
|
+
builder.label(class: "form__wrapper-checkbox-label") { builder.radio_button + builder.text } end %>
|
25
|
+
</div>
|
31
26
|
</div>
|
32
|
-
|
33
|
-
|
27
|
+
|
28
|
+
<div class="row column debate-fields--finite">
|
29
|
+
<div class="column">
|
30
|
+
<%= form.datetime_field :start_time %>
|
31
|
+
</div>
|
32
|
+
<div class="column">
|
33
|
+
<%= form.datetime_field :end_time %>
|
34
|
+
</div>
|
34
35
|
</div>
|
35
|
-
</div>
|
36
36
|
|
37
|
-
|
37
|
+
<% if current_component.has_subscopes? %>
|
38
|
+
<div class="row column">
|
39
|
+
<%= scopes_select_field form, :scope_id, root: current_component.scope %>
|
40
|
+
</div>
|
41
|
+
<% end %>
|
42
|
+
|
38
43
|
<div class="row column">
|
39
|
-
<%=
|
44
|
+
<%= form.categories_select :decidim_category_id, current_participatory_space.categories, include_blank: "", disable_parents: false %>
|
40
45
|
</div>
|
41
|
-
<% end %>
|
42
|
-
|
43
|
-
<div class="row column">
|
44
|
-
<%= form.categories_select :decidim_category_id, current_participatory_space.categories, include_blank: "", disable_parents: false %>
|
45
|
-
</div>
|
46
46
|
|
47
|
-
|
48
|
-
|
47
|
+
<div class="row column">
|
48
|
+
<%= form.check_box :comments_enabled, label: t("enabled", scope: "decidim.comments.admin.shared.availability_fields") %>
|
49
|
+
</div>
|
49
50
|
</div>
|
50
51
|
</div>
|
51
52
|
</div>
|
52
53
|
|
53
|
-
<%=
|
54
|
+
<%= append_javascript_pack_tag "decidim_debates_admin" %>
|
@@ -1,8 +1,18 @@
|
|
1
1
|
<% add_decidim_page_title(t(".title")) %>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
<div class="item_show__header">
|
3
|
+
<h2 class="item_show__header-title">
|
4
|
+
<%= t(".title") %>
|
5
|
+
</h2>
|
6
|
+
</div>
|
7
|
+
<div class="item__edit item__edit-1col">
|
8
|
+
<div class="item__edit-form">
|
9
|
+
<%= decidim_form_for(@form, html: { class: "form-defaults form edit_debate" }) do |f| %>
|
10
|
+
<%= render partial: "form", object: f %>
|
11
|
+
<div class="item__edit-sticky">
|
12
|
+
<div class="item__edit-sticky-container">
|
13
|
+
<%= f.submit t(".update"), class: "button button__sm button__secondary" %>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
7
17
|
</div>
|
8
|
-
|
18
|
+
</div>
|
@@ -1,69 +1,71 @@
|
|
1
1
|
<% add_decidim_page_title(t(".title")) %>
|
2
2
|
<div class="card">
|
3
|
-
<div class="
|
4
|
-
<h2 class="
|
3
|
+
<div class="item_show__header">
|
4
|
+
<h2 class="item_show__header-title">
|
5
5
|
<%= t(".title") %>
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
</div>
|
6
|
+
<%= export_dropdown if allowed_to? :export, :comments %>
|
7
|
+
<%= link_to t("actions.new", scope: "decidim.debates"), new_debate_path, class: "button button__sm button__secondary" if allowed_to? :create, :debate %>
|
8
|
+
<%= render partial: "decidim/admin/components/resource_action" %>
|
10
9
|
</h2>
|
11
10
|
</div>
|
11
|
+
<div class="table-scroll">
|
12
|
+
<table class="table-list">
|
13
|
+
<thead>
|
14
|
+
<tr>
|
15
|
+
<th><%= t("models.debate.fields.title", scope: "decidim.debates") %></th>
|
16
|
+
<th><%= t("models.debate.fields.start_time", scope: "decidim.debates") %></th>
|
17
|
+
<th><%= t("models.debate.fields.end_time", scope: "decidim.debates") %></th>
|
18
|
+
<%= th_resource_scope_label %>
|
19
|
+
<th class="actions"><%= t("actions.title", scope: "decidim.debates") %></th>
|
20
|
+
</tr>
|
21
|
+
</thead>
|
22
|
+
<tbody>
|
23
|
+
<% debates.each do |debate| %>
|
24
|
+
<tr data-id="<%= debate.id %>">
|
25
|
+
<td>
|
26
|
+
<% if allowed_to? :update, :debate, debate: debate %>
|
27
|
+
<%= link_to present(debate).title(html_escape: true), edit_debate_path(debate) %>
|
28
|
+
<% else %>
|
29
|
+
<%= present(debate).title(html_escape: true) %><br>
|
30
|
+
<% end %>
|
31
|
+
</td>
|
32
|
+
<td>
|
33
|
+
<% if debate.start_time %>
|
34
|
+
<%= l debate.start_time, format: :long %>
|
35
|
+
<% end %>
|
36
|
+
</td>
|
37
|
+
<td>
|
38
|
+
<% if debate.end_time %>
|
39
|
+
<%= l debate.end_time, format: :long %>
|
40
|
+
<% end %>
|
41
|
+
</td>
|
42
|
+
<%= td_resource_scope_for(debate.scope) %>
|
43
|
+
<td class="table-list__actions">
|
44
|
+
<% if allowed_to? :update, :debate, debate: debate %>
|
45
|
+
<%= icon_link_to "pencil-line", edit_debate_path(debate), t("actions.edit", scope: "decidim.debates"), class: "action-icon--edit" %>
|
46
|
+
<% else %>
|
47
|
+
<span class="action-space icon"></span>
|
48
|
+
<% end %>
|
12
49
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
<th><%= t("models.debate.fields.title", scope: "decidim.debates") %></th>
|
19
|
-
<th><%= t("models.debate.fields.start_time", scope: "decidim.debates") %></th>
|
20
|
-
<th><%= t("models.debate.fields.end_time", scope: "decidim.debates") %></th>
|
21
|
-
<%= th_resource_scope_label %>
|
22
|
-
<th class="actions"><%= t("actions.title", scope: "decidim.debates") %></th>
|
23
|
-
</tr>
|
24
|
-
</thead>
|
25
|
-
<tbody>
|
26
|
-
<% debates.each do |debate| %>
|
27
|
-
<tr data-id="<%= debate.id %>">
|
28
|
-
<td>
|
29
|
-
<%= link_to present(debate).title(html_escape: true), resource_locator(debate).path, target: :blank %><br>
|
30
|
-
</td>
|
31
|
-
<td>
|
32
|
-
<% if debate.start_time %>
|
33
|
-
<%= l debate.start_time, format: :long %>
|
34
|
-
<% end %>
|
35
|
-
</td>
|
36
|
-
<td>
|
37
|
-
<% if debate.end_time %>
|
38
|
-
<%= l debate.end_time, format: :long %>
|
39
|
-
<% end %>
|
40
|
-
</td>
|
41
|
-
<%= td_resource_scope_for(debate.scope) %>
|
42
|
-
<td class="table-list__actions">
|
43
|
-
<% if allowed_to? :update, :debate, debate: debate %>
|
44
|
-
<%= icon_link_to "pencil", edit_debate_path(debate), t("actions.edit", scope: "decidim.debates"), class: "action-icon--edit" %>
|
45
|
-
<% else %>
|
46
|
-
<span class="action-space icon"></span>
|
47
|
-
<% end %>
|
50
|
+
<% if allowed_to? :close, :debate, debate: debate %>
|
51
|
+
<%= icon_link_to "lock-line" , edit_debate_debate_close_path(debate_id: debate.id, id: debate.id), t("actions.close", scope: "decidim.debates"), class: "action-icon--close" %>
|
52
|
+
<% else %>
|
53
|
+
<span class="action-space icon"></span>
|
54
|
+
<% end %>
|
48
55
|
|
49
|
-
|
50
|
-
<%= icon_link_to "lock-locked", edit_debate_debate_close_path(debate_id: debate.id, id: debate.id), t("actions.close", scope: "decidim.debates"), class: "action-icon--close" %>
|
51
|
-
<% else %>
|
52
|
-
<span class="action-space icon"></span>
|
53
|
-
<% end %>
|
56
|
+
<%= icon_link_to "eye-line", resource_locator(debate).path, t("actions.preview", scope: "decidim.admin"), class: "action-icon--preview", target: :blank, data: { "external-link": false } %>
|
54
57
|
|
55
|
-
|
58
|
+
<%= resource_permissions_link(debate) %>
|
56
59
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
</div>
|
60
|
+
<% if allowed_to? :delete, :debate, debate: debate %>
|
61
|
+
<%= icon_link_to "delete-bin-line", debate_path(debate), t("actions.destroy", scope: "decidim.debates"), method: :delete, class: "action-icon--remove", data: { confirm: t("actions.confirm_destroy", scope: "decidim.debates") } %>
|
62
|
+
<% else %>
|
63
|
+
<span class="action-space icon"></span>
|
64
|
+
<% end %>
|
65
|
+
</td>
|
66
|
+
</tr>
|
67
|
+
<% end %>
|
68
|
+
</tbody>
|
69
|
+
</table>
|
68
70
|
</div>
|
69
71
|
</div>
|
@@ -1,8 +1,18 @@
|
|
1
1
|
<% add_decidim_page_title(t(".title")) %>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
<div class="item_show__header">
|
3
|
+
<h2 class="item_show__header-title">
|
4
|
+
<%= t(".title") %>
|
5
|
+
</h2>
|
6
|
+
</div>
|
7
|
+
<div class="item__edit item__edit-1col">
|
8
|
+
<div class="item__edit-form">
|
9
|
+
<%= decidim_form_for(@form, html: { class: "form-defaults form new_debate" }) do |f| %>
|
10
|
+
<%= render partial: "form", object: f %>
|
11
|
+
<div class="item__edit-sticky">
|
12
|
+
<div class="item__edit-sticky-container">
|
13
|
+
<%= f.submit t(".create"), class: "button button__sm button__secondary" %>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
7
17
|
</div>
|
8
|
-
|
18
|
+
</div>
|
@@ -1,13 +1,24 @@
|
|
1
|
-
|
2
|
-
<div class="reveal__header">
|
3
|
-
<h3 id="closeDebateModal-label" class="reveal__title"><%= t("decidim.debates.debates.show.close_debate") %></h3>
|
4
|
-
<button class="close-button" data-close aria-label="<%= t(".close") %>" type="button">
|
5
|
-
<span aria-hidden="true">×</span>
|
6
|
-
</button>
|
7
|
-
</div>
|
8
|
-
<p><%= t(".description") %></p>
|
1
|
+
<%= decidim_modal id: "close-debate", class:"close-debate-modal" do %>
|
9
2
|
<%= decidim_form_for form, url: close_debate_path(debate), method: :post do |f| %>
|
10
|
-
|
11
|
-
|
3
|
+
<div data-dialog-container>
|
4
|
+
<%= icon "information-line" %>
|
5
|
+
<h3 class="h3" id="dialog-title-close-debate" data-dialog-title>
|
6
|
+
<%= t("close_debate", scope: "decidim.debates.debates.show") %>
|
7
|
+
</h3>
|
8
|
+
<div class="my-8" id="dialog-desc-close-debate">
|
9
|
+
<p><%= t("description", scope: "decidim.debates.debates.close_debate_modal") %></p>
|
10
|
+
<div class="form__wrapper">
|
11
|
+
<%= f.text_area :conclusions, rows: 10 %>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
<div data-dialog-actions>
|
16
|
+
<button type="button" data-dialog-close="close-debate" class="button button__sm md:button__lg button__transparent-secondary">
|
17
|
+
<%= t("cancel", scope: "decidim.debates.debates.close_debate_modal") %>
|
18
|
+
</button>
|
19
|
+
<button type="submit" class="button button__sm md:button__lg button__secondary">
|
20
|
+
<%= t("send", scope: "decidim.debates.debates.close_debate_modal") %>
|
21
|
+
</button>
|
22
|
+
</div>
|
12
23
|
<% end %>
|
13
|
-
|
24
|
+
<% end %>
|
@@ -1,12 +1,11 @@
|
|
1
1
|
<% if debates.empty? %>
|
2
2
|
<%= cell("decidim/announcement", params[:filter].present? ? t(".empty_filters") : t(".empty")) %>
|
3
3
|
<% else %>
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
<div class="row small-up-1 medium-up-2 card-grid">
|
4
|
+
<h2 class="h5 md:h3 decorator"><%= t("debates_count", scope: "decidim.debates.debates.count", count: paginated_debates.total_count) %></h2>
|
5
|
+
|
6
|
+
<%= order_selector available_orders, i18n_scope: "decidim.debates.debates.orders" %>
|
7
|
+
|
8
|
+
<div class="card__list-list">
|
10
9
|
<%= render paginated_debates %>
|
11
10
|
</div>
|
12
11
|
|
@@ -1,25 +1,16 @@
|
|
1
|
-
<div class="
|
1
|
+
<div class="form__wrapper">
|
2
2
|
<%= form.text_field :title %>
|
3
|
-
</div>
|
4
|
-
|
5
|
-
<div class="field">
|
6
3
|
<%= text_editor_for_debate_description(form) %>
|
7
|
-
</div>
|
8
4
|
|
9
|
-
<% if current_component.has_subscopes? %>
|
10
|
-
|
11
|
-
|
12
|
-
</div>
|
13
|
-
<% end %>
|
5
|
+
<% if current_component.has_subscopes? %>
|
6
|
+
<%= scopes_select_field form, :scope_id, root: current_component.scope %>
|
7
|
+
<% end %>
|
14
8
|
|
15
|
-
<% if current_participatory_space.categories&.any? %>
|
16
|
-
<div class="field">
|
9
|
+
<% if current_participatory_space.categories&.any? %>
|
17
10
|
<%= form.categories_select :category_id, current_participatory_space.categories, include_blank: t(".select_a_category"), disable_parents: false %>
|
18
|
-
|
19
|
-
<% end %>
|
11
|
+
<% end %>
|
20
12
|
|
21
|
-
<% if @form.id.blank? && Decidim::UserGroups::ManageableUserGroups.for(current_user).verified.any? %>
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
<% end %>
|
13
|
+
<% if @form.id.blank? && Decidim::UserGroups::ManageableUserGroups.for(current_user).verified.any? %>
|
14
|
+
<%= form.select :user_group_id, Decidim::UserGroups::ManageableUserGroups.for(current_user).verified.map { |g| [g.name, g.id] }, prompt: current_user.name %>
|
15
|
+
<% end %>
|
16
|
+
</div>
|
@@ -1,24 +1,20 @@
|
|
1
|
-
|
2
|
-
<div class="
|
3
|
-
|
4
|
-
<%=
|
5
|
-
|
6
|
-
<% end %>
|
1
|
+
<%= render layout: "layouts/decidim/shared/layout_center" do %>
|
2
|
+
<div class="text-center py-10">
|
3
|
+
<h1 class="title-decorator inline-block text-left">
|
4
|
+
<%= t("title", scope: "decidim.debates.debates.edit") %>
|
5
|
+
</h1>
|
7
6
|
</div>
|
8
|
-
<
|
9
|
-
|
10
|
-
|
11
|
-
<div class="row">
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
<%= decidim_form_for(@form) do |form| %>
|
16
|
-
<%= render partial: "form", locals: { form: form } %>
|
17
|
-
<div class="actions">
|
18
|
-
<%= form.submit t(".save"), class: "button expanded", data: { disable: true } %>
|
19
|
-
</div>
|
7
|
+
<div class="mb-24">
|
8
|
+
<%= decidim_form_for(@form) do |form| %>
|
9
|
+
<%= render partial: "form", locals: { form: } %>
|
10
|
+
<div class="form__wrapper-block flex-col-reverse md:flex-row justify-between">
|
11
|
+
<%= link_to :back, class: "button button__sm md:button__lg button__text-secondary" do %>
|
12
|
+
<%= icon "arrow-left-line", class: "fill-current" %>
|
13
|
+
<%= t("back", scope: "decidim.debates.debates.edit") %>
|
20
14
|
<% end %>
|
15
|
+
<%= form.submit t("save", scope: "decidim.debates.debates.edit"), class: "button button__sm md:button__lg button__secondary", data: { disable: true } %>
|
16
|
+
</div>
|
21
17
|
</div>
|
22
|
-
|
18
|
+
<% end %>
|
23
19
|
</div>
|
24
|
-
|
20
|
+
<% end %>
|