Skip to content

Commit

Permalink
Render default title per page
Browse files Browse the repository at this point in the history
  • Loading branch information
v9n committed Dec 28, 2019
1 parent c1ce4b9 commit dee1797
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions app/helpers/dashboard_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# frozen_string_literal: true

module DashboardHelper
def default_dashboard_title
t('dashboard.default_title')
end
end
7 changes: 4 additions & 3 deletions app/views/layouts/dashboard.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<!DOCTYPE html>

<html>
<head>
<title>NotyIM - Uptime monitoring</title>
<%= stylesheet_pack_tag 'dashboard', media: 'all' %>
<%= render 'partials/dashboard/title' %>
<%= csrf_meta_tags %>
<%= render 'partials/meta' %>
<%= stylesheet_pack_tag 'application', media: 'all' %>
<%= javascript_pack_tag 'dashboard' %>
<%= render 'partials/meta' %>
</head>

<body class="layout-default">
Expand Down
1 change: 1 addition & 0 deletions app/views/partials/dashboard/_title.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<title><% content_for?(:page_title) ? yield(:page_title) : default_dashboard_title %></title>
6 changes: 4 additions & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
# available at http://guides.rubyonrails.org/i18n.html.

en:
hello: "Hello world"

dashboard:
default_title: 'noty - notification platform for monitoring'
check_created: 'Check was successfully created.'

bot:
Expand All @@ -40,6 +39,9 @@ en:

membership:

check:
destroy_schedule: 'Check are scheduled to be removed from our system. All associated data will be deleted too'

payment:
card_error: 'Invalid credit card'
success_charge: 'Thanks you. We have charge an amount of %{amount} on your card succesfully'
Expand Down

0 comments on commit dee1797

Please sign in to comment.