decidim-system 0.1.0 → 0.2.0

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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -0
  3. data/app/assets/stylesheets/decidim/system/_sidebar.scss +9 -2
  4. data/app/commands/decidim/system/create_admin.rb +1 -0
  5. data/app/commands/decidim/system/create_default_pages.rb +1 -0
  6. data/app/commands/decidim/system/register_organization.rb +1 -0
  7. data/app/commands/decidim/system/update_admin.rb +1 -0
  8. data/app/commands/decidim/system/update_organization.rb +1 -0
  9. data/app/controllers/decidim/system/admins_controller.rb +1 -0
  10. data/app/controllers/decidim/system/application_controller.rb +3 -0
  11. data/app/controllers/decidim/system/dashboard_controller.rb +1 -0
  12. data/app/controllers/decidim/system/devise/passwords_controller.rb +1 -0
  13. data/app/controllers/decidim/system/devise/sessions_controller.rb +1 -0
  14. data/app/controllers/decidim/system/organizations_controller.rb +1 -0
  15. data/app/forms/decidim/system/admin_form.rb +1 -0
  16. data/app/forms/decidim/system/register_organization_form.rb +1 -0
  17. data/app/forms/decidim/system/update_organization_form.rb +1 -0
  18. data/app/helpers/decidim/system/application_helper.rb +1 -0
  19. data/app/helpers/decidim/system/menu_helper.rb +14 -0
  20. data/app/jobs/decidim/system/application_job.rb +1 -0
  21. data/app/mailers/decidim/system/application_mailer.rb +1 -0
  22. data/app/models/decidim/system/admin.rb +1 -0
  23. data/app/models/decidim/system/application_record.rb +1 -0
  24. data/app/views/layouts/decidim/system/_sidebar.html.erb +1 -5
  25. data/config/i18n-tasks.yml +6 -6
  26. data/config/locales/eu.yml +3 -0
  27. data/config/routes.rb +1 -0
  28. data/db/seeds.rb +1 -0
  29. data/lib/decidim/system.rb +1 -0
  30. data/lib/decidim/system/engine.rb +20 -0
  31. metadata +7 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b0a8098156240f8a15c175512d4243dd8a4909be
4
- data.tar.gz: bff59750de98b406404ba934ef9353d6b0312010
3
+ metadata.gz: 4ebed92d0fcbd3babd63a158cf85d60c7d8de921
4
+ data.tar.gz: 90051e8c3e59e98b76fb9eda79290e832f0c6bde
5
5
  SHA512:
6
- metadata.gz: 7447dde949d9bd526368a18e203e5af69107b9f89b852b1c1003bdcc49654077787764e899d9c589ffa9733935862463848e94a0fd7196b922b91bd69aa913b1
7
- data.tar.gz: 4780c476905b9324d6577e1d2a797409acdecfa685891e87d89d385cde271998ac5c36980e185eff97db4e939f29192888a8ce6c637e44755b3986a27bf15227
6
+ metadata.gz: 15d23f1cdee507abcee4ca68adf392f73ba3f74c6485980ec1fe7999fde3b2dca107d433e5e43a73772df366459492500d0a43a6b230669c4c8c3b84a646504b
7
+ data.tar.gz: ceb3f13d707089ca06e8000ff48fc0bb27cca912d5c38f92d95cc49c632409aee8a19284d60073c51cc11f0e0c8ac8da923f8152807e799581ad3ada00560a2a
data/Rakefile CHANGED
@@ -1,2 +1,3 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "decidim/dev/common_rake"
@@ -31,13 +31,20 @@
31
31
  @include show-for(large);
32
32
  }
33
33
 
34
- .main-menu{
34
+ .main-nav{
35
35
  border-top: 1px solid black;
36
36
  border-bottom: 1px solid black;
37
37
  a{
38
38
  padding: $global-padding;
39
39
  display: block;
40
40
  color: $light-gray;
41
+ }
42
+ ul{
43
+ list-style: none;
44
+ margin-left: 0;
45
+ }
46
+
47
+ li{
41
48
  text-transform: uppercase;
42
49
  font-weight: bold;
43
50
  font-size: 0.9em;
@@ -70,4 +77,4 @@
70
77
  }
71
78
  .sign-out{ @include grid-column(4); }
72
79
  }
73
- }
80
+ }
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  module System
4
5
  # A command with all the business logic when creating a new admin in
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  module System
4
5
  # A command with all the business logic when creating a new organization in
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  module System
4
5
  # A command with all the business logic when creating a new organization in
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  module System
4
5
  # A command with all the business logic when updating an admin in
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  module System
4
5
  # A command with all the business logic when creating a new organization in
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require_dependency "decidim/system/application_controller"
3
4
 
4
5
  module Decidim
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  module System
4
5
  # The main application controller that inherits from Rails.
@@ -10,6 +11,8 @@ module Decidim
10
11
  helper Decidim::TranslationsHelper
11
12
  helper Decidim::DecidimFormHelper
12
13
  helper Decidim::ReplaceButtonsHelper
14
+
15
+ helper Decidim::System::MenuHelper
13
16
  end
14
17
  end
15
18
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require_dependency "decidim/system/application_controller"
3
4
 
4
5
  module Decidim
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  module System
4
5
  module Devise
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  module System
4
5
  module Devise
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require_dependency "decidim/system/application_controller"
3
4
 
4
5
  module Decidim
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  module System
4
5
  # A form object used to create organizations from the system dashboard.
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "decidim/translatable_attributes"
3
4
 
4
5
  module Decidim
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "decidim/translatable_attributes"
3
4
 
4
5
  module Decidim
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  module System
4
5
  # Custom helpers, scoped to the system panel.
@@ -0,0 +1,14 @@
1
+ # encoding: utf-8
2
+ # frozen_string_literal: true
3
+
4
+ module Decidim
5
+ module System
6
+ # This module includes helpers to manage menus in system layout
7
+ module MenuHelper
8
+ # Public: Returns the main menu presenter object
9
+ def main_menu
10
+ @main_menu ||= MenuPresenter.new(:system_menu, self)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  module System
4
5
  # Custom ApplicationJob scoped to the system panel.
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  module System
4
5
  # Custom application mailer, scoped to the system mailer.
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  module System
4
5
  # Admins are the users in charge of managing a Decidim installation.
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Decidim
3
4
  module System
4
5
  # Custom ApplicationRecord scoped to the system panel.
@@ -6,10 +6,6 @@
6
6
  </h1>
7
7
  </div>
8
8
 
9
- <nav class="main-menu">
10
- <%= active_link_to t("menu.dashboard", scope: "decidim.system"), root_path, active: :exact %>
11
- <%= active_link_to t("menu.organizations", scope: "decidim.system"), organizations_path, active: :inclusive %>
12
- <%= active_link_to t("menu.admins", scope: "decidim.system"), admins_path, active: :inclusive %>
13
- </nav>
9
+ <%= main_menu.render %>
14
10
 
15
11
  <%= render partial: 'layouts/decidim/system/login_items' %>
@@ -2,8 +2,7 @@
2
2
 
3
3
  # The "main" locale.
4
4
  base_locale: en
5
- ## All available locales are inferred from the data by default. Alternatively, specify them explicitly:
6
- locales: [en]
5
+
7
6
  ## Reporting locale, default: en. Available: en, ru.
8
7
  # internal_locale: en
9
8
 
@@ -48,9 +47,10 @@ data:
48
47
 
49
48
  # Find translate calls
50
49
  search:
51
- ## Paths or `File.find` patterns to search in:
52
- # paths:
53
- # - app/
50
+ # Paths or `File.find` patterns to search in:
51
+ paths:
52
+ - app/
53
+ - lib/
54
54
 
55
55
  ## Root directories for relative keys resolution.
56
56
  # relative_roots:
@@ -71,7 +71,7 @@ search:
71
71
  # only: ["*.rb", "*.html.slim"]
72
72
 
73
73
  ## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`.
74
- # strict: true
74
+ strict: false
75
75
 
76
76
  ## Multiple scanners can be used. Their results are merged.
77
77
  ## The options specified above are passed down to each scanner. Per-scanner options can be specified as well.
@@ -5,6 +5,7 @@ eu:
5
5
  confirm_destroy: Ziur hau ezabatu nahi duzula?
6
6
  destroy: Ezabatu
7
7
  edit: Editatu
8
+ new: Berria
8
9
  save: Gorde
9
10
  title: Ekintzak
10
11
  admins:
@@ -15,9 +16,11 @@ eu:
15
16
  success: Administratzailea zuzen sortu da
16
17
  edit:
17
18
  title: Editatu administratzailea
19
+ update: Eguneratu
18
20
  index:
19
21
  title: Administratzaileak
20
22
  new:
23
+ create: Sortu
21
24
  title: Administratzaile berria
22
25
  update:
23
26
  error: Errorea gertatu da administratzaile hau eguneratzean.
data/config/routes.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  Decidim::System::Engine.routes.draw do
3
4
  devise_for :admins,
4
5
  class_name: "Decidim::System::Admin",
data/db/seeds.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  if !Rails.env.production? || ENV["SEED"]
3
4
  Decidim::System::Admin.create!(
4
5
  email: "system@example.org",
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "decidim/system/engine"
3
4
 
4
5
  module Decidim
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require "rails"
3
4
  require "active_support/all"
4
5
 
@@ -27,6 +28,25 @@ module Decidim
27
28
  initializer "decidim_system.assets" do |app|
28
29
  app.config.assets.precompile += %w(decidim_system_manifest.js)
29
30
  end
31
+
32
+ initializer "decidim_system.menu" do
33
+ Decidim.menu :system_menu do |menu|
34
+ menu.item I18n.t("menu.dashboard", scope: "decidim.system"),
35
+ decidim_system.root_path,
36
+ position: 1,
37
+ active: ["decidim/system/dashboard" => :show]
38
+
39
+ menu.item I18n.t("menu.organizations", scope: "decidim.system"),
40
+ decidim_system.organizations_path,
41
+ position: 2,
42
+ active: :inclusive
43
+
44
+ menu.item I18n.t("menu.admins", scope: "decidim.system"),
45
+ decidim_system.admins_path,
46
+ position: 3,
47
+ active: :inclusive
48
+ end
49
+ end
30
50
  end
31
51
  end
32
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-system
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-05-18 00:00:00.000000000 Z
13
+ date: 2017-06-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: decidim-core
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.1.0
21
+ version: 0.2.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 0.1.0
28
+ version: 0.2.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: rails
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -158,14 +158,14 @@ dependencies:
158
158
  requirements:
159
159
  - - '='
160
160
  - !ruby/object:Gem::Version
161
- version: 0.1.0
161
+ version: 0.2.0
162
162
  type: :development
163
163
  prerelease: false
164
164
  version_requirements: !ruby/object:Gem::Requirement
165
165
  requirements:
166
166
  - - '='
167
167
  - !ruby/object:Gem::Version
168
- version: 0.1.0
168
+ version: 0.2.0
169
169
  description: System administration to create new organization in an installation.
170
170
  email:
171
171
  - josepjaume@gmail.com
@@ -202,6 +202,7 @@ files:
202
202
  - app/forms/decidim/system/register_organization_form.rb
203
203
  - app/forms/decidim/system/update_organization_form.rb
204
204
  - app/helpers/decidim/system/application_helper.rb
205
+ - app/helpers/decidim/system/menu_helper.rb
205
206
  - app/jobs/decidim/system/application_job.rb
206
207
  - app/mailers/decidim/system/application_mailer.rb
207
208
  - app/models/decidim/system/admin.rb