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 +4 -4
- data/app/controllers/spotlight/admin_users_controller.rb +4 -1
- data/app/controllers/spotlight/exhibits_controller.rb +2 -0
- data/app/controllers/spotlight/sites_controller.rb +8 -2
- data/app/helpers/spotlight/title_helper.rb +12 -2
- data/app/views/shared/_site_sidebar.html.erb +1 -1
- data/app/views/spotlight/admin_users/index.html.erb +1 -1
- data/app/views/spotlight/exhibits/new.html.erb +1 -1
- data/app/views/spotlight/sites/edit.html.erb +1 -1
- data/app/views/spotlight/sites/edit_exhibits.html.erb +1 -1
- data/config/locales/spotlight.en.yml +2 -7
- data/lib/spotlight/version.rb +1 -1
- data/spec/features/create_exhibit_spec.rb +1 -2
- data/spec/helpers/spotlight/title_helper_spec.rb +13 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eee784e93eaeb64d3b581a84b8969f67ef1365fcb244845541cce3db8743a44d
|
4
|
+
data.tar.gz: 72cc1075f6bf87b3f0ec675d71484ea0f664181d36fe55978878890627d8f264
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
@@ -8,9 +8,15 @@ module Spotlight
|
|
8
8
|
before_action :load_site
|
9
9
|
load_and_authorize_resource
|
10
10
|
|
11
|
-
def edit
|
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
|
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
|
-
|
17
|
-
|
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.
|
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('.
|
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('.
|
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('.
|
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
|
-
|
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
|
-
|
804
|
-
page_title: Create a new exhibit
|
805
|
-
section: Manage exhibits
|
800
|
+
home: Exhibits
|
806
801
|
tags:
|
807
802
|
index:
|
808
803
|
actions: Actions
|
data/lib/spotlight/version.rb
CHANGED
@@ -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: '
|
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.
|
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-
|
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
|