decidim-core 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/decidim.js.es6 +2 -4
  3. data/app/assets/javascripts/decidim/append_elements.js.es6 +1 -1
  4. data/app/assets/javascripts/decidim/editor.js.es6 +33 -35
  5. data/app/assets/javascripts/decidim/filters.js.es6 +9 -15
  6. data/app/assets/javascripts/decidim/form_filter.component.js.es6 +5 -5
  7. data/app/assets/javascripts/decidim/form_filter.component.test.js +1 -1
  8. data/app/assets/javascripts/decidim/foundation.js.es6 +17 -0
  9. data/app/assets/javascripts/decidim/user_registrations.js.es6 +2 -3
  10. data/app/assets/stylesheets/decidim/_decidim.scss +9 -0
  11. data/app/assets/stylesheets/decidim/_variables.scss +5 -11
  12. data/app/assets/stylesheets/decidim/application.scss.erb +6 -0
  13. data/app/assets/stylesheets/decidim/extras/_leaflet.scss +13 -0
  14. data/app/assets/stylesheets/decidim/modules/_buttons.scss +8 -2
  15. data/app/assets/stylesheets/decidim/modules/_cards.scss +0 -2
  16. data/app/assets/stylesheets/decidim/modules/_comments.scss +33 -8
  17. data/app/assets/stylesheets/decidim/modules/{_defintion-data.scss → _definition-data.scss} +0 -0
  18. data/app/assets/stylesheets/decidim/modules/_filter-tags.scss +24 -0
  19. data/app/assets/stylesheets/decidim/modules/_layout.scss +1 -9
  20. data/app/assets/stylesheets/decidim/modules/_list-docs.scss +1 -1
  21. data/app/assets/stylesheets/decidim/modules/_margins.scss +15 -0
  22. data/app/assets/stylesheets/decidim/modules/_modules.scss +56 -0
  23. data/app/assets/stylesheets/decidim/modules/_opinion-toggle.scss +25 -5
  24. data/app/assets/stylesheets/decidim/modules/_order-by.scss +1 -0
  25. data/app/assets/stylesheets/decidim/modules/_process-header.scss +2 -1
  26. data/app/assets/stylesheets/decidim/modules/_process-phase.scss +0 -4
  27. data/app/assets/stylesheets/decidim/modules/_status-labels.scss +7 -1
  28. data/app/assets/stylesheets/decidim/modules/_typography.scss +17 -0
  29. data/app/assets/stylesheets/decidim/utils/_fontface.scss +3 -3
  30. data/app/assets/stylesheets/decidim/utils/_settings.scss +10 -7
  31. data/app/commands/decidim/invite_user.rb +2 -2
  32. data/app/commands/decidim/update_account.rb +48 -0
  33. data/app/controllers/concerns/decidim/form_factory.rb +1 -1
  34. data/app/controllers/concerns/decidim/needs_authorization.rb +12 -1
  35. data/app/controllers/concerns/decidim/user_profile.rb +30 -0
  36. data/app/controllers/decidim/account_controller.rb +28 -10
  37. data/app/controllers/decidim/authorizations_controller.rb +21 -8
  38. data/app/controllers/decidim/devise/invitations_controller.rb +2 -0
  39. data/app/controllers/decidim/devise/sessions_controller.rb +1 -1
  40. data/app/controllers/decidim/own_user_groups_controller.rb +14 -0
  41. data/app/controllers/decidim/participatory_processes_controller.rb +1 -1
  42. data/app/forms/decidim/account_form.rb +41 -0
  43. data/app/helpers/decidim/aria_selected_link_to_helper.rb +26 -0
  44. data/app/helpers/decidim/attachments_helper.rb +15 -0
  45. data/app/helpers/decidim/filters_helper.rb +2 -3
  46. data/app/helpers/decidim/layout_helper.rb +29 -6
  47. data/app/helpers/decidim/resource_helper.rb +64 -0
  48. data/app/helpers/decidim/user_profile_helper.rb +23 -0
  49. data/app/mailers/decidim/decidim_devise_mailer.rb +1 -0
  50. data/app/models/decidim/abilities/everyone.rb +5 -1
  51. data/app/models/decidim/ability.rb +3 -4
  52. data/app/models/decidim/{participatory_process_attachment.rb → attachment.rb} +5 -5
  53. data/app/models/decidim/feature.rb +2 -0
  54. data/app/models/decidim/organization.rb +1 -0
  55. data/app/models/decidim/participatory_process.rb +2 -5
  56. data/app/models/decidim/resource_link.rb +28 -0
  57. data/app/models/decidim/user.rb +6 -0
  58. data/app/models/decidim/user_group.rb +10 -1
  59. data/app/services/decidim/resource_search.rb +1 -4
  60. data/app/types/decidim/session_type.rb +16 -0
  61. data/app/types/decidim/user_group_type.rb +20 -0
  62. data/app/types/decidim/user_type.rb +5 -1
  63. data/app/uploaders/decidim/attachment_uploader.rb +4 -1
  64. data/app/uploaders/decidim/avatar_uploader.rb +8 -0
  65. data/app/uploaders/decidim/banner_image_uploader.rb +1 -0
  66. data/app/uploaders/decidim/hero_image_uploader.rb +1 -0
  67. data/app/uploaders/decidim/homepage_image_uploader.rb +5 -1
  68. data/app/uploaders/decidim/image_uploader.rb +1 -1
  69. data/app/uploaders/decidim/organization_favicon_uploader.rb +17 -0
  70. data/app/uploaders/decidim/organization_logo_uploader.rb +2 -2
  71. data/app/validators/feature_validator.rb +23 -0
  72. data/app/views/decidim/account/_password_fields.html.erb +2 -0
  73. data/app/views/decidim/account/_user_groups.html.erb +0 -0
  74. data/app/views/decidim/account/show.html.erb +24 -29
  75. data/app/views/decidim/application/_attachments.html.erb +8 -0
  76. data/app/views/decidim/{participatory_processes → application}/_documents.html.erb +0 -0
  77. data/app/views/decidim/{participatory_processes → application}/_photos.html.erb +0 -0
  78. data/app/views/decidim/authorizations/first_login.html.erb +22 -0
  79. data/app/views/decidim/authorizations/index.html.erb +46 -19
  80. data/app/views/decidim/devise/omniauth_registrations/new.html.erb +1 -1
  81. data/app/views/decidim/devise/registrations/new.html.erb +1 -1
  82. data/app/views/decidim/own_user_groups/index.html.erb +24 -0
  83. data/app/views/decidim/participatory_process_steps/_participatory_process_step.html.erb +1 -1
  84. data/app/views/decidim/participatory_process_steps/index.html.erb +3 -1
  85. data/app/views/decidim/participatory_processes/_participatory_process.html.erb +2 -2
  86. data/app/views/decidim/participatory_processes/_promoted_process.html.erb +1 -1
  87. data/app/views/decidim/participatory_processes/index.html.erb +2 -0
  88. data/app/views/decidim/participatory_processes/show.html.erb +37 -8
  89. data/app/views/decidim/shared/_comments.html.erb +0 -0
  90. data/app/views/layouts/decidim/_application.html.erb +5 -3
  91. data/app/views/layouts/decidim/_header.html.erb +4 -4
  92. data/app/views/layouts/decidim/_logo.html.erb +29 -17
  93. data/app/views/layouts/decidim/_process_header.html.erb +15 -3
  94. data/app/views/layouts/decidim/_process_header_steps.html.erb +1 -1
  95. data/app/views/layouts/decidim/_user_menu.html.erb +3 -0
  96. data/app/views/layouts/decidim/mailer.html.erb +1 -1
  97. data/app/views/layouts/decidim/user_profile.html.erb +35 -0
  98. data/app/views/pages/home.html.erb +5 -139
  99. data/app/views/pages/home/_extended.html.erb +48 -0
  100. data/app/views/pages/home/_hero.html.erb +20 -0
  101. data/app/views/pages/home/_highlighted_processes.html.erb +37 -0
  102. data/app/views/pages/home/_statistics.html.erb +22 -0
  103. data/app/views/pages/home/_sub_hero.html.erb +11 -0
  104. data/config/i18n-tasks.yml +1 -0
  105. data/config/initializers/foundation_rails_helper.rb +2 -0
  106. data/config/locales/ca.yml +69 -33
  107. data/config/locales/en.yml +86 -29
  108. data/config/locales/es.yml +68 -32
  109. data/config/routes.rb +8 -3
  110. data/db/migrate/20161116115156_create_attachments.rb +0 -2
  111. data/db/migrate/20170113150627_create_resource_links.rb +10 -0
  112. data/db/migrate/20170123134023_make_attachments_polymorphic.rb +18 -0
  113. data/db/migrate/20170123140857_add_avatar_to_user_groups.rb +5 -0
  114. data/db/migrate/20170125135937_rename_attachable_to_attached_to.rb +11 -0
  115. data/db/migrate/20170125152026_add_weight_to_features.rb +5 -0
  116. data/db/migrate/20170126151123_add_extra_info_to_processes.rb +8 -0
  117. data/db/migrate/20170128140553_add_timestamps_to_identities.rb +5 -0
  118. data/db/migrate/20170130132833_add_favicon_to_decidim_organizations.rb +5 -0
  119. data/db/seeds.rb +38 -6
  120. data/lib/decidim/authorable.rb +32 -0
  121. data/lib/decidim/core.rb +37 -0
  122. data/lib/decidim/core/engine.rb +2 -3
  123. data/lib/decidim/core/test.rb +6 -0
  124. data/lib/decidim/core/test/factories.rb +24 -3
  125. data/lib/decidim/core/test/shared_examples/authorable.rb +31 -0
  126. data/lib/decidim/core/test/shared_examples/has_attachments.rb +29 -0
  127. data/lib/decidim/core/test/shared_examples/has_category.rb +10 -0
  128. data/lib/decidim/core/test/shared_examples/has_feature.rb +20 -0
  129. data/lib/decidim/core/test/shared_examples/has_scope.rb +10 -0
  130. data/lib/decidim/core/version.rb +1 -1
  131. data/lib/decidim/feature_manifest.rb +31 -1
  132. data/lib/decidim/features/base_controller.rb +10 -0
  133. data/lib/decidim/features/settings_manifest.rb +1 -0
  134. data/lib/decidim/has_attachment.rb +32 -0
  135. data/lib/decidim/has_attachments.rb +32 -0
  136. data/lib/decidim/has_category.rb +21 -0
  137. data/lib/decidim/has_feature.rb +20 -0
  138. data/lib/decidim/has_scope.rb +21 -0
  139. data/lib/decidim/query_extensions.rb +2 -2
  140. data/lib/decidim/resource_manifest.rb +80 -0
  141. data/lib/decidim/resourceable.rb +85 -0
  142. metadata +67 -40
  143. data/app/assets/javascripts/decidim/inline_svg.js.es6 +0 -12
  144. data/app/assets/stylesheets/decidim/application.sass +0 -12
  145. data/app/assets/stylesheets/decidim/extras/_turbolinks.scss +0 -3
  146. data/app/assets/stylesheets/decidim/modules/_popularity.scss +0 -74
  147. data/app/assets/stylesheets/decidim/utils/_variables.scss +0 -22
  148. data/app/views/decidim/account/_authorizations.html.erb +0 -52
  149. data/vendor/assets/javascripts/owl.carousel.min.js +0 -47
  150. data/vendor/assets/javascripts/svg-injector.js +0 -464
@@ -6,6 +6,8 @@ module Decidim
6
6
  # steps that get enabled or disabled depending on which step is currently
7
7
  # active.
8
8
  class ParticipatoryProcess < ApplicationRecord
9
+ include Decidim::HasAttachments
10
+
9
11
  belongs_to :organization,
10
12
  foreign_key: "decidim_organization_id",
11
13
  class_name: Decidim::Organization,
@@ -22,11 +24,6 @@ module Decidim
22
24
  class_name: Decidim::ParticipatoryProcessStep,
23
25
  dependent: :destroy,
24
26
  inverse_of: :participatory_process
25
- has_many :attachments,
26
- foreign_key: "decidim_participatory_process_id",
27
- class_name: Decidim::ParticipatoryProcessAttachment,
28
- dependent: :destroy,
29
- inverse_of: :participatory_process
30
27
  has_many :categories,
31
28
  foreign_key: "decidim_participatory_process_id",
32
29
  class_name: Decidim::Category,
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+ module Decidim
3
+ # A ResourceLink allows linking resources (other entities in Decidim) between
4
+ # them without them having to know each other.
5
+ #
6
+ # In order to group the relations between resources you need to specify a name.
7
+ #
8
+ # Some examples could be: proposals that have been created in a meeting or
9
+ # projects that are a result of merging diffrent proposals.
10
+ class ResourceLink < ApplicationRecord
11
+ belongs_to :from, polymorphic: true
12
+ belongs_to :to, polymorphic: true
13
+
14
+ validates :from, :to, :name, presence: true
15
+ validates :name, uniqueness: { scope: [:from, :to] }
16
+
17
+ validate :same_organization
18
+
19
+ private
20
+
21
+ def same_organization
22
+ return if from.try(:organization) == to.try(:organization)
23
+
24
+ errors.add(:from, :invalid)
25
+ errors.add(:to, :invalid)
26
+ end
27
+ end
28
+ end
@@ -11,6 +11,8 @@ module Decidim
11
11
  belongs_to :organization, foreign_key: "decidim_organization_id", class_name: Decidim::Organization
12
12
  has_many :authorizations, foreign_key: "decidim_user_id", class_name: Decidim::Authorization, inverse_of: :user
13
13
  has_many :identities, foreign_key: "decidim_user_id", class_name: Decidim::Identity
14
+ has_many :user_groups, through: :memberships, class_name: Decidim::UserGroup, foreign_key: :decidim_user_group_id
15
+ has_many :memberships, class_name: Decidim::UserGroupMembership, foreign_key: :decidim_user_id
14
16
 
15
17
  ROLES = %w(admin moderator official).freeze
16
18
 
@@ -44,6 +46,10 @@ module Decidim
44
46
  roles.include?(role.to_s)
45
47
  end
46
48
 
49
+ def name
50
+ super || I18n.t("decidim.anonymous_user")
51
+ end
52
+
47
53
  private
48
54
 
49
55
  def all_roles_are_valid
@@ -9,10 +9,19 @@ module Decidim
9
9
  validates :name, presence: true
10
10
  validates :document_number, presence: true
11
11
  validates :phone, presence: true
12
+ validates :avatar, file_size: { less_than_or_equal_to: 5.megabytes }
13
+ mount_uploader :avatar, Decidim::AvatarUploader
14
+
15
+ scope :verified, -> { where.not(verified_at: nil) }
12
16
 
13
17
  # Public: Mark the user group as verified
14
18
  def verify!
15
- update_attribute(:verified, true)
19
+ update_attribute(:verified_at, Time.current)
20
+ end
21
+
22
+ # Public: Checks if the user group is verified.
23
+ def verified?
24
+ verified_at.present?
16
25
  end
17
26
  end
18
27
  end
@@ -20,10 +20,7 @@ module Decidim
20
20
  # raise order_start_time.inspect
21
21
  raise "Missing feature" unless feature
22
22
 
23
- @scope
24
- .page(options[:page] || 1)
25
- .per(options[:per_page] || 12)
26
- .where(feature: feature)
23
+ @scope.where(feature: feature)
27
24
  end
28
25
 
29
26
  # Handle the category_id filter
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+ module Decidim
3
+ # This type represents the current user session.
4
+ SessionType = GraphQL::ObjectType.define do
5
+ name "Session"
6
+ description "The current session"
7
+
8
+ field :user, UserType, "The current user" do
9
+ resolve ->(obj, _args, _ctx) { obj }
10
+ end
11
+
12
+ field :verifiedUserGroups, !types[UserGroupType], "The current user verified user groups" do
13
+ resolve ->(obj, _args, _ctx) { obj.user_groups.verified }
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+ module Decidim
3
+ # This type represents a UserGroup
4
+ UserGroupType = GraphQL::ObjectType.define do
5
+ name "UserGroup"
6
+ description "A user group"
7
+
8
+ interfaces [
9
+ Decidim::Api::AuthorInterface
10
+ ]
11
+
12
+ field :id, !types.ID, "The user group's id"
13
+
14
+ field :name, !types.String, "The user group's name"
15
+
16
+ field :avatarUrl, !types.String, "The user's avatar url" do
17
+ resolve ->(obj, _args, _ctx) { obj.avatar.url }
18
+ end
19
+ end
20
+ end
@@ -5,7 +5,11 @@ module Decidim
5
5
  name "User"
6
6
  description "A user"
7
7
 
8
- field :name, types.String, "The user's name"
8
+ interfaces [
9
+ Decidim::Api::AuthorInterface
10
+ ]
11
+
12
+ field :name, !types.String, "The user's name"
9
13
 
10
14
  field :avatarUrl, !types.String, "The user's avatar url" do
11
15
  resolve ->(obj, _args, _ctx) { obj.avatar.url }
@@ -7,9 +7,11 @@ module Decidim
7
7
 
8
8
  process :set_content_type_and_size_in_model
9
9
  process :validate_dimensions
10
+
10
11
  version :thumbnail, if: :image? do
11
12
  process resize_to_fit: [nil, 237]
12
13
  end
14
+
13
15
  version :big, if: :image? do
14
16
  process resize_to_limit: [nil, 1000]
15
17
  end
@@ -39,7 +41,8 @@ module Decidim
39
41
  #
40
42
  # Returns a Boolean.
41
43
  def image?(new_file)
42
- new_file.content_type.start_with? "image"
44
+ content_type = model.try(:content_type) || new_file.content_type
45
+ content_type.to_s.start_with? "image"
43
46
  end
44
47
 
45
48
  # Copies the content type and file size to the model where this is mounted.
@@ -7,6 +7,14 @@ module Decidim
7
7
 
8
8
  process :validate_dimensions
9
9
 
10
+ version :big do
11
+ process resize_to_fill: [500, 500]
12
+ end
13
+
14
+ version :thumb do
15
+ process resize_to_fill: [100, 100]
16
+ end
17
+
10
18
  def default_url(*)
11
19
  ActionController::Base.helpers.asset_path("decidim/default-avatar.svg")
12
20
  end
@@ -2,5 +2,6 @@
2
2
  module Decidim
3
3
  # This class deals with uploading banner images to ParticipatoryProcesses.
4
4
  class BannerImageUploader < ImageUploader
5
+ process resize_to_limit: [1000, 200]
5
6
  end
6
7
  end
@@ -2,5 +2,6 @@
2
2
  module Decidim
3
3
  # This class deals with uploading hero images to ParticipatoryProcesses.
4
4
  class HeroImageUploader < ImageUploader
5
+ process resize_to_limit: [1000, 1000]
5
6
  end
6
7
  end
@@ -5,7 +5,11 @@ module Decidim
5
5
  include CarrierWave::MiniMagick
6
6
 
7
7
  version :big do
8
- process resize_to_limit: [nil, 2000]
8
+ process resize_to_fill: [1920, 666]
9
+ end
10
+
11
+ def max_image_height_or_width
12
+ 8000
9
13
  end
10
14
  end
11
15
  end
@@ -33,7 +33,7 @@ module Decidim
33
33
  end
34
34
 
35
35
  def max_image_height_or_width
36
- 8000
36
+ 2000
37
37
  end
38
38
 
39
39
  private
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+ module Decidim
3
+ # This class deals with uploading an organization's favicon.
4
+ class OrganizationFaviconUploader < ImageUploader
5
+ SIZES = {
6
+ big: 152,
7
+ medium: 64,
8
+ small: 32
9
+ }.freeze
10
+
11
+ SIZES.each do |name, size|
12
+ version name do
13
+ process resize_and_pad: [size, size]
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
  module Decidim
3
- # This class deals with uploading hero images to ParticipatoryProcesses.
3
+ # This class deals with uploading the organization's logo.
4
4
  class OrganizationLogoUploader < ImageUploader
5
5
  version :medium do
6
- process resize_to_limit: [500, 500]
6
+ process resize_to_limit: [600, 160]
7
7
  end
8
8
  end
9
9
  end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+ # A custom validator to make sure features are correctly assigned to a model.
3
+ #
4
+ # Adds a presence validation and checks that the manifest is the correct one.
5
+ class FeatureValidator < ActiveModel::EachValidator
6
+ # Validates the arguiments passed to the validator.
7
+ def check_validity!
8
+ raise ArgumentError, "You must include a `manifest` option with the name of the manifest to validate when validating a feature" unless options[:manifest].present?
9
+ end
10
+
11
+ # The actual validator method. It is called when ActiveRecord iterates
12
+ # over all the validators.
13
+ def validate_each(record, attribute, feature)
14
+ unless feature
15
+ record.errors[attribute] << :blank
16
+ return
17
+ end
18
+
19
+ manifest_name = options[:manifest].respond_to?(:call) ? options[:manifest].call : options[:manifest].to_s
20
+
21
+ record.errors[attribute] << :invalid if feature.manifest_name.to_s != manifest_name
22
+ end
23
+ end
@@ -0,0 +1,2 @@
1
+ <%= form.password_field :password, value: form.object.password %>
2
+ <%= form.password_field :password_confirmation, value: form.object.password_confirmation %>
File without changes
@@ -1,32 +1,27 @@
1
- <main class="wrapper">
2
- <div class="row collapse">
3
- <div class="columns">
4
- <h1 class="heading1 user-header"><%= t(".title") %></h1>
5
- </div>
6
- </div>
7
- <div class="row collapse">
8
- <div class="main-container">
9
- <div class="row collapse main-container--side-panel">
10
- <div class="columns medium-4 large-3">
11
- <div class="side-panel">
12
- <ul class="tabs vertical side-panel__tabs" id="user-settings-tabs"
13
- data-tabs>
14
- <% if handlers.any? || authorizations.any? %>
15
- <li class="tabs-title">
16
- <a href="#authorizations"><%= t(".authorizations") %></a>
17
- </li>
18
- <% end %>
19
- </ul>
20
- </div>
21
- </div>
22
- <div class="columns medium-8 large-9">
23
- <div class="main-container__content">
24
- <div class="tabs-content vertical" data-tabs-content="user-settings-tabs">
25
- <%= render partial: "authorizations" %>
26
- </div>
27
- </div>
28
- </div>
1
+ <div class="row">
2
+ <%= form_for(@account, url: account_path, method: :put, class: "user-form") do |f| %>
3
+ <div class="columns large-4">
4
+ <%= image_tag current_user.avatar.big.url, width: "100%" %>
5
+ <%= f.file_field :avatar, label: false %>
6
+ <%= f.check_box :remove_avatar %>
29
7
  </div>
8
+
9
+ <div class="columns large-8 end">
10
+ <%= f.text_field :name %>
11
+ <%= f.email_field :email %>
12
+
13
+ <% if @account.errors[:password].any? || @account.errors[:password_confirmation].any? %>
14
+ <%= render partial: "password_fields", locals: { form: f } %>
15
+ <% else %>
16
+ <p>
17
+ <a data-toggle="passwordChange" class="change-password"><%= t ".change_password" %></a>
18
+ </p>
19
+ <div id="passwordChange" class="toggle-show" data-toggler=".is-expanded">
20
+ <%= render partial: "password_fields", locals: { form: f } %>
21
+ </div>
22
+ <% end %>
23
+
24
+ <%= f.submit t(".update_account"), disable_with: true %>
25
+ <% end %>
30
26
  </div>
31
27
  </div>
32
- </main>
@@ -0,0 +1,8 @@
1
+ <% if attached_to.attachments.any? %>
2
+ <div class="row attachments">
3
+ <div class="columns large-8">
4
+ <%= render partial: "documents", locals: { documents: attached_to.documents } %>
5
+ <%= render partial: "photos", locals: { photos: attached_to.photos } %>
6
+ </div>
7
+ </div>
8
+ <% end %>
@@ -0,0 +1,22 @@
1
+ <main class="wrapper">
2
+ <div class="row collapse">
3
+ <div class="row collapse">
4
+ <div class="columns large-8 large-centered text-center">
5
+ <h1 class="heading1 page-title"><%= t(".title") %></h1>
6
+ <p class="heading5"><%= t(".verify_with_these_options") %></p>
7
+ </div>
8
+ </div>
9
+ <div class="row">
10
+ <div class="columns medium-7 large-5 medium-centered">
11
+ <div class="card">
12
+ <div class="card__content">
13
+ <% handlers.each do |handler| %>
14
+ <%= link_to t(handler.handler_name, scope: "decidim.authorizations.first_login.actions"), new_authorization_path(handler: handler.handler_name), class: "button expanded" %>
15
+ <% end %>
16
+ <p class="text-center skip"><%= t("decidim.authorizations.skip_verification", link: link_to(t("decidim.authorizations.current_participatory_processes"), participatory_processes_path).html_safe).html_safe %>.</p>
17
+ </div>
18
+ </div>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ </main>
@@ -1,22 +1,49 @@
1
- <main class="wrapper">
2
- <div class="row collapse">
3
- <div class="row collapse">
4
- <div class="columns large-8 large-centered text-center">
5
- <h1 class="heading1 page-title"><%= t(".title") %></h1>
6
- <p class="heading5"><%= t(".verify_with_these_options") %></p>
1
+ <div class="row column authorizations-list">
2
+ <% if @authorizations.any? %>
3
+ <section class="section">
4
+ <div class="card card--list">
5
+ <% @authorizations.each do |authorization| %>
6
+ <div class="card--list__item">
7
+ <div class="card--list__text">
8
+ <%= icon "lock-unlocked", class: "card--list__icon" %>
9
+ <div>
10
+ <h5 class="card--list__heading">
11
+ <%= t(authorization.name, scope: "decidim.authorization_handlers") %>
12
+ </h5>
13
+ <span class="text-small"><%= l(authorization.created_at, format: :long) %></span>
14
+ </div>
15
+ </div>
16
+ <div class="card--list__data">
17
+ <%= link_to authorization, method: :delete, class: "card--list__data__icon", data: { confirm: t(".authorization_confirm_destroy") } do %>
18
+ <%= icon "circle-x" %>
19
+ <% end %>
20
+ </div>
21
+ </div>
22
+ <% end %>
7
23
  </div>
8
- </div>
9
- <div class="row">
10
- <div class="columns medium-7 large-5 medium-centered">
11
- <div class="card">
12
- <div class="card__content">
13
- <% handlers.each do |handler| %>
14
- <%= link_to t(handler.handler_name, scope: "decidim.authorizations.index.actions"), new_authorization_path(handler: handler.handler_name), class: "button expanded" %>
15
- <% end %>
16
- <p class="text-center skip"><%= t("decidim.authorizations.skip_verification", link: link_to(t("decidim.authorizations.current_participatory_processes"), participatory_processes_path).html_safe).html_safe %>.</p>
24
+ <% end %>
25
+ <% if handlers.any? %>
26
+ <div class="card card--list">
27
+ <% handlers.each do |handler| %>
28
+ <div class="card--list__item">
29
+ <div class="card--list__text">
30
+ <a href="#">
31
+ <%= icon "lock-locked", class: "card--list__icon" %>
32
+ </a>
33
+ <div>
34
+ <h5 class="card--list__heading">
35
+ <%= link_to t(handler.handler_name, scope: "decidim.authorization_handlers"), new_authorization_path(handler: handler.handler_name) %>
36
+ </h5>
37
+ </div>
38
+ </div>
39
+ <div class="card--list__data">
40
+ <%= link_to new_authorization_path(handler: handler.handler_name), class: "card--list__data__icon" do %>
41
+ <%= icon "chevron-right" %>
42
+ <% end %>
43
+ </div>
17
44
  </div>
18
- </div>
45
+ <% end %>
19
46
  </div>
20
- </div>
21
- </div>
22
- </main>
47
+ </section>
48
+ <% end %>
49
+ </div>