Commit f1dd48d269affba0d6e3f91d90d77ebc7075edad
1 parent
12a28da7
Exists in
master
and in
28 other branches
Added info to better sharing in other networks
* Changed title tag (ActionItem2610)
Showing
2 changed files
with
17 additions
and
2 deletions
Show diff stats
app/helpers/application_helper.rb
... | ... | @@ -889,12 +889,11 @@ module ApplicationHelper |
889 | 889 | |
890 | 890 | def page_title |
891 | 891 | (@page ? @page.title + ' - ' : '') + |
892 | - (profile ? profile.short_name + ' - ' : '') + | |
893 | 892 | (@topic ? @topic.title + ' - ' : '') + |
894 | 893 | (@section ? @section.title + ' - ' : '') + |
895 | 894 | (@toc ? _('Online Manual') + ' - ' : '') + |
896 | 895 | (@controller.controller_name == 'chat' ? _('Chat') + ' - ' : '') + |
897 | - environment.name + | |
896 | + (profile ? profile.short_name : environment.name) + | |
898 | 897 | (@category ? " - #{@category.full_name}" : '') |
899 | 898 | end |
900 | 899 | ... | ... |
test/unit/application_helper_test.rb
... | ... | @@ -466,6 +466,22 @@ class ApplicationHelperTest < ActiveSupport::TestCase |
466 | 466 | assert_match(/Community nick/, page_title) |
467 | 467 | end |
468 | 468 | |
469 | + should 'not display environment name if is a profile' do | |
470 | + stubs(:environment).returns(Environment.default) | |
471 | + @controller = ApplicationController.new | |
472 | + | |
473 | + c = fast_create(Community, :name => 'Community for tests', :nickname => 'Community nick', :identifier => 'test_comm') | |
474 | + stubs(:profile).returns(c) | |
475 | + assert_equal c.short_name, page_title | |
476 | + end | |
477 | + | |
478 | + should 'display only environment if no profile and page' do | |
479 | + stubs(:environment).returns(Environment.default) | |
480 | + @controller = ApplicationController.new | |
481 | + | |
482 | + assert_equal Environment.default.name, page_title | |
483 | + end | |
484 | + | |
469 | 485 | should 'gravatar default parameter' do |
470 | 486 | profile = mock |
471 | 487 | profile.stubs(:theme).returns('some-theme') | ... | ... |