From dd231a335758873dcd9024db7618837094fcc0a5 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 6 Jul 2018 16:52:48 -0400 Subject: Added page titles refs #4 --- app/helpers/application_helper.rb | 5 +++++ app/views/admin/blogs/drafts.html.haml | 1 + app/views/admin/blogs/edit.html.haml | 1 + app/views/admin/blogs/index.html.haml | 1 + app/views/admin/blogs/new.html.haml | 1 + app/views/admin/blogs/show.html.haml | 1 + app/views/admin/streams/edit.html.haml | 1 + app/views/admin/streams/index.html.haml | 1 + app/views/admin/streams/new.html.haml | 1 + app/views/admin/updates/edit.html.haml | 1 + app/views/admin/updates/new.html.haml | 1 + app/views/blogs/show.html.haml | 1 + app/views/devise/confirmations/new.html.erb | 2 ++ app/views/devise/registrations/edit.html.erb | 2 ++ app/views/devise/registrations/new.html.erb | 2 ++ app/views/devise/unlocks/new.html.erb | 2 ++ app/views/layouts/admin.html.haml | 2 +- app/views/layouts/application.html.haml | 2 +- app/views/streams/show.html.haml | 1 + app/views/users/passwords/edit.html.haml | 1 + app/views/users/passwords/new.html.haml | 1 + app/views/users/sessions/new.html.haml | 1 + 22 files changed, 30 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be79..a8b1c7e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,7 @@ module ApplicationHelper + + def title(text) + content_for :title, text + end + end diff --git a/app/views/admin/blogs/drafts.html.haml b/app/views/admin/blogs/drafts.html.haml index 8f2d369..7f6d19d 100644 --- a/app/views/admin/blogs/drafts.html.haml +++ b/app/views/admin/blogs/drafts.html.haml @@ -1,3 +1,4 @@ +- title "Blog drafts" %table#entries %tr %th Title diff --git a/app/views/admin/blogs/edit.html.haml b/app/views/admin/blogs/edit.html.haml index f356069..beb7b88 100644 --- a/app/views/admin/blogs/edit.html.haml +++ b/app/views/admin/blogs/edit.html.haml @@ -1,2 +1,3 @@ +- title "Editing #{@blog.title}" = form_for @blog, url: admin_blog_url(@blog), html: { id: "entry-form" } do |f| = render partial: "form", locals: { f: f } diff --git a/app/views/admin/blogs/index.html.haml b/app/views/admin/blogs/index.html.haml index 427d922..28078f8 100644 --- a/app/views/admin/blogs/index.html.haml +++ b/app/views/admin/blogs/index.html.haml @@ -1,3 +1,4 @@ +- title "Blogs" %table#entries %tr %th Title diff --git a/app/views/admin/blogs/new.html.haml b/app/views/admin/blogs/new.html.haml index 0005278..eff1f16 100644 --- a/app/views/admin/blogs/new.html.haml +++ b/app/views/admin/blogs/new.html.haml @@ -1,2 +1,3 @@ +- title "New blog" = form_for @blog, url: admin_blogs_url, html: { id: "entry-form" } do |f| = render partial: "form", locals: { f: f } diff --git a/app/views/admin/blogs/show.html.haml b/app/views/admin/blogs/show.html.haml index 7875cab..b9acd5d 100644 --- a/app/views/admin/blogs/show.html.haml +++ b/app/views/admin/blogs/show.html.haml @@ -1,3 +1,4 @@ +- title "Previewing #{@blog.title}" = render partial: "blogs/blog", object: @blog %footer#blog-footer This draft was last updated on diff --git a/app/views/admin/streams/edit.html.haml b/app/views/admin/streams/edit.html.haml index 1b58331..8d910fe 100644 --- a/app/views/admin/streams/edit.html.haml +++ b/app/views/admin/streams/edit.html.haml @@ -1,2 +1,3 @@ +- title "Editing #{@stream.title}" = form_for @stream, url: admin_stream_url(@stream), html: { id: "entry-form" } do |f| = render partial: "form", locals: { f: f } diff --git a/app/views/admin/streams/index.html.haml b/app/views/admin/streams/index.html.haml index c69c6f9..6903fd1 100644 --- a/app/views/admin/streams/index.html.haml +++ b/app/views/admin/streams/index.html.haml @@ -1,3 +1,4 @@ +- title "Streams" %table#entries %tr %th Title diff --git a/app/views/admin/streams/new.html.haml b/app/views/admin/streams/new.html.haml index 52febf5..875805a 100644 --- a/app/views/admin/streams/new.html.haml +++ b/app/views/admin/streams/new.html.haml @@ -1,2 +1,3 @@ +- title "New stream" = form_for @stream, url: admin_streams_url, html: { id: "entry-form" } do |f| = render partial: "form", locals: { f: f } diff --git a/app/views/admin/updates/edit.html.haml b/app/views/admin/updates/edit.html.haml index 5651d23..75a9957 100644 --- a/app/views/admin/updates/edit.html.haml +++ b/app/views/admin/updates/edit.html.haml @@ -1,2 +1,3 @@ +- title "Editing stream update" = form_for @update, url: admin_stream_update_url(@stream, @update), html: { id: "entry-form" } do |f| = render partial: "form", locals: { f: f } diff --git a/app/views/admin/updates/new.html.haml b/app/views/admin/updates/new.html.haml index 14c6d77..f6c1c20 100644 --- a/app/views/admin/updates/new.html.haml +++ b/app/views/admin/updates/new.html.haml @@ -1,2 +1,3 @@ +- title "New stream update" = form_for @update, url: admin_stream_updates_url(@stream), html: { id: "entry-form" } do |f| = render partial: "form", locals: { f: f } diff --git a/app/views/blogs/show.html.haml b/app/views/blogs/show.html.haml index 8ab4523..f915e64 100644 --- a/app/views/blogs/show.html.haml +++ b/app/views/blogs/show.html.haml @@ -1,3 +1,4 @@ +- title @blog.title .breadcrumb= link_to "← Back to home page", root_path = render @blog %footer#blog-footer diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb index 2dc668f..8d6680a 100644 --- a/app/views/devise/confirmations/new.html.erb +++ b/app/views/devise/confirmations/new.html.erb @@ -1,3 +1,5 @@ +<% title "Resend confirmation instructions" %> +

Resend confirmation instructions

<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 1e66f3d..471580a 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -1,3 +1,5 @@ +<% "Edit account" %> +

Edit <%= resource_name.to_s.humanize %>

<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb index 5a238ce..ad0a77f 100644 --- a/app/views/devise/registrations/new.html.erb +++ b/app/views/devise/registrations/new.html.erb @@ -1,3 +1,5 @@ +<% title "Sign up" %> +

Sign up

<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb index 16586bc..8a9097a 100644 --- a/app/views/devise/unlocks/new.html.erb +++ b/app/views/devise/unlocks/new.html.erb @@ -1,3 +1,5 @@ +<% title "Resend unlock instructions" %> +

Resend unlock instructions

<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml index cb48c50..bc07335 100644 --- a/app/views/layouts/admin.html.haml +++ b/app/views/layouts/admin.html.haml @@ -1,7 +1,7 @@ !!! 5 %html %head - %title Thoughts - Admin + %title= content_for?(:title) ? "Thoughts - Admin - #{yield(:title)}" : "Thoughts - Admin" = csrf_meta_tags = stylesheet_link_tag 'admin', media: 'all', 'data-turbolinks-track': 'reload' = javascript_include_tag 'application', 'data-turbolinks-track': 'reload' diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 2d264a7..8cd06b0 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -1,7 +1,7 @@ !!! 5 %html %head - %title Thoughts + %title= content_for?(:title) ? "Thoughts - #{yield(:title)}" : "Thoughts" = csrf_meta_tags = stylesheet_link_tag 'main', media: 'all', 'data-turbolinks-track': 'reload' = javascript_include_tag 'application', 'data-turbolinks-track': 'reload' diff --git a/app/views/streams/show.html.haml b/app/views/streams/show.html.haml index dcec0a2..8365556 100644 --- a/app/views/streams/show.html.haml +++ b/app/views/streams/show.html.haml @@ -1,2 +1,3 @@ +- title @stream.title .breadcrumb= link_to "← Back to home page", root_path = render @stream diff --git a/app/views/users/passwords/edit.html.haml b/app/views/users/passwords/edit.html.haml index 3d2d9ee..39db61e 100644 --- a/app/views/users/passwords/edit.html.haml +++ b/app/views/users/passwords/edit.html.haml @@ -1,3 +1,4 @@ +- title "Change password" %h2 Change your password = devise_error_messages! #principal diff --git a/app/views/users/passwords/new.html.haml b/app/views/users/passwords/new.html.haml index 03d3854..d5972f5 100644 --- a/app/views/users/passwords/new.html.haml +++ b/app/views/users/passwords/new.html.haml @@ -1,3 +1,4 @@ +- title "Forgot password" %h2 Forgot your password? = devise_error_messages! #principal diff --git a/app/views/users/sessions/new.html.haml b/app/views/users/sessions/new.html.haml index f7c8de9..6b82038 100644 --- a/app/views/users/sessions/new.html.haml +++ b/app/views/users/sessions/new.html.haml @@ -1,3 +1,4 @@ +- title "Sign in" #principal = form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| .field -- cgit 1.4.1