1
0
mirror of https://github.com/projekteuler/projekteuler.git synced 2025-12-10 08:46:41 +01:00

Merge pull request #47 from PFischbeck/site-titles

Add custom site titles
This commit is contained in:
Philipp Fischbeck 2017-11-23 17:14:28 +01:00 committed by GitHub
commit 703975adf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 34 additions and 2 deletions

View File

@ -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

View File

@ -1,3 +1,4 @@
<% provide(:title, t('.administration')) %>
<h1><%= t('.administration') %></h1>
<%= link_to t('.view_translations'), admin_translations_path, class: 'btn btn-default' %>

View File

@ -1,3 +1,5 @@
<% provide(:title, Translation.model_name.human(count: 2)) %>
<h1><%= Translation.model_name.human(count: 2) %></h1>
<%= render 'translation_pagination' %>

View File

@ -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>

View File

@ -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">

View File

@ -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 %>

View File

@ -1,3 +1,5 @@
<% provide(:title, Problem.model_name.human(count: 2)) %>
<h1><%= Problem.model_name.human(count: 2) %></h1>
<%= render 'problem_pagination' %>

View File

@ -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>

View File

@ -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 %>

View File

@ -1,3 +1,5 @@
<% provide(:title, t('.new_translation', id: @problem.id)) %>
<h1><%= t '.new_translation', id: @problem.id %></h1>
<%= render 'form' %>