From acc462af85880c319766fe1c6acaf26dd98ef1aa Mon Sep 17 00:00:00 2001 From: Tim Cowlishaw Date: Tue, 29 Oct 2024 07:58:32 +0100 Subject: [PATCH] set titles in controllers git status --- app/controllers/ui/sessions_controller.rb | 2 ++ app/controllers/ui/users_controller.rb | 1 + app/views/layouts/application.html.erb | 5 ++++- app/views/ui/sessions/new.html.erb | 2 -- app/views/ui/sessions/password_reset_landing.html.erb | 2 -- app/views/ui/users/index.html.erb | 2 -- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/ui/sessions_controller.rb b/app/controllers/ui/sessions_controller.rb index a672315d..faea7aba 100644 --- a/app/controllers/ui/sessions_controller.rb +++ b/app/controllers/ui/sessions_controller.rb @@ -6,6 +6,7 @@ class SessionsController < ApplicationController require 'net/https' def new + @title = "Welcome!" redirect_to ui_users_url if current_user end @@ -49,6 +50,7 @@ def reset_password_email end def password_reset_landing + @title = "Change password" @token = params[:token] end diff --git a/app/controllers/ui/users_controller.rb b/app/controllers/ui/users_controller.rb index 3ff935e2..d256ccfe 100644 --- a/app/controllers/ui/users_controller.rb +++ b/app/controllers/ui/users_controller.rb @@ -2,6 +2,7 @@ module Ui class UsersController < ApplicationController include SharedControllerMethods def index + @title = "User information" end end end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index f8bb4f98..2bf546af 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,7 +1,7 @@ - SmartCitizen Platform + <%= ["SmartCitizen Platform", @title].compact.join(" – ") %> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> @@ -11,6 +11,9 @@ <%= render partial: "layouts/flashes" %>
+ <% if @title %> +

<%= @title %>

+ <% end %> <%= yield %>
diff --git a/app/views/ui/sessions/new.html.erb b/app/views/ui/sessions/new.html.erb index 3fae8b48..21af2e3b 100644 --- a/app/views/ui/sessions/new.html.erb +++ b/app/views/ui/sessions/new.html.erb @@ -1,5 +1,3 @@ -

Welcome!

- <%= bootstrap_form_tag url: ui_sessions_path do |f| %> <%= f.text_field :username_or_email, value: params[:username_or_email], autofocus: params[:username_or_email].blank? %> <%= f.password_field :password %> diff --git a/app/views/ui/sessions/password_reset_landing.html.erb b/app/views/ui/sessions/password_reset_landing.html.erb index d2d7a8f0..de2e886f 100644 --- a/app/views/ui/sessions/password_reset_landing.html.erb +++ b/app/views/ui/sessions/password_reset_landing.html.erb @@ -1,5 +1,3 @@ -

Change password

- <%= bootstrap_form_tag url: ui_change_password_path do |f| %> <%= f.hidden_field :token, value: @token %> <%= f.password_field :password %> diff --git a/app/views/ui/users/index.html.erb b/app/views/ui/users/index.html.erb index b7e6f93c..6e12f87f 100644 --- a/app/views/ui/users/index.html.erb +++ b/app/views/ui/users/index.html.erb @@ -1,5 +1,3 @@ -

User information

- <% if current_user %>

Logged in as <%= current_user.email %>.

Your access token: