Commit 769f8d7504810c9bf246a21f4e4c411361194765

Authored by Daniela Feitosa
1 parent 5e12247d

Added links on template options on signup

app/controllers/public/profile_controller.rb
@@ -379,7 +379,9 @@ class ProfileController < PublicController @@ -379,7 +379,9 @@ class ProfileController < PublicController
379 end 379 end
380 380
381 def invisible_profile 381 def invisible_profile
382 - render_access_denied(_("This profile is inaccessible. You don't have the permission to view the content here."), _("Oops ... you cannot go ahead here")) 382 + unless profile.is_template?
  383 + render_access_denied(_("This profile is inaccessible. You don't have the permission to view the content here."), _("Oops ... you cannot go ahead here"))
  384 + end
383 end 385 end
384 386
385 def per_page 387 def per_page
app/helpers/application_helper.rb
@@ -1337,7 +1337,7 @@ module ApplicationHelper @@ -1337,7 +1337,7 @@ module ApplicationHelper
1337 counter = 0 1337 counter = 0
1338 radios = klass.templates.map do |template| 1338 radios = klass.templates.map do |template|
1339 counter += 1 1339 counter += 1
1340 - content_tag('li', labelled_radio_button(template.name, "#{field_name}[template_id]", template.id, counter==1)) 1340 + content_tag('li', labelled_radio_button(link_to(template.name, template.url, :target => '_blank'), "#{field_name}[template_id]", template.id, counter==1))
1341 end.join("\n") 1341 end.join("\n")
1342 1342
1343 content_tag('div', content_tag('label', _('Template'), :for => 'template-options', :class => 'formlabel') + 1343 content_tag('div', content_tag('label', _('Template'), :for => 'template-options', :class => 'formlabel') +
public/stylesheets/application.css
@@ -5742,6 +5742,10 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img { @@ -5742,6 +5742,10 @@ li.profile-activity-item.upload_image .activity-gallery-images-count-1 img {
5742 font-size: 18px; 5742 font-size: 18px;
5743 } 5743 }
5744 5744
  5745 +#signup-form #template-options li a {
  5746 + color: #555753
  5747 +}
  5748 +
5745 #signup-form label[for=profile_data_sex_female], 5749 #signup-form label[for=profile_data_sex_female],
5746 #signup-form label[for=profile_data_sex_male] { 5750 #signup-form label[for=profile_data_sex_male] {
5747 color: #6d786e; 5751 color: #6d786e;
test/functional/profile_controller_test.rb
@@ -189,6 +189,17 @@ class ProfileControllerTest < ActionController::TestCase @@ -189,6 +189,17 @@ class ProfileControllerTest < ActionController::TestCase
189 assert_response 403 189 assert_response 403
190 end 190 end
191 191
  192 + should 'display template profiles' do
  193 + Person.any_instance.expects(:display_info_to?).with(anything).returns(false)
  194 + @profile.visible = false
  195 + @profile.is_template = true
  196 + @profile.save
  197 +
  198 + get :index, :profile => @profile.identifier
  199 + assert_response :success
  200 + end
  201 +
  202 +
192 should 'display add friend button' do 203 should 'display add friend button' do
193 @profile.user.activate 204 @profile.user.activate
194 login_as(@profile.identifier) 205 login_as(@profile.identifier)