From 73fda5989153bf38d96cf76d1d94c97d9f81ad12 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Mon, 1 Sep 2014 12:57:27 +0300 Subject: [PATCH] Add titles for all the pages --- app/controllers/lectures_controller.rb | 2 +- app/controllers/workshops_controller.rb | 2 +- app/views/devise/confirmations/new.html.slim | 2 ++ app/views/devise/passwords/edit.html.slim | 2 ++ app/views/devise/passwords/new.html.slim | 2 ++ app/views/devise/registrations/edit.html.slim | 2 ++ app/views/devise/registrations/new.html.slim | 2 ++ app/views/devise/sessions/new.html.slim | 2 ++ app/views/devise/unlocks/new.html.slim | 2 ++ app/views/layouts/application.html.erb | 5 ++++- app/views/lectures/edit.html.slim | 1 + app/views/lectures/index.html.slim | 1 + app/views/lectures/new.html.slim | 1 + app/views/lectures/show.html.slim | 5 +++-- app/views/workshops/edit.html.slim | 2 ++ app/views/workshops/index.html.slim | 2 ++ app/views/workshops/new.html.slim | 2 ++ app/views/workshops/show.html.slim | 6 ++++-- 18 files changed, 36 insertions(+), 7 deletions(-) diff --git a/app/controllers/lectures_controller.rb b/app/controllers/lectures_controller.rb index c18612b..4a03ea4 100644 --- a/app/controllers/lectures_controller.rb +++ b/app/controllers/lectures_controller.rb @@ -37,7 +37,7 @@ class LecturesController < ApplicationController private def assign_lecture - @lecture = Lecture.find params[:id] + @lecture = current_user.lectures.find params[:id] end def lecture_params diff --git a/app/controllers/workshops_controller.rb b/app/controllers/workshops_controller.rb index 34d8da9..06ffe48 100644 --- a/app/controllers/workshops_controller.rb +++ b/app/controllers/workshops_controller.rb @@ -37,7 +37,7 @@ class WorkshopsController < ApplicationController private def assign_workshop - @workshop = Workshop.find params[:id] + @workshop = current_user.workshops.find params[:id] end def workshop_params diff --git a/app/views/devise/confirmations/new.html.slim b/app/views/devise/confirmations/new.html.slim index 966750a..72c8dca 100644 --- a/app/views/devise/confirmations/new.html.slim +++ b/app/views/devise/confirmations/new.html.slim @@ -1,3 +1,5 @@ +- content_for(:title) { ":: #{t :resend_instructions_header}" } + h2.entry-title = t :resend_instructions_header = simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| diff --git a/app/views/devise/passwords/edit.html.slim b/app/views/devise/passwords/edit.html.slim index 647b4d6..f39bcb7 100644 --- a/app/views/devise/passwords/edit.html.slim +++ b/app/views/devise/passwords/edit.html.slim @@ -1,3 +1,5 @@ +- content_for(:title) { ":: #{t :change_pass}" } + h2.entry-title = t :change_pass = simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| diff --git a/app/views/devise/passwords/new.html.slim b/app/views/devise/passwords/new.html.slim index 964f619..7e1f90c 100644 --- a/app/views/devise/passwords/new.html.slim +++ b/app/views/devise/passwords/new.html.slim @@ -1,3 +1,5 @@ +- content_for(:title) { ":: #{t :lostpass}" } + h2.entry-title = t :lostpass = simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| diff --git a/app/views/devise/registrations/edit.html.slim b/app/views/devise/registrations/edit.html.slim index e0fdfc4..0de96c2 100644 --- a/app/views/devise/registrations/edit.html.slim +++ b/app/views/devise/registrations/edit.html.slim @@ -1,3 +1,5 @@ +- content_for(:title) { ":: #{t :edit_speaker_profile}" } + = simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, multipart: true }) do |f| .form_inputs h2.entry-title = t :speaker_profile diff --git a/app/views/devise/registrations/new.html.slim b/app/views/devise/registrations/new.html.slim index 35e6592..2fe8223 100644 --- a/app/views/devise/registrations/new.html.slim +++ b/app/views/devise/registrations/new.html.slim @@ -1,3 +1,5 @@ +- content_for(:title) { ":: #{t :registration}" } + h2.entry-title = t :registration = simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| diff --git a/app/views/devise/sessions/new.html.slim b/app/views/devise/sessions/new.html.slim index ddd4b37..4c04132 100644 --- a/app/views/devise/sessions/new.html.slim +++ b/app/views/devise/sessions/new.html.slim @@ -1,3 +1,5 @@ +- content_for(:title) { ":: #{t :login}" } + h2.entry-title = t :login = simple_form_for(resource, as: resource_name, url: session_path(resource_name), ) do |f| diff --git a/app/views/devise/unlocks/new.html.slim b/app/views/devise/unlocks/new.html.slim index 910293e..0f91453 100644 --- a/app/views/devise/unlocks/new.html.slim +++ b/app/views/devise/unlocks/new.html.slim @@ -1,3 +1,5 @@ +- content_for(:title) { ":: #{t :resend_unlock_instructions_title}" } + h2 =t :resend_unlock_instructions_title = simple_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index ea58493..6c93200 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,7 +1,10 @@ - Clarion + + <%= Conference.current.title %> + <%= yield :title if content_for? :title %> + <%= stylesheet_link_tag 'application' %> <%= stylesheet_link_tag 'http://openfest.org/wp-content/themes/thematic-openfest/style.css' %> <%= csrf_meta_tags %> diff --git a/app/views/lectures/edit.html.slim b/app/views/lectures/edit.html.slim index c9e44d7..fb8eeb3 100644 --- a/app/views/lectures/edit.html.slim +++ b/app/views/lectures/edit.html.slim @@ -1,2 +1,3 @@ +- content_for(:title) { ":: #{t :edit_talk} #{@lecture.title}" } h1.entry-title = t :edit_talk = render 'form' diff --git a/app/views/lectures/index.html.slim b/app/views/lectures/index.html.slim index 28215f1..5e95fd0 100644 --- a/app/views/lectures/index.html.slim +++ b/app/views/lectures/index.html.slim @@ -1,3 +1,4 @@ +- content_for(:title) { ":: #{t :my_talks}" } h1.entry-title = t :my_talks - unless @lectures.empty? diff --git a/app/views/lectures/new.html.slim b/app/views/lectures/new.html.slim index c3e2bad..c636206 100644 --- a/app/views/lectures/new.html.slim +++ b/app/views/lectures/new.html.slim @@ -1,2 +1,3 @@ +- content_for(:title) { ":: #{t :submit_talk_header}" } h1.entry-title = t :submit_talk_header = render 'form' diff --git a/app/views/lectures/show.html.slim b/app/views/lectures/show.html.slim index ac01131..62bba69 100644 --- a/app/views/lectures/show.html.slim +++ b/app/views/lectures/show.html.slim @@ -1,9 +1,10 @@ +- content_for(:title) { ":: #{@lecture.title}" } + h2.lecture-title => @lecture.title span.subtitle = @lecture.subtitle .entry-meta - | - =t :edit_title, track: @lecture.track.name, len: @lecture.length + = t :edit_title, track: @lecture.track.name, len: @lecture.length section.abstract h3 = t :abstract diff --git a/app/views/workshops/edit.html.slim b/app/views/workshops/edit.html.slim index 0d51b39..b6d9fde 100644 --- a/app/views/workshops/edit.html.slim +++ b/app/views/workshops/edit.html.slim @@ -1,2 +1,4 @@ +- content_for(:title) { ":: #{t :edit_workshop} #{@workshop.title}" } + h1.entry-title = t :edit_workshop = render 'form' diff --git a/app/views/workshops/index.html.slim b/app/views/workshops/index.html.slim index 60e8b36..6f2eb6c 100644 --- a/app/views/workshops/index.html.slim +++ b/app/views/workshops/index.html.slim @@ -1,3 +1,5 @@ +- content_for(:title) { ":: #{t :my_workshops}" } + h1.entry-title = t :my_workshops - unless @workshops.empty? diff --git a/app/views/workshops/new.html.slim b/app/views/workshops/new.html.slim index 32c02c4..72919d4 100644 --- a/app/views/workshops/new.html.slim +++ b/app/views/workshops/new.html.slim @@ -1,2 +1,4 @@ +- content_for(:title) { ":: #{t :new_workshop_title}" } + h1.entry-title = t :new_workshop_title = render 'form' diff --git a/app/views/workshops/show.html.slim b/app/views/workshops/show.html.slim index cff0250..8ddc530 100644 --- a/app/views/workshops/show.html.slim +++ b/app/views/workshops/show.html.slim @@ -1,9 +1,11 @@ +- content_for(:title) { ":: #{@workshop.title}" } + h2.workshop-title = @workshop.title span.subtitle = @workshop.subtitle + .entry-meta - | - = t :edit_title, track: @workshop.track.name, len: @workshop.length + = t :edit_title, track: @workshop.track.name, len: @workshop.length section.abstract h3 = t :abstract