releaf-core 1.1.6 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/lib/releaf/action_controller/breadcrumbs.rb +2 -1
- data/lib/generators/dummy/templates/builders/admin/banners/show_builder.rb +7 -0
- data/lib/generators/dummy/templates/config/routes.rb +1 -0
- data/lib/generators/dummy/templates/controllers/admin/banners_controller.rb +5 -0
- data/lib/generators/dummy/templates/initializers/releaf.rb +1 -1
- data/lib/generators/dummy/templates/models/banner.rb +4 -0
- data/lib/generators/dummy/templates/views/admin/banners/_content.html.haml +1 -0
- data/spec/features/breadcrumbs_spec.rb +16 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91ffbe0b73a1a02298214cf8931dddeb78400590
|
4
|
+
data.tar.gz: b1f1e9bc4b5665332037ece716ae92e4cac4e1b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0875ef365a71397578fd57284cce935ff3a722497e7e9b7b7cd60157327a71091ab36f29b30eb47b893f33c09472f332c70f9702c939f4aaa3164e7c13dc13f
|
7
|
+
data.tar.gz: 3af0badbca5d5b8411e4fc2c61d2295c5bed0e2f4b89aaa7f4947f261a428d3e3bffa0d2c7247693d5514c9378aec8a150a7940db8876cc557e125d3a3dea414
|
@@ -18,8 +18,9 @@ module Releaf::ActionController::Breadcrumbs
|
|
18
18
|
name= I18n.t('New record', scope: 'admin.breadcrumbs')
|
19
19
|
url = url_for(action: :new, only_path: true) if url.nil?
|
20
20
|
else
|
21
|
+
url_action = feature_available?(:show) ? :show : :edit
|
21
22
|
name = Releaf::ResourceBase.title(resource)
|
22
|
-
url = url_for(action:
|
23
|
+
url = url_for(action: url_action, id: resource.id, only_path: true) if url.nil?
|
23
24
|
end
|
24
25
|
@breadcrumbs << { name: name, url: url }
|
25
26
|
end
|
@@ -4,7 +4,7 @@ Releaf.application.configure do
|
|
4
4
|
### setup menu items and therefore available controllers
|
5
5
|
config.menu = [
|
6
6
|
"admin/nodes",
|
7
|
-
{name: "inventory", items: %w[admin/books admin/authors admin/publishers]},
|
7
|
+
{name: "inventory", items: %w[admin/books admin/authors admin/publishers admin/banners]},
|
8
8
|
{name: "permissions", items: %w[releaf/permissions/users releaf/permissions/roles]},
|
9
9
|
"releaf/settings",
|
10
10
|
"releaf/i18n_database/translations"
|
@@ -0,0 +1 @@
|
|
1
|
+
= link_to "Releaf external url", @resource.url
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
feature "Breadcrumbs", js: true do
|
3
|
+
background do
|
4
|
+
auth_as_user
|
5
|
+
end
|
6
|
+
|
7
|
+
scenario "Open show view with link to resource show in breadcrumbs" do
|
8
|
+
banner = Banner.create(url: "https://google.com")
|
9
|
+
visit admin_banner_path(banner)
|
10
|
+
|
11
|
+
within ".breadcrumbs" do
|
12
|
+
expect(page).to have_css("li:last-child", text: "https://google.com")
|
13
|
+
expect(page).to have_link("https://google.com", href: admin_banner_path(banner))
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: releaf-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CubeSystems
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -445,12 +445,14 @@ files:
|
|
445
445
|
- lib/generators/dummy/templates/assets/javascripts/controllers/admin/other_site/other_nodes.js
|
446
446
|
- lib/generators/dummy/templates/assets/stylesheets/controllers/admin/nodes.scss
|
447
447
|
- lib/generators/dummy/templates/assets/stylesheets/controllers/admin/other_site/other_nodes.scss
|
448
|
+
- lib/generators/dummy/templates/builders/admin/banners/show_builder.rb
|
448
449
|
- lib/generators/dummy/templates/builders/admin/books/form_builder.rb
|
449
450
|
- lib/generators/dummy/templates/builders/admin/books/index_builder.rb
|
450
451
|
- lib/generators/dummy/templates/builders/admin/books/table_builder.rb
|
451
452
|
- lib/generators/dummy/templates/builders/admin/nodes/form_builder.rb
|
452
453
|
- lib/generators/dummy/templates/config/routes.rb
|
453
454
|
- lib/generators/dummy/templates/controllers/admin/authors_controller.rb
|
455
|
+
- lib/generators/dummy/templates/controllers/admin/banners_controller.rb
|
454
456
|
- lib/generators/dummy/templates/controllers/admin/books_controller.rb
|
455
457
|
- lib/generators/dummy/templates/controllers/admin/chapters_controller.rb
|
456
458
|
- lib/generators/dummy/templates/controllers/admin/nodes_controller.rb
|
@@ -488,6 +490,7 @@ files:
|
|
488
490
|
- lib/generators/dummy/templates/models/other_site/other_node.rb
|
489
491
|
- lib/generators/dummy/templates/models/publisher.rb
|
490
492
|
- lib/generators/dummy/templates/models/text_page.rb
|
493
|
+
- lib/generators/dummy/templates/views/admin/banners/_content.html.haml
|
491
494
|
- lib/generators/dummy/templates/views/contacts/show.html.haml
|
492
495
|
- lib/generators/dummy/templates/views/home_pages/show.haml
|
493
496
|
- lib/generators/dummy/templates/views/layouts/application.html.haml
|
@@ -559,6 +562,7 @@ files:
|
|
559
562
|
- spec/ext/array_reorder_spec.rb
|
560
563
|
- spec/features/ajaxbox_spec.rb
|
561
564
|
- spec/features/authorization_spec.rb
|
565
|
+
- spec/features/breadcrumbs_spec.rb
|
562
566
|
- spec/features/dragonfly_integration_spec.rb
|
563
567
|
- spec/features/edit_actions_spec.rb
|
564
568
|
- spec/features/errors_spec.rb
|
@@ -679,6 +683,7 @@ test_files:
|
|
679
683
|
- spec/features/title_spec.rb
|
680
684
|
- spec/features/richtext_embed_spec.rb
|
681
685
|
- spec/features/search_spec.rb
|
686
|
+
- spec/features/breadcrumbs_spec.rb
|
682
687
|
- spec/features/authorization_spec.rb
|
683
688
|
- spec/features/menu_spec.rb
|
684
689
|
- spec/features/ajaxbox_spec.rb
|