Commit fea9c1a6c1cd3f7173bd001f29b1ed4bc77f7c0b

Authored by Antonio Terceiro
1 parent 591d6baf

Copying public/private setting from template

(ActionItem1404)
app/models/profile.rb
... ... @@ -288,6 +288,7 @@ class Profile < ActiveRecord::Base
288 288 self.theme = template.theme
289 289 self.custom_footer = template[:custom_footer]
290 290 self.custom_header = template[:custom_header]
  291 + self.public_profile = template.public_profile
291 292  
292 293 # flush
293 294 self.save_without_validation!
... ...
public/stylesheets/common.css
... ... @@ -272,7 +272,6 @@ td .button {
272 272 }
273 273  
274 274 td.field-name {
275   - color: #888;
276 275 width: 150px;
277 276 text-align: left;
278 277 vertical-align: top;
... ...
test/unit/profile_test.rb
... ... @@ -1190,6 +1190,13 @@ class ProfileTest < Test::Unit::TestCase
1190 1190 assert_equal 6, p.boxes_limit
1191 1191 end
1192 1192  
  1193 + should 'copy public/private setting from template' do
  1194 + template = fast_create(Profile, :public_profile => false)
  1195 + p = fast_create(Profile)
  1196 + p.apply_template(template)
  1197 + assert_equal false, p.public_profile
  1198 + end
  1199 +
1193 1200 should 'destroy tasks requested to it when destroyed' do
1194 1201 p = Profile.create!(:name => 'test_profile', :identifier => 'test_profile')
1195 1202  
... ...