diff --git a/app/models/portal.rb b/app/models/portal.rb index 85e25d9..ace15ec 100644 --- a/app/models/portal.rb +++ b/app/models/portal.rb @@ -16,6 +16,9 @@ def initialize(args={}) private + def configured_title + I18n.t('ddr.public.portal.%{controller_name}.title', :default => I18n.t('blacklight.application_name')) + end def item_or_collection_documents(local_ids) local_ids ? documents(item_or_collection_documents_search(local_ids)) : [] diff --git a/app/models/portal/digital_collections.rb b/app/models/portal/digital_collections.rb index 9bd9ce5..22fc724 100644 --- a/app/models/portal/digital_collections.rb +++ b/app/models/portal/digital_collections.rb @@ -21,7 +21,7 @@ def item_count end def title - parent_collection_document.title + parent_collection_document ? parent_collection_document.title : configured_title end def abstract diff --git a/app/views/catalog/_search_header.html.erb b/app/views/catalog/_search_header.html.erb index 74fc127..7b2e0a0 100644 --- a/app/views/catalog/_search_header.html.erb +++ b/app/views/catalog/_search_header.html.erb @@ -5,3 +5,7 @@ <%= render 'collection_matches' %> <%= render 'sort_and_per_page' %> + +<% if @portal %> + <%= content_for :page_title, t('blacklight.search.page_title.title', :constraints => render_search_to_page_title(params), :application_name => @portal.title + ' - Duke Libraries -') %> +<% end %> diff --git a/app/views/catalog/_show_default.html.erb b/app/views/catalog/_show_default.html.erb index 80237a0..272ff22 100644 --- a/app/views/catalog/_show_default.html.erb +++ b/app/views/catalog/_show_default.html.erb @@ -13,6 +13,6 @@ <%= render partial: 'show_license_default', locals: { document: @document } %> - <%= render partial: 'related_items', locals: {document: @document} %> +<%= content_for :page_title, t('blacklight.search.show.title', :document_title => document_show_html_title, :application_name => document.collection.title + ' - Duke Libraries').html_safe %> diff --git a/app/views/digital_collections/index.html.erb b/app/views/digital_collections/index.html.erb index f0989dd..d8c6e2e 100644 --- a/app/views/digital_collections/index.html.erb +++ b/app/views/digital_collections/index.html.erb @@ -8,8 +8,7 @@ <%= render 'home_showcase' %> <% else %> <% unless has_search_parameters? %> - <%= render partial: 'collection_submast', locals: { document: @portal.collection } %> - + <%= render partial: 'collection_submast', locals: { document: @portal.collection } %> <% end %> <% end %> @@ -34,10 +33,8 @@ <%= render 'home' %> <%# set the html title for collection portal page -%> - <% if @portal.collection %> - <%= content_for :page_title, t("ddr.public.portal.#{params[:collection] || controller_name}.title", :default => @portal.title) + " - Duke Libraries" %> - <% else %> - <%= content_for :page_title, t("ddr.public.portal.#{params[:collection] || controller_name}.title", :default => t("blacklight.welcome")) %> + <% if @portal %> + <%= content_for :page_title, @portal.title + " - Duke Libraries" %> <% end %> <% else %> <%= render 'search_results' %> diff --git a/app/views/digital_collections/index_portal.html.erb b/app/views/digital_collections/index_portal.html.erb index 83c93a4..446f0a4 100644 --- a/app/views/digital_collections/index_portal.html.erb +++ b/app/views/digital_collections/index_portal.html.erb @@ -20,19 +20,18 @@