blacklight-spotlight 3.0.0.alpha.7 → 3.0.0.alpha.8

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
  SHA256:
3
- metadata.gz: 61d1cc793dd74339242e08e5a0c66ba33ebde6736f25423fa6315bc52ae7fcbf
4
- data.tar.gz: 00a54261d57877c5610e244851d82d32b0700c01cb919af5d2ac17481d5e7de9
3
+ metadata.gz: eee784e93eaeb64d3b581a84b8969f67ef1365fcb244845541cce3db8743a44d
4
+ data.tar.gz: 72cc1075f6bf87b3f0ec675d71484ea0f664181d36fe55978878890627d8f264
5
5
  SHA512:
6
- metadata.gz: 50cba1c7d20e658be91c54ff2c56f9c296b9b521df5d1054e202d6eba74d6f3dbd67dfeec7701e4061e2db0f26e66e0241e3494adea2002280ad68a787a06d2b
7
- data.tar.gz: cd32bcc19cfa68295fcc40b2969e47a0623dbe750e3bcb4e3d2fb86b3825f7897a10da3ba87fd4ef3b5f855bb1f7ce875fbca16c12087a53456ca40120a4f0e3
6
+ metadata.gz: 99dd649874596c8b56267f9757fd4c56a05768289c52545b698932dbd8756c498b280f969602b2578afb31e13c5a26856379a573ea4b4fb5dc7d938f18199b19
7
+ data.tar.gz: 2477bf2480ec591974433df8bb7a48c58c51ca2961ddfbee954fe3ca5a4a82244cfcd9efbd784a046d8c86b90df9c1078ebc77cef04422e1d77eb66c91f4871e
@@ -10,7 +10,10 @@ module Spotlight
10
10
 
11
11
  load_and_authorize_resource :site, class: 'Spotlight::Site'
12
12
 
13
- def index; end
13
+ def index
14
+ add_breadcrumb t(:'spotlight.sites.home'), root_url
15
+ add_breadcrumb t(:'spotlight.admin_users.index.page_title')
16
+ end
14
17
 
15
18
  def create
16
19
  if update_roles
@@ -22,6 +22,8 @@ module Spotlight
22
22
 
23
23
  def new
24
24
  build_initial_exhibit_contact_emails
25
+ add_breadcrumb t(:'spotlight.sites.home'), root_url
26
+ add_breadcrumb t(:'spotlight.exhibits.new.page_title')
25
27
  end
26
28
 
27
29
  def process_import
@@ -8,9 +8,15 @@ module Spotlight
8
8
  before_action :load_site
9
9
  load_and_authorize_resource
10
10
 
11
- def edit; end
11
+ def edit
12
+ add_breadcrumb t(:'spotlight.sites.home'), root_url
13
+ add_breadcrumb t(:'spotlight.sites.edit.page_title')
14
+ end
12
15
 
13
- def edit_exhibits; end
16
+ def edit_exhibits
17
+ add_breadcrumb t(:'spotlight.sites.home'), root_url
18
+ add_breadcrumb t(:'spotlight.sites.edit_exhibits.page_title')
19
+ end
14
20
 
15
21
  def update
16
22
  if @site.update(site_params)
@@ -13,8 +13,18 @@ module Spotlight
13
13
  end
14
14
 
15
15
  def page_title(section, title = nil)
16
- set_html_page_title(t(:'spotlight.html_admin_title', section: section, title: title || t(:'.title', default: :'.header')))
17
- content_tag(:h1, safe_join([section, content_tag(:small, title || t(:'.header'))], "\n"), class: 'page-header')
16
+ title ||= t(:'.header', default: '').presence
17
+
18
+ head_content = t(:'spotlight.html_admin_title', section: section, title: title) if section && title
19
+ head_content ||= section || title
20
+ set_html_page_title(head_content)
21
+
22
+ html_content = safe_join([
23
+ (section if section.present?),
24
+ (content_tag(:small, title) if title.present?)
25
+ ].compact, "\n")
26
+
27
+ content_tag(:h1, html_content, class: 'page-header')
18
28
  end
19
29
 
20
30
  # rubocop:disable Naming/AccessorMethodName
@@ -14,6 +14,6 @@
14
14
  </ul>
15
15
 
16
16
  <ul class="nav sidenav nav-pills nav-stacked">
17
- <li class="nav-item"><%= link_to t(:'spotlight.sites.new.page_title'), spotlight.new_exhibit_path, class: 'btn btn-outline-secondary btn-nav', role: 'button' if can? :create, Spotlight::Exhibit %></li>
17
+ <li class="nav-item"><%= link_to t(:'spotlight.exhibits.new.page_title'), spotlight.new_exhibit_path, class: 'btn btn-outline-secondary btn-nav', role: 'button' if can? :create, Spotlight::Exhibit %></li>
18
18
  </ul>
19
19
  <% end %>
@@ -1,4 +1,4 @@
1
- <%= page_title(t('.section'), t('.page_title')) %>
1
+ <%= page_title(t('.page_title')) %>
2
2
  <%= bootstrap_form_for Spotlight::Engine.user_class.new, html: { class: 'admin-users' }, url: spotlight.admin_users_path do |f| %>
3
3
  <div class="mb-4">
4
4
  <h3 class="instructions"><%= t :'.instructions' %></h3>
@@ -1,4 +1,4 @@
1
- <%= page_title t(:'spotlight.sites.new.section') %>
1
+ <%= page_title t(:'.page_title') %>
2
2
  <%= render 'new_exhibit_form' %>
3
3
 
4
4
  <% content_for(:sidebar_position) { 'order-last' } %>
@@ -1,4 +1,4 @@
1
- <%= page_title(t('.section'), t('.page_title')) %>
1
+ <%= page_title(t('.page_title')) %>
2
2
  <div role="tabpanel">
3
3
  <%= bootstrap_form_for @site, url: spotlight.site_path, layout: :horizontal, label_col: 'col-md-2', control_col: 'col-md-10' do |f| %>
4
4
  <ul class="nav nav-tabs" role="tablist">
@@ -1,4 +1,4 @@
1
- <%= page_title(t('.section'), t('.page_title')) %>
1
+ <%= page_title(t('.page_title')) %>
2
2
  <%= bootstrap_form_for @site, url: spotlight.site_path, layout: :horizontal, label_col: 'col-md-2', control_col: 'col-md-10' do |f| %>
3
3
  <p class="instructions"><%= t :'.instructions' %></p>
4
4
  <table class="table table-striped dd-table">
@@ -187,7 +187,6 @@ en:
187
187
  page_title: Manage users
188
188
  pending: pending
189
189
  save: Add role
190
- section: Manage exhibits
191
190
  update: Make user an administrator
192
191
  appearances:
193
192
  edit:
@@ -423,7 +422,7 @@ en:
423
422
  language: Language
424
423
  public: Public
425
424
  new:
426
- header: Create a new exhibit
425
+ page_title: Create a new exhibit
427
426
  new_exhibit_form:
428
427
  fields:
429
428
  slug:
@@ -787,7 +786,6 @@ en:
787
786
  basic_settings:
788
787
  heading: Title
789
788
  page_title: Customize appearance
790
- section: Manage exhibits
791
789
  site_masthead:
792
790
  heading: Site masthead
793
791
  help: |
@@ -796,13 +794,10 @@ en:
796
794
  edit_exhibits:
797
795
  instructions: Drag and drop the exhibits below to specify the order in which they are displayed on the exhibits homepage.
798
796
  page_title: Order exhibits
799
- section: Manage exhibits
800
797
  exhibit:
801
798
  published: Published
802
799
  unpublished: Unpublished
803
- new:
804
- page_title: Create a new exhibit
805
- section: Manage exhibits
800
+ home: Exhibits
806
801
  tags:
807
802
  index:
808
803
  actions: Actions
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spotlight
4
- VERSION = '3.0.0.alpha.7'
4
+ VERSION = '3.0.0.alpha.8'
5
5
  end
@@ -13,8 +13,7 @@ describe 'Create a new exhibit', type: :feature do
13
13
  within '.dropdown-menu' do
14
14
  click_link 'Create new exhibit'
15
15
  end
16
- expect(page).to have_selector 'h1', text: 'Manage exhibits'
17
- expect(page).to have_selector 'h1 small', text: 'Create a new exhibit'
16
+ expect(page).to have_selector 'h1', text: 'Create a new exhibit'
18
17
  end
19
18
 
20
19
  it 'allows admins to create a new exhibit' do
@@ -17,6 +17,19 @@ describe Spotlight::TitleHelper, type: :helper do
17
17
  expect(title).to have_selector 'h1', text: 'Section'
18
18
  expect(title).to have_selector 'h1 small', text: 'Title'
19
19
  end
20
+
21
+ it 'renders just the section title if that was all that was provided' do
22
+ allow(helper).to receive(:t).and_call_original
23
+ allow(helper).to receive(:t).with(:'.header', default: '').and_return('')
24
+
25
+ title = helper.page_title('Section')
26
+
27
+ expect(title).to have_selector 'h1', text: 'Section'
28
+ expect(title).not_to have_selector 'h1 small'
29
+
30
+ title = helper.instance_variable_get(:@page_title)
31
+ expect(title).to eq 'Section | Application'
32
+ end
20
33
  end
21
34
 
22
35
  describe '#set_html_page_title' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-spotlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.alpha.7
4
+ version: 3.0.0.alpha.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2020-03-03 00:00:00.000000000 Z
14
+ date: 2020-03-05 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: acts-as-taggable-on