diff --git a/app/helpers/accounts_helper.rb b/app/helpers/accounts_helper.rb index 22c6c4a..559e195 100644 --- a/app/helpers/accounts_helper.rb +++ b/app/helpers/accounts_helper.rb @@ -2,13 +2,4 @@ module AccountsHelper def account_logo_tag(style: nil) tag.figure image_tag(fresh_account_logo_path, alt: "Account logo", size: 300), class: "account-logo avatar #{style}" end - - def button_to_toggle_setting(label, setting) - button_to account_path(account: { settings: { setting => !Current.account.settings.send("#{setting}?") } }), - method: :put, - role: "checkbox", aria: { checked: true, labelledby: "#{setting}_account_setting" }, tabindex: 0, - class: "btn" do - tag.span(label, id: "#{setting}_account_setting") - end - end end diff --git a/app/views/accounts/edit.html.erb b/app/views/accounts/edit.html.erb index d4a4ab8..e0c2152 100644 --- a/app/views/accounts/edit.html.erb +++ b/app/views/accounts/edit.html.erb @@ -65,11 +65,29 @@ <% end %> - <% if Current.account.settings.restrict_room_creation_to_administrators? %> - <%= button_to_toggle_setting "Allow everyone to create new rooms", :restrict_room_creation_to_administrators %> - <% else %> - <%= button_to_toggle_setting "Only allow admins to create new rooms", :restrict_room_creation_to_administrators %> - <% end %> +