decidim 0.0.1.alpha2 → 0.0.1.alpha3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of decidim might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.codeclimate.yml +8 -2
- data/.dockerignore +5 -0
- data/.gitignore +2 -1
- data/.hound.yml +4 -0
- data/.rubocop.yml +16 -3
- data/.ruby-version +1 -0
- data/.travis.yml +28 -0
- data/Dockerfile +36 -0
- data/Gemfile +7 -2
- data/Gemfile.lock +188 -30
- data/README.md +40 -6
- data/Rakefile +4 -20
- data/codecov.yml +71 -0
- data/common_gemfile.rb +6 -18
- data/decidim-admin/Gemfile +17 -0
- data/decidim-admin/Gemfile.lock +383 -0
- data/decidim-admin/README.md +28 -0
- data/decidim-admin/Rakefile +32 -0
- data/decidim-admin/app/assets/config/decidim_admin_manifest.js +2 -0
- data/{template.rb → decidim-admin/app/assets/images/decidim/admin/.keep} +0 -0
- data/decidim-admin/app/assets/javascripts/decidim/admin.js +21 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin.scss +8 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_actions.scss +8 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_foundation_and_overrides.scss +52 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_layout.scss +16 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_login.scss +36 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_settings.scss +566 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_sidebar.scss +73 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_tables.scss +5 -0
- data/decidim-admin/app/constraints/decidim/admin/organization_dashboard_constraint.rb +36 -0
- data/decidim-admin/app/controllers/decidim/admin/application_controller.rb +10 -0
- data/decidim-admin/app/controllers/decidim/admin/dashboard_controller.rb +9 -0
- data/decidim-admin/app/helpers/decidim/admin/application_helper.rb +12 -0
- data/decidim-admin/app/jobs/decidim/admin/application_job.rb +9 -0
- data/decidim-admin/app/mailers/decidim/admin/application_mailer.rb +11 -0
- data/decidim-admin/app/models/decidim/admin/application_record.rb +10 -0
- data/decidim-admin/app/policies/decidim/admin/application_policy.rb +20 -0
- data/decidim-admin/app/policies/decidim/admin/organization_policy.rb +15 -0
- data/decidim-admin/app/views/decidim/admin/dashboard/show.html.erb +3 -0
- data/decidim-admin/app/views/decidim/admin/devise/mailers/password_change.html.erb +3 -0
- data/decidim-admin/app/views/decidim/admin/devise/mailers/reset_password_instructions.html.erb +8 -0
- data/decidim-admin/app/views/layouts/decidim/admin/_header.html.erb +4 -0
- data/decidim-admin/app/views/layouts/decidim/admin/_login_items.html.erb +8 -0
- data/decidim-admin/app/views/layouts/decidim/admin/_sidebar.html.erb +13 -0
- data/decidim-admin/app/views/layouts/decidim/admin/application.html.erb +40 -0
- data/decidim-admin/app/views/layouts/decidim/admin/login.html.erb +19 -0
- data/decidim-admin/bin/rails +14 -0
- data/decidim-admin/config/i18n-tasks.yml +120 -0
- data/decidim-admin/config/locales/en.yml +8 -0
- data/decidim-admin/config/routes.rb +4 -0
- data/decidim-admin/decidim-admin.gemspec +38 -0
- data/decidim-admin/lib/decidim/admin.rb +12 -0
- data/decidim-admin/lib/decidim/admin/engine.rb +31 -0
- data/decidim-admin/lib/tasks/decidim/admin_tasks.rake +5 -0
- data/decidim-admin/spec/factories.rb +1 -0
- data/decidim-admin/spec/features/admin_access_control.rb +52 -0
- data/decidim-admin/spec/features/admin_invite_spec.rb +38 -0
- data/decidim-admin/spec/policies/organization_policy_spec.rb +41 -0
- data/decidim-admin/spec/spec_helper.rb +3 -0
- data/decidim-dev/Gemfile +17 -0
- data/decidim-dev/Gemfile.lock +381 -0
- data/decidim-dev/README.md +28 -0
- data/decidim-dev/decidim-dev.gemspec +30 -0
- data/decidim-dev/lib/decidim/common_rake.rb +14 -0
- data/decidim-dev/lib/decidim/test/base_spec_helper.rb +44 -0
- data/decidim-dev/lib/decidim/test/i18n_spec.rb +18 -0
- data/decidim-dev/lib/decidim/test/rspec_support/action_mailer.rb +46 -0
- data/decidim-dev/lib/decidim/test/rspec_support/active_job.rb +11 -0
- data/decidim-dev/lib/decidim/test/rspec_support/capybara.rb +19 -0
- data/decidim-dev/lib/decidim/test/rspec_support/database_cleaner.rb +13 -0
- data/decidim-dev/lib/decidim/test/rspec_support/factory_girl.rb +4 -0
- data/decidim-dev/lib/decidim/test/rspec_support/i18n.rb +12 -0
- data/decidim-dev/lib/decidim/test/rspec_support/warden.rb +8 -0
- data/decidim-dev/lib/decidim/test/rspec_support/wisper.rb +6 -0
- data/decidim-dev/lib/generators/decidim/dummy_generator.rb +65 -0
- data/decidim-system/Gemfile +17 -0
- data/decidim-system/Gemfile.lock +377 -0
- data/decidim-system/README.md +28 -0
- data/decidim-system/Rakefile +32 -0
- data/decidim-system/app/assets/config/decidim_system_manifest.js +2 -0
- data/decidim-system/app/assets/images/decidim/system/.keep +0 -0
- data/decidim-system/app/assets/javascripts/decidim/system.js +21 -0
- data/decidim-system/app/assets/stylesheets/decidim/system.scss +8 -0
- data/decidim-system/app/assets/stylesheets/decidim/system/_actions.scss +8 -0
- data/decidim-system/app/assets/stylesheets/decidim/system/_foundation_and_overrides.scss +52 -0
- data/decidim-system/app/assets/stylesheets/decidim/system/_layout.scss +16 -0
- data/decidim-system/app/assets/stylesheets/decidim/system/_login.scss +36 -0
- data/decidim-system/app/assets/stylesheets/decidim/system/_settings.scss +566 -0
- data/decidim-system/app/assets/stylesheets/decidim/system/_sidebar.scss +73 -0
- data/decidim-system/app/assets/stylesheets/decidim/system/_tables.scss +5 -0
- data/decidim-system/app/commands/decidim/system/create_admin.rb +40 -0
- data/decidim-system/app/commands/decidim/system/register_organization.rb +59 -0
- data/decidim-system/app/commands/decidim/system/update_admin.rb +52 -0
- data/decidim-system/app/commands/decidim/system/update_organization.rb +51 -0
- data/decidim-system/app/controllers/decidim/system/admins_controller.rb +67 -0
- data/decidim-system/app/controllers/decidim/system/application_controller.rb +11 -0
- data/decidim-system/app/controllers/decidim/system/dashboard_controller.rb +9 -0
- data/decidim-system/app/controllers/decidim/system/devise/passwords_controller.rb +12 -0
- data/decidim-system/app/controllers/decidim/system/devise/sessions_controller.rb +12 -0
- data/decidim-system/app/controllers/decidim/system/organizations_controller.rb +59 -0
- data/decidim-system/app/forms/decidim/system/admin_form.rb +33 -0
- data/decidim-system/app/forms/decidim/system/register_organization_form.rb +20 -0
- data/decidim-system/app/forms/decidim/system/update_organization_form.rb +28 -0
- data/decidim-system/app/helpers/decidim/system/application_helper.rb +12 -0
- data/decidim-system/app/jobs/decidim/system/application_job.rb +9 -0
- data/decidim-system/app/mailers/decidim/system/application_mailer.rb +11 -0
- data/decidim-system/app/models/decidim/system/admin.rb +18 -0
- data/decidim-system/app/models/decidim/system/application_record.rb +10 -0
- data/decidim-system/app/views/decidim/system/admins/_form.html.erb +11 -0
- data/decidim-system/app/views/decidim/system/admins/edit.html.erb +11 -0
- data/decidim-system/app/views/decidim/system/admins/index.html.erb +33 -0
- data/decidim-system/app/views/decidim/system/admins/new.html.erb +11 -0
- data/decidim-system/app/views/decidim/system/admins/show.html.erb +9 -0
- data/decidim-system/app/views/decidim/system/dashboard/show.html.erb +3 -0
- data/decidim-system/app/views/decidim/system/devise/mailers/password_change.html.erb +3 -0
- data/decidim-system/app/views/decidim/system/devise/mailers/reset_password_instructions.html.erb +8 -0
- data/decidim-system/app/views/decidim/system/devise/passwords/edit.html.erb +23 -0
- data/decidim-system/app/views/decidim/system/devise/passwords/new.html.erb +15 -0
- data/decidim-system/app/views/decidim/system/devise/sessions/new.html.erb +23 -0
- data/decidim-system/app/views/decidim/system/devise/shared/_links.html.erb +25 -0
- data/decidim-system/app/views/decidim/system/organizations/edit.html.erb +17 -0
- data/decidim-system/app/views/decidim/system/organizations/index.html.erb +34 -0
- data/decidim-system/app/views/decidim/system/organizations/new.html.erb +25 -0
- data/decidim-system/app/views/decidim/system/organizations/show.html.erb +11 -0
- data/decidim-system/app/views/layouts/decidim/system/_header.html.erb +4 -0
- data/decidim-system/app/views/layouts/decidim/system/_login_items.html.erb +8 -0
- data/decidim-system/app/views/layouts/decidim/system/_sidebar.html.erb +15 -0
- data/decidim-system/app/views/layouts/decidim/system/application.html.erb +40 -0
- data/decidim-system/app/views/layouts/decidim/system/login.html.erb +19 -0
- data/decidim-system/bin/rails +14 -0
- data/decidim-system/config/i18n-tasks.yml +120 -0
- data/decidim-system/config/locales/en.yml +60 -0
- data/decidim-system/config/routes.rb +17 -0
- data/decidim-system/db/migrate/20160919105637_devise_create_decidim_admins.rb +26 -0
- data/decidim-system/db/seeds.rb +9 -0
- data/decidim-system/decidim-system.gemspec +36 -0
- data/decidim-system/lib/decidim/system.rb +12 -0
- data/decidim-system/lib/decidim/system/engine.rb +31 -0
- data/decidim-system/lib/tasks/decidim/system_tasks.rake +5 -0
- data/decidim-system/spec/commands/decidim/system/create_admin_spec.rb +48 -0
- data/decidim-system/spec/commands/decidim/system/register_organization_spec.rb +68 -0
- data/decidim-system/spec/factories.rb +9 -0
- data/decidim-system/spec/features/manage_admins_spec.rb +67 -0
- data/decidim-system/spec/features/organizations_spec.rb +62 -0
- data/decidim-system/spec/features/sessions_spec.rb +38 -0
- data/decidim-system/spec/models/admin_spec.rb +23 -0
- data/decidim-system/spec/spec_helper.rb +2 -0
- data/decidim.gemspec +3 -1
- data/docker-compose.yml +24 -0
- data/lib/decidim.rb +8 -0
- data/lib/generators/decidim/app_builder.rb +1 -1
- data/lib/generators/decidim/app_generator.rb +35 -4
- data/lib/generators/decidim/install_generator.rb +121 -0
- data/lib/generators/decidim/templates/Dockerfile.erb +26 -0
- data/lib/generators/decidim/templates/Gemfile.erb +8 -1
- data/lib/generators/decidim/templates/README.md.erb +26 -0
- data/lib/generators/decidim/templates/app.json.erb +13 -0
- data/lib/generators/decidim/templates/cable.yml.erb +9 -0
- data/lib/generators/decidim/templates/database.yml.erb +85 -0
- data/lib/generators/decidim/templates/docker-compose.yml.erb +28 -0
- data/lib/generators/decidim/templates/initializer.rb +4 -0
- data/lib/generators/decidim/templates/secrets.yml.erb +30 -0
- data/run_ci.sh +7 -0
- metadata +183 -8
- data/circle.yml +0 -19
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Decidim
|
3
|
+
module System
|
4
|
+
# A form object used to create organizations from the system dashboard.
|
5
|
+
#
|
6
|
+
class AdminForm < Rectify::Form
|
7
|
+
mimic :admin
|
8
|
+
|
9
|
+
attribute :email, String
|
10
|
+
attribute :password, String
|
11
|
+
attribute :password_confirmation, String
|
12
|
+
|
13
|
+
validates :email, presence: true
|
14
|
+
validates :password, presence: true, unless: :admin_exists?
|
15
|
+
validates :password_confirmation, presence: true, unless: :admin_exists?
|
16
|
+
|
17
|
+
validate :email, :email_uniqueness
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def email_uniqueness
|
22
|
+
return unless Admin.where(email: email).where.not(id: id).any?
|
23
|
+
|
24
|
+
errors.add(:email, I18n.t("models.admin.validations.email_uniqueness",
|
25
|
+
scope: "decidim.system"))
|
26
|
+
end
|
27
|
+
|
28
|
+
def admin_exists?
|
29
|
+
id.present?
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "decidim/translatable_attributes"
|
3
|
+
|
4
|
+
module Decidim
|
5
|
+
module System
|
6
|
+
# A form object used to create organizations from the system dashboard.
|
7
|
+
#
|
8
|
+
class RegisterOrganizationForm < UpdateOrganizationForm
|
9
|
+
include TranslatableAttributes
|
10
|
+
|
11
|
+
mimic :organization
|
12
|
+
|
13
|
+
attribute :organization_admin_email, String
|
14
|
+
|
15
|
+
validates :organization_admin_email, presence: true
|
16
|
+
|
17
|
+
translatable_attribute :description, String
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "decidim/translatable_attributes"
|
3
|
+
|
4
|
+
module Decidim
|
5
|
+
module System
|
6
|
+
# A form object used to update organizations from the system dashboard.
|
7
|
+
#
|
8
|
+
class UpdateOrganizationForm < Rectify::Form
|
9
|
+
include TranslatableAttributes
|
10
|
+
|
11
|
+
mimic :organization
|
12
|
+
|
13
|
+
attribute :name, String
|
14
|
+
attribute :host, String
|
15
|
+
|
16
|
+
translatable_attribute :description, String
|
17
|
+
|
18
|
+
validate :validate_organization_uniqueness
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def validate_organization_uniqueness
|
23
|
+
errors.add(:name, :taken) if Decidim::Organization.where(name: name).where.not(id: id).exists?
|
24
|
+
errors.add(:host, :taken) if Decidim::Organization.where(host: host).where.not(id: id).exists?
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Decidim
|
3
|
+
module System
|
4
|
+
# Admins are the users in charge of managing a Decidim installation.
|
5
|
+
class Admin < ApplicationRecord
|
6
|
+
devise :database_authenticatable, :recoverable, :rememberable, :validatable
|
7
|
+
|
8
|
+
validates :email, uniqueness: true
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
# Changes default Devise behaviour to use ActiveJob to send async emails.
|
13
|
+
def send_devise_notification(notification, *args)
|
14
|
+
devise_mailer.send(notification, self, *args).deliver_later
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<% content_for :title do %>
|
2
|
+
<h2><%= t ".title" %></h2>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<div class="actions title">
|
6
|
+
<%= link_to t("actions.new", scope: "decidim.system", name: t("models.admin.name", scope: "decidim.system")), ['new', 'admin'], class: 'new' %>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<table class="stack">
|
10
|
+
<thead>
|
11
|
+
<tr>
|
12
|
+
<th><%= t("models.admin.fields.email", scope: "decidim.system") %></th>
|
13
|
+
<th><%= t("models.admin.fields.created_at", scope: "decidim.system") %></th>
|
14
|
+
<th class="actions"><%= t("actions.title", scope: "decidim.system") %></th>
|
15
|
+
</tr>
|
16
|
+
</thead>
|
17
|
+
<tbody>
|
18
|
+
<% @admins.each do |admin| %>
|
19
|
+
<tr>
|
20
|
+
<td>
|
21
|
+
<%= link_to admin.email, admin %><br />
|
22
|
+
</td>
|
23
|
+
<td>
|
24
|
+
<%= l admin.created_at, format: :short %>
|
25
|
+
</td>
|
26
|
+
<td class="actions">
|
27
|
+
<%= link_to t("actions.edit", scope: "decidim.system"), ['edit', admin] %>
|
28
|
+
<%= link_to t("actions.destroy", scope: "decidim.system"), admin, method: :delete, class: "small alert button", data: { confirm: t("actions.confirm_destroy", scope: "decidim.system") } %>
|
29
|
+
</td>
|
30
|
+
</tr>
|
31
|
+
<% end %>
|
32
|
+
</tbody>
|
33
|
+
</table>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<% content_for :title do %>
|
2
|
+
<h2><%= link_to @admin.email, @admin %></h2>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<div class="actions">
|
6
|
+
<hr />
|
7
|
+
<%= link_to "Edit", ['edit', @admin] %>
|
8
|
+
<%= link_to "Destroy", @admin, method: :delete, class: "alert button", data: { confirm: "Are you sure you want to do this?" } %>
|
9
|
+
</div>
|
data/decidim-system/app/views/decidim/system/devise/mailers/reset_password_instructions.html.erb
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<p>Hello <%= @resource.email %>!</p>
|
2
|
+
|
3
|
+
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
|
4
|
+
|
5
|
+
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
|
6
|
+
|
7
|
+
<p>If you didn't request this, please ignore this email.</p>
|
8
|
+
<p>Your password won't change until you access the link above and create a new one.</p>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<h2>Change your password</h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
|
4
|
+
<%= devise_error_messages! %>
|
5
|
+
<%= f.hidden_field :reset_password_token %>
|
6
|
+
|
7
|
+
<div class="field">
|
8
|
+
<% if @minimum_password_length %>
|
9
|
+
<em>(<%= @minimum_password_length %> characters minimum)</em><br />
|
10
|
+
<% end %>
|
11
|
+
<%= f.password_field :password, autofocus: true, autocomplete: "off" %>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<div class="field">
|
15
|
+
<%= f.password_field :password_confirmation, autocomplete: "off" %>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div class="actions">
|
19
|
+
<%= f.submit "Change my password" %>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
22
|
+
|
23
|
+
<%= render "decidim/system/devise/shared/links" %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<h2>Forgot your password?</h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
|
4
|
+
<%= devise_error_messages! %>
|
5
|
+
|
6
|
+
<div class="field">
|
7
|
+
<%= f.email_field :email, autofocus: true %>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="actions">
|
11
|
+
<%= f.submit "Send me reset password instructions" %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<%= render "decidim/system/devise/shared/links" %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<h2>Log in</h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
|
4
|
+
<div class="field">
|
5
|
+
<%= f.email_field :email, autofocus: true %>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<div class="field">
|
9
|
+
<%= f.password_field :password, autocomplete: "off" %>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<% if devise_mapping.rememberable? -%>
|
13
|
+
<div class="field">
|
14
|
+
<%= f.check_box :remember_me %>
|
15
|
+
</div>
|
16
|
+
<% end -%>
|
17
|
+
|
18
|
+
<div class="actions">
|
19
|
+
<%= f.submit "Log in" %>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
22
|
+
|
23
|
+
<%= render "decidim/system/devise/shared/links" %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%- if controller_name != 'sessions' %>
|
2
|
+
<%= link_to "Log in", new_session_path(resource_name) %><br />
|
3
|
+
<% end -%>
|
4
|
+
|
5
|
+
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
6
|
+
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
|
7
|
+
<% end -%>
|
8
|
+
|
9
|
+
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
|
10
|
+
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
|
11
|
+
<% end -%>
|
12
|
+
|
13
|
+
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
14
|
+
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
|
15
|
+
<% end -%>
|
16
|
+
|
17
|
+
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
18
|
+
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
|
19
|
+
<% end -%>
|
20
|
+
|
21
|
+
<%- if devise_mapping.omniauthable? %>
|
22
|
+
<%- resource_class.omniauth_providers.each do |provider| %>
|
23
|
+
<%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider) %><br />
|
24
|
+
<% end -%>
|
25
|
+
<% end -%>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<%= form_for(@form) do |f| %>
|
2
|
+
<div class="field">
|
3
|
+
<%= f.text_field :name, autofocus: true %>
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<div class="field">
|
7
|
+
<%= f.text_field :host %>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="field">
|
11
|
+
<%= f.translated :text_area, :description %>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<div class="actions">
|
15
|
+
<%= f.submit t("decidim.system.actions.save") %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<% content_for :title do %>
|
2
|
+
<h2><%= t ".title" %></h2>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<div class="actions title">
|
6
|
+
<%= link_to t("actions.new", scope: "decidim.system", name: t("models.organization.name", scope: "decidim.system")), ['new', 'organization'], class: 'new' %>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<table class="stack">
|
10
|
+
<thead>
|
11
|
+
<tr>
|
12
|
+
<th><%= t("models.organization.fields.name", scope: "decidim.system") %></th>
|
13
|
+
<th><%= t("models.organization.fields.created_at", scope: "decidim.system") %></th>
|
14
|
+
<th class="actions"><%= t("actions.title", scope: "decidim.system") %></th>
|
15
|
+
</tr>
|
16
|
+
</thead>
|
17
|
+
<tbody>
|
18
|
+
<% @organizations.each do |organization| %>
|
19
|
+
<tr>
|
20
|
+
<td>
|
21
|
+
<%= link_to organization.name, organization %><br />
|
22
|
+
<%= organization.host %>
|
23
|
+
</td>
|
24
|
+
<td>
|
25
|
+
<%= l organization.created_at, format: :short %>
|
26
|
+
</td>
|
27
|
+
<td class="actions">
|
28
|
+
<%= link_to t("actions.edit", scope: "decidim.system"), ['edit', organization] %>
|
29
|
+
<%= link_to t("actions.destroy", scope: "decidim.system"), organization, method: :delete, class: "small alert button", data: { confirm: t("actions.confirm_destroy", scope: "decidim.system") } %>
|
30
|
+
</td>
|
31
|
+
</tr>
|
32
|
+
<% end %>
|
33
|
+
</tbody>
|
34
|
+
</table>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<% content_for :title do %>
|
2
|
+
<h2><%= t ".title" %></h2>
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<%= form_for(@form) do |f| %>
|
6
|
+
<div class="field">
|
7
|
+
<%= f.text_field :name, autofocus: true %>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="field">
|
11
|
+
<%= f.text_field :host %>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<div class="field">
|
15
|
+
<%= f.translated :text_area, :description %>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<div class="field">
|
19
|
+
<%= f.email_field :organization_admin_email %>
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<div class="actions">
|
23
|
+
<%= f.submit t("decidim.system.models.organization.actions.save_and_invite") %>
|
24
|
+
</div>
|
25
|
+
<% end %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% content_for :title do %>
|
2
|
+
<h2><%= link_to @organization.name, @organization %></h2>
|
3
|
+
<h3 class="subheader"><%= @organization.host %></h3>
|
4
|
+
<p><%= translated_attribute @organization.description %></p>
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<div class="actions">
|
8
|
+
<hr />
|
9
|
+
<%= link_to t("decidim.system.actions.edit"), ['edit', @organization] %>
|
10
|
+
<%= link_to t("decidim.system.actions.destroy"), @organization, method: :delete, class: "alert button", data: { confirm: t("decidim.system.actions.confirm_destroy") } %>
|
11
|
+
</div>
|