diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index fc5c037..142f027 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -17,4 +17,14 @@ module ApplicationHelper nil end end + + # Returns the full title on a per-page basis. + def full_title(page_title = '') + base_title = t('site_title') + if page_title.empty? + base_title + else + page_title + ' - ' + base_title + end + end end diff --git a/app/views/admin/dashboard/index.html.erb b/app/views/admin/dashboard/index.html.erb index 22e7719..b6ab745 100644 --- a/app/views/admin/dashboard/index.html.erb +++ b/app/views/admin/dashboard/index.html.erb @@ -1,3 +1,4 @@ +<% provide(:title, t('.administration')) %>

<%= t('.administration') %>

<%= link_to t('.view_translations'), admin_translations_path, class: 'btn btn-default' %> diff --git a/app/views/admin/translations/index.html.erb b/app/views/admin/translations/index.html.erb index 1ba4325..9c17d93 100644 --- a/app/views/admin/translations/index.html.erb +++ b/app/views/admin/translations/index.html.erb @@ -1,3 +1,5 @@ +<% provide(:title, Translation.model_name.human(count: 2)) %> +

<%= Translation.model_name.human(count: 2) %>

<%= render 'translation_pagination' %> diff --git a/app/views/admin/translations/show.html.erb b/app/views/admin/translations/show.html.erb index ca7421d..72febdf 100644 --- a/app/views/admin/translations/show.html.erb +++ b/app/views/admin/translations/show.html.erb @@ -1,3 +1,5 @@ +<% provide(:title, t('problems.show.problem_subtitle', id: @translation.problem_id)) %> + diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 3444e2d..a0b1d79 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -1,3 +1,5 @@ +<% provide(:title, t('.sign_in')) %> + <%= alert_box t('.no_sign_in_required_for_translating'), context: :warning %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 0e7948a..7a9bcd9 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,7 +1,7 @@ - <%= t :site_title %> + <%= full_title(yield(:title)) %> <%= favicon_link_tag %> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> diff --git a/app/views/problems/index.html.erb b/app/views/problems/index.html.erb index b6f9b6a..a33f34d 100644 --- a/app/views/problems/index.html.erb +++ b/app/views/problems/index.html.erb @@ -1,3 +1,5 @@ +<% provide(:title, Problem.model_name.human(count: 2)) %> +

<%= Problem.model_name.human(count: 2) %>

<%= render 'problem_pagination' %> diff --git a/app/views/problems/show.html.erb b/app/views/problems/show.html.erb index 708617f..bcfbdd7 100644 --- a/app/views/problems/show.html.erb +++ b/app/views/problems/show.html.erb @@ -1,3 +1,5 @@ +<% provide(:title, t('problems.show.problem_subtitle', id: @problem.id)) %> + diff --git a/app/views/problems/untranslated.html.erb b/app/views/problems/untranslated.html.erb index cab6535..5aa1cb4 100644 --- a/app/views/problems/untranslated.html.erb +++ b/app/views/problems/untranslated.html.erb @@ -1 +1,10 @@ -<%= t 'problems.not_yet_translated' %> \ No newline at end of file +<% provide(:title, t('problems.show.problem_subtitle', id: @problem.id)) %> + + + +<%= t 'problems.not_yet_translated' %> +<%= link_to new_problem_translation_path(@problem), class: 'btn btn-default btn-xs' do %> + <%= icon :pencil %> <%= t 'problems.index.suggest_translation' %> +<% end %> \ No newline at end of file diff --git a/app/views/translations/new.html.erb b/app/views/translations/new.html.erb index c5f0585..3f0fc9b 100644 --- a/app/views/translations/new.html.erb +++ b/app/views/translations/new.html.erb @@ -1,3 +1,5 @@ +<% provide(:title, t('.new_translation', id: @problem.id)) %> +

<%= t '.new_translation', id: @problem.id %>

<%= render 'form' %>