From e6c32556da5dd605dd38e7401eef95ffc0ed3a72 Mon Sep 17 00:00:00 2001 From: albertlast Date: Tue, 29 Sep 2026 12:33:10 +0200 Subject: [PATCH 01/10] Adds template snapshot tests that freeze what each page renders Records what about 230 pages render today, as a guest, a member and an administrator, so that moving the templates to Plates can be checked page by page. A page that renders differently fails, and the diff says how. Pages are compared as DomSnapshot describes them rather than as HTML: whitespace, comments and attribute order are dropped, and the forum's own data - ids, counts, dates, names, sessions, list lengths - is masked. Pages that list content look at fixtures built once per forum, and lists of the whole forum are narrowed to them, so the snapshots do not change when somebody posts, registers or adds a board. The errors a page logs are part of its snapshot. perturb-forum.php fills a throwaway forum with unrelated members, boards and posts. Recorded on a fresh MySQL forum, the snapshots pass there and on a fresh PostgreSQL forum, and on both again after two rounds of it. Co-Authored-By: Claude Opus 5.5 Signed-off-by: albertlast --- AGENTS.md | 30 + phpunit.xml.dist | 10 + .../Http/Snapshot/AdminSnapshotTest.php | 302 ++++++++ .../Http/Snapshot/CalendarSnapshotTest.php | 116 +++ .../Http/Snapshot/GuestSnapshotTest.php | 90 +++ .../Http/Snapshot/MemberSnapshotTest.php | 124 +++ .../Http/Snapshot/SnapshotTestCase.php | 510 ++++++++++++ .../Http/Snapshot/fixture-forum.php | 653 ++++++++++++++++ tests/Integration/Http/Snapshot/index.php | 8 + .../Http/Snapshot/perturb-forum.php | 192 +++++ .../snapshots/admin/admin_credits.txt | 90 +++ .../Snapshot/snapshots/admin/admin_index.txt | 193 +++++ .../Snapshot/snapshots/admin/admin_menu.txt | 434 +++++++++++ .../Snapshot/snapshots/admin/antispam.txt | 251 ++++++ .../Snapshot/snapshots/admin/attachments.txt | 368 +++++++++ .../snapshots/admin/attachments_avatars.txt | 390 ++++++++++ .../snapshots/admin/attachments_browse.txt | 128 +++ .../admin/attachments_browse_avatars.txt | 128 +++ .../admin/attachments_browse_thumbs.txt | 128 +++ .../admin/attachments_maintenance.txt | 225 ++++++ .../snapshots/admin/attachments_paths.txt | 126 +++ .../Http/Snapshot/snapshots/admin/bans.txt | 76 ++ .../Snapshot/snapshots/admin/bans_add.txt | 149 ++++ .../Snapshot/snapshots/admin/bans_browse.txt | 75 ++ .../Snapshot/snapshots/admin/bans_log.txt | 69 ++ .../Snapshot/snapshots/admin/board_index.txt | 95 +++ .../Http/Snapshot/snapshots/admin/chrome.txt | 185 +++++ .../Http/Snapshot/snapshots/admin/display.txt | 733 ++++++++++++++++++ .../Snapshot/snapshots/admin/display_poll.txt | 429 ++++++++++ .../snapshots/admin/features_alerts.txt | 335 ++++++++ .../snapshots/admin/features_basic.txt | 599 ++++++++++++++ .../Snapshot/snapshots/admin/features_bbc.txt | 588 ++++++++++++++ .../snapshots/admin/features_layout.txt | 172 ++++ .../snapshots/admin/features_likes.txt | 137 ++++ .../snapshots/admin/features_mentions.txt | 141 ++++ .../snapshots/admin/features_profile.txt | 257 ++++++ .../admin/features_profile_field_edit.txt | 349 +++++++++ .../admin/features_profile_field_new.txt | 346 +++++++++ .../Snapshot/snapshots/admin/features_sig.txt | 375 +++++++++ .../Http/Snapshot/snapshots/admin/index.php | 8 + .../Snapshot/snapshots/admin/languages.txt | 113 +++ .../snapshots/admin/languages_add.txt | 87 +++ .../snapshots/admin/languages_edit.txt | 113 +++ .../snapshots/admin/languages_settings.txt | 104 +++ .../Snapshot/snapshots/admin/logs_admin.txt | 121 +++ .../snapshots/admin/logs_moderation.txt | 121 +++ .../snapshots/admin/logs_settings.txt | 263 +++++++ .../Snapshot/snapshots/admin/mail_queue.txt | 127 +++ .../snapshots/admin/mail_settings.txt | 195 +++++ .../Snapshot/snapshots/admin/mail_test.txt | 89 +++ .../snapshots/admin/maintain_database.txt | 97 +++ .../snapshots/admin/maintain_members.txt | 199 +++++ .../snapshots/admin/maintain_routine.txt | 121 +++ .../snapshots/admin/maintain_topics.txt | 182 +++++ .../snapshots/admin/manage_boards.txt | 108 +++ .../admin/manage_boards_edit_board.txt | 280 +++++++ .../admin/manage_boards_edit_category.txt | 123 +++ .../snapshots/admin/manage_boards_move.txt | 171 ++++ .../admin/manage_boards_new_board.txt | 299 +++++++ .../admin/manage_boards_new_category.txt | 124 +++ .../admin/manage_boards_settings.txt | 176 +++++ .../snapshots/admin/manage_calendar.txt | 64 ++ .../snapshots/admin/manage_search.txt | 133 ++++ .../admin/manage_search_settings.txt | 243 ++++++ .../snapshots/admin/manage_search_weights.txt | 155 ++++ .../Snapshot/snapshots/admin/membergroups.txt | 233 ++++++ .../snapshots/admin/membergroups_add.txt | 171 ++++ .../admin/membergroups_add_post_group.txt | 136 ++++ .../snapshots/admin/membergroups_edit.txt | 250 ++++++ .../snapshots/admin/membergroups_settings.txt | 112 +++ .../Http/Snapshot/snapshots/admin/members.txt | 110 +++ .../snapshots/admin/members_search.txt | 286 +++++++ .../snapshots/admin/members_settings.txt | 97 +++ .../Snapshot/snapshots/admin/merge_topic.txt | 100 +++ .../snapshots/admin/message_index.txt | 372 +++++++++ .../admin/moderate_group_requests.txt | 69 ++ .../snapshots/admin/moderate_index.txt | 93 +++ .../snapshots/admin/moderate_modlog.txt | 73 ++ .../admin/moderate_reported_members.txt | 81 ++ .../moderate_reported_members_closed.txt | 81 ++ .../admin/moderate_reported_posts.txt | 80 ++ .../admin/moderate_reported_posts_closed.txt | 80 ++ .../admin/moderate_unapproved_attachments.txt | 93 +++ .../admin/moderate_unapproved_posts.txt | 93 +++ .../admin/moderate_unapproved_topics.txt | 93 +++ .../snapshots/admin/moderate_view_groups.txt | 94 +++ .../snapshots/admin/moderate_warning_log.txt | 93 +++ .../admin/moderate_warning_templates.txt | 89 +++ .../snapshots/admin/moderate_warnings.txt | 93 +++ .../admin/moderate_watched_members.txt | 88 +++ .../admin/moderate_watched_posts.txt | 72 ++ .../snapshots/admin/moderation_menu.txt | 94 +++ .../Snapshot/snapshots/admin/modsettings.txt | 79 ++ .../Snapshot/snapshots/admin/move_topic.txt | 112 +++ .../Http/Snapshot/snapshots/admin/news.txt | 129 +++ .../Snapshot/snapshots/admin/news_mailing.txt | 202 +++++ .../snapshots/admin/news_settings.txt | 172 ++++ .../Snapshot/snapshots/admin/packages.txt | 141 ++++ .../snapshots/admin/packages_options.txt | 117 +++ .../snapshots/admin/paid_subscriptions.txt | 60 ++ .../Snapshot/snapshots/admin/permissions.txt | 338 ++++++++ .../snapshots/admin/permissions_board.txt | 131 ++++ .../snapshots/admin/permissions_group.txt | 550 +++++++++++++ .../snapshots/admin/permissions_profiles.txt | 161 ++++ .../snapshots/admin/permissions_settings.txt | 138 ++++ .../Snapshot/snapshots/admin/post_edit.txt | 237 ++++++ .../snapshots/admin/post_edit_poll.txt | 126 +++ .../snapshots/admin/post_settings.txt | 232 ++++++ .../snapshots/admin/post_settings_censor.txt | 142 ++++ .../snapshots/admin/post_settings_drafts.txt | 148 ++++ .../snapshots/admin/post_settings_topics.txt | 240 ++++++ .../snapshots/admin/profile_account.txt | 300 +++++++ .../snapshots/admin/profile_delete.txt | 184 +++++ .../snapshots/admin/profile_forum.txt | 367 +++++++++ .../snapshots/admin/profile_issue_warning.txt | 251 ++++++ .../snapshots/admin/profile_permissions.txt | 401 ++++++++++ .../snapshots/admin/profile_summary.txt | 238 ++++++ .../admin/profile_track_activity.txt | 223 ++++++ .../snapshots/admin/profile_track_edits.txt | 226 ++++++ .../snapshots/admin/profile_track_ip.txt | 198 +++++ .../snapshots/admin/profile_track_logins.txt | 197 +++++ .../Snapshot/snapshots/admin/registration.txt | 147 ++++ .../admin/registration_agreement.txt | 100 +++ .../snapshots/admin/registration_policy.txt | 99 +++ .../snapshots/admin/registration_reserved.txt | 117 +++ .../snapshots/admin/registration_settings.txt | 193 +++++ .../Http/Snapshot/snapshots/admin/reports.txt | 86 ++ .../snapshots/admin/scheduled_task_edit.txt | 87 +++ .../snapshots/admin/scheduled_tasks.txt | 245 ++++++ .../snapshots/admin/scheduled_tasks_log.txt | 62 ++ .../admin/scheduled_tasks_settings.txt | 62 ++ .../snapshots/admin/search_engines.txt | 177 +++++ .../Snapshot/snapshots/admin/server_cache.txt | 126 +++ .../snapshots/admin/server_cookie.txt | 218 ++++++ .../snapshots/admin/server_database.txt | 151 ++++ .../snapshots/admin/server_export.txt | 140 ++++ .../snapshots/admin/server_general.txt | 215 +++++ .../Snapshot/snapshots/admin/server_loads.txt | 177 +++++ .../snapshots/admin/server_security.txt | 280 +++++++ .../Http/Snapshot/snapshots/admin/smileys.txt | 138 ++++ .../snapshots/admin/smileys_new_set.txt | 105 +++ .../Snapshot/snapshots/admin/smileys_set.txt | 109 +++ .../snapshots/admin/smileys_settings.txt | 175 +++++ .../Snapshot/snapshots/admin/split_topic.txt | 185 +++++ .../Http/Snapshot/snapshots/admin/themes.txt | 180 +++++ .../Snapshot/snapshots/admin/themes_copy.txt | 521 +++++++++++++ .../Snapshot/snapshots/admin/themes_edit.txt | 96 +++ .../Snapshot/snapshots/admin/themes_list.txt | 126 +++ .../Snapshot/snapshots/admin/themes_reset.txt | 103 +++ .../snapshots/admin/themes_reset_options.txt | 362 +++++++++ .../snapshots/admin/themes_settings.txt | 264 +++++++ .../Snapshot/snapshots/admin/track_ip.txt | 101 +++ .../Snapshot/snapshots/admin/warnings.txt | 172 ++++ .../Snapshot/snapshots/guest/activate.txt | 25 + .../Snapshot/snapshots/guest/agreement.txt | 39 + .../Snapshot/snapshots/guest/board_index.txt | 92 +++ .../Http/Snapshot/snapshots/guest/chrome.txt | 124 +++ .../Http/Snapshot/snapshots/guest/credits.txt | 241 ++++++ .../Http/Snapshot/snapshots/guest/display.txt | 380 +++++++++ .../snapshots/guest/display_child.txt | 196 +++++ .../Snapshot/snapshots/guest/display_poll.txt | 218 ++++++ .../Http/Snapshot/snapshots/guest/groups.txt | 55 ++ .../Http/Snapshot/snapshots/guest/help.txt | 80 ++ .../Snapshot/snapshots/guest/help_popup.txt | 21 + .../Http/Snapshot/snapshots/guest/index.php | 8 + .../Http/Snapshot/snapshots/guest/login.txt | 59 ++ .../Snapshot/snapshots/guest/login_popup.txt | 41 + .../Snapshot/snapshots/guest/member_list.txt | 55 ++ .../snapshots/guest/message_index.txt | 243 ++++++ .../snapshots/guest/message_index_child.txt | 191 +++++ .../snapshots/guest/message_index_empty.txt | 127 +++ .../snapshots/guest/no_such_topic.txt | 25 + .../Snapshot/snapshots/guest/not_found.txt | 25 + .../Http/Snapshot/snapshots/guest/post.txt | 69 ++ .../Snapshot/snapshots/guest/printpage.txt | 124 +++ .../Http/Snapshot/snapshots/guest/profile.txt | 55 ++ .../Http/Snapshot/snapshots/guest/recent.txt | 240 ++++++ .../Snapshot/snapshots/guest/reminder.txt | 34 + .../Http/Snapshot/snapshots/guest/search.txt | 122 +++ .../snapshots/guest/search_results.txt | 101 +++ .../Http/Snapshot/snapshots/guest/signup.txt | 48 ++ .../Http/Snapshot/snapshots/guest/stats.txt | 203 +++++ .../Snapshot/snapshots/guest/theme_picker.txt | 5 + .../Http/Snapshot/snapshots/guest/unread.txt | 55 ++ .../Http/Snapshot/snapshots/index.php | 8 + .../Snapshot/snapshots/member/board_index.txt | 95 +++ .../snapshots/member/calendar_list.txt | 210 +++++ .../snapshots/member/calendar_month.txt | 222 ++++++ .../snapshots/member/calendar_post.txt | 25 + .../snapshots/member/calendar_week.txt | 283 +++++++ .../Http/Snapshot/snapshots/member/chrome.txt | 152 ++++ .../Snapshot/snapshots/member/credits.txt | 241 ++++++ .../Snapshot/snapshots/member/display.txt | 641 +++++++++++++++ .../snapshots/member/display_child.txt | 353 +++++++++ .../snapshots/member/display_poll.txt | 324 ++++++++ .../Http/Snapshot/snapshots/member/groups.txt | 67 ++ .../Http/Snapshot/snapshots/member/help.txt | 80 ++ .../Http/Snapshot/snapshots/member/index.php | 8 + .../Http/Snapshot/snapshots/member/likes.txt | 5 + .../Snapshot/snapshots/member/member_list.txt | 115 +++ .../snapshots/member/member_list_search.txt | 68 ++ .../snapshots/member/message_index.txt | 371 +++++++++ .../snapshots/member/message_index_child.txt | 319 ++++++++ .../snapshots/member/message_index_empty.txt | 226 ++++++ .../snapshots/member/other_profile_posts.txt | 210 +++++ .../member/other_profile_summary.txt | 149 ++++ .../Snapshot/snapshots/member/pm_inbox.txt | 249 ++++++ .../Snapshot/snapshots/member/pm_labels.txt | 128 +++ .../Snapshot/snapshots/member/pm_outbox.txt | 131 ++++ .../Snapshot/snapshots/member/pm_prune.txt | 110 +++ .../Snapshot/snapshots/member/pm_read.txt | 249 ++++++ .../Snapshot/snapshots/member/pm_reply.txt | 197 +++++ .../Snapshot/snapshots/member/pm_rules.txt | 112 +++ .../Snapshot/snapshots/member/pm_search.txt | 173 +++++ .../Snapshot/snapshots/member/pm_send.txt | 182 +++++ .../Snapshot/snapshots/member/pm_settings.txt | 151 ++++ .../snapshots/member/post_in_locked_topic.txt | 39 + .../snapshots/member/post_new_poll.txt | 254 ++++++ .../snapshots/member/post_new_topic.txt | 202 +++++ .../Snapshot/snapshots/member/post_reply.txt | 344 ++++++++ .../Snapshot/snapshots/member/printpage.txt | 124 +++ .../snapshots/member/profile_account.txt | 144 ++++ .../snapshots/member/profile_alerts.txt | 144 ++++ .../snapshots/member/profile_attachments.txt | 201 +++++ .../snapshots/member/profile_buddies.txt | 207 +++++ .../snapshots/member/profile_delete.txt | 162 ++++ .../snapshots/member/profile_drafts.txt | 162 ++++ .../snapshots/member/profile_forum.txt | 343 ++++++++ .../snapshots/member/profile_groups.txt | 218 ++++++ .../member/profile_ignore_boards.txt | 218 ++++++ .../snapshots/member/profile_ignore_list.txt | 206 +++++ .../snapshots/member/profile_notification.txt | 348 +++++++++ .../member/profile_notification_boards.txt | 207 +++++ .../member/profile_notification_topics.txt | 213 +++++ .../snapshots/member/profile_permissions.txt | 218 ++++++ .../snapshots/member/profile_posts.txt | 303 ++++++++ .../snapshots/member/profile_statistics.txt | 215 +++++ .../snapshots/member/profile_summary.txt | 218 ++++++ .../snapshots/member/profile_theme.txt | 529 +++++++++++++ .../snapshots/member/profile_topics.txt | 299 +++++++ .../Http/Snapshot/snapshots/member/recent.txt | 316 ++++++++ .../snapshots/member/report_to_moderator.txt | 56 ++ .../Http/Snapshot/snapshots/member/search.txt | 122 +++ .../snapshots/member/search_results.txt | 101 +++ .../Http/Snapshot/snapshots/member/stats.txt | 204 +++++ .../snapshots/member/theme_picker.txt | 5 + .../Http/Snapshot/snapshots/member/unread.txt | 33 + .../snapshots/member/unread_replies.txt | 30 + tests/Support/DomSnapshot.php | 551 +++++++++++++ tests/Unit/Support/DomSnapshotTest.php | 277 +++++++ tests/Unit/Support/index.php | 8 + 251 files changed, 44483 insertions(+) create mode 100644 tests/Integration/Http/Snapshot/AdminSnapshotTest.php create mode 100644 tests/Integration/Http/Snapshot/CalendarSnapshotTest.php create mode 100644 tests/Integration/Http/Snapshot/GuestSnapshotTest.php create mode 100644 tests/Integration/Http/Snapshot/MemberSnapshotTest.php create mode 100644 tests/Integration/Http/Snapshot/SnapshotTestCase.php create mode 100644 tests/Integration/Http/Snapshot/fixture-forum.php create mode 100644 tests/Integration/Http/Snapshot/index.php create mode 100644 tests/Integration/Http/Snapshot/perturb-forum.php create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/admin_credits.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/admin_index.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/admin_menu.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/antispam.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/attachments.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/attachments_avatars.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/attachments_browse.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/attachments_browse_avatars.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/attachments_browse_thumbs.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/attachments_maintenance.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/attachments_paths.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/bans.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/bans_add.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/bans_browse.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/bans_log.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/board_index.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/chrome.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/display.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/display_poll.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/features_alerts.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/features_basic.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/features_bbc.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/features_layout.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/features_likes.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/features_mentions.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/features_profile.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/features_profile_field_edit.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/features_profile_field_new.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/features_sig.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/index.php create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/languages.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/languages_add.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/languages_edit.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/languages_settings.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/logs_admin.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/logs_moderation.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/logs_settings.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/mail_queue.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/mail_settings.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/mail_test.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/maintain_database.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/maintain_members.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/maintain_routine.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/maintain_topics.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/manage_boards.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_edit_board.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_edit_category.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_move.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_new_board.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_new_category.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_settings.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/manage_calendar.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/manage_search.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/manage_search_settings.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/manage_search_weights.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/membergroups.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/membergroups_add.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/membergroups_add_post_group.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/membergroups_edit.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/membergroups_settings.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/members.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/members_search.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/members_settings.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/merge_topic.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/message_index.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/moderate_group_requests.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/moderate_index.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/moderate_modlog.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/moderate_reported_members.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/moderate_reported_members_closed.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/moderate_reported_posts.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/moderate_reported_posts_closed.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/moderate_unapproved_attachments.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/moderate_unapproved_posts.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/moderate_unapproved_topics.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/moderate_view_groups.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/moderate_warning_log.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/moderate_warning_templates.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/moderate_warnings.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/moderate_watched_members.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/moderate_watched_posts.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/moderation_menu.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/modsettings.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/move_topic.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/news.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/news_mailing.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/news_settings.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/packages.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/packages_options.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/paid_subscriptions.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/permissions.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/permissions_board.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/permissions_group.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/permissions_profiles.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/permissions_settings.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/post_edit.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/post_edit_poll.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/post_settings.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/post_settings_censor.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/post_settings_drafts.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/post_settings_topics.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/profile_account.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/profile_delete.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/profile_forum.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/profile_issue_warning.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/profile_permissions.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/profile_summary.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/profile_track_activity.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/profile_track_edits.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/profile_track_ip.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/profile_track_logins.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/registration.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/registration_agreement.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/registration_policy.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/registration_reserved.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/registration_settings.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/reports.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/scheduled_task_edit.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/scheduled_tasks.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/scheduled_tasks_log.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/scheduled_tasks_settings.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/search_engines.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/server_cache.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/server_cookie.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/server_database.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/server_export.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/server_general.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/server_loads.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/server_security.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/smileys.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/smileys_new_set.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/smileys_set.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/smileys_settings.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/split_topic.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/themes.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/themes_copy.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/themes_edit.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/themes_list.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/themes_reset.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/themes_reset_options.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/themes_settings.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/track_ip.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/admin/warnings.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/activate.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/agreement.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/board_index.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/chrome.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/credits.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/display.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/display_child.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/display_poll.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/groups.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/help.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/help_popup.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/index.php create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/login.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/login_popup.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/member_list.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/message_index.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/message_index_child.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/message_index_empty.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/no_such_topic.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/not_found.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/post.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/printpage.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/profile.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/recent.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/reminder.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/search.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/search_results.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/signup.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/stats.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/theme_picker.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/guest/unread.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/index.php create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/board_index.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/calendar_list.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/calendar_month.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/calendar_post.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/calendar_week.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/chrome.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/credits.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/display.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/display_child.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/display_poll.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/groups.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/help.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/index.php create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/likes.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/member_list.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/member_list_search.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/message_index.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/message_index_child.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/message_index_empty.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/other_profile_posts.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/other_profile_summary.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/pm_inbox.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/pm_labels.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/pm_outbox.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/pm_prune.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/pm_read.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/pm_reply.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/pm_rules.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/pm_search.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/pm_send.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/pm_settings.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/post_in_locked_topic.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/post_new_poll.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/post_new_topic.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/post_reply.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/printpage.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/profile_account.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/profile_alerts.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/profile_attachments.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/profile_buddies.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/profile_delete.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/profile_drafts.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/profile_forum.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/profile_groups.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/profile_ignore_boards.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/profile_ignore_list.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/profile_notification.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/profile_notification_boards.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/profile_notification_topics.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/profile_permissions.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/profile_posts.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/profile_statistics.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/profile_summary.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/profile_theme.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/profile_topics.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/recent.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/report_to_moderator.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/search.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/search_results.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/stats.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/theme_picker.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/unread.txt create mode 100644 tests/Integration/Http/Snapshot/snapshots/member/unread_replies.txt create mode 100644 tests/Support/DomSnapshot.php create mode 100644 tests/Unit/Support/DomSnapshotTest.php create mode 100644 tests/Unit/Support/index.php diff --git a/AGENTS.md b/AGENTS.md index c9a0339583f..2bd857966a0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -339,6 +339,36 @@ in place*, because MySQL silently coerces text to a number where PostgreSQL refu On PostgreSQL a failed query also poisons the rest of the transaction, so one swallowed error turns every later query in the test into `false`. +#### Template snapshots + +`tests/Integration/Http/Snapshot/` records what about 250 pages render today, as a guest, +a member and an administrator, in `snapshots//.txt`. It exists so a +change to the template layer, such as moving the templates to another engine, can be +checked page by page: a page that renders differently fails, and the diff says how. + +```bash +.dev/test.sh --engine mysql --testsuite snapshot +SMF_UPDATE_SNAPSHOTS=1 .dev/test.sh --engine mysql --testsuite snapshot # re-record +``` + +- **What is compared is not the HTML.** `tests/Support/DomSnapshot.php` reduces a page to + its elements, attributes and text, with whitespace, comments and attribute order + dropped and the forum's own data masked: ids and counts become `#`, dates `{date}`, + names and subjects `{member}`, `{board}`, `{subject}`, and identical rows of a list + collapse into one. So reflowing a template is not a failure, and neither is somebody + posting. +- **Pages that list content look at fixtures.** `fixture-forum.php` builds a category of + boards, topics, members, a poll, a PM and calendar events with pinned dates, once per + forum, and the snapshots are scoped to it. Point a new case at a fixture, not at + whatever the forum happens to hold. +- **A snapshot includes what the page logged.** A conversion that renders the same page + while logging an undefined index shows up as a diff too. +- **Re-recording is a decision, not a fix.** Read the diff first. The only diffs that + should appear while converting templates are ones you meant to make. +- **Check a new case is stable** by recording it on a fresh forum, running + `perturb-forum.php` (which adds unrelated members, boards and posts, so only on a + forum you will throw away), and running the suite again without recording. + #### Writing one `tests/Unit/Test.php`, namespace `SMF\Tests\Unit`, `declare(strict_types=1)`, diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 8d9fe7313e0..fd802300bd5 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -26,6 +26,16 @@ tests/Integration/Http + tests/Integration/Http/Snapshot + + + + + tests/Integration/Http/Snapshot diff --git a/tests/Integration/Http/Snapshot/AdminSnapshotTest.php b/tests/Integration/Http/Snapshot/AdminSnapshotTest.php new file mode 100644 index 00000000000..85aceed79c7 --- /dev/null +++ b/tests/Integration/Http/Snapshot/AdminSnapshotTest.php @@ -0,0 +1,302 @@ + .sub_bar', '#admin_content .windowbg > form']; + + /** + * The versions of the database, PHP, the web server and the extensions, + * which describe the machine rather than the forum: Apache in the + * container, PHP's own server in CI, and MySQL or PostgreSQL either way. + */ + public const SUPPORT_INFORMATION = [ + '#admin_content .roundframe > .title_bar:not(#support_resources) + .padding', + '#admin_content script', + ]; + + /** + * Which cache accelerators PHP was built with, and the settings form, which + * has a section for each one it found. The form is the same settings + * template as every other settings page here. + */ + public const CACHE_SETTINGS = [ + '#admin_content .information + .information', + '#admin_form_wrapper .windowbg', + ]; + + /**************** + * Public methods + ****************/ + + #[DataProvider('pages')] + public function testThePageRendersAsItDid(string $name, string $path, array $roots = self::ADMIN, array $ignore = [], array $only = [], array $unordered = []): void + { + $this->assertPageMatchesSnapshot($name, $path, $roots, $ignore, $only, $unordered); + } + + public function testTheChromeRendersAsItDid(): void + { + $this->assertPageMatchesSnapshot('chrome', '', self::CHROME, self::CHROME_IGNORE); + } + + public function testTheAdminMenuRendersAsItDid(): void + { + $this->assertPageMatchesSnapshot('admin_menu', '?action=admin', ['#genericmenu']); + } + + public function testTheModerationMenuRendersAsItDid(): void + { + $this->assertPageMatchesSnapshot('moderation_menu', '?action=moderate', ['#genericmenu']); + } + + /*********************** + * Public static methods + ***********************/ + + public static function audience(): string + { + return 'admin'; + } + + /** + * The pages, as name, path, and optionally what to compare and what to + * leave out of it. + * + * @return array The cases. + */ + public static function pages(): array + { + return self::cases([ + // The forum, as an administrator sees it. + ['board_index', '', self::BOARD_INDEX, self::BOARD_INDEX_IGNORE], + ['message_index', '?board={board:Snapshot board}.0', self::PAGE], + ['display', '?topic={topic:Snapshot topic}.0', self::PAGE], + ['display_poll', '?topic={topic:Snapshot poll topic}.0', self::PAGE], + ['post_edit', '?action=post;msg={first_msg:Snapshot topic};topic={topic:Snapshot topic}.0', self::PAGE], + ['post_edit_poll', '?action=editpoll;topic={topic:Snapshot poll topic}.0', self::PAGE], + ['split_topic', '?action=splittopics;topic={topic:Snapshot topic}.0;at={first_msg:Snapshot topic}', self::PAGE, [], [], ['.split_messages']], + ['merge_topic', '?action=mergetopics;board={board:Snapshot board}.0;from={topic:Snapshot second topic}', self::PAGE, [], ['select[name="targetboard"] optgroup']], + ['move_topic', '?action=movetopic;current_board={board:Snapshot board};topic={topic:Snapshot second topic}.0', self::PAGE, [], ['select[name="toboard"] optgroup']], + ['track_ip', '?action=trackip;searchip=127.0.0.1', self::PAGE, self::LOG_ROWS, self::LIST_PAGES], + + // A member's profile, as an administrator sees it. + ['profile_summary', '?action=profile;u={member:snapshot_member}', self::PAGE], + ['profile_account', '?action=profile;u={member:snapshot_member};area=account', self::PAGE], + ['profile_forum', '?action=profile;u={member:snapshot_member};area=forumprofile', self::PAGE], + ['profile_permissions', '?action=profile;u={member:snapshot_member};area=permissions', self::PAGE, [], [], ['table.table_grid tbody']], + ['profile_issue_warning', '?action=profile;u={member:snapshot_member};area=issuewarning', self::PAGE], + ['profile_track_activity', '?action=profile;u={member:snapshot_member};area=tracking;sa=activity', self::PAGE, [...self::LOG_ROWS, ...self::SHARED_ADDRESSES], self::LIST_PAGES], + ['profile_track_ip', '?action=profile;u={member:snapshot_member};area=tracking;sa=ip', self::PAGE, self::LOG_ROWS, self::LIST_PAGES], + ['profile_track_edits', '?action=profile;u={member:snapshot_member};area=tracking;sa=edits', self::PAGE, self::SHARED_ADDRESSES], + ['profile_track_logins', '?action=profile;u={member:snapshot_member};area=tracking;sa=logins', self::PAGE, self::LOG_ROWS, self::LIST_PAGES], + ['profile_delete', '?action=profile;u={member:snapshot_member};area=deleteaccount', self::PAGE], + + // The moderation centre. + ['moderate_index', '?action=moderate;area=index'], + ['moderate_modlog', '?action=moderate;area=modlog', self::ADMIN, self::LOG_ROWS, self::LIST_PAGES], + ['moderate_reported_posts', '?action=moderate;area=reportedposts'], + ['moderate_reported_posts_closed', '?action=moderate;area=reportedposts;sa=closed'], + ['moderate_reported_members', '?action=moderate;area=reportedmembers'], + ['moderate_reported_members_closed', '?action=moderate;area=reportedmembers;sa=closed'], + ['moderate_warnings', '?action=moderate;area=warnings'], + ['moderate_warning_log', '?action=moderate;area=warnings;sa=log'], + ['moderate_warning_templates', '?action=moderate;area=warnings;sa=templates'], + ['moderate_group_requests', '?action=moderate;area=groups;sa=requests'], + ['moderate_view_groups', '?action=moderate;area=viewgroups'], + ['moderate_watched_members', '?action=moderate;area=userwatch;sa=member'], + ['moderate_watched_posts', '?action=moderate;area=userwatch;sa=post'], + ['moderate_unapproved_posts', '?action=moderate;area=postmod;sa=posts'], + ['moderate_unapproved_topics', '?action=moderate;area=postmod;sa=topics'], + ['moderate_unapproved_attachments', '?action=moderate;area=attachmod'], + + // Administration: the centre itself. + ['admin_index', '?action=admin'], + ['admin_credits', '?action=admin;area=credits', self::ADMIN, self::SUPPORT_INFORMATION], + + // Configuration. + ['features_basic', '?action=admin;area=featuresettings;sa=basic'], + ['features_bbc', '?action=admin;area=featuresettings;sa=bbc'], + ['features_layout', '?action=admin;area=featuresettings;sa=layout'], + ['features_sig', '?action=admin;area=featuresettings;sa=sig'], + ['features_profile', '?action=admin;area=featuresettings;sa=profile'], + ['features_profile_field_new', '?action=admin;area=featuresettings;sa=profileedit'], + ['features_profile_field_edit', '?action=admin;area=featuresettings;sa=profileedit;fid=1'], + ['features_likes', '?action=admin;area=featuresettings;sa=likes'], + ['features_mentions', '?action=admin;area=featuresettings;sa=mentions'], + ['features_alerts', '?action=admin;area=featuresettings;sa=alerts'], + ['antispam', '?action=admin;area=antispam'], + ['languages', '?action=admin;area=languages'], + ['languages_add', '?action=admin;area=languages;sa=add'], + ['languages_edit', '?action=admin;area=languages;sa=edit'], + ['languages_settings', '?action=admin;area=languages;sa=settings'], + ['server_general', '?action=admin;area=serversettings;sa=general'], + ['server_database', '?action=admin;area=serversettings;sa=database', self::ADMIN, [], self::ENGINE_SETTINGS], + ['server_cookie', '?action=admin;area=serversettings;sa=cookie'], + ['server_security', '?action=admin;area=serversettings;sa=security'], + ['server_cache', '?action=admin;area=serversettings;sa=cache', self::ADMIN, self::CACHE_SETTINGS], + ['server_export', '?action=admin;area=serversettings;sa=export'], + ['server_loads', '?action=admin;area=serversettings;sa=loads'], + ['themes', '?action=admin;area=theme;sa=admin'], + ['themes_list', '?action=admin;area=theme;sa=list'], + ['themes_settings', '?action=admin;area=theme;sa=list;th=1'], + ['themes_reset', '?action=admin;area=theme;sa=reset'], + ['themes_reset_options', '?action=admin;area=theme;th=1;sa=reset;who=1'], + ['themes_edit', '?action=admin;area=theme;sa=edit'], + ['themes_copy', '?action=admin;area=theme;th=1;sa=copy'], + ['modsettings', '?action=admin;area=modsettings;sa=general'], + + // Layout. + ['manage_boards', '?action=admin;area=manageboards;sa=main', self::ADMIN, [], self::CATEGORY_LIST], + ['manage_boards_move', '?action=admin;area=manageboards;move={board:Snapshot child two}', self::ADMIN, [], self::CATEGORY_LIST], + ['manage_boards_new_category', '?action=admin;area=manageboards;sa=newcat', self::ADMIN, [], ['select[name="cat_order"] option']], + ['manage_boards_edit_category', '?action=admin;area=manageboards;sa=cat;cat={category}', self::ADMIN, [], ['select[name="cat_order"] option']], + ['manage_boards_new_board', '?action=admin;area=manageboards;sa=newboard;cat={category}', self::ADMIN, [], ['select[name="new_cat"] option'], self::PROFILE_LISTS], + ['manage_boards_edit_board', '?action=admin;area=manageboards;sa=board;boardid={board:Snapshot board}', self::ADMIN, [], ['select[name="new_cat"] option'], self::PROFILE_LISTS], + ['manage_boards_settings', '?action=admin;area=manageboards;sa=settings', self::ADMIN, [], ['#recycle_board option']], + ['news', '?action=admin;area=news;sa=editnews'], + ['news_mailing', '?action=admin;area=news;sa=mailingmembers'], + ['news_settings', '?action=admin;area=news;sa=settings'], + ['post_settings', '?action=admin;area=postsettings;sa=posts'], + ['post_settings_topics', '?action=admin;area=postsettings;sa=topics'], + ['post_settings_drafts', '?action=admin;area=postsettings;sa=drafts'], + ['post_settings_censor', '?action=admin;area=postsettings;sa=censor'], + ['manage_calendar', '?action=admin;area=managecalendar'], + ['manage_search', '?action=admin;area=managesearch;sa=method'], + ['manage_search_settings', '?action=admin;area=managesearch;sa=settings'], + ['manage_search_weights', '?action=admin;area=managesearch;sa=weights'], + ['search_engines', '?action=admin;area=sengines'], + ['smileys', '?action=admin;area=smileys;sa=editsets'], + ['smileys_set', '?action=admin;area=smileys;sa=modifyset;set=fugue'], + ['smileys_new_set', '?action=admin;area=smileys;sa=modifyset'], + ['smileys_settings', '?action=admin;area=smileys;sa=settings'], + ['attachments', '?action=admin;area=manageattachments;sa=attachments'], + ['attachments_avatars', '?action=admin;area=manageattachments;sa=avatars'], + ['attachments_browse', '?action=admin;area=manageattachments;sa=browse'], + ['attachments_browse_avatars', '?action=admin;area=manageattachments;sa=browse;avatars'], + ['attachments_browse_thumbs', '?action=admin;area=manageattachments;sa=browse;thumbs'], + ['attachments_maintenance', '?action=admin;area=manageattachments;sa=maintenance'], + ['attachments_paths', '?action=admin;area=manageattachments;sa=attachpaths'], + + // Members. + ['members', '?action=admin;area=viewmembers;sa=all', self::ADMIN, self::LOG_ROWS, self::LIST_PAGES], + ['members_search', '?action=admin;area=viewmembers;sa=search'], + ['members_settings', '?action=admin;area=viewmembers;sa=settings'], + ['membergroups', '?action=admin;area=membergroups;sa=index'], + ['membergroups_add', '?action=admin;area=membergroups;sa=add;generalgroup', self::ADMIN, [], ['li.category']], + ['membergroups_add_post_group', '?action=admin;area=membergroups;sa=add;postgroup', self::ADMIN, [], ['li.category']], + ['membergroups_edit', '?action=admin;area=membergroups;sa=edit;group=2', self::ADMIN, [], ['li.category']], + ['membergroups_settings', '?action=admin;area=membergroups;sa=settings'], + ['permissions', '?action=admin;area=permissions;sa=index'], + ['permissions_group', '?action=admin;area=permissions;sa=modify;group=0'], + ['permissions_board', '?action=admin;area=permissions;sa=board', self::ADMIN, [], ['#admin_content .windowbg > .sub_bar', '#admin_content ul.perm_boards']], + ['permissions_profiles', '?action=admin;area=permissions;sa=profiles', self::ADMIN, [], [], self::PROFILE_LISTS], + ['permissions_settings', '?action=admin;area=permissions;sa=settings'], + ['registration', '?action=admin;area=regcenter;sa=register'], + ['registration_agreement', '?action=admin;area=regcenter;sa=agreement'], + ['registration_policy', '?action=admin;area=regcenter;sa=policy'], + ['registration_reserved', '?action=admin;area=regcenter;sa=reservednames'], + ['registration_settings', '?action=admin;area=regcenter;sa=settings'], + ['bans', '?action=admin;area=ban;sa=list'], + ['bans_add', '?action=admin;area=ban;sa=add'], + ['bans_browse', '?action=admin;area=ban;sa=browse;entity=ip'], + ['bans_log', '?action=admin;area=ban;sa=log', self::ADMIN, self::LOG_ROWS, self::LIST_PAGES], + ['paid_subscriptions', '?action=admin;area=paidsubscribe'], + ['warnings', '?action=admin;area=warnings'], + + // Maintenance. + ['maintain_routine', '?action=admin;area=maintain;sa=routine'], + ['maintain_database', '?action=admin;area=maintain;sa=database'], + ['maintain_members', '?action=admin;area=maintain;sa=members'], + // The board picker for pruning splits the categories into two + // columns by how many there are, so which column the fixtures land in + // is the forum's business. The same boards are in the two selects. + ['maintain_topics', '?action=admin;area=maintain;sa=topics', self::ADMIN, ['#rotPanel > div'], ['#id_board_from optgroup', '#id_board_to optgroup']], + ['scheduled_tasks', '?action=admin;area=scheduledtasks;sa=tasks', self::ADMIN, [], [], ['#scheduled_tasks tbody']], + ['scheduled_task_edit', '?action=admin;area=scheduledtasks;sa=taskedit;tid=3'], + ['scheduled_tasks_log', '?action=admin;area=scheduledtasks;sa=tasklog', self::ADMIN, self::LOG_ROWS, self::LIST_PAGES], + ['scheduled_tasks_settings', '?action=admin;area=scheduledtasks;sa=settings'], + ['logs_settings', '?action=admin;area=logs;sa=settings'], + ['logs_admin', '?action=admin;area=logs;sa=adminlog', self::ADMIN, self::LOG_ROWS, self::LIST_PAGES], + ['logs_moderation', '?action=admin;area=logs;sa=modlog', self::ADMIN, self::LOG_ROWS, self::LIST_PAGES], + ['mail_queue', '?action=admin;area=mailqueue;sa=browse'], + ['mail_settings', '?action=admin;area=mailqueue;sa=settings'], + ['mail_test', '?action=admin;area=mailqueue;sa=test'], + ['reports', '?action=admin;area=reports'], + ['packages', '?action=admin;area=packages;sa=browse'], + ['packages_options', '?action=admin;area=packages;sa=options'], + ]); + } +} diff --git a/tests/Integration/Http/Snapshot/CalendarSnapshotTest.php b/tests/Integration/Http/Snapshot/CalendarSnapshotTest.php new file mode 100644 index 00000000000..5c49a619e9e --- /dev/null +++ b/tests/Integration/Http/Snapshot/CalendarSnapshotTest.php @@ -0,0 +1,116 @@ +assertPageMatchesSnapshot($name, $path, $roots, $ignore, $only, $unordered); + } + + /*********************** + * Public static methods + ***********************/ + + public static function audience(): string + { + return 'member'; + } + + public static function tearDownAfterClass(): void + { + if (self::$previous !== null && isset(Db::$db)) { + self::setCalendar(self::$previous); + self::$previous = null; + } + + parent::tearDownAfterClass(); + } + + /** + * The pages, as name, path, and optionally what to compare and what to + * leave out of it. + * + * @return array The cases. + */ + public static function pages(): array + { + return self::cases([ + ['calendar_month', '?action=calendar;year=2020;month=1;day=15'], + ['calendar_week', '?action=calendar;viewweek;year=2020;month=1;day=20'], + ['calendar_list', '?action=calendar;viewlist;year=2020;month=1;day=1'], + ['calendar_post', '?action=calendar;sa=post'], + ]); + } + + /****************** + * Internal methods + ******************/ + + protected function setUp(): void + { + parent::setUp(); + + if (self::$previous === null) { + self::$previous = $this->rawSetting('cal_enabled') ?? '0'; + self::setCalendar('1'); + } + } + + /************************* + * Internal static methods + *************************/ + + /** + * Turns the calendar on or off. + * + * Written to the table rather than through Config::updateModSettings(), + * which skips a value it believes is already set. IntegrationTestCase puts + * Config::$modSettings back after every test, so by the time this class + * finishes, the copy in memory says the calendar is off while the table + * still says it is on, and the calendar would never be turned off again. + * + * @param string $value '1' or '0'. + */ + private static function setCalendar(string $value): void + { + Db::$db->insert( + 'replace', + '{db_prefix}settings', + ['variable' => 'string-255', 'value' => 'string-65534'], + [['cal_enabled', $value]], + ['variable'], + ); + } +} diff --git a/tests/Integration/Http/Snapshot/GuestSnapshotTest.php b/tests/Integration/Http/Snapshot/GuestSnapshotTest.php new file mode 100644 index 00000000000..8f4f4f8cf86 --- /dev/null +++ b/tests/Integration/Http/Snapshot/GuestSnapshotTest.php @@ -0,0 +1,90 @@ +assertPageMatchesSnapshot($name, $path, $roots, $ignore, $only, $unordered); + } + + public function testTheChromeRendersAsItDid(): void + { + $this->assertPageMatchesSnapshot('chrome', '', self::CHROME, self::CHROME_IGNORE); + } + + /*********************** + * Public static methods + ***********************/ + + public static function audience(): string + { + return 'guest'; + } + + /** + * The pages, as name, path, and optionally what to compare and what to + * leave out of it. + * + * @return array The cases. + */ + public static function pages(): array + { + return self::cases([ + // Browsing. + ['board_index', '', self::BOARD_INDEX, self::BOARD_INDEX_IGNORE], + ['message_index', '?board={board:Snapshot board}.0'], + ['message_index_child', '?board={board:Snapshot child one}.0'], + ['message_index_empty', '?board={board:Snapshot empty board}.0'], + ['display', '?topic={topic:Snapshot topic}.0'], + ['display_poll', '?topic={topic:Snapshot poll topic}.0'], + ['display_child', '?topic={topic:Snapshot child topic}.0'], + ['printpage', '?action=printpage;topic={topic:Snapshot topic}.0', self::WHOLE_PAGE], + ['recent', '?action=recent;c={category}'], + ['unread', '?action=unread'], + ['post', '?action=post;board={board:Snapshot board}.0'], + ['not_found', '?action=smf_snapshot_no_such_action'], + ['no_such_topic', '?topic=999999999.0'], + + // Signing in and up. + ['login', '?action=login'], + ['login_popup', '?action=login;ajax', self::WHOLE_PAGE], + ['reminder', '?action=reminder'], + ['activate', '?action=activate'], + ['signup', '?action=signup'], + ['agreement', '?action=agreement'], + + // Everything else a guest can try. + ['search', '?action=search', self::PAGE, [], ['.boardslist > ul > li']], + ['search_results', '?action=search2;search=bold;brd[{board:Snapshot board}]={board:Snapshot board}'], + // Narrowed to the fixture members by a search, since the list of everybody + // grows a page at a time. + ['member_list', '?action=mlist;sa=search;search=snapshot;fields=name'], + ['profile', '?action=profile;u={member:snapshot_member}'], + ['stats', '?action=stats'], + ['groups', '?action=groups'], + ['help', '?action=help'], + ['help_popup', '?action=helpadmin;help=registration_agreement', self::WHOLE_PAGE], + ['credits', '?action=credits'], + ['theme_picker', '?action=theme;sa=pick'], + ]); + } +} diff --git a/tests/Integration/Http/Snapshot/MemberSnapshotTest.php b/tests/Integration/Http/Snapshot/MemberSnapshotTest.php new file mode 100644 index 00000000000..19ec8aa5a10 --- /dev/null +++ b/tests/Integration/Http/Snapshot/MemberSnapshotTest.php @@ -0,0 +1,124 @@ +assertPageMatchesSnapshot($name, $path, $roots, $ignore, $only, $unordered); + } + + public function testTheChromeRendersAsItDid(): void + { + $this->assertPageMatchesSnapshot('chrome', '', self::CHROME, self::CHROME_IGNORE); + } + + /*********************** + * Public static methods + ***********************/ + + public static function audience(): string + { + return 'member'; + } + + /** + * The pages, as name, path, and optionally what to compare and what to + * leave out of it. + * + * @return array The cases. + */ + public static function pages(): array + { + return self::cases([ + // Browsing. + ['board_index', '', self::BOARD_INDEX, self::BOARD_INDEX_IGNORE], + ['message_index', '?board={board:Snapshot board}.0'], + ['message_index_child', '?board={board:Snapshot child one}.0'], + ['message_index_empty', '?board={board:Snapshot empty board}.0'], + ['display', '?topic={topic:Snapshot topic}.0'], + ['display_poll', '?topic={topic:Snapshot poll topic}.0'], + ['display_child', '?topic={topic:Snapshot child topic}.0'], + ['printpage', '?action=printpage;topic={topic:Snapshot topic}.0', self::WHOLE_PAGE], + ['recent', '?action=recent;c={category}'], + ['unread', '?action=unread;boards={board:Snapshot board}'], + ['unread_replies', '?action=unreadreplies;boards={board:Snapshot board}'], + + // Posting. + ['post_new_topic', '?action=post;board={board:Snapshot board}.0'], + ['post_reply', '?action=post;topic={topic:Snapshot topic}.0'], + ['post_new_poll', '?action=post;board={board:Snapshot board}.0;poll'], + ['post_in_locked_topic', '?action=post;topic={topic:Snapshot poll topic}.0'], + ['report_to_moderator', '?action=reporttm;topic={topic:Snapshot topic}.0;msg={first_msg:Snapshot topic}'], + + // Personal messages. + ['pm_inbox', '?action=pm'], + ['pm_outbox', '?action=pm;f=sent'], + ['pm_read', '?action=pm;pmsg={pm}'], + ['pm_send', '?action=pm;sa=send'], + ['pm_reply', '?action=pm;sa=send;f=inbox;pmsg={pm};quote;u={member:snapshot_other}'], + ['pm_search', '?action=pm;sa=search'], + ['pm_labels', '?action=pm;sa=manlabels'], + ['pm_rules', '?action=pm;sa=manrules'], + ['pm_settings', '?action=pm;sa=settings'], + ['pm_prune', '?action=pm;sa=prune'], + + // The member's own profile. + ['profile_summary', '?action=profile'], + ['profile_statistics', '?action=profile;area=statistics'], + ['profile_posts', '?action=profile;area=showposts'], + ['profile_topics', '?action=profile;area=showposts;sa=topics'], + ['profile_attachments', '?action=profile;area=showposts;sa=attach'], + ['profile_alerts', '?action=profile;area=showalerts'], + ['profile_drafts', '?action=profile;area=showdrafts'], + ['profile_permissions', '?action=profile;area=permissions', self::PAGE, [], [], ['table.table_grid tbody']], + ['profile_account', '?action=profile;area=account'], + ['profile_forum', '?action=profile;area=forumprofile'], + ['profile_theme', '?action=profile;area=theme'], + ['profile_notification', '?action=profile;area=notification'], + ['profile_notification_topics', '?action=profile;area=notification;sa=topics'], + ['profile_notification_boards', '?action=profile;area=notification;sa=boards'], + ['profile_ignore_boards', '?action=profile;area=ignoreboards'], + ['profile_buddies', '?action=profile;area=lists;sa=buddies'], + ['profile_ignore_list', '?action=profile;area=lists;sa=ignore'], + ['profile_groups', '?action=profile;area=groupmembership'], + ['profile_delete', '?action=profile;area=deleteaccount'], + + // Somebody else's profile. + ['other_profile_summary', '?action=profile;u={member:snapshot_other}'], + ['other_profile_posts', '?action=profile;u={member:snapshot_other};area=showposts'], + + // Everything else a member can reach. + ['search', '?action=search', self::PAGE, [], ['.boardslist > ul > li']], + ['search_results', '?action=search2;search=bold;brd[{board:Snapshot board}]={board:Snapshot board}'], + // Narrowed to the fixture members by a search, since the list of everybody + // grows a page at a time. + ['member_list', '?action=mlist;sa=search;search=snapshot;fields=name'], + ['member_list_search', '?action=mlist;sa=search'], + ['groups', '?action=groups'], + ['stats', '?action=stats'], + ['help', '?action=help'], + ['credits', '?action=credits'], + ['likes', '?action=likes;sa=view;ltype=msg;like={first_msg:Snapshot topic}'], + ['theme_picker', '?action=theme;sa=pick'], + ]); + } +} diff --git a/tests/Integration/Http/Snapshot/SnapshotTestCase.php b/tests/Integration/Http/Snapshot/SnapshotTestCase.php new file mode 100644 index 00000000000..4bd854e6a40 --- /dev/null +++ b/tests/Integration/Http/Snapshot/SnapshotTestCase.php @@ -0,0 +1,510 @@ + p:nth-of-type(2)']; + + /** + * Parts of the page that change between two identical requests whatever + * the templates do. + */ + public const ALWAYS_IGNORE = [ + // The verification honeypot, whose field Verifier names at random on + // every request so that a bot cannot learn to leave it alone. + '.vv_special input', + + // The bar drawn for each entry of a top ten. A count of nothing draws + // an empty one, and whether any entry has a count of nothing depends + // on how busy the rest of the forum is. + '.statsbar > .bar', + ]; + + /** + * Parts of the page that are there or not depending on the forum's data, + * and are left out without a trace. + * + * The count of unread messages or alerts beside a menu item, which is only + * drawn when there are some. + */ + public const ALWAYS_DROP = ['.amt']; + + /** + * What every fixture's name starts with, for narrowing a list of everything + * on the forum to the fixtures. See DomSnapshot::describe(). + */ + public const FIXTURE_MARKER = 'Snapshot'; + + /** + * Text that is the forum's data wherever it appears, and is not in a link + * that DomSnapshot would recognise as such. See DomSnapshot::describe(). + * + * A post count group changes as its member posts, so the administrator's + * reads "Newbie" or "Hero Member" depending on how the forum has been used. + * When a member was last active reads "Today" or "3 days ago" depending on + * when the list is looked at. + */ + public const MASKS = ['.postgroup', 'td.last_active']; + + /********************* + * Internal properties + *********************/ + + /** + * @var int The last error logged before the page being compared was + * requested. + */ + private int $watermark = 0; + + /**************************** + * Internal static properties + ****************************/ + + /** + * @var array|null Where the fixtures are, once they have been built. + */ + private static ?array $fixtures = null; + + /** + * @var array Signed in clients, by audience, shared by every test in the + * process. Signing in once per test would spend most of the run waiting + * for flood control. + */ + private static array $clients = []; + + /**************** + * Public methods + ****************/ + + /** + * Fetches a page and compares it with its snapshot. + * + * The status is part of the snapshot rather than asserted, so that a page + * which today turns the visitor away, or redirects, is pinned down as doing + * exactly that. + * + * @param string $name The snapshot's name, which is also its file name. + * @param string $path The page, as HttpClient::get() takes it, with + * {board:Name}, {topic:Subject}, {member:name} and friends standing for + * the fixtures' ids. + * @param array $roots What to compare. See DomSnapshot::describe(). + * @param array $ignore What to leave out. + * @param array $only Lists of everything on the forum, to narrow to the + * entries that mention the fixtures. + * @param array $unordered Lists in whatever order the database returns. + */ + public function assertPageMatchesSnapshot(string $name, string $path, array $roots = self::PAGE, array $ignore = [], array $only = [], array $unordered = []): void + { + $this->assertMatchesSnapshot($name, $this->http->get($this->resolve($path)), $roots, $ignore, $only, $unordered); + } + + /** + * Compares a response with its snapshot. + * + * @param string $name The snapshot's name. + * @param HttpResponse $response What came back. + * @param array $roots What to compare. + * @param array $ignore What to leave out. + * @param array $only Lists to narrow to the fixtures. + * @param array $unordered Lists in whatever order the database returns. + */ + public function assertMatchesSnapshot(string $name, HttpResponse $response, array $roots = self::PAGE, array $ignore = [], array $only = [], array $unordered = []): void + { + $actual = $this->describe($response, $roots, array_merge(static::ALWAYS_IGNORE, $ignore), $only, $unordered); + $file = $this->snapshotDirectory() . '/' . $name . '.txt'; + + if (getenv('SMF_UPDATE_SNAPSHOTS') === '1') { + if (!is_dir(\dirname($file))) { + mkdir(\dirname($file), 0o777, true); + } + + file_put_contents($file, $actual); + } + + if (!is_file($file)) { + $this->fail( + 'there is no snapshot for ' . $name . ' yet. Record one with SMF_UPDATE_SNAPSHOTS=1 ' + . 'and read it before committing it.', + ); + } + + $this->assertSame( + (string) file_get_contents($file), + $actual, + $name . ' (' . $response->url . ') no longer renders as it did. If the change is ' + . 'intended, record it again with SMF_UPDATE_SNAPSHOTS=1.', + ); + } + + /*********************** + * Public static methods + ***********************/ + + /** + * Who the tests in the class are looking at the forum as. + * + * @return string 'guest', 'member' or 'admin'. + */ + abstract public static function audience(): string; + + /****************** + * Internal methods + ******************/ + + protected function setUp(): void + { + parent::setUp(); + + self::$fixtures ??= $this->buildFixtures(); + + $audience = static::audience(); + + if (!isset(self::$clients[$audience])) { + self::$clients[$audience] = $this->http; + + if ($audience === 'admin') { + $this->signInAsAdmin(); + $this->passAdminSecurity(); + } elseif ($audience === 'member') { + $this->signInAsMember(); + } + } + + $this->http = self::$clients[$audience]; + + // The fixture member is signed in by one class and looked at by the + // others, which would then show them as online or not depending on the + // order the classes ran in and how long ago that was. Removing them from + // the who's online log makes them offline to everybody else, while + // leaving their session alone; their own next request puts them back. + Db::$db->query( + 'DELETE FROM {db_prefix}log_online + WHERE id_member IN ({array_int:members})', + [ + 'members' => array_values($this->fixtures()['members'] ?? [0]), + ], + ); + + // Taken after signing in, which is not what is being tested. + $row = $this->queryRow('SELECT COALESCE(MAX(id_error), 0) AS id_error FROM {db_prefix}log_errors'); + $this->watermark = (int) ($row['id_error'] ?? 0); + } + + /** + * The fixtures, as fixture-forum.php described them. + * + * @return array The fixtures. + */ + protected function fixtures(): array + { + return self::$fixtures ?? []; + } + + /** + * Replaces the fixture placeholders in a path with ids. + * + * @param string $path The path. + * @return string The path with ids in it. + */ + protected function resolve(string $path): string + { + $fixtures = $this->fixtures(); + + return (string) preg_replace_callback( + '~\{(board|topic|first_msg|member|category|admin|pm)(?::([^}]+))?\}~', + function (array $match) use ($fixtures, $path): string { + $id = match ($match[1]) { + 'board' => $fixtures['boards'][$match[2]] ?? null, + 'topic' => $fixtures['topics'][$match[2]] ?? null, + 'first_msg' => $fixtures['first_msgs'][$match[2]] ?? null, + 'member' => $fixtures['members'][$match[2]] ?? null, + 'category' => $fixtures['category'] ?? null, + 'admin' => $fixtures['admin'] ?? null, + 'pm' => $fixtures['pm'] ?? null, + }; + + $this->assertNotNull($id, 'no fixture for ' . $match[0] . ' in ' . $path); + + return (string) $id; + }, + $path, + ); + } + + /** + * Describes a response, with the errors it logged. + * + * @param HttpResponse $response The response. + * @param array $roots What to describe. + * @param array $ignore What to leave out. + * @param array $only Lists to narrow to the fixtures. + * @param array $unordered Lists in whatever order the database returns. + * @return string The description. + */ + protected function describe(HttpResponse $response, array $roots, array $ignore, array $only = [], array $unordered = []): string + { + // Where the forum is installed shows up in the server settings, and is + // /var/www/html in the container and a runner's home directory in CI. + // The name is whatever it was installed with, and the image proxy's + // secret is made up by the installer and shown in the server settings. + $snapshot = new DomSnapshot([ + $this->http->base_url => '{boardurl}', + Config::$boardurl => '{boardurl}', + Config::$boarddir => '{boarddir}', + Config::$mbname => '{forum_name}', + Config::$image_proxy_secret => '{secret}', + ]); + + // Described first, since that is what finds the session on the page for + // the masking of the location to use. + $body = $snapshot->describe( + $response->body, + array_map([$this, 'resolve'], $roots), + array_map([$this, 'resolve'], $ignore), + static::MASKS, + array_fill_keys($only, self::FIXTURE_MARKER) + array_fill_keys(static::ALWAYS_DROP, null), + $unordered, + ); + + $description = 'status ' . $response->status . "\n"; + + if (isset($response->headers['location'])) { + $description .= 'location ' . $snapshot->mask((string) $response->headers['location'], true) . "\n"; + } + + $description .= $body; + + $errors = $this->loggedErrors($snapshot); + + if ($errors !== []) { + $description .= "\n= errors logged\n" . implode("\n", $errors) . "\n"; + } + + return $description; + } + + /** + * What the forum logged since the test started, masked like the page. + * + * The file and line are left out, since they move whenever anything above + * them in the file changes. + * + * @param DomSnapshot $snapshot For its masking rules. + * @return array One line per distinct error, sorted. + */ + protected function loggedErrors(DomSnapshot $snapshot): array + { + $request = Db::$db->query( + 'SELECT id_error, error_type, message + FROM {db_prefix}log_errors + WHERE id_error > {int:watermark}', + [ + 'watermark' => $this->watermark, + ], + ); + + $errors = []; + + while ($row = Db::$db->fetch_assoc($request)) { + // Once a request has logged something the watermark moves on, so the + // next comparison in the same test only reports what came after it. + $this->watermark = max($this->watermark, (int) $row['id_error']); + + $message = html_entity_decode((string) $row['message'], ENT_QUOTES | ENT_HTML5, 'UTF-8'); + $message = trim((string) preg_replace('~\s+~u', ' ', strip_tags($message))); + + $errors[] = '[' . trim((string) $row['error_type']) . '] ' . $snapshot->mask($message); + } + + Db::$db->free_result($request); + + $errors = array_unique($errors); + sort($errors); + + return $errors; + } + + /** + * Where this class keeps its snapshots. + * + * @return string The directory. + */ + protected function snapshotDirectory(): string + { + return __DIR__ . '/snapshots/' . static::audience(); + } + + /** + * Signs in as the fixture member. + */ + protected function signInAsMember(): void + { + $fixtures = $this->fixtures(); + + for ($attempt = 0; $attempt < 2; $attempt++) { + $form = $this->http->get('?action=login'); + + $response = $this->http->submit($form, [ + 'user' => 'snapshot_member', + 'passwrd' => (string) ($fixtures['member_password'] ?? ''), + ], '//form[contains(@action, "action=login2")]'); + + if (!self::isThrottled($response)) { + break; + } + + sleep(self::FLOOD_WAIT); + } + + $this->assertSignedIn(true, 'could not sign in as the fixture member'); + } + + /** + * Gets through the password prompt the admin area puts in front of an + * administrator, when the forum has it switched on. + */ + protected function passAdminSecurity(): void + { + $page = $this->http->get('?action=admin'); + $form = '//form[.//input[@name="admin_pass"]]'; + + if ($page->xpath($form)->length === 0) { + return; + } + + $response = $this->submitForm($page, ['admin_pass' => self::adminPassword()], $form); + + $this->assertSame( + 0, + $response->xpath($form)->length, + 'the admin area asked for the password again: ' . $response->errorText(), + ); + } + + /** + * Builds the fixtures, in a process of its own. + * + * @return array Where they are. + */ + private function buildFixtures(): array + { + $script = __DIR__ . '/fixture-forum.php'; + + $process = proc_open( + [PHP_BINARY, $script], + [1 => ['pipe', 'w'], 2 => ['pipe', 'w']], + $pipes, + Config::$boarddir, + ); + + $this->assertIsResource($process, 'could not run ' . $script); + + $out = (string) stream_get_contents($pipes[1]); + $err = (string) stream_get_contents($pipes[2]); + fclose($pipes[1]); + fclose($pipes[2]); + + $status = proc_close($process); + $fixtures = json_decode($out, true); + + $this->assertSame(0, $status, 'building the fixtures failed: ' . $err . $out); + $this->assertIsArray($fixtures, 'the fixture script printed no JSON: ' . $err . $out); + + return $fixtures; + } + + /************************* + * Internal static methods + *************************/ + + /** + * Keys each case by its name, which is what PHPUnit reports. + * + * @param array $cases The cases, each starting with its name. + * @return array The same, keyed. + */ + protected static function cases(array $cases): array + { + $keyed = []; + + foreach ($cases as $case) { + $keyed[$case[0]] = $case; + } + + return $keyed; + } +} diff --git a/tests/Integration/Http/Snapshot/fixture-forum.php b/tests/Integration/Http/Snapshot/fixture-forum.php new file mode 100644 index 00000000000..c9505b22275 --- /dev/null +++ b/tests/Integration/Http/Snapshot/fixture-forum.php @@ -0,0 +1,653 @@ +build(), JSON_PRETTY_PRINT), "\n"; + +/** + * Does the work, so the script above reads as what it does. + */ +final class SnapshotFixtures +{ + /********************* + * Internal properties + *********************/ + + /** + * @var int The administrator, who creates the boards and posts some replies. + */ + private int $admin; + + /**************** + * Public methods + ****************/ + + /** + * Creates the fixtures, or finds the ones already there. + * + * @return array Where everything is, for the tests. + */ + public function build(): array + { + $this->admin = $this->adminId(); + + User::setMe($this->admin); + + // Some of what follows asks for the administrator's password again, + // unless the forum has switched that off. Having just given it is what + // User::validateSession() looks for. + $_SESSION['admin_time'] = time(); + + $category = $this->categoryId(); + + if ($category === 0) { + $this->create(); + } + + $fixtures = $this->locate(); + + $this->ensureEvents($fixtures['members']); + + return $fixtures; + } + + /****************** + * Internal methods + ******************/ + + /** + * Makes the fixtures. + */ + private function create(): void + { + $member = $this->registerMember('snapshot_member', 'Snapshot Member'); + $other = $this->registerMember('snapshot_other', 'Snapshot Other'); + + $category = Category::create([ + 'cat_name' => FIXTURE_CATEGORY, + 'cat_desc' => 'Content for the template snapshot tests.', + 'move_after' => 0, + ]); + + // -1 is guests and 0 regular members; administrators see everything. + $groups = [-1, 0]; + + $board = Board::create([ + 'board_name' => 'Snapshot board', + 'board_description' => 'Topics, replies and a poll for the snapshot tests.', + 'move_to' => 'bottom', + 'target_category' => $category, + 'access_groups' => $groups, + 'moderators' => 'snapshot_other', + ]); + + $child_one = Board::create([ + 'board_name' => 'Snapshot child one', + 'board_description' => 'The first child board.', + 'move_to' => 'child', + 'target_category' => $category, + 'target_board' => $board, + 'access_groups' => $groups, + ]); + + Board::create([ + 'board_name' => 'Snapshot child two', + 'board_description' => 'The second child board, which stays empty.', + 'move_to' => 'after', + 'target_category' => $category, + 'target_board' => $child_one, + 'access_groups' => $groups, + ]); + + Board::create([ + 'board_name' => 'Snapshot empty board', + 'board_description' => 'A board with nothing in it.', + 'move_to' => 'bottom', + 'target_category' => $category, + 'access_groups' => $groups, + ]); + + $time = FIXTURE_TIME; + + // The topic most snapshots look at. The guest reply is deliberately not + // the last post anywhere, so that no list of recent posts ever has to + // show a guest's name - one does on this topic's own page, and that is + // enough. + $topic = $this->post($board, 0, $member, 'Snapshot topic', self::richBody(), $time); + $this->post($board, $topic, 0, 'Re: Snapshot topic', 'A reply from a guest.', $time += 3600, 'Snapshot Guest'); + $this->post($board, $topic, $this->admin, 'Re: Snapshot topic', '[quote author=Snapshot Member]The quoted text.[/quote]' . "\n" . 'A reply from the administrator.', $time += 3600); + $this->post($board, $topic, $other, 'Re: Snapshot topic', 'A reply from another member, with a smiley :)', $time += 3600); + + $poll = $this->poll($this->admin, 'Which colour?', ['Red', 'Green', 'Blue']); + + $this->post($board, 0, $this->admin, 'Snapshot poll topic', 'A sticky, locked topic with a poll.', $time += 3600, '', [ + 'poll' => $poll, + 'sticky_mode' => 1, + 'lock_mode' => 1, + ]); + + $this->post($board, 0, $other, 'Snapshot second topic', 'Another topic, so the board lists more than one.', $time += 3600); + $this->post($child_one, 0, $other, 'Snapshot child topic', 'A topic in a child board.', $time += 3600); + $this->post($child_one, 0, $member, 'Snapshot second child topic', 'A second topic in the child board.', $time += 3600); + + $this->personalMessage($other, [$member, $this->admin], 'Snapshot message', 'A personal message to two people.', $time += 3600); + + + // Every visit to a topic counts as a view, and "1 view" is worded + // differently from "2 views", so the count starts high enough that + // the wording never changes again. + Db::$db->query( + 'UPDATE {db_prefix}topics + SET num_views = {int:views} + WHERE id_board IN ({array_int:boards})', + ['views' => 10, 'boards' => [$board, $child_one]], + ); + + $this->pinMembers([$member, $other], $time); + $this->markEverythingRead([$this->admin, $member, $other]); + } + + /** + * Creates the calendar events, when they are not there yet. + * + * Separate from create() so that a forum whose fixtures were built before + * the calendar snapshots existed gets them too. + * + * @param array $members The fixture members, by name. + */ + private function ensureEvents(array $members): void + { + $row = $this->queryRow( + 'SELECT id_event FROM {db_prefix}calendar WHERE title = {string:title}', + ['title' => 'Snapshot event'], + ); + + if ($row !== null) { + return; + } + + // In the same month as everything else, which is the month the calendar + // snapshots look at. One with a time and one lasting all day, since the + // calendar draws the two differently. + SMF\Calendar\Event::create([ + 'board' => 0, + 'topic' => 0, + 'member' => $members['snapshot_member'], + 'title' => 'Snapshot event', + 'location' => 'Snapshot location', + 'start_date' => '2020-01-20', + 'end_date' => '2020-01-20', + 'start_time' => '10:00', + 'end_time' => '11:30', + 'timezone' => 'UTC', + 'allday' => false, + ]); + + SMF\Calendar\Event::create([ + 'board' => 0, + 'topic' => 0, + 'member' => $members['snapshot_other'], + 'title' => 'Snapshot all day event', + 'location' => '', + 'start_date' => '2020-01-22', + 'end_date' => '2020-01-23', + 'start_time' => '00:00', + 'end_time' => '00:00', + 'timezone' => 'UTC', + 'allday' => true, + ]); + } + + /** + * Finds everything the tests need to know about. + * + * @return array Board, topic and member ids by name. + */ + private function locate(): array + { + $category = $this->categoryId(); + + $boards = $this->column( + 'SELECT name, id_board FROM {db_prefix}boards WHERE id_cat = {int:cat}', + ['cat' => $category], + ); + + $topics = $this->column( + 'SELECT m.subject, t.id_topic + FROM {db_prefix}topics AS t + INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg) + WHERE t.id_board IN ({array_int:boards})', + ['boards' => array_values($boards)], + ); + + $first_msgs = $this->column( + 'SELECT m.subject, t.id_first_msg + FROM {db_prefix}topics AS t + INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg) + WHERE t.id_board IN ({array_int:boards})', + ['boards' => array_values($boards)], + ); + + $members = $this->column( + 'SELECT member_name, id_member FROM {db_prefix}members WHERE member_name IN ({array_string:names})', + ['names' => ['snapshot_member', 'snapshot_other']], + ); + + $pm = $this->column( + 'SELECT subject, id_pm FROM {db_prefix}personal_messages WHERE subject = {string:subject}', + ['subject' => 'Snapshot message'], + ); + + return [ + 'category' => $category, + 'boards' => $boards, + 'topics' => $topics, + 'first_msgs' => $first_msgs, + 'members' => $members, + 'admin' => $this->admin, + 'member_password' => MEMBER_PASSWORD, + 'pm' => (int) ($pm['Snapshot message'] ?? 0), + ]; + } + + /** + * Posts, as the given member or as a guest. + * + * @param int $board Where. + * @param int $topic The topic to reply to, or 0 for a new one. + * @param int $poster The member, or 0 for a guest. + * @param string $subject The subject. + * @param string $body The body, in BBCode. + * @param int $time When it was posted. + * @param string $guest_name The name a guest posts under. + * @param array $topic_options Anything else the topic needs. + * @return int The topic id. + */ + private function post(int $board, int $topic, int $poster, string $subject, string $body, int $time, string $guest_name = '', array $topic_options = []): int + { + $msgOptions = [ + 'subject' => Utils::htmlspecialchars($subject), + 'body' => Utils::htmlspecialchars($body), + 'icon' => 'xx', + 'smileys_enabled' => true, + 'approved' => 1, + 'poster_time' => $time, + 'send_notifications' => false, + ]; + + $topicOptions = $topic_options + [ + 'id' => $topic, + 'board' => $board, + 'mark_as_read' => false, + ]; + + $posterOptions = [ + 'id' => $poster, + 'ip' => '127.0.0.1', + 'update_post_count' => $poster !== 0, + ]; + + if ($poster === 0) { + $posterOptions['name'] = $guest_name; + $posterOptions['email'] = 'guest@example.com'; + } + + Msg::create($msgOptions, $topicOptions, $posterOptions); + + // Msg::create() stamps the topic and board with the time now in a few + // places of its own; the message carries the pinned time already. + return (int) $topicOptions['id']; + } + + /** + * Creates a poll to attach to a topic. + * + * @param int $poster Who asked. + * @param string $question The question. + * @param array $choices The answers. + * @return int The poll id. + */ + private function poll(int $poster, string $question, array $choices): int + { + $id = (int) Db::$db->insert( + '', + '{db_prefix}polls', + [ + 'question' => 'string-255', + 'hide_results' => 'int', + 'max_votes' => 'int', + 'expire_time' => 'int', + 'id_member' => 'int', + 'poster_name' => 'string-255', + 'change_vote' => 'int', + 'guest_vote' => 'int', + ], + [[$question, 0, 1, 0, $poster, 'admin', 0, 0]], + ['id_poll'], + Db::INSERT_RETURN_MODE_SINGLE, + ); + + $rows = []; + + foreach ($choices as $i => $label) { + // Two votes for the first, one for the second, none for the third, so + // the results show a bar of each width. + $rows[] = [$id, $i, $label, max(0, 2 - $i)]; + } + + Db::$db->insert( + '', + '{db_prefix}poll_choices', + ['id_poll' => 'int', 'id_choice' => 'int', 'label' => 'string-255', 'votes' => 'int'], + $rows, + ['id_poll', 'id_choice'], + ); + + return $id; + } + + /** + * Sends a personal message and pins its time. + * + * @param int $from The sender. + * @param array $to The recipients. + * @param string $subject The subject. + * @param string $body The body. + * @param int $time When it was sent. + */ + private function personalMessage(int $from, array $to, string $subject, string $body, int $time): void + { + $sender = $this->queryRow( + 'SELECT member_name, real_name FROM {db_prefix}members WHERE id_member = {int:id}', + ['id' => $from], + ); + + PM::send(['to' => $to, 'bcc' => []], $subject, $body, true, [ + 'id' => $from, + 'name' => $sender['real_name'], + 'username' => $sender['member_name'], + ]); + + Db::$db->query( + 'UPDATE {db_prefix}personal_messages + SET msgtime = {int:time} + WHERE subject = {string:subject}', + ['time' => $time, 'subject' => $subject], + ); + + // Read already, as it will be once the member tests have opened it, so + // the unread count in the menu is the same before that as after. + Db::$db->query( + 'UPDATE {db_prefix}pm_recipients + SET is_read = {int:read}, is_new = {int:not_new} + WHERE id_member IN ({array_int:members})', + ['read' => 1, 'not_new' => 0, 'members' => $to], + ); + + Db::$db->query( + 'UPDATE {db_prefix}members + SET unread_messages = {int:none}, new_pm = {int:none} + WHERE id_member IN ({array_int:members})', + ['none' => 0, 'members' => $to], + ); + } + + /** + * Registers a member who can sign in straight away. + * + * @param string $name The member name. + * @param string $display The display name. + * @return int The member id. + */ + private function registerMember(string $name, string $display): int + { + $options = [ + 'interface' => 'admin', + 'username' => $name, + 'email' => $name . '@example.com', + 'password' => MEMBER_PASSWORD, + 'password_check' => MEMBER_PASSWORD, + 'check_reserved_name' => false, + 'check_password_strength' => false, + 'check_email_ban' => false, + 'send_welcome_email' => false, + 'require' => 'nothing', + 'memberGroup' => 0, + ]; + + $id = SMF\Actions\Register2::registerMember($options, true); + + if (!is_int($id)) { + fwrite(STDERR, 'could not register ' . $name . ': ' . json_encode($id) . "\n"); + + exit(1); + } + + Db::$db->query( + 'UPDATE {db_prefix}members + SET real_name = {string:display}, + personal_text = {string:personal_text}, + signature = {string:signature}, + website_title = {string:website_title}, + website_url = {string:website_url}, + member_ip = {inet:ip}, + member_ip2 = {inet:ip} + WHERE id_member = {int:id}', + [ + 'id' => $id, + 'display' => $display, + 'personal_text' => 'Personal text for ' . $display, + 'signature' => 'A signature with [b]bold[/b] text.', + 'website_title' => 'Example', + 'website_url' => 'https://www.example.com', + // Registering from the command line records no address, which + // no real member is without, and the tracking pages fatal on. + 'ip' => '127.0.0.1', + ], + ); + + return $id; + } + + /** + * Pins the dates a profile shows. + * + * @param array $members Who. + * @param int $time The last thing that happened. + */ + private function pinMembers(array $members, int $time): void + { + Db::$db->query( + 'UPDATE {db_prefix}members + SET date_registered = {int:registered}, last_login = {int:login} + WHERE id_member IN ({array_int:members})', + [ + 'members' => $members, + 'registered' => FIXTURE_TIME - 86400, + 'login' => $time, + ], + ); + } + + /** + * Marks every fixture board and topic read for these members. + * + * @param array $members Who. + */ + private function markEverythingRead(array $members): void + { + $boards = $this->column( + 'SELECT id_board, id_msg_updated FROM {db_prefix}boards WHERE id_cat = {int:cat}', + ['cat' => $this->categoryId()], + ); + + $topics = $this->column( + 'SELECT id_topic, id_last_msg FROM {db_prefix}topics WHERE id_board IN ({array_int:boards})', + ['boards' => array_keys($boards)], + ); + + $latest = max(array_merge([0], $topics, $boards)); + + foreach ($members as $member) { + foreach ($boards as $board => $msg) { + Db::$db->insert('replace', '{db_prefix}log_boards', ['id_member' => 'int', 'id_board' => 'int', 'id_msg' => 'int'], [[$member, $board, $latest]], ['id_member', 'id_board']); + Db::$db->insert('replace', '{db_prefix}log_mark_read', ['id_member' => 'int', 'id_board' => 'int', 'id_msg' => 'int'], [[$member, $board, $latest]], ['id_member', 'id_board']); + } + + foreach ($topics as $topic => $msg) { + Db::$db->insert('replace', '{db_prefix}log_topics', ['id_member' => 'int', 'id_topic' => 'int', 'id_msg' => 'int', 'unwatched' => 'int'], [[$member, $topic, $latest, 0]], ['id_member', 'id_topic']); + } + } + } + + /** + * The fixture category, if it has been made. + * + * @return int Its id, or 0. + */ + private function categoryId(): int + { + $row = $this->queryRow( + 'SELECT id_cat FROM {db_prefix}categories WHERE name = {string:name}', + ['name' => FIXTURE_CATEGORY], + ); + + return (int) ($row['id_cat'] ?? 0); + } + + /** + * The first administrator. + * + * @return int The member id. + */ + private function adminId(): int + { + $row = $this->queryRow( + 'SELECT id_member FROM {db_prefix}members WHERE id_group = {int:group} ORDER BY id_member LIMIT 1', + ['group' => 1], + ); + + return (int) ($row['id_member'] ?? 1); + } + + /** + * Runs a two column query into key => value. + * + * @param string $sql The query. + * @param array $params Its parameters. + * @return array The first column as keys, the second as integer values. + */ + private function column(string $sql, array $params): array + { + $request = Db::$db->query($sql, $params); + $result = []; + + while ($row = Db::$db->fetch_row($request)) { + $result[$row[0]] = (int) $row[1]; + } + + Db::$db->free_result($request); + + return $result; + } + + /** + * Runs a query and returns its first row. + * + * @param string $sql The query. + * @param array $params Its parameters. + * @return array|null The row. + */ + private function queryRow(string $sql, array $params): ?array + { + $request = Db::$db->query($sql, $params); + $row = Db::$db->fetch_assoc($request); + Db::$db->free_result($request); + + return is_array($row) ? $row : null; + } + + /************************* + * Internal static methods + *************************/ + + /** + * A first post that exercises as much of the BBCode parser's output as a + * template is likely to wrap. + * + * @return string The body. + */ + private static function richBody(): string + { + return implode("\n", [ + 'The first post, with [b]bold[/b], [i]italic[/i], [u]underlined[/u] and [s]struck[/s] text.', + '[url=https://www.simplemachines.org]A link[/url] and [email]someone@example.com[/email].', + '[quote]An unattributed quote.[/quote]', + '[code]echo "code";[/code]', + '[list][li]One[/li][li]Two[/li][/list]', + '[color=red]Red[/color] [size=12pt]Sized[/size] [center]Centred[/center]', + '[table][tr][td]A[/td][td]B[/td][/tr][/table]', + '[spoiler]Hidden[/spoiler] [hr] Smileys: :) ;)', + ]); + } +} diff --git a/tests/Integration/Http/Snapshot/index.php b/tests/Integration/Http/Snapshot/index.php new file mode 100644 index 00000000000..2844a3b9e7b --- /dev/null +++ b/tests/Integration/Http/Snapshot/index.php @@ -0,0 +1,8 @@ +query( + 'SELECT id_member FROM {db_prefix}members WHERE id_group = {int:group} ORDER BY id_member LIMIT 1', + ['group' => 1], +); +[$admin] = Db::$db->fetch_row($request); +Db::$db->free_result($request); + +User::setMe((int) $admin); +$_SESSION['admin_time'] = time(); + +// Members, with the sorts of names people have. +$names = ['Zoë Ünïcödé', 'O\'Brien & Sons', 'user_' . $run, 'Another Member', 'Ma Li', 'Ångström']; +$members = []; + +for ($i = 0; $i < $scale; $i++) { + $options = [ + 'interface' => 'admin', + 'username' => 'perturb_' . $run . '_' . $i, + 'email' => 'perturb_' . $run . '_' . $i . '@example.com', + 'password' => 'perturb-password-1', + 'password_check' => 'perturb-password-1', + 'check_reserved_name' => false, + 'check_password_strength' => false, + 'check_email_ban' => false, + 'send_welcome_email' => false, + 'require' => 'nothing', + 'memberGroup' => 0, + ]; + + $id = SMF\Actions\Register2::registerMember($options, true); + + if (is_int($id)) { + $members[] = $id; + + Db::$db->query( + 'UPDATE {db_prefix}members SET real_name = {string:name} WHERE id_member = {int:id}', + ['id' => $id, 'name' => $names[$i % count($names)] . ' ' . $run . $i], + ); + } +} + +// A category with boards and child boards, and a child board of an existing +// board. +$category = Category::create(['cat_name' => 'Perturbation ' . $run, 'move_after' => 0]); + +$boards = []; + +$boards[] = Board::create([ + 'board_name' => 'Perturbed board ' . $run, + 'move_to' => 'bottom', + 'target_category' => $category, + 'access_groups' => [-1, 0], +]); + +$boards[] = Board::create([ + 'board_name' => 'Perturbed child ' . $run, + 'move_to' => 'child', + 'target_category' => $category, + 'target_board' => $boards[0], + 'access_groups' => [-1, 0], +]); + +$request = Db::$db->query( + 'SELECT id_board, id_cat FROM {db_prefix}boards WHERE name = {string:name} LIMIT 1', + ['name' => 'General Discussion'], +); +$general = Db::$db->fetch_assoc($request); +Db::$db->free_result($request); + +if (is_array($general)) { + $boards[] = (int) $general['id_board']; + + $boards[] = Board::create([ + 'board_name' => 'Perturbed sub-board ' . $run, + 'move_to' => 'child', + 'target_category' => (int) $general['id_cat'], + 'target_board' => (int) $general['id_board'], + 'access_groups' => [-1, 0], + ]); +} + +// Topics and replies, from the administrator, the new members and a guest. +$posters = array_merge([(int) $admin, 0], $members); + +for ($i = 0; $i < $scale; $i++) { + $board = $boards[$i % count($boards)]; + $poster = $posters[$i % count($posters)]; + + $msgOptions = [ + 'subject' => Utils::htmlspecialchars('Unrelated topic ' . $run . ' number ' . $i . ' with a long subject & '), + 'body' => Utils::htmlspecialchars('Body ' . $i . ' [b]bold[/b] :)'), + 'approved' => 1, + 'send_notifications' => false, + ]; + $topicOptions = [ + 'board' => $board, + 'mark_as_read' => false, + 'sticky_mode' => $i % 5 === 0 ? 1 : null, + 'lock_mode' => $i % 7 === 0 ? 1 : null, + ]; + $posterOptions = ['id' => $poster, 'ip' => '127.0.0.1', 'update_post_count' => $poster !== 0]; + + if ($poster === 0) { + $posterOptions['name'] = 'A Guest ' . $run; + $posterOptions['email'] = 'guest@example.com'; + } + + Msg::create($msgOptions, $topicOptions, $posterOptions); + + for ($j = 0; $j < 1 + $i % 3; $j++) { + $replier = $posters[($i + $j + 1) % count($posters)]; + + $replyOptions = [ + 'subject' => $msgOptions['subject'], + 'body' => Utils::htmlspecialchars('Reply ' . $j . ' [quote]quoted[/quote]'), + 'approved' => 1, + 'send_notifications' => false, + ]; + $replyTopic = ['id' => $topicOptions['id'], 'board' => $board, 'mark_as_read' => false]; + $replyPoster = ['id' => $replier, 'ip' => '127.0.0.1', 'update_post_count' => $replier !== 0]; + + if ($replier === 0) { + $replyPoster['name'] = 'A Guest ' . $run; + $replyPoster['email'] = 'guest@example.com'; + } + + Msg::create($replyOptions, $replyTopic, $replyPoster); + } +} + +// Personal messages, to the administrator and between the new members. +foreach (array_slice($members, 0, $scale) as $i => $from) { + $to = [(int) $admin]; + + if (isset($members[$i + 1])) { + $to[] = $members[$i + 1]; + } + + PM::send(['to' => $to, 'bcc' => []], 'Unrelated message ' . $run . ' ' . $i, 'Hello.', true, [ + 'id' => $from, + 'name' => 'perturb_' . $run . '_' . $i, + 'username' => 'perturb_' . $run . '_' . $i, + ]); +} + +echo 'added ', count($members), ' members, ', count($boards), ' boards and ', $scale, ' topics (run ', $run, ")\n"; diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/admin_credits.txt b/tests/Integration/Http/Snapshot/snapshots/admin/admin_credits.txt new file mode 100644 index 00000000000..6e045024518 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/admin_credits.txt @@ -0,0 +1,90 @@ +status 200 +@ title +title + "Support and Credits" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=credits;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Support and Credits" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + "Support and Credits" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + div.noup.roundframe + div.title_bar + h3.titlebg + "Support Information" + snapshot-ignored [selector="#admin_content .roundframe > .title_bar:not(#support_resources) + .padding"] + div#support_resources.title_bar + h3.titlebg + "Support Resources" + div.padding + p + "Our" + a [href="https://wiki.simplemachines.org/"] + "Online Manual" + "provides the main documentation for SMF. The SMF Online Manual has many documents to help answer support questions and explain" + a [href="https://wiki.simplemachines.org/smf/features#"] + "Features" + "," + a [href="https://wiki.simplemachines.org/smf/options#"] + "Settings" + "," + a [href="https://wiki.simplemachines.org/smf/themes#"] + "Themes" + "," + a [href="https://wiki.simplemachines.org/smf/packages#"] + "Packages" + ", etc. The Online Manual documents each area of SMF thoroughly and should answer most questions quickly." + p + "If you cannot find the answers to your questions in the Online Manual, you may want to search our" + a [href="https://www.simplemachines.org/community/"] + "Support Community" + "or ask for assistance in either our" + a [href="https://www.simplemachines.org/redirect/english_support"] + "English" + "or one of our many" + a [href="https://www.simplemachines.org/redirect/international_support_boards"] + "international support boards" + ". The SMF Support Community can be used for" + a [href="https://www.simplemachines.org/redirect/smf_support"] + "support" + "," + a [href="https://www.simplemachines.org/redirect/customize_support"] + "customization" + ", and many other things such as discussing SMF, finding a host, and discussing administrative issues with other forum administrators." + div#credits_sections.title_bar + h3.titlebg + "Credits" + snapshot-ignored [selector="#admin_content .roundframe > .title_bar:not(#support_resources) + .padding"] + snapshot-ignored [selector="#admin_content script"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/admin_index.txt b/tests/Integration/Http/Snapshot/snapshots/admin/admin_index.txt new file mode 100644 index 00000000000..8707ec5753c --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/admin_index.txt @@ -0,0 +1,193 @@ +status 200 +@ title +title + "Administration Center" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + "Administration Center" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + strong + "Hello, {member}." + "This is your \"Administration Center\". From here, you can edit settings, maintain your forum, view logs, install packages, manage themes, and many other things." + br + "If you have any trouble, please look at the \"Support & Credits\" page. If the information there does not help you, feel free to" + a [href="https://www.simplemachines.org/community/index.php" rel="noopener" target="_blank"] + "look to us for help" + "with the problem." + br + "You may also find answers to your questions or problems by clicking the" + span.help.main_icons [title="Help"] + "symbols for more information on the related functions." + div#update_section + div#admin_main_section + div#live_news.floatleft + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=live_news" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Live from Simple Machines..." + div.nopadding.windowbg + div#smfAnnouncements + "You are unable to connect to simplemachines.org’s latest news file." + div#support_info.floatright + div.cat_bar + h3.catbg + a [href="{boardurl}/index.php?action=admin;area=credits"] + "Support Information" + div.nopadding.windowbg + div#version_details.padding + strong + "Version Information" + ul + li + "Forum version:" + em#yourVersion + "SMF #.# Alpha(s) #-dev" + li + "Current SMF version:" + em#smfVersion + "??" + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=routine;activity=version"] + "(more detailed)" + br + "Forum Administrators:" + a [href="{boardurl}/index.php?action=profile;u=#"] + "{member}" + fieldset#group_forum.admin_group.windowbg + legend + "Main" + a [href="{boardurl}/index.php?action=admin;area=credits"] + span.large_admin_menu_icon.support + "Support and Credits" + a [href="{boardurl}/index.php?action=admin;area=news"] + span.large_admin_menu_icon.news + "News and Newsletters" + a [href="{boardurl}/index.php?action=admin;area=packages"] + span.large_admin_menu_icon.packages + "Package Manager" + a [href="{boardurl}/index.php?action=admin;area=adminlogoff"] + span.exit.large_admin_menu_icon + "End {member} Session" + fieldset#group_config.admin_group.windowbg + legend + "Configuration" + a [href="{boardurl}/index.php?action=admin;area=featuresettings"] + span.features.large_admin_menu_icon + "Features and Options" + a [href="{boardurl}/index.php?action=admin;area=antispam"] + span.large_admin_menu_icon.security + "Anti-Spam" + a [href="{boardurl}/index.php?action=admin;area=languages"] + span.languages.large_admin_menu_icon + "Languages" + a [href="{boardurl}/index.php?action=admin;area=theme;sa=list;th=#"] + span.current_theme.large_admin_menu_icon + "Current Theme" + a [href="{boardurl}/index.php?action=admin;area=theme"] + span.large_admin_menu_icon.themes + "Themes and Layout" + a [href="{boardurl}/index.php?action=admin;area=modsettings"] + span.large_admin_menu_icon.modifications + "Modification Settings" + fieldset#group_layout.admin_group.windowbg + legend + "Forum" + a [href="{boardurl}/index.php?action=admin;area=manageboards"] + span.boards.large_admin_menu_icon + "Boards and Categories" + a [href="{boardurl}/index.php?action=admin;area=postsettings"] + span.large_admin_menu_icon.posts + "Posts and Topics" + a [href="{boardurl}/index.php?action=admin;area=managecalendar"] + span.calendar.inactive.large_admin_menu_icon + "Calendar" + a [href="{boardurl}/index.php?action=admin;area=managesearch"] + span.large_admin_menu_icon.search + "Search" + a [href="{boardurl}/index.php?action=admin;area=smileys"] + span.large_admin_menu_icon.smiley + "Smileys and Message Icons" + a [href="{boardurl}/index.php?action=admin;area=manageattachments"] + span.attachment.large_admin_menu_icon + "Attachments and Avatars" + a [href="{boardurl}/index.php?action=admin;area=sengines"] + span.engines.inactive.large_admin_menu_icon + "Search Engines" + fieldset#group_members.admin_group.windowbg + legend + "Members" + a [href="{boardurl}/index.php?action=admin;area=viewmembers"] + span.large_admin_menu_icon.members + "Members" + a [href="{boardurl}/index.php?action=admin;area=membergroups"] + span.large_admin_menu_icon.membergroups + "Membergroups" + a [href="{boardurl}/index.php?action=admin;area=permissions"] + span.large_admin_menu_icon.permissions + "Permissions" + a [href="{boardurl}/index.php?action=admin;area=regcenter"] + span.large_admin_menu_icon.regcenter + "Registration" + a [href="{boardurl}/index.php?action=admin;area=warnings"] + span.large_admin_menu_icon.warning + "Warnings" + a [href="{boardurl}/index.php?action=admin;area=ban"] + span.ban.large_admin_menu_icon + "Ban list" + a [href="{boardurl}/index.php?action=admin;area=paidsubscribe"] + span.inactive.large_admin_menu_icon.paid + "Paid Subscriptions" + fieldset#group_maintenance.admin_group.windowbg + legend + "Maintenance" + a [href="{boardurl}/index.php?action=admin;area=serversettings"] + span.large_admin_menu_icon.server + "Server Settings" + a [href="{boardurl}/index.php?action=admin;area=maintain"] + span.large_admin_menu_icon.maintain + "Forum Maintenance" + a [href="{boardurl}/index.php?action=admin;area=scheduledtasks"] + span.large_admin_menu_icon.scheduled + "Scheduled Tasks" + a [href="{boardurl}/index.php?action=admin;area=mailqueue"] + span.large_admin_menu_icon.mail + "Mail" + a [href="{boardurl}/index.php?action=admin;area=reports"] + span.large_admin_menu_icon.reports + "Reports" + a [href="{boardurl}/index.php?action=admin;area=logs"] + span.large_admin_menu_icon.logs + "Logs" + script [src="{boardurl}/index.php?action=viewsmfile;filename=current-version.js"] + script [src="{boardurl}/index.php?action=viewsmfile;filename=latest-news.js"] + script + | var oAdminIndex = new smf_AdminIndex({ bLoadAnnouncements: true, sAnnouncementTemplate: '\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t%content%\n\t\t\t\t\t\t\t\t<' + '/dl>\n\t\t\t\t\t\t\t', sAnnouncementMessageTemplate: '\n\t\t\t\t\t\t\t\t
%subject%<' + '/a>%time%<' + '/dt>\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t%message%\n\t\t\t\t\t\t\t\t<' + '/dd>\n\t\t\t\t\t\t\t', sAnnouncementContainerId: 'smfAnnouncements', bLoadVersions: true, sSmfVersionContainerId: 'smfVersion', sYourVersionContainerId: 'yourVersion', sVersionOutdatedTemplate: '\n\t\t\t\t\t\t\t\t%currentVersion%<' + '/span>\n\t\t\t\t\t\t\t', bLoadUpdateNotification: true, sUpdateNotificationContainerId: 'update_section', sUpdateNotificationDefaultTitle: 'Update available', sUpdateNotificationDefaultMessage: 'You’re using an outdated version of SMF, which contains some bugs which have since been fixed.\n\tIt is recommended that you update your forum<' + '/a> to the latest version as soon as possible. It only takes a minute!', sUpdateNotificationTemplate: '\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t%title%\n\t\t\t\t\t\t\t\t<' + '/h#>\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t%message%\n\t\t\t\t\t\t\t\t<' + '/div>\n\t\t\t\t\t\t\t', sUpdateNotificationLink: smf_scripturl + '?action=admin;area=packages;pgdownload;auto;package=%package%;{session_var}={session_id}' }); diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/admin_menu.txt b/tests/Integration/Http/Snapshot/snapshots/admin/admin_menu.txt new file mode 100644 index 00000000000..e7d9124b520 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/admin_menu.txt @@ -0,0 +1,434 @@ +status 200 +@ #genericmenu +nav#genericmenu [aria-label="Administration Center Menu"] + a.mobile_generic_menu_1 + span.menu_icon + span.text_menu + "Administration Center Menu" + div#mobile_generic_menu_#.popup_container + div.description.popup_window + div.popup_heading + "Administration Center Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1.dropmenu + li.subsections + a.active [href="{boardurl}/index.php?action=admin;area=index;{session_var}={session_id}"] + "Main" + ul + li + a.admin_menu_icon.administration.chosen [href="{boardurl}/index.php?action=admin;area=index;{session_var}={session_id}"] + span.administration.main_icons + "Administration Center" + li + a.admin_menu_icon.support [href="{boardurl}/index.php?action=admin;area=credits;{session_var}={session_id}"] + span.main_icons.support + "Support and Credits" + li.subsections + a.admin_menu_icon.news [href="{boardurl}/index.php?action=admin;area=news;{session_var}={session_id}"] + span.main_icons.news + "News and Newsletters" + ul + li + a [href="{boardurl}/index.php?action=admin;area=news;sa=editnews;{session_var}={session_id}"] + "News" + li + a [href="{boardurl}/index.php?action=admin;area=news;sa=mailingmembers;{session_var}={session_id}"] + "Newsletters" + li + a [href="{boardurl}/index.php?action=admin;area=news;sa=settings;{session_var}={session_id}"] + "Settings" + li.subsections + a.admin_menu_icon.packages [href="{boardurl}/index.php?action=admin;area=packages;{session_var}={session_id}"] + span.main_icons.packages + "Package Manager" + ul + li + a [href="{boardurl}/index.php?action=admin;area=packages;sa=browse;{session_var}={session_id}"] + "Browse Packages" + li + a [href="{boardurl}/index.php?action=admin;area=packages;sa=packageget;get;{session_var}={session_id}"] + "Add Packages" + li + a [href="{boardurl}/index.php?action=admin;area=packages;sa=perms;{session_var}={session_id}"] + "File Permissions" + li + a [href="{boardurl}/index.php?action=admin;area=packages;sa=options;{session_var}={session_id}"] + "Options" + li + a.admin_menu_icon.exit [href="{boardurl}/index.php?action=admin;area=adminlogoff;{session_var}={session_id}"] + span.exit.main_icons + "End {member} Session" + li.subsections + a [href="{boardurl}/index.php?action=admin;area=featuresettings;{session_var}={session_id}"] + "Configuration" + ul + li.subsections + a.admin_menu_icon.features [href="{boardurl}/index.php?action=admin;area=featuresettings;{session_var}={session_id}"] + span.features.main_icons + "Features and Options" + ul + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=basic;{session_var}={session_id}"] + "General" + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=bbc;{session_var}={session_id}"] + "Bulletin Board Code & Markdown" + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=layout;{session_var}={session_id}"] + "Layout" + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=sig;{session_var}={session_id}"] + "Signatures" + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=profile;{session_var}={session_id}"] + "Profile Fields" + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=likes;{session_var}={session_id}"] + "Likes" + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=mentions;{session_var}={session_id}"] + "Mentions" + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=alerts;{session_var}={session_id}"] + "Notifications" + li + a.admin_menu_icon.security [href="{boardurl}/index.php?action=admin;area=antispam;{session_var}={session_id}"] + span.main_icons.security + "Anti-Spam" + li.subsections + a.admin_menu_icon.languages [href="{boardurl}/index.php?action=admin;area=languages;{session_var}={session_id}"] + span.languages.main_icons + "Languages" + ul + li + a [href="{boardurl}/index.php?action=admin;area=languages;sa=edit;{session_var}={session_id}"] + "Edit Languages" + li + a [href="{boardurl}/index.php?action=admin;area=languages;sa=add;{session_var}={session_id}"] + "Add Language" + li + a [href="{boardurl}/index.php?action=admin;area=languages;sa=settings;{session_var}={session_id}"] + "Settings" + li + a.admin_menu_icon.current_theme [href="{boardurl}/index.php?action=admin;area=theme;sa=list;th=#;{session_var}={session_id}"] + span.current_theme.main_icons + "Current Theme" + li.subsections + a.admin_menu_icon.themes [href="{boardurl}/index.php?action=admin;area=theme;{session_var}={session_id}"] + span.main_icons.themes + "Themes and Layout" + ul + li + a [href="{boardurl}/index.php?action=admin;area=theme;sa=admin;{session_var}={session_id}"] + "Manage and Install" + li + a [href="{boardurl}/index.php?action=admin;area=theme;sa=list;{session_var}={session_id}"] + "Theme Settings" + li + a [href="{boardurl}/index.php?action=admin;area=theme;sa=reset;{session_var}={session_id}"] + "Member Options" + li + a [href="{boardurl}/index.php?action=admin;area=theme;sa=edit;{session_var}={session_id}"] + "Modify Themes" + li.subsections + a.admin_menu_icon.modifications [href="{boardurl}/index.php?action=admin;area=modsettings;{session_var}={session_id}"] + span.main_icons.modifications + "Modification Settings" + ul + li + a [href="{boardurl}/index.php?action=admin;area=modsettings;sa=general;{session_var}={session_id}"] + "Miscellaneous" + li.subsections + a [href="{boardurl}/index.php?action=admin;area=manageboards;{session_var}={session_id}"] + "Forum" + ul + li.subsections + a.admin_menu_icon.boards [href="{boardurl}/index.php?action=admin;area=manageboards;{session_var}={session_id}"] + span.boards.main_icons + "Boards and Categories" + ul + li + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=main;{session_var}={session_id}"] + "Modify Boards" + li + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=newcat;{session_var}={session_id}"] + "Create new category" + li + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=settings;{session_var}={session_id}"] + "Settings" + li.subsections + a.admin_menu_icon.posts [href="{boardurl}/index.php?action=admin;area=postsettings;{session_var}={session_id}"] + span.main_icons.posts + "Posts and Topics" + ul + li + a [href="{boardurl}/index.php?action=admin;area=postsettings;sa=posts;{session_var}={session_id}"] + "Post Settings" + li + a [href="{boardurl}/index.php?action=admin;area=postsettings;sa=censor;{session_var}={session_id}"] + "Censored Words" + li + a [href="{boardurl}/index.php?action=admin;area=postsettings;sa=topics;{session_var}={session_id}"] + "Topic Settings" + li + a [href="{boardurl}/index.php?action=admin;area=postsettings;sa=drafts;{session_var}={session_id}"] + "Drafts" + li + a.admin_menu_icon.calendar [href="{boardurl}/index.php?action=admin;area=managecalendar;{session_var}={session_id}"] + span.calendar.main_icons + "Calendar" + li.subsections + a.admin_menu_icon.search [href="{boardurl}/index.php?action=admin;area=managesearch;{session_var}={session_id}"] + span.main_icons.search + "Search" + ul + li + a [href="{boardurl}/index.php?action=admin;area=managesearch;sa=weights;{session_var}={session_id}"] + "Weights" + li + a [href="{boardurl}/index.php?action=admin;area=managesearch;sa=method;{session_var}={session_id}"] + "Search Method" + li + a [href="{boardurl}/index.php?action=admin;area=managesearch;sa=settings;{session_var}={session_id}"] + "Settings" + li.subsections + a.admin_menu_icon.smiley [href="{boardurl}/index.php?action=admin;area=smileys;{session_var}={session_id}"] + span.main_icons.smiley + "Smileys and Message Icons" + ul + li + a [href="{boardurl}/index.php?action=admin;area=smileys;sa=editsets;{session_var}={session_id}"] + "Smiley Sets" + li + a [href="{boardurl}/index.php?action=admin;area=smileys;sa=settings;{session_var}={session_id}"] + "Settings" + li.subsections + a.admin_menu_icon.attachment [href="{boardurl}/index.php?action=admin;area=manageattachments;{session_var}={session_id}"] + span.attachment.main_icons + "Attachments and Avatars" + ul + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;{session_var}={session_id}"] + "Browse Files" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachments;{session_var}={session_id}"] + "Attachment Settings" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=avatars;{session_var}={session_id}"] + "Avatar Settings" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachpaths;{session_var}={session_id}"] + "Attachment Directories" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=maintenance;{session_var}={session_id}"] + "File Maintenance" + li + a.admin_menu_icon.engines [href="{boardurl}/index.php?action=admin;area=sengines;{session_var}={session_id}"] + span.engines.main_icons + "Search Engines" + li.subsections + a [href="{boardurl}/index.php?action=admin;area=viewmembers;{session_var}={session_id}"] + "Members" + ul + li.subsections + a.admin_menu_icon.members [href="{boardurl}/index.php?action=admin;area=viewmembers;{session_var}={session_id}"] + span.main_icons.members + "Members" + ul + li + a [href="{boardurl}/index.php?action=admin;area=viewmembers;sa=all;{session_var}={session_id}"] + "View all Members" + li + a [href="{boardurl}/index.php?action=admin;area=viewmembers;sa=search;{session_var}={session_id}"] + "Search for Members" + li + a [href="{boardurl}/index.php?action=admin;area=viewmembers;sa=settings;{session_var}={session_id}"] + "Settings" + li.subsections + a.admin_menu_icon.membergroups [href="{boardurl}/index.php?action=admin;area=membergroups;{session_var}={session_id}"] + span.main_icons.membergroups + "Membergroups" + ul + li + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=index;{session_var}={session_id}"] + "Edit membergroups" + li + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=add;{session_var}={session_id}"] + "Add membergroup" + li + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=settings;{session_var}={session_id}"] + "Settings" + li.subsections + a.admin_menu_icon.permissions [href="{boardurl}/index.php?action=admin;area=permissions;{session_var}={session_id}"] + span.main_icons.permissions + "Permissions" + ul + li + a [href="{boardurl}/index.php?action=admin;area=permissions;sa=index;{session_var}={session_id}"] + "General permissions" + li + a [href="{boardurl}/index.php?action=admin;area=permissions;sa=board;{session_var}={session_id}"] + "Board permissions" + li + a [href="{boardurl}/index.php?action=admin;area=permissions;sa=profiles;{session_var}={session_id}"] + "Edit profiles" + li + a [href="{boardurl}/index.php?action=admin;area=permissions;sa=postmod;{session_var}={session_id}"] + "Post moderation" + li + a [href="{boardurl}/index.php?action=admin;area=permissions;sa=settings;{session_var}={session_id}"] + "Settings" + li.subsections + a.admin_menu_icon.regcenter [href="{boardurl}/index.php?action=admin;area=regcenter;{session_var}={session_id}"] + span.main_icons.regcenter + "Registration" + ul + li + a [href="{boardurl}/index.php?action=admin;area=regcenter;sa=register;{session_var}={session_id}"] + "Register new member" + li + a [href="{boardurl}/index.php?action=admin;area=regcenter;sa=agreement;{session_var}={session_id}"] + "Registration Agreement" + li + a [href="{boardurl}/index.php?action=admin;area=regcenter;sa=policy;{session_var}={session_id}"] + "Privacy Policy" + li + a [href="{boardurl}/index.php?action=admin;area=regcenter;sa=reservednames;{session_var}={session_id}"] + "Set reserved names" + li + a [href="{boardurl}/index.php?action=admin;area=regcenter;sa=settings;{session_var}={session_id}"] + "Settings" + li + a.admin_menu_icon.warning [href="{boardurl}/index.php?action=admin;area=warnings;{session_var}={session_id}"] + span.main_icons.warning + "Warnings" + li.subsections + a.admin_menu_icon.ban [href="{boardurl}/index.php?action=admin;area=ban;{session_var}={session_id}"] + span.ban.main_icons + "Ban list" + ul + li + a [href="{boardurl}/index.php?action=admin;area=ban;sa=list;{session_var}={session_id}"] + "Ban list" + li + a [href="{boardurl}/index.php?action=admin;area=ban;sa=add;{session_var}={session_id}"] + "Add new ban" + li + a [href="{boardurl}/index.php?action=admin;area=ban;sa=browse;{session_var}={session_id}"] + "Browse Ban Triggers" + li + a [href="{boardurl}/index.php?action=admin;area=ban;sa=log;{session_var}={session_id}"] + "Ban Log" + li + a.admin_menu_icon.paid [href="{boardurl}/index.php?action=admin;area=paidsubscribe;{session_var}={session_id}"] + span.main_icons.paid + "Paid Subscriptions" + li.subsections + a [href="{boardurl}/index.php?action=admin;area=serversettings;{session_var}={session_id}"] + "Maintenance" + ul + li.subsections + a.admin_menu_icon.server [href="{boardurl}/index.php?action=admin;area=serversettings;{session_var}={session_id}"] + span.main_icons.server + "Server Settings" + ul + li + a [href="{boardurl}/index.php?action=admin;area=serversettings;sa=general;{session_var}={session_id}"] + "General" + li + a [href="{boardurl}/index.php?action=admin;area=serversettings;sa=database;{session_var}={session_id}"] + "Database" + li + a [href="{boardurl}/index.php?action=admin;area=serversettings;sa=cookie;{session_var}={session_id}"] + "Cookies and Sessions" + li + a [href="{boardurl}/index.php?action=admin;area=serversettings;sa=security;{session_var}={session_id}"] + "Security" + li + a [href="{boardurl}/index.php?action=admin;area=serversettings;sa=cache;{session_var}={session_id}"] + "Caching" + li + a [href="{boardurl}/index.php?action=admin;area=serversettings;sa=export;{session_var}={session_id}"] + "Data Export" + li + a [href="{boardurl}/index.php?action=admin;area=serversettings;sa=loads;{session_var}={session_id}"] + "Load Balancing" + li + a [href="{boardurl}/index.php?action=admin;area=serversettings;sa=phpinfo;{session_var}={session_id}"] + "PHP Info" + li.subsections + a.admin_menu_icon.maintain [href="{boardurl}/index.php?action=admin;area=maintain;{session_var}={session_id}"] + span.main_icons.maintain + "Forum Maintenance" + ul + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=routine;{session_var}={session_id}"] + "Routine" + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=database;{session_var}={session_id}"] + "Database" + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=members;{session_var}={session_id}"] + "Members" + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=topics;{session_var}={session_id}"] + "Topics" + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=hooks;{session_var}={session_id}"] + "Integration Hooks" + li.subsections + a.admin_menu_icon.scheduled [href="{boardurl}/index.php?action=admin;area=scheduledtasks;{session_var}={session_id}"] + span.main_icons.scheduled + "Scheduled Tasks" + ul + li + a [href="{boardurl}/index.php?action=admin;area=scheduledtasks;sa=tasks;{session_var}={session_id}"] + "Scheduled Tasks" + li + a [href="{boardurl}/index.php?action=admin;area=scheduledtasks;sa=tasklog;{session_var}={session_id}"] + "Task Log" + li + a [href="{boardurl}/index.php?action=admin;area=scheduledtasks;sa=settings;{session_var}={session_id}"] + "Settings" + li.subsections + a.admin_menu_icon.mail [href="{boardurl}/index.php?action=admin;area=mailqueue;{session_var}={session_id}"] + span.mail.main_icons + "Mail" + ul + li + a [href="{boardurl}/index.php?action=admin;area=mailqueue;sa=browse;{session_var}={session_id}"] + "Browse Queue" + li + a [href="{boardurl}/index.php?action=admin;area=mailqueue;sa=settings;{session_var}={session_id}"] + "Settings" + li + a [href="{boardurl}/index.php?action=admin;area=mailqueue;sa=test;{session_var}={session_id}"] + "Send Test" + li + a.admin_menu_icon.reports [href="{boardurl}/index.php?action=admin;area=reports;{session_var}={session_id}"] + span.main_icons.reports + "Reports" + li.subsections + a.admin_menu_icon.logs [href="{boardurl}/index.php?action=admin;area=logs;{session_var}={session_id}"] + span.logs.main_icons + "Logs" + ul + li + a [href="{boardurl}/index.php?action=admin;area=logs;sa=errorlog;desc;{session_var}={session_id}"] + "Error Log" + li + a [href="{boardurl}/index.php?action=admin;area=logs;sa=adminlog;{session_var}={session_id}"] + "Administration Log" + li + a [href="{boardurl}/index.php?action=admin;area=logs;sa=modlog;{session_var}={session_id}"] + "Moderation Log" + li + a [href="{boardurl}/index.php?action=admin;area=logs;sa=banlog;{session_var}={session_id}"] + "Ban Log" + li + a [href="{boardurl}/index.php?action=admin;area=logs;sa=tasklog;{session_var}={session_id}"] + "Task Log" + li + a [href="{boardurl}/index.php?action=admin;area=logs;sa=settings;{session_var}={session_id}"] + "Log Settings" diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/antispam.txt b/tests/Integration/Http/Snapshot/snapshots/admin/antispam.txt new file mode 100644 index 00000000000..76cabd27e7f --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/antispam.txt @@ -0,0 +1,251 @@ +status 200 +@ title +title + "Anti-Spam" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=antispam;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Anti-Spam" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + "Anti-Spam" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "This section allows you to setup verification checks to ensure the user is a human (and not a bot), and tweak how and where these apply." + form#admin_form_wrapper [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=antispam;save" method="post"] + div.cat_bar + h3.catbg + "Anti-Spam Verification" + div.noup.windowbg + dl.settings + dt + a#setting_reg_verification + span + label [for="reg_verification"] + "Require verification on registration page" + dd + input#reg_verification [checked name="reg_verification" type="checkbox" value="#"] + dt + a#setting_search_enable_captcha + span + label [for="search_enable_captcha"] + "Require verification on all guest searches" + dd + input#search_enable_captcha [name="search_enable_captcha" type="checkbox" value="#"] + dt + a#setting_guests_require_captcha + span + label [for="guests_require_captcha"] + "Guests must pass verification when making a post" + br + span.smalltext + "(Automatically set if you specify a minimum post count below)" + dd + input#guests_require_captcha [name="guests_require_captcha" type="checkbox" value="#"] + dt + a#setting_posts_require_captcha_help [href="{boardurl}/index.php?action=helpadmin;help=posts_require_captcha" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_posts_require_captcha + span + label [for="posts_require_captcha"] + "Post count under which users must pass verification to make a post" + br + span.smalltext + "(# for(s) no limit, moderators are exempt)" + dd + input#posts_require_captcha [min="-#" name="posts_require_captcha" onchange="if (this.value > #){ document.getElementById('guests_require_captcha').checked = true; document.getElementById('guests_require_captcha').disabled = true;} else {document.getElementById('guests_require_captcha').disabled = false;}" size="#" type="number" value="#"] + hr + dl.settings + dt + a#setting_max_pm_recipients_help [href="{boardurl}/index.php?action=helpadmin;help=max_pm_recipients" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_max_pm_recipients + span + label [for="max_pm_recipients"] + "Maximum number of recipients allowed in a personal message" + br + span.smalltext + "(# for(s) no limit, admins are exempt)" + dd + input#max_pm_recipients [min="#" name="max_pm_recipients" size="#" type="number" value="#"] + dt + a#setting_pm_posts_verification_help [href="{boardurl}/index.php?action=helpadmin;help=pm_posts_verification" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_pm_posts_verification + span + label [for="pm_posts_verification"] + "Post count under which users must pass verification when sending personal messages" + br + span.smalltext + "(# for(s) no limit, admins are exempt)" + dd + input#pm_posts_verification [min="#" name="pm_posts_verification" size="#" type="number" value="#"] + dt + a#setting_pm_posts_per_hour_help [href="{boardurl}/index.php?action=helpadmin;help=pm_posts_per_hour" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_pm_posts_per_hour + span + label [for="pm_posts_per_hour"] + "Number of personal messages a user may send in an hour" + br + span.smalltext + "(# for(s) no limit, moderators are exempt)" + dd + input#pm_posts_per_hour [min="#" name="pm_posts_per_hour" size="#" type="number" value="#"] + div.cat_bar + h3.catbg + "Configure Verification methods" + div.information.noup + span.smalltext + "Below you can set which anti-spam features you wish to have enabled whenever a user needs to verify they are a human. Note that the user will have to pass" + em + "all" + "verification so if you enable both a verification image and a question/answer test they need to complete both to proceed." + div.noup.windowbg + dl.settings + dt + a#setting_visual_verification_type + span + label [for="visual_verification_type"] + "Visual verification image to display" + br + span.smalltext + "The more complex the image the harder it is for bots to bypass" + dd + select#visual_verification_type [name="visual_verification_type" onchange="refreshImages();" size="#"] + option [value="#"] + "None" + option [value="#"] + "Very Simple - Plain text on image" + option [value="#"] + "Simple - Overlapping colored letters, no noise" + option [selected value="#"] + "Medium - Overlapping colored letters, with noise/lines" + option [value="#"] + "High - Angled letters, considerable noise/lines" + option [value="#"] + "Extreme - Angled letters, noise, lines and blocks" + br + img#verification_image [alt="Sample" src="{boardurl}/index.php?action=verificationcode;rand={hash};type=#"] + br + div.cat_bar + h3.catbg + "reCAPTCHA Verification System" + div.information.noup + "Configure the reCAPTCHA Verification System. Don’t have a key for reCAPTCHA?" + a [href="https://www.google.com/recaptcha/admin"] + "Get your reCAPTCHA key here" + "." + div.noup.windowbg + dl.settings + dt + a#setting_recaptcha_enabled + span + label [for="recaptcha_enabled"] + "Use reCAPTCHA Verification System" + br + span.smalltext + "This augments the built-in visual verification" + dd + input#recaptcha_enabled [name="recaptcha_enabled" type="checkbox" value="#"] + dt + a#setting_recaptcha_site_key + span + label [for="recaptcha_site_key"] + "Site Key" + br + span.smalltext + "This will be set in the HTML code your site serves to users." + dd + input#recaptcha_site_key [name="recaptcha_site_key" type="text" value] + dt + a#setting_recaptcha_secret_key + span + label [for="recaptcha_secret_key"] + "Secret Key" + br + span.smalltext + "This is for communication between your site and Google. Be sure to keep it a secret." + dd + input#recaptcha_secret_key [name="recaptcha_secret_key" type="text" value] + dt + a#setting_recaptcha_theme + span + label [for="recaptcha_theme"] + "reCAPTCHA Theme" + dd + select#recaptcha_theme [name="recaptcha_theme" size="#"] + option [value="light"] + "Light" + option [value="dark"] + "Dark" + div.cat_bar + h3.catbg + "Verification Questions" + div.information.noup + span.smalltext + "If you want users to answer verification questions in order to stop spam bots, you should setup a number of questions in the table below. You should choose questions which relate to the subject of your forum. Genuine users will be able to answer these questions, while spam bots will not. Answers are not case sensitive. You may use BBC in the questions for formatting. To remove a question simply delete the contents of that line." + div.noup.windowbg + dl.settings + dt + a#setting_qa_verification_number + span + label [for="qa_verification_number"] + "Number of verification questions user must answer" + br + span.smalltext + "(# to(s) disable; questions are set below)" + dd + input#qa_verification_number [min="#" name="qa_verification_number" size="#" type="number" value="#"] + dt#qa_dt_en_US.qa_link + a [href="javascript:void(#);"] + "[ English (US) ]" + fieldset#qa_fs_en_US.qa_fieldset + legend + a [href="javascript:void(#);"] + "English (US)" + dl.settings + dt + strong + "Question" + dd + strong + "Answer" + dt.qa_add_question + a [href="javascript:void(#);"] + "[ Add another question ]" + input.button [type="submit" value="Save"] + input [name="{token_var}" type="hidden" value="{hash}"] + input [name="{session_var}" type="hidden" value="{session_id}"] + script + | function refreshImages() { var imageType = document.getElementById('visual_verification_type').value; document.getElementById('verification_image').src = '{boardurl}/index.php?action=verificationcode;rand={hash};type=' + imageType; } diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/attachments.txt b/tests/Integration/Http/Snapshot/snapshots/admin/attachments.txt new file mode 100644 index 00000000000..235c4936a04 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/attachments.txt @@ -0,0 +1,368 @@ +status 200 +@ title +title + "Attachments and Avatars" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Attachments and Avatars" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachments;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Attachment Settings" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=manage_files" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Attachments and Avatars" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "From here you can administer the attached files on your system. You can delete attachments by size and by date from your system. Statistics on attachments are also displayed below." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Attachments and Avatars Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Attachments and Avatars Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;{session_var}={session_id}"] + "Browse Files" + li + a.active [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachments;{session_var}={session_id}"] + "Attachment Settings" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=avatars;{session_var}={session_id}"] + "Avatar Settings" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachpaths;{session_var}={session_id}"] + "Attachment Directories" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=maintenance;{session_var}={session_id}"] + "File Maintenance" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + form#admin_form_wrapper [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=manageattachments;save;sa=attachments" method="post"] + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=attachment_manager_settings" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Attachment Settings" + div.noup.windowbg + dl.settings + dt + a#setting_attachmentEnable_help [href="{boardurl}/index.php?action=helpadmin;help=attachmentEnable" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_attachmentEnable + span + label [for="attachmentEnable"] + "Attachments mode" + dd + select#attachmentEnable [name="attachmentEnable" size="#"] + option [value="#"] + "Disable attachments" + option [selected value="#"] + "Enable all attachments" + option [value="#"] + "Disable new attachments" + hr + dl.settings + dt + a#setting_automanage_attachments_help [href="{boardurl}/index.php?action=helpadmin;help=automanage_attachments" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_automanage_attachments + span + label [for="automanage_attachments"] + "Choose the method for the management of the attachment directories" + dd + select#automanage_attachments [name="automanage_attachments" size="#"] + option [value="#"] + "(Manual) SMF default behavior" + option [value="#"] + "(Auto) When either directory space limit is reached" + option [value="#"] + "(Auto) Subdivide by years" + option [value="#"] + "(Auto) Subdivide by years and months" + option [value="#"] + "(Auto) # random(s) directories" + dt + a#setting_use_subdirectories_for_attachments_help [href="{boardurl}/index.php?action=helpadmin;help=use_subdirectories_for_attachments" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_use_subdirectories_for_attachments + span + label [for="use_subdirectories_for_attachments"] + "Create new directories within a base directory" + dd + input#use_subdirectories_for_attachments [checked name="use_subdirectories_for_attachments" type="checkbox" value="#"] + dt + a#setting_basedirectory_for_attachments + span + label [for="basedirectory_for_attachments"] + "Set a base directory for attachments" + dd + input#basedirectory_for_attachments [name="basedirectory_for_attachments" size="#" type="text" value="{boarddir}/attachments"] + dt + a#setting_attachmentUploadDir_path + span + label [for="attachmentUploadDir_path"] + "Attachments directory" + br + span.smalltext + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachpaths"] + "[Manage attachment directories]" + dd + div#attachmentUploadDir_path + "{boarddir}/attachments" + dt + a#setting_attachmentDirFileLimit_help [href="{boardurl}/index.php?action=helpadmin;help=attachmentDirFileLimit" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_attachmentDirFileLimit + span + label [for="attachmentDirFileLimit"] + "Maximum number of files per directory" + br + span.smalltext + "(# for(s) no limit)" + dd + input#attachmentDirFileLimit [min="#" name="attachmentDirFileLimit" size="#" type="number" value="#"] + dt + a#setting_attachmentDirSizeLimit_help [href="{boardurl}/index.php?action=helpadmin;help=attachmentDirSizeLimit" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_attachmentDirSizeLimit + span + label [for="attachmentDirSizeLimit"] + "Max attachment directory space" + br + span.smalltext + "(# for(s) no limit)" + dd + input#attachmentDirSizeLimit [min="#" name="attachmentDirSizeLimit" size="#" type="number" value="#"] + "KB" + dt + a#setting_dont_show_attach_under_post_help [href="{boardurl}/index.php?action=helpadmin;help=dont_show_attach_under_post" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_dont_show_attach_under_post + span + label [for="dont_show_attach_under_post"] + "Do not show attachments under the post if they are already embedded in it." + br + span.smalltext + "Enable this if you do not want attachments to appear twice. Attachments embedded in the post still count towards attachment limits and can still be treated like normal attachments." + dd + input#dont_show_attach_under_post [name="dont_show_attach_under_post" type="checkbox" value="#"] + hr + dl.settings + dt + a#setting_attachmentPostLimit_help [href="{boardurl}/index.php?action=helpadmin;help=attachmentPostLimit" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_attachmentPostLimit + span + label [for="attachmentPostLimit"] + "Max attachment size per post" + br + span.smalltext + "Maximum allowed by php.ini: #,# KB(s)" + dd + input#attachmentPostLimit [max="#" min="#" name="attachmentPostLimit" size="#" type="number" value="#"] + "KB" + dt + a#setting_attachmentSizeLimit_help [href="{boardurl}/index.php?action=helpadmin;help=attachmentSizeLimit" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_attachmentSizeLimit + span + label [for="attachmentSizeLimit"] + "Max size per attachment" + br + span.smalltext + "Maximum allowed by php.ini: #,# KB(s)" + dd + input#attachmentSizeLimit [max="#" min="#" name="attachmentSizeLimit" size="#" type="number" value="#"] + "KB" + dt + a#setting_attachmentNumPerPostLimit_help [href="{boardurl}/index.php?action=helpadmin;help=attachmentNumPerPostLimit" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_attachmentNumPerPostLimit + span + label [for="attachmentNumPerPostLimit"] + "Max number of attachments per post" + br + span.smalltext + "(# for(s) no limit)" + dd + input#attachmentNumPerPostLimit [min="#" name="attachmentNumPerPostLimit" size="#" type="number" value="#"] + div.cat_bar + h3.catbg + "Attachment security settings" + div.noup.windowbg + dl.settings + dt + a#setting_attachmentCheckExtensions_help [href="{boardurl}/index.php?action=helpadmin;help=attachmentCheckExtensions" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_attachmentCheckExtensions + span + label [for="attachmentCheckExtensions"] + "Check attachment’s extension" + dd + input#attachmentCheckExtensions [name="attachmentCheckExtensions" type="checkbox" value="#"] + dt + a#setting_attachmentExtensions_help [href="{boardurl}/index.php?action=helpadmin;help=attachmentExtensions" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_attachmentExtensions + span + label [for="attachmentExtensions"] + "Allowed attachment extensions" + dd + input#attachmentExtensions [name="attachmentExtensions" size="#" type="text" value="doc,gif,jpg,mpg,pdf,png,txt,zip"] + hr + dl.settings + dt + a#setting_attachment_image_reencode_help [href="{boardurl}/index.php?action=helpadmin;help=attachment_image_reencode" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_attachment_image_reencode + span + label [for="attachment_image_reencode"] + "Re-encode potentially dangerous image attachments" + dd + input#attachment_image_reencode [checked name="attachment_image_reencode" type="checkbox" value="#"] + hr + dl.settings + dd.alert + "The extensive security checks can result in a large number of rejected attachments." + dt + a#setting_attachment_image_paranoid_help [href="{boardurl}/index.php?action=helpadmin;help=attachment_image_paranoid" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_attachment_image_paranoid + span + label [for="attachment_image_paranoid"] + "Perform extensive security checks on uploaded image attachments" + dd + input#attachment_image_paranoid [name="attachment_image_paranoid" type="checkbox" value="#"] + div.cat_bar + h3.catbg + "Thumbnail Settings" + div.noup.windowbg + dl.settings + dt + a#setting_attachmentShowImages_help [href="{boardurl}/index.php?action=helpadmin;help=attachmentShowImages" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_attachmentShowImages + span + label [for="attachmentShowImages"] + "Display image attachments as pictures under post" + dd + input#attachmentShowImages [checked name="attachmentShowImages" type="checkbox" value="#"] + dt + a#setting_attachmentThumbnails_help [href="{boardurl}/index.php?action=helpadmin;help=attachmentThumbnails" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_attachmentThumbnails + span + label [for="attachmentThumbnails"] + "Resize images when showing under posts" + dd + input#attachmentThumbnails [checked name="attachmentThumbnails" type="checkbox" value="#"] + dt + a#setting_attachment_thumb_png + span + label [for="attachment_thumb_png"] + "Save thumbnails as PNG" + dd + input#attachment_thumb_png [checked name="attachment_thumb_png" type="checkbox" value="#"] + dt + a#setting_attachment_thumb_memory_help [href="{boardurl}/index.php?action=helpadmin;help=attachment_thumb_memory" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_attachment_thumb_memory + span + label [for="attachment_thumb_memory"] + "Adaptive thumbnail memory" + dd + input#attachment_thumb_memory [name="attachment_thumb_memory" type="checkbox" value="#"] + dd.alert + "If disabled, memory is limited to # MB(s)" + dt + a#setting_attachmentThumbWidth_help [href="{boardurl}/index.php?action=helpadmin;help=attachmentThumbWidth" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_attachmentThumbWidth + span + label [for="attachmentThumbWidth"] + "Maximum width of thumbnails" + dd + input#attachmentThumbWidth [name="attachmentThumbWidth" size="#" type="text" value="#"] + dt + a#setting_attachmentThumbHeight_help [href="{boardurl}/index.php?action=helpadmin;help=attachmentThumbHeight" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_attachmentThumbHeight + span + label [for="attachmentThumbHeight"] + "Maximum height of thumbnails" + dd + input#attachmentThumbHeight [name="attachmentThumbHeight" size="#" type="text" value="#"] + hr + dl.settings + dt + a#setting_max_image_width_help [href="{boardurl}/index.php?action=helpadmin;help=max_image_width" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_max_image_width + span + label [for="max_image_width"] + "Max display width of posted or attached images" + br + span.smalltext + "(# for(s) no limit)" + dd + input#max_image_width [min="#" name="max_image_width" size="#" type="number" value="#"] + dt + a#setting_max_image_height_help [href="{boardurl}/index.php?action=helpadmin;help=max_image_height" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_max_image_height + span + label [for="max_image_height"] + "Max display height of posted or attached images" + br + span.smalltext + "(# for(s) no limit)" + dd + input#max_image_height [min="#" name="max_image_height" size="#" type="number" value="#"] + input.button [type="submit" value="Save"] + input [name="{token_var}" type="hidden" value="{hash}"] + input [name="{session_var}" type="hidden" value="{session_id}"] + script + | var storing_type = document.getElementById('automanage_attachments'); var base_dir = document.getElementById('use_subdirectories_for_attachments'); storing_type.addEventListener("change", toggleSubDir, false); base_dir.addEventListener("change", toggleSubDir, false); toggleSubDir(); diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/attachments_avatars.txt b/tests/Integration/Http/Snapshot/snapshots/admin/attachments_avatars.txt new file mode 100644 index 00000000000..e4a5d0b65b3 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/attachments_avatars.txt @@ -0,0 +1,390 @@ +status 200 +@ title +title + "Attachments and Avatars" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Attachments and Avatars" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=avatars;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Avatar Settings" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=manage_files" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Attachments and Avatars" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "From here you can administer the attached files on your system. You can delete attachments by size and by date from your system. Statistics on attachments are also displayed below." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Attachments and Avatars Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Attachments and Avatars Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;{session_var}={session_id}"] + "Browse Files" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachments;{session_var}={session_id}"] + "Attachment Settings" + li + a.active [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=avatars;{session_var}={session_id}"] + "Avatar Settings" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachpaths;{session_var}={session_id}"] + "Attachment Directories" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=maintenance;{session_var}={session_id}"] + "File Maintenance" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + form#admin_form_wrapper [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=manageattachments;save;sa=avatars" method="post"] + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=avatar_server_stored" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Server-stored avatars" + div.noup.windowbg + dl.settings + dt + a#setting_profile_server_avatar + span + label + "Membergroups allowed to select a server stored avatar" + dd + fieldset#profile_server_avatar + legend + a.toggle_up [href="javascript:void(#);" onclick="document.getElementById('profile_server_avatar').style.display = 'none';document.getElementById('profile_server_avatar_groups_link').style.display = 'block'; return false;"] + "Select permissions for each group" + ul + li + input [checked name="profile_server_avatar[#]" type="checkbox" value="on"] + span + "Regular Members" + li + input [checked name="profile_server_avatar[#]" type="checkbox" value="on"] + span + "Global Moderator" + li + input [onclick="invertAll(this, this.form, 'profile_server_avatar[');" type="checkbox"] + span + "Select all" + a#profile_server_avatar_groups_link.toggle_down [href="javascript:void(#);" onclick="document.getElementById('profile_server_avatar').style.display = 'block'; document.getElementById('profile_server_avatar_groups_link').style.display = 'none'; return false;" style="display: none;"] + "Select permissions for each group" + script + | document.getElementById("profile_server_avatar").style.display = "none"; document.getElementById("profile_server_avatar_groups_link").style.display = ""; + dt + a#setting_avatar_directory + span + label [for="avatar_directory"] + "Avatars directory" + dd + input#avatar_directory [name="avatar_directory" size="#" type="text" value="{boarddir}/avatars"] + dt + a#setting_avatar_url + span + label [for="avatar_url"] + "Avatars URL" + dd + input#avatar_url [name="avatar_url" size="#" type="text" value="{boardurl}/avatars"] + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=avatar_external" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "External avatars" + div.noup.windowbg + dl.settings + dt + a#setting_profile_remote_avatar + span + label + "Membergroups allowed to select an external URL" + dd + fieldset#profile_remote_avatar + legend + a.toggle_up [href="javascript:void(#);" onclick="document.getElementById('profile_remote_avatar').style.display = 'none';document.getElementById('profile_remote_avatar_groups_link').style.display = 'block'; return false;"] + "Select permissions for each group" + ul + li + input [checked name="profile_remote_avatar[#]" type="checkbox" value="on"] + span + "Regular Members" + li + input [checked name="profile_remote_avatar[#]" type="checkbox" value="on"] + span + "Global Moderator" + li + input [onclick="invertAll(this, this.form, 'profile_remote_avatar[');" type="checkbox"] + span + "Select all" + a#profile_remote_avatar_groups_link.toggle_down [href="javascript:void(#);" onclick="document.getElementById('profile_remote_avatar').style.display = 'block'; document.getElementById('profile_remote_avatar_groups_link').style.display = 'none'; return false;" style="display: none;"] + "Select permissions for each group" + script + | document.getElementById("profile_remote_avatar").style.display = "none"; document.getElementById("profile_remote_avatar_groups_link").style.display = ""; + dt + a#setting_avatar_download_external_help [href="{boardurl}/index.php?action=helpadmin;help=avatar_download_external" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_avatar_download_external + span + label [for="avatar_download_external"] + "Download avatar at given URL" + dd + input#avatar_download_external [name="avatar_download_external" onchange="fUpdateStatus();" type="checkbox" value="#"] + dt + a#setting_avatar_max_width_external + span + label [for="avatar_max_width_external"] + "Maximum width of external avatar" + br + span.smalltext + "(# for(s) no limit)" + dd + input#avatar_max_width_external [name="avatar_max_width_external" size="#" type="text" value="#"] + dt + a#setting_avatar_max_height_external + span + label [for="avatar_max_height_external"] + "Maximum height of external avatar" + br + span.smalltext + "(# for(s) no limit)" + dd + input#avatar_max_height_external [name="avatar_max_height_external" size="#" type="text" value="#"] + dt + a#setting_avatar_action_too_large_help [href="{boardurl}/index.php?action=helpadmin;help=avatar_action_too_large" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_avatar_action_too_large + span + label [for="avatar_action_too_large"] + "If the avatar is too large..." + dd + select#avatar_action_too_large [name="avatar_action_too_large" size="#"] + option [value="option_refuse"] + "Refuse it" + option [selected value="option_css_resize"] + "Resize it in the users’ browser" + option [value="option_download_and_resize"] + "Download and resize it on the server" + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=avatar_upload" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Uploadable avatars" + div.noup.windowbg + dl.settings + dt + a#setting_profile_upload_avatar + span + label + "Membergroups allowed to upload an avatar to the server" + dd + fieldset#profile_upload_avatar + legend + a.toggle_up [href="javascript:void(#);" onclick="document.getElementById('profile_upload_avatar').style.display = 'none';document.getElementById('profile_upload_avatar_groups_link').style.display = 'block'; return false;"] + "Select permissions for each group" + ul + li + input [checked name="profile_upload_avatar[#]" type="checkbox" value="on"] + span + "Regular Members" + li + input [checked name="profile_upload_avatar[#]" type="checkbox" value="on"] + span + "Global Moderator" + li + input [onclick="invertAll(this, this.form, 'profile_upload_avatar[');" type="checkbox"] + span + "Select all" + a#profile_upload_avatar_groups_link.toggle_down [href="javascript:void(#);" onclick="document.getElementById('profile_upload_avatar').style.display = 'block'; document.getElementById('profile_upload_avatar_groups_link').style.display = 'none'; return false;" style="display: none;"] + "Select permissions for each group" + script + | document.getElementById("profile_upload_avatar").style.display = "none"; document.getElementById("profile_upload_avatar_groups_link").style.display = ""; + dt + a#setting_avatar_max_width_upload + span + label [for="avatar_max_width_upload"] + "Maximum width of uploaded avatar" + br + span.smalltext + "(# for(s) no limit)" + dd + input#avatar_max_width_upload [name="avatar_max_width_upload" size="#" type="text" value="#"] + dt + a#setting_avatar_max_height_upload + span + label [for="avatar_max_height_upload"] + "Maximum height of uploaded avatar" + br + span.smalltext + "(# for(s) no limit)" + dd + input#avatar_max_height_upload [name="avatar_max_height_upload" size="#" type="text" value="#"] + dt + a#setting_avatar_resize_upload + span + label [for="avatar_resize_upload"] + "Resize oversized large avatars" + br + span.smalltext + "(requires GD module or ImageMagick with IMagick extension)" + dd + input#avatar_resize_upload [checked name="avatar_resize_upload" type="checkbox" value="#"] + dt + a#setting_avatar_download_png_help [href="{boardurl}/index.php?action=helpadmin;help=avatar_download_png" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_avatar_download_png + span + label [for="avatar_download_png"] + "Use PNG for resized avatars" + dd + input#avatar_download_png [checked name="avatar_download_png" type="checkbox" value="#"] + dt + a#setting_avatar_reencode_help [href="{boardurl}/index.php?action=helpadmin;help=avatar_reencode" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_avatar_reencode + span + label [for="avatar_reencode"] + "Re-encode potentially dangerous avatars" + dd + input#avatar_reencode [checked name="avatar_reencode" type="checkbox" value="#"] + hr + dl.settings + dd.alert + "The extensive security checks can result in a large number of rejected avatars." + dt + a#setting_avatar_paranoid_help [href="{boardurl}/index.php?action=helpadmin;help=avatar_paranoid" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_avatar_paranoid + span + label [for="avatar_paranoid"] + "Perform extensive security checks on uploaded avatars" + dd + input#avatar_paranoid [name="avatar_paranoid" type="checkbox" value="#"] + hr + dl.settings + dt + a#setting_custom_avatar_dir + span + label [for="custom_avatar_dir"] + "Upload directory" + br + span.smalltext + "This should be a valid and writable directory, different from the server-stored directory." + dd + input#custom_avatar_dir [name="custom_avatar_dir" size="#" type="text" value="{boarddir}/custom_avatar"] + dt + a#setting_custom_avatar_url + span + label [for="custom_avatar_url"] + "Upload URL" + dd + input#custom_avatar_url [name="custom_avatar_url" size="#" type="text" value="{boardurl}/custom_avatar"] + div.cat_bar + h3.catbg + "Gravatars (Globally Recognized Avatars)" + div.noup.windowbg + dl.settings + dt + a#setting_gravatarEnabled + span + label [for="gravatarEnabled"] + "Enable Gravatars for forum users?" + dd + input#gravatarEnabled [checked name="gravatarEnabled" type="checkbox" value="#"] + dt + a#setting_gravatarOverride + span + label [for="gravatarOverride"] + "Force Gravatars to be used instead of normal avatars?" + dd + input#gravatarOverride [name="gravatarOverride" type="checkbox" value="#"] + dt + a#setting_gravatarAllowExtraEmail + span + label [for="gravatarAllowExtraEmail"] + "Allow storing an extra email address for Gravatars?" + dd + input#gravatarAllowExtraEmail [checked name="gravatarAllowExtraEmail" type="checkbox" value="#"] + hr + dl.settings + dt + a#setting_gravatarMaxRating + span + label [for="gravatarMaxRating"] + "Maximum allowed rating?" + dd + select#gravatarMaxRating [name="gravatarMaxRating" size="#"] + option [value="G"] + "G rated (Generally acceptable)" + option [selected value="PG"] + "PG rated (Parental Guidance)" + option [value="R"] + "R rated (Restricted)" + option [value="X"] + "X rated (Explicit)" + dt + a#setting_gravatarDefault + span + label [for="gravatarDefault"] + "Default image to show when an email address has no matching Gravatar" + dd + select#gravatarDefault [name="gravatarDefault" size="#"] + option [value="mm"] + "A simple, cartoon-style silhouetted outline of a person" + option [value="identicon"] + "A geometric pattern based on an email hash" + option [value="monsterid"] + "A generated \"monster\" with different colors, faces, etc" + option [value="wavatar"] + "Generated faces with differing features and backgrounds" + option [value="retro"] + "Awesome generated, #-bit arcade-style pixelated faces" + option [value="blank"] + "A transparent PNG image" + input.button [onclick="return (document.getElementById('custom_avatar_dir').value == '' || document.getElementById('custom_avatar_url').value == '') ? confirm('The custom avatars directory you have specified may be empty or invalid. Please ensure these settings are correct.') : true;" type="submit" value="Save"] + input [name="{token_var}" type="hidden" value="{hash}"] + input [name="{session_var}" type="hidden" value="{session_id}"] + script + | var fUpdateStatus = function () { document.getElementById("avatar_max_width_external").disabled = document.getElementById("avatar_download_external").checked; document.getElementById("avatar_max_height_external").disabled = document.getElementById("avatar_download_external").checked; document.getElementById("avatar_action_too_large").disabled = document.getElementById("avatar_download_external").checked; } addLoadEvent(fUpdateStatus); diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/attachments_browse.txt b/tests/Integration/Http/Snapshot/snapshots/admin/attachments_browse.txt new file mode 100644 index 00000000000..0e31dcb088d --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/attachments_browse.txt @@ -0,0 +1,128 @@ +status 200 +@ title +title + "Attachments and Avatars" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Attachments and Avatars" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Browse Files" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=manage_files" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Attachments and Avatars" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "From here you can administer the attached files on your system. You can delete attachments by size and by date from your system. Statistics on attachments are also displayed below." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Attachments and Avatars Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Attachments and Avatars Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a.active [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;{session_var}={session_id}"] + "Browse Files" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachments;{session_var}={session_id}"] + "Attachment Settings" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=avatars;{session_var}={session_id}"] + "Avatar Settings" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachpaths;{session_var}={session_id}"] + "Attachment Directories" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=maintenance;{session_var}={session_id}"] + "File Maintenance" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=manageattachments;sa=remove" method="post"] + div.cat_bar + h3.catbg + "Browse files:" + img [alt=">" src="{boardurl}/Themes/default/images/selected.png"] + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse"] + "Attachments" + "|" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;avatars"] + "Avatars" + "|" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;thumbs"] + "Thumbnails" + div.additional_row + input.button.you_sure [data-confirm="Are you sure you want to delete the selected attachments?" name="remove_submit" type="submit" value="Remove selected"] + table#file_list.table_grid + thead + tr.title_bar + th#header_file_list_name.name [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;sort=name;desc" rel="nofollow"] + "Attachment name" + span.main_icons.sort_up + th#header_file_list_filesize.filesize [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;sort=filesize" rel="nofollow"] + "File size" + th#header_file_list_member.member [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;sort=member" rel="nofollow"] + "Posted by" + th#header_file_list_date.date [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;sort=date" rel="nofollow"] + "Date" + th#header_file_list_downloads.downloads [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;sort=downloads" rel="nofollow"] + "Downloads" + th#header_file_list_check.centercol.check [scope="col"] + input [onclick="invertAll(this, this.form);" type="checkbox"] + tbody + tr.windowbg + td.centertext [colspan="#"] + "There are currently no attachments." + div.flow_auto + div.additional_row + input.button.you_sure [data-confirm="Are you sure you want to delete the selected attachments?" name="remove_submit" type="submit" value="Remove selected"] + input [name="type" type="hidden" value="attachments"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="sort" type="hidden" value="name"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/attachments_browse_avatars.txt b/tests/Integration/Http/Snapshot/snapshots/admin/attachments_browse_avatars.txt new file mode 100644 index 00000000000..4915e679ad6 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/attachments_browse_avatars.txt @@ -0,0 +1,128 @@ +status 200 +@ title +title + "Attachments and Avatars" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Attachments and Avatars" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Browse Files" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=manage_files" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Attachments and Avatars" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "From here you can administer the attached files on your system. You can delete attachments by size and by date from your system. Statistics on attachments are also displayed below." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Attachments and Avatars Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Attachments and Avatars Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a.active [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;{session_var}={session_id}"] + "Browse Files" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachments;{session_var}={session_id}"] + "Attachment Settings" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=avatars;{session_var}={session_id}"] + "Avatar Settings" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachpaths;{session_var}={session_id}"] + "Attachment Directories" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=maintenance;{session_var}={session_id}"] + "File Maintenance" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=manageattachments;sa=remove;avatars" method="post"] + div.cat_bar + h3.catbg + "Browse files:" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse"] + "Attachments" + "|" + img [alt=">" src="{boardurl}/Themes/default/images/selected.png"] + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;avatars"] + "Avatars" + "|" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;thumbs"] + "Thumbnails" + div.additional_row + input.button.you_sure [data-confirm="Are you sure you want to delete the selected attachments?" name="remove_submit" type="submit" value="Remove selected"] + table#file_list.table_grid + thead + tr.title_bar + th#header_file_list_name.name [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;avatars;sort=name;desc" rel="nofollow"] + "Attachment name" + span.main_icons.sort_up + th#header_file_list_filesize.filesize [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;avatars;sort=filesize" rel="nofollow"] + "File size" + th#header_file_list_member.member [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;avatars;sort=member" rel="nofollow"] + "Member" + th#header_file_list_date.date [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;avatars;sort=date" rel="nofollow"] + "Last active" + th#header_file_list_downloads.downloads [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;avatars;sort=downloads" rel="nofollow"] + "Downloads" + th#header_file_list_check.centercol.check [scope="col"] + input [onclick="invertAll(this, this.form);" type="checkbox"] + tbody + tr.windowbg + td.centertext [colspan="#"] + "There are currently no avatars." + div.flow_auto + div.additional_row + input.button.you_sure [data-confirm="Are you sure you want to delete the selected attachments?" name="remove_submit" type="submit" value="Remove selected"] + input [name="type" type="hidden" value="avatars"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="sort" type="hidden" value="name"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/attachments_browse_thumbs.txt b/tests/Integration/Http/Snapshot/snapshots/admin/attachments_browse_thumbs.txt new file mode 100644 index 00000000000..b030e591590 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/attachments_browse_thumbs.txt @@ -0,0 +1,128 @@ +status 200 +@ title +title + "Attachments and Avatars" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Attachments and Avatars" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Browse Files" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=manage_files" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Attachments and Avatars" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "From here you can administer the attached files on your system. You can delete attachments by size and by date from your system. Statistics on attachments are also displayed below." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Attachments and Avatars Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Attachments and Avatars Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a.active [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;{session_var}={session_id}"] + "Browse Files" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachments;{session_var}={session_id}"] + "Attachment Settings" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=avatars;{session_var}={session_id}"] + "Avatar Settings" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachpaths;{session_var}={session_id}"] + "Attachment Directories" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=maintenance;{session_var}={session_id}"] + "File Maintenance" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=manageattachments;sa=remove;thumbs" method="post"] + div.cat_bar + h3.catbg + "Browse files:" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse"] + "Attachments" + "|" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;avatars"] + "Avatars" + "|" + img [alt=">" src="{boardurl}/Themes/default/images/selected.png"] + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;thumbs"] + "Thumbnails" + div.additional_row + input.button.you_sure [data-confirm="Are you sure you want to delete the selected attachments?" name="remove_submit" type="submit" value="Remove selected"] + table#file_list.table_grid + thead + tr.title_bar + th#header_file_list_name.name [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;thumbs;sort=name;desc" rel="nofollow"] + "Attachment name" + span.main_icons.sort_up + th#header_file_list_filesize.filesize [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;thumbs;sort=filesize" rel="nofollow"] + "File size" + th#header_file_list_member.member [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;thumbs;sort=member" rel="nofollow"] + "Posted by" + th#header_file_list_date.date [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;thumbs;sort=date" rel="nofollow"] + "Date" + th#header_file_list_downloads.downloads [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;thumbs;sort=downloads" rel="nofollow"] + "Downloads" + th#header_file_list_check.centercol.check [scope="col"] + input [onclick="invertAll(this, this.form);" type="checkbox"] + tbody + tr.windowbg + td.centertext [colspan="#"] + "There are currently no thumbnails." + div.flow_auto + div.additional_row + input.button.you_sure [data-confirm="Are you sure you want to delete the selected attachments?" name="remove_submit" type="submit" value="Remove selected"] + input [name="type" type="hidden" value="thumbs"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="sort" type="hidden" value="name"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/attachments_maintenance.txt b/tests/Integration/Http/Snapshot/snapshots/admin/attachments_maintenance.txt new file mode 100644 index 00000000000..b76a3fa41a3 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/attachments_maintenance.txt @@ -0,0 +1,225 @@ +status 200 +@ title +title + "Attachments and Avatars" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Attachments and Avatars" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=maintenance;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "File Maintenance" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=manage_files" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Attachments and Avatars" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "From here you can administer the attached files on your system. You can delete attachments by size and by date from your system. Statistics on attachments are also displayed below." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Attachments and Avatars Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Attachments and Avatars Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;{session_var}={session_id}"] + "Browse Files" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachments;{session_var}={session_id}"] + "Attachment Settings" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=avatars;{session_var}={session_id}"] + "Avatar Settings" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachpaths;{session_var}={session_id}"] + "Attachment Directories" + li + a.active [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=maintenance;{session_var}={session_id}"] + "File Maintenance" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + div#manage_attachments + div.cat_bar + h3.catbg + "File attachment statistics" + div.windowbg + dl.settings + dt + strong + "Total attachments" + dd + "#" + dt + strong + "Total avatars" + dd + "#" + dt + strong + "Total size of all attachment directories" + dd + "# KB(s)" + dt + strong + "Current attachment directory" + dd.word_break + "{boarddir}/attachments" + dt + strong + "Total size of current attachment directory" + dd + "# KB(s)" + dt + strong + "Total space available" + dd + "# KB(s)" + dt + strong + "Total files in current attachment directory" + dd + "#" + dt + strong + "Total files remaining" + dd + "#,#" + div.cat_bar + h3.catbg + "Attachment integrity check" + div.windowbg + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=manageattachments;sa=repair;{session_var}={session_id}" method="post"] + p + "This function will check the integrity and sizes of attachments and filenames listed in the database and, if necessary, fix errors it encounters." + input.button [name="repair" type="submit" value="Run check now"] + div.cat_bar + h3.catbg + "Attachment Pruning" + div.windowbg + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=manageattachments" method="post" onsubmit="return confirm('Are you sure you want to delete these attachments?\\nThis cannot be undone!');"] + dl.settings + dt + "Remove attachments older than" + dd + input [name="age" size="#" type="number" value="#"] + "days" + dt + "Message to add to post" + dd + input [name="notice" size="#" type="text" value="[attachment deleted by admin]"] + input.button [name="remove" type="submit" value="Remove"] + input [name="type" type="hidden" value="attachments"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="sa" type="hidden" value="byage"] + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=manageattachments" method="post" onsubmit="return confirm('Are you sure you want to delete these attachments?\\nThis cannot be undone!');"] + dl.settings + dt + "Remove attachments larger than" + dd + input#size [name="size" size="#" type="number" value="#"] + "KB" + dt + "Message to add to post" + dd + input [name="notice" size="#" type="text" value="[attachment deleted by admin]"] + input.button [name="remove" type="submit" value="Remove"] + input [name="type" type="hidden" value="attachments"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="sa" type="hidden" value="bysize"] + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=manageattachments" method="post" onsubmit="return confirm('Are you sure you want to delete these attachments?\\nThis cannot be undone!');"] + dl.settings + dt + "Remove avatars from members not active for more than" + dd + input [name="age" size="#" type="number" value="#"] + "days" + input.button [name="remove" type="submit" value="Remove"] + input [name="type" type="hidden" value="avatars"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="sa" type="hidden" value="byage"] + div#transfer.cat_bar + h3.catbg + "Transfer Attachments" + div.windowbg + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=manageattachments;sa=transfer" method="post"] + p + "Transfer files between directories." + dl.settings + dt + "Transfer files from" + dd + select [name="from"] + option [value="#"] + "Select directory" + option [value="#"] + "{boarddir}/attachments" + dt + "Automatically by space or file count" + dd + select [name="auto"] + option [value="#"] + "Select base directory" + option [value="-#"] + "Forum root directory." + option [disabled value="#"] + "No base directories available." + dt + "Or to a specific directory." + dd + select [name="to"] + option [value="#"] + "Select directory" + option [value="#"] + "{boarddir}/attachments" + dt + "Empty the source directory" + dd + input [checked name="empty_it" type="checkbox"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input.button [name="transfer" onclick="start_progress()" type="submit" value="Transfer"] + div#progress_msg + div#show_progress.padding + script + | function start_progress() { setTimeout(show_msg, #); } function show_msg() { $('#progress_msg').html('
Loading... Please wait. Transfer in progress.<\/div>'); show_progress(); } function show_progress() { $('#show_progress').on("load", "progress.php"); setTimeout(show_progress, #); } diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/attachments_paths.txt b/tests/Integration/Http/Snapshot/snapshots/admin/attachments_paths.txt new file mode 100644 index 00000000000..fc7900ea0d3 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/attachments_paths.txt @@ -0,0 +1,126 @@ +status 200 +@ title +title + "Manage attachment paths" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Attachments and Avatars" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachpaths;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Attachment Directories" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=manage_files" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Attachments and Avatars" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "From here you can administer the attached files on your system. You can delete attachments by size and by date from your system. Statistics on attachments are also displayed below." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Attachments and Avatars Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Attachments and Avatars Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=browse;{session_var}={session_id}"] + "Browse Files" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachments;{session_var}={session_id}"] + "Attachment Settings" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=avatars;{session_var}={session_id}"] + "Avatar Settings" + li + a.active [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachpaths;{session_var}={session_id}"] + "Attachment Directories" + li + a [href="{boardurl}/index.php?action=admin;area=manageattachments;sa=maintenance;{session_var}={session_id}"] + "File Maintenance" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=manageattachments;sa=attachpaths;{session_var}={session_id}" method="post"] + div.cat_bar + h3.catbg + "Attachment directory paths" + div.additional_row.information + "Create new directories or change the current directory below." + br + "To create a new directory within the forum directory structure, use just the directory name." + br + "To remove a directory, blank the path input field. Only empty directories can be removed. To see if a directory is empty, check for files or sub-directories in brackets next to the file count." + br + "To rename a directory, simply change its name in the input field. Only directories without sub-directories may be renamed." + table#attach_paths.table_grid + thead + tr.title_bar + th#header_attach_paths_current_dir.centercol.current_dir [scope="col"] + "Current" + th#header_attach_paths_path.path [scope="col"] + "Path" + th#header_attach_paths_current_size.current_size [scope="col"] + "Size (KB)" + th#header_attach_paths_num_files.num_files [scope="col"] + "Files" + th#header_attach_paths_status.centercol.status [scope="col"] + "Status" + tbody + tr#list_attach_paths_#.windowbg + td.centercol.current_dir [style="width: #%;"] + input [checked name="current_dir" type="radio" value="#"] + td.path [style="width: #%;"] + input [name="dirs[#]" type="hidden" value="{boarddir}/attachments"] + input [name="dirs[#]" size="#" style="width: #%" type="text" value="{boarddir}/attachments"] + td.current_size [style="width: #%;"] + "#" + td.num_files [style="width: #%;"] + "#" + td.centercol.status [style="width: #%;"] + "Unused" + div.flow_auto + div.additional_row + input [name="{session_var}" type="hidden" value="{session_id}"] + input.button [name="save" type="submit" value="Save"] + input.button [name="new_path" type="submit" value="Add Path"] + input [name="{session_var}" type="hidden" value="{session_id}"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/bans.txt b/tests/Integration/Http/Snapshot/snapshots/admin/bans.txt new file mode 100644 index 00000000000..30501c37712 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/bans.txt @@ -0,0 +1,76 @@ +status 200 +@ title +title + "Ban list" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=ban;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Ban list" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=ban;sa=list;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Ban list" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=ban;sa=list" method="post"] + div.cat_bar + h3.catbg + "Ban list" + div.additional_row + input.button [name="removeBans" type="submit" value="Remove selected"] + table#ban_list.table_grid + thead + tr.title_bar + th#header_ban_list_name.name [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=ban;sa=list;sort=name" rel="nofollow"] + "Ban name" + th#header_ban_list_notes.notes [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=ban;sa=list;sort=notes" rel="nofollow"] + "Notes" + th#header_ban_list_reason.reason [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=ban;sa=list;sort=reason" rel="nofollow"] + "Reason" + th#header_ban_list_added.added [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=ban;sa=list;sort=added" rel="nofollow"] + "Added" + span.main_icons.sort_down + th#header_ban_list_expires.expires [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=ban;sa=list;sort=expires" rel="nofollow"] + "Expires" + th#header_ban_list_num_triggers.num_triggers [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=ban;sa=list;sort=num_triggers" rel="nofollow"] + "Triggers" + th#header_ban_list_actions.actions.centercol [scope="col"] + "Actions" + th#header_ban_list_check.centercol.check [scope="col"] + input [onclick="invertAll(this, this.form);" type="checkbox"] + tbody + tr.windowbg + td.centertext [colspan="#"] + "There are currently no bans in effect." + div.additional_row + input.button [name="removeBans" type="submit" value="Remove selected"] + input [name="{session_var}" type="hidden" value="{session_id}"] + script + | var removeBans = $("input[name='removeBans']"); removeBans.on( "click", function(e) { var removeItems = $("input[name='remove[]']:checked").length; if (removeItems == #) { e.preventDefault(); return alert("Please select at least one item in the list"); } return confirm("Are you sure you want to remove the selected bans?"); }); diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/bans_add.txt b/tests/Integration/Http/Snapshot/snapshots/admin/bans_add.txt new file mode 100644 index 00000000000..08795087804 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/bans_add.txt @@ -0,0 +1,149 @@ +status 200 +@ title +title + "Ban list" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=ban;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Ban list" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=ban;sa=add;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Add new ban" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div#manage_bans + form#admin_form_wrapper [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=ban;sa=edit" method="post" onsubmit="return confirmBan(this);"] + div.cat_bar + h3.catbg + "Add new ban" + div.information.noup + strong + "Note" + ": after creating the above ban, you can add additional entries that trigger the ban, like IP addresses, hostnames, and email addresses." + div.noup.windowbg + dl.settings + dt#ban_name_label + strong + "Ban name:" + dd + input#ban_name [maxlength="#" name="ban_name" size="#" type="text" value] + dt + strong + label [for="reason"] + "Reason" + br + span.smalltext + "Reason for ban, to be displayed to banned member." + dd + textarea#reason [cols="#" name="reason" rows="#"] + dt + strong + label [for="ban_notes"] + "Notes" + br + span.smalltext + "Notes that may assist other staff members." + dd + textarea#ban_notes [cols="#" name="notes" rows="#"] + fieldset.ban_settings.floatleft + legend + "Expiration" + input#never_expires [checked name="expiration" onclick="fUpdateStatus();" type="radio" value="never"] + label [for="never_expires"] + "Never" + br + input#expires_one_day [name="expiration" onclick="fUpdateStatus();" type="radio" value="one_day"] + label [for="expires_one_day"] + "Ban will expire after" + input#expire_date [name="expire_date" size="#" type="number" value="#"] + "days" + br + input#already_expired [name="expiration" onclick="fUpdateStatus();" type="radio" value="expired"] + label [for="already_expired"] + "Expired / disabled" + fieldset.ban_settings.floatright + legend + "Restriction" + input#full_ban [checked name="full_ban" onclick="fUpdateStatus();" type="radio" value="#"] + label [for="full_ban"] + "Full ban" + br + input#partial_ban [name="full_ban" onclick="fUpdateStatus();" type="radio" value="#"] + label [for="partial_ban"] + "Partial ban" + br + input#cannot_post.ban_restriction [name="cannot_post" type="checkbox" value="#"] + label [for="cannot_post"] + "Cannot post" + "(" + a [href="{boardurl}/index.php?action=helpadmin;help=ban_cannot_post" onclick="return reqOverlayDiv(this.href);"] + "?" + ")" + br + input#cannot_register.ban_restriction [name="cannot_register" type="checkbox" value="#"] + label [for="cannot_register"] + "Cannot register" + br + input#cannot_login.ban_restriction [name="cannot_login" type="checkbox" value="#"] + label [for="cannot_login"] + "Cannot login" + br + br.clear_right + fieldset + legend + input [onclick="invertAll(this, this.form, 'ban_suggestion');" type="checkbox"] + "Triggers" + dl.settings + dt + input#main_ip_check [name="ban_suggestions[]" type="checkbox" value="main_ip"] + label [for="main_ip_check"] + "Ban on IP (e.g. #.#.#-#.*)" + dd + input [name="main_ip" onfocus="document.getElementById('main_ip_check').checked = true;" size="#" type="text" value] + dt + input#hostname_check [name="ban_suggestions[]" type="checkbox" value="hostname"] + label [for="hostname_check"] + "Ban on Hostname (e.g. *.mil)" + dd + input [name="hostname" onfocus="document.getElementById('hostname_check').checked = true;" size="#" type="text" value] + dt + input#email_check [name="ban_suggestions[]" type="checkbox" value="email"] + label [for="email_check"] + "Ban on Email Address (e.g. *@badsite.com)" + dd + input [name="email" onfocus="document.getElementById('email_check').checked = true;" size="#" type="text" value] + dt + input#user_check [name="ban_suggestions[]" type="checkbox" value="user"] + label [for="user_check"] + "Ban on Username" + dd + input#user [name="user" size="#" type="text" value] + input.button [name="add_ban" type="submit" value="Add"] + input [name="old_expire" type="hidden" value="#"] + input [name="bg" type="hidden" value="#"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] + script + | var fUpdateStatus = function () { document.getElementById("expire_date").disabled = !document.getElementById("expires_one_day").checked; document.getElementById("cannot_post").disabled = document.getElementById("full_ban").checked; document.getElementById("cannot_register").disabled = document.getElementById("full_ban").checked; document.getElementById("cannot_login").disabled = document.getElementById("full_ban").checked; } addLoadEvent(fUpdateStatus); var oAddMemberSuggest = new smc_AutoSuggest({ sSessionId: smf_session_id, sSessionVar: smf_session_var, sSuggestId: 'user', sControlId: 'user', sSearchType: 'member', sTextDeleteItem: 'Delete Item', }); function confirmBan(aForm) { if (aForm.ban_name.value == '') { alert('The name of the ban was left empty'); return false; } if (aForm.partial_ban.checked && !(aForm.cannot_post.checked || aForm.cannot_register.checked || aForm.cannot_login.checked)) { alert('No restriction selected.'); return false; } } diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/bans_browse.txt b/tests/Integration/Http/Snapshot/snapshots/admin/bans_browse.txt new file mode 100644 index 00000000000..c2fe44dc75b --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/bans_browse.txt @@ -0,0 +1,75 @@ +status 200 +@ title +title + "Ban list" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=ban;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Ban list" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=ban;sa=browse;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Browse Ban Triggers" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=ban;sa=browse;entity=ip" method="post"] + div.cat_bar + h3.catbg + "Browse Ban Triggers" + div.additional_row + a [href="{boardurl}/index.php?action=admin;area=ban;sa=browse;entity=ip"] + img [alt=">" src="{boardurl}/Themes/default/images/selected.png"] + "IP" + "|" + a [href="{boardurl}/index.php?action=admin;area=ban;sa=browse;entity=hostname"] + "Hostname" + "|" + a [href="{boardurl}/index.php?action=admin;area=ban;sa=browse;entity=email"] + "Email" + "|" + a [href="{boardurl}/index.php?action=admin;area=ban;sa=browse;entity=member"] + "Username" + table#ban_trigger_list.table_grid + thead + tr.title_bar + th#header_ban_trigger_list_banned_entity.banned_entity [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=ban;sa=browse;entity=ip;sort=banned_entity;desc" rel="nofollow"] + "Banned entity" + span.main_icons.sort_up + th#header_ban_trigger_list_ban_name.ban_name [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=ban;sa=browse;entity=ip;sort=ban_name" rel="nofollow"] + "Ban name" + th#header_ban_trigger_list_hits.hits [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=ban;sa=browse;entity=ip;sort=hits" rel="nofollow"] + "Hits" + th#header_ban_trigger_list_check.centercol.check [scope="col"] + input [onclick="invertAll(this, this.form);" type="checkbox"] + tbody + tr.windowbg + td.centertext [colspan="#"] + "There are currently no ban triggers." + div.additional_row + input.button.you_sure [data-confirm="Are you sure you want to remove the selected ban triggers?" name="remove_triggers" type="submit" value="Remove selected ban triggers"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="sort" type="hidden" value="banned_entity"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/bans_log.txt b/tests/Integration/Http/Snapshot/snapshots/admin/bans_log.txt new file mode 100644 index 00000000000..21df84c8be7 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/bans_log.txt @@ -0,0 +1,69 @@ +status 200 +@ title +title + "Ban Log" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=ban;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Ban list" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=ban;sa=log;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Ban Log" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=ban;sa=log" method="post"] + div.cat_bar + h3.catbg + "Ban Log" + div.flow_hidden.information + div.additional_row + input.button.you_sure [data-confirm="Are you sure you want to delete all selected ban log entries?" name="removeSelected" type="submit" value="Remove selected"] + input.button.you_sure [data-confirm="Are you sure you want to delete all ban log entries?" name="removeAll" type="submit" value="Clear log"] + table#ban_log.table_grid + thead + tr.title_bar + th#header_ban_log_ip.ip [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=ban;sa=log;sort=ip" rel="nofollow"] + "IP" + th#header_ban_log_email.email [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=ban;sa=log;sort=email" rel="nofollow"] + "Email address" + th#header_ban_log_member.member [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=ban;sa=log;sort=member" rel="nofollow"] + "Member" + th#header_ban_log_date.date [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=ban;sa=log;sort=date;desc" rel="nofollow"] + "Date" + span.main_icons.sort_up + th#header_ban_log_check.centercol.check [scope="col"] + input [onclick="invertAll(this, this.form);" type="checkbox"] + snapshot-ignored [selector="table.table_grid tbody"] + div.additional_row + input.button.you_sure [data-confirm="Are you sure you want to delete all selected ban log entries?" name="removeSelected" type="submit" value="Remove selected"] + input.button.you_sure [data-confirm="Are you sure you want to delete all ban log entries?" name="removeAll" type="submit" value="Clear log"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] + input [name="sort" type="hidden" value="date"] + input [name="{token_var}" type="hidden" value="{hash}"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/board_index.txt b/tests/Integration/Http/Snapshot/snapshots/admin/board_index.txt new file mode 100644 index 00000000000..399ca04edf3 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/board_index.txt @@ -0,0 +1,95 @@ +status 200 +@ title +title + "{forum_name} - Index" +@ #category_2 +div#category_#.cat_bar + h3.catbg + a#c# + a [href="{boardurl}/index.php?action=unread;c=#" title="Click to see the new posts in Snapshot fixtures"] + "Snapshot fixtures" + span#category_#_upshrink.toggle_up [data-collapsed="#" style="display: none;" title="Hide Category"] + div.desc + "Content for the template snapshot tests." +@ #category_2_boards +div#category_#_boards + div#board_#.up_contain + div.board_icon + a.board_off [href="{boardurl}/index.php?action=unread;board=#.#;children" title="No New Posts"] + div.info + a#b#.mobile_subject.subject [href="{boardurl}/index.php?board=#.#"] + "{board}" + div.board_description + "Topics, replies and a poll for the snapshot tests." + div.board_stats + p + "# post(s)" + br + "# topic(s)" + div.lastpost + p + strong + "Last post:" + "{date}" + span.postby + a [href="{boardurl}/index.php?topic=#.msg##new" title="{subject}"] + "{subject}" + "by" + a [href="{boardurl}/index.php?action=profile;u=#" title="View the profile of {member}"] + "{member}" + div#board_#_children.children + p + strong#child_list_# + "Sub-Boards" + span + a [href="{boardurl}/index.php?board=#.#" title="No New Posts (# topic(s), # post(s))"] + "{board}" + div#board_#.up_contain + div.board_icon + a.board_off [href="{boardurl}/index.php?action=unread;board=#.#;children" title="No New Posts"] + div.info + a#b#.mobile_subject.subject [href="{boardurl}/index.php?board=#.#"] + "{board}" + div.board_description + "A board with nothing in it." + div.board_stats + p + "# post(s)" + br + "# topic(s)" + div.lastpost +@ #info_center +div#info_center.roundframe + div.title_bar + h3.titlebg + a#upshrink_link [href="#"] + "{forum_name} - Info Center" + span#upshrink_ic.toggle_up [style="display: none;" title="Hide Info Center"] + div#upshrink_stats + div.sub_bar + h4.subbg + a [href="{boardurl}/index.php?action=stats" title="[More Stats]"] + span.main_icons.stats + "Forum Stats" + p.inline + "# post(s) in # topic(s) by # member(s) - Latest Member:" + strong + a [href="{boardurl}/index.php?action=profile;u=#"] + "{member}" + br + "Latest Post:" + strong + "\"" + a [href="{boardurl}/index.php?topic=#.msg#;boardseen#new" title="{subject}"] + "{subject}" + "\"" + "({date})" + br + a [href="{boardurl}/index.php?action=recent"] + "View the most recent posts on the forum." + div.sub_bar + h4.subbg + a [href="{boardurl}/index.php?action=who"] + span.main_icons.people + "Users Online" + snapshot-ignored [selector="#upshrink_stats > p:nth-of-type(#)"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/chrome.txt b/tests/Integration/Http/Snapshot/snapshots/admin/chrome.txt new file mode 100644 index 00000000000..b307a18db70 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/chrome.txt @@ -0,0 +1,185 @@ +status 200 +@ head +head + meta [charset="UTF-#"] + link [href="{boardurl}/Themes/default/css/minified_ab#f#f#a#d#a#da#fd#dbf#.css?smf#alpha#dev_#" rel="stylesheet"] + link [href="https://use.fontawesome.com/releases/v#.#.#/css/all.css" rel="stylesheet"] + style + | img.avatar { max-width: #px !important; max-height: #px !important; } + noscript + link [href="{boardurl}/Themes/default/css/minified_#c#ea#f#a#cbce#fa#a#e#.css?smf#alpha#dev_#" rel="stylesheet"] + script + | var smf_theme_url = "{boardurl}/Themes/default"; var smf_default_theme_url = "{boardurl}/Themes/default"; var smf_images_url = "{boardurl}/Themes/default/images"; var smf_smileys_url = "{boardurl}/Smileys"; var smf_smiley_sets = "fugue,alienine"; var smf_smiley_sets_default = "fugue"; var smf_avatars_url = "{boardurl}/avatars"; var smf_scripturl = "{boardurl}/index.php"; var smf_charset = "UTF-#"; var smf_session_id = "{session_id}"; var smf_session_var = "{session_var}"; var smf_member_id = #; var ajax_notification_text = 'Loading...'; var help_popup_heading_text = 'A little lost? Let me explain:'; var banned_text = 'Sorry admin, you are banned from using this forum!'; var smf_txt_expand = 'Expand'; var smf_txt_shrink = 'Shrink'; var smf_collapseAlt = 'Hide Category'; var smf_expandAlt = 'Show Category'; var smf_quote_expand = false; var allow_xhjr_credentials = false; + script [src="https://ajax.googleapis.com/ajax/libs/jquery/#.#.#/jquery.min.js"] + script [src="{boardurl}/Themes/default/scripts/minified_#b#eded#c#d#c#b#d#c#.js?smf#alpha#dev_#"] + script + | var new_alert_title = "{forum_name}"; var alert_timeout = #; var smf_you_sure ='Are you sure you want to do this?'; + title + "{forum_name} - Index" + meta [content="width=device-width, initial-scale=#" name="viewport"] + meta [content="{forum_name}" property="og:site_name"] + meta [content="{forum_name} - Index" property="og:title"] + meta [content="{boardurl}/index.php" property="og:url"] + meta [content="{forum_name} - Index" property="og:description"] + meta [content="{forum_name} - Index" name="description"] + meta [content="##EA#" name="theme-color"] + link [href="{boardurl}/index.php" rel="canonical"] + link [href="{boardurl}/index.php?action=help" rel="help"] + link [href="{boardurl}/index.php" rel="contents"] + link [href="{boardurl}/index.php?action=search" rel="search"] + link [href="{boardurl}/index.php?action=feed;type=rss#" rel="alternate" title="{forum_name} - RSS" type="application/rss+xml"] + link [href="{boardurl}/index.php?action=feed;type=atom" rel="alternate" title="{forum_name} - Atom" type="application/atom+xml"] +@ body +body#smf.action_home + div#footerfix + div#top_section + div.content_wrapper.inner_wrap + ul#top_info.floatleft + li + a#profile_menu_top [href="{boardurl}/index.php?action=profile"] + img.avatar [alt src="{boardurl}/avatars/default.png"] + span.textmenu + "{member}" + div#profile_menu.top_menu + li + a#pm_menu_top [href="{boardurl}/index.php?action=pm"] + span.inbox.main_icons + span.textmenu + "My Messages" + div#pm_menu.scrollable.top_menu + li + a#alerts_menu_top [href="{boardurl}/index.php?action=profile;area=showalerts;u=#"] + span.alerts.main_icons + span.textmenu + "Alerts" + div#alerts_menu.scrollable.top_menu + li#nojs_logout + a [href="{boardurl}/index.php?action=logout;{session_var}={session_id}"] + "Log out" + script + | document.getElementById("nojs_logout").style.display = "none"; + form#search_form.floatright [accept-charset="UTF-#" action="{boardurl}/index.php?action=search#" method="post"] + input [name="search" type="search" value] + select [name="search_selection"] + option [selected value="all"] + "Entire forum" + option [value="members"] + "Members" + input.button [name="search#" type="submit" value="Search"] + input [name="advanced" type="hidden" value="#"] + header#header.content_wrapper + h1.forumtitle + a#top [href="{boardurl}/index.php"] + "{forum_name}" + img#smflogo [alt="Simple Machines Forum" src="{boardurl}/Themes/default/images/smflogo.svg" title="Simple Machines Forum"] + nav#main_menu [aria-label="Main Menu"] + div.content_wrapper + a.mobile_user_menu + span.menu_icon + span.text_menu + "Main Menu" + div#mobile_user_menu.popup_container + div.description.popup_window + div.popup_heading + "Main Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + ul.dropmenu.menu_nav + li.button_home + a.active [href="{boardurl}/index.php"] + span.home.main_icons + span.textmenu + "Home" + li.button_search + a [href="{boardurl}/index.php?action=search"] + span.main_icons.search + span.textmenu + "Search" + li.button_admin.subsections + a [href="{boardurl}/index.php?action=admin"] + span.admin.main_icons + span.textmenu + "Admin" + ul + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings"] + "Features and Options" + li + a [href="{boardurl}/index.php?action=admin;area=packages"] + "Package Manager" + li + a [href="{boardurl}/index.php?action=admin;area=logs;sa=errorlog;desc"] + "Error Log" + li + a [href="{boardurl}/index.php?action=admin;area=permissions"] + "Permissions" + li.button_moderate.subsections + a [href="{boardurl}/index.php?action=moderate"] + span.main_icons.moderate + span.textmenu + "Moderate" + ul + li + a [href="{boardurl}/index.php?action=moderate;area=modlog"] + "Moderation Log" + li + a [href="{boardurl}/index.php?action=moderate;area=reportedposts"] + "Reported Posts" + li + a [href="{boardurl}/index.php?action=moderate;area=reportedmembers"] + "Reported Members" + li.button_mlist.subsections + a [href="{boardurl}/index.php?action=mlist"] + span.main_icons.mlist + span.textmenu + "Members" + ul + li + a [href="{boardurl}/index.php?action=mlist"] + "View the memberlist" + li + a [href="{boardurl}/index.php?action=mlist;sa=search"] + "Search for Members" + div#wrapper.content_wrapper + div#inner_wrap + div.user + time [datetime="{date}"] + "{date}" + ul.unread_links + li + a [href="{boardurl}/index.php?action=unread" title="Show unread posts since last visit."] + "Unread Posts" + li + a [href="{boardurl}/index.php?action=unreadreplies" title="Show new replies to your posts."] + "Updated Topics" + div.news + h2 + "News:" + p + "SMF - Just Installed!" + nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + div#content_section + snapshot-ignored [selector="#main_content_section"] + footer#footer + div.content_wrapper + ul + li.copyright + a [href="{boardurl}/index.php?action=credits" rel="noopener" target="_blank" title="License"] + "SMF #.# Alpha(s) #-dev © #" + "," + a [href="https://www.simplemachines.org" rel="noopener" target="_blank" title="Simple Machines"] + "Simple Machines" + li.helplinks + a [href="{boardurl}/index.php?action=help"] + "Help" + a [href="{boardurl}/index.php?action=agreement"] + "Terms and Rules" + a [href="#top_section"] + "Go Up ▲" + script + | window.addEventListener("DOMContentLoaded", function() { function triggerCron() { $.get('{boardurl}' + "/cron.php?ts=#"); } window.setTimeout(triggerCron, #); var user_menus = new smc_PopupMenu(); user_menus.add("profile", "{boardurl}/index.php?action=profile;area=popup"); user_menus.add("alerts", "{boardurl}/index.php?action=profile;area=alerts_popup;u=#"); user_menus.add("pm", "{boardurl}/index.php?action=pm;sa=popup"); }); diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/display.txt b/tests/Integration/Http/Snapshot/snapshots/admin/display.txt new file mode 100644 index 00000000000..5edbfcf3643 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/display.txt @@ -0,0 +1,733 @@ +status 200 +@ title +title + "{subject}" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php#c#" itemprop="item"] + span [itemprop="name"] + "Snapshot fixtures" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?board=#.#" itemprop="item"] + span [itemprop="name"] + "{board}" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?topic=#.#" itemprop="item"] + span [itemprop="name"] + "{subject}" + meta [content="#" itemprop="position"] +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php#c#" itemprop="item"] + span [itemprop="name"] + "Snapshot fixtures" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?board=#.#" itemprop="item"] + span [itemprop="name"] + "{board}" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?topic=#.#" itemprop="item"] + span [itemprop="name"] + "{subject}" + meta [content="#" itemprop="position"] +@ #content_section +div#content_section + main#main_content_section + div#display_head.information + h2.display_title + span#top_subject + "{subject}" + p + "Started by {member}, {date}" + span.floatright.nextlinks + a [href="{boardurl}/index.php?topic=#.#;prev_next=prev#new"] + "Previous topic" + "-" + a [href="{boardurl}/index.php?topic=#.#;prev_next=next#new"] + "Next topic" + div.pagesection.top + div.buttonlist.floatright + a.active.button.button_strip_reply [href="{boardurl}/index.php?action=post;topic=#.#;last_msg=#"] + "Reply" + a.button.button_strip_add_poll [href="{boardurl}/index.php?action=editpoll;add;topic=#.#"] + "Add poll" + a.button.button_strip_mark_unread [href="{boardurl}/index.php?action=markasread;sa=topic;t=#;topic=#.#;{session_var}={session_id}"] + "Mark unread" + a.button.button_strip_print [href="{boardurl}/index.php?action=printpage;topic=#.#" rel="nofollow"] + "Print" + a.button.button_strip_notify + "No Alerts or Emails" + div.dropmenu.notify_dropdown.top_menu + div.viewport + div.overview + a [href="{boardurl}/index.php?action=notifytopic;topic=#;mode=#;{session_var}={session_id}"] + strong + "Not Following" + br + span + "You will not receive any emails or alerts for this topic and it will also not show up in your unread replies and topics list. You will still receive @mentions for this topic." + a [href="{boardurl}/index.php?action=notifytopic;topic=#;mode=#;{session_var}={session_id}"] + strong + "No Alerts or Emails" + br + span + "You will not receive any emails or alerts but only @mentions by other members." + a [href="{boardurl}/index.php?action=notifytopic;topic=#;mode=#;{session_var}={session_id}"] + strong + "Receive Alerts" + br + span + "You will receive alerts for this topic." + a [href="{boardurl}/index.php?action=notifytopic;topic=#;mode=#;{session_var}={session_id}"] + strong + "Receive Emails and Alerts" + br + span + "You will receive both alerts and e-mails for this topic." + div.floatleft.pagelinks + a.button [href="#bot"] + "Go Down" + span.pages + "Pages" + span.current_page + "#" + div.floatright.mobile_buttons + a.button.mobile_act + "User actions" + a.button.mobile_mod + "Moderation" + div#forumposts + form#quickModForm [accept-charset="UTF-#" action="{boardurl}/index.php?action=quickmod#;topic=#.#" method="post" name="quickModForm"] + div#msg#.windowbg + div.post_wrapper + div.poster + h4 + a [href="{boardurl}/index.php?action=profile;u=#" title="View the profile of {member}"] + "{member}" + ul.user_info + li.avatar + a [href="{boardurl}/index.php?action=profile;u=#"] + img.avatar [alt src="{boardurl}/avatars/default.png"] + li.icons + img [alt="*" src="{boardurl}/Themes/default/images/membericons/icon.png"] + li.postgroup + "{text}" + li.postcount + "Posts: #" + li.blurb + "Personal text for {member}" + li.profile + ol.profile_icons + li + a [href="https://www.example.com" rel="noopener" target="_blank" title="Example"] + span.centericon.main_icons.www [title="Example"] + li + a [href="{boardurl}/index.php?action=pm;sa=send;u=#" title="Personal Message (Offline)"] + span.centericon.im_off.main_icons [title="Personal Message (Offline)"] + li.email + a [href="mailto:snapshot_member@example.com" rel="nofollow"] + span.centericon.mail.main_icons [title="Email"] + li.poster_ip + a.show_on_hover [data-hover="#.#.#.#" href="{boardurl}/index.php?action=profile;area=tracking;sa=ip;u=#;searchip=#.#.#.#"] + span + "Show IP address" + a.help [href="{boardurl}/index.php?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);"] + "(?)" + div.postarea + div.keyinfo + div#subject_#.subject_hidden.subject_title + a [href="{boardurl}/index.php?msg=#" rel="nofollow"] + "{subject}" + div.postinfo + span.messageicon + img#msg_icon_# [alt src="{boardurl}/Themes/default/images/post/xx.png"] + a.smalltext [href="{boardurl}/index.php?msg=#" rel="nofollow" title="{subject}"] + "{date}" + span.spacer + span#modified_#.floatright.modified.smalltext + div#msg_#_quick_mod + div.post + div#msg_#.inner [data-msgid="#"] + "The first post, with" + strong + "bold" + "," + em + "italic" + "," + u + "underlined" + "and" + s + "struck" + "text." + br + a.bbc_link [href="https://www.simplemachines.org" rel="noopener" target="_blank"] + "A link" + "and" + a.bbc_email [href="mailto:someone@example.com"] + "someone@example.com" + "." + br + blockquote.bbc_standard_quote + cite + "Quote" + "An unattributed quote." + div.codeheader + "Code" + pre.bbc_code [data-expand-txt="Expand" data-select-txt="Select" data-shrink-txt="Shrink"] + code + "echo \"code\";" + ul.bbc_list + li + "One" + li + "Two" + span.bbc_color [style="color: red;"] + "Red" + span.bbc_size [style="font-size: #pt;"] + "Sized" + div.centertext + "Centred" + table.bbc_table + thead + tr + th + "A" + th + "B" + tbody + span.bbc_inline_spoiler [title="Show or hide spoiler content"] + button [tabindex="#" title="Show or hide spoiler content" type="button"] + span + "Hidden" + hr.bbc_hr + "Smileys:" + img.smiley [alt=":)" src="{boardurl}/Smileys/fugue/smiley.png" title="Smiley"] + img.smiley [alt=";)" src="{boardurl}/Smileys/fugue/wink.png" title="Wink"] + div.under_message + ul.quickbuttons.quickbuttons_post + li + a [href="{boardurl}/index.php?action=post;quote=#;topic=#.#;last_msg=#" onclick="return oQuickReply.quote(#);"] + span.main_icons.quote + "Quote" + li#quoteSelected_# [style="display:none"] + a [href="javascript:void(#)"] + span.main_icons.quote_selected + "Quote selected text" + li#modify_button_#.quick_edit + a [href="javascript:void(#);"] + span.main_icons.quick_edit_button + "Quick Edit" + li.post_options + a [href="javascript:void(#);"] + "More..." + ul + li + a [href="{boardurl}/index.php?action=post;msg=#;topic=#.#"] + span.main_icons.modify_button + "Modify" + li.you_sure + a [data-confirm="Are you sure you want to remove this topic?" href="{boardurl}/index.php?action=removetopic#;topic=#.#;{session_var}={session_id}"] + span.main_icons.remove_button + "Remove topic" + li + a [href="{boardurl}/index.php?action=splittopics;topic=#.#;at=#"] + span.main_icons.split_button + "Split Topic" + li + a [href="{boardurl}/index.php?action=reporttm;topic=#.#;msg=#"] + span.error.main_icons + "Report to moderator" + li + a [href="{boardurl}/index.php?action=profile;area=issuewarning;u=#;msg=#"] + span.main_icons.warn_button + "Issue Warning" + div.moderatorbar + div#msg_#_signature.signature + "A signature with" + strong + "bold" + "text." + hr.post_separator + div#msg#.windowbg + div.post_wrapper + div.poster + h4 + "Snapshot Guest" + ul.user_info + li.membergroup + "Guest" + li.email + a [href="mailto:guest@example.com" rel="nofollow"] + span.centericon.mail.main_icons [title="Email"] + li.poster_ip + a.show_on_hover [data-hover="#.#.#.#" href="{boardurl}/index.php?action=trackip;searchip=#.#.#.#"] + span + "Show IP address" + a.help [href="{boardurl}/index.php?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);"] + "(?)" + div.postarea + div.keyinfo + div#subject_#.subject_hidden.subject_title + a [href="{boardurl}/index.php?msg=#" rel="nofollow"] + "{subject}" + span.floatright.page_number + "##" + div.postinfo + span.messageicon + img#msg_icon_# [alt src="{boardurl}/Themes/default/images/post/xx.png"] + a.smalltext [href="{boardurl}/index.php?msg=#" rel="nofollow" title="Reply ## - {subject}"] + "{date}" + span.spacer + span#modified_#.floatright.modified.smalltext + div#msg_#_quick_mod + div.post + div#msg_#.inner [data-msgid="#"] + "A reply from a guest." + div.under_message + ul.quickbuttons.quickbuttons_post + li + a [href="{boardurl}/index.php?action=post;quote=#;topic=#.#;last_msg=#" onclick="return oQuickReply.quote(#);"] + span.main_icons.quote + "Quote" + li#quoteSelected_# [style="display:none"] + a [href="javascript:void(#)"] + span.main_icons.quote_selected + "Quote selected text" + li#modify_button_#.quick_edit + a [href="javascript:void(#);"] + span.main_icons.quick_edit_button + "Quick Edit" + li.post_options + a [href="javascript:void(#);"] + "More..." + ul + li + a [href="{boardurl}/index.php?action=post;msg=#;topic=#.#"] + span.main_icons.modify_button + "Modify" + li.you_sure + a [data-confirm="Remove this post?" href="{boardurl}/index.php?action=deletemsg;topic=#.#;msg=#;{session_var}={session_id}"] + span.main_icons.remove_button + "Remove" + li + a [href="{boardurl}/index.php?action=splittopics;topic=#.#;at=#"] + span.main_icons.split_button + "Split Topic" + li + a [href="{boardurl}/index.php?action=reporttm;topic=#.#;msg=#"] + span.error.main_icons + "Report to moderator" + div.moderatorbar + hr.post_separator + div#msg#.windowbg + div.post_wrapper + div.poster + h4 + a [href="{boardurl}/index.php?action=profile;u=#" title="View the profile of {member}"] + "{member}" + ul.user_info + li.membergroup + "Administrator" + li.avatar + a [href="{boardurl}/index.php?action=profile;u=#"] + img.avatar [alt src="{boardurl}/avatars/default.png"] + li.icons + img [alt="*" src="{boardurl}/Themes/default/images/membericons/iconadmin.png"] + li.postgroup + "{text}" + li.postcount + "Posts: #" + li.profile + ol.profile_icons + li + a [href="{boardurl}/index.php?action=pm;sa=send;u=#" title="Personal Message (Online)"] + span.centericon.im_on.main_icons [title="Personal Message (Online)"] + li.email + a [href="mailto:admin@example.com" rel="nofollow"] + span.centericon.mail.main_icons [title="Email"] + li.poster_ip + a.show_on_hover [data-hover="#.#.#.#" href="{boardurl}/index.php?action=profile;area=tracking;sa=ip;u=#;searchip=#.#.#.#"] + span + "Show IP address" + a.help [href="{boardurl}/index.php?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);"] + "(?)" + div.postarea + div.keyinfo + div#subject_#.subject_hidden.subject_title + a [href="{boardurl}/index.php?msg=#" rel="nofollow"] + "{subject}" + span.floatright.page_number + "##" + div.postinfo + span.messageicon + img#msg_icon_# [alt src="{boardurl}/Themes/default/images/post/xx.png"] + a.smalltext [href="{boardurl}/index.php?msg=#" rel="nofollow" title="Reply ## - {subject}"] + "{date}" + span.spacer + span#modified_#.floatright.modified.smalltext + div#msg_#_quick_mod + div.post + div#msg_#.inner [data-msgid="#"] + blockquote.bbc_standard_quote + cite + "Quote from: {member}" + "The quoted text." + "A reply from the administrator." + div.under_message + ul.quickbuttons.quickbuttons_post + li + a [href="{boardurl}/index.php?action=post;quote=#;topic=#.#;last_msg=#" onclick="return oQuickReply.quote(#);"] + span.main_icons.quote + "Quote" + li#quoteSelected_# [style="display:none"] + a [href="javascript:void(#)"] + span.main_icons.quote_selected + "Quote selected text" + li#modify_button_#.quick_edit + a [href="javascript:void(#);"] + span.main_icons.quick_edit_button + "Quick Edit" + li.post_options + a [href="javascript:void(#);"] + "More..." + ul + li + a [href="{boardurl}/index.php?action=post;msg=#;topic=#.#"] + span.main_icons.modify_button + "Modify" + li.you_sure + a [data-confirm="Remove this post?" href="{boardurl}/index.php?action=deletemsg;topic=#.#;msg=#;{session_var}={session_id}"] + span.main_icons.remove_button + "Remove" + li + a [href="{boardurl}/index.php?action=splittopics;topic=#.#;at=#"] + span.main_icons.split_button + "Split Topic" + li + a [href="{boardurl}/index.php?action=reporttm;topic=#.#;msg=#"] + span.error.main_icons + "Report to moderator" + div.moderatorbar + hr.post_separator + div#msg#.windowbg + div.post_wrapper + div.poster + h4 + a [href="{boardurl}/index.php?action=profile;u=#" title="View the profile of {member}"] + "{member}" + ul.user_info + li.avatar + a [href="{boardurl}/index.php?action=profile;u=#"] + img.avatar [alt src="{boardurl}/avatars/default.png"] + li.icons + img [alt="*" src="{boardurl}/Themes/default/images/membericons/icon.png"] + li.postgroup + "{text}" + li.postcount + "Posts: #" + li.blurb + "Personal text for {member}" + li.profile + ol.profile_icons + li + a [href="https://www.example.com" rel="noopener" target="_blank" title="Example"] + span.centericon.main_icons.www [title="Example"] + li + a [href="{boardurl}/index.php?action=pm;sa=send;u=#" title="Personal Message (Offline)"] + span.centericon.im_off.main_icons [title="Personal Message (Offline)"] + li.email + a [href="mailto:snapshot_other@example.com" rel="nofollow"] + span.centericon.mail.main_icons [title="Email"] + li.poster_ip + a.show_on_hover [data-hover="#.#.#.#" href="{boardurl}/index.php?action=profile;area=tracking;sa=ip;u=#;searchip=#.#.#.#"] + span + "Show IP address" + a.help [href="{boardurl}/index.php?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);"] + "(?)" + div.postarea + div.keyinfo + div#subject_#.subject_hidden.subject_title + a [href="{boardurl}/index.php?msg=#" rel="nofollow"] + "{subject}" + span.floatright.page_number + "##" + div.postinfo + span.messageicon + img#msg_icon_# [alt src="{boardurl}/Themes/default/images/post/xx.png"] + a.smalltext [href="{boardurl}/index.php?msg=#" rel="nofollow" title="Reply ## - {subject}"] + "{date}" + span.spacer + span#modified_#.floatright.modified.smalltext + div#msg_#_quick_mod + div.post + div#msg_#.inner [data-msgid="#"] + "A reply from another member, with a smiley" + img.smiley [alt=":)" src="{boardurl}/Smileys/fugue/smiley.png" title="Smiley"] + div.under_message + ul.quickbuttons.quickbuttons_post + li + a [href="{boardurl}/index.php?action=post;quote=#;topic=#.#;last_msg=#" onclick="return oQuickReply.quote(#);"] + span.main_icons.quote + "Quote" + li#quoteSelected_# [style="display:none"] + a [href="javascript:void(#)"] + span.main_icons.quote_selected + "Quote selected text" + li#modify_button_#.quick_edit + a [href="javascript:void(#);"] + span.main_icons.quick_edit_button + "Quick Edit" + li.post_options + a [href="javascript:void(#);"] + "More..." + ul + li + a [href="{boardurl}/index.php?action=post;msg=#;topic=#.#"] + span.main_icons.modify_button + "Modify" + li.you_sure + a [data-confirm="Remove this post?" href="{boardurl}/index.php?action=deletemsg;topic=#.#;msg=#;{session_var}={session_id}"] + span.main_icons.remove_button + "Remove" + li + a [href="{boardurl}/index.php?action=splittopics;topic=#.#;at=#"] + span.main_icons.split_button + "Split Topic" + li + a [href="{boardurl}/index.php?action=reporttm;topic=#.#;msg=#"] + span.error.main_icons + "Report to moderator" + li + a [href="{boardurl}/index.php?action=profile;area=issuewarning;u=#;msg=#"] + span.main_icons.warn_button + "Issue Warning" + div.moderatorbar + div#msg_#_signature.signature + "A signature with" + strong + "bold" + "text." + hr.post_separator + div.pagesection + div.buttonlist.floatright + a.active.button.button_strip_reply [href="{boardurl}/index.php?action=post;topic=#.#;last_msg=#"] + "Reply" + a.button.button_strip_add_poll [href="{boardurl}/index.php?action=editpoll;add;topic=#.#"] + "Add poll" + a.button.button_strip_mark_unread [href="{boardurl}/index.php?action=markasread;sa=topic;t=#;topic=#.#;{session_var}={session_id}"] + "Mark unread" + a.button.button_strip_print [href="{boardurl}/index.php?action=printpage;topic=#.#" rel="nofollow"] + "Print" + a.button.button_strip_notify + "No Alerts or Emails" + div.dropmenu.notify_dropdown.top_menu + div.viewport + div.overview + a [href="{boardurl}/index.php?action=notifytopic;topic=#;mode=#;{session_var}={session_id}"] + strong + "Not Following" + br + span + "You will not receive any emails or alerts for this topic and it will also not show up in your unread replies and topics list. You will still receive @mentions for this topic." + a [href="{boardurl}/index.php?action=notifytopic;topic=#;mode=#;{session_var}={session_id}"] + strong + "No Alerts or Emails" + br + span + "You will not receive any emails or alerts but only @mentions by other members." + a [href="{boardurl}/index.php?action=notifytopic;topic=#;mode=#;{session_var}={session_id}"] + strong + "Receive Alerts" + br + span + "You will receive alerts for this topic." + a [href="{boardurl}/index.php?action=notifytopic;topic=#;mode=#;{session_var}={session_id}"] + strong + "Receive Emails and Alerts" + br + span + "You will receive both alerts and e-mails for this topic." + div.floatleft.pagelinks + a#bot.button [href="#main_content_section"] + "Go Up" + span.pages + "Pages" + span.current_page + "#" + div.floatright.mobile_buttons + a.button.mobile_act + "User actions" + a.button.mobile_mod + "Moderation" + nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php#c#" itemprop="item"] + span [itemprop="name"] + "Snapshot fixtures" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?board=#.#" itemprop="item"] + span [itemprop="name"] + "{board}" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?topic=#.#" itemprop="item"] + span [itemprop="name"] + "{subject}" + meta [content="#" itemprop="position"] + div#moderationbuttons + div#moderationbuttons_strip.buttonlist.floatbottom + a.button.button_strip_move [href="{boardurl}/index.php?action=movetopic;current_board=#;topic=#.#"] + "Move Topic" + a.button.button_strip_delete.you_sure [data-confirm="Are you sure you want to remove this topic?" href="{boardurl}/index.php?action=removetopic#;topic=#.#;{session_var}={session_id}"] + "Remove topic" + a.button.button_strip_lock [href="{boardurl}/index.php?action=lock;topic=#.#;sa=lock;{session_var}={session_id}"] + "Lock topic" + a.button.button_strip_sticky [href="{boardurl}/index.php?action=sticky;topic=#.#;sa=sticky;{session_var}={session_id}"] + "Set topic sticky" + a.button.button_strip_merge [href="{boardurl}/index.php?action=mergetopics;board=#.#;from=#"] + "Merge Topics" + div#display_jump_to + a#quickreply_anchor + div#quickreply.tborder + div.cat_bar + h3.catbg + "Quick Reply" + div#quickreply_options + div.roundframe + p.alert.smalltext + "Warning: this topic has not been posted in for at least {duration}." + br + "Unless you are sure you want to reply, please consider starting a new topic." + form#postmodify [accept-charset="UTF-#" action="{boardurl}/index.php?board=#;action=post#" method="post" name="postmodify" onsubmit="submitonce(this);"] + input [name="topic" type="hidden" value="#"] + input [name="subject" type="hidden" value="{subject}"] + input [name="icon" type="hidden" value="xx"] + input [name="from_qr" type="hidden" value="#"] + input [name="notify" type="hidden" value="#"] + input [name="not_approved" type="hidden" value] + input [name="goback" type="hidden" value="#"] + input [name="last_msg" type="hidden" value="#"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="seqnum" type="hidden" value="#"] + textarea#quickReply.editor [cols="#" name="quickReply" style="width: #%; height: #px;"] + input#quickReply_mode [name="quickReply_mode" type="hidden" value="#"] + script + | document.addEventListener("DOMContentLoaded", function () { var textarea = document.getElementById("quickReply"), options = { "width": "#%", "height": "#px", "style": "{boardurl}/Themes/default/css/jquery.sceditor.default.css?smf#alpha#dev_#", "emoticonsCompat": true, "emoticons": { "dropdown": { ":)": { "newRow": false, "url": "smiley.png", "tooltip": "Smiley" }, ";)": { "newRow": false, "url": "wink.png", "tooltip": "Wink" }, ":D": { "newRow": false, "url": "cheesy.png", "tooltip": "Cheesy" }, ";D": { "newRow": false, "url": "grin.png", "tooltip": "Grin" }, ">:(": { "newRow": false, "url": "angry.png", "tooltip": "Angry" }, ":(": { "newRow": false, "url": "sad.png", "tooltip": "Sad" }, ":o": { "newRow": false, "url": "shocked.png", "tooltip": "Shocked" }, "#)": { "newRow": false, "url": "cool.png", "tooltip": "Cool" }, "???": { "newRow": false, "url": "huh.png", "tooltip": "Huh?" }, "::)": { "newRow": false, "url": "rolleyes.png", "tooltip": "Roll Eyes" }, ":P": { "newRow": false, "url": "tongue.png", "tooltip": "Tongue" }, ":-[": { "newRow": false, "url": "embarrassed.png", "tooltip": "Embarrassed" }, ":-X": { "newRow": false, "url": "lipsrsealed.png", "tooltip": "Lips Sealed" }, ":-\\": { "newRow": false, "url": "undecided.png", "tooltip": "Undecided" }, ":-*": { "newRow": false, "url": "kiss.png", "tooltip": "Kiss" }, ":'(": { "newRow": false, "url": "cry.png", "tooltip": "Cry" } } }, "emoticonsEnabled": true, "emoticonsRoot": "{boardurl}/Smileys/fugue/", "colors": [ [ "black", "Black" ], [ "red", "Red" ], [ "yellow", "Yellow" ], [ "pink", "Pink" ], [ "green", "Green" ], [ "orange", "Orange" ], [ "purple", "Purple" ], [ "blue", "Blue" ], [ "beige", "Beige" ], [ "brown", "Brown" ], [ "teal", "Teal" ], [ "navy", "Navy" ], [ "maroon", "Maroon" ], [ "limegreen", "Lime Green" ], [ "white", "White" ] ], "fonts": "Arial,Arial Black,Comic Sans MS,Courier New,Georgia,Impact,Sans-serif,Serif,Times New Roman,Trebuchet MS,Verdana", "icons": "monocons", "format": "bbcode", "plugins": "smf,autolinker", "toolbar": "bold,italic,underline,strike,superscript,subscript,tt,spoiler|pre,left,center,right,justify|font,size,color|removeformat||floatleft,floatright|youtube,image,email,link,unlink|table,code,quote,details|heading,bulletlist,orderedlist,horizontalrule|maximize,source", "customTextualCommands": { "tt": { "image": "tt", "code": "tt", "description": "Inline code" }, "spoiler": { "image": "hidden", "code": "spoiler", "description": "Spoiler" }, "details": { "image": "details", "code": "details", "description": "Details" }, "heading": { "image": "heading", "code": "heading", "description": "Heading" } }, "startInSourceMode": true, "bbcodeTrim": false, "resizeWidth": false, "resizeMaxHeight": -#, "locale": "en", "rtl": false, "commandsWithDropdown": { "color": true, "heading": true, "font": true, "size": true }, "textOnlyCommands": [], "commandsWithText": [], "parserOptions": { "txtVars": { "code": "Code" } } }; sceditor.create(textarea, options, '#', '#'); }); + span#post_confirm_buttons + span.smalltext + "Shortcuts: ALT+S post, ALT+P preview, ALT+D save draft" + span.post_button_container + input.button [accesskey="d" name="save_draft" onclick="return confirm('This will save the text of your post, but it will not save attachments, poll or event information.');" type="submit" value="Save draft"] + input#id_draft [name="id_draft" type="hidden" value="#"] + input.button [accesskey="p" name="preview" type="submit" value="Preview"] + input.button [accesskey="s" name="post" onclick="return submitThisOnce(this);" type="submit" value="Post"] + br.clear + script + | window.addEventListener("DOMContentLoaded", function() { new QuickReply({ bDefaultCollapsed: false, iTopicId: #, iStart: #, sScriptUrl: smf_scripturl, sImagesUrl: smf_images_url, sContainerId: "quickreply_options", sImageId: "quickReplyExpand", sClassCollapsed: "toggle_up", sClassExpanded: "toggle_down", sJumpAnchor: "quickreply_anchor", bIsFull: true }); }); var oEditorID = "quickReply"; + div#mobile_action.popup_container + div.description.popup_window + div.popup_heading + "User actions" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.buttonlist + a.active.button.button_strip_reply [href="{boardurl}/index.php?action=post;topic=#.#;last_msg=#"] + "Reply" + a.button.button_strip_add_poll [href="{boardurl}/index.php?action=editpoll;add;topic=#.#"] + "Add poll" + a.button.button_strip_mark_unread [href="{boardurl}/index.php?action=markasread;sa=topic;t=#;topic=#.#;{session_var}={session_id}"] + "Mark unread" + a.button.button_strip_print [href="{boardurl}/index.php?action=printpage;topic=#.#" rel="nofollow"] + "Print" + a.button.button_strip_notify + "No Alerts or Emails" + div.dropmenu.notify_dropdown.top_menu + div.viewport + div.overview + a [href="{boardurl}/index.php?action=notifytopic;topic=#;mode=#;{session_var}={session_id}"] + strong + "Not Following" + br + span + "You will not receive any emails or alerts for this topic and it will also not show up in your unread replies and topics list. You will still receive @mentions for this topic." + a [href="{boardurl}/index.php?action=notifytopic;topic=#;mode=#;{session_var}={session_id}"] + strong + "No Alerts or Emails" + br + span + "You will not receive any emails or alerts but only @mentions by other members." + a [href="{boardurl}/index.php?action=notifytopic;topic=#;mode=#;{session_var}={session_id}"] + strong + "Receive Alerts" + br + span + "You will receive alerts for this topic." + a [href="{boardurl}/index.php?action=notifytopic;topic=#;mode=#;{session_var}={session_id}"] + strong + "Receive Emails and Alerts" + br + span + "You will receive both alerts and e-mails for this topic." + div#mobile_moderation.popup_container + div.description.popup_window + div.popup_heading + "Moderation" + a.hide_popup.main_icons [href="javascript:void(#);"] + div#moderationbuttons_mobile + div#moderationbuttons_strip_mobile.buttonlist.floatbottom + a.button.button_strip_move [href="{boardurl}/index.php?action=movetopic;current_board=#;topic=#.#"] + "Move Topic" + a.button.button_strip_delete.you_sure [data-confirm="Are you sure you want to remove this topic?" href="{boardurl}/index.php?action=removetopic#;topic=#.#;{session_var}={session_id}"] + "Remove topic" + a.button.button_strip_lock [href="{boardurl}/index.php?action=lock;topic=#.#;sa=lock;{session_var}={session_id}"] + "Lock topic" + a.button.button_strip_sticky [href="{boardurl}/index.php?action=sticky;topic=#.#;sa=sticky;{session_var}={session_id}"] + "Set topic sticky" + a.button.button_strip_merge [href="{boardurl}/index.php?action=mergetopics;board=#.#;from=#"] + "Merge Topics" + script + | window.addEventListener("DOMContentLoaded", function() { new QuickModify({ sScriptUrl: smf_scripturl, sFormName: 'quickModForm', sClassName: 'quick_edit', bShowModify: true, iTopicId: #, sSaveButtonText: 'Save', sCancelButtonText: 'Cancel', sEditReasonText: 'Reason for editing', sErrorBorderStyle: '#px solid red' }); new JumpTo({ sContainerId: "display_jump_to", sJumpToTemplate: "\"ICQ" + fieldset + legend + "Input Settings" + dl.settings + dt + strong + label [for="field_type"] + "Field Type" + dd + select#field_type [name="field_type" onchange="updateInputBoxes();"] + option [selected value="text"] + "Text" + option [value="textarea"] + "Large Text" + option [value="select"] + "Select Box" + option [value="radio"] + "Radio Button" + option [value="check"] + "Checkbox" + dt#max_length_dt + strong + label [for="max_length_dd"] + "Maximum Length" + br + span.smalltext + "(# for(s) no limit)" + dd + input#max_length_dd [maxlength="#" name="max_length" size="#" type="text" value="#"] + dt#dimension_dt + strong + label [for="dimension_dd"] + "Dimensions" + dd#dimension_dd + strong + "Rows" + input [maxlength="#" name="rows" size="#" type="text" value="#"] + strong + "Columns" + input [maxlength="#" name="cols" size="#" type="text" value="#"] + dt#bbc_dt + strong + label [for="bbc_dd"] + "Allow BBC" + dd + input#bbc_dd [name="bbc" type="checkbox"] + dt#options_dt + a.help [href="{boardurl}/index.php?action=helpadmin;help=customoptions" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + strong + label [for="options_dd"] + "Options" + br + span.smalltext + "Leave option box blank to remove. Radio button selects default option." + br + span + "You can use translatable tokens in this field." + dd#options_dd + input [checked name="default_select" type="radio" value="#"] + input [name="select_option[#]" type="text" value] + br + input [checked name="default_select" type="radio" value="#"] + input [name="select_option[#]" type="text" value] + span#addopt + "[" + a [href onclick="addOption(); return false;"] + "More" + "]" + dt#default_dt + strong + label [for="default_dd"] + "Default State" + dd + input#default_dd [name="default_check" type="checkbox"] + fieldset + legend + "Advanced Settings" + dl.settings + dt#mask_dt + a#custom_mask.help [href="{boardurl}/index.php?action=helpadmin;help=custom_mask" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + strong + label [for="mask"] + "Input Mask" + br + span.smalltext + "For text fields an input mask can be selected to validate the data." + dd + select#mask [name="mask" onchange="updateInputBoxes();"] + option [value="nohtml"] + "No HTML" + option [value="email"] + "Valid Email" + option [value="number"] + "Numeric" + option [selected value="regex"] + "Regex (Advanced)" + br + span#regex_div + input [name="regex" size="#" type="text" value="~[#-#][#-#]{#,#}~i"] + dt + strong + label [for="private"] + "Privacy" + br + span.smalltext + "Who can see and edit this field." + dd + select#private [name="private" onchange="updateInputBoxes();"] + option [selected value="#"] + "Users can see this field; owner can edit it" + option [value="#"] + "Users can see this field; only admins can edit it" + option [value="#"] + "Users cannot see this field; owner and admins can edit it." + option [value="#"] + "This field is only visible to admins" + dt#can_search_dt + strong + label [for="can_search_dd"] + "Searchable" + br + span.smalltext + "Can this field be searched from the members list." + dd + input#can_search_dd [name="can_search" type="checkbox"] + dt + strong + label [for="can_search_check"] + "Active" + br + span.smalltext + "If not selected this field will not be shown to anyone." + dd + input#can_search_check [checked name="active" type="checkbox"] + input.button [name="save" type="submit" value="Save"] + input.button.you_sure [data-confirm="Are you sure you wish to delete this field - all related user data will be lost!" name="delete" type="submit" value="Delete"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] + script + | updateInputBoxes(); diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/features_profile_field_new.txt b/tests/Integration/Http/Snapshot/snapshots/admin/features_profile_field_new.txt new file mode 100644 index 00000000000..d4c49181650 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/features_profile_field_new.txt @@ -0,0 +1,346 @@ +status 200 +@ title +title + "Add Profile field" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=featuresettings;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Features and Options" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=basic;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "General" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=featuresettings" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Features and Options" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "From this page you can create your own custom profile fields that fit in with your own forum’s requirements" + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Features and Options Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Features and Options Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=basic;{session_var}={session_id}"] + "General" + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=bbc;{session_var}={session_id}"] + "Bulletin Board Code & Markdown" + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=layout;{session_var}={session_id}"] + "Layout" + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=sig;{session_var}={session_id}"] + "Signatures" + li + a.active [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=profile;{session_var}={session_id}"] + "Profile Fields" + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=likes;{session_var}={session_id}"] + "Likes" + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=mentions;{session_var}={session_id}"] + "Mentions" + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=alerts;{session_var}={session_id}"] + "Notifications" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + script + | var startOptID = #; + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=featuresettings;sa=profileedit;fid=#;{session_var}={session_id}" method="post"] + div#section_header.cat_bar + h3.catbg + "Add Profile field" + div.windowbg + fieldset + legend + "Display Settings" + dl.settings + dt + a#field_name_help.help [href="{boardurl}/index.php?action=helpadmin;help=translatable_fields" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + strong + label [for="field_name"] + "Name" + br + span.smalltext + "You can use translatable tokens in this field." + dd + input#field_name [maxlength="#" name="field_name" size="#" type="text" value] + dt + a#field_desc_help.help [href="{boardurl}/index.php?action=helpadmin;help=translatable_fields" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + strong + label [for="field_desc"] + "Description" + br + span.smalltext + "You can use translatable tokens in this field." + dd + textarea#field_desc [cols="#" name="field_desc" rows="#"] + dt + strong + label [for="profile_area"] + "Profile Section" + br + span.smalltext + "Section of profile the users will be able to edit this in." + dd + select#profile_area [name="profile_area"] + option [value="none"] + "None" + option [value="account"] + "Account Settings" + option [selected value="forumprofile"] + "Forum Profile" + option [value="theme"] + "Look and Layout" + dt + a#field_reg_require.help [href="{boardurl}/index.php?action=helpadmin;help=field_reg_require" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + strong + label [for="reg"] + "Show on Registration" + dd + select#reg [name="reg"] + option [selected value="#"] + "No" + option [value="#"] + "Yes" + option [value="#"] + "Yes, and require entry" + dt + strong + label [for="display"] + "Show on Topic View" + dd + input#display [name="display" type="checkbox"] + dt + strong + label [for="mlist"] + "Show on memberlist" + dd + input#show_mlist [name="mlist" type="checkbox"] + dt + strong + label [for="placement"] + "Choose Placement" + dd + select#placement [name="placement"] + option [selected value="#"] + "Standard (with title)" + option [value="#"] + "With Icons" + option [value="#"] + "Above Signature" + option [value="#"] + "Below Signature" + option [value="#"] + "Below Avatar" + option [value="#"] + "Above Username" + option [value="#"] + "Bottom poster info" + option [value="#"] + "Before Username" + option [value="#"] + "After Username" + dt + a#field_show_enclosed.help [href="{boardurl}/index.php?action=helpadmin;help=field_show_enclosed" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + strong + label [for="enclose"] + "Show Enclosed Within Text (Optional)" + br + span.smalltext + "We" + strong + "strongly" + "recommend to use an input mask to validate the input supplied by the user." + dd + textarea#enclose [cols="#" name="enclose" rows="#"] + fieldset + legend + "Input Settings" + dl.settings + dt + strong + label [for="field_type"] + "Field Type" + dd + select#field_type [name="field_type" onchange="updateInputBoxes();"] + option [selected value="text"] + "Text" + option [value="textarea"] + "Large Text" + option [value="select"] + "Select Box" + option [value="radio"] + "Radio Button" + option [value="check"] + "Checkbox" + dt#max_length_dt + strong + label [for="max_length_dd"] + "Maximum Length" + br + span.smalltext + "(# for(s) no limit)" + dd + input#max_length_dd [maxlength="#" name="max_length" size="#" type="text" value="#"] + dt#dimension_dt + strong + label [for="dimension_dd"] + "Dimensions" + dd#dimension_dd + strong + "Rows" + input [maxlength="#" name="rows" size="#" type="text" value="#"] + strong + "Columns" + input [maxlength="#" name="cols" size="#" type="text" value="#"] + dt#bbc_dt + strong + label [for="bbc_dd"] + "Allow BBC" + dd + input#bbc_dd [name="bbc" type="checkbox"] + dt#options_dt + a.help [href="{boardurl}/index.php?action=helpadmin;help=customoptions" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + strong + label [for="options_dd"] + "Options" + br + span.smalltext + "Leave option box blank to remove. Radio button selects default option." + br + span + "You can use translatable tokens in this field." + dd#options_dd + input [checked name="default_select" type="radio" value="#"] + input [name="select_option[#]" type="text" value] + br + input [checked name="default_select" type="radio" value="#"] + input [name="select_option[#]" type="text" value] + span#addopt + "[" + a [href onclick="addOption(); return false;"] + "More" + "]" + dt#default_dt + strong + label [for="default_dd"] + "Default State" + dd + input#default_dd [name="default_check" type="checkbox"] + fieldset + legend + "Advanced Settings" + dl.settings + dt#mask_dt + a#custom_mask.help [href="{boardurl}/index.php?action=helpadmin;help=custom_mask" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + strong + label [for="mask"] + "Input Mask" + br + span.smalltext + "For text fields an input mask can be selected to validate the data." + dd + select#mask [name="mask" onchange="updateInputBoxes();"] + option [selected value="nohtml"] + "No HTML" + option [value="email"] + "Valid Email" + option [value="number"] + "Numeric" + option [value="regex"] + "Regex (Advanced)" + br + span#regex_div + input [name="regex" size="#" type="text" value] + dt + strong + label [for="private"] + "Privacy" + br + span.smalltext + "Who can see and edit this field." + dd + select#private [name="private" onchange="updateInputBoxes();"] + option [selected value="#"] + "Users can see this field; owner can edit it" + option [value="#"] + "Users can see this field; only admins can edit it" + option [value="#"] + "Users cannot see this field; owner and admins can edit it." + option [value="#"] + "This field is only visible to admins" + dt#can_search_dt + strong + label [for="can_search_dd"] + "Searchable" + br + span.smalltext + "Can this field be searched from the members list." + dd + input#can_search_dd [name="can_search" type="checkbox"] + dt + strong + label [for="can_search_check"] + "Active" + br + span.smalltext + "If not selected this field will not be shown to anyone." + dd + input#can_search_check [checked name="active" type="checkbox"] + input.button [name="save" type="submit" value="Save"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] + script + | updateInputBoxes(); diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/features_sig.txt b/tests/Integration/Http/Snapshot/snapshots/admin/features_sig.txt new file mode 100644 index 00000000000..5b79c47a44c --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/features_sig.txt @@ -0,0 +1,375 @@ +status 200 +@ title +title + "Signature Settings" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=featuresettings;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Features and Options" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=sig;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Signatures" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=featuresettings" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Features and Options" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Use the settings on this page to decide how member signatures should be treated in SMF." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Features and Options Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Features and Options Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=basic;{session_var}={session_id}"] + "General" + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=bbc;{session_var}={session_id}"] + "Bulletin Board Code & Markdown" + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=layout;{session_var}={session_id}"] + "Layout" + li + a.active [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=sig;{session_var}={session_id}"] + "Signatures" + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=profile;{session_var}={session_id}"] + "Profile Fields" + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=likes;{session_var}={session_id}"] + "Likes" + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=mentions;{session_var}={session_id}"] + "Mentions" + li + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=alerts;{session_var}={session_id}"] + "Notifications" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + form#admin_form_wrapper [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=featuresettings;save;sa=sig" method="post"] + div.cat_bar + h3.catbg + "Signature Settings" + div.information.noup + div.centertext + "Note that settings are not applied to existing signatures by default." + a [href="{boardurl}/index.php?action=admin;area=featuresettings;sa=sig;apply;{session_var}={sessions_id}"] + "Apply changes now" + div.noup.windowbg + dl.settings + dt + a#setting_signature_enable + span + label [for="signature_enable"] + "Enable signatures" + dd + input#signature_enable [checked name="signature_enable" type="checkbox" value="#"] + hr + dl.settings + dt + a#setting_signature_max_length + span + label [for="signature_max_length"] + "Maximum allowed characters" + br + span.smalltext + "(# for(s) no limit)" + dd + input#signature_max_length [min="#" name="signature_max_length" size="#" type="number" value="#"] + dt + a#setting_signature_max_lines + span + label [for="signature_max_lines"] + "Maximum amount of lines" + br + span.smalltext + "(# for(s) no limit)" + dd + input#signature_max_lines [min="#" name="signature_max_lines" size="#" type="number" value="#"] + dt + a#setting_signature_max_font_size + span + label [for="signature_max_font_size"] + "Maximum font size allowed in signatures (pixels)" + br + span.smalltext + "(# for(s) no limit)" + dd + input#signature_max_font_size [min="#" name="signature_max_font_size" size="#" type="number" value="#"] + dt + a#setting_signature_allow_smileys + span + label [for="signature_allow_smileys"] + "Allow smileys in signatures" + dd + input#signature_allow_smileys [checked name="signature_allow_smileys" onclick="document.getElementById('signature_max_smileys').disabled = !this.checked;" type="checkbox" value="#"] + dt + a#setting_signature_max_smileys + span + label [for="signature_max_smileys"] + "Maximum smiley count" + br + span.smalltext + "(# for(s) no limit)" + dd + input#signature_max_smileys [min="#" name="signature_max_smileys" size="#" type="number" value="#"] + hr + dl.settings + dt + a#setting_signature_max_images + span + label [for="signature_max_images"] + "Maximum image count" + br + span.smalltext + "(# for(s) no max - excludes smileys)" + dd + input#signature_max_images [min="#" name="signature_max_images" size="#" type="number" value="#"] + dt + a#setting_signature_max_image_width + span + label [for="signature_max_image_width"] + "Maximum width of signature images (pixels)" + br + span.smalltext + "(# for(s) no limit)" + dd + input#signature_max_image_width [min="#" name="signature_max_image_width" size="#" type="number" value="#"] + dt + a#setting_signature_max_image_height + span + label [for="signature_max_image_height"] + "Maximum height of signature images (pixels)" + br + span.smalltext + "(# for(s) no limit)" + dd + input#signature_max_image_height [min="#" name="signature_max_image_height" size="#" type="number" value="#"] + hr + dl.settings + dt + a#setting_signature_bbc + span + label [for="signature_bbc"] + "Enabled BBC tags" + dd + fieldset#signature_bbc + legend + "Select the tags which are allowed to be used" + ul + li.floatleft.list_bbc + input#tag_signature_bbc_abbr [checked name="signature_bbc_enabledTags[]" type="checkbox" value="abbr"] + label [for="tag_signature_bbc_abbr"] + "abbr" + li.floatleft.list_bbc + input#tag_signature_bbc_anchor [checked name="signature_bbc_enabledTags[]" type="checkbox" value="anchor"] + label [for="tag_signature_bbc_anchor"] + "anchor" + li.floatleft.list_bbc + input#tag_signature_bbc_attach [checked name="signature_bbc_enabledTags[]" type="checkbox" value="attach"] + label [for="tag_signature_bbc_attach"] + "attach" + li.floatleft.list_bbc + input#tag_signature_bbc_b [checked name="signature_bbc_enabledTags[]" type="checkbox" value="b"] + label [for="tag_signature_bbc_b"] + "b" + li.floatleft.list_bbc + input#tag_signature_bbc_br [checked name="signature_bbc_enabledTags[]" type="checkbox" value="br"] + label [for="tag_signature_bbc_br"] + "br" + li.floatleft.list_bbc + input#tag_signature_bbc_center [checked name="signature_bbc_enabledTags[]" type="checkbox" value="center"] + label [for="tag_signature_bbc_center"] + "center" + li.floatleft.list_bbc + input#tag_signature_bbc_code [checked name="signature_bbc_enabledTags[]" type="checkbox" value="code"] + label [for="tag_signature_bbc_code"] + "code" + li.floatleft.list_bbc + input#tag_signature_bbc_color [checked name="signature_bbc_enabledTags[]" type="checkbox" value="color"] + label [for="tag_signature_bbc_color"] + "color" + li.floatleft.list_bbc + input#tag_signature_bbc_details [checked name="signature_bbc_enabledTags[]" type="checkbox" value="details"] + label [for="tag_signature_bbc_details"] + "details" + li.floatleft.list_bbc + input#tag_signature_bbc_email [checked name="signature_bbc_enabledTags[]" type="checkbox" value="email"] + label [for="tag_signature_bbc_email"] + "email" + li.floatleft.list_bbc + input#tag_signature_bbc_float [checked name="signature_bbc_enabledTags[]" type="checkbox" value="float"] + label [for="tag_signature_bbc_float"] + "float" + li.floatleft.list_bbc + input#tag_signature_bbc_font [checked name="signature_bbc_enabledTags[]" type="checkbox" value="font"] + label [for="tag_signature_bbc_font"] + "font" + li.floatleft.list_bbc + input#tag_signature_bbc_h# [checked name="signature_bbc_enabledTags[]" type="checkbox" value="h#"] + label [for="tag_signature_bbc_h#"] + "h#" + li.floatleft.list_bbc + input#tag_signature_bbc_html [checked name="signature_bbc_enabledTags[]" type="checkbox" value="html"] + label [for="tag_signature_bbc_html"] + "html" + li.floatleft.list_bbc + input#tag_signature_bbc_hr [checked name="signature_bbc_enabledTags[]" type="checkbox" value="hr"] + label [for="tag_signature_bbc_hr"] + "hr" + li.floatleft.list_bbc + input#tag_signature_bbc_i [checked name="signature_bbc_enabledTags[]" type="checkbox" value="i"] + label [for="tag_signature_bbc_i"] + "i" + li.floatleft.list_bbc + input#tag_signature_bbc_img [checked name="signature_bbc_enabledTags[]" type="checkbox" value="img"] + label [for="tag_signature_bbc_img"] + "img" + li.floatleft.list_bbc + input#tag_signature_bbc_iurl [checked name="signature_bbc_enabledTags[]" type="checkbox" value="iurl"] + label [for="tag_signature_bbc_iurl"] + "iurl" + li.floatleft.list_bbc + input#tag_signature_bbc_justify [checked name="signature_bbc_enabledTags[]" type="checkbox" value="justify"] + label [for="tag_signature_bbc_justify"] + "justify" + li.floatleft.list_bbc + input#tag_signature_bbc_list [checked name="signature_bbc_enabledTags[]" type="checkbox" value="list"] + label [for="tag_signature_bbc_list"] + "list" + li.floatleft.list_bbc + input#tag_signature_bbc_ltr [checked name="signature_bbc_enabledTags[]" type="checkbox" value="ltr"] + label [for="tag_signature_bbc_ltr"] + "ltr" + li.floatleft.list_bbc + input#tag_signature_bbc_me [checked name="signature_bbc_enabledTags[]" type="checkbox" value="me"] + label [for="tag_signature_bbc_me"] + "me" + li.floatleft.list_bbc + input#tag_signature_bbc_member [checked name="signature_bbc_enabledTags[]" type="checkbox" value="member"] + label [for="tag_signature_bbc_member"] + "member" + li.floatleft.list_bbc + input#tag_signature_bbc_nobbc [checked name="signature_bbc_enabledTags[]" type="checkbox" value="nobbc"] + label [for="tag_signature_bbc_nobbc"] + "nobbc" + li.floatleft.list_bbc + input#tag_signature_bbc_nolink [checked name="signature_bbc_enabledTags[]" type="checkbox" value="nolink"] + label [for="tag_signature_bbc_nolink"] + "nolink" + li.floatleft.list_bbc + input#tag_signature_bbc_php [checked name="signature_bbc_enabledTags[]" type="checkbox" value="php"] + label [for="tag_signature_bbc_php"] + "php" + li.floatleft.list_bbc + input#tag_signature_bbc_pre [checked name="signature_bbc_enabledTags[]" type="checkbox" value="pre"] + label [for="tag_signature_bbc_pre"] + "pre" + li.floatleft.list_bbc + input#tag_signature_bbc_quote [checked name="signature_bbc_enabledTags[]" type="checkbox" value="quote"] + label [for="tag_signature_bbc_quote"] + "quote" + li.floatleft.list_bbc + input#tag_signature_bbc_right [checked name="signature_bbc_enabledTags[]" type="checkbox" value="right"] + label [for="tag_signature_bbc_right"] + "right" + li.floatleft.list_bbc + input#tag_signature_bbc_rtl [checked name="signature_bbc_enabledTags[]" type="checkbox" value="rtl"] + label [for="tag_signature_bbc_rtl"] + "rtl" + li.floatleft.list_bbc + input#tag_signature_bbc_s [checked name="signature_bbc_enabledTags[]" type="checkbox" value="s"] + label [for="tag_signature_bbc_s"] + "s" + li.floatleft.list_bbc + input#tag_signature_bbc_size [checked name="signature_bbc_enabledTags[]" type="checkbox" value="size"] + label [for="tag_signature_bbc_size"] + "size" + li.floatleft.list_bbc + input#tag_signature_bbc_spoiler [checked name="signature_bbc_enabledTags[]" type="checkbox" value="spoiler"] + label [for="tag_signature_bbc_spoiler"] + "spoiler" + li.floatleft.list_bbc + input#tag_signature_bbc_sub [checked name="signature_bbc_enabledTags[]" type="checkbox" value="sub"] + label [for="tag_signature_bbc_sub"] + "sub" + li.floatleft.list_bbc + input#tag_signature_bbc_sup [checked name="signature_bbc_enabledTags[]" type="checkbox" value="sup"] + label [for="tag_signature_bbc_sup"] + "sup" + li.floatleft.list_bbc + input#tag_signature_bbc_table [checked name="signature_bbc_enabledTags[]" type="checkbox" value="table"] + label [for="tag_signature_bbc_table"] + "table" + li.floatleft.list_bbc + input#tag_signature_bbc_time [checked name="signature_bbc_enabledTags[]" type="checkbox" value="time"] + label [for="tag_signature_bbc_time"] + "time" + li.floatleft.list_bbc + input#tag_signature_bbc_tt [checked name="signature_bbc_enabledTags[]" type="checkbox" value="tt"] + label [for="tag_signature_bbc_tt"] + "tt" + li.floatleft.list_bbc + input#tag_signature_bbc_u [checked name="signature_bbc_enabledTags[]" type="checkbox" value="u"] + label [for="tag_signature_bbc_u"] + "u" + li.floatleft.list_bbc + input#tag_signature_bbc_url [checked name="signature_bbc_enabledTags[]" type="checkbox" value="url"] + label [for="tag_signature_bbc_url"] + "url" + li.floatleft.list_bbc + input#tag_signature_bbc_youtube [checked name="signature_bbc_enabledTags[]" type="checkbox" value="youtube"] + label [for="tag_signature_bbc_youtube"] + "youtube" + input#bbc_signature_bbc_select_all [checked onclick="invertAll(this, this.form, 'signature_bbc_enabledTags');" type="checkbox"] + label [for="bbc_signature_bbc_select_all"] + em + "Select all tags" + input.button [type="submit" value="Save"] + input [name="{token_var}" type="hidden" value="{hash}"] + input [name="{session_var}" type="hidden" value="{session_id}"] + script + | document.getElementById('signature_max_smileys').disabled = !document.getElementById('signature_allow_smileys').checked; diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/index.php b/tests/Integration/Http/Snapshot/snapshots/admin/index.php new file mode 100644 index 00000000000..2844a3b9e7b --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/index.php @@ -0,0 +1,8 @@ +\n
\nWe here at {FORUMNAME} would like to wish you a happy birthday. May this day and the year to follow be full of joy.
\n
\n{REGARDS}' }, karlbenson#: { subject: 'On your Birthday...', body: 'We could have sent you a birthday card. We could have sent you some flowers or a cake.
\n
\nBut we didn’t.
\n
\nWe could have even sent you one of those automatically generated messages to wish you happy birthday where we don’t even have to replace INSERT NAME.
\n
\nBut we didn’t.
\n
\nWe wrote this birthday greeting just for you.
\n
\nWe would like to wish you a very special birthday.
\n
\n{REGARDS}
\n
\n//:: This message was automatically generated :://' }, nite#: { subject: 'Happy Birthday!', body: 'Your friends at {FORUMNAME} would like to take a moment of your time to wish you a happy birthday, {REALNAME}. If you have not done so recently, please visit our community in order for others to have the opportunity to pass along their warm regards.
\n
\nEven though today is your birthday, {REALNAME}, we would like to remind you that your membership in our community has been the best gift to us thus far.
\n
\nBest Wishes,
\nThe Staff of {FORUMNAME}' }, zwaldowski: { subject: 'Birthday Wishes to {REALNAME}', body: 'Dear {REALNAME},
\n
\nAnother year in your life has passed. We at {FORUMNAME} hope it has been filled with happiness, and wish you luck in the coming one.
\n
\n{REGARDS}' }, geezmo: { subject: 'Happy birthday, {REALNAME}!', body: 'Do you know who’s having a birthday today, {REALNAME}?
\n
\nWe know... YOU!
\n
\nHappy birthday!
\n
\nYou’re now a year older but we hope you’re a lot happier than last year.
\n
\nEnjoy your day today, {REALNAME}!
\n
\n- From your {FORUMNAME} family' }, karlbenson#: { subject: 'Your Birthday Greeting', body: 'We hope your birthday is the best ever; cloudy, sunny or whatever the weather.
\nHave lots of birthday cake and fun, and tell us what you have done.
\n
\nWe hope this message brought you cheer, and make it last, until same time same place, next year.
\n
\n{REGARDS}' } }; function fetch_birthday_preview() { var index = document.getElementById('birthday_email').value; document.getElementById('birthday_subject').innerHTML = bDay[index].subject; document.getElementById('birthday_body').innerHTML = bDay[index].body; } + form#admin_form_wrapper [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=mailqueue;save;sa=settings" method="post"] + div.cat_bar + h3.catbg + "Settings" + div.noup.windowbg + dl.settings + dt + a#setting_mail_limit + span + label [for="mail_limit"] + "Maximum emails to send per minute" + br + span.smalltext + "(Set to # to(s) disable.)" + dd + input#mail_limit [min="#" name="mail_limit" size="#" type="number" value="#"] + dt + a#setting_mail_quantity + span + label [for="mail_quantity"] + "Maximum amount of emails to send per page load" + dd + input#mail_quantity [min="#" name="mail_quantity" size="#" type="number" value="#"] + hr + dl.settings + dt + a#setting_birthday_email_help [href="{boardurl}/index.php?action=helpadmin;help=birthday_email" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_birthday_email + span + label [for="birthday_email"] + "Birthday message to use" + dd + select#birthday_email [name="birthday_email" onchange="fetch_birthday_preview()" size="#"] + option [value="happy_birthday"] + "happy_birthday" + option [value="karlbenson#"] + "karlbenson#" + option [value="nite#"] + "nite#" + option [value="zwaldowski"] + "zwaldowski" + option [value="geezmo"] + "geezmo" + option [value="karlbenson#"] + "karlbenson#" + dt + a#setting_birthday_subject + span [style="color: ##;"] + label [for="birthday_subject"] + "Email subject" + dd + div#birthday_subject + "Happy birthday from {FORUMNAME}." + dt + a#setting_birthday_body + span [style="color: ##;"] + label [for="birthday_body"] + "Email body" + dd + div#birthday_body + "Dear {REALNAME}," + br + "We here at {FORUMNAME} would like to wish you a happy birthday. May this day and the year to follow be full of joy." + br + "{REGARDS}" + hr + dl.settings + dt + a#setting_mail_type_help [href="{boardurl}/index.php?action=helpadmin;help=mail_type" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_mail_type + span + label [for="mail_type"] + "Mail type" + dd + select#mail_type [name="mail_type" size="#"] + option [value="SMTP"] + "SMTP" + option [value="SMTPTLS"] + "SMTPTLS" + option [selected value="SendMail"] + "SendMail" + dt + a#setting_smtp_host + span + label [for="smtp_host"] + "SMTP server" + dd + input#smtp_host [name="smtp_host" type="text" value] + dt + a#setting_smtp_port + span + label [for="smtp_port"] + "SMTP port" + dd + input#smtp_port [name="smtp_port" type="text" value="#"] + dt + a#setting_smtp_username + span + label [for="smtp_username"] + "SMTP username" + dd + input#smtp_username [name="smtp_username" type="text" value] + dt + a#setting_smtp_password + span + label [for="smtp_password"] + "SMTP password" + br + em + "(confirm)" + dd + input [name="smtp_password[#]" onfocus="this.value = ''; this.form.smtp_password.disabled = false;" type="password" value="*#fakepass#*"] + br + input#smtp_password [disabled name="smtp_password[#]" type="password"] + input.button [type="submit" value="Save"] + input [name="{token_var}" type="hidden" value="{hash}"] + input [name="{session_var}" type="hidden" value="{session_id}"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/mail_test.txt b/tests/Integration/Http/Snapshot/snapshots/admin/mail_test.txt new file mode 100644 index 00000000000..b731dff32f5 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/mail_test.txt @@ -0,0 +1,89 @@ +status 200 +@ title +title + "Mail" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=mailqueue;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Mail" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=mailqueue;sa=test;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Send Test" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + "Mail" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "From this page you can configure your mail settings, as well as view and administer the current mail queue." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Mail Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Mail Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a [href="{boardurl}/index.php?action=admin;area=mailqueue;sa=browse;{session_var}={session_id}"] + "Browse Queue" + li + a [href="{boardurl}/index.php?action=admin;area=mailqueue;sa=settings;{session_var}={session_id}"] + "Settings" + li + a.active [href="{boardurl}/index.php?action=admin;area=mailqueue;sa=test;{session_var}={session_id}"] + "Send Test" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + form#admin_form_wrapper [action="{boardurl}/index.php?action=admin;area=mailqueue;sa=test;save" method="post"] + div.cat_bar + h3.catbg + "Email Test" + div.windowbg + dl#post_header + dt + label#caption_subject [for="subject"] + "Subject" + dd + input#subject [maxlength="#" name="subject" size="#" type="text"] + textarea.editor [cols="#" name="message" rows="#"] + dl#post_footer + dd + input.button [type="submit" value="Send message"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/maintain_database.txt b/tests/Integration/Http/Snapshot/snapshots/admin/maintain_database.txt new file mode 100644 index 00000000000..6407c81ba0b --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/maintain_database.txt @@ -0,0 +1,97 @@ +status 200 +@ title +title + "Forum Maintenance" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=maintain;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Forum Maintenance" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=database;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Database" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + "Forum Maintenance" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Optimize tables, make backups, check for errors, and prune boards with these tools." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Forum Maintenance Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Forum Maintenance Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=routine;{session_var}={session_id}"] + "Routine" + li + a.active [href="{boardurl}/index.php?action=admin;area=maintain;sa=database;{session_var}={session_id}"] + "Database" + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=members;{session_var}={session_id}"] + "Members" + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=topics;{session_var}={session_id}"] + "Topics" + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=hooks;{session_var}={session_id}"] + "Integration Hooks" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + div#manage_maintenance + form.option_form.windowbg [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=maintain;sa=database" method="post"] + label + input [name="activity" type="radio" value="optimize"] + strong + "Optimize all tables" + p + "This task allows you to optimize all tables. This will get rid of overhead, effectively making the tables smaller in size and your forum faster." + label + input [name="activity" type="radio" value="convertentities"] + strong + "Convert HTML-entities to UTF-# character(s)" + p + "This function will convert all characters that are stored in the database as HTML-entities to UTF-# character(s). This is especially useful when you have just converted your forum from a character set like ISO-#-# while(s) non-latin characters were used on the forum. The browser then sends all characters as HTML-entities. For example, the HTML-entity &##; represents the greek letter α (alpha). Converting entities to UTF-# will(s) improve searching and sorting of text and reduce storage size." + input.button [type="submit" value="Run task now"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/maintain_members.txt b/tests/Integration/Http/Snapshot/snapshots/admin/maintain_members.txt new file mode 100644 index 00000000000..14d2e8698c7 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/maintain_members.txt @@ -0,0 +1,199 @@ +status 200 +@ title +title + "Forum Maintenance" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=maintain;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Forum Maintenance" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=members;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Members" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + "Forum Maintenance" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Optimize tables, make backups, check for errors, and prune boards with these tools." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Forum Maintenance Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Forum Maintenance Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=routine;{session_var}={session_id}"] + "Routine" + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=database;{session_var}={session_id}"] + "Database" + li + a.active [href="{boardurl}/index.php?action=admin;area=maintain;sa=members;{session_var}={session_id}"] + "Members" + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=topics;{session_var}={session_id}"] + "Topics" + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=hooks;{session_var}={session_id}"] + "Integration Hooks" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + script + | var warningMessage = ''; var membersSwap = false; function swapMembers() { membersSwap = !membersSwap; var membersForm = document.getElementById('membersForm'); $("#membersPanel").slideToggle(#); document.getElementById("membersIcon").src = smf_images_url + (membersSwap ? "/selected_open.png" : "/selected.png"); setInnerHTML(document.getElementById("membersText"), membersSwap ? "Selected Groups" : "All Membergroups"); for (var i = #; i < membersForm.length; i++) { if (membersForm.elements[i].type.toLowerCase() == "checkbox") membersForm.elements[i].checked = !membersSwap; } } function checkAttributeValidity() { origText = 'Are you sure you want to attribute all guest posts with %type% of "%find%" to member "%member_to%"?'; valid = true; // Do all the fields! if (!document.getElementById('to').value) valid = false; warningMessage = origText.replace(/%member_to%/, document.getElementById('to').value); if (document.getElementById('type_email').checked) { if (!document.getElementById('from_email').value) valid = false; warningMessage = warningMessage.replace(/%type%/, 'an email address').replace(/%find%/, document.getElementById('from_email').value); } else { if (!document.getElementById('from_name').value) valid = false; warningMessage = warningMessage.replace(/%type%/, 'a username').replace(/%find%/, document.getElementById('from_name').value); } document.getElementById('do_attribute').disabled = valid ? '' : 'disabled'; setTimeout("checkAttributeValidity();", #); return valid; } setTimeout("checkAttributeValidity();", #); + div#manage_maintenance + div.cat_bar + h3.catbg + "Reattribute User Posts" + div.windowbg + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=maintain;sa=members;activity=reattribute" method="post"] + p + strong + "Attribute posts made with" + dl.settings + dt + label [for="type_email"] + input#type_email [checked name="type" type="radio" value="email"] + "Email address of" + dd + input#from_email [name="from_email" onclick="document.getElementById('type_email').checked = 'checked'; document.getElementById('from_name').value = '';" type="text" value] + dt + label [for="type_name"] + input#type_name [name="type" type="radio" value="name"] + "Username of" + dd + input#from_name [name="from_name" onclick="document.getElementById('type_name').checked = 'checked'; document.getElementById('from_email').value = '';" type="text" value] + dl.settings + dt + label [for="to"] + strong + "Attribute posts to member" + dd + input#to [name="to" type="text" value] + p.maintain_members + input#posts [checked name="posts" type="checkbox"] + label [for="posts"] + "Add posts to users post count" + input#do_attribute.button [onclick="if (!checkAttributeValidity()) return false;\n\t\t\t\treturn confirm(warningMessage);" type="submit" value="Reattribute"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=maintenance_members" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Remove Inactive Members" + div.windowbg + form#membersForm [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=maintain;sa=members;activity=purgeinactive" method="post"] + div.padding + a#membersLink + "Remove all members who have not" + select [name="del_type"] + option [selected value="activated"] + "activated their account" + option [value="logged"] + "logged in" + "for" + input [name="maxdays" size="#" type="number" value="#"] + "days." + div.padding + label [for="anonymize"] + input#anonymize [name="anonymize" type="checkbox" value="#"] + "Anonymize personally identifying information when account is deleted" + div.padding + a [href="#membersLink" onclick="swapMembers();"] + img#membersIcon [alt="+" src="{boardurl}/Themes/default/images/selected.png"] + a#membersText [href="#membersLink" onclick="swapMembers();" style="font-weight: bold;"] + "All Membergroups" + div#membersPanel [style="display: none;"] + label [for="groups#"] + input#groups# [checked name="groups[#]" type="checkbox"] + "Ungrouped Members" + span.smalltext + "(Members with no assigned groups)" + br + label [for="groups#"] + input#groups# [checked name="groups[#]" type="checkbox"] + "Administrator" + br + label [for="groups#"] + input#groups# [checked name="groups[#]" type="checkbox"] + "Global Moderator" + br + label [for="groups#"] + input#groups# [checked name="groups[#]" type="checkbox"] + "Moderator" + br + label [for="groups#"] + input#groups# [checked name="groups[#]" type="checkbox"] + "Newbie" + br + label [for="groups#"] + input#groups# [checked name="groups[#]" type="checkbox"] + "Jr. Member" + br + label [for="groups#"] + input#groups# [checked name="groups[#]" type="checkbox"] + "Full Member" + br + label [for="groups#"] + input#groups# [checked name="groups[#]" type="checkbox"] + "Sr. Member" + br + label [for="groups#"] + input#groups# [checked name="groups[#]" type="checkbox"] + "Hero Member" + br + input.button.you_sure [data-confirm="Are you sure you really want to delete these member accounts?-n-This cannot be undone!" type="submit" value="Remove now"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] + div.cat_bar + h3.catbg + "Recount User Posts" + div.windowbg + form#membersRecountForm [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=maintain;sa=members;activity=recountposts" method="post"] + p + "Run this maintenance task to update your users total post count. It will recount all (countable) posts made by each user and then update their profile post count totals" + input.button [type="submit" value="Run task now"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] + script + | var oAttributeMemberSuggest = new smc_AutoSuggest({ sSelf: 'oAttributeMemberSuggest', sSessionId: smf_session_id, sSessionVar: smf_session_var, sSuggestId: 'attributeMember', sControlId: 'to', sSearchType: 'member', sTextDeleteItem: 'Delete Item', bItemList: false }); diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/maintain_routine.txt b/tests/Integration/Http/Snapshot/snapshots/admin/maintain_routine.txt new file mode 100644 index 00000000000..86cf6f4fa98 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/maintain_routine.txt @@ -0,0 +1,121 @@ +status 200 +@ title +title + "Forum Maintenance" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=maintain;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Forum Maintenance" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=routine;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Routine" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + "Forum Maintenance" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Optimize tables, make backups, check for errors, and prune boards with these tools." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Forum Maintenance Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Forum Maintenance Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a.active [href="{boardurl}/index.php?action=admin;area=maintain;sa=routine;{session_var}={session_id}"] + "Routine" + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=database;{session_var}={session_id}"] + "Database" + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=members;{session_var}={session_id}"] + "Members" + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=topics;{session_var}={session_id}"] + "Topics" + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=hooks;{session_var}={session_id}"] + "Integration Hooks" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + div#manage_maintenance + form.option_form.windowbg [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=maintain" method="post"] + label + input [name="activity" type="radio" value="version"] + strong + "Check all files against current versions" + p + "This maintenance task allows you to do a detailed version check of all forum files against the official list of latest versions." + label + input [name="activity" type="radio" value="repair"] + strong + "Find and repair any errors" + p + "If, for example, posts or topics are missing after a server crash, this function may help in finding them again." + label + input [name="activity" type="radio" value="recount"] + strong + "Recount all forum totals and statistics" + p + "Should the total replies of a topic or the number of PMs in your inbox be incorrect: this function will recount all saved counts and statistics for you." + label + input [name="activity" type="radio" value="rebuild_settings"] + strong + "Rebuild Settings.php" + p + "This task reconstructs your Settings.php file. It does not change the values stored in the file. Instead, it cleans up and reformats your Settings.php file to a pristine version." + label + input [name="activity" type="radio" value="logs"] + strong + "Empty out unimportant logs" + p + "This function will empty out all unimportant logs. This should be avoided unless something is wrong, but it does not hurt anything." + label + input [name="activity" type="radio" value="cleancache"] + strong + "Empty SMF’s cache" + p + "This function will empty out the cache should you need it to be cleared." + input.button [type="submit" value="Run task now"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/maintain_topics.txt b/tests/Integration/Http/Snapshot/snapshots/admin/maintain_topics.txt new file mode 100644 index 00000000000..37f444fbfcb --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/maintain_topics.txt @@ -0,0 +1,182 @@ +status 200 +@ title +title + "Forum Maintenance" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=maintain;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Forum Maintenance" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=topics;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Topics" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + "Forum Maintenance" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Optimize tables, make backups, check for errors, and prune boards with these tools." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Forum Maintenance Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Forum Maintenance Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=routine;{session_var}={session_id}"] + "Routine" + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=database;{session_var}={session_id}"] + "Database" + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=members;{session_var}={session_id}"] + "Members" + li + a.active [href="{boardurl}/index.php?action=admin;area=maintain;sa=topics;{session_var}={session_id}"] + "Topics" + li + a [href="{boardurl}/index.php?action=admin;area=maintain;sa=hooks;{session_var}={session_id}"] + "Integration Hooks" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + script + | var rotSwap = false; function swapRot() { rotSwap = !rotSwap; // Toggle icon document.getElementById("rotIcon").src = smf_images_url + (rotSwap ? "/selected_open.png" : "/selected.png"); setInnerHTML(document.getElementById("rotText"), rotSwap ? 'Specific boards (click to select all)' : 'All boards (click to select specific boards)'); // Toggle panel $("#rotPanel").slideToggle(#); // Toggle checkboxes var rotPanel = document.getElementById('rotPanel'); var oBoardCheckBoxes = rotPanel.getElementsByTagName('input'); for (var i = #; i < oBoardCheckBoxes.length; i++) { if (oBoardCheckBoxes[i].type.toLowerCase() == "checkbox") oBoardCheckBoxes[i].checked = !rotSwap; } } + div#manage_maintenance + div.cat_bar + h3.catbg + "Remove old posts" + div.windowbg + div.flow_auto + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=maintain;sa=topics;activity=pruneold" method="post"] + p + a#rotLink + "Remove all topics not posted in for" + input [name="maxdays" size="#" type="number" value="#"] + "days, which are:" + p + label [for="delete_type_nothing"] + input#delete_type_nothing [name="delete_type" type="radio" value="nothing"] + "Any sort of topic." + br + label [for="delete_type_moved"] + input#delete_type_moved [checked name="delete_type" type="radio" value="moved"] + "Moved/merged topic notices." + br + label [for="delete_type_locked"] + input#delete_type_locked [name="delete_type" type="radio" value="locked"] + "Locked." + br + p + label [for="delete_old_not_sticky"] + input#delete_old_not_sticky [checked name="delete_old_not_sticky" type="checkbox"] + "But do not count stickied topics." + br + p + a [href="#rotLink" onclick="swapRot();"] + img#rotIcon [alt="+" src="{boardurl}/Themes/default/images/selected.png"] + a#rotText [href="#rotLink" onclick="swapRot();" style="font-weight: bold;"] + "All boards (click to select specific boards)" + div#rotPanel.flow_hidden [style="display: none;"] + snapshot-ignored [selector="#rotPanel > div"] + input.button.you_sure [data-confirm="Are you really sure you want to delete old posts now?-n-This cannot be undone!" type="submit" value="Remove now"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] + div.cat_bar + h3.catbg + "Remove old drafts" + div.windowbg + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=maintain;sa=topics;activity=olddrafts" method="post"] + p + "Remove all drafts older than" + input [name="draftdays" size="#" type="number" value="#"] + "days." + input.button.you_sure [data-confirm="Are you really sure you want to delete old drafts now?-n-This cannot be undone!" type="submit" value="Remove now"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] + div.cat_bar + h3.catbg + "Move Topics" + div.windowbg + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=maintain;sa=topics;activity=massmove" method="post"] + p + "Move topics from" + select#id_board_from [name="id_board_from"] + option [disabled selected] + "(Select Board)" + optgroup [label="Snapshot fixtures"] + option [value="#"] + "=> Snapshot board" + option [value="#"] + "===> Snapshot child one" + option [value="#"] + "===> Snapshot child two" + option [value="#"] + "=> Snapshot empty board" + "to" + select#id_board_to [name="id_board_to"] + option [disabled selected] + "(Select Board)" + optgroup [label="Snapshot fixtures"] + option [value="#"] + "=> Snapshot board" + option [value="#"] + "===> Snapshot child one" + option [value="#"] + "===> Snapshot child two" + option [value="#"] + "=> Snapshot empty board" + p + "Move topics not posted in for" + input [name="maxdays" size="#" type="number" value="#"] + "days. (Enter # to(s) move all topics)" + p + label [for="move_type_locked"] + input#move_type_locked [checked name="move_type_locked" type="checkbox"] + "Locked topics" + br + label [for="move_type_sticky"] + input#move_type_sticky [name="move_type_sticky" type="checkbox"] + "Sticky topics" + br + input.button [onclick="if (document.getElementById('id_board_from').options[document.getElementById('id_board_from').selectedIndex].disabled || document.getElementById('id_board_from').options[document.getElementById('id_board_to').selectedIndex].disabled) return false; var confirmText = 'Are you sure you want to move ALL the topics from \"%board_from%\" to \"%board_to%\"?'; return confirm(confirmText.replace(/%board_from%/, document.getElementById('id_board_from').options[document.getElementById('id_board_from').selectedIndex].text.replace(/^=+> /, '')).replace(/%board_to%/, document.getElementById('id_board_to').options[document.getElementById('id_board_to').selectedIndex].text.replace(/^=+> /, '')));" type="submit" value="Move now"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards.txt b/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards.txt new file mode 100644 index 00000000000..352c408d0b2 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards.txt @@ -0,0 +1,108 @@ +status 200 +@ title +title + "Manage Boards and Categories" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageboards;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Boards and Categories" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=main;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Modify Boards" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=manage_boards" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Manage Boards and Categories" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Edit your categories and boards here. List multiple moderators as" + em + "\"username\", \"username\"" + ". (these must be usernames and *not* display names)" + br + "To create a new board, click the Add Board button. To make the new board a sub-board of a current board, select \"Sub-board of...\" from the Order drop down menu when creating the board." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Manage Boards and Categories Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Manage Boards and Categories Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a.active [href="{boardurl}/index.php?action=admin;area=manageboards;sa=main;{session_var}={session_id}"] + "Modify Boards" + li + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=newcat;{session_var}={session_id}"] + "Create new category" + li + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=settings;{session_var}={session_id}"] + "Settings" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + div#manage_boards + div.cat_bar + h3.catbg + "Modify Boards" + div.windowbg + div.sub_bar + h3.subbg + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=cat;cat=#"] + "Snapshot fixtures" + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=cat;cat=#"] + "(modify)" + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=manageboards;sa=newboard;cat=#" method="post"] + ul#category_#.nolist + li.windowbg [style="padding-inline-start: #px;"] + span.floatleft + a [href="{boardurl}/index.php?board=#.#"] + "{board}" + span.floatright + a.button [href="{boardurl}/index.php?action=admin;area=permissions;sa=index;pid=#;{session_var}={session_id}"] + "permissions" + a.button [href="{boardurl}/index.php?action=admin;area=manageboards;move=#"] + "move" + a.button [href="{boardurl}/index.php?action=admin;area=manageboards;sa=board;boardid=#"] + "modify" + br [style="clear: right;"] + input.button [type="submit" value="Add Board"] + input [name="{session_var}" type="hidden" value="{session_id}"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_edit_board.txt b/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_edit_board.txt new file mode 100644 index 00000000000..ba04c34ecb7 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_edit_board.txt @@ -0,0 +1,280 @@ +status 200 +@ title +title + "Modify Boards" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageboards;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Boards and Categories" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=main;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Modify Boards" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=manage_boards" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Manage Boards and Categories" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Edit your categories and boards here. List multiple moderators as" + em + "\"username\", \"username\"" + ". (these must be usernames and *not* display names)" + br + "To create a new board, click the Add Board button. To make the new board a sub-board of a current board, select \"Sub-board of...\" from the Order drop down menu when creating the board." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Manage Boards and Categories Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Manage Boards and Categories Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a.active [href="{boardurl}/index.php?action=admin;area=manageboards;sa=main;{session_var}={session_id}"] + "Modify Boards" + li + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=newcat;{session_var}={session_id}"] + "Create new category" + li + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=settings;{session_var}={session_id}"] + "Settings" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + div#manage_boards + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=manageboards;sa=board#" method="post"] + input [name="boardid" type="hidden" value="#"] + div.cat_bar + h3.catbg + "Modify Boards" + div.windowbg + dl.settings + dt + strong + "Category" + dd + select [name="new_cat" onchange="if (this.form.order) {this.form.order.disabled = this.options[this.selectedIndex].value != #; this.form.board_order.disabled = this.options[this.selectedIndex].value != # || this.form.order.options[this.form.order.selectedIndex].value == '';}"] + option [selected value="#"] + "Snapshot fixtures" + dt + strong + "Order" + dd + select#order [name="placement" onchange="this.form.board_order.disabled = this.options[this.selectedIndex].value == '';"] + option [value] + "(Unchanged)" + option [value="after"] + "After ..." + option [value="child"] + "Sub-board of ..." + option [value="before"] + "Before ..." + select#board_order [disabled name="board_order"] + option [value] + "(Unchanged)" + option [selected value="#"] + "(Current Position)" + option [value="#"] + "- Snapshot child one" + option [value="#"] + "- Snapshot child two" + option [value="#"] + "Snapshot empty board" + dt + strong + "Full name" + br + span.smalltext + "This is the name that will be displayed." + dd + input [name="board_name" size="#" type="text" value="Snapshot board"] + dt + strong + "Description" + br + span.smalltext + "A short description of your board. HTML is not allowed, you can use the following BBC tags: abbr, anchor, b, br, center, color, font, hr, i, img, iurl, left, li, list, ltr, pre, right, s, sub, sup, table, td, tr, u, url" + dd + textarea [cols="#" name="desc" rows="#"] + "Topics, replies and a poll for the snapshot tests." + dt + strong + "Permission Profile" + br + span.smalltext + "Which" + a [href="{boardurl}/index.php?action=admin;area=permissions;sa=profiles;{session_var}={session_id}"] + "permission set" + "the board should use." + dd + select [name="profile"] + option [selected value="#"] + "Default" + option [value="#"] + "No Polls" + option [value="#"] + "Read Only" + option [value="#"] + "Reply Only" + dt + strong + "Allowed Groups" + br + span.smalltext + "Groups allowed to access this board." + br + em + "Note: if the member is in any group or post group checked, they will have access to this board." + dd + label [for="groups_-#"] + input#groups_-# [checked name="groups[-#]" type="checkbox" value="allow"] + span + "Guests" + br + label [for="groups_#"] + input#groups_# [checked name="groups[#]" type="checkbox" value="allow"] + span.regular_members [title="This group contains all members that have no primary group set."] + "Regular Members" + br + label [for="groups_#"] + input#groups_# [name="groups[#]" type="checkbox" value="allow"] + span + "Global Moderator" + br + label [for="groups_#"] + input#groups_# [name="groups[#]" type="checkbox" value="allow"] + span.post_group [title="This group is a post count based group."] + "Newbie" + br + label [for="groups_#"] + input#groups_# [name="groups[#]" type="checkbox" value="allow"] + span.post_group [title="This group is a post count based group."] + "Jr. Member" + br + label [for="groups_#"] + input#groups_# [name="groups[#]" type="checkbox" value="allow"] + span.post_group [title="This group is a post count based group."] + "Full Member" + br + label [for="groups_#"] + input#groups_# [name="groups[#]" type="checkbox" value="allow"] + span.post_group [title="This group is a post count based group."] + "Sr. Member" + br + label [for="groups_#"] + input#groups_# [name="groups[#]" type="checkbox" value="allow"] + span.post_group [title="This group is a post count based group."] + "Hero Member" + br + span.select_all_box + em + "Select all" + input [onclick="invertAll(this, this.form, 'groups[');" type="checkbox"] + br + dt + strong + "Moderators" + br + span.smalltext + "Additional members to have moderation privileges on this board. Note that administrators do not have to be listed here." + br + dd + input#moderators [name="moderators" size="#" type="text" value] + div#moderator_container + dt + strong + "Moderator Groups" + br + span.smalltext + "Groups whose members have moderation privileges on this board. Note that this is limited to groups which are not post-based and not \"hidden\"." + br + dd + input#moderator_groups [name="moderator_groups" size="#" type="text" value] + div#moderator_group_container + script + | $(document).ready(function () { $(".select_all_box").each(function () { $(this).removeClass('select_all_box'); }); }); + hr + div#count_posts_div + dl.settings + dt + strong + "Count posts" + br + span.smalltext + "Makes new replies and topics raise members’ post counts." + br + dd + input [checked name="count" type="checkbox"] + div#board_theme_div + dl.settings + dt + strong + "Board Theme" + br + span.smalltext + "This allows you to change the look of your forum only inside this board." + br + dd + select#boardtheme [name="boardtheme" onchange="refreshOptions();"] + option [selected value="#"] + "(overall forum default.)" + option [value="#"] + "SMF Default Theme - Curve#" + div#override_theme_div + dl.settings + dt + strong + "Override Member’s Theme" + br + span.smalltext + "Use this board’s theme even if the member did not choose to use the defaults." + br + dd + input [name="override_theme" type="checkbox"] + input [name="rid" type="hidden" value="boards"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] + input.button [name="edit" onclick="return !isEmptyText(this.form.board_name);" type="submit" value="Modify"] + input.button.you_sure [data-confirm="Do you really want to delete this board?" name="delete" type="submit" value="Delete Board"] + script + | var oModeratorSuggest = new smc_AutoSuggest({ sSessionId: smf_session_id, sSessionVar: smf_session_var, sSuggestId: 'moderators', sControlId: 'moderators', sSearchType: 'member', bItemList: true, sPostName: 'moderator_list', sURLMask: 'action=profile;u=%item_id%', sTextDeleteItem: 'Delete Item', sItemListContainerId: 'moderator_container', aListItems: [ ] }); var oModeratorGroupSuggest = new smc_AutoSuggest({ sSessionId: smf_session_id, sSessionVar: smf_session_var, sSuggestId: 'moderator_groups', sControlId: 'moderator_groups', sSearchType: 'membergroups', bItemList: true, sPostName: 'moderator_group_list', sURLMask: 'action=groups;sa=members;group=%item_id%', sTextDeleteItem: 'Delete Item', sItemListContainerId: 'moderator_group_container', aListItems: [ ] }); + script + | function refreshOptions() { var redirect = document.getElementById("redirect_enable"); var redirectEnabled = redirect ? redirect.checked : false; var nonDefaultTheme = document.getElementById("boardtheme").value == # ? false : true; // What to show? if(redirectEnabled || !nonDefaultTheme) document.getElementById("override_theme_div").classList.add('hidden'); else document.getElementById("override_theme_div").classList.remove('hidden'); if(redirectEnabled) { document.getElementById("board_theme_div").classList.add('hidden'); document.getElementById("count_posts_div").classList.add('hidden'); } else { document.getElementById("board_theme_div").classList.remove('hidden'); document.getElementById("count_posts_div").classList.remove('hidden'); } } refreshOptions(); diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_edit_category.txt b/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_edit_category.txt new file mode 100644 index 00000000000..f66a0890874 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_edit_category.txt @@ -0,0 +1,123 @@ +status 200 +@ title +title + "Edit Category" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageboards;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Boards and Categories" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=main;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Modify Boards" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=manage_boards" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Manage Boards and Categories" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Edit your categories and boards here. List multiple moderators as" + em + "\"username\", \"username\"" + ". (these must be usernames and *not* display names)" + br + "To create a new board, click the Add Board button. To make the new board a sub-board of a current board, select \"Sub-board of...\" from the Order drop down menu when creating the board." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Manage Boards and Categories Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Manage Boards and Categories Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a.active [href="{boardurl}/index.php?action=admin;area=manageboards;sa=main;{session_var}={session_id}"] + "Modify Boards" + li + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=newcat;{session_var}={session_id}"] + "Create new category" + li + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=settings;{session_var}={session_id}"] + "Settings" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + div#manage_boards + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=manageboards;sa=cat#" method="post"] + input [name="cat" type="hidden" value="#"] + div.cat_bar + h3.catbg + "Edit Category" + div.windowbg + dl.settings + dt + strong + "Order" + dd + select [name="cat_order"] + dt + strong + "Full name" + br + span.smalltext + "This is the name that will be displayed." + dd + input [name="cat_name" size="#" type="text" value="Snapshot fixtures"] + dt + strong + "Description" + br + span.smalltext + "A short description of your category. HTML is not allowed, you can use the following BBC tags: abbr, anchor, b, br, center, color, font, hr, i, img, iurl, left, li, list, ltr, pre, right, s, sub, sup, table, td, tr, u, url" + dd + textarea [cols="#" name="cat_desc" rows="#"] + "Content for the template snapshot tests." + dt + strong + "Collapsible" + br + span.smalltext + "Allow users to collapse this category" + dd + input [checked name="collapse" type="checkbox"] + input.button [name="edit" onclick="return !isEmptyText(this.form.cat_name);" type="submit" value="Modify"] + input.button.you_sure [data-confirm="Do you really want to delete this category?" name="delete" type="submit" value="Delete Category"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_move.txt b/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_move.txt new file mode 100644 index 00000000000..d5630aa3b61 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_move.txt @@ -0,0 +1,171 @@ +status 200 +@ title +title + "Manage Boards and Categories" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageboards;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Boards and Categories" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=main;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Modify Boards" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=manage_boards" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Manage Boards and Categories" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Edit your categories and boards here. List multiple moderators as" + em + "\"username\", \"username\"" + ". (these must be usernames and *not* display names)" + br + "To create a new board, click the Add Board button. To make the new board a sub-board of a current board, select \"Sub-board of...\" from the Order drop down menu when creating the board." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Manage Boards and Categories Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Manage Boards and Categories Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a.active [href="{boardurl}/index.php?action=admin;area=manageboards;sa=main;{session_var}={session_id}"] + "Modify Boards" + li + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=newcat;{session_var}={session_id}"] + "Create new category" + li + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=settings;{session_var}={session_id}"] + "Settings" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + div#manage_boards + div.cat_bar + h3.catbg + "Modify Boards" + div.windowbg + div.noticebox + "Select destination for board \"" + strong + "{board}" + "\" [" + a [href="{boardurl}/index.php?action=admin;area=manageboards"] + "Cancel moving" + "]" + div.sub_bar + h3.subbg + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=cat;cat=#"] + "Snapshot fixtures" + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=cat;cat=#"] + "(modify)" + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=manageboards;sa=newboard;cat=#" method="post"] + ul#category_#.nolist + li + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=move;src_board=#;target_board=#;move_to=before;{session_var}={session_id};{token}" title="Before {board}"] + span.main_icons.select_above + li.windowbg [style="padding-inline-start: #px;"] + span.floatleft + a [href="{boardurl}/index.php?board=#.#"] + "{board}" + span.floatright + a.button [href="{boardurl}/index.php?action=admin;area=permissions;sa=index;pid=#;{session_var}={session_id}"] + "permissions" + a.button [href="{boardurl}/index.php?action=admin;area=manageboards;move=#"] + "move" + a.button [href="{boardurl}/index.php?action=admin;area=manageboards;sa=board;boardid=#"] + "modify" + br [style="clear: right;"] + li.windowbg [style="padding-inline-start: #px;"] + a.move_links [href="{boardurl}/index.php?action=admin;area=manageboards;sa=move;src_board=#;target_board=#;move_to=child;{session_var}={session_id};{token}" title="Sub-board of {board}"] + span.main_icons.select_here [title="Sub-board of {board}"] + li.windowbg [style="padding-inline-start: #px;"] + span.floatleft + a [href="{boardurl}/index.php?board=#.#"] + "{board}" + span.floatright + a.button [href="{boardurl}/index.php?action=admin;area=permissions;sa=index;pid=#;{session_var}={session_id}"] + "permissions" + a.button [href="{boardurl}/index.php?action=admin;area=manageboards;move=#"] + "move" + a.button [href="{boardurl}/index.php?action=admin;area=manageboards;sa=board;boardid=#"] + "modify" + br [style="clear: right;"] + li.windowbg [style="padding-inline-start: #px;"] + a.move_links [href="{boardurl}/index.php?action=admin;area=manageboards;sa=move;src_board=#;target_board=#;move_to=after;{session_var}={session_id};{token}" title="After {board}"] + span.main_icons.select_above [title="After {board}"] + a.move_links [href="{boardurl}/index.php?action=admin;area=manageboards;sa=move;src_board=#;target_board=#;move_to=child;{session_var}={session_id};{token}" title="Sub-board of {board}"] + span.main_icons.select_here [title="Sub-board of {board}"] + li.windowbg [style="padding-inline-start: #px;"] + span.floatleft + a.red [href="{boardurl}/index.php?board=#.#"] + "{board}" + span.floatright + a.button [href="{boardurl}/index.php?action=admin;area=permissions;sa=index;pid=#;{session_var}={session_id}"] + "permissions" + a.button [href="{boardurl}/index.php?action=admin;area=manageboards;move=#"] + "move" + a.button [href="{boardurl}/index.php?action=admin;area=manageboards;sa=board;boardid=#"] + "modify" + br [style="clear: right;"] + li.windowbg [style="padding-inline-start: #px;"] + a.move_links [href="{boardurl}/index.php?action=admin;area=manageboards;sa=move;src_board=#;target_board=#;move_to=after;{session_var}={session_id};{token}" title="After {board}"] + span.main_icons.select_below [title="After {board}"] + li.windowbg [style="padding-inline-start: #px;"] + span.floatleft + a [href="{boardurl}/index.php?board=#.#"] + "{board}" + span.floatright + a.button [href="{boardurl}/index.php?action=admin;area=permissions;sa=index;pid=#;{session_var}={session_id}"] + "permissions" + a.button [href="{boardurl}/index.php?action=admin;area=manageboards;move=#"] + "move" + a.button [href="{boardurl}/index.php?action=admin;area=manageboards;sa=board;boardid=#"] + "modify" + br [style="clear: right;"] + li.windowbg [style="padding-inline-start: #px;"] + a.move_links [href="{boardurl}/index.php?action=admin;area=manageboards;sa=move;src_board=#;target_board=#;move_to=after;{session_var}={session_id};{token}" title="After {board}"] + span.main_icons.select_below [title="After {board}"] + a.move_links [href="{boardurl}/index.php?action=admin;area=manageboards;sa=move;src_board=#;target_board=#;move_to=child;{session_var}={session_id};{token}" title="Sub-board of {board}"] + span.main_icons.select_here [title="Sub-board of {board}"] + input.button [type="submit" value="Add Board"] + input [name="{session_var}" type="hidden" value="{session_id}"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_new_board.txt b/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_new_board.txt new file mode 100644 index 00000000000..c2aeea7eaeb --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_new_board.txt @@ -0,0 +1,299 @@ +status 200 +@ title +title + "Modify Boards" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageboards;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Boards and Categories" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=main;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Modify Boards" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=manage_boards" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Manage Boards and Categories" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Edit your categories and boards here. List multiple moderators as" + em + "\"username\", \"username\"" + ". (these must be usernames and *not* display names)" + br + "To create a new board, click the Add Board button. To make the new board a sub-board of a current board, select \"Sub-board of...\" from the Order drop down menu when creating the board." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Manage Boards and Categories Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Manage Boards and Categories Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a.active [href="{boardurl}/index.php?action=admin;area=manageboards;sa=main;{session_var}={session_id}"] + "Modify Boards" + li + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=newcat;{session_var}={session_id}"] + "Create new category" + li + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=settings;{session_var}={session_id}"] + "Settings" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + div#manage_boards + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=manageboards;sa=board#" method="post"] + input [name="boardid" type="hidden" value="#"] + div.cat_bar + h3.catbg + "New Board" + div.windowbg + dl.settings + dt + strong + "Category" + dd + select [name="new_cat" onchange="if (this.form.order) {this.form.order.disabled = this.options[this.selectedIndex].value != #; this.form.board_order.disabled = this.options[this.selectedIndex].value != # || this.form.order.options[this.form.order.selectedIndex].value == '';}"] + option [selected value="#"] + "Snapshot fixtures" + dt + strong + "Order" + dd + select#order [name="placement" onchange="this.form.board_order.disabled = this.options[this.selectedIndex].value == '';"] + option [value="after"] + "After ..." + option [value="child"] + "Sub-board of ..." + option [value="before"] + "Before ..." + select#board_order [name="board_order"] + option [value="#"] + "Snapshot board" + option [value="#"] + "- Snapshot child one" + option [value="#"] + "- Snapshot child two" + option [value="#"] + "Snapshot empty board" + dt + strong + "Full name" + br + span.smalltext + "This is the name that will be displayed." + dd + input [name="board_name" size="#" type="text" value="New Board"] + dt + strong + "Description" + br + span.smalltext + "A short description of your board. HTML is not allowed, you can use the following BBC tags: abbr, anchor, b, br, center, color, font, hr, i, img, iurl, left, li, list, ltr, pre, right, s, sub, sup, table, td, tr, u, url" + dd + textarea [cols="#" name="desc" rows="#"] + dt + strong + "Permission Profile" + br + span.smalltext + "Which" + a [href="{boardurl}/index.php?action=admin;area=permissions;sa=profiles;{session_var}={session_id}"] + "permission set" + "the board should use." + dd + select [name="profile"] + option [selected value="#"] + "Default" + option [value="#"] + "No Polls" + option [value="#"] + "Read Only" + option [value="#"] + "Reply Only" + option [value="-#"] + "[Inherit from parent board]" + dt + strong + "Allowed Groups" + br + span.smalltext + "Groups allowed to access this board." + br + em + "Note: if the member is in any group or post group checked, they will have access to this board." + dd + label [for="groups_-#"] + input#groups_-# [checked name="groups[-#]" type="checkbox" value="allow"] + span + "Guests" + br + label [for="groups_#"] + input#groups_# [checked name="groups[#]" type="checkbox" value="allow"] + span.regular_members [title="This group contains all members that have no primary group set."] + "Regular Members" + br + label [for="groups_#"] + input#groups_# [name="groups[#]" type="checkbox" value="allow"] + span + "Global Moderator" + br + label [for="groups_#"] + input#groups_# [name="groups[#]" type="checkbox" value="allow"] + span.post_group [title="This group is a post count based group."] + "Newbie" + br + label [for="groups_#"] + input#groups_# [name="groups[#]" type="checkbox" value="allow"] + span.post_group [title="This group is a post count based group."] + "Jr. Member" + br + label [for="groups_#"] + input#groups_# [name="groups[#]" type="checkbox" value="allow"] + span.post_group [title="This group is a post count based group."] + "Full Member" + br + label [for="groups_#"] + input#groups_# [name="groups[#]" type="checkbox" value="allow"] + span.post_group [title="This group is a post count based group."] + "Sr. Member" + br + label [for="groups_#"] + input#groups_# [name="groups[#]" type="checkbox" value="allow"] + span.post_group [title="This group is a post count based group."] + "Hero Member" + br + span.select_all_box + em + "Select all" + input [onclick="invertAll(this, this.form, 'groups[');" type="checkbox"] + br + dt + strong + "Moderators" + br + span.smalltext + "Additional members to have moderation privileges on this board. Note that administrators do not have to be listed here." + br + dd + input#moderators [name="moderators" size="#" type="text" value] + div#moderator_container + dt + strong + "Moderator Groups" + br + span.smalltext + "Groups whose members have moderation privileges on this board. Note that this is limited to groups which are not post-based and not \"hidden\"." + br + dd + input#moderator_groups [name="moderator_groups" size="#" type="text" value] + div#moderator_group_container + script + | $(document).ready(function () { $(".select_all_box").each(function () { $(this).removeClass('select_all_box'); }); }); + hr + dl.settings + dt + strong + "Redirect to a web address" + br + span.smalltext + "Enable this option to redirect anyone who clicks on this board to another web address." + br + dd + input#redirect_enable [name="redirect_enable" onclick="refreshOptions();" type="checkbox"] + div#redirect_address_div + dl.settings + dt + strong + "Address to redirect users to" + br + span.smalltext + "For example: \"https://www.simplemachines.org\"." + br + dd + input [name="redirect_address" size="#" type="text" value] + div#count_posts_div + dl.settings + dt + strong + "Count posts" + br + span.smalltext + "Makes new replies and topics raise members’ post counts." + br + dd + input [checked name="count" type="checkbox"] + div#board_theme_div + dl.settings + dt + strong + "Board Theme" + br + span.smalltext + "This allows you to change the look of your forum only inside this board." + br + dd + select#boardtheme [name="boardtheme" onchange="refreshOptions();"] + option [selected value="#"] + "(overall forum default.)" + option [value="#"] + "SMF Default Theme - Curve#" + div#override_theme_div + dl.settings + dt + strong + "Override Member’s Theme" + br + span.smalltext + "Use this board’s theme even if the member did not choose to use the defaults." + br + dd + input [name="override_theme" type="checkbox"] + input [name="rid" type="hidden" value="boards"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] + input [name="no_children" type="hidden" value="#"] + input [name="cur_cat" type="hidden" value="#"] + input.button [name="add" onclick="return !isEmptyText(this.form.board_name);" type="submit" value="Add Board"] + script + | var oModeratorSuggest = new smc_AutoSuggest({ sSessionId: smf_session_id, sSessionVar: smf_session_var, sSuggestId: 'moderators', sControlId: 'moderators', sSearchType: 'member', bItemList: true, sPostName: 'moderator_list', sURLMask: 'action=profile;u=%item_id%', sTextDeleteItem: 'Delete Item', sItemListContainerId: 'moderator_container', aListItems: [ ] }); var oModeratorGroupSuggest = new smc_AutoSuggest({ sSessionId: smf_session_id, sSessionVar: smf_session_var, sSuggestId: 'moderator_groups', sControlId: 'moderator_groups', sSearchType: 'membergroups', bItemList: true, sPostName: 'moderator_group_list', sURLMask: 'action=groups;sa=members;group=%item_id%', sTextDeleteItem: 'Delete Item', sItemListContainerId: 'moderator_group_container', aListItems: [ ] }); + script + | function refreshOptions() { var redirect = document.getElementById("redirect_enable"); var redirectEnabled = redirect ? redirect.checked : false; var nonDefaultTheme = document.getElementById("boardtheme").value == # ? false : true; // What to show? if(redirectEnabled || !nonDefaultTheme) document.getElementById("override_theme_div").classList.add('hidden'); else document.getElementById("override_theme_div").classList.remove('hidden'); if(redirectEnabled) { document.getElementById("board_theme_div").classList.add('hidden'); document.getElementById("count_posts_div").classList.add('hidden'); } else { document.getElementById("board_theme_div").classList.remove('hidden'); document.getElementById("count_posts_div").classList.remove('hidden'); } if(redirectEnabled) document.getElementById("redirect_address_div").classList.remove('hidden'); else document.getElementById("redirect_address_div").classList.add('hidden'); } refreshOptions(); diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_new_category.txt b/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_new_category.txt new file mode 100644 index 00000000000..83800551088 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_new_category.txt @@ -0,0 +1,124 @@ +status 200 +@ title +title + "New Category" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageboards;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Boards and Categories" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=newcat;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Create new category" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=manage_boards" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Manage Boards and Categories" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Edit your categories and boards here. List multiple moderators as" + em + "\"username\", \"username\"" + ". (these must be usernames and *not* display names)" + br + "To create a new board, click the Add Board button. To make the new board a sub-board of a current board, select \"Sub-board of...\" from the Order drop down menu when creating the board." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Manage Boards and Categories Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Manage Boards and Categories Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=main;{session_var}={session_id}"] + "Modify Boards" + li + a.active [href="{boardurl}/index.php?action=admin;area=manageboards;sa=newcat;{session_var}={session_id}"] + "Create new category" + li + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=settings;{session_var}={session_id}"] + "Settings" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + div#manage_boards + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=manageboards;sa=cat#" method="post"] + input [name="cat" type="hidden" value="#"] + div.cat_bar + h3.catbg + "New Category" + div.windowbg + dl.settings + dt + strong + "Order" + dd + select [name="cat_order"] + option [value="#"] + "After Snapshot fixtures" + dt + strong + "Full name" + br + span.smalltext + "This is the name that will be displayed." + dd + input [name="cat_name" size="#" type="text" value="New Category"] + dt + strong + "Description" + br + span.smalltext + "A short description of your category. HTML is not allowed, you can use the following BBC tags: abbr, anchor, b, br, center, color, font, hr, i, img, iurl, left, li, list, ltr, pre, right, s, sub, sup, table, td, tr, u, url" + dd + textarea [cols="#" name="cat_desc" rows="#"] + dt + strong + "Collapsible" + br + span.smalltext + "Allow users to collapse this category" + dd + input [checked name="collapse" type="checkbox"] + input.button [name="add" onclick="return !isEmptyText(this.form.cat_name);" type="submit" value="Add Category"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] + input [name="empty" type="hidden" value="#"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_settings.txt b/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_settings.txt new file mode 100644 index 00000000000..133a7588d7f --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/manage_boards_settings.txt @@ -0,0 +1,176 @@ +status 200 +@ title +title + "Manage Boards and Categories - Settings" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageboards;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Boards and Categories" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=settings;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Settings" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=manage_boards" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Manage Boards and Categories" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Edit general board and category settings." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Manage Boards and Categories Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Manage Boards and Categories Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=main;{session_var}={session_id}"] + "Modify Boards" + li + a [href="{boardurl}/index.php?action=admin;area=manageboards;sa=newcat;{session_var}={session_id}"] + "Create new category" + li + a.active [href="{boardurl}/index.php?action=admin;area=manageboards;sa=settings;{session_var}={session_id}"] + "Settings" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + form#admin_form_wrapper [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=manageboards;save;sa=settings" method="post" onsubmit="if(document.getElementById('recycle_enable').checked && document.getElementById('recycle_board').value == #) { return confirm('You have enabled the recycling of topics without specifying a board to place them in. This feature will not be enabled until you specify a board to place recycled topics into.');} return true;"] + div.cat_bar + h3.catbg + "Settings" + div.noup.windowbg + dl.settings + dt + a#setting_manage_boards_help [href="{boardurl}/index.php?action=helpadmin;help=manage_boards" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_manage_boards + span + label + "Membergroups allowed to manage boards and categories" + dd + fieldset#manage_boards + legend + a.toggle_up [href="javascript:void(#);" onclick="document.getElementById('manage_boards').style.display = 'none';document.getElementById('manage_boards_groups_link').style.display = 'block'; return false;"] + "Select permissions for each group" + ul + li + input [name="manage_boards[#]" type="checkbox" value="on"] + span + "Regular Members" + li + input [name="manage_boards[#]" type="checkbox" value="on"] + span + "Global Moderator" + li + input [onclick="invertAll(this, this.form, 'manage_boards[');" type="checkbox"] + span + "Select all" + a#manage_boards_groups_link.toggle_down [href="javascript:void(#);" onclick="document.getElementById('manage_boards').style.display = 'block'; document.getElementById('manage_boards_groups_link').style.display = 'none'; return false;" style="display: none;"] + "Select permissions for each group" + script + | document.getElementById("manage_boards").style.display = "none"; document.getElementById("manage_boards_groups_link").style.display = ""; + hr + dl.settings + dt + a#setting_boardindex_max_depth_help [href="{boardurl}/index.php?action=helpadmin;help=boardindex_max_depth" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_boardindex_max_depth + span + label [for="boardindex_max_depth"] + "Maximum depth of sub-boards to check for new posts, etc." + dd + input#boardindex_max_depth [max="#" min="#" name="boardindex_max_depth" size="#" step="#" type="number" value="#"] + dt + a#setting_countChildPosts_help [href="{boardurl}/index.php?action=helpadmin;help=countChildPosts" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_countChildPosts + span + label [for="countChildPosts"] + "Count sub-board’s posts in parent’s totals" + dd + input#countChildPosts [name="countChildPosts" type="checkbox" value="#"] + dt + a#setting_recycle_enable_help [href="{boardurl}/index.php?action=helpadmin;help=recycle_enable" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_recycle_enable + span + label [for="recycle_enable"] + "Enable recycling of deleted topics" + dd + input#recycle_enable [name="recycle_enable" onclick="document.getElementById('recycle_board').disabled = !this.checked;" type="checkbox" value="#"] + dt + a#setting_recycle_board + span + label [for="recycle_board"] + "Board for recycled topics" + dd + select#recycle_board [name="recycle_board" size="#"] + option [value="#"] + "Snapshot fixtures - Snapshot board" + option [value="#"] + "Snapshot fixtures - Snapshot child one" + option [value="#"] + "Snapshot fixtures - Snapshot child two" + option [value="#"] + "Snapshot fixtures - Snapshot empty board" + dt + a#setting_allow_ignore_boards_help [href="{boardurl}/index.php?action=helpadmin;help=allow_ignore_boards" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_allow_ignore_boards + span + label [for="allow_ignore_boards"] + "Allow boards to be ignored" + dd + input#allow_ignore_boards [name="allow_ignore_boards" type="checkbox" value="#"] + dt + a#setting_deny_boards_access_help [href="{boardurl}/index.php?action=helpadmin;help=deny_boards_access" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_deny_boards_access + span + label [for="deny_boards_access"] + "Enable the option to deny board access based on membergroup" + dd + input#deny_boards_access [name="deny_boards_access" type="checkbox" value="#"] + input.button [type="submit" value="Save"] + input [name="{token_var}" type="hidden" value="{hash}"] + input [name="{session_var}" type="hidden" value="{session_id}"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/manage_calendar.txt b/tests/Integration/Http/Snapshot/snapshots/admin/manage_calendar.txt new file mode 100644 index 00000000000..df46479d5d1 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/manage_calendar.txt @@ -0,0 +1,64 @@ +status 200 +@ title +title + "Calendar Settings" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=managecalendar;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Calendar" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=calendar" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Calendar" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Here you can enable the calendar, and determine the settings that it should use." + form#admin_form_wrapper [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=managecalendar;save;sa=settings" method="post"] + div.cat_bar + h3.catbg + "Calendar Settings" + div.noup.windowbg + dl.settings + dt + a#setting_cal_enabled_help [href="{boardurl}/index.php?action=helpadmin;help=cal_enabled" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_cal_enabled + span + label [for="cal_enabled"] + "Enable the calendar" + dd + input#cal_enabled [name="cal_enabled" type="checkbox" value="#"] + input.button [type="submit" value="Save"] + input [name="{token_var}" type="hidden" value="{hash}"] + input [name="{session_var}" type="hidden" value="{session_id}"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/manage_search.txt b/tests/Integration/Http/Snapshot/snapshots/admin/manage_search.txt new file mode 100644 index 00000000000..0088155e44e --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/manage_search.txt @@ -0,0 +1,133 @@ +status 200 +@ title +title + "Search - method" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=managesearch;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Search" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=managesearch;sa=method;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Search Method" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=search" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Search" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Here you can set the way search is powered." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Search Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Search Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a [href="{boardurl}/index.php?action=admin;area=managesearch;sa=weights;{session_var}={session_id}"] + "Weights" + li + a.active [href="{boardurl}/index.php?action=admin;area=managesearch;sa=method;{session_var}={session_id}"] + "Search Method" + li + a [href="{boardurl}/index.php?action=admin;area=managesearch;sa=settings;{session_var}={session_id}"] + "Settings" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + div.cat_bar + h3.catbg + "Search Method" + div.information + div.smalltext + a [href="{boardurl}/index.php?action=helpadmin;help=search_why_use_index" onclick="return reqOverlayDiv(this.href);"] + "Why create a search index?" + form#admin_form_wrapper [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=managesearch;sa=method" method="post"] + div.cat_bar + h3.catbg + "Search Method" + div.windowbg + dl.settings + dt + strong + "Space used by forum messages in the database" + dd + "# KB(s)" + dt + strong + "Space used to index messages in the database" + dd + "# KB(s)" + fieldset.floatleft.search_settings + legend + "Search index" + dl + dt + label + input [checked name="search_index" type="radio" value] + "No index" + hr + dt + label + input [name="search_index" onclick="alert('In order to be able to use this search index, you must first create it.'); return false;" type="radio" value="parsed"] + "Parsed index" + dd + span.smalltext + "An optimized index tailored specifically for SMF." + br + "Parsed index does not currently exist" + a.button [href="{boardurl}/index.php?action=admin;area=managesearch;sa=createparsed;{session_var}={session_id};{token}"] + "Create" + fieldset.floatright.search_settings + legend + "Search Method" + input#search_force_index_check [name="search_force_index" type="checkbox" value="#"] + label [for="search_force_index_check"] + "Force the use of a search index" + br + input#search_match_words_check [name="search_match_words" type="checkbox" value="#"] + label [for="search_match_words_check"] + "Match whole words only" + br.clear + input.button [name="save" type="submit" value="Save"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/manage_search_settings.txt b/tests/Integration/Http/Snapshot/snapshots/admin/manage_search_settings.txt new file mode 100644 index 00000000000..704db0b346f --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/manage_search_settings.txt @@ -0,0 +1,243 @@ +status 200 +@ title +title + "Search Settings" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=managesearch;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Search" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=managesearch;sa=settings;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Settings" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=search" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Search" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Here you can changes the basic settings of the search function." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Search Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Search Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a [href="{boardurl}/index.php?action=admin;area=managesearch;sa=weights;{session_var}={session_id}"] + "Weights" + li + a [href="{boardurl}/index.php?action=admin;area=managesearch;sa=method;{session_var}={session_id}"] + "Search Method" + li + a.active [href="{boardurl}/index.php?action=admin;area=managesearch;sa=settings;{session_var}={session_id}"] + "Settings" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + form#admin_form_wrapper [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=managesearch;save;sa=settings" method="post"] + div.cat_bar + h3.catbg + "Search Settings" + div.noup.windowbg + dl.settings + dt + a#setting_search_posts + span + label + "Membergroups with access to the search function" + dd + fieldset#search_posts + legend + a.toggle_up [href="javascript:void(#);" onclick="document.getElementById('search_posts').style.display = 'none';document.getElementById('search_posts_groups_link').style.display = 'block'; return false;"] + "Select permissions for each group" + ul + li + input [checked name="search_posts[#]" type="checkbox" value="on"] + span + "Regular Members" + li + input [checked name="search_posts[-#]" type="checkbox" value="on"] + span + "Guests" + li + input [checked name="search_posts[#]" type="checkbox" value="on"] + span + "Global Moderator" + li + input [onclick="invertAll(this, this.form, 'search_posts[');" type="checkbox"] + span + "Select all" + a#search_posts_groups_link.toggle_down [href="javascript:void(#);" onclick="document.getElementById('search_posts').style.display = 'block'; document.getElementById('search_posts_groups_link').style.display = 'none'; return false;" style="display: none;"] + "Select permissions for each group" + script + | document.getElementById("search_posts").style.display = "none"; document.getElementById("search_posts_groups_link").style.display = ""; + dt + a#setting_search_results_per_page + span + label [for="search_results_per_page"] + "Number of search results per page" + dd + input#search_results_per_page [min="#" name="search_results_per_page" size="#" type="number" value="#"] + dt + a#setting_search_max_results + span + label [for="search_max_results"] + "Maximum results to show" + br + span.smalltext + "(#: no limit)" + dd + input#search_max_results [min="#" name="search_max_results" size="#" type="number" value="#"] + hr + dl.settings + dt + a#setting_search_floodcontrol_time + span + label [for="search_floodcontrol_time"] + "Time required between searches from same user" + br + span.smalltext + "(# for(s) no limit, in seconds)" + dd + input#search_floodcontrol_time [min="#" name="search_floodcontrol_time" size="#" type="number" value="#"] + "seconds" + hr + dl.settings + dt + a#setting_search_stopwords_custom + span + label [for="search_stopwords_custom"] + "Words to ignore when searching" + br + span.smalltext + span.block.infobox + "The following words are always ignored:" + br + code.bbc_tt + "a" + "," + code.bbc_tt + "about" + "," + code.bbc_tt + "an" + "," + code.bbc_tt + "are" + "," + code.bbc_tt + "as" + "," + code.bbc_tt + "at" + "," + code.bbc_tt + "be" + "," + code.bbc_tt + "by" + "," + code.bbc_tt + "for" + "," + code.bbc_tt + "from" + "," + code.bbc_tt + "how" + "," + code.bbc_tt + "in" + "," + code.bbc_tt + "is" + "," + code.bbc_tt + "it" + "," + code.bbc_tt + "of" + "," + code.bbc_tt + "on" + "," + code.bbc_tt + "or" + "," + code.bbc_tt + "that" + "," + code.bbc_tt + "the" + "," + code.bbc_tt + "this" + "," + code.bbc_tt + "to" + "," + code.bbc_tt + "was" + "," + code.bbc_tt + "what" + "," + code.bbc_tt + "when" + "," + code.bbc_tt + "where" + "," + code.bbc_tt + "who" + "," + code.bbc_tt + "will" + "," + code.bbc_tt + "with" + dd + textarea#search_stopwords_custom [cols="#" name="search_stopwords_custom" rows="#"] + input.button [type="submit" value="Save"] + input [name="{token_var}" type="hidden" value="{hash}"] + input [name="{session_var}" type="hidden" value="{session_id}"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/manage_search_weights.txt b/tests/Integration/Http/Snapshot/snapshots/admin/manage_search_weights.txt new file mode 100644 index 00000000000..4430ce24e5f --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/manage_search_weights.txt @@ -0,0 +1,155 @@ +status 200 +@ title +title + "Search - weights" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=managesearch;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Search" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=managesearch;sa=weights;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Weights" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=search" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Search" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Here you can change the individual components of the relevance rating." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Search Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Search Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a.active [href="{boardurl}/index.php?action=admin;area=managesearch;sa=weights;{session_var}={session_id}"] + "Weights" + li + a [href="{boardurl}/index.php?action=admin;area=managesearch;sa=method;{session_var}={session_id}"] + "Search Method" + li + a [href="{boardurl}/index.php?action=admin;area=managesearch;sa=settings;{session_var}={session_id}"] + "Settings" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + form#admin_form_wrapper [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=managesearch;sa=weights" method="post"] + div.cat_bar + h3.catbg + "Weights" + div.windowbg + dl.settings + dt + a.help [href="{boardurl}/index.php?action=helpadmin;help=search_weight_frequency" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + label [for="weight#_val"] + "Relative search weight for number of matching messages within a topic" + dd + span.search_weight + input#weight#_val [name="search_weight_frequency" onchange="calculateNewValues()" size="#" type="text" value="#"] + span#weight#.search_weight + "#%" + dt + a.help [href="{boardurl}/index.php?action=helpadmin;help=search_weight_age" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + label [for="weight#_val"] + "Relative search weight for age of last matching message" + dd + span.search_weight + input#weight#_val [name="search_weight_age" onchange="calculateNewValues()" size="#" type="text" value="#"] + span#weight#.search_weight + "#%" + dt + a.help [href="{boardurl}/index.php?action=helpadmin;help=search_weight_length" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + label [for="weight#_val"] + "Relative search weight for topic length" + dd + span.search_weight + input#weight#_val [name="search_weight_length" onchange="calculateNewValues()" size="#" type="text" value="#"] + span#weight#.search_weight + "#%" + dt + a.help [href="{boardurl}/index.php?action=helpadmin;help=search_weight_subject" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + label [for="weight#_val"] + "Relative search weight for a matching subject" + dd + span.search_weight + input#weight#_val [name="search_weight_subject" onchange="calculateNewValues()" size="#" type="text" value="#"] + span#weight#.search_weight + "#%" + dt + a.help [href="{boardurl}/index.php?action=helpadmin;help=search_weight_first_message" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + label [for="weight#_val"] + "Relative search weight for a first message match" + dd + span.search_weight + input#weight#_val [name="search_weight_first_message" onchange="calculateNewValues()" size="#" type="text" value="#"] + span#weight#.search_weight + "#%" + dt + a.help [href="{boardurl}/index.php?action=helpadmin;help=search_weight_sticky" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + label [for="weight#_val"] + "Relative search weight for a sticky topic" + dd + span.search_weight + input#weight#_val [name="search_weight_sticky" onchange="calculateNewValues()" size="#" type="text" value="#"] + span#weight#.search_weight + "#%" + dt + strong + "Total" + dd + span#weighttotal.search_weight + strong + "#" + span.search_weight + strong + "#%" + input.button [name="save" type="submit" value="Save"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/membergroups.txt b/tests/Integration/Http/Snapshot/snapshots/admin/membergroups.txt new file mode 100644 index 00000000000..04528ccf524 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/membergroups.txt @@ -0,0 +1,233 @@ +status 200 +@ title +title + "Manage Membergroups" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=membergroups;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Membergroups" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=index;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Edit membergroups" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=membergroups" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Manage Membergroups" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Membergroups are groups of members that have similar permission settings, appearance, or access rights. Some membergroups are based on the amount of posts a user has made. You can assign someone to a membergroup by selecting their profile and changing their account settings." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Manage Membergroups Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Manage Membergroups Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a.active [href="{boardurl}/index.php?action=admin;area=membergroups;sa=index;{session_var}={session_id}"] + "Edit membergroups" + li + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=add;{session_var}={session_id}"] + "Add membergroup" + li + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=settings;{session_var}={session_id}"] + "Settings" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + div.cat_bar + h3.catbg + "Regular groups" + div.additional_row + a.button [href="{boardurl}/index.php?action=admin;area=membergroups;sa=add;generalgroup"] + "Add group" + table#regular_membergroups_list.table_grid + thead + tr.title_bar + th#header_regular_membergroups_list_name.name [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=membergroups;sort=name;desc" rel="nofollow"] + "Name" + span.main_icons.sort_up + th#header_regular_membergroups_list_icons.icons [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=membergroups;sort=icons" rel="nofollow"] + "Icons" + th#header_regular_membergroups_list_members.centercol.members [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=membergroups;sort=members" rel="nofollow"] + "Members" + th#header_regular_membergroups_list_modify.centercol.modify [scope="col"] + "Modify" + tbody + tr#list_regular_membergroups_list_#.windowbg + td.name + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=members;group=#" style="color: #FF#;"] + "Administrator" + "(" + a [href="{boardurl}/index.php?action=helpadmin;help=membergroup_administrator" onclick="return reqOverlayDiv(this.href);"] + "?" + ")" + td.icons + img [alt="*" src="{boardurl}/Themes/default/images/membericons/iconadmin.png"] + td.centercol.members + "#" + td.centercol.modify + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=edit;group=#"] + "Modify" + tr#list_regular_membergroups_list_#.windowbg + td.name + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=members;group=#" style="color: ##FF;"] + "Global Moderator" + td.icons + img [alt="*" src="{boardurl}/Themes/default/images/membericons/icongmod.png"] + td.centercol.members + "#" + td.centercol.modify + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=edit;group=#"] + "Modify" + tr#list_regular_membergroups_list_#.windowbg + td.name + "Moderator (" + a [href="{boardurl}/index.php?action=helpadmin;help=membergroup_moderator" onclick="return reqOverlayDiv(this.href);"] + "?" + ")" + td.icons + img [alt="*" src="{boardurl}/Themes/default/images/membericons/iconmod.png"] + td.centercol.members + "n/a" + td.centercol.modify + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=edit;group=#"] + "Modify" + div.flow_auto + div.additional_row + a.button [href="{boardurl}/index.php?action=admin;area=membergroups;sa=add;generalgroup"] + "Add group" + br + div.cat_bar + h3.catbg + "Post count based groups" + table#post_count_membergroups_list.table_grid + thead + tr.title_bar + th#header_post_count_membergroups_list_name.name [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=membergroups;sort#=name" rel="nofollow"] + "Name" + th#header_post_count_membergroups_list_icons.icons [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=membergroups;sort#=icons" rel="nofollow"] + "Icons" + th#header_post_count_membergroups_list_members.centercol.members [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=membergroups;sort#=members" rel="nofollow"] + "Members" + th#header_post_count_membergroups_list_required_posts.centercol.required_posts [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=membergroups;sort#=required_posts;desc#" rel="nofollow"] + "Required posts" + span.main_icons.sort_up + th#header_post_count_membergroups_list_modify.centercol.modify [scope="col"] + "Modify" + tbody + tr#list_post_count_membergroups_list_#.windowbg + td.name + a [href="{boardurl}/index.php?action=moderate;area=viewgroups;sa=members;group=#"] + "Newbie" + td.icons + img [alt="*" src="{boardurl}/Themes/default/images/membericons/icon.png"] + td.centercol.members + "#" + td.centercol.required_posts + "#" + td.centercol.modify + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=edit;group=#"] + "Modify" + tr#list_post_count_membergroups_list_#.windowbg + td.name + a [href="{boardurl}/index.php?action=moderate;area=viewgroups;sa=members;group=#"] + "Jr. Member" + td.icons + img [alt="*" src="{boardurl}/Themes/default/images/membericons/icon.png"] + td.centercol.members + "#" + td.centercol.required_posts + "#" + td.centercol.modify + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=edit;group=#"] + "Modify" + tr#list_post_count_membergroups_list_#.windowbg + td.name + a [href="{boardurl}/index.php?action=moderate;area=viewgroups;sa=members;group=#"] + "Full Member" + td.icons + img [alt="*" src="{boardurl}/Themes/default/images/membericons/icon.png"] + td.centercol.members + "#" + td.centercol.required_posts + "#" + td.centercol.modify + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=edit;group=#"] + "Modify" + tr#list_post_count_membergroups_list_#.windowbg + td.name + a [href="{boardurl}/index.php?action=moderate;area=viewgroups;sa=members;group=#"] + "Sr. Member" + td.icons + img [alt="*" src="{boardurl}/Themes/default/images/membericons/icon.png"] + td.centercol.members + "#" + td.centercol.required_posts + "#" + td.centercol.modify + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=edit;group=#"] + "Modify" + tr#list_post_count_membergroups_list_#.windowbg + td.name + a [href="{boardurl}/index.php?action=moderate;area=viewgroups;sa=members;group=#"] + "Hero Member" + td.icons + img [alt="*" src="{boardurl}/Themes/default/images/membericons/icon.png"] + td.centercol.members + "#" + td.centercol.required_posts + "#" + td.centercol.modify + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=edit;group=#"] + "Modify" + div.flow_auto + div.additional_row + a.button [href="{boardurl}/index.php?action=admin;area=membergroups;sa=add;postgroup"] + "Add group" diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/membergroups_add.txt b/tests/Integration/Http/Snapshot/snapshots/admin/membergroups_add.txt new file mode 100644 index 00000000000..2bbafffe66c --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/membergroups_add.txt @@ -0,0 +1,171 @@ +status 200 +@ title +title + "Add membergroup" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=membergroups;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Membergroups" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=add;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Add membergroup" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=membergroups" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Manage Membergroups" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Membergroups are groups of members that have similar permission settings, appearance, or access rights. Some membergroups are based on the amount of posts a user has made. You can assign someone to a membergroup by selecting their profile and changing their account settings." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Manage Membergroups Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Manage Membergroups Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=index;{session_var}={session_id}"] + "Edit membergroups" + li + a.active [href="{boardurl}/index.php?action=admin;area=membergroups;sa=add;{session_var}={session_id}"] + "Add membergroup" + li + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=settings;{session_var}={session_id}"] + "Settings" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + form#new_group [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=membergroups;sa=add" method="post"] + div.cat_bar + h3.catbg + "Add membergroup" + div.windowbg + dl.settings + dt + label [for="group_name_input"] + strong + "Membergroup name" + dd + input#group_name_input [name="group_name" size="#" type="text"] + dt + label [for="permission_base"] + strong + "Permissions" + br + span.smalltext + "You can edit them later." + dd + fieldset#permission_base + legend + "Select permission profile" + input#perm_type_inherit [checked name="perm_type" type="radio" value="inherit"] + label [for="perm_type_inherit"] + "inherit from" + select#inheritperm_select [name="inheritperm" onclick="document.getElementById('perm_type_inherit').checked = true;"] + option [value="-#"] + "Guests" + option [selected value="#"] + "Regular Members" + option [value="#"] + "Global Moderator" + br + input#perm_type_copy [name="perm_type" type="radio" value="copy"] + label [for="perm_type_copy"] + "based off of" + select#copyperm_select [name="copyperm" onclick="document.getElementById('perm_type_copy').checked = true;"] + option [value="-#"] + "Guests" + option [selected value="#"] + "Regular Members" + option [value="#"] + "Global Moderator" + br + input#perm_type_predefined [name="perm_type" type="radio" value="predefined"] + label [for="perm_type_predefined"] + "by type" + select#level_select [name="level" onclick="document.getElementById('perm_type_predefined').checked = true;"] + option [value="restrict"] + "Restrictive" + option [selected value="standard"] + "Standard" + option [value="moderator"] + "Moderator" + option [value="maintenance"] + "Maintenance" + dt + strong + "Visible Boards" + dd + fieldset#visible_boards + legend + "Boards the membergroup can see" + ul.floatleft.padding + li.category + a [href="javascript:void(#);" onclick="selectBoards([#, #, #, #], 'new_group'); return false;"] + strong + "Snapshot fixtures" + ul + li.board [style="margin-inline-start: #em;"] + input#brd# [name="boardaccess[#]" type="checkbox" value="allow"] + label [for="brd#"] + "Snapshot board" + li.board [style="margin-inline-start: #em;"] + input#brd# [name="boardaccess[#]" type="checkbox" value="allow"] + label [for="brd#"] + "Snapshot child one" + li.board [style="margin-inline-start: #em;"] + input#brd# [name="boardaccess[#]" type="checkbox" value="allow"] + label [for="brd#"] + "Snapshot child two" + li.board [style="margin-inline-start: #em;"] + input#brd# [name="boardaccess[#]" type="checkbox" value="allow"] + label [for="brd#"] + "Snapshot empty board" + br.clear + br + input#checkall_check [onclick="invertAll(this, this.form, 'boardaccess');" type="checkbox"] + label [for="checkall_check"] + em + "Select all" + input.button [type="submit" value="Add group"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/membergroups_add_post_group.txt b/tests/Integration/Http/Snapshot/snapshots/admin/membergroups_add_post_group.txt new file mode 100644 index 00000000000..aecd073c9f9 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/membergroups_add_post_group.txt @@ -0,0 +1,136 @@ +status 200 +@ title +title + "Add membergroup" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=membergroups;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Membergroups" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=add;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Add membergroup" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=membergroups" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Manage Membergroups" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Membergroups are groups of members that have similar permission settings, appearance, or access rights. Some membergroups are based on the amount of posts a user has made. You can assign someone to a membergroup by selecting their profile and changing their account settings." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Manage Membergroups Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Manage Membergroups Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=index;{session_var}={session_id}"] + "Edit membergroups" + li + a.active [href="{boardurl}/index.php?action=admin;area=membergroups;sa=add;{session_var}={session_id}"] + "Add membergroup" + li + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=settings;{session_var}={session_id}"] + "Settings" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + form#new_group [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=membergroups;sa=add" method="post"] + div.cat_bar + h3.catbg + "Add membergroup" + div.windowbg + dl.settings + dt + label [for="group_name_input"] + strong + "Membergroup name" + dd + input#group_name_input [name="group_name" size="#" type="text"] + dt#min_posts_text + label [for="min_posts_input"] + strong + "Required posts" + dd + input#min_posts_input [name="min_posts" size="#" type="number"] + dt + strong + "Visible Boards" + br + span.smalltext + em + "Note: normally, post groups do not need access because the group the member is in will give them access." + dd + fieldset#visible_boards + legend + "Boards the membergroup can see" + ul.floatleft.padding + li.category + a [href="javascript:void(#);" onclick="selectBoards([#, #, #, #], 'new_group'); return false;"] + strong + "Snapshot fixtures" + ul + li.board [style="margin-inline-start: #em;"] + input#brd# [name="boardaccess[#]" type="checkbox" value="allow"] + label [for="brd#"] + "Snapshot board" + li.board [style="margin-inline-start: #em;"] + input#brd# [name="boardaccess[#]" type="checkbox" value="allow"] + label [for="brd#"] + "Snapshot child one" + li.board [style="margin-inline-start: #em;"] + input#brd# [name="boardaccess[#]" type="checkbox" value="allow"] + label [for="brd#"] + "Snapshot child two" + li.board [style="margin-inline-start: #em;"] + input#brd# [name="boardaccess[#]" type="checkbox" value="allow"] + label [for="brd#"] + "Snapshot empty board" + br.clear + br + input#checkall_check [onclick="invertAll(this, this.form, 'boardaccess');" type="checkbox"] + label [for="checkall_check"] + em + "Select all" + input.button [type="submit" value="Add group"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/membergroups_edit.txt b/tests/Integration/Http/Snapshot/snapshots/admin/membergroups_edit.txt new file mode 100644 index 00000000000..1dc608a28a0 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/membergroups_edit.txt @@ -0,0 +1,250 @@ +status 200 +@ title +title + "Edit Membergroup Global Moderator" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=membergroups;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Membergroups" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=index;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Edit membergroups" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=membergroups" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Manage Membergroups" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Membergroups are groups of members that have similar permission settings, appearance, or access rights. Some membergroups are based on the amount of posts a user has made. You can assign someone to a membergroup by selecting their profile and changing their account settings." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Manage Membergroups Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Manage Membergroups Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a.active [href="{boardurl}/index.php?action=admin;area=membergroups;sa=index;{session_var}={session_id}"] + "Edit membergroups" + li + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=add;{session_var}={session_id}"] + "Add membergroup" + li + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=settings;{session_var}={session_id}"] + "Settings" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + form#groupForm [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=membergroups;sa=edit;group=#" method="post" name="groupForm"] + div.cat_bar + h3.catbg + "Edit Membergroup Global Moderator" + div.windowbg + dl.settings + dt + label [for="group_name_input"] + strong + "Group name" + dd + input#group_name_input [name="group_name" size="#" type="text" value="Global Moderator"] + dt#group_desc_text + label [for="group_desc_input"] + strong + "Group description" + dd + textarea#group_desc_input [cols="#" name="group_desc" rows="#"] + dt + label [for="group_type"] + strong + "Group type" + dd + fieldset#group_type + legend + "Select Group type" + label [for="group_type_private"] + input#group_type_private [checked name="group_type" type="radio" value="#"] + "Private" + span.smalltext + "(Membership must be assigned)" + br + label [for="group_type_protected"] + input#group_type_protected [name="group_type" type="radio" value="#"] + "Protected" + span.smalltext + "(Only administrators can manage and assign)" + br + label [for="group_type_request"] + input#group_type_request [name="group_type" type="radio" value="#"] + "Requestable" + span.smalltext + "(User may request membership)" + br + label [for="group_type_free"] + input#group_type_free [name="group_type" type="radio" value="#"] + "Free" + span.smalltext + "(User may leave and join group at will)" + br + dt#group_moderators_text + label [for="group_moderators"] + strong + "Moderators" + dd + input#group_moderators [name="group_moderators" size="#" type="text" value] + div#moderator_container + dt#group_hidden_text + label [for="group_hidden_input"] + strong + "Visibility" + dd + select#group_hidden_input [name="group_hidden" onchange="if (this.value == # && !confirm('Are you sure you want to disallow assignment of this group as a users primary group?\\n\\nDoing so will restrict assignment to additional groups only, and will update all current \"primary\" members to have it as an additional group only.\\n\\nIt will also remove the group as moderator from any boards it is currently assigned to moderate.')) this.value = #;"] + option [selected value="#"] + "Visible" + option [value="#"] + "Visible - Apart from in group key" + option [value="#"] + "Invisible" + dt#group_inherit_text + label [for="group_inherit_input"] + strong + "Inherit permissions" + br + span.smalltext + "Select \"No\" to enable group to have own permission set." + dd + select#group_inherit_input [name="group_inherit"] + option [value="-#"] + "No - Use unique permissions" + option [value="-#"] + "Inherit from Guests" + option [value="#"] + "Inherit from Regular Members" + input [name="old_inherit" type="hidden" value="-#"] + dt + label [for="online_color_input"] + strong + "Color in online list" + dd + input#online_color_input [name="online_color" size="#" type="text" value="##FF"] + dt + label [for="icon_count_input"] + strong + "Number of icon images" + dd + input#icon_count_input [name="icon_count" size="#" type="number" value="#"] + dt + label [for="icon_image_input"] + strong + "Icon image filename" + br + span.smalltext + "You can upload custom images to the forum’s default theme directory to be able to select them here. Different images can be used in different themes, just give them the same name." + span.smalltext + "Max size allowed #x#px" + dd + "Themes/default/images/membericons/" + select#icon_image_input [name="icon_image"] + option [value="blank.png"] + "blank.png" + option [value="icon.png"] + "icon.png" + option [value="iconadmin.png"] + "iconadmin.png" + option [selected value="icongmod.png"] + "icongmod.png" + option [value="iconmod.png"] + "iconmod.png" + img#icon_preview [alt="*" src] + dt + label [for="max_messages_input"] + strong + "Max personal messages" + br + span.smalltext + "# = unlimited" + dd + input#max_messages_input [name="max_messages" size="#" type="text" value="#"] + dt + strong + "Visible Boards" + dd + fieldset#visible_boards + legend + "Boards the membergroup can see" + ul.floatleft.padding + li.category + a [href="javascript:void(#);" onclick="selectBoards([#, #, #, #], 'groupForm'); return false;"] + strong + "Snapshot fixtures" + ul + li.board [style="margin-inline-start: #em;"] + input#brd# [name="boardaccess[#]" type="checkbox" value="allow"] + label [for="brd#"] + "Snapshot board" + li.board [style="margin-inline-start: #em;"] + input#brd# [name="boardaccess[#]" type="checkbox" value="allow"] + label [for="brd#"] + "Snapshot child one" + li.board [style="margin-inline-start: #em;"] + input#brd# [name="boardaccess[#]" type="checkbox" value="allow"] + label [for="brd#"] + "Snapshot child two" + li.board [style="margin-inline-start: #em;"] + input#brd# [name="boardaccess[#]" type="checkbox" value="allow"] + label [for="brd#"] + "Snapshot empty board" + br.clear + br + input#checkall_check [onclick="invertAll(this, this.form, 'boardaccess');" type="checkbox"] + label [for="checkall_check"] + em + "Select all" + a#visible_boards_link.hidden [href="javascript:void(#);" onclick="document.getElementById('visible_boards').classList.remove('hidden'); document.getElementById('visible_boards_link').classList.add('hidden'); return false;"] + "[ Show boards ]" + script + | document.getElementById("visible_boards_link").classList.remove('hidden'); document.getElementById("visible_boards").classList.add('hidden'); + input.button [name="save" type="submit" value="Save"] + input.button.you_sure [data-confirm="Are you sure you want to delete this group?" name="delete" type="submit" value="Delete"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="{token_var}" type="hidden" value="{hash}"] + script + | var oModeratorSuggest = new smc_AutoSuggest({ sSessionId: smf_session_id, sSessionVar: smf_session_var, sSuggestId: 'group_moderators', sControlId: 'group_moderators', sSearchType: 'member', bItemList: true, sPostName: 'moderator_list', sURLMask: 'action=profile;u=%item_id%', sTextDeleteItem: 'Delete Item', sItemListContainerId: 'moderator_container', aListItems: [ ] }); diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/membergroups_settings.txt b/tests/Integration/Http/Snapshot/snapshots/admin/membergroups_settings.txt new file mode 100644 index 00000000000..4c79405494a --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/membergroups_settings.txt @@ -0,0 +1,112 @@ +status 200 +@ title +title + "Membergroup Settings" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=membergroups;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Membergroups" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=settings;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Settings" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=membergroups" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Manage Membergroups" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Membergroups are groups of members that have similar permission settings, appearance, or access rights. Some membergroups are based on the amount of posts a user has made. You can assign someone to a membergroup by selecting their profile and changing their account settings." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Manage Membergroups Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Manage Membergroups Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=index;{session_var}={session_id}"] + "Edit membergroups" + li + a [href="{boardurl}/index.php?action=admin;area=membergroups;sa=add;{session_var}={session_id}"] + "Add membergroup" + li + a.active [href="{boardurl}/index.php?action=admin;area=membergroups;sa=settings;{session_var}={session_id}"] + "Settings" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + form#admin_form_wrapper [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=membergroups;save;sa=settings" method="post"] + div.cat_bar + h3.catbg + "Membergroup Settings" + div.noup.windowbg + dl.settings + dt + a#setting_manage_membergroups + span + label + "Groups allowed to manage and assign membergroups" + dd + fieldset#manage_membergroups + legend + a.toggle_up [href="javascript:void(#);" onclick="document.getElementById('manage_membergroups').style.display = 'none';document.getElementById('manage_membergroups_groups_link').style.display = 'block'; return false;"] + "Select permissions for each group" + ul + li + input [name="manage_membergroups[#]" type="checkbox" value="on"] + span + "Regular Members" + li + input [name="manage_membergroups[#]" type="checkbox" value="on"] + span + "Global Moderator" + li + input [onclick="invertAll(this, this.form, 'manage_membergroups[');" type="checkbox"] + span + "Select all" + a#manage_membergroups_groups_link.toggle_down [href="javascript:void(#);" onclick="document.getElementById('manage_membergroups').style.display = 'block'; document.getElementById('manage_membergroups_groups_link').style.display = 'none'; return false;" style="display: none;"] + "Select permissions for each group" + script + | document.getElementById("manage_membergroups").style.display = "none"; document.getElementById("manage_membergroups_groups_link").style.display = ""; + input.button [type="submit" value="Save"] + input [name="{token_var}" type="hidden" value="{hash}"] + input [name="{session_var}" type="hidden" value="{session_id}"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/members.txt b/tests/Integration/Http/Snapshot/snapshots/admin/members.txt new file mode 100644 index 00000000000..3d68728e2fd --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/members.txt @@ -0,0 +1,110 @@ +status 200 +@ title +title + "Manage Members" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=viewmembers;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Members" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=viewmembers;sa=all;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "View all Members" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=view_members" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Manage Members" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Below is a listing of all the members currently registered with your forum." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Manage Members Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Manage Members Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a.active [href="{boardurl}/index.php?action=admin;area=viewmembers;sa=all;{session_var}={session_id}"] + "View all Members" + li + a [href="{boardurl}/index.php?action=admin;area=viewmembers;sa=search;{session_var}={session_id}"] + "Search for Members" + li + a [href="{boardurl}/index.php?action=admin;area=viewmembers;sa=settings;{session_var}={session_id}"] + "Settings" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=viewmembers" method="post"] + div.cat_bar + h3.catbg + "Members List" + table#member_list.table_grid + thead + tr.title_bar + th#header_member_list_id_member.id_member [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=viewmembers;sort=id_member" rel="nofollow"] + "ID" + th#header_member_list_user_name.user_name [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=viewmembers;sort=user_name;desc" rel="nofollow"] + "Username" + span.main_icons.sort_up + th#header_member_list_display_name.display_name [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=viewmembers;sort=display_name" rel="nofollow"] + "Display name" + th#header_member_list_email.email [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=viewmembers;sort=email" rel="nofollow"] + "Email address" + th#header_member_list_ip.ip [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=viewmembers;sort=ip" rel="nofollow"] + "IP address" + th#header_member_list_last_active.last_active [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=viewmembers;sort=last_active" rel="nofollow"] + "Last Online" + th#header_member_list_posts.posts [scope="col"] + a [href="{boardurl}/index.php?action=admin;area=viewmembers;sort=posts" rel="nofollow"] + "Posts" + th#header_member_list_check.centercol.check [scope="col"] + input [onclick="invertAll(this, this.form);" type="checkbox"] + snapshot-ignored [selector="table.table_grid tbody"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input [name="sort" type="hidden" value="user_name"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/members_search.txt b/tests/Integration/Http/Snapshot/snapshots/admin/members_search.txt new file mode 100644 index 00000000000..eed30376675 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/members_search.txt @@ -0,0 +1,286 @@ +status 200 +@ title +title + "Manage Members" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=viewmembers;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Members" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=viewmembers;sa=search;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Search for Members" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=view_members" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Manage Members" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Below is a listing of all the members currently registered with your forum." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Manage Members Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Manage Members Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a [href="{boardurl}/index.php?action=admin;area=viewmembers;sa=all;{session_var}={session_id}"] + "View all Members" + li + a.active [href="{boardurl}/index.php?action=admin;area=viewmembers;sa=search;{session_var}={session_id}"] + "Search for Members" + li + a [href="{boardurl}/index.php?action=admin;area=viewmembers;sa=settings;{session_var}={session_id}"] + "Settings" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + form#admin_form_wrapper [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=viewmembers" method="post"] + input [name="sa" type="hidden" value="query"] + div.cat_bar + h3.catbg + span.floatleft + "Search for" + span.floatright.smalltext + "wildcard characters * and ? are allowed" + div.windowbg + div.flow_hidden + div.floatleft.msearch_details + dl.right.settings + dt.righttext + strong + label [for="mem_id"] + "ID" + select [name="types[mem_id]"] + option [value="--"] + "<" + option [value="-"] + "<=" + option [selected value="="] + "=" + option [value="+"] + ">=" + option [value="++"] + ">" + dd + input#mem_id [name="mem_id" size="#" type="number" value] + dt.righttext + strong + label [for="age"] + "User age" + select [name="types[age]"] + option [value="--"] + "<" + option [value="-"] + "<=" + option [selected value="="] + "=" + option [value="+"] + ">=" + option [value="++"] + ">" + dd + input#age [name="age" size="#" type="number" value] + dt.righttext + strong + label [for="posts"] + "Posts" + select [name="types[posts]"] + option [value="--"] + "<" + option [value="-"] + "<=" + option [selected value="="] + "=" + option [value="+"] + ">=" + option [value="++"] + ">" + dd + input#posts [name="posts" size="#" type="number" value] + dt.righttext + strong + label [for="reg_date"] + "Date registered" + select [name="types[reg_date]"] + option [value="--"] + "<" + option [value="-"] + "<=" + option [selected value="="] + "=" + option [value="+"] + ">=" + option [value="++"] + ">" + dd + input#reg_date [name="reg_date" size="#" type="date" value] + span.smalltext + dt.righttext + strong + label [for="last_online"] + "Last Online" + select [name="types[last_online]"] + option [value="--"] + "<" + option [value="-"] + "<=" + option [selected value="="] + "=" + option [value="+"] + ">=" + option [value="++"] + ">" + dd + input#last_online [name="last_online" size="#" type="date" value] + span.smalltext + div.floatright.msearch_details + dl.right.settings + dt.righttext + strong + label [for="membername"] + "Username" + dd + input#membername [name="membername" type="text" value] + dt.righttext + strong + label [for="email"] + "Email address" + dd + input#email [name="email" type="email" value] + dt.righttext + strong + label [for="website"] + "Website" + dd + input#website [name="website" type="url" value] + dt.righttext + strong + label [for="ip"] + "IP address" + dd + input#ip [name="ip" type="text" value] + div.floatright.msearch_details + fieldset + legend + "Activation Status" + label [for="activated-#"] + input#activated-# [checked name="activated[]" type="checkbox" value="#"] + "Activated" + label [for="activated-#"] + input#activated-# [checked name="activated[]" type="checkbox" value="#"] + "Not activated" + div.cat_bar + h3.catbg + "Member is part of these membergroups" + table.table_grid + thead + tr.title_bar + th [scope="col"] + "Membergroups" + th.centercol.quarter_table [scope="col"] + "Primary" + th.centercol.quarter_table [scope="col"] + "Additional" + tbody + tr.windowbg + td + "Regular Members" + td.centercol + input [checked name="membergroups[#][]" type="checkbox" value="#"] + td.centercol + tr.windowbg + td + "Administrator" + td.centercol + input [checked name="membergroups[#][]" type="checkbox" value="#"] + tr.windowbg + td + "Global Moderator" + td.centercol + input [checked name="membergroups[#][]" type="checkbox" value="#"] + tr.windowbg + td + em + "Select all" + td.centercol + input [checked onclick="invertAll(this, this.form, 'membergroups[#]');" type="checkbox"] + table.table_grid + thead + tr.title_bar + th [scope="col"] + "Post groups" + th.quarter_table + tbody + tr.windowbg + td + "Newbie" + td.centercol + input [checked name="postgroups[]" type="checkbox" value="#"] + tr.windowbg + td + "Jr. Member" + td.centercol + input [checked name="postgroups[]" type="checkbox" value="#"] + tr.windowbg + td + "Full Member" + td.centercol + input [checked name="postgroups[]" type="checkbox" value="#"] + tr.windowbg + td + "Sr. Member" + td.centercol + input [checked name="postgroups[]" type="checkbox" value="#"] + tr.windowbg + td + "Hero Member" + td.centercol + input [checked name="postgroups[]" type="checkbox" value="#"] + tr.windowbg + td + em + "Select all" + td.centercol + input [checked onclick="invertAll(this, this.form, 'postgroups[]');" type="checkbox"] + br + input.button [type="submit" value="Search"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/members_settings.txt b/tests/Integration/Http/Snapshot/snapshots/admin/members_settings.txt new file mode 100644 index 00000000000..5b6d40b8464 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/members_settings.txt @@ -0,0 +1,97 @@ +status 200 +@ title +title + "Manage Members" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin" itemprop="item"] + span [itemprop="name"] + "Administration Center" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=viewmembers;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Members" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?action=admin;area=viewmembers;sa=settings;{session_var}={session_id}" itemprop="item"] + span [itemprop="name"] + "Settings" + meta [content="#" itemprop="position"] +@ #admin_content +div#admin_content + div.cat_bar + h3.catbg + a.help [href="{boardurl}/index.php?action=helpadmin;help=view_members" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + "Manage Members" + form.admin_search [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=search" method="post"] + span.centericon.filter.main_icons + input [name="search_term" placeholder="Quick Search" type="search"] + select [name="search_type"] + option [selected value="internal"] + "Task/Setting" + option [value="member"] + "Member" + option [value="online"] + "Online Manual" + input#search_go.button [name="search_go" type="submit" value="Go"] + p.information + "Below is a listing of all the members currently registered with your forum." + a.mobile_generic_menu_1_tabs + span.menu_icon + span.text_menu + "Manage Members Menu" + div#adm_submenus + div#mobile_generic_menu_#_tabs.popup_container + div.description.popup_window + div.popup_heading + "Manage Members Menu" + a.hide_popup.main_icons [href="javascript:void(#);"] + div.generic_menu + ul.dropdown_menu_1_tabs.dropmenu + li + a [href="{boardurl}/index.php?action=admin;area=viewmembers;sa=all;{session_var}={session_id}"] + "View all Members" + li + a [href="{boardurl}/index.php?action=admin;area=viewmembers;sa=search;{session_var}={session_id}"] + "Search for Members" + li + a.active [href="{boardurl}/index.php?action=admin;area=viewmembers;sa=settings;{session_var}={session_id}"] + "Settings" + script + | $( ".mobile_generic_menu_#_tabs" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).show(); }); $( ".hide_popup" ).click(function() { $( "#mobile_generic_menu_#_tabs" ).hide(); }); + form#admin_form_wrapper [accept-charset="UTF-#" action="{boardurl}/index.php?action=admin;area=viewmembers;save;sa=settings" method="post"] + div.cat_bar + h3.catbg + "Settings" + div.noup.windowbg + dl.settings + dt + a#setting_always_anonymize_deleted_accounts_help [href="{boardurl}/index.php?action=helpadmin;help=always_anonymize_deleted_accounts" onclick="return reqOverlayDiv(this.href);"] + span.help.main_icons [title="Help"] + a#setting_always_anonymize_deleted_accounts + span + label [for="always_anonymize_deleted_accounts"] + "Always anonymize personally identifying information when deleting an account" + br + span.smalltext + "Anonymization will still be available on a case-by-case basis when this setting is disabled." + dd + input#always_anonymize_deleted_accounts [name="always_anonymize_deleted_accounts" type="checkbox" value="#"] + input.button [type="submit" value="Save"] + input [name="{token_var}" type="hidden" value="{hash}"] + input [name="{session_var}" type="hidden" value="{session_id}"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/merge_topic.txt b/tests/Integration/Http/Snapshot/snapshots/admin/merge_topic.txt new file mode 100644 index 00000000000..41d59621593 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/merge_topic.txt @@ -0,0 +1,100 @@ +status 200 +@ title +title + "Merge Topics" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php#c#" itemprop="item"] + span [itemprop="name"] + "Snapshot fixtures" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?board=#.#" itemprop="item"] + span [itemprop="name"] + "{board}" + meta [content="#" itemprop="position"] +@ #content_section +div#content_section + main#main_content_section + div#merge_topics + div.cat_bar + h3.catbg + "Merge Topics" + div.information + "This function will merge the messages of two topics into one topic. The messages will be sorted according to the time of posting. Therefore, the earliest posted message will be the first message of the merged topic." + div.windowbg + dl.merge_topic.settings + dt + strong + "Topic to be merged" + dd + "Snapshot second topic" + br + div.cat_bar + h3.catbg + "Target topic" + div.title_bar + h4.titlebg + form#mergeSelectBoard [accept-charset="UTF-#" action="{boardurl}/index.php?action=mergetopics;from=#;targetboard=#;board=#.#" method="post"] + "Select target from the list below (Board:" + select [name="targetboard" onchange="this.form.submit();"] + optgroup [label="Snapshot fixtures"] + option [selected value="#"] + "{board}" + option [value="#"] + "=> Snapshot child one" + option [value="#"] + "=> Snapshot child two" + option [value="#"] + "Snapshot empty board" + ")" + input [name="from" type="hidden" value="#"] + input.button [type="submit" value="Go"] + form [accept-charset="UTF-#" action="{boardurl}/index.php?action=mergetopics;sa=options" method="post"] + div.pagesection + div.pagelinks + span.pages + "Pages" + span.current_page + "#" + div.windowbg + ul.merge_topics + li + a [href="{boardurl}/index.php?action=mergetopics;sa=options;board=#.#;from=#;to=#;{session_var}={session_id}"] + span.main_icons.merge + a [href="{boardurl}/index.php?topic=#.#" rel="noopener" target="_blank"] + "{subject}" + "Started by" + a [href="{boardurl}/index.php?action=profile;u=#" rel="noopener" target="_blank"] + "{member}" + div.pagesection + div.pagelinks + span.pages + "Pages" + span.current_page + "#" + br + div.title_bar + h4.titlebg + "Select target by topic ID" + div.windowbg + dl.merge_topic.settings + dt + strong + "ID of target topic" + dd + input [name="topics[]" type="hidden" value="#"] + input [name="topics[]" type="text"] + input [name="{session_var}" type="hidden" value="{session_id}"] + input.button [type="submit" value="Merge Topics"] diff --git a/tests/Integration/Http/Snapshot/snapshots/admin/message_index.txt b/tests/Integration/Http/Snapshot/snapshots/admin/message_index.txt new file mode 100644 index 00000000000..baf4ad02621 --- /dev/null +++ b/tests/Integration/Http/Snapshot/snapshots/admin/message_index.txt @@ -0,0 +1,372 @@ +status 200 +@ title +title + "{board}" +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php#c#" itemprop="item"] + span [itemprop="name"] + "Snapshot fixtures" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?board=#.#" itemprop="item"] + span [itemprop="name"] + "{board}" + meta [content="#" itemprop="position"] +@ .navigate_section +nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php#c#" itemprop="item"] + span [itemprop="name"] + "Snapshot fixtures" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?board=#.#" itemprop="item"] + span [itemprop="name"] + "{board}" + meta [content="#" itemprop="position"] +@ #content_section +div#content_section + main#main_content_section + div#display_head.information + h2.display_title + "{board}" + p + "Topics, replies and a poll for the snapshot tests." + div#board_#_childboards.boardindex_table.main_container + div.cat_bar + h3.catbg + "Sub-Boards" + div#board_#.up_contain + div.board_icon + a.board_off [href="{boardurl}/index.php?action=unread;board=#.#;children" title="No New Posts"] + div.info + a#b#.mobile_subject.subject [href="{boardurl}/index.php?board=#.#"] + "{board}" + div.board_description + "The first child board." + div.board_stats + p + "# post(s)" + br + "# topic(s)" + div.lastpost + p + strong + "Last post:" + "{date}" + span.postby + a [href="{boardurl}/index.php?topic=#.msg##new" title="{subject}"] + "{subject}" + "by" + a [href="{boardurl}/index.php?action=profile;u=#" title="View the profile of {member}"] + "{member}" + div#board_#.up_contain + div.board_icon + a.board_off [href="{boardurl}/index.php?action=unread;board=#.#;children" title="No New Posts"] + div.info + a#b#.mobile_subject.subject [href="{boardurl}/index.php?board=#.#"] + "{board}" + div.board_description + "The second child board, which stays empty." + div.board_stats + p + "# post(s)" + br + "# topic(s)" + div.lastpost + div.pagesection + div.floatleft.pagelinks + a.button [href="#bot"] + "Go Down" + span.pages + "Pages" + span.current_page + "#" + div.buttonlist.floatright + a.active.button.button_strip_new_topic [href="{boardurl}/index.php?action=post;board=#.#"] + "New Topic" + a.button.button_strip_post_poll [href="{boardurl}/index.php?action=post;board=#.#;poll"] + "New poll" + a.button.button_strip_markread.you_sure [data-confirm="Are you sure you want to mark messages as read?" href="{boardurl}/index.php?action=markasread;sa=board;board=#.#;{session_var}={session_id}"] + "Mark Read" + a.button.button_strip_notify + "No Alerts or Emails" + div.dropmenu.notify_dropdown.top_menu + div.viewport + div.overview + a [href="{boardurl}/index.php?action=notifyboard;board=#;mode=#;{session_var}={session_id}"] + strong + "No Alerts or Emails" + br + span + "You will not receive any emails or alerts for new topics" + a [href="{boardurl}/index.php?action=notifyboard;board=#;mode=#;{session_var}={session_id}"] + strong + "Receive Alerts" + br + span + "You will receive alerts for this board." + a [href="{boardurl}/index.php?action=notifyboard;board=#;mode=#;{session_var}={session_id}"] + strong + "Receive Emails and Alerts" + br + span + "You will receive both alerts and e-mails for this board." + div.floatright.mobile_buttons + a.button.mobile_act + "User actions" + div#messageindex + div#topic_header.title_bar + div.board_icon + div.info + a [href="{boardurl}/index.php?board=#.#;sort=subject"] + "Subject" + "/" + a [href="{boardurl}/index.php?board=#.#;sort=starter"] + "Started by" + div.board_stats.centertext + a [href="{boardurl}/index.php?board=#.#;sort=replies"] + "Replies" + "/" + a [href="{boardurl}/index.php?board=#.#;sort=views"] + "Views" + div.lastpost + a [href="{boardurl}/index.php?board=#.#;asc"] + "Last post" + span.main_icons.sort_down + div#topic_container + div.locked.sticky.windowbg + div.board_icon + img [alt src="{boardurl}/Themes/default/images/post/xx.png"] + span.main_icons.profile_sm + div.info.info_block + div + div#icons#.floatright.icons + span.lock.main_icons + span.main_icons.sticky + span.main_icons.poll + div.message_index_title + span.bold_text.preview [title] + span#msg# + a [href="{boardurl}/index.php?topic=#.#"] + "{subject}" + p.floatleft + "Started by" + a.preview [href="{boardurl}/index.php?action=profile;u=#" title="View the profile of {member}"] + "{member}" + div.board_stats.centertext + p + "# reply(s)" + br + "# view(s)" + div.lastpost + p + a [href="{boardurl}/index.php?topic=#.##new"] + "{date}" + br + "by" + a [href="{boardurl}/index.php?action=profile;u=#"] + "{member}" + div.windowbg + div.board_icon + img [alt src="{boardurl}/Themes/default/images/post/xx.png"] + div.info.info_block + div + div#icons#.floatright.icons + div.message_index_title + span.preview [title] + span#msg# + a [href="{boardurl}/index.php?topic=#.#"] + "{subject}" + p.floatleft + "Started by" + a.preview [href="{boardurl}/index.php?action=profile;u=#" title="View the profile of {member}"] + "{member}" + div.board_stats.centertext + p + "# reply(s)" + br + "# view(s)" + div.lastpost + p + a [href="{boardurl}/index.php?topic=#.##new"] + "{date}" + br + "by" + a [href="{boardurl}/index.php?action=profile;u=#"] + "{member}" + div.windowbg + div.board_icon + img [alt src="{boardurl}/Themes/default/images/post/xx.png"] + span.main_icons.profile_sm + div.info.info_block + div + div#icons#.floatright.icons + div.message_index_title + span.preview [title] + span#msg# + a [href="{boardurl}/index.php?topic=#.#"] + "{subject}" + p.floatleft + "Started by" + a.preview [href="{boardurl}/index.php?action=profile;u=#" title="View the profile of {member}"] + "{member}" + div.board_stats.centertext + p + "# reply(s)" + br + "# view(s)" + div.lastpost + p + a [href="{boardurl}/index.php?topic=#.msg##new"] + "{date}" + br + "by" + a [href="{boardurl}/index.php?action=profile;u=#"] + "{member}" + div.pagesection + div.floatleft.pagelinks + a#bot.button [href="#main_content_section"] + "Go Up" + span.pages + "Pages" + span.current_page + "#" + div.buttonlist.floatright + a.active.button.button_strip_new_topic [href="{boardurl}/index.php?action=post;board=#.#"] + "New Topic" + a.button.button_strip_post_poll [href="{boardurl}/index.php?action=post;board=#.#;poll"] + "New poll" + a.button.button_strip_markread.you_sure [data-confirm="Are you sure you want to mark messages as read?" href="{boardurl}/index.php?action=markasread;sa=board;board=#.#;{session_var}={session_id}"] + "Mark Read" + a.button.button_strip_notify + "No Alerts or Emails" + div.dropmenu.notify_dropdown.top_menu + div.viewport + div.overview + a [href="{boardurl}/index.php?action=notifyboard;board=#;mode=#;{session_var}={session_id}"] + strong + "No Alerts or Emails" + br + span + "You will not receive any emails or alerts for new topics" + a [href="{boardurl}/index.php?action=notifyboard;board=#;mode=#;{session_var}={session_id}"] + strong + "Receive Alerts" + br + span + "You will receive alerts for this board." + a [href="{boardurl}/index.php?action=notifyboard;board=#;mode=#;{session_var}={session_id}"] + strong + "Receive Emails and Alerts" + br + span + "You will receive both alerts and e-mails for this board." + div.floatright.mobile_buttons + a.button.mobile_act + "User actions" + nav.navigate_section [aria-label="Breadcrumb"] + ol [itemscope itemtype="https://schema.org/BreadcrumbList"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + a [href="{boardurl}/index.php" itemprop="item"] + span [itemprop="name"] + "{forum_name}" + meta [content="#" itemprop="position"] + li [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php#c#" itemprop="item"] + span [itemprop="name"] + "Snapshot fixtures" + meta [content="#" itemprop="position"] + li.last [itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"] + span.dividers + "►" + a [href="{boardurl}/index.php?board=#.#" itemprop="item"] + span [itemprop="name"] + "{board}" + meta [content="#" itemprop="position"] + script + | window.addEventListener("DOMContentLoaded", function() { new QuickModifyTopic({ aHidePrefixes: ["icons", "msg", "pages", "newicon"], sTopicContainer: "topic_container", }); }); + div#topic_icons.tborder + div.information + p#message_index_jump_to + p.floatleft + span.main_icons.profile_sm + "Topic you have posted in" + br + span.main_icons.poll + "Poll" + br + span.main_icons.move + "Moved Topic" + br + p + span.lock.main_icons + "Locked Topic" + br + span.main_icons.sticky + "Sticky Topic" + br + span.main_icons.watch + "Topic you are watching" + br + script + | window.addEventListener("DOMContentLoaded", function() { new JumpTo({ sContainerId: "message_index_jump_to", sJumpToTemplate: "