decidim-debates 0.26.5 → 0.26.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2aa7de7f8546c10aef013ce58eb27c0086c6f5b62e10aaf2df0d69d832be3651
4
- data.tar.gz: ff0fb59944708e3efeb4739c5d94ad52218b450b0ee416ecf9b9cbfa4227218f
3
+ metadata.gz: c0bca3a5f4858f1ce57bc1563e38c590ca9192051b4d1f1e7ccd521cd7a3e01b
4
+ data.tar.gz: dd0737e391a18e28f72ff37776ece47021ca228082f3ed92d8c8aea73f3eb9bf
5
5
  SHA512:
6
- metadata.gz: 1a6ecea24b601ba6ebdcf0e51c7b7053a09d7ea97b422ba77e4f7b359f6af11fe7d210a380a2b93f3d19ab39cd2f3f9c1d76189b797099fc0dfbda7de9c0930d
7
- data.tar.gz: 3afa4cb668d7ce1dd9c844c077b7d52ba3794cc61a003f7c921b82abc74222afdc24d1386f8342e3f271efd76980de69d4ecc1ad58a36ae3dd727344c9e6e20c
6
+ metadata.gz: a8e0add1b8530a4dcc2cd4480649657cea8c62641ee658a26258bda720d1710e71514718263fc21a62d5045603d1ae627e459353f4d47b16761f669d6b360c98
7
+ data.tar.gz: 3b58ee2a378b1d7cd159a510bb0ef5ce39f6a3b7a614fb499f5654dd73b6505acdb44d8ab2a8936fabc9911cde720172dc926ff951d1236dbd67644384eed786
@@ -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
 
@@ -124,7 +124,7 @@ eu:
124
124
  official: Ofiziala
125
125
  origin: Origin
126
126
  scope: Eremua
127
- search: Search
127
+ search: Bilatu
128
128
  state: Egoera
129
129
  state_values:
130
130
  closed: Itxita
@@ -211,7 +211,7 @@ eu:
211
211
  notification_title: Orain <a href="%{resource_path}">eztabaida berriak hasi ditzakezu</a> <a href="%{participatory_space_url}">%{participatory_space_title}</a>
212
212
  debate_closed:
213
213
  affected_user:
214
- email_intro: '"%{resource_title}" eztabaida itrxi egin da. Ondorioak bere orrialdean irakur ditzakezu:'
214
+ email_intro: '"%{resource_title}" eztabaida itxi egin da. Ondorioak bere orrialdean irakur ditzakezu:'
215
215
  email_outro: Jakinarazpen hau jaso duzu "%{resource_title}" eztabaida jarraitzen ari zarelako. Aurreko loturan utzi ahal diozu jarraitzeari .
216
216
  email_subject: '"%{resource_title}" eztabaida itxi egin da'
217
217
  notification_title: <a href="%{resource_path}">%{resource_title}</a> eztabaida itxi egin da.
@@ -0,0 +1 @@
1
+ fa:
@@ -10,6 +10,7 @@ hu:
10
10
  end_time: Lejár ekkor
11
11
  information_updates: Információ frissítések
12
12
  instructions: Útmutató a részvételhez
13
+ scope_id: Hatókör
13
14
  start_time: Kezdődik
14
15
  title: Cím
15
16
  user_group_id: Vita létrehozása
@@ -0,0 +1 @@
1
+ kaa:
@@ -1 +1,239 @@
1
1
  zh-TW:
2
+ activemodel:
3
+ attributes:
4
+ debate:
5
+ category_id: 類別
6
+ closed_at: 關閉於
7
+ conclusions: 結論
8
+ decidim_category_id: 類別
9
+ description: 說明
10
+ end_time: 結束於
11
+ information_updates: 資訊更新
12
+ instructions: 參加指南
13
+ scope_id: 範圍
14
+ start_time: 開始於
15
+ title: 標題
16
+ user_group_id: 建立辯論為
17
+ models:
18
+ decidim/debates/close_debate_event: 辯論功能已關閉
19
+ decidim/debates/create_debate_event: 辯論
20
+ decidim/debates/creation_disabled_event: 辯論功能已禁用
21
+ decidim/debates/creation_enabled_event: 辯論創建已啟用
22
+ activerecord:
23
+ models:
24
+ decidim/debates/debate:
25
+ other: 辯論
26
+ decidim:
27
+ components:
28
+ debates:
29
+ actions:
30
+ comment: 留言
31
+ create: 建立
32
+ endorse: 連署
33
+ name: 辯論
34
+ settings:
35
+ global:
36
+ announcement: 公告
37
+ comments_enabled: 啟用評論功能
38
+ comments_max_length: 評論字數最大長度(若要使用預設值請輸入0)
39
+ scope_id: 範圍
40
+ scopes_enabled: 啟用範圍
41
+ step:
42
+ announcement: 公告
43
+ comments_blocked: 留言已封鎖
44
+ creation_enabled: 參與者可以建立辯論
45
+ endorsements_blocked: 連署已封鎖
46
+ endorsements_enabled: 連署已封鎖
47
+ debates:
48
+ actions:
49
+ close: 關閉
50
+ confirm_destroy: 您確定嗎?
51
+ destroy: 刪除
52
+ edit: 編輯
53
+ new: 新增 %{name}
54
+ title: 操作
55
+ admin:
56
+ debate_closes:
57
+ edit:
58
+ close: 關閉
59
+ title: 關閉辯論
60
+ debates:
61
+ create:
62
+ invalid: 建立辯論時出現問題。
63
+ success: 辯論建立成功。
64
+ destroy:
65
+ success: 辯論已成功刪除。
66
+ edit:
67
+ title: 編輯辯論
68
+ update: 更新辯論
69
+ form:
70
+ debate_type: 辯論類型
71
+ finite: 有限期 (設定開始和結束時間)
72
+ open: 開放式 (沒有開始或結束時間)
73
+ index:
74
+ title: 辯論
75
+ new:
76
+ create: 建立辯論
77
+ title: 新辯論
78
+ update:
79
+ invalid: 更新此辯論時發生問題。
80
+ success: 辯論已成功更新
81
+ exports:
82
+ comments: 評論
83
+ models:
84
+ debate:
85
+ name: 辯論
86
+ admin_log:
87
+ debate:
88
+ close: "%{user_name} 在 %{space_name} 空間關閉了 %{resource_name} 辯論。"
89
+ create: "%{user_name} 在%{space_name} 空間中創建了%{resource_name} 辯論"
90
+ update: "%{user_name} 更新了 %{space_name} 空間中的 %{resource_name} 辯論"
91
+ debate_m:
92
+ commented_time_ago: 在 %{time} 前評論
93
+ debates:
94
+ close:
95
+ invalid: 關閉辯論時出現問題
96
+ success: 辯論成功關閉
97
+ close_debate_modal:
98
+ close: 關閉
99
+ description: 這場辯論的總結或結論是什麼?
100
+ send: 關閉辯論
101
+ closed: 關閉
102
+ count:
103
+ debates_count:
104
+ other: "%{count} 場辯論"
105
+ create:
106
+ invalid: 建立辯論時出現問題。
107
+ success: 辯論建立成功。
108
+ debate:
109
+ participate: 參與
110
+ edit:
111
+ back: 返回
112
+ save: 保存更改
113
+ title: 編輯辯論
114
+ filters:
115
+ activity: 我的活動
116
+ all: 全部
117
+ category: 類別
118
+ category_prompt: 選擇一個類別
119
+ citizens: 公民
120
+ commented: 已回應
121
+ my_debates: 我的辯論
122
+ official: 官方
123
+ origin: 起源
124
+ scope: 範圍
125
+ search: 搜尋
126
+ state: 狀態
127
+ state_values:
128
+ closed: 關閉
129
+ open: 開啟
130
+ user_groups: 群組
131
+ filters_small_view:
132
+ close_modal: 關閉視窗
133
+ filter: 篩選
134
+ filter_by: 篩選條件
135
+ unfold: 展開
136
+ form:
137
+ select_a_category: 請選擇一個類別
138
+ index:
139
+ new_debate: 新辯論
140
+ new:
141
+ back: 返回
142
+ create: 建立
143
+ title: 新辯論
144
+ orders:
145
+ commented: 最多評論
146
+ label: 依序排列辯論
147
+ random: 隨機順序
148
+ recent: 最近
149
+ updated: 最近更新
150
+ show:
151
+ back: 返回列表
152
+ close_debate: 關閉辯論
153
+ date: 日期
154
+ debate_closed: 關閉
155
+ debate_conclusions_are: '此辯論已於 %{date} 結束,以下是總結結論:'
156
+ edit_conclusions: 修改結論
157
+ edit_debate: 編輯辯論
158
+ groups_count: 群組
159
+ last_comment_by: 最後評論
160
+ no_comments_yet: 尚無留言
161
+ open: 開放性辯論
162
+ participants_count: 參與者
163
+ update:
164
+ invalid: 更新此辯論時發生問題。
165
+ success: 辯論已成功更新
166
+ versions:
167
+ debates:
168
+ back_to_resource: 返回辯論
169
+ index:
170
+ title: 版本
171
+ versions_list:
172
+ back_to_resource: 返回辯論
173
+ last_activity:
174
+ debate_updated_at_html: "<span>辯論已更新,連結網址為 %{link}</span>"
175
+ new_debate_at_html: "<span>新的辯論,連結網址為 %{link}</span>"
176
+ models:
177
+ debate:
178
+ fields:
179
+ end_time: 結束日期
180
+ official_debate: 正式辯論
181
+ start_time: 開始日期
182
+ title: 標題
183
+ events:
184
+ debates:
185
+ create_debate_event:
186
+ space_followers:
187
+ email_intro: |-
188
+ 你好,
189
+ 一個新的辯論「%{resource_title}」已經在 %{space_title} 參與空間中建立,請查看並參與:
190
+ email_outro: 您收到此通知,是因為您正在追蹤 %{space_title} 參與空間。您可以按照上述連結停止接收通知。
191
+ email_subject: '%{space_title} 參與空間上有新辯論主題%{resource_title}'
192
+ notification_title: 在<a href="%{space_path}">%{space_title}</a>上建立了辯論主題<a href="%{resource_path}">%{resource_title}</a>。
193
+ user_followers:
194
+ email_intro: |-
195
+ 嗨,
196
+ 你正在追蹤的 %{author_name} %{author_nickname} 創建了一個新辯論主題 "%{resource_title}"。點擊下方連結查看並參與辯論:
197
+ email_outro: 您收到此通知,是因為您正在關注 %{author_nickname}。您可以使用上面的連結停止接收通知。
198
+ email_subject: 新辯論主題「%{resource_title}」,由 %{author_nickname} 建立
199
+ notification_title: <a href="%{author_path}">%{author_name} %{author_nickname}</a> 建立了 <a href="%{resource_path}">%{resource_title}</a> 辯論。
200
+ creation_disabled:
201
+ email_intro: '在 %{participatory_space_title} 中不再開放建立辯論。您仍可在此頁面參與開放辯論:'
202
+ email_outro: 你收到此通知是因為你正在追蹤 %{participatory_space_title}。你可以透過前面的連結停止接收通知。
203
+ email_subject: 在 %{participatory_space_title} 中已停用辯論建立
204
+ notification_title: 辯論建立現在在<a href="%{participatory_space_url}">%{participatory_space_title}</a>已被停用
205
+ creation_enabled:
206
+ email_intro: '現在您可以在 %{participatory_space_title} 開始新的辯論!在此頁面開始參與:'
207
+ email_outro: 你收到此通知是因為你正在追蹤 %{participatory_space_title}。你可以透過前面的連結停止接收通知。
208
+ email_subject: 在 %{participatory_space_title} 現在可以開始新的辯論!
209
+ notification_title: 您現在可以在<a href="%{participatory_space_url}">%{participatory_space_title}</a>中<a href="%{resource_path}">開始新的辯論</a>。
210
+ debate_closed:
211
+ affected_user:
212
+ email_intro: '在 "%{resource_title}" 辯論中已經關閉。您可以在其頁面上閱讀結論:'
213
+ email_outro: 您收到此通知是因為您正在追蹤「%{resource_title}」辯論。您可以透過上方的連結取消追蹤。
214
+ email_subject: '%{resource_title} 辯論已結束'
215
+ notification_title: 這個<a href="%{resource_path}">%{resource_title}</a>辯論已經結束。
216
+ follower:
217
+ email_intro: '在 "%{resource_title}" 辯論中已經關閉。您可以在其頁面上閱讀結論:'
218
+ email_outro: 您收到此通知是因為您正在追蹤「%{resource_title}」辯論。您可以透過上方的連結取消追蹤。
219
+ email_subject: '%{resource_title} 辯論已結束'
220
+ notification_title: 這個<a href="%{resource_path}">%{resource_title}</a>辯論已經結束。
221
+ gamification:
222
+ badges:
223
+ commented_debates:
224
+ conditions:
225
+ - 選擇一個開放辯論加入
226
+ description: 當你在不同辯論中發表評論時,會被授予此徽章。
227
+ description_another: 此參與者已參與了 %{score} 個辯論。
228
+ description_own: 您已經參與了 %{score} 場辯論
229
+ name: 辯論
230
+ next_level_in: 再參與 %{score} 個辯論,即可達成下一等級!
231
+ unearned_another: 這位參與者尚未參與任何辯論。
232
+ unearned_own: 您尚未參與任何辯論。
233
+ metrics:
234
+ debates:
235
+ description: 建立的辯論次數
236
+ object: 辯論
237
+ title: 辯論
238
+ statistics:
239
+ 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.26.5"
7
+ "0.26.7"
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.26.5
4
+ version: 0.26.7
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.26.5
22
+ version: 0.26.7
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.26.5
29
+ version: 0.26.7
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.26.5
36
+ version: 0.26.7
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.26.5
43
+ version: 0.26.7
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.26.5
50
+ version: 0.26.7
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.26.5
57
+ version: 0.26.7
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.26.5
64
+ version: 0.26.7
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.26.5
71
+ version: 0.26.7
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