Skip to content
This repository has been archived by the owner on May 2, 2020. It is now read-only.

Commit

Permalink
allow account admins to enable theme editor for sub-accounts
Browse files Browse the repository at this point in the history
fixes CNVS-29585

test plan:
- as a non site admin in the new ui
- make sure you can enable theme editor for sub accounts

Change-Id: Ic518d2a46f01043783b2ad0250ad93b06454d2ea
Reviewed-on: https://gerrit.instructure.com/80913
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <[email protected]>
QA-Review: Benjamin Christian Nelson <[email protected]>
Product-Review: Simon Williams <[email protected]>
  • Loading branch information
simonista committed Jun 6, 2016
1 parent 5b8173a commit df67a6e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
16 changes: 7 additions & 9 deletions app/views/accounts/settings.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ TEXT
<%= settings.check_box :enable_alerts, :checked => @account.settings[:enable_alerts] %>
<%= settings.label :enable_alerts, :en => "Alerts (beta)" %>
</div>
<% end %>
<% end %><%# end of site_admin? %>
<div id="global_includes_warning_message_wrapper">
<%= settings.check_box :global_includes, :checked => @account.settings[:global_includes] %>
<%= settings.label :global_includes, :en => "Custom CSS/JavaScript overrides" %>
Expand All @@ -347,13 +347,7 @@ TEXT
</p>
</div>
</div>
<div>
<%= settings.check_box :sub_account_includes,
id: :account_settings_new_sub_account_includes,
checked: @account.settings[:sub_account_includes]
%>
<%= settings.label :new_sub_account_includes, :en => "Let sub-accounts use the Theme Editor to customize their own branding" %>
<% end %>
<% end %><%# end of use_new_styles? %>
</div>
<div id="show_scheduler_checkbox">
<%= settings.check_box :show_scheduler, :checked => @account.settings[:show_scheduler] %>
Expand All @@ -363,7 +357,11 @@ TEXT
<%= settings.check_box :enable_profiles, :checked => @account.settings[:enable_profiles] %>
<%= settings.label :enable_profiles, :en => "Enable Profiles" %>
</div>
<% end %>
<% end %><%# end of :manage_site_settings %>
<div>
<%= settings.check_box :sub_account_includes, checked: @account.settings[:sub_account_includes] %>
<%= settings.label :new_sub_account_includes, :en => "Let sub-accounts use the Theme Editor to customize their own branding" %>
</div>
<% if @account.canvas_authentication? %>
<div>
<%= settings.check_box :open_registration, :checked => @account.open_registration? %>
Expand Down
19 changes: 19 additions & 0 deletions spec/views/accounts/settings.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,23 @@
expect(response).not_to have_tag '#enroll_users_form'
end
end

context "theme editor" do
before do
@account = Account.default
assigns[:account] = @account
assigns[:account_users] = []
assigns[:root_account] = @account
assigns[:associated_courses_count] = 0
assigns[:announcements] = AccountNotification.none.paginate
end

it "should show sub account theme editor option for non siteadmin admins" do
admin = account_admin_user
view_context(@account, admin)
assigns[:current_user] = admin
render
expect(response).to include("Let sub-accounts use the Theme Editor")
end
end
end

0 comments on commit df67a6e

Please sign in to comment.