Commit 769f8d7504810c9bf246a21f4e4c411361194765
1 parent
5e12247d
Exists in
master
and in
29 other branches
Added links on template options on signup
Showing
4 changed files
with
19 additions
and
2 deletions
Show diff stats
app/controllers/public/profile_controller.rb
... | ... | @@ -379,7 +379,9 @@ class ProfileController < PublicController |
379 | 379 | end |
380 | 380 | |
381 | 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 | 385 | end |
384 | 386 | |
385 | 387 | def per_page | ... | ... |
app/helpers/application_helper.rb
... | ... | @@ -1337,7 +1337,7 @@ module ApplicationHelper |
1337 | 1337 | counter = 0 |
1338 | 1338 | radios = klass.templates.map do |template| |
1339 | 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 | 1341 | end.join("\n") |
1342 | 1342 | |
1343 | 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 | 5742 | font-size: 18px; |
5743 | 5743 | } |
5744 | 5744 | |
5745 | +#signup-form #template-options li a { | |
5746 | + color: #555753 | |
5747 | +} | |
5748 | + | |
5745 | 5749 | #signup-form label[for=profile_data_sex_female], |
5746 | 5750 | #signup-form label[for=profile_data_sex_male] { |
5747 | 5751 | color: #6d786e; | ... | ... |
test/functional/profile_controller_test.rb
... | ... | @@ -189,6 +189,17 @@ class ProfileControllerTest < ActionController::TestCase |
189 | 189 | assert_response 403 |
190 | 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 | 203 | should 'display add friend button' do |
193 | 204 | @profile.user.activate |
194 | 205 | login_as(@profile.identifier) | ... | ... |