diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1ad96a17f..084d3e8df 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -24,13 +24,13 @@ class ApplicationController < ActionController::Base def mobile_except_ipad if is_mobile_device? if request.env["HTTP_USER_AGENT"].include? "iPad" - session[:mobile_view] = false + session[:mobile_view] = false else session[:mobile_view] = true end end end - + def count_requests @request_count = current_user.requests_for_me.count if current_user end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 89e6121cf..94e49b23c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -9,6 +9,16 @@ module ApplicationHelper false end + def page_title text=nil + title = "" + if text.blank? + title = "#{current_user.name} | " if current_user + else + title = "#{text} | " + end + title += "DIASPORA*" + end + def aspects_with_post aspects, post aspects.select do |a| post.aspect_ids.include?(a.id) diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index ecd4be3cf..379e2f3c1 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -5,6 +5,9 @@ - content_for :head do = include_javascripts :aspects +- content_for :page_title do + = "Manage aspects" + #section_header %h2=t('.manage_aspects') .right{:style=>"top:0;"} diff --git a/app/views/aspects/show.html.haml b/app/views/aspects/show.html.haml index 480eff296..da066c2b0 100644 --- a/app/views/aspects/show.html.haml +++ b/app/views/aspects/show.html.haml @@ -2,6 +2,9 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. +- content_for :page_title do + = @aspect.name + .span-24.last %h2{:style=>"position:relative;margin-bottom:0;"} = @aspect diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index ade8de03b..ae70a18a0 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -8,10 +8,7 @@ %meta{:charset => 'utf-8'} %title - - if current_user - = "#{current_user.name} | DIASPORA*" - - else - DIASPORA* + = page_title yield(:page_title) %meta{'http-equiv' => 'X-UA-Compatible', :content => 'IE=edge,chrome=1'} diff --git a/app/views/people/_edit.html.haml b/app/views/people/_edit.html.haml index 1fa379815..6935b4601 100644 --- a/app/views/people/_edit.html.haml +++ b/app/views/people/_edit.html.haml @@ -2,6 +2,8 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. +- content_for :page_title do + = "Edit profile" = form_tag person_path(@person), :method => :put, :multipart => true, :id => 'update_profile_form' do %h3 diff --git a/app/views/people/index.html.haml b/app/views/people/index.html.haml index a0560df61..b607a02ea 100644 --- a/app/views/people/index.html.haml +++ b/app/views/people/index.html.haml @@ -2,6 +2,9 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. +- content_for :page_title do + = "Search" + .span-15.prepend-5.last %h2 -if params[:q].blank? diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index df078a437..97dc45177 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -2,6 +2,8 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. +- content_for :page_title do + = @person.name .span-24.last #author_info diff --git a/app/views/services/index.html.haml b/app/views/services/index.html.haml index 883ae1eba..345ebd885 100644 --- a/app/views/services/index.html.haml +++ b/app/views/services/index.html.haml @@ -2,6 +2,9 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. +- content_for :page_title do + = "Edit services" + #section_header %h2 = t('settings') diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 3b1cd7cdd..087f4d814 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -2,6 +2,9 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. +- content_for :page_title do + = "Edit account" + :javascript $(document).ready(function(){ $("#settings_nav li > a").live("click", function() {