diff --git a/app/views/accounts/edit.html.erb b/app/views/accounts/edit.html.erb index cfa750d..f2d1ae8 100644 --- a/app/views/accounts/edit.html.erb +++ b/app/views/accounts/edit.html.erb @@ -76,10 +76,9 @@ <% end %> - - data-action="change->form#submit"> + <%= tag.input type: "checkbox", class: "switch__input", + checked: Current.account.settings.restrict_room_creation_to_administrators?, + data: { action: "change->form#submit" } %> Must be admin to create new rooms diff --git a/app/views/pwa/_browser_settings.html.erb b/app/views/pwa/_browser_settings.html.erb index 70144f1..985f6f1 100644 --- a/app/views/pwa/_browser_settings.html.erb +++ b/app/views/pwa/_browser_settings.html.erb @@ -6,8 +6,8 @@ <%= image_tag "disclosure.svg", aria: { hidden: "true" }, size: 10, class: "disclosure" %> - <% case - when platform.firefox? && platform.android? %> + <% case %> + <% when platform.firefox? && platform.android? %> Tap <%= image_tag "lock.svg", alt: "the View site information button", size: 20 %> in the address bar. Tap Notification to change to Allowed. diff --git a/app/views/pwa/_install_instructions.html.erb b/app/views/pwa/_install_instructions.html.erb index b82ddb2..fcfe889 100644 --- a/app/views/pwa/_install_instructions.html.erb +++ b/app/views/pwa/_install_instructions.html.erb @@ -6,8 +6,8 @@ <%= image_tag "disclosure.svg", aria: { hidden: "true" }, size: 10, class: "disclosure" %> - <% case - when platform.edge? %> + <% case %> + <% when platform.edge? %> Click <%= image_tag "external/install-edge.svg", alt: "the app available - install Campfire chat button", size: 16 %>in the address bar. Click Install. diff --git a/app/views/pwa/_system_settings.html.erb b/app/views/pwa/_system_settings.html.erb index 6c6dc7b..3edccda 100644 --- a/app/views/pwa/_system_settings.html.erb +++ b/app/views/pwa/_system_settings.html.erb @@ -5,8 +5,8 @@ <%= image_tag "disclosure.svg", aria: { hidden: "true" }, size: 10, class: "disclosure" %> - <% case - when platform.firefox? && platform.android? %> + <% case %> + <% when platform.firefox? && platform.android? %> Tap the <%= image_tag "menu-dots-vertical.svg", alt: "More options", size: 16 %> menu button. Tap Settings. diff --git a/test/controllers/accounts_controller_test.rb b/test/controllers/accounts_controller_test.rb index 8292c6f..8cbe222 100644 --- a/test/controllers/accounts_controller_test.rb +++ b/test/controllers/accounts_controller_test.rb @@ -10,6 +10,16 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest assert_response :ok end + test "edit shows whether room creation is restricted to administrators" do + get edit_account_url + assert_select "label.switch input.switch__input[type=checkbox]:not([checked])" + + accounts(:signal).update!(settings: { restrict_room_creation_to_administrators: true }) + + get edit_account_url + assert_select "label.switch input.switch__input[type=checkbox][checked][data-action='change->form#submit']" + end + test "edit groups administrators separately from members with a divider" do get edit_account_url diff --git a/test/controllers/rooms_controller_test.rb b/test/controllers/rooms_controller_test.rb index 62edf72..dfba3bb 100644 --- a/test/controllers/rooms_controller_test.rb +++ b/test/controllers/rooms_controller_test.rb @@ -15,6 +15,21 @@ class RoomsControllerTest < ActionDispatch::IntegrationTest assert_response :success end + test "show renders notification help for each platform" do + { + "Firefox on Android" => "Mozilla/5.0 (Android 14; Mobile; rv:131.0) Gecko/131.0 Firefox/131.0", + "Chrome on Android" => "Mozilla/5.0 (Linux; Android 14; Pixel 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36", + "Firefox on desktop" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0", + "Chrome on desktop" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36", + "Safari on macOS" => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Safari/605.1.15" + }.each do |platform, user_agent| + get room_url(users(:david).rooms.last), headers: { "User-Agent" => user_agent } + + assert_response :success, platform + assert_select ".notifications-help ol", { minimum: 1 }, platform + end + end + test "shows records the last room visited in a cookie" do get room_url(users(:david).rooms.last) assert response.cookies[:last_room] = users(:david).rooms.last.id