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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 090d46001ef8c3b9fd70811fd9344c5acf3df0fb
4
- data.tar.gz: d1feb7ed9deb35053e4d454d200b8554c51ca3de
3
+ metadata.gz: 91ffbe0b73a1a02298214cf8931dddeb78400590
4
+ data.tar.gz: b1f1e9bc4b5665332037ece716ae92e4cac4e1b0
5
5
  SHA512:
6
- metadata.gz: 3db92f822f185bec194e763021e107a37b816d9a94a2e9210d68de37c52cc7f3ee6a6395394909390700d4472e3d31fe368453fc64a8474ccf75d0f765dee9d9
7
- data.tar.gz: 64da88ea122b6093de68a6f9137182db0caff360c7cda184b67903a4244e3c5e4e06f2bc74e67e537ca53e4cf00c2b2948a4e737c63f0a1a4bdd60e697e95565
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: :edit, id: resource.id, only_path: true) if url.nil?
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
@@ -0,0 +1,7 @@
1
+ module Admin::Banners
2
+ class ShowBuilder < Releaf::Builders::ShowBuilder
3
+ def section_body
4
+ render "content"
5
+ end
6
+ end
7
+ end
@@ -2,6 +2,7 @@ Dummy::Application.routes.draw do
2
2
 
3
3
  mount_releaf_at '/admin' do
4
4
  releaf_resources :books, :authors, :chapters, :publishers
5
+ releaf_resources :banners, only: [:index, :show]
5
6
  end
6
7
 
7
8
  # SINGLE NODE CLASS CASE:
@@ -0,0 +1,5 @@
1
+ class Admin::BannersController < Releaf::ActionController
2
+ def features
3
+ [:index, :show]
4
+ end
5
+ 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"
@@ -2,4 +2,8 @@ class Banner < ActiveRecord::Base
2
2
  dragonfly_accessor :image
3
3
  validates_presence_of :url
4
4
  belongs_to :banner_group
5
+
6
+ def releaf_title
7
+ url
8
+ end
5
9
  end
@@ -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.6
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-08-31 00:00:00.000000000 Z
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