itsf_backend 4.0.1 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 94b8e68b7534779006c7efef17f7c4a0bad73d5a
4
- data.tar.gz: 07d612fba03a8d9468d81b7b10340d847493e4fe
3
+ metadata.gz: 459376130952b2a2e65c3f3654cc7573f6cdf65b
4
+ data.tar.gz: d610d0c8aa27a7c3eca872b8aeb2a8a653ccdc91
5
5
  SHA512:
6
- metadata.gz: 5d458482ff907892c59a67594bad8cffd9d70738b16c13c13edba09cc0cc16a78b2b2aa1c04882622231fd9e8e288aa622bd232a34792c9032520a7f375bfd5d
7
- data.tar.gz: 5003c6a306f2e86ce2f1ab7193c0b0bae7d184b250804e6a6e744666b414cdabe388b6ff797d3bde232480a89208e8174e148856fbcf5f0aa30d6c5b32359bab
6
+ metadata.gz: 7b93ea0234bf938c7698b114365e301ccf42bc9a5323fbd28c80b869e55a739226e9eb3760965f76c3e75bedcd58b1c277a7de51bcdf9cb910da6839bd51ce6d
7
+ data.tar.gz: 2adb3fbe618e5fbe6a3cb843cf737b7fb7170eec2e322be6248a9e1faf3759b196ec797bf84593c1ceb88976577275eb58694523741a730a95596c1971a8096e
@@ -0,0 +1,44 @@
1
+ module Controller
2
+ module BreadcrumbsConcern
3
+ extend ActiveSupport::Concern
4
+
5
+ included do
6
+ helper_method :breadcrumbs
7
+ end
8
+
9
+ def breadcrumbs
10
+ @breadcrumbs ||= breadcrumbs!
11
+ end
12
+
13
+ def breadcrumbs!
14
+ [].tap do |breadcrumbs|
15
+ breadcrumbs << { label: t('controller.breadcrumbs_concern.home'), url: send("itsf_backend_#{I18n.locale}").root_path, link_html_options: {}, li_html_options: {}}
16
+
17
+ if respond_to?(:current_engine, true) && current_engine.present?
18
+ breadcrumbs << { label: t("classes.#{current_engine.name.underscore}"), url: send("#{current_engine.engine_name}_#{I18n.locale}").root_path, link_html_options: {}, li_html_options: {} }
19
+ end
20
+
21
+ if respond_to?(:resource_class, true)
22
+ breadcrumbs << { label: resource_class.model_name.human(count: :other), url: url_for(action: :index), link_html_options: {}, li_html_options: {} }
23
+ end
24
+ if @resource.present? && @resource.persisted?
25
+ breadcrumbs << { label: @resource.try_all(*Itsf::Backend.resource_title_methods), url: url_for(@resource), link_html_options: {}, li_html_options: {} }
26
+ end
27
+
28
+ if respond_to?(:service_class, true)
29
+ breadcrumbs << { label: t("classes.#{service_class.name.underscore}"), url: url_for(action: :index), link_html_options: {}, li_html_options: {} }
30
+ end
31
+
32
+ if %w(new create edit update invoke call).include?(action_name)
33
+ breadcrumbs << { label: t("controller.breadcrumbs_concern.#{action_name}"), url: '#', link_html_options: {}, li_html_options: {} }
34
+ end
35
+
36
+ if params[:page].present?
37
+ breadcrumbs << { label: t('controller.breadcrumbs_concern.page', page_number: params[:page]), url: '#', link_html_options: {}, li_html_options: {} }
38
+ end
39
+
40
+ breadcrumbs.last[:li_html_options][:class] = 'active'
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,27 @@
1
+ module Controller
2
+ module CurrentEngineConcern
3
+ extend ActiveSupport::Concern
4
+
5
+ included do
6
+ helper_method :current_engine
7
+ end
8
+
9
+ private
10
+
11
+ def current_engine
12
+ if respond_to?(:engine)
13
+ return engine
14
+ end
15
+ if respond_to?(:resource_class)
16
+ registered_items = Itsf::Backend.backend_engines.collect { |e| e.name.gsub!('::Engine', '').constantize }.each_with_object({}) { |e, memo| memo[e] = e.registered_controllers.call }
17
+ end
18
+ if respond_to?(:service_class)
19
+ registered_items = Itsf::Backend.backend_engines.collect { |e| e.name.gsub!('::Engine', '').constantize }.each_with_object({}) { |e, memo| memo[e] = e.registered_services.call }
20
+ end
21
+ if registered_items.present?
22
+ engine_namespace = registered_items.find { |key, values| values.include?(self.class) }.first
23
+ "#{engine_namespace}::Engine".constantize
24
+ end
25
+ end
26
+ end
27
+ end
@@ -3,6 +3,8 @@ module Itsf::Backend
3
3
  helper Itsf::Backend::ApplicationHelper
4
4
  helper Itsf::Backend::BootstrapHelper
5
5
  helper MultiClientHelper if Itsf::Backend.features?(:multi_client)
6
+ include Controller::CurrentEngineConcern
7
+ include Controller::BreadcrumbsConcern
6
8
 
7
9
  layout 'itsf/backend/base'
8
10
 
@@ -3,6 +3,8 @@ module Itsf::Backend
3
3
  helper Itsf::Backend::ApplicationHelper
4
4
  helper Itsf::Backend::BootstrapHelper
5
5
  helper MultiClientHelper if Itsf::Backend.features?(:multi_client)
6
+ include Controller::CurrentEngineConcern
7
+ include Controller::BreadcrumbsConcern
6
8
 
7
9
  def index
8
10
  end
@@ -20,6 +20,8 @@ module Itsf::Backend
20
20
  include Controller::FeatureFlagsConcern
21
21
  include Controller::ResourceLinksConcern
22
22
  include Controller::CollectionLinksConcern
23
+ include Controller::CurrentEngineConcern
24
+ include Controller::BreadcrumbsConcern
23
25
  helper Itsf::Backend::ApplicationHelper
24
26
  helper Itsf::Backend::BootstrapHelper
25
27
  helper MultiClientHelper if Itsf::Backend.features?(:multi_client)
@@ -14,6 +14,9 @@ module Itsf::Backend
14
14
  include Controller::ServiceActionsConcern
15
15
  include Controller::JsonApiConcern
16
16
  include Controller::FeatureFlagsConcern
17
+ include Controller::CurrentEngineConcern
18
+ include Controller::BreadcrumbsConcern
19
+
17
20
  helper Itsf::Backend::ApplicationHelper
18
21
  helper Itsf::Backend::BootstrapHelper
19
22
 
@@ -1,7 +1,9 @@
1
- #page-title.bottom-margin-1
1
+ .row
2
2
  .col-lg-12
3
- %h3= t('.title')
3
+ #page-title.bottom-margin-1
4
+ %h1= t('.title')
4
5
 
5
- - Itsf::Backend::Configuration.backend_engines.each do |engine|
6
- - if !Itsf::Backend.features?(:pundit) || engine_policy(engine).access?
7
- .col-lg-6= render 'dashboard_panel', engine: engine
6
+ .row
7
+ - Itsf::Backend::Configuration.backend_engines.each do |engine|
8
+ - if !Itsf::Backend.features?(:pundit) || engine_policy(engine).access?
9
+ .col-lg-6= render 'dashboard_panel', engine: engine
@@ -0,0 +1,3 @@
1
+ %ol.breadcrumb
2
+ - breadcrumbs.each do |b|
3
+ %li{ b[:li_html_options] }= link_to(b[:label], b[:url], b[:link_html_options])
@@ -37,6 +37,9 @@
37
37
  = render 'layouts/itsf/backend/vertical_navigation'
38
38
  .col-md-9.col-lg-10
39
39
  .container-fluid
40
+ .row
41
+ .col-lg-12
42
+ #breadcrumbs= render 'layouts/itsf/backend/breadcrumbs'
40
43
  .row
41
44
  .col-lg-12
42
45
  = bootstrap_flash
@@ -24,6 +24,16 @@ de:
24
24
  remove: "Entfernen"
25
25
  confirmations:
26
26
  delete: "Sind Sie sicher?"
27
+ controller:
28
+ breadcrumbs_concern:
29
+ call: 'Ausführen'
30
+ create: 'Anlegen'
31
+ edit: 'Bearbeiten'
32
+ update: 'Bearbeiten'
33
+ home: 'Backend'
34
+ invoke: 'Ausführen'
35
+ new: 'Anlegen'
36
+ page: 'Seite %{page_number'
27
37
  classes:
28
38
  i18n: 'Sprache'
29
39
  flash:
@@ -7,6 +7,8 @@ en:
7
7
  acts_as_list:
8
8
  inserted_after: "Inserted %{inserted_resource} after %{target_resource}"
9
9
  inserted_before: "Inserted %{inserted_resource} before %{target_resource}"
10
+ awesome_nested_set:
11
+ inserted_after: "Inserted %{inserted_resource} after %{target_resource}"
10
12
  attributes:
11
13
  actions: 'Actions'
12
14
  acts_as_list_actions: 'List'
@@ -22,6 +24,16 @@ en:
22
24
  remove: "Remove"
23
25
  confirmations:
24
26
  delete: "Are you sure?"
27
+ controller:
28
+ breadcrumbs_concern:
29
+ call: 'Execute'
30
+ create: 'New'
31
+ edit: 'Edit'
32
+ home: 'Backend'
33
+ invoke: 'Exectute'
34
+ new: 'New'
35
+ page: 'Page %{page_number'
36
+ update: 'Edit'
25
37
  classes:
26
38
  i18n: 'Language'
27
39
  flash:
@@ -1,5 +1,5 @@
1
1
  module Itsf
2
2
  module Backend
3
- VERSION = '4.0.1'
3
+ VERSION = '4.2.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itsf_backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-23 00:00:00.000000000 Z
11
+ date: 2017-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -490,7 +490,9 @@ files:
490
490
  - app/controllers/concerns/controller/acts_as_list_concern.rb
491
491
  - app/controllers/concerns/controller/acts_as_published_concern.rb
492
492
  - app/controllers/concerns/controller/awesome_nested_set_concern.rb
493
+ - app/controllers/concerns/controller/breadcrumbs_concern.rb
493
494
  - app/controllers/concerns/controller/collection_links_concern.rb
495
+ - app/controllers/concerns/controller/current_engine_concern.rb
494
496
  - app/controllers/concerns/controller/feature_flags_concern.rb
495
497
  - app/controllers/concerns/controller/friendly_id_concern.rb
496
498
  - app/controllers/concerns/controller/pagination_concern.rb
@@ -568,6 +570,7 @@ files:
568
570
  - app/views/itsf/backend/service/base/invoke.html.haml
569
571
  - app/views/itsf/backend/service/base/success.html.haml
570
572
  - app/views/layouts/itsf/backend/_auxiliary_navigation.haml
573
+ - app/views/layouts/itsf/backend/_breadcrumbs.html.haml
571
574
  - app/views/layouts/itsf/backend/_engine_navigation.html.haml
572
575
  - app/views/layouts/itsf/backend/_engine_navigation_drop_down.html.haml
573
576
  - app/views/layouts/itsf/backend/_footer.html.haml
@@ -3206,7 +3209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
3206
3209
  version: '0'
3207
3210
  requirements: []
3208
3211
  rubyforge_project:
3209
- rubygems_version: 2.6.11
3212
+ rubygems_version: 2.5.1
3210
3213
  signing_key:
3211
3214
  specification_version: 4
3212
3215
  summary: ITSF Backend Module.