mirror of
https://github.com/projekteuler/projekteuler.git
synced 2025-12-10 08:46:41 +01:00
Add custom site titles
This commit is contained in:
parent
0323456d2c
commit
084a640021
@ -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
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
<% provide(:title, t('.administration')) %>
|
||||
<h1><%= t('.administration') %></h1>
|
||||
<%= link_to t('.view_translations'), admin_translations_path, class: 'btn btn-default' %>
|
||||
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
<% provide(:title, Translation.model_name.human(count: 2)) %>
|
||||
|
||||
<h1><%= Translation.model_name.human(count: 2) %></h1>
|
||||
|
||||
<%= render 'translation_pagination' %>
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
<% provide(:title, t('problems.show.problem_subtitle', id: @translation.problem_id)) %>
|
||||
|
||||
<div class="page-header">
|
||||
<h1><%= @translation.title %> <small><%= t 'problems.show.problem_subtitle', id: @translation.problem_id %></small></h1>
|
||||
</div>
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
<% provide(:title, t('.sign_in')) %>
|
||||
|
||||
<%= alert_box t('.no_sign_in_required_for_translating'), context: :warning %>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><%= t :site_title %></title>
|
||||
<title><%= full_title(yield(:title)) %></title>
|
||||
<%= favicon_link_tag %>
|
||||
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
||||
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
<% provide(:title, Problem.model_name.human(count: 2)) %>
|
||||
|
||||
<h1><%= Problem.model_name.human(count: 2) %></h1>
|
||||
|
||||
<%= render 'problem_pagination' %>
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
<% provide(:title, t('problems.show.problem_subtitle', id: @problem.id)) %>
|
||||
|
||||
<div class="page-header">
|
||||
<h1><%= @problem.title %> <small><%= t '.problem_subtitle', id: @problem.id %></small></h1>
|
||||
</div>
|
||||
|
||||
@ -1 +1,10 @@
|
||||
<%= t 'problems.not_yet_translated' %>
|
||||
<% provide(:title, t('problems.show.problem_subtitle', id: @problem.id)) %>
|
||||
|
||||
<div class="page-header">
|
||||
<h1><%= t 'problems.show.problem_subtitle', id: @problem.id %></h1>
|
||||
</div>
|
||||
|
||||
<%= 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 %>
|
||||
@ -1,3 +1,5 @@
|
||||
<% provide(:title, t('.new_translation', id: @problem.id)) %>
|
||||
|
||||
<h1><%= t '.new_translation', id: @problem.id %></h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user