decidim-decidim_awesome 0.12.3 → 0.12.5

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.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -1
  3. data/README.md +1 -1
  4. data/app/commands/concerns/decidim/decidim_awesome/admin/needs_constraint_helpers.rb +39 -5
  5. data/app/commands/decidim/decidim_awesome/admin/create_authorization_group.rb +42 -0
  6. data/app/commands/decidim/decidim_awesome/admin/create_custom_redirect.rb +10 -14
  7. data/app/commands/decidim/decidim_awesome/admin/create_menu_hack.rb +9 -8
  8. data/app/commands/decidim/decidim_awesome/admin/create_proposal_custom_field.rb +3 -8
  9. data/app/commands/decidim/decidim_awesome/admin/create_scoped_admin.rb +4 -8
  10. data/app/commands/decidim/decidim_awesome/admin/create_scoped_style.rb +3 -7
  11. data/app/commands/decidim/decidim_awesome/admin/destroy_authorization_group.rb +37 -0
  12. data/app/commands/decidim/decidim_awesome/admin/destroy_custom_redirect.rb +10 -9
  13. data/app/commands/decidim/decidim_awesome/admin/destroy_menu_hack.rb +8 -7
  14. data/app/commands/decidim/decidim_awesome/admin/destroy_proposal_custom_field.rb +7 -13
  15. data/app/commands/decidim/decidim_awesome/admin/destroy_scoped_admin.rb +7 -10
  16. data/app/commands/decidim/decidim_awesome/admin/destroy_scoped_style.rb +6 -11
  17. data/app/commands/decidim/decidim_awesome/admin/update_config.rb +12 -1
  18. data/app/commands/decidim/decidim_awesome/admin/update_custom_redirect.rb +11 -11
  19. data/app/commands/decidim/decidim_awesome/admin/update_menu_hack.rb +10 -8
  20. data/app/controllers/concerns/decidim/decidim_awesome/enforce_access_authorizations.rb +49 -0
  21. data/app/controllers/concerns/decidim/decidim_awesome/needs_hashcash.rb +7 -5
  22. data/app/controllers/decidim/decidim_awesome/admin/constraints_controller.rb +2 -0
  23. data/app/controllers/decidim/decidim_awesome/admin/force_authorizations_controller.rb +44 -0
  24. data/app/controllers/decidim/decidim_awesome/required_authorizations_controller.rb +51 -13
  25. data/app/forms/concerns/decidim/decidim_awesome/proposals/admin/proposal_form_customizations.rb +59 -0
  26. data/app/forms/concerns/decidim/decidim_awesome/proposals/proposal_form_customizations.rb +28 -28
  27. data/app/forms/concerns/decidim/decidim_awesome/proposals/proposal_form_customizations_base.rb +36 -0
  28. data/app/forms/decidim/decidim_awesome/admin/authorization_group_form.rb +66 -0
  29. data/app/forms/decidim/decidim_awesome/admin/config_form.rb +12 -26
  30. data/app/forms/decidim/decidim_awesome/admin/constraint_form.rb +2 -0
  31. data/app/helpers/concerns/decidim/decidim_awesome/amendments_helper_override.rb +2 -1
  32. data/app/helpers/decidim/decidim_awesome/admin/config_constraints_helpers.rb +20 -17
  33. data/app/overrides/decidim/assemblies/admin/assemblies/_form/add_visibility_callout.html.erb.deface +3 -0
  34. data/app/overrides/decidim/conferences/admin/conferences/_form/add_visibility_callout.html.erb.deface +3 -0
  35. data/app/overrides/decidim/participatory_processes/admin/participatory_process_groups/_form/add_visibility_callout.html.erb.deface +3 -0
  36. data/app/overrides/decidim/participatory_processes/admin/participatory_processes/_form/add_visibility_callout.html.erb.deface +3 -0
  37. data/app/overrides/decidim/shared/_login_modal/add_hashcash.html.erb.deface +3 -0
  38. data/app/packs/src/decidim/decidim_awesome/admin/auto_edit.js +15 -0
  39. data/app/packs/src/decidim/decidim_awesome/awesome_admin.js +0 -1
  40. data/app/packs/stylesheets/decidim/decidim_awesome/admin/codemirror.scss +6 -1
  41. data/app/packs/stylesheets/decidim/decidim_awesome/admin/constraints.scss +5 -0
  42. data/app/packs/stylesheets/decidim/decidim_awesome/admin/custom_fields.scss +1 -2
  43. data/app/queries/decidim/decidim_awesome/space_constraint_finder.rb +45 -0
  44. data/app/serializers/concerns/decidim/decidim_awesome/proposals/proposal_serializer_methods.rb +3 -2
  45. data/app/services/decidim/decidim_awesome/access_authorization_service.rb +79 -0
  46. data/app/types/concerns/decidim/decidim_awesome/add_proposal_type_custom_fields.rb +2 -1
  47. data/app/views/decidim/decidim_awesome/admin/config/_authorization_options_form.html.erb +19 -0
  48. data/app/views/decidim/decidim_awesome/admin/config/_form_verifications.html.erb +71 -9
  49. data/app/views/decidim/decidim_awesome/admin/constraints/_form.html.erb +5 -4
  50. data/app/views/decidim/decidim_awesome/admin/shared/_visibility_notice.html.erb +8 -0
  51. data/app/views/decidim/decidim_awesome/hashcash/_hidden_field.html.erb +0 -1
  52. data/app/views/decidim/decidim_awesome/required_authorizations/index.html.erb +14 -4
  53. data/config/i18n-tasks.yml +1 -0
  54. data/config/locales/ca.yml +32 -7
  55. data/config/locales/cs.yml +33 -7
  56. data/config/locales/de.yml +32 -7
  57. data/config/locales/en.yml +36 -12
  58. data/config/locales/es.yml +33 -7
  59. data/config/locales/eu.yml +99 -34
  60. data/config/locales/fr.yml +70 -7
  61. data/config/locales/hu.yml +1 -0
  62. data/config/locales/it.yml +1 -0
  63. data/config/locales/ja.yml +71 -7
  64. data/config/locales/lt.yml +1 -0
  65. data/config/locales/nl.yml +1 -0
  66. data/config/locales/pt-BR.yml +1 -0
  67. data/config/locales/pt-PT.yml +1 -0
  68. data/config/locales/ro-RO.yml +1 -0
  69. data/config/locales/sv.yml +50 -0
  70. data/lib/decidim/decidim_awesome/admin_engine.rb +1 -0
  71. data/lib/decidim/decidim_awesome/{authorizator.rb → authorizer.rb} +1 -1
  72. data/lib/decidim/decidim_awesome/awesome.rb +5 -17
  73. data/lib/decidim/decidim_awesome/awesome_helpers.rb +14 -5
  74. data/lib/decidim/decidim_awesome/checksums.yml +11 -0
  75. data/lib/decidim/decidim_awesome/config.rb +18 -7
  76. data/lib/decidim/decidim_awesome/context_analyzers/request_analyzer.rb +1 -1
  77. data/lib/decidim/decidim_awesome/engine.rb +3 -1
  78. data/lib/decidim/decidim_awesome/menu.rb +1 -1
  79. data/lib/decidim/decidim_awesome/middleware/current_config.rb +5 -10
  80. data/lib/decidim/decidim_awesome/test/initializer.rb +1 -1
  81. data/lib/decidim/decidim_awesome/test/shared_examples/proposal_form_examples.rb +191 -0
  82. data/lib/decidim/decidim_awesome/test/shared_examples/summary_examples.rb +7 -3
  83. data/lib/decidim/decidim_awesome/version.rb +1 -1
  84. data/package.json +4 -4
  85. metadata +20 -5
  86. data/app/controllers/concerns/decidim/decidim_awesome/check_login_authorizations.rb +0 -60
  87. data/app/packs/src/decidim/decidim_awesome/admin/verification_selects.js +0 -21
@@ -1,4 +1,8 @@
1
+ ---
1
2
  ja:
3
+ active_hashcash:
4
+ submit_filter: フィルター
5
+ waiting_label: 検証を待っています…
2
6
  activemodel:
3
7
  attributes:
4
8
  config:
@@ -6,10 +10,13 @@ ja:
6
10
  allow_images_in_editors: HTMLエディターで画像を許可する
7
11
  allow_images_in_proposals: 提案エディターでの画像を許可する
8
12
  allow_videos_in_editors: HTMLエディターで動画を許可する
13
+ authorization_options_form: 認証オプション
9
14
  auto_save_forms: ローカルストレージにフォームを自動保存する
10
- force_authorization_after_login: ログイン/登録後に本人確認を行わせる
11
- force_authorization_help_text: 認証ページのヘルプテキスト
12
- force_authorization_with_any_method: いずれかの認証が行われている場合、アクセスできます (デフォルトでは、すべてが必要です)
15
+ force_authorizations: 認証グループ %{id}
16
+ hashcash_login: 既存ユーザーのハッシュキャッシュボット保護を有効にする (ログイン)
17
+ hashcash_login_bits: Hashcashアルゴリズムのビット数 (ログイン)
18
+ hashcash_signup: 新規ユーザーのハッシュキャッシュボット保護を有効にする (新規登録)
19
+ hashcash_signup_bits: Hashcashアルゴリズムのビット数 (新規登録)
13
20
  intergram_auto_no_response: ユーザーが最初のメッセージを送信し、応答が受信されなかった後1分後に送信されたメッセージ
14
21
  intergram_auto_response: ユーザーが最初のメッセージを送信した直後に送信されるメッセージ
15
22
  intergram_chat_id: チャットID
@@ -35,6 +42,7 @@ ja:
35
42
  validate_title_min_length: タイトルに必要な最小文字数
36
43
  validate_title_start_with_caps: タイトルを大文字で始めることを強制する
37
44
  constraint:
45
+ application_context: '対象:'
38
46
  component_id: 以下のみに適用
39
47
  component_manifest: このタイプのコンポーネントのみ有効
40
48
  participatory_space_manifest: 以下のタイプの参加型スペースに適用
@@ -206,7 +214,10 @@ ja:
206
214
  index:
207
215
  admin_head_tags: 管理者向けアプリケーションヘッダーに含まれる Awesome tags
208
216
  decidim-admin: Adminモジュールより
217
+ decidim-assemblies: 参加スペースモジュールから
218
+ decidim-conferences: カンファレンスモジュールから
209
219
  decidim-core: Coreモジュールより
220
+ decidim-participatory_processes: 参加型プロセスモジュールから
210
221
  decidim-proposals: 提案モジュールより
211
222
  decidim_version: Decidim version %{version}
212
223
  errors:
@@ -221,6 +232,7 @@ ja:
221
232
  処理を開始すると、バックグラウンドで実行されます。
222
233
  start_image_migrations: "\U0001F449 今すぐ移行プロセスを開始する"
223
234
  config:
235
+ anonymous: 非ログインユーザー
224
236
  caution: '注意: この機能は、予期しない結果につながる可能性があるデフォルトの動作を大きく変更します。注意して使用してください!'
225
237
  constraints:
226
238
  add_condition: 条件を追加
@@ -229,6 +241,9 @@ ja:
229
241
  delete: 削除
230
242
  edit: 編集
231
243
  title: '一部のケースのみ適用する:'
244
+ create_force_authorization:
245
+ error: 新しい認証グループの作成中にエラーが発生しました %{error}
246
+ success: 認証グループ %{key} を作成しました
232
247
  create_proposal_custom_field:
233
248
  error: 新しい「カスタム項目」ボックスの作成中にエラーが発生しました! %{error}
234
249
  success: '「カスタム項目」ボックス %{key} が正常に作成されました'
@@ -238,6 +253,9 @@ ja:
238
253
  create_scoped_style:
239
254
  error: '新規CSS box作成エラー: %{error}'
240
255
  success: CSS box %{key} が正常に作成されました
256
+ destroy_force_authorization:
257
+ error: 認証グループの削除中にエラーが発生しました %{error}
258
+ success: 認証グループ %{key} を削除しました
241
259
  destroy_proposal_custom_field:
242
260
  error: '「カスタム項目」ボックスの削除中にエラーが発生しました! %{error}'
243
261
  success: '「カスタム項目」ボックス %{key} が正常に削除されました'
@@ -247,6 +265,7 @@ ja:
247
265
  destroy_scoped_style:
248
266
  error: 'CSS box削除エラー: %{error}'
249
267
  success: CSS ボックス %{key} は正常に削除されました
268
+ force_authorizations: 認証グループ
250
269
  form:
251
270
  additional_proposal_sortings:
252
271
  enable_all: すべての追加ソートオプションを有効にする
@@ -256,14 +275,23 @@ ja:
256
275
  errors:
257
276
  incorrect_css: 'Box #%{key} のCSSに問題があります'
258
277
  incorrect_json: 'ボックス #%{key} 内の JSON 定義は無効です'
278
+ force_authorization_help_text: 認証ページのヘルプテキスト
259
279
  help:
260
280
  allow_images_in_editors: すべてのWYSIWYGエディタに画像アップローダーアイコンを追加します
261
281
  allow_images_in_proposals: 提案エディターでの画像アップロードをすべてのユーザーができるようにします。
262
282
  allow_videos_in_editors: すべてのWYSIWYGエディタに動画リンクアイコンを追加します
263
283
  auto_save_forms: 調査などのフォームにユーザーが入力したデータを、LocalStorageを使って自動的に保存します。フォームを送信されていない場合、同じブラウザーで次回アクセスした時に復元されます。フォームを送信すると、データは削除されます。ユーザーがLocalStrorageのデータを削除した場合にも、データは復元されなくなります。
264
284
  drag_and_drop_supported: 画像アップロード時にドラッグ&ドロップが利用できます。画像はサーバーにアップロードされ、外部リソースとして挿入されます(base64インラインエンコーディングは使用しません).
265
- force_authorization_after_login: '有効にした場合、指定された認証が行われていなければ、ユーザーはログインまたは登録後に認証ページにリダイレクトされます。これはユーザーがログインする前に、特定の認証を使用してユーザーを強制的に本人確認させる場合(スパムを防ぐためなど) に便利です。'
266
285
  force_authorization_help_text: 認証が必要な理由を説明するカスタムテキストを追加します。また、ユーザーがヘルプが必要な場合に備えて連絡方法を追加してください。
286
+ hashcash_i18n_key: 'ユーザーに表示されるログイン/登録ボタンのテキストは、i18n キー: %{key} でカスタマイズできます'
287
+ hashcash_login: |
288
+ 人間を煩わせることなく、Railsアプリケーションをボットや総当たり攻撃から守ります。
289
+ Hashcashはプルーフ・オブ・ワーク方式の仕組みで、ユーザーがサインアップする前に計算上のパズルを解かせるものです(これはブラウザが自動的に実行します)。
290
+ hashcash_login_bits: このパラメータは、ハッシュキャッシュアルゴリズムが作業証明書の生成に使用するビット数を定義します。 16 (簡単) から 30 (極めて困難) ビットの間の値を使用することをお勧めします。 ログインフォームのデフォルト値は %{bits} ビットです。
291
+ hashcash_signup: |
292
+ 人間を煩わせることなく、Railsアプリケーションをボットや総当たり攻撃から守ります。
293
+ Hashcashはプルーフ・オブ・ワーク方式の仕組みで、ユーザーがサインアップする前に計算上のパズルを解かせるものです(これはブラウザが自動的に実行します)。
294
+ hashcash_signup_bits: このパラメータは、ハッシュキャッシュアルゴリズムが作業証明書の生成に使用するビット数を定義します。 16 (簡単) から 30 (極めて困難) ビットの間の値を使用することをお勧めします。 登録フォームのデフォルト値は %{bits} ビットです。
267
295
  intergram_about: IntergramはTelegramメッセンジャーを使用してページの下部に埋め込まれたライブサポートチャットウィジェットを処理します。
268
296
  intergram_config: '<a href="https://web.telegram.org/#/im?p=@IntergramBot">@Intergram bot</a> をグループに招待するか、直接チャットを開始します。 <a href="https://github.com/idoco/intergram#embed-intergram-in-your-website-with-these-2-simple-steps">+ info</a>'
269
297
  original_editor_override: バージョン 0.26 以降、エディタに画像をアップロードすることが可能になりました(管理者専用)。 そのため、ここでの画像設定はパブリックエディタにのみ影響を与えます(管理者は常に利用可能です)。
@@ -290,12 +318,20 @@ ja:
290
318
  validate_title_max_marks_together: '並べて入力できる「?」と「!」の数を制限します。 すなわち、それが2の場合、「!!!」はテキストに記入できません'
291
319
  validate_title_min_length: タイトルは常に必須です。この数字はゼロにはできません
292
320
  verifications_html: |
293
- 認証プロセスにいくつかの調整を加えることができます。<br>
294
- <b>注意:</b> これらの設定を変更すると、一部のユーザーがプラットフォームにアクセスできなくなる可能性があります。慎重に使用してください!<br><br>
295
- また、これらの設定は全ユーザーに適用されますが、管理者は常に管理者バックエンドにアクセス可能です。
321
+ ここでは、参加スペースやコンポーネントに追加のアクセス制限を設けることができ、特定の場所へアクセスする前にユーザーの認証を必須とすることができます(スパム防止など)。
322
+ 制限はすべてのユーザーに適用されますが、管理者は常に /admin パネルにアクセスできます。
296
323
  validators:
297
324
  body: '「body」フィールドのユーザー入力検証'
298
325
  title: '「タイトル」フィールドのユーザー入力検証'
326
+ form_force_authorizations:
327
+ delete: 削除
328
+ force_authorizations_html: |
329
+ 認証グループを定義します。各グループでは、ユーザーがプラットフォーム内の特定のエリアにアクセスするために、1つ以上の方法で認証を受けることを必須とできます。
330
+ help: 認証方式のグループを定義し、それに基づいてアクセスを制限することができます。
331
+ new: 新しい認証グループを追加
332
+ remove: この「認証グループ」を削除
333
+ sure_to_remove: この認証グループを削除してもよろしいですか?
334
+ title: 'アクセス制限:'
299
335
  form_proposal_custom_fields:
300
336
  delete: 削除
301
337
  new: 新しい「カスタム項目」ボックスを追加
@@ -342,6 +378,7 @@ ja:
342
378
  update:
343
379
  error: 設定更新エラー %{error}
344
380
  success: 設定は正常に更新されました
381
+ user_logged_in: ログインしているユーザー
345
382
  constraints:
346
383
  create:
347
384
  error: 条件設定作成エラー
@@ -399,6 +436,25 @@ ja:
399
436
  update:
400
437
  error: 'リダイレクトの更新中にエラーが発生しました: %{error}'
401
438
  success: リダイレクトを更新しました
439
+ hashcash:
440
+ filters:
441
+ ip_addresses: IP アドレスを表示
442
+ stamps: ハッシュキャッシュスタンプを表示
443
+ index:
444
+ bits: ビット数
445
+ created_at: 作成日時
446
+ help_html: |
447
+ このページには、システムで検出されたハッシュキャッシュスタンプが表示されます。 Hashcashは、ユーザーがサインアップする前に計算パズル(ブラウザによって自動的に実行される)を解決する必要がある作業証明システムです。
448
+ <br><br>
449
+ このリストの各エントリは、新規登録またはログインするたびにユーザーによって生成されたハッシュキャッシュスタンプを表します。
450
+ ip_address: IPアドレス
451
+ no_data: ハッシュキャッシュスタンプが見つかりません
452
+ request_path: リクエストパス
453
+ ip_addresses:
454
+ help_html: このページには、システムで検出されたすべてのIPアドレスが、生成したHashcashスタンプの数順に一覧表示されます。 <br><br>各スタンプは、ユーザーによるログインまたはサインアップのいずれかの操作を表します。この情報を利用して、不審な活動を検出することができます。
455
+ ip_address: IPアドレス
456
+ no_data: IPアドレスが見つかりません
457
+ stamps: Hashcashスタンプ
402
458
  menu:
403
459
  admins: スコープ付き管理者
404
460
  custom_redirects: カスタムリダイレクト
@@ -406,6 +462,7 @@ ja:
406
462
  livechat: ライブチャット
407
463
  maintenance:
408
464
  checks: システム互換性
465
+ hashcash: Hashcashスタンプ
409
466
  maintenance: メンテナンス
410
467
  private_data: プライベートデータ
411
468
  menu_hacks: メニュー調整
@@ -442,6 +499,8 @@ ja:
442
499
  title: グローバルメニューホームブロック
443
500
  menu:
444
501
  title: メインメニュー
502
+ mobile_menu:
503
+ title: モバイルメニュー
445
504
  new: 新しい項目
446
505
  remove: 追加の削除
447
506
  remove_hack: カスタマイズの削除
@@ -502,6 +561,9 @@ ja:
502
561
  scoped_styles:
503
562
  menu:
504
563
  title: 公開フロントエンド
564
+ visibility:
565
+ info_html: '%{awesome_link} による検証を使用して、追加のアクセス制限を管理できます。'
566
+ restricted_html: このスペースは %{awesome_link} による追加のアクセス制限を使用しています。
505
567
  admin_log:
506
568
  component:
507
569
  destroy_private_data: "%{user_name} は %{space_name} 内のプライベートデータの項目 %{resource_name} を%{count} 件破棄しました"
@@ -573,6 +635,7 @@ ja:
573
635
  proposal_private_custom_fields_disclosure: この情報は公開されません
574
636
  required_authorizations:
575
637
  index:
638
+ authorization_options_invalid: 残念ながら、この権限を持っていますが、あなたを検証するために使用されたデータは、このコンテキストでは無効です。
576
639
  cancel: あとで %{link} を行う
577
640
  granted_title: 許可された本人確認
578
641
  logout: ログアウトする
@@ -639,6 +702,7 @@ ja:
639
702
  title: 'メンテナンスツール: %{title}'
640
703
  titles:
641
704
  checks: システム互換性チェック
705
+ hashcash: Hashcashスタンプ
642
706
  private_data: プライベートデータのクリーンアップ
643
707
  awesome_config:
644
708
  amendments: 修正
@@ -1,3 +1,4 @@
1
+ ---
1
2
  lt:
2
3
  activemodel:
3
4
  attributes:
@@ -1,3 +1,4 @@
1
+ ---
1
2
  nl:
2
3
  activemodel:
3
4
  attributes:
@@ -1,3 +1,4 @@
1
+ ---
1
2
  pt-BR:
2
3
  activemodel:
3
4
  attributes:
@@ -1,3 +1,4 @@
1
+ ---
1
2
  pt:
2
3
  activemodel:
3
4
  attributes:
@@ -1,3 +1,4 @@
1
+ ---
1
2
  ro:
2
3
  activemodel:
3
4
  attributes:
@@ -1,17 +1,44 @@
1
+ ---
1
2
  sv:
3
+ active_hashcash:
4
+ submit_filter: Filtrera
5
+ waiting_label: Väntar på verifiering ...
2
6
  activemodel:
3
7
  attributes:
4
8
  config:
9
+ additional_proposal_sortings: Ytterligare sorteringsalternativ aktiva
10
+ allow_images_in_editors: Tillåt bilder i HTML-redigeraren
5
11
  allow_images_in_proposals: Tillåt bilder i förslagsfältet
12
+ allow_videos_in_editors: Tillåt videor i HTML-redigeraren
6
13
  auto_save_forms: Spara formulär automatiskt i lokal lagring
14
+ hashcash_login: Aktivera Hashcash bot-skydd för befintliga användare (inloggning)
15
+ hashcash_login_bits: Antal bitar för Hashcash-algoritmen (inloggning)
16
+ hashcash_signup: Aktivera Hashcash bot-skydd för nya användare (registrering)
17
+ hashcash_signup_bits: Antal bitar för Hashcash-algoritmen (registrering)
18
+ intergram_auto_no_response: Ett meddelande som skickas en minut efter att användaren skickar sitt första meddelande och inget svar tagits emot
19
+ intergram_auto_response: Ett meddelande som skickas omedelbart efter att användaren skickar sitt första meddelande
7
20
  intergram_chat_id: Chatt ID
8
21
  intergram_color: Huvudfärg för widget
22
+ intergram_for_admins: Aktivera Intergram-chatt i admin-backend
9
23
  intergram_intro_message: Första meddelandet när användaren öppnar chatten för första gången
10
24
  intergram_require_login: Endast för inloggade användare
25
+ intergram_title_closed: Rubrik för stängd chatt
26
+ intergram_title_open: Rubrik för öppen chatt
27
+ intergram_use_floating_button: Om markerad är den stängda chatten alltid en knapp istället för en text
11
28
  proposal_custom_fields: Tilläggsfält %{id}
12
29
  scoped_styles: Tilläggsstilar %{id}
30
+ user_timezone: Tillåt användare att ställa in tidszon i sin profil
31
+ validate_body_max_caps_percent: Maximal tillåten procentandel versaler för brödtexten
32
+ validate_body_max_marks_together: Maximalt antal symboler i rad tillåtna i brödtexten
33
+ validate_body_min_length: Minst tillåtna antal tecken för brödtexten
34
+ validate_body_start_with_caps: Tvinga brödtexten att börja med en stor bokstav
35
+ validate_title_max_caps_percent: Maximal tillåten procentandel versaler för titeln
36
+ validate_title_max_marks_together: Maximalt antal symboler i rad tillåtna i titeln
37
+ validate_title_min_length: Minst tillåtna antal tecken för titeln
38
+ validate_title_start_with_caps: Tvinga titeln att börja med en versal
13
39
  constraint:
14
40
  component_id: eller specifikt i
41
+ component_manifest: Endast i komponenter av typ
15
42
  participatory_space_slug: Endast i
16
43
  custom_redirect:
17
44
  active: Aktiv
@@ -24,8 +51,27 @@ sv:
24
51
  target: Öppna i
25
52
  url: Webbadress
26
53
  visibility: Synlighet
54
+ organization:
55
+ awesome_admins_available_authorizations: Tillåt administratörer att manuellt verifiera användare med dessa auktoriseringar
56
+ user:
57
+ user_time_zone: Personlig tidszon
27
58
  decidim:
28
59
  admin:
60
+ actions:
61
+ manage: Hantera
62
+ filters:
63
+ admin_accountability:
64
+ admin_role_type:
65
+ label: Rolltyp
66
+ role:
67
+ label: Roll
68
+ role_type_eq:
69
+ label: Rolltyp
70
+ label:
71
+ search_field_end_date: 'Till datum:'
72
+ search_field_start_date: 'Från datum:'
73
+ search_placeholder:
74
+ user_name_or_user_email_cont: Sök på användarnamn, e-post
29
75
  menu:
30
76
  decidim_awesome: Decidim Awesome
31
77
  components:
@@ -35,6 +81,7 @@ sv:
35
81
  global:
36
82
  announcement: Meddelande
37
83
  iframe: Iframe kod
84
+ iframe_help: 'Ange din kod som html: <iframe width="100%" height="700" frameBorder="0" allowFullscreen src="..."></iframe>. Innehållet kommer att saneras från andra HTML-taggar. Se till att använda 100% som bredd för att fylla skärmen.'
38
85
  step:
39
86
  announcement: Meddelande
40
87
  iframe: Iframe kod
@@ -43,7 +90,10 @@ sv:
43
90
  settings:
44
91
  global:
45
92
  announcement: Meddelande
93
+ collapse: Börja med kollapsad meny
94
+ map_center: Kartans centrum (Latitud, Longitud)
46
95
  map_height: Karthöjd (px)
96
+ map_zoom: Zoom (valfritt tal mellan 0 och 18)
47
97
  menu_amendments: Visa ändringsförslag
48
98
  menu_meetings: Visa möten
49
99
  step:
@@ -24,6 +24,7 @@ module Decidim
24
24
  resources :scoped_styles, param: :var, only: [:create, :destroy]
25
25
  resources :proposal_custom_fields, param: :var, only: [:create, :destroy]
26
26
  resources :scoped_admins, param: :var, only: [:create, :destroy]
27
+ resources :force_authorizations, param: :var, only: [:create, :destroy]
27
28
  get :admin_accountability, to: "admin_accountability#index", as: "admin_accountability"
28
29
  post :export_admin_accountability, to: "admin_accountability#export", as: "export_admin_accountability"
29
30
  get :users, to: "config#users"
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Decidim
4
4
  module DecidimAwesome
5
- class Authorizator
5
+ class Authorizer
6
6
  def initialize(user, admin_authorizations)
7
7
  @user = user
8
8
  @admin_authorizations = admin_authorizations
@@ -15,7 +15,7 @@ module Decidim
15
15
  autoload :Lock, "decidim/decidim_awesome/lock"
16
16
  autoload :TranslatedCustomFieldsType, "decidim/decidim_awesome/api/types/translated_custom_fields_type"
17
17
  autoload :LocalizedCustomFieldsType, "decidim/decidim_awesome/api/types/localized_custom_fields_type"
18
- autoload :Authorizator, "decidim/decidim_awesome/authorizator"
18
+ autoload :Authorizer, "decidim/decidim_awesome/authorizer"
19
19
 
20
20
  # Awesome comes with some components for participatory spaces
21
21
  # Currently :awesome_map and :awesome_iframe, list them here
@@ -203,22 +203,10 @@ module Decidim
203
203
  false
204
204
  end
205
205
 
206
- # Forces the user to authorize using some registered verification flow in order to access the platform
207
- # if set to an empty array, the user will be able to access the platform without any verification but admins can still enforce it
208
- # if set to :disabled the feature will be completely removed
209
- # You can initialize some default verification workflow manifests
210
- config_accessor :force_authorization_after_login do
211
- []
212
- end
213
-
214
- # By default all methods specified in force_authorization_after_login must be granted in order to access the platform
215
- # if set to true, the user will be able to access the platform if any of the methods is granted
216
- config_accessor :force_authorization_with_any_method do
217
- false
218
- end
219
-
220
- # When force_authorization_after_login is enabled, this text will be shown to the user as a help text (ie: add a contact information)
221
- config_accessor :force_authorization_help_text do
206
+ # Allows to enforce specific authorizations to access the platform
207
+ # Constraints can be defined for each group
208
+ # Set to :disabled to completely remove this feature
209
+ config_accessor :force_authorizations do
222
210
  {}
223
211
  end
224
212
 
@@ -10,11 +10,13 @@ module Decidim
10
10
 
11
11
  # Returns the normalized config for an Organization and the current url
12
12
  def awesome_config_instance
13
- memoize("current_config") do
13
+ @awesome_config_instance ||= memoize("current_config") do
14
14
  config = Config.new(request.env["decidim.current_organization"])
15
- config.context_from_request(request)
15
+ config.context_from_request!(request)
16
16
  config
17
17
  end
18
+ @awesome_config_instance.application_context!(current_user:) if respond_to?(:current_user)
19
+ @awesome_config_instance
18
20
  end
19
21
 
20
22
  def awesome_config
@@ -86,6 +88,13 @@ module Decidim
86
88
  end
87
89
  end
88
90
 
91
+ # Collects all the force authorizations that is applied in the current URL context
92
+ def awesome_force_authorizations
93
+ memoize("awesome_force_authorizations") do
94
+ awesome_config_instance.collect_sub_configs_values("force_authorization")
95
+ end
96
+ end
97
+
89
98
  # this will check if the current component has been configured to use a custom voting manifest
90
99
  def awesome_voting_manifest_for(component)
91
100
  memoize("awesome_voting_manifest_for_#{component.id}") do
@@ -93,11 +102,11 @@ module Decidim
93
102
  end
94
103
  end
95
104
 
96
- # Retrives all the "admins_available_authorizations" for the user along with other possible authorizations
97
- # returns an instance of Decidim::DecidimAwesome::Authorizator
105
+ # Retrieves all the "admins_available_authorizations" for the user along with other possible authorizations
106
+ # returns an instance of Decidim::DecidimAwesome::Authorizer
98
107
  def awesome_authorizations_for(user)
99
108
  memoize("awesome_authorizations_for_#{user.id}") do
100
- Authorizator.new(user, awesome_config[:admins_available_authorizations])
109
+ Authorizer.new(user, awesome_config[:admins_available_authorizations])
101
110
  end
102
111
  end
103
112
 
@@ -1,6 +1,15 @@
1
1
  decidim-admin:
2
2
  /app/views/layouts/decidim/admin/_header.html.erb:
3
3
  decidim-0.29.1: b2ae319d5bcf43954bbe0edb9a4e3ffb
4
+ decidim-assemblies:
5
+ /app/views/decidim/assemblies/admin/assemblies/_form.html.erb:
6
+ decidim-0.29.4: 020a06e40fd3b8dae4ec63b2afcac9cb
7
+ decidim-participatory_processes:
8
+ /app/views/decidim/participatory_processes/admin/participatory_processes/_form.html.erb:
9
+ decidim-0.29.4: 41d304c7583bdd51cbd5b6e98b27fded
10
+ decidim-conferences:
11
+ /app/views/decidim/conferences/admin/conferences/_form.html.erb:
12
+ decidim-0.29.4: 40c04d3e64936598f2c3acedf8e99372
4
13
  decidim-core:
5
14
  /app/packs/entrypoints/decidim_editor.js:
6
15
  decidim-0.29.1: beddd77e3893fd0b7cd2679a7ee6e536
@@ -34,6 +43,8 @@ decidim-core:
34
43
  decidim-0.29.1: b30423406afd43bb9af2c98d59d43632
35
44
  /app/views/decidim/devise/sessions/new.html.erb:
36
45
  decidim-0.29.1: a8fe60cd10c1636822c252d5488a979d
46
+ /app/views/decidim/shared/_login_modal.html.erb:
47
+ decidim-0.29.1: 0d615603bb45f7b209032578dda9fc72
37
48
  decidim-proposals:
38
49
  /lib/decidim/proposals/proposal_serializer.rb:
39
50
  decidim-0.29.1: 58915ff3a7528463587d3762a93ff51b
@@ -11,12 +11,13 @@ module Decidim
11
11
  participatory_space_manifest: nil,
12
12
  participatory_space_slug: nil,
13
13
  component_id: nil,
14
- component_manifest: nil
14
+ component_manifest: nil,
15
+ application_context: "anonymous"
15
16
  }
16
17
  @sub_configs = {}
17
18
  end
18
19
 
19
- attr_reader :context, :organization, :vars
20
+ attr_reader :context, :organization, :vars, :application_context
20
21
  attr_writer :defaults
21
22
 
22
23
  def defaults
@@ -29,23 +30,33 @@ module Decidim
29
30
  end
30
31
 
31
32
  # convert context to manifest, slug and id
32
- def context_from_request(request)
33
+ def context_from_request!(request)
33
34
  @config = nil
34
35
  @context = Decidim::DecidimAwesome::ContextAnalyzers::RequestAnalyzer.context_for request
35
36
  end
36
37
 
37
38
  # convert component to manifest, slug and id
38
- def context_from_component(component)
39
+ def context_from_component!(component)
39
40
  @config = nil
40
41
  @context = Decidim::DecidimAwesome::ContextAnalyzers::ComponentAnalyzer.context_for component
41
42
  end
42
43
 
43
44
  # convert participatory space to manifest, slug and id
44
- def context_from_participatory_space(space)
45
+ def context_from_participatory_space!(space)
45
46
  @config = nil
46
47
  @context = Decidim::DecidimAwesome::ContextAnalyzers::ParticipatorySpaceAnalyzer.context_for space
47
48
  end
48
49
 
50
+ def application_context!(ctx = {})
51
+ @application_context = ctx
52
+ @context[:application_context] = case ctx[:current_user]
53
+ when Decidim::User
54
+ "user_logged_in"
55
+ else
56
+ "anonymous"
57
+ end
58
+ end
59
+
49
60
  # config processed in context
50
61
  def config
51
62
  @config ||= calculate_config
@@ -93,7 +104,7 @@ module Decidim
93
104
  # if no constraints defined, applies to everything
94
105
  return true if constraints.blank?
95
106
 
96
- # if containts the "none" constraints, deactivate everything else
107
+ # if contains the "none" constraints, deactivate everything else
97
108
  return false if constraints.detect { |c| c.settings["participatory_space_manifest"] == "none" }
98
109
 
99
110
  # check if current context matches some constraint
@@ -117,7 +128,7 @@ module Decidim
117
128
  sub_configs_for(singular_key)[subkey.to_sym]&.add_constraints constraints
118
129
  end
119
130
 
120
- # Merges all subconfigs values for custom_styles or any other scoped confs
131
+ # Merges all sub-configs values for custom_styles or any other scoped configs
121
132
  # by default filtered according to the current scope, a block can be passed for custom filtering
122
133
  # ie, collect everything:
123
134
  # collect_sub_configs_values("scoped_style") { true }
@@ -34,7 +34,7 @@ module Decidim
34
34
  attr_reader :request, :context
35
35
 
36
36
  def extract_context!
37
- path = URI.parse(@request.url).path
37
+ path = @request.is_a?(String) ? @request : URI.parse(@request.url).path
38
38
  context_from_path path
39
39
  end
40
40
 
@@ -30,6 +30,7 @@ module Decidim
30
30
  # Add hashcash to signup and login
31
31
  Decidim::Devise::SessionsController.include(Decidim::DecidimAwesome::NeedsHashcash)
32
32
  Decidim::Devise::RegistrationsController.include(Decidim::DecidimAwesome::NeedsHashcash)
33
+ Decidim::ApplicationController.include(Decidim::DecidimAwesome::NeedsHashcash)
33
34
  end
34
35
  # Include additional helpers globally
35
36
  ActiveSupport.on_load(:action_view) { include Decidim::DecidimAwesome::AwesomeHelpers }
@@ -56,6 +57,7 @@ module Decidim
56
57
  :validate_body_max_marks_together,
57
58
  :validate_body_start_with_caps)
58
59
  Decidim::Proposals::ProposalForm.include(Decidim::DecidimAwesome::Proposals::ProposalFormCustomizations)
60
+ Decidim::Proposals::Admin::ProposalForm.include(Decidim::DecidimAwesome::Proposals::Admin::ProposalFormCustomizations)
59
61
  end
60
62
 
61
63
  if DecidimAwesome.enabled?(:proposal_custom_fields, :proposal_private_custom_fields)
@@ -118,7 +120,7 @@ module Decidim
118
120
 
119
121
  initializer "decidim_decidim_awesome.overrides", after: "decidim.action_controller" do
120
122
  config.to_prepare do
121
- Decidim::ApplicationController.include(Decidim::DecidimAwesome::CheckLoginAuthorizations) if DecidimAwesome.enabled?(:force_authorization_after_login)
123
+ Decidim::ApplicationController.include(Decidim::DecidimAwesome::EnforceAccessAuthorizations) if DecidimAwesome.enabled?(:force_authorizations)
122
124
  Decidim::ApplicationController.include(Decidim::DecidimAwesome::UseUserTimeZone) if Decidim::DecidimAwesome.enabled?(:user_timezone)
123
125
 
124
126
  # Auto-insert some csp directives
@@ -192,7 +192,7 @@ module Decidim
192
192
  menu_hacks_home_content_block_menu: config_enabled?(:home_content_block_menu),
193
193
  custom_redirects: config_enabled?(:custom_redirects),
194
194
  livechat: config_enabled?(:intergram_for_admins, :intergram_for_public),
195
- verifications: config_enabled?(:force_authorization_after_login),
195
+ verifications: config_enabled?(:force_authorizations),
196
196
  maintenance: true
197
197
  }
198
198
  end
@@ -17,15 +17,10 @@ module Decidim
17
17
  def call(env)
18
18
  @request = Rack::Request.new(env)
19
19
  if @request.env["decidim.current_organization"] && processable_path?
20
- @config = awesome_config_instance
21
- env["decidim_awesome.current_config"] = @config
20
+ # memoize for later
21
+ @config = env["decidim_awesome.current_config"] = awesome_config_instance
22
22
  tamper_user_model
23
23
  add_flash_message_from_request(env)
24
-
25
- # puts "requested path: #{env["PATH_INFO"]}"
26
- # puts "current_organization: #{@request.env["decidim.current_organization"]&.id}"
27
- # puts "potential_admins: #{Decidim::User.awesome_potential_admins}"
28
- # puts "scoped admins: #{Decidim::User.awesome_admins_for_current_scope}"
29
24
  else
30
25
  reset_user_model
31
26
  end
@@ -35,7 +30,7 @@ module Decidim
35
30
 
36
31
  private
37
32
 
38
- # a workaround to set a flash message if comming from the error controller (route not found)
33
+ # a workaround to set a flash message if coming from the error controller (route not found)
39
34
  def add_flash_message_from_request(env)
40
35
  return unless scoped_admins_active?
41
36
  return unless @request.params.has_key? "unauthorized"
@@ -45,7 +40,7 @@ module Decidim
45
40
 
46
41
  def awesome_config_instance
47
42
  @awesome_config_instance = Config.new @request.env["decidim.current_organization"]
48
- @awesome_config_instance.context_from_request @request
43
+ @awesome_config_instance.context_from_request! @request
49
44
  @awesome_config_instance
50
45
  end
51
46
 
@@ -127,7 +122,7 @@ module Decidim
127
122
  # to access certain deeper routes it requires first to click on a parent route, even without Post permissions in there
128
123
  # this adds this additional routes to these cases
129
124
  # For instance:
130
- # accessing /admin/participatory_processes/som-procress requires access first to /admin/participatory_processes
125
+ # accessing /admin/participatory_processes/some-process requires access first to /admin/participatory_processes
131
126
  def additional_get_constraints(constraints)
132
127
  return [] unless @request.get?
133
128
 
@@ -8,7 +8,7 @@ Decidim::DecidimAwesome.configure do |config|
8
8
  :allow_images_in_proposals,
9
9
  :auto_save_forms,
10
10
  :user_timezone,
11
- :force_authorization_after_login,
11
+ :force_authorizations,
12
12
  :admins_available_authorizations,
13
13
  :intergram_for_admins,
14
14
  :intergram_for_public,