decidim-debates 0.27.2 → 0.27.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3aeaf8f0b68768d7e2ccaf07f37d5834b5371ff2bb5f6ab27f45fa0604871f7b
4
- data.tar.gz: cd0975ff8e758cfb51935e4dfcb3978653e510719132291d28be37250af776b9
3
+ metadata.gz: 54df639a3fa55cecbf727848b5f4bd2326b684a1a189eaf36dd311dc13cee4e2
4
+ data.tar.gz: 8e09873531d97c3b099f152aa7bc6b2cf929d54a29460ec37e7211306d6e89a9
5
5
  SHA512:
6
- metadata.gz: bfbbb41a23107aabf4059661060e4aad028653cb7bc24105ea4de5dc5dc951e280d6770c7e26231539e2f6d5083f0e2769abdb919dcf94b98f2db36293298328
7
- data.tar.gz: 6c3477f366b97a30e54ac3024ed8f9033e865c2255dd39068f09b76733b9a6be3fe7fff19f37e99016c01f0a60f2912b0ba7fd614fa52b95aec483d295c7214c
6
+ metadata.gz: 3ba717ca8ac85d21928a20e7292986331e40fe919c9a95501ff0305528ddaf9d57f5ff9fb8a62a8fa0d1f0c334ea212ac6bf00a21720cbfab3756095ce4a42b3
7
+ data.tar.gz: ca07907e14de0693b72e969d6e5cc14f998eb7bbbb60d2bc2d110ccfeb4ad9730516910a45f94eb5bfeed9512a1e030986299e8b842b5b5b2d95f3823665f4bc
@@ -15,14 +15,23 @@ module Decidim
15
15
  # If the debate is official or the rich text editor is enabled on the
16
16
  # frontend, the debate description is considered as safe content.
17
17
  def safe_content?
18
- debate&.official? || rich_text_editor_in_public_views?
18
+ rich_text_editor_in_public_views? || safe_content_admin?
19
+ end
20
+
21
+ # For admin entered content, the debate body can contain certain extra
22
+ # tags, such as iframes.
23
+ def safe_content_admin?
24
+ debate&.official?
19
25
  end
20
26
 
21
27
  # If the content is safe, HTML tags are sanitized, otherwise, they are stripped.
22
28
  def render_debate_description(debate)
23
- description = present(debate).description(strip_tags: !safe_content?, links: true)
24
-
25
- safe_content? ? decidim_sanitize_editor(description) : simple_format(description)
29
+ sanitized = render_sanitized_content(debate, :description)
30
+ if safe_content?
31
+ Decidim::ContentProcessor.render_without_format(sanitized).html_safe
32
+ else
33
+ Decidim::ContentProcessor.render(sanitized, "div")
34
+ end
26
35
  end
27
36
 
28
37
  # Returns :text_area or :editor based on current_component settings.
@@ -8,6 +8,7 @@ module Decidim
8
8
  class DebatePresenter < Decidim::ResourcePresenter
9
9
  include Decidim::TranslationsHelper
10
10
  include Decidim::ResourceHelper
11
+ include Decidim::SanitizeHelper
11
12
  include ActionView::Helpers::DateHelper
12
13
 
13
14
  def debate
@@ -30,16 +31,10 @@ module Decidim
30
31
  super debate.title, links, html_escape, all_locales
31
32
  end
32
33
 
33
- def description(strip_tags: false, links: false, all_locales: false)
34
+ def description(strip_tags: false, extras: true, links: false, all_locales: false)
34
35
  return unless debate
35
36
 
36
- handle_locales(debate.description, all_locales) do |content|
37
- content = strip_tags(content) if strip_tags
38
- renderer = Decidim::ContentRenderers::HashtagRenderer.new(content)
39
- content = renderer.render(links: links).html_safe
40
- content = Decidim::ContentRenderers::LinkRenderer.new(content).render if links
41
- content
42
- end
37
+ content_handle_locale(debate.description, all_locales, extras, links, strip_tags)
43
38
  end
44
39
 
45
40
  def last_comment_at
@@ -108,12 +108,12 @@ edit_link(
108
108
 
109
109
  <% if translated_attribute(debate.instructions).present? %>
110
110
  <div class="callout secondary">
111
- <%= decidim_sanitize_editor(simple_format(translated_attribute(debate.instructions), {}, sanitize: false)) %>
111
+ <%= decidim_sanitize_editor_admin(simple_format(translated_attribute(debate.instructions), {}, sanitize: false)) %>
112
112
  </div>
113
113
  <% end %>
114
114
  <% if translated_attribute(debate.information_updates).present? %>
115
115
  <div class="callout success">
116
- <%= decidim_sanitize_editor(simple_format(translated_attribute(debate.information_updates), {}, sanitize: false)) %>
116
+ <%= decidim_sanitize_editor_admin(simple_format(translated_attribute(debate.information_updates), {}, sanitize: false)) %>
117
117
  </div>
118
118
  <% end %>
119
119
 
@@ -125,7 +125,7 @@ eu:
125
125
  origin: Origin
126
126
  participants: Parte-hartzaileak
127
127
  scope: Eremua
128
- search: Search
128
+ search: Bilatu
129
129
  state: Egoera
130
130
  state_values:
131
131
  closed: Itxita
@@ -212,7 +212,7 @@ eu:
212
212
  notification_title: Orain <a href="%{resource_path}">eztabaida berriak hasi ditzakezu</a> <a href="%{participatory_space_url}">%{participatory_space_title}</a>
213
213
  debate_closed:
214
214
  affected_user:
215
- email_intro: '"%{resource_title}" eztabaida itrxi egin da. Ondorioak bere orrialdean irakur ditzakezu:'
215
+ email_intro: '"%{resource_title}" eztabaida itxi egin da. Ondorioak bere orrialdean irakur ditzakezu:'
216
216
  email_outro: Jakinarazpen hau jaso duzu "%{resource_title}" eztabaida jarraitzen ari zarelako. Aurreko loturan utzi ahal diozu jarraitzeari .
217
217
  email_subject: '"%{resource_title}" eztabaida itxi egin da'
218
218
  notification_title: <a href="%{resource_path}">%{resource_title}</a> eztabaida itxi egin da.
@@ -0,0 +1 @@
1
+ fa:
@@ -11,6 +11,7 @@ hu:
11
11
  end_time: Lejár ekkor
12
12
  information_updates: Információ frissítések
13
13
  instructions: Útmutató a részvételhez
14
+ scope_id: Hatókör
14
15
  start_time: Kezdődik
15
16
  title: Cím
16
17
  user_group_id: Vita létrehozása
@@ -0,0 +1 @@
1
+ kaa:
@@ -1 +1,240 @@
1
+ ---
1
2
  zh-TW:
3
+ activemodel:
4
+ attributes:
5
+ debate:
6
+ category_id: 類別
7
+ closed_at: 關閉於
8
+ conclusions: 結論
9
+ decidim_category_id: 類別
10
+ description: 說明
11
+ end_time: 結束於
12
+ information_updates: 資訊更新
13
+ instructions: 參加指南
14
+ scope_id: 範圍
15
+ start_time: 開始於
16
+ title: 標題
17
+ user_group_id: 建立辯論為
18
+ models:
19
+ decidim/debates/close_debate_event: 辯論功能已關閉
20
+ decidim/debates/create_debate_event: 辯論
21
+ decidim/debates/creation_disabled_event: 辯論功能已禁用
22
+ decidim/debates/creation_enabled_event: 辯論創建已啟用
23
+ activerecord:
24
+ models:
25
+ decidim/debates/debate:
26
+ other: 辯論
27
+ decidim:
28
+ components:
29
+ debates:
30
+ actions:
31
+ comment: 留言
32
+ create: 建立
33
+ endorse: 連署
34
+ name: 辯論
35
+ settings:
36
+ global:
37
+ announcement: 公告
38
+ comments_enabled: 啟用評論功能
39
+ comments_max_length: 評論字數最大長度(若要使用預設值請輸入0)
40
+ scope_id: 範圍
41
+ scopes_enabled: 啟用範圍
42
+ step:
43
+ announcement: 公告
44
+ comments_blocked: 留言已封鎖
45
+ creation_enabled: 參與者可以建立辯論
46
+ endorsements_blocked: 連署已封鎖
47
+ endorsements_enabled: 連署已封鎖
48
+ debates:
49
+ actions:
50
+ close: 關閉
51
+ confirm_destroy: 您確定嗎?
52
+ destroy: 刪除
53
+ edit: 編輯
54
+ new: 新增 %{name}
55
+ title: 操作
56
+ admin:
57
+ debate_closes:
58
+ edit:
59
+ close: 關閉
60
+ title: 關閉辯論
61
+ debates:
62
+ create:
63
+ invalid: 建立辯論時出現問題。
64
+ success: 辯論建立成功。
65
+ destroy:
66
+ success: 辯論已成功刪除。
67
+ edit:
68
+ title: 編輯辯論
69
+ update: 更新辯論
70
+ form:
71
+ debate_type: 辯論類型
72
+ finite: 有限期 (設定開始和結束時間)
73
+ open: 開放式 (沒有開始或結束時間)
74
+ index:
75
+ title: 辯論
76
+ new:
77
+ create: 建立辯論
78
+ title: 新辯論
79
+ update:
80
+ invalid: 更新此辯論時發生問題。
81
+ success: 辯論已成功更新
82
+ exports:
83
+ comments: 評論
84
+ models:
85
+ debate:
86
+ name: 辯論
87
+ admin_log:
88
+ debate:
89
+ close: "%{user_name} 在 %{space_name} 空間關閉了 %{resource_name} 辯論。"
90
+ create: "%{user_name} 在%{space_name} 空間中創建了%{resource_name} 辯論"
91
+ update: "%{user_name} 更新了 %{space_name} 空間中的 %{resource_name} 辯論"
92
+ debate_m:
93
+ commented_time_ago: 在 %{time} 前評論
94
+ debates:
95
+ close:
96
+ invalid: 關閉辯論時出現問題
97
+ success: 辯論成功關閉
98
+ close_debate_modal:
99
+ close: 關閉
100
+ description: 這場辯論的總結或結論是什麼?
101
+ send: 關閉辯論
102
+ closed: 關閉
103
+ count:
104
+ debates_count:
105
+ other: "%{count} 場辯論"
106
+ create:
107
+ invalid: 建立辯論時出現問題。
108
+ success: 辯論建立成功。
109
+ debate:
110
+ participate: 參與
111
+ edit:
112
+ back: 返回
113
+ save: 保存更改
114
+ title: 編輯辯論
115
+ filters:
116
+ activity: 我的活動
117
+ all: 全部
118
+ category: 類別
119
+ category_prompt: 選擇一個類別
120
+ commented: 已回應
121
+ my_debates: 我的辯論
122
+ official: 官方
123
+ origin: 起源
124
+ participants: 參與者
125
+ scope: 範圍
126
+ search: 搜尋
127
+ state: 狀態
128
+ state_values:
129
+ closed: 關閉
130
+ open: 開啟
131
+ user_groups: 群組
132
+ filters_small_view:
133
+ close_modal: 關閉視窗
134
+ filter: 篩選
135
+ filter_by: 篩選條件
136
+ unfold: 展開
137
+ form:
138
+ select_a_category: 請選擇一個類別
139
+ index:
140
+ new_debate: 新辯論
141
+ new:
142
+ back: 返回
143
+ create: 建立
144
+ title: 新辯論
145
+ orders:
146
+ commented: 最多評論
147
+ label: 依序排列辯論
148
+ random: 隨機順序
149
+ recent: 最近
150
+ updated: 最近更新
151
+ show:
152
+ back: 返回列表
153
+ close_debate: 關閉辯論
154
+ date: 日期
155
+ debate_closed: 關閉
156
+ debate_conclusions_are: '此辯論已於 %{date} 結束,以下是總結結論:'
157
+ edit_conclusions: 修改結論
158
+ edit_debate: 編輯辯論
159
+ groups_count: 群組
160
+ last_comment_by: 最後評論
161
+ no_comments_yet: 尚無留言
162
+ open: 開放性辯論
163
+ participants_count: 參與者
164
+ update:
165
+ invalid: 更新此辯論時發生問題。
166
+ success: 辯論已成功更新
167
+ versions:
168
+ debates:
169
+ back_to_resource: 返回辯論
170
+ index:
171
+ title: 版本
172
+ versions_list:
173
+ back_to_resource: 返回辯論
174
+ last_activity:
175
+ debate_updated_at_html: "<span>辯論已更新,連結網址為 %{link}</span>"
176
+ new_debate_at_html: "<span>新的辯論,連結網址為 %{link}</span>"
177
+ models:
178
+ debate:
179
+ fields:
180
+ end_time: 結束日期
181
+ official_debate: 正式辯論
182
+ start_time: 開始日期
183
+ title: 標題
184
+ events:
185
+ debates:
186
+ create_debate_event:
187
+ space_followers:
188
+ email_intro: |-
189
+ 你好,
190
+ 一個新的辯論「%{resource_title}」已經在 %{space_title} 參與空間中建立,請查看並參與:
191
+ email_outro: 您收到此通知,是因為您正在追蹤 %{space_title} 參與空間。您可以按照上述連結停止接收通知。
192
+ email_subject: '%{space_title} 參與空間上有新辯論主題%{resource_title}'
193
+ notification_title: 在<a href="%{space_path}">%{space_title}</a>上建立了辯論主題<a href="%{resource_path}">%{resource_title}</a>。
194
+ user_followers:
195
+ email_intro: |-
196
+ 嗨,
197
+ 你正在追蹤的 %{author_name} %{author_nickname} 創建了一個新辯論主題 "%{resource_title}"。點擊下方連結查看並參與辯論:
198
+ email_outro: 您收到此通知,是因為您正在關注 %{author_nickname}。您可以使用上面的連結停止接收通知。
199
+ email_subject: 新辯論主題「%{resource_title}」,由 %{author_nickname} 建立
200
+ notification_title: <a href="%{author_path}">%{author_name} %{author_nickname}</a> 建立了 <a href="%{resource_path}">%{resource_title}</a> 辯論。
201
+ creation_disabled:
202
+ email_intro: '在 %{participatory_space_title} 中不再開放建立辯論。您仍可在此頁面參與開放辯論:'
203
+ email_outro: 你收到此通知是因為你正在追蹤 %{participatory_space_title}。你可以透過前面的連結停止接收通知。
204
+ email_subject: 在 %{participatory_space_title} 中已停用辯論建立
205
+ notification_title: 辯論建立現在在<a href="%{participatory_space_url}">%{participatory_space_title}</a>已被停用
206
+ creation_enabled:
207
+ email_intro: '現在您可以在 %{participatory_space_title} 開始新的辯論!在此頁面開始參與:'
208
+ email_outro: 你收到此通知是因為你正在追蹤 %{participatory_space_title}。你可以透過前面的連結停止接收通知。
209
+ email_subject: 在 %{participatory_space_title} 現在可以開始新的辯論!
210
+ notification_title: 您現在可以在<a href="%{participatory_space_url}">%{participatory_space_title}</a>中<a href="%{resource_path}">開始新的辯論</a>。
211
+ debate_closed:
212
+ affected_user:
213
+ email_intro: '在 "%{resource_title}" 辯論中已經關閉。您可以在其頁面上閱讀結論:'
214
+ email_outro: 您收到此通知是因為您正在追蹤「%{resource_title}」辯論。您可以透過上方的連結取消追蹤。
215
+ email_subject: '%{resource_title} 辯論已結束'
216
+ notification_title: 這個<a href="%{resource_path}">%{resource_title}</a>辯論已經結束。
217
+ follower:
218
+ email_intro: '在 "%{resource_title}" 辯論中已經關閉。您可以在其頁面上閱讀結論:'
219
+ email_outro: 您收到此通知是因為您正在追蹤「%{resource_title}」辯論。您可以透過上方的連結取消追蹤。
220
+ email_subject: '%{resource_title} 辯論已結束'
221
+ notification_title: 這個<a href="%{resource_path}">%{resource_title}</a>辯論已經結束。
222
+ gamification:
223
+ badges:
224
+ commented_debates:
225
+ conditions:
226
+ - 選擇一個開放辯論加入
227
+ description: 當你在不同辯論中發表評論時,會被授予此徽章。
228
+ description_another: 此參與者已參與了 %{score} 個辯論。
229
+ description_own: 您已經參與了 %{score} 場辯論
230
+ name: 辯論
231
+ next_level_in: 再參與 %{score} 個辯論,即可達成下一等級!
232
+ unearned_another: 這位參與者尚未參與任何辯論。
233
+ unearned_own: 您尚未參與任何辯論。
234
+ metrics:
235
+ debates:
236
+ description: 建立的辯論次數
237
+ object: 辯論
238
+ title: 辯論
239
+ statistics:
240
+ debates_count: 辯論
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds the decidim-debates version.
5
5
  module Debates
6
6
  def self.version
7
- "0.27.2"
7
+ "0.27.3"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-debates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.2
4
+ version: 0.27.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2023-02-13 00:00:00.000000000 Z
14
+ date: 2023-05-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: decidim-comments
@@ -19,56 +19,56 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 0.27.2
22
+ version: 0.27.3
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.27.2
29
+ version: 0.27.3
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: decidim-core
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
34
  - - '='
35
35
  - !ruby/object:Gem::Version
36
- version: 0.27.2
36
+ version: 0.27.3
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - '='
42
42
  - !ruby/object:Gem::Version
43
- version: 0.27.2
43
+ version: 0.27.3
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: decidim-admin
46
46
  requirement: !ruby/object:Gem::Requirement
47
47
  requirements:
48
48
  - - '='
49
49
  - !ruby/object:Gem::Version
50
- version: 0.27.2
50
+ version: 0.27.3
51
51
  type: :development
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - '='
56
56
  - !ruby/object:Gem::Version
57
- version: 0.27.2
57
+ version: 0.27.3
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: decidim-dev
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
62
  - - '='
63
63
  - !ruby/object:Gem::Version
64
- version: 0.27.2
64
+ version: 0.27.3
65
65
  type: :development
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
69
  - - '='
70
70
  - !ruby/object:Gem::Version
71
- version: 0.27.2
71
+ version: 0.27.3
72
72
  description: A debates component for decidim's participatory spaces.
73
73
  email:
74
74
  - josepjaume@gmail.com
@@ -179,6 +179,7 @@ files:
179
179
  - config/locales/et-EE.yml
180
180
  - config/locales/et.yml
181
181
  - config/locales/eu.yml
182
+ - config/locales/fa-IR.yml
182
183
  - config/locales/fi-pl.yml
183
184
  - config/locales/fi-plain.yml
184
185
  - config/locales/fi.yml
@@ -197,6 +198,7 @@ files:
197
198
  - config/locales/it.yml
198
199
  - config/locales/ja.yml
199
200
  - config/locales/ka-GE.yml
201
+ - config/locales/kaa.yml
200
202
  - config/locales/ko-KR.yml
201
203
  - config/locales/ko.yml
202
204
  - config/locales/lb-LU.yml
@@ -281,7 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
281
283
  - !ruby/object:Gem::Version
282
284
  version: '0'
283
285
  requirements: []
284
- rubygems_version: 3.3.7
286
+ rubygems_version: 3.2.22
285
287
  signing_key:
286
288
  specification_version: 4
287
289
  summary: Decidim debates module