From 769f8d7504810c9bf246a21f4e4c411361194765 Mon Sep 17 00:00:00 2001 From: Daniela Soares Feitosa Date: Sun, 11 Nov 2012 13:02:29 -0200 Subject: [PATCH] Added links on template options on signup --- app/controllers/public/profile_controller.rb | 4 +++- app/helpers/application_helper.rb | 2 +- public/stylesheets/application.css | 4 ++++ test/functional/profile_controller_test.rb | 11 +++++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/controllers/public/profile_controller.rb b/app/controllers/public/profile_controller.rb index b30d5a9..2a7bd73 100644 --- a/app/controllers/public/profile_controller.rb +++ b/app/controllers/public/profile_controller.rb @@ -379,7 +379,9 @@ class ProfileController < PublicController end def invisible_profile - render_access_denied(_("This profile is inaccessible. You don't have the permission to view the content here."), _("Oops ... you cannot go ahead here")) + unless profile.is_template? + render_access_denied(_("This profile is inaccessible. You don't have the permission to view the content here."), _("Oops ... you cannot go ahead here")) + end end def per_page diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index bffff20..7e74359 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1337,7 +1337,7 @@ module ApplicationHelper counter = 0 radios = klass.templates.map do |template| counter += 1 - content_tag('li', labelled_radio_button(template.name, "#{field_name}[template_id]", template.id, counter==1)) + content_tag('li', labelled_radio_button(link_to(template.name, template.url, :target => '_blank'), "#{field_name}[template_id]", template.id, counter==1)) end.join("\n") content_tag('div', content_tag('label', _('Template'), :for => 'template-options', :class => 'formlabel') + diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 8638502..f1b0da6 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -5742,6 +5742,10 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { font-size: 18px; } +#signup-form #template-options li a { + color: #555753 +} + #signup-form label[for=profile_data_sex_female], #signup-form label[for=profile_data_sex_male] { color: #6d786e; diff --git a/test/functional/profile_controller_test.rb b/test/functional/profile_controller_test.rb index cbb1870..d651865 100644 --- a/test/functional/profile_controller_test.rb +++ b/test/functional/profile_controller_test.rb @@ -189,6 +189,17 @@ class ProfileControllerTest < ActionController::TestCase assert_response 403 end + should 'display template profiles' do + Person.any_instance.expects(:display_info_to?).with(anything).returns(false) + @profile.visible = false + @profile.is_template = true + @profile.save + + get :index, :profile => @profile.identifier + assert_response :success + end + + should 'display add friend button' do @profile.user.activate login_as(@profile.identifier) -- libgit2 0.21.2