Hide 'profile type' form element for non super-admin users

This commit is contained in:
Rob H
2014-09-05 18:38:43 +10:00
parent 58dcdbd9c4
commit 780df6bfe0
2 changed files with 20 additions and 19 deletions

View File

@@ -36,24 +36,25 @@
= f.check_box :is_primary_producer, 'ng-model' => 'Enterprise.is_primary_producer'
 
= f.label :is_primary_producer, 'Producer'
.row
.alpha.eleven.columns
.three.columns.alpha
= f.label :type, 'Profile type'
.with-tip{'data-powertip' => "Full - enterprise may have products and relationships.<br />Single - enterprise may have products but no relationships.<br />Profile - enterprise has a profile but no products or relationships.<br />"}
%a What's this?
.two.columns
= f.radio_button :type, "full"
&nbsp;
= f.label :type, "Full", value: "full"
.two.columns
= f.radio_button :type, "single"
&nbsp;
= f.label :type, "Single", value: "single"
.four.columns.omega
= f.radio_button :type, "profile"
&nbsp;
= f.label :type, "Profile", value: "profile"
- if spree_current_user.admin?
.row
.alpha.eleven.columns
.three.columns.alpha
= f.label :type, 'Profile type'
.with-tip{'data-powertip' => "Full - enterprise may have products and relationships.<br />Single - enterprise may have products but no relationships.<br />Profile - enterprise has a profile but no products or relationships.<br />"}
%a What's this?
.two.columns
= f.radio_button :type, "full"
&nbsp;
= f.label :type, "Full", value: "full"
.two.columns
= f.radio_button :type, "single"
&nbsp;
= f.label :type, "Single", value: "single"
.four.columns.omega
= f.radio_button :type, "profile"
&nbsp;
= f.label :type, "Profile", value: "profile"
.row
.three.columns.alpha
%label Visible in search?

View File

@@ -127,7 +127,7 @@ feature %q{
choose 'Single'
fill_in 'enterprise_description', :with => 'Connecting farmers and eaters'
fill_in 'enterprise_long_description', :with => 'Zombie ipsum reversus ab viral inferno, nam rick grimes malum cerebro.'
# Check Angularjs switching of sidebar elements
uncheck 'enterprise_is_primary_producer'
uncheck 'enterprise_is_distributor'