One place for each thing and no microcopy: admin is Users, Runners, Server, Mail, Backups, Health and Audit log, with invites under Users and replication under Backups, and every server setting on one page (backup, replication and mail settings on their own pages
Browse files at this commita2e388f98aef9cba207ba39e11e35b4a79bb9ff4Parent: c452194All checks have passed
Show checks
ci/buildSucceededDetails
- style
- one place for each thing and no microcopy: admin is Users, Runners, Server, Mail, Backups, Health and Audit log, with invites under Users and replication under Backups, and every server setting on one page (backup, replication and mail settings on their own pages
- the storage page shows only the chosen backend's fields)
- a repository's settings are General (with a Features topic for discussions and wiki), Collaborators, Branch protection, Webhooks, Mirrors, Secrets and a Danger zone holding rename, transfer, visibility, archive and delete
- the profile corner holds Notifications, Settings, Admin and Log out, and a signed-in visitor at / gets Home with what needs them and their repositories
- an issue or pull reads quieter: comment tools are words, one person's run of events is one line, Close and Subscribe sit in the head, empty facts say nothing, and the merge box is one line
- CI keeps Run workflow in its head and the badge as a tool word
- Delete account lives under Data
- org members and repo collaborators share one list
- hints, intros, explanatory subs and the server help column are gone everywhere
117 changed files +2726 -4544
- crates/forge-e2e/tests/e2e/orgs_ui_e2e.rs +2 -2
- crates/forge-e2e/tests/e2e/repo_collaborators_e2e.rs +0 -2
- crates/forge-e2e/tests/e2e/repo_rename_e2e.rs +3 -3
- crates/forge-e2e/tests/e2e/repo_settings_e2e.rs +8 -8
- crates/forge-e2e/tests/e2e/repo_transfer_e2e.rs +8 -8
- crates/forge-e2e/tests/e2e/section_nav_e2e.rs +14 -6
- crates/forge-e2e/tests/e2e/ui_prefs_e2e.rs +1 -17
- crates/forge-e2e/tests/e2e/wiki_e2e.rs +5 -5
- crates/forge-web-base/src/i18n/accounts.rs +0 -34
- crates/forge-web-base/src/i18n/admin.rs +10 -329
- crates/forge-web-base/src/i18n/authoring.rs +0 -3
- crates/forge-web-base/src/i18n/browse.rs +1 -9
- crates/forge-web-base/src/i18n/code.rs +8 -28
- crates/forge-web-base/src/i18n/community.rs +0 -66
- crates/forge-web-base/src/i18n/integrations.rs +0 -120
- crates/forge-web-base/src/i18n/issues.rs +33 -62
- crates/forge-web-base/src/i18n/merge_queue.rs +4 -52
- crates/forge-web-base/src/i18n/migrate.rs +0 -80
- crates/forge-web-base/src/i18n/misc.rs +1 -246
- crates/forge-web-base/src/i18n/mod.rs +4 -242
- crates/forge-web-base/src/i18n/needs.rs +1 -1
- crates/forge-web-base/src/i18n/orgs.rs +0 -74
- crates/forge-web-base/src/i18n/packages.rs +0 -42
- crates/forge-web-base/src/i18n/pulls.rs +1 -21
- crates/forge-web-base/src/i18n/pulls_review.rs +2 -14
- crates/forge-web-base/src/i18n/push.rs +0 -7
- crates/forge-web-base/src/i18n/releases_ci.rs +8 -102
- crates/forge-web-base/src/i18n/repo_admin.rs +14 -182
- crates/forge-web/assets/nav.js +45 -225
- crates/forge-web/src/pages/admin_backups.rs +107 -94
- crates/forge-web/src/pages/admin_health.rs +1 -1
- crates/forge-web/src/pages/admin_mail.rs +43 -28
- crates/forge-web/src/pages/admin_replication.rs +84 -68
- crates/forge-web/src/pages/admin_runners.rs +56 -186
- crates/forge-web/src/pages/admin_server.rs +333 -123
- crates/forge-web/src/pages/admin_user_detail.rs +4 -16
- crates/forge-web/src/pages/admin_users.rs +70 -46
- crates/forge-web/src/pages/audit_log.rs +9 -15
- crates/forge-web/src/pages/blame.rs +1 -1
- crates/forge-web/src/pages/blob.rs +1 -1
- crates/forge-web/src/pages/branches.rs +1 -1
- crates/forge-web/src/pages/ci_job.rs +4 -5
- crates/forge-web/src/pages/ci_runs.rs +39 -41
- crates/forge-web/src/pages/ci_tests.rs +1 -1
- crates/forge-web/src/pages/code_search.rs +1 -1
- crates/forge-web/src/pages/discussion_settings.rs +14 -24
- crates/forge-web/src/pages/discussion_view.rs +1 -11
- crates/forge-web/src/pages/discussions.rs +0 -1
- crates/forge-web/src/pages/edit_history.rs +1 -3
- crates/forge-web/src/pages/explore.rs +2 -6
- crates/forge-web/src/pages/forgot.rs +3 -8
- crates/forge-web/src/pages/home.rs +237 -12
- crates/forge-web/src/pages/import.rs +2 -11
- crates/forge-web/src/pages/invites.rs +22 -18
- crates/forge-web/src/pages/issue_parts.rs +315 -125
- crates/forge-web/src/pages/issue_pin.rs +12 -22
- crates/forge-web/src/pages/issue_view.rs +8 -6
- crates/forge-web/src/pages/issues_list.rs +1 -2
- crates/forge-web/src/pages/labels_page.rs +2 -3
- crates/forge-web/src/pages/login.rs +2 -2
- crates/forge-web/src/pages/merge_queue.rs +2 -8
- crates/forge-web/src/pages/milestones_page.rs +5 -8
- crates/forge-web/src/pages/needs_you.rs +2 -4
- crates/forge-web/src/pages/new_repo.rs +0 -3
- crates/forge-web/src/pages/notifications.rs +15 -44
- crates/forge-web/src/pages/org_ctx.rs +0 -11
- crates/forge-web/src/pages/org_members.rs +43 -91
- crates/forge-web/src/pages/org_new.rs +2 -2
- crates/forge-web/src/pages/org_settings.rs +0 -3
- crates/forge-web/src/pages/org_teams.rs +0 -1
- crates/forge-web/src/pages/packages.rs +0 -1
- crates/forge-web/src/pages/packages_oci.rs +1 -3
- crates/forge-web/src/pages/palette.rs +41 -15
- crates/forge-web/src/pages/passkeys.rs +1 -3
- crates/forge-web/src/pages/passkeys_tests.rs +0 -1
- crates/forge-web/src/pages/profile.rs +1 -2
- crates/forge-web/src/pages/profile_pins.rs +0 -1
- crates/forge-web/src/pages/pull_files.rs +5 -14
- crates/forge-web/src/pages/pull_view.rs +46 -56
- crates/forge-web/src/pages/pulls_list.rs +1 -1
- crates/forge-web/src/pages/register.rs +3 -13
- crates/forge-web/src/pages/releases.rs +1 -10
- crates/forge-web/src/pages/releases_tests.rs +0 -4
- crates/forge-web/src/pages/repo.rs +1 -2
- crates/forge-web/src/pages/repo_collaborators.rs +59 -119
- crates/forge-web/src/pages/repo_ctx.rs +0 -3
- crates/forge-web/src/pages/repo_mirrors.rs +3 -31
- crates/forge-web/src/pages/repo_rename.rs +57 -187
- crates/forge-web/src/pages/repo_scrub.rs +1 -5
- crates/forge-web/src/pages/repo_secrets.rs +3 -10
- crates/forge-web/src/pages/repo_security.rs +0 -1
- crates/forge-web/src/pages/repo_settings.rs +272 -176
- crates/forge-web/src/pages/repo_settings_live.rs +0 -15
- crates/forge-web/src/pages/repo_settings_live_tests.rs +1 -1
- crates/forge-web/src/pages/repo_transfer.rs +94 -87
- crates/forge-web/src/pages/repo_webhooks.rs +8 -15
- crates/forge-web/src/pages/review_requests.rs +10 -13
- crates/forge-web/src/pages/settings_appearance.rs +4 -17
- crates/forge-web/src/pages/settings_export.rs +185 -27
- crates/forge-web/src/pages/settings_gpg.rs +0 -1
- crates/forge-web/src/pages/settings_keys.rs +1 -29
- crates/forge-web/src/pages/settings_notifications.rs +1 -3
- crates/forge-web/src/pages/settings_profile.rs +4 -9
- crates/forge-web/src/pages/settings_security.rs +22 -110
- crates/forge-web/src/pages/settings_tokens.rs +1 -11
- crates/forge-web/src/pages/setup.rs +2 -2
- crates/forge-web/src/pages/snippets.rs +0 -1
- crates/forge-web/src/pages/wiki.rs +15 -46
- crates/forge-web/src/views/heatmap.rs +0 -2
- crates/forge-web/src/views/mod.rs +31 -142
- crates/forge-web/src/views/parts.rs +161 -0
- docs/ui-language.md +23 -5
- style/_min_menus.scss +1 -2
- style/_one.scss +18 -55
- style/_one_admin.scss +12 -0
- style/_one_ci.scss +15 -0
- style/_shell.scss +2 -246
crates/forge-e2e/tests/e2e/orgs_ui_e2e.rsmodified+2 -2
| @@ -469,14 +469,14 @@ async fn org_settings_delete_and_audit_end_to_end() { | ||
| 469 | 469 | .await; |
| 470 | 470 | assert_eq!(audit.status, 200, "audit page"); |
| 471 | 471 | assert!( |
| 472 | - audit.body.contains("title=\"org_settings_updated\""), | |
| 472 | + audit.body.contains("data-action=\"org_settings_updated\""), | |
| 473 | 473 | "settings change is audited" |
| 474 | 474 | ); |
| 475 | 475 | let audit = http |
| 476 | 476 | .get("/admin/audit?action=org_deleted", Some(&root_session)) |
| 477 | 477 | .await; |
| 478 | 478 | assert!( |
| 479 | - audit.body.contains("title=\"org_deleted\""), | |
| 479 | + audit.body.contains("data-action=\"org_deleted\""), | |
| 480 | 480 | "org deletion is audited" |
| 481 | 481 | ); |
| 482 | 482 | } |
crates/forge-e2e/tests/e2e/repo_collaborators_e2e.rsmodified+0 -2
| @@ -157,10 +157,8 @@ async fn repo_collaborators_end_to_end() { | ||
| 157 | 157 | ); |
| 158 | 158 | assert_eq!(http.get("/olivia/priv", Some(&bob)).await.status, 404); |
| 159 | 159 | |
| 160 | - // The owner sees the page with the role legend. | |
| 161 | 160 | let owner_page = http.get(page, Some(&olivia)).await; |
| 162 | 161 | assert_eq!(owner_page.status, 200, "owner page"); |
| 163 | - assert!(owner_page.body.contains("view and clone"), "legend missing"); | |
| 164 | 162 | |
| 165 | 163 | // The owner adds bob as Write: bob now sees the private repo, and the row shows the role. |
| 166 | 164 | let csrf = csrf_for(&http, &olivia).await; |
crates/forge-e2e/tests/e2e/repo_rename_e2e.rsmodified+3 -3
| @@ -243,7 +243,7 @@ async fn repo_rename_end_to_end() { | ||
| 243 | 243 | assert_eq!(renamed.status, 303, "rename: {}", renamed.body); |
| 244 | 244 | assert_eq!( |
| 245 | 245 | renamed.header(LOCATION).as_deref(), |
| 246 | - Some("/bob/newpub/settings/rename") | |
| 246 | + Some("/bob/newpub/settings?section=danger") | |
| 247 | 247 | ); |
| 248 | 248 | assert_eq!( |
| 249 | 249 | http.get("/bob/newpub/tree/main/src", None).await.status, |
| @@ -381,14 +381,14 @@ async fn repo_rename_end_to_end() { | ||
| 381 | 381 | assert_eq!(transfer.status, 303, "transfer offered: {}", transfer.body); |
| 382 | 382 | assert_eq!( |
| 383 | 383 | transfer.header(LOCATION).as_deref(), |
| 384 | - Some("/bob/newpub/transfer") | |
| 384 | + Some("/bob/newpub/settings?section=danger") | |
| 385 | 385 | ); |
| 386 | 386 | assert_eq!( |
| 387 | 387 | http.get("/bob/newpub/tree/main/src", None).await.status, |
| 388 | 388 | 200, |
| 389 | 389 | "repo unchanged until accepted" |
| 390 | 390 | ); |
| 391 | - let offered = http.get("/bob/newpub/transfer", Some(&bob)).await; | |
| 391 | + let offered = http.get("/bob/newpub/settings?section=danger", Some(&bob)).await; | |
| 392 | 392 | assert!(offered.body.contains("Pending transfer to carol")); |
| 393 | 393 | let inbox = http.get("/notifications", Some(&carol)).await; |
| 394 | 394 | let accept_action = form_action(&inbox.body, "/accept"); |
crates/forge-e2e/tests/e2e/repo_settings_e2e.rsmodified+8 -8
| @@ -138,8 +138,8 @@ async fn repo_settings_end_to_end() { | ||
| 138 | 138 | .await; |
| 139 | 139 | assert_eq!(carol_page.status, 200, "admin collaborator settings page"); |
| 140 | 140 | assert!( |
| 141 | - !carol_page.body.contains("Danger zone"), | |
| 142 | - "admin collaborator must not see the danger zone" | |
| 141 | + !carol_page.body.contains("/bob/priv/settings/delete\""), | |
| 142 | + "admin collaborator must not see the delete form" | |
| 143 | 143 | ); |
| 144 | 144 | let carol_csrf = csrf_for(&http, &carol).await; |
| 145 | 145 | let carol_delete = http |
| @@ -246,10 +246,10 @@ async fn repo_settings_end_to_end() { | ||
| 246 | 246 | "trash entry is a bare repo" |
| 247 | 247 | ); |
| 248 | 248 | |
| 249 | - // The home page sends a signed-in viewer to their own profile. | |
| 249 | + // The home page is the signed-in viewer's own page, not a redirect. | |
| 250 | 250 | let home = http.get("/", Some(&bob)).await; |
| 251 | - assert_eq!(home.status, 303, "home page for a signed-in viewer"); | |
| 252 | - assert_eq!(home.header(LOCATION).as_deref(), Some("/bob")); | |
| 251 | + assert_eq!(home.status, 200, "home page for a signed-in viewer"); | |
| 252 | + assert!(home.body.contains("Your repositories"), "home lists their repositories"); | |
| 253 | 253 | |
| 254 | 254 | // An admin who does not own the repo can delete it. |
| 255 | 255 | let admin_page = http.get("/bob/priv/settings", Some(&tahinli)).await; |
| @@ -662,8 +662,8 @@ async fn branch_protection_end_to_end() { | ||
| 662 | 662 | .get("/bob/app/settings?section=danger", Some(&carol)) |
| 663 | 663 | .await; |
| 664 | 664 | assert!( |
| 665 | - !carol_danger.body.contains("Danger zone"), | |
| 666 | - "admin collaborator must not see the danger zone" | |
| 665 | + !carol_danger.body.contains("/bob/app/settings/delete\""), | |
| 666 | + "admin collaborator must not see the delete form" | |
| 667 | 667 | ); |
| 668 | 668 | assert!( |
| 669 | 669 | http.get("/bob/app", Some(&carol)) |
| @@ -864,7 +864,7 @@ async fn general_settings_end_to_end() { | ||
| 864 | 864 | page.body |
| 865 | 865 | .contains("href=\"/bob/gen/settings/collaborators\"") |
| 866 | 866 | ); |
| 867 | - assert!(page.body.contains("href=\"/bob/gen/settings/rename\"")); | |
| 867 | + assert!(page.body.contains("href=\"/bob/gen/settings?section=danger\"")); | |
| 868 | 868 | |
| 869 | 869 | // Description: control characters are stripped and it shows on the repo header. |
| 870 | 870 | let csrf = csrf_for(&http, &bob).await; |
crates/forge-e2e/tests/e2e/repo_transfer_e2e.rsmodified+8 -8
| @@ -146,29 +146,29 @@ async fn repo_transfer_offers_declines_cancels_and_org_targets() { | ||
| 146 | 146 | assert_eq!(offered.status, 303, "offer: {}", offered.body); |
| 147 | 147 | assert_eq!( |
| 148 | 148 | offered.header(LOCATION).as_deref(), |
| 149 | - Some("/bob/priv/transfer") | |
| 149 | + Some("/bob/priv/settings?section=danger") | |
| 150 | 150 | ); |
| 151 | - let status = http.get("/bob/priv/transfer", Some(&bob)).await; | |
| 151 | + let status = http.get("/bob/priv/settings?section=danger", Some(&bob)).await; | |
| 152 | 152 | assert!(status.body.contains("Pending transfer to carol")); |
| 153 | 153 | // Carol cannot read the private repo, yet the inbox offers her the actions. |
| 154 | 154 | assert_eq!(http.get("/bob/priv", Some(&carol)).await.status, 404); |
| 155 | 155 | let declined = act_from(&http, &carol, "/notifications", "/decline").await; |
| 156 | 156 | assert_eq!(declined.status, 303, "decline: {}", declined.body); |
| 157 | 157 | assert_eq!(declined.header(LOCATION).as_deref(), Some("/notifications")); |
| 158 | - let after = http.get("/bob/priv/transfer", Some(&bob)).await; | |
| 159 | - assert!(after.body.contains("No transfer is pending")); | |
| 158 | + let after = http.get("/bob/priv/settings?section=danger", Some(&bob)).await; | |
| 159 | + assert!(!after.body.contains("Pending transfer")); | |
| 160 | 160 | assert_eq!(http.get("/bob/priv", Some(&bob)).await.status, 200); |
| 161 | 161 | |
| 162 | 162 | // Offer again, then the initiator cancels it. |
| 163 | 163 | assert_eq!(offer(&http, &bob, "bob", "priv", "carol").await.status, 303); |
| 164 | - let cancelled = act_from(&http, &bob, "/bob/priv/transfer", "/cancel").await; | |
| 164 | + let cancelled = act_from(&http, &bob, "/bob/priv/settings?section=danger", "/cancel").await; | |
| 165 | 165 | assert_eq!(cancelled.status, 303, "cancel: {}", cancelled.body); |
| 166 | 166 | assert_eq!( |
| 167 | 167 | cancelled.header(LOCATION).as_deref(), |
| 168 | - Some("/bob/priv/transfer") | |
| 168 | + Some("/bob/priv/settings?section=danger") | |
| 169 | 169 | ); |
| 170 | - let after = http.get("/bob/priv/transfer", Some(&bob)).await; | |
| 171 | - assert!(after.body.contains("No transfer is pending")); | |
| 170 | + let after = http.get("/bob/priv/settings?section=danger", Some(&bob)).await; | |
| 171 | + assert!(!after.body.contains("Pending transfer")); | |
| 172 | 172 | |
| 173 | 173 | // A transfer to an org: plain members get no accept form, owners do. |
| 174 | 174 | let to_org = offer(&http, &bob, "bob", "pub", "acme").await; |
crates/forge-e2e/tests/e2e/section_nav_e2e.rsmodified+14 -6
| @@ -170,18 +170,26 @@ async fn admin_pages_get_the_admin_tabs() { | ||
| 170 | 170 | let session = login(&env.http, "tahinli", PW).await; |
| 171 | 171 | let want = [ |
| 172 | 172 | "/admin/users", |
| 173 | - "/admin/invites", | |
| 174 | - "/admin/audit", | |
| 175 | 173 | "/admin/runners", |
| 176 | - "/admin/mail", | |
| 177 | 174 | "/admin/server", |
| 175 | + "/admin/mail", | |
| 178 | 176 | "/admin/backups", |
| 179 | - "/admin/replication", | |
| 177 | + "/admin/audit", | |
| 180 | 178 | ]; |
| 181 | - for path in want { | |
| 179 | + // Invites live under Users and replication under Backups: their own tab is the one marked. | |
| 180 | + for (path, current) in [ | |
| 181 | + ("/admin/users", "/admin/users"), | |
| 182 | + ("/admin/invites", "/admin/users"), | |
| 183 | + ("/admin/audit", "/admin/audit"), | |
| 184 | + ("/admin/runners", "/admin/runners"), | |
| 185 | + ("/admin/mail", "/admin/mail"), | |
| 186 | + ("/admin/server", "/admin/server"), | |
| 187 | + ("/admin/backups", "/admin/backups"), | |
| 188 | + ("/admin/replication", "/admin/backups"), | |
| 189 | + ] { | |
| 182 | 190 | let page = env.http.get(path, Some(&session)).await; |
| 183 | 191 | assert_eq!(page.status, 200, "GET {path}"); |
| 184 | - assert_tabs(&page.body, path, &want); | |
| 192 | + assert_tabs(&page.body, current, &want); | |
| 185 | 193 | assert!( |
| 186 | 194 | !tab_links(&page.body).iter().any(|(h, _)| h == "/explore"), |
| 187 | 195 | "global links are swapped out" |
crates/forge-e2e/tests/e2e/ui_prefs_e2e.rsmodified+1 -17
| @@ -59,9 +59,8 @@ fn checked_radio(body: &str, name: &str) -> Option<String> { | ||
| 59 | 59 | /// The option value that is selected in the `<select name="...">` on a page. |
| 60 | 60 | fn selected_option(body: &str, select: &str) -> Option<String> { |
| 61 | 61 | let doc = scraper::Html::parse_document(body); |
| 62 | - // A select's chosen option, or the pressed button of a choice row. | |
| 63 | 62 | let selector = scraper::Selector::parse(&format!( |
| 64 | - "select[name=\"{select}\"] option[selected], button[name=\"{select}\"][aria-pressed=\"true\"]" | |
| 63 | + "select[name=\"{select}\"] option[selected], input[name=\"{select}\"][checked], button[name=\"{select}\"][aria-pressed=\"true\"]" | |
| 65 | 64 | )) |
| 66 | 65 | .expect("selector"); |
| 67 | 66 | doc.select(&selector) |
| @@ -95,17 +94,6 @@ fn theme_button(body: &str) -> (String, String) { | ||
| 95 | 94 | (value, label) |
| 96 | 95 | } |
| 97 | 96 | |
| 98 | -/// The theme the profile corner's three-way choice shows as pressed, for signed-in users. | |
| 99 | -fn pressed_theme(body: &str) -> Option<String> { | |
| 100 | - let doc = scraper::Html::parse_document(body); | |
| 101 | - let selector = scraper::Selector::parse("form.corner-theme-set button[aria-pressed=\"true\"]") | |
| 102 | - .expect("selector"); | |
| 103 | - doc.select(&selector) | |
| 104 | - .next() | |
| 105 | - .and_then(|el| el.value().attr("value")) | |
| 106 | - .map(str::to_owned) | |
| 107 | -} | |
| 108 | - | |
| 109 | 97 | /// Runs an admin subcommand with the password in FORGE_PASSWORD and asserts it succeeded. |
| 110 | 98 | fn admin(config: &Path, args: &[&str]) { |
| 111 | 99 | let out = Command::new(bin()) |
| @@ -646,7 +634,6 @@ async fn theme_button_cycles_light_dark_auto_light_for_signed_in_users() { | ||
| 646 | 634 | let page = env.http.get(back, Some(&session)).await; |
| 647 | 635 | let csrf = input_value(&page.body, "csrf"); |
| 648 | 636 | assert_eq!(html_theme(&page.body).as_deref(), Some("light")); |
| 649 | - assert_eq!(pressed_theme(&page.body).as_deref(), Some("light")); | |
| 650 | 637 | |
| 651 | 638 | let step = env |
| 652 | 639 | .http |
| @@ -659,7 +646,6 @@ async fn theme_button_cycles_light_dark_auto_light_for_signed_in_users() { | ||
| 659 | 646 | assert_eq!(step.status, 303, "light to dark: {}", step.body); |
| 660 | 647 | let page = env.http.get(back, Some(&session)).await; |
| 661 | 648 | assert_eq!(html_theme(&page.body).as_deref(), Some("dark")); |
| 662 | - assert_eq!(pressed_theme(&page.body).as_deref(), Some("dark")); | |
| 663 | 649 | |
| 664 | 650 | let step = env |
| 665 | 651 | .http |
| @@ -677,7 +663,6 @@ async fn theme_button_cycles_light_dark_auto_light_for_signed_in_users() { | ||
| 677 | 663 | "signed-in toggle to auto stores 'auto'" |
| 678 | 664 | ); |
| 679 | 665 | assert_eq!(html_theme(&page.body), None, "auto renders no data-theme"); |
| 680 | - assert_eq!(pressed_theme(&page.body).as_deref(), Some("auto")); | |
| 681 | 666 | |
| 682 | 667 | let step = env |
| 683 | 668 | .http |
| @@ -690,7 +675,6 @@ async fn theme_button_cycles_light_dark_auto_light_for_signed_in_users() { | ||
| 690 | 675 | assert_eq!(step.status, 303, "auto to light: {}", step.body); |
| 691 | 676 | let page = env.http.get(back, Some(&session)).await; |
| 692 | 677 | assert_eq!(html_theme(&page.body).as_deref(), Some("light")); |
| 693 | - assert_eq!(pressed_theme(&page.body).as_deref(), Some("light")); | |
| 694 | 678 | } |
| 695 | 679 | |
| 696 | 680 | #[tokio::test] |
crates/forge-e2e/tests/e2e/wiki_e2e.rsmodified+5 -5
| @@ -242,7 +242,7 @@ async fn wiki_end_to_end() { | ||
| 242 | 242 | .await; |
| 243 | 243 | assert_eq!(audit.status, 200, "audit page"); |
| 244 | 244 | assert!( |
| 245 | - audit.body.contains("title=\"wiki_pushed\""), | |
| 245 | + audit.body.contains("data-action=\"wiki_pushed\""), | |
| 246 | 246 | "the wiki push is audited: {}", |
| 247 | 247 | audit.body |
| 248 | 248 | ); |
| @@ -299,15 +299,15 @@ async fn wiki_end_to_end() { | ||
| 299 | 299 | assert!(!denied.status.success(), "read-only push must fail"); |
| 300 | 300 | |
| 301 | 301 | // Bob turns the wiki off on the settings page. Carol, who is not an admin, cannot. |
| 302 | - let settings = page_body(&http, "/bob/proj/settings/wiki", Some(&bob)).await; | |
| 302 | + let settings = page_body(&http, "/bob/proj/settings", Some(&bob)).await; | |
| 303 | 303 | assert!( |
| 304 | - settings.body.contains("Enable the wiki"), | |
| 304 | + settings.body.contains("action=\"/bob/proj/settings/wiki\""), | |
| 305 | 305 | "{}", |
| 306 | 306 | settings.body |
| 307 | 307 | ); |
| 308 | - let forbidden_toggle = http.get("/bob/proj/settings/wiki", Some(&carol)).await; | |
| 308 | + let forbidden_toggle = http.get("/bob/proj/settings", Some(&carol)).await; | |
| 309 | 309 | assert_eq!( |
| 310 | - forbidden_toggle.status, 404, | |
| 310 | + forbidden_toggle.status, 403, | |
| 311 | 311 | "only admins see wiki settings" |
| 312 | 312 | ); |
| 313 | 313 | let off = http |
crates/forge-web-base/src/i18n/accounts.rsmodified+0 -34
| @@ -15,16 +15,12 @@ pub enum A { | ||
| 15 | 15 | Suspend, |
| 16 | 16 | Unsuspend, |
| 17 | 17 | SuspendReason, |
| 18 | - SuspendHelp, | |
| 19 | 18 | GrantAdmin, |
| 20 | 19 | RevokeAdmin, |
| 21 | 20 | AdminHelp, |
| 22 | - ResetPassword, | |
| 23 | 21 | GenerateLink, |
| 24 | - ResetHelp, | |
| 25 | 22 | ResetLinkReady, |
| 26 | 23 | Disable2fa, |
| 27 | - Disable2faHelp, | |
| 28 | 24 | Actions, |
| 29 | 25 | OkSuspended, |
| 30 | 26 | OkUnsuspended, |
| @@ -53,15 +49,11 @@ pub enum A { | ||
| 53 | 49 | Ok, |
| 54 | 50 | Error, |
| 55 | 51 | Lagging, |
| 56 | - HealthIntro, | |
| 57 | 52 | Storage, |
| 58 | 53 | Services, |
| 59 | 54 | Fine, |
| 60 | 55 | DiskUsed, |
| 61 | 56 | Joined, |
| 62 | - NoPasskeysToRemove, | |
| 63 | - TwoFactorNotOn, | |
| 64 | - DeleteHelp, | |
| 65 | 57 | } |
| 66 | 58 | |
| 67 | 59 | pub fn t(lang: Lang, key: A) -> &'static str { |
| @@ -90,36 +82,18 @@ pub fn t(lang: Lang, key: A) -> &'static str { | ||
| 90 | 82 | (Unsuspend, Tr) => "Askıyı kaldır", |
| 91 | 83 | (SuspendReason, En) => "Reason shown on the login page", |
| 92 | 84 | (SuspendReason, Tr) => "Giriş sayfasında gösterilen neden", |
| 93 | - (SuspendHelp, En) => { | |
| 94 | - "Signs the user out everywhere and stops their tokens and keys, including git over SSH and HTTP." | |
| 95 | - } | |
| 96 | - (SuspendHelp, Tr) => { | |
| 97 | - "Kullanıcının tüm oturumlarını kapatır; belirteçlerini ve anahtarlarını (SSH ve HTTP üzerinden git dahil) durdurur." | |
| 98 | - } | |
| 99 | 85 | (GrantAdmin, En) => "Make administrator", |
| 100 | 86 | (GrantAdmin, Tr) => "Yönetici yap", |
| 101 | 87 | (RevokeAdmin, En) => "Remove administrator", |
| 102 | 88 | (RevokeAdmin, Tr) => "Yöneticiliği kaldır", |
| 103 | 89 | (AdminHelp, En) => "The last administrator cannot be demoted.", |
| 104 | 90 | (AdminHelp, Tr) => "Son yönetici yetkisiz bırakılamaz.", |
| 105 | - (ResetPassword, En) => "Reset password", | |
| 106 | - (ResetPassword, Tr) => "Parolayı sıfırla", | |
| 107 | 91 | (GenerateLink, En) => "Generate reset link", |
| 108 | 92 | (GenerateLink, Tr) => "Sıfırlama bağlantısı üret", |
| 109 | - (ResetHelp, En) => { | |
| 110 | - "Makes a one-time link that works for an hour. Their current sessions are signed out." | |
| 111 | - } | |
| 112 | - (ResetHelp, Tr) => { | |
| 113 | - "Bir saat geçerli, tek kullanımlık bir bağlantı üretir. Mevcut oturumları kapatılır." | |
| 114 | - } | |
| 115 | 93 | (ResetLinkReady, En) => "One-time reset link. It is shown only now:", |
| 116 | 94 | (ResetLinkReady, Tr) => "Tek kullanımlık sıfırlama bağlantısı. Yalnızca şimdi gösterilir:", |
| 117 | 95 | (Disable2fa, En) => "Disable two-factor", |
| 118 | 96 | (Disable2fa, Tr) => "İki adımlı doğrulamayı kapat", |
| 119 | - (Disable2faHelp, En) => "For a locked-out user. Clears the secret and the recovery codes.", | |
| 120 | - (Disable2faHelp, Tr) => { | |
| 121 | - "Hesabına giremeyen kullanıcı için. Sırrı ve kurtarma kodlarını siler." | |
| 122 | - } | |
| 123 | 97 | (Actions, En) => "Actions", |
| 124 | 98 | (Actions, Tr) => "İşlemler", |
| 125 | 99 | (OkSuspended, En) => "Account suspended.", |
| @@ -176,8 +150,6 @@ pub fn t(lang: Lang, key: A) -> &'static str { | ||
| 176 | 150 | (Error, Tr) => "Hata", |
| 177 | 151 | (Lagging, En) => "Lagging", |
| 178 | 152 | (Lagging, Tr) => "Geride", |
| 179 | - (HealthIntro, En) => "Read when the page loads. Reload the page for fresh numbers.", | |
| 180 | - (HealthIntro, Tr) => "Sayfa açılırken okunur. Güncel değerler için sayfayı yenileyin.", | |
| 181 | 153 | (Storage, En) => "Storage", |
| 182 | 154 | (Storage, Tr) => "Depolama", |
| 183 | 155 | (Services, En) => "Services", |
| @@ -188,12 +160,6 @@ pub fn t(lang: Lang, key: A) -> &'static str { | ||
| 188 | 160 | (DiskUsed, Tr) => "kullanıldı", |
| 189 | 161 | (Joined, En) => "Joined", |
| 190 | 162 | (Joined, Tr) => "Katılım", |
| 191 | - (NoPasskeysToRemove, En) => "No passkeys to remove", | |
| 192 | - (NoPasskeysToRemove, Tr) => "Kaldırılacak geçiş anahtarı yok", | |
| 193 | - (TwoFactorNotOn, En) => "Two-factor is not on", | |
| 194 | - (TwoFactorNotOn, Tr) => "İki adımlı doğrulama açık değil", | |
| 195 | - (DeleteHelp, En) => "Removes the account, its sessions and keys. This cannot be undone.", | |
| 196 | - (DeleteHelp, Tr) => "Hesabı, oturumlarını ve anahtarlarını siler. Bu işlem geri alınamaz.", | |
| 197 | 163 | } |
| 198 | 164 | } |
| 199 | 165 |
crates/forge-web-base/src/i18n/admin.rsmodified+10 -329
| @@ -9,24 +9,17 @@ use super::Lang; | ||
| 9 | 9 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] |
| 10 | 10 | pub enum K { |
| 11 | 11 | ActionLabel, |
| 12 | - ActorUsername, | |
| 13 | 12 | AddARunner, |
| 14 | 13 | AdminArea, |
| 15 | 14 | Administrator, |
| 16 | 15 | AllActions, |
| 17 | - RowActions, | |
| 18 | 16 | Anonymous, |
| 19 | - AtLeast12Chars, | |
| 20 | - AuditIntro, | |
| 21 | 17 | AuditLog, |
| 22 | 18 | BackToRunners, |
| 23 | 19 | BackToUsers, |
| 24 | - BackupInterval, | |
| 25 | 20 | Backups, |
| 26 | - BackupsIntro, | |
| 27 | 21 | CiRunners, |
| 28 | 22 | CopyTokenNow, |
| 29 | - CreateAUser, | |
| 30 | 23 | CreateRegistrationToken, |
| 31 | 24 | CreateUser, |
| 32 | 25 | Database, |
| @@ -54,27 +47,16 @@ pub enum K { | ||
| 54 | 47 | FromName, |
| 55 | 48 | Fsck, |
| 56 | 49 | Healthcheck, |
| 57 | - HealthcheckNotSet, | |
| 58 | - HealthcheckSet, | |
| 59 | - HealthcheckUrlInvalid, | |
| 60 | 50 | HealthError, |
| 61 | 51 | HealthLagging, |
| 62 | 52 | HealthNever, |
| 63 | 53 | HealthOk, |
| 64 | - Interval, | |
| 65 | 54 | Invites, |
| 66 | 55 | LastDbAttempt, |
| 67 | 56 | LastDbSnapshotShipped, |
| 68 | 57 | LastSeen, |
| 69 | 58 | LastSuccess, |
| 70 | 59 | ServerSettings, |
| 71 | - ServerSettingsIntro, | |
| 72 | - SrvTabGeneral, | |
| 73 | - SrvTabLimits, | |
| 74 | - SrvTabStorage, | |
| 75 | - SrvTabBackups, | |
| 76 | - SrvTabIntegrations, | |
| 77 | - SrvTabAlerts, | |
| 78 | 60 | SrvSaved, |
| 79 | 61 | SrvNothingChanged, |
| 80 | 62 | SrvResetDone, |
| @@ -83,17 +65,12 @@ pub enum K { | ||
| 83 | 65 | SrvKindLive, |
| 84 | 66 | SrvKindRestart, |
| 85 | 67 | SrvKindReadOnly, |
| 86 | - SrvSourceDefault, | |
| 87 | - SrvSourceFile, | |
| 88 | - SrvSourceUi, | |
| 89 | 68 | SrvSecretSet, |
| 90 | 69 | SrvSecretNotSet, |
| 91 | - SrvSecretHint, | |
| 92 | 70 | SrvFileValue, |
| 93 | 71 | SrvEmpty, |
| 94 | 72 | Mail, |
| 95 | 73 | MailHost, |
| 96 | - MailIntro, | |
| 97 | 74 | MailTabSettings, |
| 98 | 75 | MailTabQueue, |
| 99 | 76 | MailFilterAll, |
| @@ -103,9 +80,6 @@ pub enum K { | ||
| 103 | 80 | MailNotFailed, |
| 104 | 81 | MailDiscarded, |
| 105 | 82 | MailSentAt, |
| 106 | - MailTransportNote, | |
| 107 | - MailTransportInUse, | |
| 108 | - MailQueueIntro, | |
| 109 | 83 | MailNothingMatches, |
| 110 | 84 | MailQueueEmpty, |
| 111 | 85 | MailPort, |
| @@ -117,25 +91,15 @@ pub enum K { | ||
| 117 | 91 | NoRunnersYet, |
| 118 | 92 | NoRunnerWithId, |
| 119 | 93 | NoRunsYet, |
| 120 | - BackupsEmptyHint, | |
| 121 | - ReplicationConfigHint, | |
| 122 | - ReposEmptyHint, | |
| 123 | - RunnersEmptyHint, | |
| 124 | 94 | Older, |
| 125 | - OwnLogIntro, | |
| 126 | - PasswordStoredHint, | |
| 127 | 95 | RecentRuns, |
| 128 | 96 | ReconcileNow, |
| 129 | 97 | ReconcileStarted, |
| 130 | 98 | RegisterARunner, |
| 131 | 99 | RegistrationToken, |
| 132 | 100 | RemovedWithAccount, |
| 133 | - ReplacePrefix, | |
| 134 | - ReplaceSuffix, | |
| 135 | 101 | Replication, |
| 136 | - ReplicationIntro, | |
| 137 | 102 | ReplicationOff, |
| 138 | - ReplicationTarget, | |
| 139 | 103 | Repos, |
| 140 | 104 | Retention, |
| 141 | 105 | Role, |
| @@ -159,22 +123,9 @@ pub enum K { | ||
| 159 | 123 | StatusFailed, |
| 160 | 124 | StatusInProgress, |
| 161 | 125 | StatusOk, |
| 162 | - TableActor, | |
| 163 | - TableDetails, | |
| 164 | - TableDuration, | |
| 165 | - TableKind, | |
| 166 | 126 | TableLastError, |
| 167 | 127 | TableQueued, |
| 168 | - TableResult, | |
| 169 | - TableSize, | |
| 170 | - TableStarted, | |
| 171 | - TableState, | |
| 172 | - TableSubject, | |
| 173 | - TableTarget, | |
| 174 | - TableTo, | |
| 175 | 128 | TableTries, |
| 176 | - TableTrigger, | |
| 177 | - TableWhen, | |
| 178 | 129 | TestQueued, |
| 179 | 130 | Token, |
| 180 | 131 | TokenCreateFailed, |
| @@ -194,8 +145,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 194 | 145 | match (key, lang) { |
| 195 | 146 | (ActionLabel, En) => "Action", |
| 196 | 147 | (ActionLabel, Tr) => "İşlem", |
| 197 | - (ActorUsername, En) => "Actor username", | |
| 198 | - (ActorUsername, Tr) => "Yapan kullanıcı adı", | |
| 199 | 148 | (AddARunner, En) => "Add a runner", |
| 200 | 149 | (AddARunner, Tr) => "Çalıştırıcı ekle", |
| 201 | 150 | (AdminArea, En) => "Admin", |
| @@ -204,44 +153,20 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 204 | 153 | (Administrator, Tr) => "Yönetici", |
| 205 | 154 | (AllActions, En) => "All actions", |
| 206 | 155 | (AllActions, Tr) => "Tüm işlemler", |
| 207 | - (RowActions, En) => "Actions", | |
| 208 | - (RowActions, Tr) => "İşlemler", | |
| 209 | 156 | (Anonymous, En) => "anonymous", |
| 210 | 157 | (Anonymous, Tr) => "anonim", |
| 211 | - (AtLeast12Chars, En) => "At least 12 characters.", | |
| 212 | - (AtLeast12Chars, Tr) => "En az 12 karakter.", | |
| 213 | - (AuditIntro, En) => { | |
| 214 | - "Security events across the instance, newest first. Times are in your timezone." | |
| 215 | - } | |
| 216 | - (AuditIntro, Tr) => { | |
| 217 | - "Sunucudaki güvenlik olayları, en yeniden en eskiye sıralı. Saatler sizin saat diliminizde gösterilir." | |
| 218 | - } | |
| 219 | 158 | (AuditLog, En) => "Audit log", |
| 220 | 159 | (AuditLog, Tr) => "Denetim günlüğü", |
| 221 | 160 | (BackToRunners, En) => "Back to runners", |
| 222 | 161 | (BackToRunners, Tr) => "Çalıştırıcılara dön", |
| 223 | 162 | (BackToUsers, En) => "Back to users", |
| 224 | 163 | (BackToUsers, Tr) => "Kullanıcılara dön", |
| 225 | - (BackupInterval, En) => "Backup interval", | |
| 226 | - (BackupInterval, Tr) => "Yedekleme aralığı", | |
| 227 | 164 | (Backups, En) => "Backups", |
| 228 | 165 | (Backups, Tr) => "Yedeklemeler", |
| 229 | - (BackupsIntro, En) => { | |
| 230 | - "Backup sets and integrity checks. Times are in your timezone. Settings come from the [backup] section of the config file." | |
| 231 | - } | |
| 232 | - (BackupsIntro, Tr) => { | |
| 233 | - "Yedek kümeleri ve bütünlük denetimleri. Saatler sizin saat diliminizde gösterilir. Ayarlar, yapılandırma dosyasındaki [backup] bölümünden gelir." | |
| 234 | - } | |
| 235 | 166 | (CiRunners, En) => "CI runners", |
| 236 | 167 | (CiRunners, Tr) => "CI çalıştırıcıları", |
| 237 | - (CopyTokenNow, En) => { | |
| 238 | - "Copy this token now. It is shown once and cannot be looked up again." | |
| 239 | - } | |
| 240 | - (CopyTokenNow, Tr) => { | |
| 241 | - "Bu belirteci şimdi kopyalayın. Yalnızca bir kez gösterilir ve sonradan yeniden görüntülenemez." | |
| 242 | - } | |
| 243 | - (CreateAUser, En) => "Create a user", | |
| 244 | - (CreateAUser, Tr) => "Kullanıcı oluştur", | |
| 168 | + (CopyTokenNow, En) => "Shown once.", | |
| 169 | + (CopyTokenNow, Tr) => "Bir kez gösterilir.", | |
| 245 | 170 | (CreateRegistrationToken, En) => "Create registration token", |
| 246 | 171 | (CreateRegistrationToken, Tr) => "Kayıt belirteci oluştur", |
| 247 | 172 | (CreateUser, En) => "Create user", |
| @@ -250,12 +175,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 250 | 175 | (Database, Tr) => "Veritabanı", |
| 251 | 176 | (DatabaseErrorPrefix, En) => "Database: ", |
| 252 | 177 | (DatabaseErrorPrefix, Tr) => "Veritabanı: ", |
| 253 | - (DeleteAccountRest, En) => { | |
| 254 | - ". Its sessions, SSH keys, access tokens and stars are removed. Its issues, comments and reviews stay and are shown as written by the deleted user. This cannot be undone." | |
| 255 | - } | |
| 256 | - (DeleteAccountRest, Tr) => { | |
| 257 | - " hesabını siler. Oturumları, SSH anahtarları, erişim belirteçleri ve yıldızları kaldırılır. Sorunları, yorumları ve incelemeleri kalır; silinmiş kullanıcının adıyla gösterilir. Bu işlem geri alınamaz." | |
| 258 | - } | |
| 178 | + (DeleteAccountRest, En) => ". This cannot be undone.", | |
| 179 | + (DeleteAccountRest, Tr) => " hesabını siler. Bu işlem geri alınamaz.", | |
| 259 | 180 | (DeletesAccount, En) => "This deletes the account ", |
| 260 | 181 | (DeletesAccount, Tr) => "Bu işlem ", |
| 261 | 182 | (DeleteOrgTitle, En) => "Delete organization", |
| @@ -272,14 +193,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 272 | 193 | (Enable, Tr) => "Etkinleştir", |
| 273 | 194 | (OpenOrgSettings, En) => "Open organization settings", |
| 274 | 195 | (OpenOrgSettings, Tr) => "Kuruluş ayarlarını aç", |
| 275 | - (OrgNotAUser, En) => { | |
| 276 | - " is an organization, not a user account, so it cannot be deleted from here. One of its owners deletes it from the organization's settings." | |
| 277 | - } | |
| 278 | - (OrgNotAUser, Tr) => { | |
| 279 | - " bir kuruluştur, kullanıcı hesabı değildir, bu yüzden buradan silinemez. Kuruluşu sahiplerinden biri, kuruluşun ayarlarından siler." | |
| 280 | - } | |
| 281 | - (OrgReposFirst, En) => "It can be deleted once it owns no repositories. It still owns:", | |
| 282 | - (OrgReposFirst, Tr) => "Hiç deposu kalmadığında silinebilir. Hâlâ sahip olduğu depolar:", | |
| 196 | + (OrgNotAUser, En) => " is an organization.", | |
| 197 | + (OrgNotAUser, Tr) => " bir kuruluştur.", | |
| 198 | + (OrgReposFirst, En) => "Repositories it still owns:", | |
| 199 | + (OrgReposFirst, Tr) => "Hâlâ sahip olduğu depolar:", | |
| 283 | 200 | (ErrAccountCannotBeDeleted, En) => "this account cannot be deleted", |
| 284 | 201 | (ErrAccountCannotBeDeleted, Tr) => "bu hesap silinemez", |
| 285 | 202 | (ErrBackupsNotConfigured, En) => { |
| @@ -320,12 +237,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 320 | 237 | (Fsck, Tr) => "Fsck", |
| 321 | 238 | (Healthcheck, En) => "Healthcheck", |
| 322 | 239 | (Healthcheck, Tr) => "Sağlık denetimi", |
| 323 | - (HealthcheckNotSet, En) => "not set", | |
| 324 | - (HealthcheckNotSet, Tr) => "ayarlanmamış", | |
| 325 | - (HealthcheckSet, En) => "set", | |
| 326 | - (HealthcheckSet, Tr) => "ayarlı", | |
| 327 | - (HealthcheckUrlInvalid, En) => "set (the URL is not valid)", | |
| 328 | - (HealthcheckUrlInvalid, Tr) => "ayarlı (URL geçersiz)", | |
| 329 | 240 | (HealthError, En) => "error", |
| 330 | 241 | (HealthError, Tr) => "hata", |
| 331 | 242 | (HealthLagging, En) => "lagging", |
| @@ -334,8 +245,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 334 | 245 | (HealthNever, Tr) => "hiç çoğaltılmadı", |
| 335 | 246 | (HealthOk, En) => "ok", |
| 336 | 247 | (HealthOk, Tr) => "tamam", |
| 337 | - (Interval, En) => "Interval", | |
| 338 | - (Interval, Tr) => "Aralık", | |
| 339 | 248 | (Invites, En) => "Invites", |
| 340 | 249 | (Invites, Tr) => "Davetler", |
| 341 | 250 | (LastDbAttempt, En) => "Last database attempt", |
| @@ -348,24 +257,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 348 | 257 | (LastSuccess, Tr) => "Son başarı", |
| 349 | 258 | (ServerSettings, En) => "Server", |
| 350 | 259 | (ServerSettings, Tr) => "Sunucu", |
| 351 | - (ServerSettingsIntro, En) => { | |
| 352 | - "The forge's own settings. A saved value overrides the config file; the file is never rewritten. Live settings apply at once, the others wait for a restart." | |
| 353 | - } | |
| 354 | - (ServerSettingsIntro, Tr) => { | |
| 355 | - "Forge'un kendi ayarları. Kaydedilen değer yapılandırma dosyasını geçersiz kılar; dosya hiç yeniden yazılmaz. Canlı ayarlar hemen uygulanır, diğerleri yeniden başlatmayı bekler." | |
| 356 | - } | |
| 357 | - (SrvTabGeneral, En) => "General", | |
| 358 | - (SrvTabGeneral, Tr) => "Genel", | |
| 359 | - (SrvTabLimits, En) => "CI and limits", | |
| 360 | - (SrvTabLimits, Tr) => "CI ve sınırlar", | |
| 361 | - (SrvTabStorage, En) => "Storage", | |
| 362 | - (SrvTabStorage, Tr) => "Depolama", | |
| 363 | - (SrvTabBackups, En) => "Backups", | |
| 364 | - (SrvTabBackups, Tr) => "Yedekler", | |
| 365 | - (SrvTabIntegrations, En) => "Integrations", | |
| 366 | - (SrvTabIntegrations, Tr) => "Entegrasyonlar", | |
| 367 | - (SrvTabAlerts, En) => "Alerts", | |
| 368 | - (SrvTabAlerts, Tr) => "Uyarılar", | |
| 369 | 260 | (SrvSaved, En) => "Server settings saved.", |
| 370 | 261 | (SrvSaved, Tr) => "Sunucu ayarları kaydedildi.", |
| 371 | 262 | (SrvNothingChanged, En) => "Nothing changed.", |
| @@ -382,18 +273,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 382 | 273 | (SrvKindRestart, Tr) => "yeniden başlatma", |
| 383 | 274 | (SrvKindReadOnly, En) => "read-only", |
| 384 | 275 | (SrvKindReadOnly, Tr) => "salt okunur", |
| 385 | - (SrvSourceDefault, En) => "default", | |
| 386 | - (SrvSourceDefault, Tr) => "varsayılan", | |
| 387 | - (SrvSourceFile, En) => "file", | |
| 388 | - (SrvSourceFile, Tr) => "dosya", | |
| 389 | - (SrvSourceUi, En) => "UI", | |
| 390 | - (SrvSourceUi, Tr) => "arayüz", | |
| 391 | 276 | (SrvSecretSet, En) => "set", |
| 392 | 277 | (SrvSecretSet, Tr) => "ayarlı", |
| 393 | 278 | (SrvSecretNotSet, En) => "not set", |
| 394 | 279 | (SrvSecretNotSet, Tr) => "ayarlı değil", |
| 395 | - (SrvSecretHint, En) => "Write-only. Leave blank to keep the current value.", | |
| 396 | - (SrvSecretHint, Tr) => "Yalnızca yazılır. Mevcut değeri korumak için boş bırakın.", | |
| 397 | 280 | (SrvFileValue, En) => "File value", |
| 398 | 281 | (SrvFileValue, Tr) => "Dosya değeri", |
| 399 | 282 | (SrvEmpty, En) => "(empty)", |
| @@ -422,32 +305,12 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 422 | 305 | (MailDiscarded, Tr) => "Mesajdan vazgeçildi.", |
| 423 | 306 | (MailSentAt, En) => "Sent", |
| 424 | 307 | (MailSentAt, Tr) => "Gönderildi", |
| 425 | - (MailTransportNote, En) => { | |
| 426 | - "The SMTP account is stored in the database and applies to the next send, with no restart. The transport comes from forge.toml, in the [mail] section." | |
| 427 | - } | |
| 428 | - (MailTransportNote, Tr) => { | |
| 429 | - "SMTP hesabı veritabanında tutulur ve bir sonraki gönderimde, yeniden başlatmadan geçerli olur. Taşıma yöntemi forge.toml dosyasındaki [mail] bölümünden gelir." | |
| 430 | - } | |
| 431 | - (MailTransportInUse, En) => "Transport in use:", | |
| 432 | - (MailTransportInUse, Tr) => "Kullanılan taşıma:", | |
| 433 | - (MailQueueIntro, En) => { | |
| 434 | - "Every message goes through this queue. A failed try is retried on a backoff; a message that keeps failing is marked failed, and you can retry or discard it here." | |
| 435 | - } | |
| 436 | - (MailQueueIntro, Tr) => { | |
| 437 | - "Her ileti bu kuyruktan geçer. Başarısız gönderim, aralığı artan şekilde yeniden denenir; sürekli başarısız olan ileti başarısız işaretlenir ve burada yeniden denenebilir ya da vazgeçilebilir." | |
| 438 | - } | |
| 439 | 308 | (MailNothingMatches, En) => "No message is in this state.", |
| 440 | 309 | (MailNothingMatches, Tr) => "Bu durumda ileti yok.", |
| 441 | 310 | (MailQueueEmpty, En) => "Nothing waiting to be sent.", |
| 442 | 311 | (MailQueueEmpty, Tr) => "Gönderilmeyi bekleyen ileti yok.", |
| 443 | 312 | (MailHost, En) => "Host", |
| 444 | 313 | (MailHost, Tr) => "Sunucu", |
| 445 | - (MailIntro, En) => { | |
| 446 | - "Outgoing mail for password resets, verification and notifications. Mail is sent from a queue with retries; a message that keeps failing is marked as gave up." | |
| 447 | - } | |
| 448 | - (MailIntro, Tr) => { | |
| 449 | - "Parola sıfırlama, doğrulama ve bildirimler için giden e-posta. E-postalar yeniden denemelerle bir kuyruktan gönderilir; sürekli başarısız olan bir ileti vazgeçildi olarak işaretlenir." | |
| 450 | - } | |
| 451 | 314 | (MailPort, En) => "Port", |
| 452 | 315 | (MailPort, Tr) => "Bağlantı noktası", |
| 453 | 316 | (MailSettingsSaved, En) => "Mail settings saved.", |
| @@ -466,34 +329,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 466 | 329 | (NoRunnerWithId, Tr) => "Bu kimlikte bir çalıştırıcı yok. Hiçbir şey değiştirilmedi.", |
| 467 | 330 | (NoRunsYet, En) => "No runs yet.", |
| 468 | 331 | (NoRunsYet, Tr) => "Henüz çalıştırma yok.", |
| 469 | - (BackupsEmptyHint, En) => "Scheduled and manual runs are listed here.", | |
| 470 | - (BackupsEmptyHint, Tr) => "Zamanlanmış ve elle başlatılan çalıştırmalar burada listelenir.", | |
| 471 | - (ReplicationConfigHint, En) => { | |
| 472 | - "Replication is set under [replication] in the config file. See docs/backup.md." | |
| 473 | - } | |
| 474 | - (ReplicationConfigHint, Tr) => { | |
| 475 | - "Replikasyon, yapılandırma dosyasındaki [replication] bölümünde ayarlanır. Bkz. docs/backup.md." | |
| 476 | - } | |
| 477 | - (ReposEmptyHint, En) => "Each repo is copied to the standby and listed here.", | |
| 478 | - (ReposEmptyHint, Tr) => "Her depo yedek sunucuya kopyalanır ve burada listelenir.", | |
| 479 | - (RunnersEmptyHint, En) => { | |
| 480 | - "Create a registration token below, then run this command on the runner machine." | |
| 481 | - } | |
| 482 | - (RunnersEmptyHint, Tr) => { | |
| 483 | - "Aşağıdan bir kayıt belirteci oluşturun, ardından bu komutu çalıştırıcı makinesinde çalıştırın." | |
| 484 | - } | |
| 485 | 332 | (Older, En) => "Older", |
| 486 | 333 | (Older, Tr) => "Daha eski", |
| 487 | - (OwnLogIntro, En) => { | |
| 488 | - "Sign-ins, changes to your account and keys, and sessions you revoked. Times are in your timezone." | |
| 489 | - } | |
| 490 | - (OwnLogIntro, Tr) => { | |
| 491 | - "Oturum açmalar, hesabınızdaki ve anahtarlarınızdaki değişiklikler ile iptal ettiğiniz oturumlar. Saatler sizin saat diliminizde gösterilir." | |
| 492 | - } | |
| 493 | - (PasswordStoredHint, En) => "A password is stored. Leave this blank to keep it.", | |
| 494 | - (PasswordStoredHint, Tr) => { | |
| 495 | - "Bir parola kayıtlı. Mevcut parolayı korumak için bu alanı boş bırakın." | |
| 496 | - } | |
| 497 | 334 | (RecentRuns, En) => "Recent runs", |
| 498 | 335 | (RecentRuns, Tr) => "Son çalıştırmalar", |
| 499 | 336 | (ReconcileNow, En) => "Reconcile now", |
| @@ -506,26 +343,14 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 506 | 343 | (RegistrationToken, Tr) => "Kayıt belirteci", |
| 507 | 344 | (RemovedWithAccount, En) => "Removed with the account:", |
| 508 | 345 | (RemovedWithAccount, Tr) => "Hesapla birlikte silinenler:", |
| 509 | - (ReplacePrefix, En) => "Replace ", | |
| 510 | - (ReplacePrefix, Tr) => "Çalıştırıcının adını ", | |
| 511 | - (ReplaceSuffix, En) => " with the runner's name.", | |
| 512 | - (ReplaceSuffix, Tr) => " yerine yazın.", | |
| 513 | 346 | (Replication, En) => "Replication", |
| 514 | 347 | (Replication, Tr) => "Çoğaltma", |
| 515 | - (ReplicationIntro, En) => { | |
| 516 | - "Standby copies of every repo and of the database. Times are in your timezone. Settings come from the [replication] section of the config file." | |
| 517 | - } | |
| 518 | - (ReplicationIntro, Tr) => { | |
| 519 | - "Her deponun ve veritabanının bekleme kopyaları. Saatler sizin saat diliminizde gösterilir. Ayarlar, yapılandırma dosyasındaki [replication] bölümünden gelir." | |
| 520 | - } | |
| 521 | 348 | (ReplicationOff, En) => { |
| 522 | 349 | "Replication is off. Set target, identity_file and known_hosts_file in the [replication] section to turn it on." |
| 523 | 350 | } |
| 524 | 351 | (ReplicationOff, Tr) => { |
| 525 | 352 | "Çoğaltma kapalı. Açmak için [replication] bölümünde target, identity_file ve known_hosts_file ayarlarını yapın." |
| 526 | 353 | } |
| 527 | - (ReplicationTarget, En) => "Target", | |
| 528 | - (ReplicationTarget, Tr) => "Hedef", | |
| 529 | 354 | (Repos, En) => "Repos", |
| 530 | 355 | (Repos, Tr) => "Depolar", |
| 531 | 356 | (Retention, En) => "Retention", |
| @@ -551,10 +376,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 551 | 376 | (Runners, En) => "Runners", |
| 552 | 377 | (Runners, Tr) => "Çalıştırıcılar", |
| 553 | 378 | (ScheduledBackupsOff, En) => { |
| 554 | - "Scheduled backups are off. Set dir in the [backup] section to turn them on." | |
| 379 | + "Scheduled backups are off." | |
| 555 | 380 | } |
| 556 | 381 | (ScheduledBackupsOff, Tr) => { |
| 557 | - "Zamanlanmış yedeklemeler kapalı. Açmak için [backup] bölümünde dir ayarını yapın." | |
| 382 | + "Zamanlanmış yedeklemeler kapalı." | |
| 558 | 383 | } |
| 559 | 384 | (SecurityLogTitle, En) => "Security log", |
| 560 | 385 | (SecurityLogTitle, Tr) => "Güvenlik günlüğü", |
| @@ -576,38 +401,12 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 576 | 401 | (StatusInProgress, Tr) => "sürüyor", |
| 577 | 402 | (StatusOk, En) => "ok", |
| 578 | 403 | (StatusOk, Tr) => "tamam", |
| 579 | - (TableActor, En) => "Actor", | |
| 580 | - (TableActor, Tr) => "Yapan", | |
| 581 | - (TableDetails, En) => "Details", | |
| 582 | - (TableDetails, Tr) => "Ayrıntılar", | |
| 583 | - (TableDuration, En) => "Duration", | |
| 584 | - (TableDuration, Tr) => "Süre", | |
| 585 | - (TableKind, En) => "Kind", | |
| 586 | - (TableKind, Tr) => "Tür", | |
| 587 | 404 | (TableLastError, En) => "Last error", |
| 588 | 405 | (TableLastError, Tr) => "Son hata", |
| 589 | 406 | (TableQueued, En) => "Queued", |
| 590 | 407 | (TableQueued, Tr) => "Kuyruğa alındı", |
| 591 | - (TableResult, En) => "Result", | |
| 592 | - (TableResult, Tr) => "Sonuç", | |
| 593 | - (TableSize, En) => "Size", | |
| 594 | - (TableSize, Tr) => "Boyut", | |
| 595 | - (TableStarted, En) => "Started", | |
| 596 | - (TableStarted, Tr) => "Başlangıç", | |
| 597 | - (TableState, En) => "State", | |
| 598 | - (TableState, Tr) => "Durum", | |
| 599 | - (TableSubject, En) => "Subject", | |
| 600 | - (TableSubject, Tr) => "Konu", | |
| 601 | - (TableTarget, En) => "Target", | |
| 602 | - (TableTarget, Tr) => "Hedef", | |
| 603 | - (TableTo, En) => "To", | |
| 604 | - (TableTo, Tr) => "Alıcı", | |
| 605 | 408 | (TableTries, En) => "Tries", |
| 606 | 409 | (TableTries, Tr) => "Deneme", |
| 607 | - (TableTrigger, En) => "Trigger", | |
| 608 | - (TableTrigger, Tr) => "Tetikleyen", | |
| 609 | - (TableWhen, En) => "When", | |
| 610 | - (TableWhen, Tr) => "Ne zaman", | |
| 611 | 410 | (TestQueued, En) => "Test message queued. It appears in the list when it is sent.", |
| 612 | 411 | (TestQueued, Tr) => "Test iletisi kuyruğa alındı. Gönderildiğinde listede görünür.", |
| 613 | 412 | (Token, En) => "Token", |
| @@ -653,58 +452,6 @@ pub fn deleted_repo_name(lang: Lang, subject: &str) -> String { | ||
| 653 | 452 | } |
| 654 | 453 | } |
| 655 | 454 | |
| 656 | -/// "database every 60 min, reconcile every 30 min". | |
| 657 | -pub fn interval_line(lang: Lang, db_minutes: u64, reconcile_minutes: u64) -> String { | |
| 658 | - match lang { | |
| 659 | - Lang::En => { | |
| 660 | - format!("database every {db_minutes} min, reconcile every {reconcile_minutes} min") | |
| 661 | - } | |
| 662 | - Lang::Tr => format!( | |
| 663 | - "veritabanı her {db_minutes} dakikada, uzlaştırma her {reconcile_minutes} dakikada" | |
| 664 | - ), | |
| 665 | - } | |
| 666 | -} | |
| 667 | - | |
| 668 | -/// "1 hour" or "24 hours" for the registration token lifetime. | |
| 669 | -pub fn hours_text(lang: Lang, hours: u32) -> String { | |
| 670 | - match (lang, hours) { | |
| 671 | - (Lang::En, 1) => "1 hour".to_owned(), | |
| 672 | - (Lang::En, _) => format!("{hours} hours"), | |
| 673 | - (Lang::Tr, 1) => "1 saat".to_owned(), | |
| 674 | - (Lang::Tr, _) => format!("{hours} saat"), | |
| 675 | - } | |
| 676 | -} | |
| 677 | - | |
| 678 | -/// "A registration token works once and expires after 24 hours. Creating one shows it on the next | |
| 679 | -/// page only." | |
| 680 | -pub fn token_ttl_note(lang: Lang, ttl: &str) -> String { | |
| 681 | - match lang { | |
| 682 | - Lang::En => format!( | |
| 683 | - "A registration token works once and expires after {ttl}. Creating one shows it on the next page only." | |
| 684 | - ), | |
| 685 | - Lang::Tr => format!( | |
| 686 | - "Kayıt belirteci yalnızca bir kez çalışır ve {ttl} sonra geçerliliğini yitirir. Oluşturulduğunda yalnızca bir sonraki sayfada gösterilir." | |
| 687 | - ), | |
| 688 | - } | |
| 689 | -} | |
| 690 | - | |
| 691 | -/// "It works once and expires in 24 hours." | |
| 692 | -pub fn token_expiry_line(lang: Lang, ttl: &str) -> String { | |
| 693 | - match lang { | |
| 694 | - Lang::En => format!("It works once and expires in {ttl}."), | |
| 695 | - Lang::Tr => format!("Yalnızca bir kez çalışır ve {ttl} içinde sona erer."), | |
| 696 | - } | |
| 697 | -} | |
| 698 | - | |
| 699 | -/// "set (host hc.example.test)" for a healthcheck URL, with the host unknown when it has none. | |
| 700 | -pub fn healthcheck_host(lang: Lang, host: Option<&str>) -> String { | |
| 701 | - let host = host.unwrap_or_else(|| t(lang, K::UnknownHost)); | |
| 702 | - match lang { | |
| 703 | - Lang::En => format!("set (host {host})"), | |
| 704 | - Lang::Tr => format!("ayarlı (sunucu: {host})"), | |
| 705 | - } | |
| 706 | -} | |
| 707 | - | |
| 708 | 455 | /// "every 6 hours". |
| 709 | 456 | pub fn every_hours(lang: Lang, hours: u64) -> String { |
| 710 | 457 | match lang { |
| @@ -714,23 +461,6 @@ pub fn every_hours(lang: Lang, hours: u64) -> String { | ||
| 714 | 461 | } |
| 715 | 462 | } |
| 716 | 463 | |
| 717 | -/// "every 7 days". | |
| 718 | -pub fn every_days(lang: Lang, days: u64) -> String { | |
| 719 | - match lang { | |
| 720 | - Lang::En if days == 1 => "every day".to_owned(), | |
| 721 | - Lang::En => format!("every {days} days"), | |
| 722 | - Lang::Tr => format!("her {days} günde bir"), | |
| 723 | - } | |
| 724 | -} | |
| 725 | - | |
| 726 | -/// "2 newest complete sets". | |
| 727 | -pub fn newest_sets(lang: Lang, keep: usize) -> String { | |
| 728 | - match lang { | |
| 729 | - Lang::En => format!("{keep} newest complete sets"), | |
| 730 | - Lang::Tr => format!("en yeni {keep} tam küme"), | |
| 731 | - } | |
| 732 | -} | |
| 733 | - | |
| 734 | 464 | /// The run kind as a table cell: "backup" or "fsck". |
| 735 | 465 | pub fn kind_name(lang: Lang, kind: RunKind) -> &'static str { |
| 736 | 466 | match (kind, lang) { |
| @@ -828,24 +558,17 @@ mod tests { | ||
| 828 | 558 | |
| 829 | 559 | const ALL: &[K] = &[ |
| 830 | 560 | K::ActionLabel, |
| 831 | - K::ActorUsername, | |
| 832 | 561 | K::AddARunner, |
| 833 | 562 | K::AdminArea, |
| 834 | 563 | K::Administrator, |
| 835 | 564 | K::AllActions, |
| 836 | - K::RowActions, | |
| 837 | 565 | K::Anonymous, |
| 838 | - K::AtLeast12Chars, | |
| 839 | - K::AuditIntro, | |
| 840 | 566 | K::AuditLog, |
| 841 | 567 | K::BackToRunners, |
| 842 | 568 | K::BackToUsers, |
| 843 | - K::BackupInterval, | |
| 844 | 569 | K::Backups, |
| 845 | - K::BackupsIntro, | |
| 846 | 570 | K::CiRunners, |
| 847 | 571 | K::CopyTokenNow, |
| 848 | - K::CreateAUser, | |
| 849 | 572 | K::CreateRegistrationToken, |
| 850 | 573 | K::CreateUser, |
| 851 | 574 | K::Database, |
| @@ -876,27 +599,16 @@ mod tests { | ||
| 876 | 599 | K::FromName, |
| 877 | 600 | K::Fsck, |
| 878 | 601 | K::Healthcheck, |
| 879 | - K::HealthcheckNotSet, | |
| 880 | - K::HealthcheckSet, | |
| 881 | - K::HealthcheckUrlInvalid, | |
| 882 | 602 | K::HealthError, |
| 883 | 603 | K::HealthLagging, |
| 884 | 604 | K::HealthNever, |
| 885 | 605 | K::HealthOk, |
| 886 | - K::Interval, | |
| 887 | 606 | K::Invites, |
| 888 | 607 | K::LastDbAttempt, |
| 889 | 608 | K::LastDbSnapshotShipped, |
| 890 | 609 | K::LastSeen, |
| 891 | 610 | K::LastSuccess, |
| 892 | 611 | K::ServerSettings, |
| 893 | - K::ServerSettingsIntro, | |
| 894 | - K::SrvTabGeneral, | |
| 895 | - K::SrvTabLimits, | |
| 896 | - K::SrvTabStorage, | |
| 897 | - K::SrvTabBackups, | |
| 898 | - K::SrvTabIntegrations, | |
| 899 | - K::SrvTabAlerts, | |
| 900 | 612 | K::SrvSaved, |
| 901 | 613 | K::SrvNothingChanged, |
| 902 | 614 | K::SrvResetDone, |
| @@ -905,17 +617,12 @@ mod tests { | ||
| 905 | 617 | K::SrvKindLive, |
| 906 | 618 | K::SrvKindRestart, |
| 907 | 619 | K::SrvKindReadOnly, |
| 908 | - K::SrvSourceDefault, | |
| 909 | - K::SrvSourceFile, | |
| 910 | - K::SrvSourceUi, | |
| 911 | 620 | K::SrvSecretSet, |
| 912 | 621 | K::SrvSecretNotSet, |
| 913 | - K::SrvSecretHint, | |
| 914 | 622 | K::SrvFileValue, |
| 915 | 623 | K::SrvEmpty, |
| 916 | 624 | K::Mail, |
| 917 | 625 | K::MailHost, |
| 918 | - K::MailIntro, | |
| 919 | 626 | K::MailTabSettings, |
| 920 | 627 | K::MailTabQueue, |
| 921 | 628 | K::MailFilterAll, |
| @@ -925,9 +632,6 @@ mod tests { | ||
| 925 | 632 | K::MailNotFailed, |
| 926 | 633 | K::MailDiscarded, |
| 927 | 634 | K::MailSentAt, |
| 928 | - K::MailTransportNote, | |
| 929 | - K::MailTransportInUse, | |
| 930 | - K::MailQueueIntro, | |
| 931 | 635 | K::MailNothingMatches, |
| 932 | 636 | K::MailPort, |
| 933 | 637 | K::MailSettingsSaved, |
| @@ -938,26 +642,16 @@ mod tests { | ||
| 938 | 642 | K::NoRunnersYet, |
| 939 | 643 | K::NoRunnerWithId, |
| 940 | 644 | K::NoRunsYet, |
| 941 | - K::BackupsEmptyHint, | |
| 942 | - K::ReplicationConfigHint, | |
| 943 | - K::ReposEmptyHint, | |
| 944 | - K::RunnersEmptyHint, | |
| 945 | 645 | K::MailQueueEmpty, |
| 946 | 646 | K::Older, |
| 947 | - K::OwnLogIntro, | |
| 948 | - K::PasswordStoredHint, | |
| 949 | 647 | K::RecentRuns, |
| 950 | 648 | K::ReconcileNow, |
| 951 | 649 | K::ReconcileStarted, |
| 952 | 650 | K::RegisterARunner, |
| 953 | 651 | K::RegistrationToken, |
| 954 | 652 | K::RemovedWithAccount, |
| 955 | - K::ReplacePrefix, | |
| 956 | - K::ReplaceSuffix, | |
| 957 | 653 | K::Replication, |
| 958 | - K::ReplicationIntro, | |
| 959 | 654 | K::ReplicationOff, |
| 960 | - K::ReplicationTarget, | |
| 961 | 655 | K::Repos, |
| 962 | 656 | K::Retention, |
| 963 | 657 | K::Role, |
| @@ -981,22 +675,9 @@ mod tests { | ||
| 981 | 675 | K::StatusFailed, |
| 982 | 676 | K::StatusInProgress, |
| 983 | 677 | K::StatusOk, |
| 984 | - K::TableActor, | |
| 985 | - K::TableDetails, | |
| 986 | - K::TableDuration, | |
| 987 | - K::TableKind, | |
| 988 | 678 | K::TableLastError, |
| 989 | 679 | K::TableQueued, |
| 990 | - K::TableResult, | |
| 991 | - K::TableSize, | |
| 992 | - K::TableStarted, | |
| 993 | - K::TableState, | |
| 994 | - K::TableSubject, | |
| 995 | - K::TableTarget, | |
| 996 | - K::TableTo, | |
| 997 | 680 | K::TableTries, |
| 998 | - K::TableTrigger, | |
| 999 | - K::TableWhen, | |
| 1000 | 681 | K::TestQueued, |
| 1001 | 682 | K::Token, |
| 1002 | 683 | K::TokenCreateFailed, |
crates/forge-web-base/src/i18n/authoring.rsmodified+0 -3
| @@ -5,7 +5,6 @@ use super::Lang; | ||
| 5 | 5 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] |
| 6 | 6 | pub enum K { |
| 7 | 7 | Reviewers, |
| 8 | - NoReviewers, | |
| 9 | 8 | RequestReview, |
| 10 | 9 | ReviewerName, |
| 11 | 10 | WithdrawRequest, |
| @@ -24,8 +23,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 24 | 23 | match (key, lang) { |
| 25 | 24 | (Reviewers, En) => "Reviewers", |
| 26 | 25 | (Reviewers, Tr) => "İnceleyenler", |
| 27 | - (NoReviewers, En) => "No review requested", | |
| 28 | - (NoReviewers, Tr) => "İnceleme istenmedi", | |
| 29 | 26 | (RequestReview, En) => "Request review", |
| 30 | 27 | (RequestReview, Tr) => "İnceleme iste", |
| 31 | 28 | (ReviewerName, En) => "Username", |
crates/forge-web-base/src/i18n/browse.rsmodified+1 -9
| @@ -34,7 +34,6 @@ strings! { | ||
| 34 | 34 | |
| 35 | 35 | BlameLink => "Blame", "Satır geçmişi"; |
| 36 | 36 | BlameTitle => "Blame", "Satır geçmişi"; |
| 37 | - BlameBackToFile => "Back to file", "Dosyaya dön"; | |
| 38 | 37 | BlamePrior => "Blame prior to this commit", "Bu işlemeden önceki satır geçmişi"; |
| 39 | 38 | BlameTimeout => "Blame took too long and was stopped. Try a smaller file or git on your machine.", "Satır geçmişi çok uzun sürdü ve durduruldu. Daha küçük bir dosya deneyin ya da kendi makinenizde git çalıştırın."; |
| 40 | 39 | BlameFailed => "Blame could not be computed for this file.", "Bu dosya için satır geçmişi hesaplanamadı."; |
| @@ -42,7 +41,6 @@ strings! { | ||
| 42 | 41 | |
| 43 | 42 | CopyPermalink => "Copy permalink", "Kalıcı bağlantıyı kopyala"; |
| 44 | 43 | PermalinkCopied => "Permalink copied", "Kalıcı bağlantı kopyalandı"; |
| 45 | - PermalinkHint => "Link to this exact commit. Press y to switch the address bar.", "Tam bu işlemeye bağlantı. Adres çubuğunu değiştirmek için y'ye basın."; | |
| 46 | 44 | |
| 47 | 45 | GoToFile => "Go to file", "Dosyaya git"; |
| 48 | 46 | FinderTitle => "Go to file", "Dosyaya git"; |
| @@ -66,19 +64,13 @@ strings! { | ||
| 66 | 64 | PaletteDone => "Done", "Tamamlandı"; |
| 67 | 65 | PaletteActionFailed => "The action did not go through.", "İşlem gerçekleşmedi."; |
| 68 | 66 | |
| 69 | - BranchAuthorHeader => "Author", "Yazar"; | |
| 70 | - BranchAheadBehindHeader => "Ahead / behind", "Önde / geride"; | |
| 71 | - BranchActionsHeader => "Actions", "İşlemler"; | |
| 72 | 67 | UpToDate => "Even with the default branch", "Varsayılan dalla aynı"; |
| 73 | 68 | NewPr => "New PR", "Yeni PR"; |
| 74 | 69 | DeleteBranch => "Delete", "Sil"; |
| 75 | - DeleteConfirm => "Delete this branch? Its commits stay in the repository until they are cleaned up.", "Bu dal silinsin mi? İşlemeleri temizlenene kadar depoda kalır."; | |
| 76 | - DeleteConfirmYes => "Yes, delete branch", "Evet, dalı sil"; | |
| 77 | - DeleteCancel => "Cancel", "Vazgeç"; | |
| 70 | + DeleteConfirm => "Delete this branch?", "Bu dal silinsin mi?"; | |
| 78 | 71 | NewBranchTitle => "New branch", "Yeni dal"; |
| 79 | 72 | BranchNameLabel => "Branch name", "Dal adı"; |
| 80 | 73 | BranchFromLabel => "From", "Kaynak"; |
| 81 | - BranchFromPlaceholder => "branch, tag or commit", "dal, etiket veya işleme"; | |
| 82 | 74 | CreateBranch => "Create branch", "Dal oluştur"; |
| 83 | 75 | BranchCreated => "Branch created.", "Dal oluşturuldu."; |
| 84 | 76 | BranchDeleted => "Branch deleted.", "Dal silindi."; |
crates/forge-web-base/src/i18n/code.rsmodified+8 -28
| @@ -24,7 +24,6 @@ pub enum K { | ||
| 24 | 24 | CopyCloneUrl, |
| 25 | 25 | CloneCopied, |
| 26 | 26 | CloneCopyFailed, |
| 27 | - SshRequiresKey, | |
| 28 | 27 | BranchesTitle, |
| 29 | 28 | FilterRefs, |
| 30 | 29 | ViewAllBranches, |
| @@ -39,8 +38,6 @@ pub enum K { | ||
| 39 | 38 | HadRecentPushes, |
| 40 | 39 | CompareAndPr, |
| 41 | 40 | BranchLabel, |
| 42 | - LastCommitHeader, | |
| 43 | - AgeHeader, | |
| 44 | 41 | KindDir, |
| 45 | 42 | KindFile, |
| 46 | 43 | KindExec, |
| @@ -51,7 +48,6 @@ pub enum K { | ||
| 51 | 48 | HistoryLink, |
| 52 | 49 | RawLink, |
| 53 | 50 | DownloadLink, |
| 54 | - FileNav, | |
| 55 | 51 | SymlinkPrefix, |
| 56 | 52 | SubmodulePrefix, |
| 57 | 53 | SubmoduleSuffix, |
| @@ -108,7 +104,6 @@ pub enum K { | ||
| 108 | 104 | NothingHere, |
| 109 | 105 | DefaultBadge, |
| 110 | 106 | TagsTitle, |
| 111 | - TagKindLabel, | |
| 112 | 107 | ForkedFrom, |
| 113 | 108 | MirrorOf, |
| 114 | 109 | NotSyncedYet, |
| @@ -166,8 +161,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 166 | 161 | (CloneCopied, Tr) => "Kopyalandı", |
| 167 | 162 | (CloneCopyFailed, En) => "Copy failed", |
| 168 | 163 | (CloneCopyFailed, Tr) => "Kopyalanamadı", |
| 169 | - (SshRequiresKey, En) => "SSH (requires an ed25519 or ECDSA key on your account)", | |
| 170 | - (SshRequiresKey, Tr) => "SSH (hesabınızda bir ed25519 veya ECDSA anahtarı olmalı)", | |
| 171 | 164 | (BranchesTitle, En) => "Branches", |
| 172 | 165 | (BranchesTitle, Tr) => "Dallar", |
| 173 | 166 | (FilterRefs, En) => "Filter branches and tags", |
| @@ -176,8 +169,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 176 | 169 | (ViewAllBranches, Tr) => "Tüm dalları gör", |
| 177 | 170 | (ViewAllTags, En) => "View all tags", |
| 178 | 171 | (ViewAllTags, Tr) => "Tüm etiketleri gör", |
| 179 | - (EmptyRepoPush, En) => "This repository is empty. Push a branch to get started:", | |
| 180 | - (EmptyRepoPush, Tr) => "Bu depo boş. Başlamak için bir dal gönderin:", | |
| 172 | + (EmptyRepoPush, En) => "This repository is empty.", | |
| 173 | + (EmptyRepoPush, Tr) => "Bu depo boş.", | |
| 181 | 174 | (OverHttps, En) => "Over HTTPS", |
| 182 | 175 | (OverHttps, Tr) => "HTTPS üzerinden", |
| 183 | 176 | (OverSsh, En) => "Over SSH", |
| @@ -196,10 +189,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 196 | 189 | (CompareAndPr, Tr) => "Karşılaştır ve çekme isteği aç", |
| 197 | 190 | (BranchLabel, En) => "Branch", |
| 198 | 191 | (BranchLabel, Tr) => "Dal", |
| 199 | - (LastCommitHeader, En) => "Last commit", | |
| 200 | - (LastCommitHeader, Tr) => "Son commit", | |
| 201 | - (AgeHeader, En) => "Age", | |
| 202 | - (AgeHeader, Tr) => "Zaman", | |
| 203 | 192 | (KindDir, En) => "dir", |
| 204 | 193 | (KindDir, Tr) => "dizin", |
| 205 | 194 | (KindFile, En) => "file", |
| @@ -220,8 +209,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 220 | 209 | (RawLink, Tr) => "Ham", |
| 221 | 210 | (DownloadLink, En) => "Download", |
| 222 | 211 | (DownloadLink, Tr) => "İndir", |
| 223 | - (FileNav, En) => "File", | |
| 224 | - (FileNav, Tr) => "Dosya", | |
| 225 | 212 | (SymlinkPrefix, En) => "Symbolic link → ", |
| 226 | 213 | (SymlinkPrefix, Tr) => "Sembolik bağlantı → ", |
| 227 | 214 | (SubmodulePrefix, En) => "Submodule at commit ", |
| @@ -230,8 +217,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 230 | 217 | (SubmoduleSuffix, Tr) => ". İçeriği bu depoda yok.", |
| 231 | 218 | (TruncatedPrefix, En) => "Showing the first 1 MiB of this file. ", |
| 232 | 219 | (TruncatedPrefix, Tr) => "Bu dosyanın ilk 1 MiB'ı gösteriliyor. ", |
| 233 | - (ViewFullRaw, En) => "View the full file raw", | |
| 234 | - (ViewFullRaw, Tr) => "Dosyanın tamamını ham olarak görüntüle", | |
| 220 | + (ViewFullRaw, En) => "View raw", | |
| 221 | + (ViewFullRaw, Tr) => "Ham görüntüle", | |
| 235 | 222 | (LivePathGone, En) => "This path no longer exists in this ref.", |
| 236 | 223 | (LivePathGone, Tr) => "Bu yol bu referansta artık yok.", |
| 237 | 224 | (StatusAdded, En) => "added", |
| @@ -320,22 +307,20 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 320 | 307 | (FilteredTo, Tr) => "Şuna göre filtrelendi: ", |
| 321 | 308 | (ClearFilter, En) => "Clear filter", |
| 322 | 309 | (ClearFilter, Tr) => "Filtreyi temizle", |
| 323 | - (NoCommits, En) => "No commits yet. Push a branch and its history shows up here.", | |
| 324 | - (NoCommits, Tr) => "Henüz commit yok. Bir dal gönderin, geçmişi burada görünsün.", | |
| 310 | + (NoCommits, En) => "No commits yet.", | |
| 311 | + (NoCommits, Tr) => "Henüz commit yok.", | |
| 325 | 312 | (BrowseFilesShort, En) => "Browse files", |
| 326 | 313 | (BrowseFilesShort, Tr) => "Dosyalara göz at", |
| 327 | 314 | (NewerLink, En) => "Newer", |
| 328 | 315 | (NewerLink, Tr) => "Daha yeni", |
| 329 | 316 | (OlderLink, En) => "Older", |
| 330 | 317 | (OlderLink, Tr) => "Daha eski", |
| 331 | - (NothingHere, En) => "Nothing here yet. Push a commit and it shows up.", | |
| 332 | - (NothingHere, Tr) => "Henüz burada bir şey yok. Bir commit gönderin, burada görünsün.", | |
| 318 | + (NothingHere, En) => "Nothing here yet.", | |
| 319 | + (NothingHere, Tr) => "Henüz burada bir şey yok.", | |
| 333 | 320 | (DefaultBadge, En) => "default", |
| 334 | 321 | (DefaultBadge, Tr) => "varsayılan", |
| 335 | 322 | (TagsTitle, En) => "Tags", |
| 336 | 323 | (TagsTitle, Tr) => "Etiketler", |
| 337 | - (TagKindLabel, En) => "Tag", | |
| 338 | - (TagKindLabel, Tr) => "Etiket", | |
| 339 | 324 | (ForkedFrom, En) => "forked from ", |
| 340 | 325 | (ForkedFrom, Tr) => "Şu depodan çatallandı: ", |
| 341 | 326 | (MirrorOf, En) => "Mirror of ", |
| @@ -552,7 +537,6 @@ mod tests { | ||
| 552 | 537 | K::CopyCloneUrl, |
| 553 | 538 | K::CloneCopied, |
| 554 | 539 | K::CloneCopyFailed, |
| 555 | - K::SshRequiresKey, | |
| 556 | 540 | K::BranchesTitle, |
| 557 | 541 | K::FilterRefs, |
| 558 | 542 | K::ViewAllBranches, |
| @@ -567,8 +551,6 @@ mod tests { | ||
| 567 | 551 | K::HadRecentPushes, |
| 568 | 552 | K::CompareAndPr, |
| 569 | 553 | K::BranchLabel, |
| 570 | - K::LastCommitHeader, | |
| 571 | - K::AgeHeader, | |
| 572 | 554 | K::KindDir, |
| 573 | 555 | K::KindFile, |
| 574 | 556 | K::KindExec, |
| @@ -579,7 +561,6 @@ mod tests { | ||
| 579 | 561 | K::HistoryLink, |
| 580 | 562 | K::RawLink, |
| 581 | 563 | K::DownloadLink, |
| 582 | - K::FileNav, | |
| 583 | 564 | K::SymlinkPrefix, |
| 584 | 565 | K::SubmodulePrefix, |
| 585 | 566 | K::SubmoduleSuffix, |
| @@ -636,7 +617,6 @@ mod tests { | ||
| 636 | 617 | K::NothingHere, |
| 637 | 618 | K::DefaultBadge, |
| 638 | 619 | K::TagsTitle, |
| 639 | - K::TagKindLabel, | |
| 640 | 620 | K::ForkedFrom, |
| 641 | 621 | K::MirrorOf, |
| 642 | 622 | K::NotSyncedYet, |
crates/forge-web-base/src/i18n/community.rsmodified+0 -66
| @@ -19,7 +19,6 @@ pub enum K { | ||
| 19 | 19 | Category, |
| 20 | 20 | Title, |
| 21 | 21 | Description, |
| 22 | - MarkdownSupported, | |
| 23 | 22 | StartDiscussion, |
| 24 | 23 | Cancel, |
| 25 | 24 | Save, |
| @@ -38,8 +37,6 @@ pub enum K { | ||
| 38 | 37 | UnlockConversation, |
| 39 | 38 | Answered, |
| 40 | 39 | Locked, |
| 41 | - OpenedThis, | |
| 42 | - OpenedSeparator, | |
| 43 | 40 | NoDescription, |
| 44 | 41 | LockedNotice, |
| 45 | 42 | AddComment, |
| @@ -47,9 +44,6 @@ pub enum K { | ||
| 47 | 44 | LogInLink, |
| 48 | 45 | ToCommentSuffix, |
| 49 | 46 | ArchivedDiscussions, |
| 50 | - DiscussionsDescription, | |
| 51 | - TurnOffDiscussions, | |
| 52 | - TurnOnDiscussions, | |
| 53 | 47 | CategoryGeneral, |
| 54 | 48 | CategoryIdeas, |
| 55 | 49 | CategoryQa, |
| @@ -68,17 +62,12 @@ pub enum K { | ||
| 68 | 62 | BackToPage, |
| 69 | 63 | NoChangesYet, |
| 70 | 64 | PageName, |
| 71 | - PageNameHint, | |
| 72 | 65 | ContentMarkdown, |
| 73 | - WikiLinkHint, | |
| 74 | 66 | Summary, |
| 75 | 67 | SavePage, |
| 76 | 68 | PageNameRules, |
| 77 | 69 | PageExists, |
| 78 | 70 | WikiConflict, |
| 79 | - WikiSettings, | |
| 80 | - EnableWiki, | |
| 81 | - WikiDisabledHint, | |
| 82 | 71 | WikiPages, |
| 83 | 72 | |
| 84 | 73 | // Snippets. |
| @@ -105,9 +94,6 @@ pub enum K { | ||
| 105 | 94 | SaveSnippet, |
| 106 | 95 | EditSnippet, |
| 107 | 96 | Raw, |
| 108 | - SnippetNav, | |
| 109 | - FileNav, | |
| 110 | - OnlyOwnerEdits, | |
| 111 | 97 | Revisions, |
| 112 | 98 | BackToSnippet, |
| 113 | 99 | NoRevisions, |
| @@ -139,8 +125,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 139 | 125 | (Title, Tr) => "Başlık", |
| 140 | 126 | (Description, En) => "Description", |
| 141 | 127 | (Description, Tr) => "Açıklama", |
| 142 | - (MarkdownSupported, En) => "Markdown supported.", | |
| 143 | - (MarkdownSupported, Tr) => "Markdown desteklenir.", | |
| 144 | 128 | (StartDiscussion, En) => "Start discussion", |
| 145 | 129 | (StartDiscussion, Tr) => "Tartışma başlat", |
| 146 | 130 | (Cancel, En) => "Cancel", |
| @@ -177,10 +161,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 177 | 161 | (Answered, Tr) => "Cevaplandı", |
| 178 | 162 | (Locked, En) => "Locked", |
| 179 | 163 | (Locked, Tr) => "Kilitli", |
| 180 | - (OpenedThis, En) => " opened this ", | |
| 181 | - (OpenedThis, Tr) => " tarafından ", | |
| 182 | - (OpenedSeparator, En) => " · ", | |
| 183 | - (OpenedSeparator, Tr) => " açıldı · ", | |
| 184 | 164 | (NoDescription, En) => "_No description provided._", |
| 185 | 165 | (NoDescription, Tr) => "_Açıklama eklenmedi._", |
| 186 | 166 | (LockedNotice, En) => { |
| @@ -201,16 +181,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 201 | 181 | "This repository is archived, so its discussions are read-only." |
| 202 | 182 | } |
| 203 | 183 | (ArchivedDiscussions, Tr) => "Bu depo arşivlendiği için tartışmalar salt okunur.", |
| 204 | - (DiscussionsDescription, En) => { | |
| 205 | - "A forum for questions, ideas and announcements, next to issues. Off by default. Turning it off hides the tab; existing discussions are kept." | |
| 206 | - } | |
| 207 | - (DiscussionsDescription, Tr) => { | |
| 208 | - "Sorunların yanında sorular, fikirler ve duyurular için bir forum. Varsayılan olarak kapalıdır. Kapatıldığında sekme gizlenir; mevcut tartışmalar korunur." | |
| 209 | - } | |
| 210 | - (TurnOffDiscussions, En) => "Turn off discussions", | |
| 211 | - (TurnOffDiscussions, Tr) => "Tartışmaları kapat", | |
| 212 | - (TurnOnDiscussions, En) => "Turn on discussions", | |
| 213 | - (TurnOnDiscussions, Tr) => "Tartışmaları aç", | |
| 214 | 184 | (CategoryGeneral, En) => "General", |
| 215 | 185 | (CategoryGeneral, Tr) => "Genel", |
| 216 | 186 | (CategoryIdeas, En) => "Ideas", |
| @@ -244,14 +214,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 244 | 214 | (NoChangesYet, Tr) => "Henüz değişiklik yok.", |
| 245 | 215 | (PageName, En) => "Page name", |
| 246 | 216 | (PageName, Tr) => "Sayfa adı", |
| 247 | - (PageNameHint, En) => "Letters, digits, - and _. Dashes show as spaces in titles.", | |
| 248 | - (PageNameHint, Tr) => "Harfler, rakamlar, - ve _. Başlıkta tireler boşluk olarak görünür.", | |
| 249 | 217 | (ContentMarkdown, En) => "Content (Markdown)", |
| 250 | 218 | (ContentMarkdown, Tr) => "İçerik (Markdown)", |
| 251 | - (WikiLinkHint, En) => "Link to another page with [[Page-Name]] or [[Label|Page-Name]].", | |
| 252 | - (WikiLinkHint, Tr) => { | |
| 253 | - "Başka bir sayfaya [[Sayfa-Adı]] ya da [[Etiket|Sayfa-Adı]] biçiminde bağlantı verin." | |
| 254 | - } | |
| 255 | 219 | (Summary, En) => "Summary", |
| 256 | 220 | (Summary, Tr) => "Özet", |
| 257 | 221 | (SavePage, En) => "Save page", |
| @@ -268,16 +232,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 268 | 232 | (WikiConflict, Tr) => { |
| 269 | 233 | "Siz düzenlerken başka biri bu wiki'yi kaydetti. Metniniz aşağıda duruyor; kopyalayın, sayfayı yenileyin ve yeniden kaydedin." |
| 270 | 234 | } |
| 271 | - (WikiSettings, En) => "Wiki settings", | |
| 272 | - (WikiSettings, Tr) => "Wiki ayarları", | |
| 273 | - (EnableWiki, En) => "Enable the wiki", | |
| 274 | - (EnableWiki, Tr) => "Wiki'yi etkinleştir", | |
| 275 | - (WikiDisabledHint, En) => { | |
| 276 | - "A disabled wiki is hidden and refuses edits and pushes. Its pages are kept." | |
| 277 | - } | |
| 278 | - (WikiDisabledHint, Tr) => { | |
| 279 | - "Devre dışı bir wiki gizlenir; düzenlemelerini ve göndermelerini kabul etmez. Sayfaları korunur." | |
| 280 | - } | |
| 281 | 235 | (WikiPages, En) => "Wiki pages", |
| 282 | 236 | (WikiPages, Tr) => "Wiki sayfaları", |
| 283 | 237 | |
| @@ -327,12 +281,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 327 | 281 | (EditSnippet, Tr) => "Parçacığı düzenle", |
| 328 | 282 | (Raw, En) => "Raw", |
| 329 | 283 | (Raw, Tr) => "Ham", |
| 330 | - (SnippetNav, En) => "Snippet", | |
| 331 | - (SnippetNav, Tr) => "Parçacık", | |
| 332 | - (FileNav, En) => "File", | |
| 333 | - (FileNav, Tr) => "Dosya", | |
| 334 | - (OnlyOwnerEdits, En) => "Only the owner can edit this snippet.", | |
| 335 | - (OnlyOwnerEdits, Tr) => "Bu parçacığı yalnızca sahibi düzenleyebilir.", | |
| 336 | 284 | (Revisions, En) => "Revisions", |
| 337 | 285 | (Revisions, Tr) => "Revizyonlar", |
| 338 | 286 | (BackToSnippet, En) => "Back to the snippet", |
| @@ -461,7 +409,6 @@ mod tests { | ||
| 461 | 409 | K::Category, |
| 462 | 410 | K::Title, |
| 463 | 411 | K::Description, |
| 464 | - K::MarkdownSupported, | |
| 465 | 412 | K::StartDiscussion, |
| 466 | 413 | K::Cancel, |
| 467 | 414 | K::Save, |
| @@ -480,8 +427,6 @@ mod tests { | ||
| 480 | 427 | K::UnlockConversation, |
| 481 | 428 | K::Answered, |
| 482 | 429 | K::Locked, |
| 483 | - K::OpenedThis, | |
| 484 | - K::OpenedSeparator, | |
| 485 | 430 | K::NoDescription, |
| 486 | 431 | K::LockedNotice, |
| 487 | 432 | K::AddComment, |
| @@ -489,9 +434,6 @@ mod tests { | ||
| 489 | 434 | K::LogInLink, |
| 490 | 435 | K::ToCommentSuffix, |
| 491 | 436 | K::ArchivedDiscussions, |
| 492 | - K::DiscussionsDescription, | |
| 493 | - K::TurnOffDiscussions, | |
| 494 | - K::TurnOnDiscussions, | |
| 495 | 437 | K::CategoryGeneral, |
| 496 | 438 | K::CategoryIdeas, |
| 497 | 439 | K::CategoryQa, |
| @@ -508,17 +450,12 @@ mod tests { | ||
| 508 | 450 | K::BackToPage, |
| 509 | 451 | K::NoChangesYet, |
| 510 | 452 | K::PageName, |
| 511 | - K::PageNameHint, | |
| 512 | 453 | K::ContentMarkdown, |
| 513 | - K::WikiLinkHint, | |
| 514 | 454 | K::Summary, |
| 515 | 455 | K::SavePage, |
| 516 | 456 | K::PageNameRules, |
| 517 | 457 | K::PageExists, |
| 518 | 458 | K::WikiConflict, |
| 519 | - K::WikiSettings, | |
| 520 | - K::EnableWiki, | |
| 521 | - K::WikiDisabledHint, | |
| 522 | 459 | K::WikiPages, |
| 523 | 460 | K::Snippets, |
| 524 | 461 | K::NewSnippet, |
| @@ -543,9 +480,6 @@ mod tests { | ||
| 543 | 480 | K::SaveSnippet, |
| 544 | 481 | K::EditSnippet, |
| 545 | 482 | K::Raw, |
| 546 | - K::SnippetNav, | |
| 547 | - K::FileNav, | |
| 548 | - K::OnlyOwnerEdits, | |
| 549 | 483 | K::Revisions, |
| 550 | 484 | K::BackToSnippet, |
| 551 | 485 | K::NoRevisions, |
crates/forge-web-base/src/i18n/integrations.rsmodified+0 -120
| @@ -5,13 +5,9 @@ use super::Lang; | ||
| 5 | 5 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] |
| 6 | 6 | pub enum K { |
| 7 | 7 | ActiveField, |
| 8 | - ArchivedHookNote, | |
| 9 | - AddPullIntro, | |
| 10 | 8 | AddPullMirror, |
| 11 | - AddPushIntro, | |
| 12 | 9 | AddPushMirror, |
| 13 | 10 | AddWebhook, |
| 14 | - AddWebhookIntro, | |
| 15 | 11 | ArchivedNotice, |
| 16 | 12 | BackToWebhooks, |
| 17 | 13 | ClearSecret, |
| @@ -19,14 +15,10 @@ pub enum K { | ||
| 19 | 15 | CurrentUrl, |
| 20 | 16 | Cancel, |
| 21 | 17 | DeleteConfirm, |
| 22 | - DeleteIntro, | |
| 23 | 18 | DeleteMirror, |
| 24 | - DeleteTextPull, | |
| 25 | - DeleteTextPush, | |
| 26 | 19 | DeleteWebhook, |
| 27 | 20 | DirectionPull, |
| 28 | 21 | DirectionPush, |
| 29 | - EditWebhook, | |
| 30 | 22 | EnabledField, |
| 31 | 23 | ErrIntervalMax, |
| 32 | 24 | ErrIntervalNotWhole, |
| @@ -54,7 +46,6 @@ pub enum K { | ||
| 54 | 46 | LastSync, |
| 55 | 47 | ManualOnly, |
| 56 | 48 | Mirrors, |
| 57 | - MirrorsIntro, | |
| 58 | 49 | NoDeliveries, |
| 59 | 50 | NoMirrors, |
| 60 | 51 | NoWebhooks, |
| @@ -82,14 +73,10 @@ pub enum K { | ||
| 82 | 73 | SaveMirror, |
| 83 | 74 | SaveWebhook, |
| 84 | 75 | Secret, |
| 85 | - SecretHintNew, | |
| 86 | 76 | SecretHintSet, |
| 87 | 77 | SecretHintUnset, |
| 88 | 78 | SecretOptional, |
| 89 | - SecretSet, | |
| 90 | - SecretUnset, | |
| 91 | 79 | SendTestPing, |
| 92 | - SignedWith, | |
| 93 | 80 | StateFailed, |
| 94 | 81 | StateGaveUp, |
| 95 | 82 | StateOk, |
| @@ -100,42 +87,29 @@ pub enum K { | ||
| 100 | 87 | StatusNotRun, |
| 101 | 88 | StatusOk, |
| 102 | 89 | SyncHeading, |
| 103 | - SyncIntro, | |
| 104 | 90 | SyncNow, |
| 105 | 91 | Test, |
| 106 | - TestIntro, | |
| 107 | - UrlHintKeep, | |
| 108 | - UrlHintNew, | |
| 109 | 92 | UsernameOptional, |
| 110 | 93 | Webhooks, |
| 111 | - WebhooksIntro, | |
| 112 | 94 | } |
| 113 | 95 | |
| 114 | 96 | /// Every key, so the tests can walk them. |
| 115 | 97 | #[cfg(test)] |
| 116 | 98 | pub const ALL: &[K] = &[ |
| 117 | 99 | K::ActiveField, |
| 118 | - K::ArchivedHookNote, | |
| 119 | - K::AddPullIntro, | |
| 120 | 100 | K::AddPullMirror, |
| 121 | - K::AddPushIntro, | |
| 122 | 101 | K::AddPushMirror, |
| 123 | 102 | K::AddWebhook, |
| 124 | - K::AddWebhookIntro, | |
| 125 | 103 | K::ArchivedNotice, |
| 126 | 104 | K::BackToWebhooks, |
| 127 | 105 | K::ClearSecret, |
| 128 | 106 | K::CreateWebhook, |
| 129 | 107 | K::CurrentUrl, |
| 130 | 108 | K::DeleteConfirm, |
| 131 | - K::DeleteIntro, | |
| 132 | 109 | K::DeleteMirror, |
| 133 | - K::DeleteTextPull, | |
| 134 | - K::DeleteTextPush, | |
| 135 | 110 | K::DeleteWebhook, |
| 136 | 111 | K::DirectionPull, |
| 137 | 112 | K::DirectionPush, |
| 138 | - K::EditWebhook, | |
| 139 | 113 | K::EnabledField, |
| 140 | 114 | K::ErrIntervalMax, |
| 141 | 115 | K::ErrIntervalNotWhole, |
| @@ -163,7 +137,6 @@ pub const ALL: &[K] = &[ | ||
| 163 | 137 | K::LastSync, |
| 164 | 138 | K::ManualOnly, |
| 165 | 139 | K::Mirrors, |
| 166 | - K::MirrorsIntro, | |
| 167 | 140 | K::NoDeliveries, |
| 168 | 141 | K::NoMirrors, |
| 169 | 142 | K::NoWebhooks, |
| @@ -191,14 +164,10 @@ pub const ALL: &[K] = &[ | ||
| 191 | 164 | K::SaveMirror, |
| 192 | 165 | K::SaveWebhook, |
| 193 | 166 | K::Secret, |
| 194 | - K::SecretHintNew, | |
| 195 | 167 | K::SecretHintSet, |
| 196 | 168 | K::SecretHintUnset, |
| 197 | 169 | K::SecretOptional, |
| 198 | - K::SecretSet, | |
| 199 | - K::SecretUnset, | |
| 200 | 170 | K::SendTestPing, |
| 201 | - K::SignedWith, | |
| 202 | 171 | K::StateFailed, |
| 203 | 172 | K::StateGaveUp, |
| 204 | 173 | K::StateOk, |
| @@ -209,15 +178,10 @@ pub const ALL: &[K] = &[ | ||
| 209 | 178 | K::StatusNotRun, |
| 210 | 179 | K::StatusOk, |
| 211 | 180 | K::SyncHeading, |
| 212 | - K::SyncIntro, | |
| 213 | 181 | K::SyncNow, |
| 214 | 182 | K::Test, |
| 215 | - K::TestIntro, | |
| 216 | - K::UrlHintKeep, | |
| 217 | - K::UrlHintNew, | |
| 218 | 183 | K::UsernameOptional, |
| 219 | 184 | K::Webhooks, |
| 220 | - K::WebhooksIntro, | |
| 221 | 185 | ]; |
| 222 | 186 | |
| 223 | 187 | /// The phrase a key names, in a user's language. |
| @@ -227,32 +191,12 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 227 | 191 | match (key, lang) { |
| 228 | 192 | (ActiveField, En) => "Active: deliver events to this URL", |
| 229 | 193 | (ActiveField, Tr) => "Etkin: olaylar bu URL'ye teslim edilir", |
| 230 | - (ArchivedHookNote, En) => "The webhook cannot be changed while the repository is archived.", | |
| 231 | - (ArchivedHookNote, Tr) => "Depo arşivlenmiş olduğu için web kancası değiştirilemez.", | |
| 232 | - (AddPullIntro, En) => { | |
| 233 | - "This repository is empty. A pull mirror fills it from a remote: branches and tags are fetched now, on the interval and on demand, and pushes are refused. It can only be added while the repository has no refs." | |
| 234 | - } | |
| 235 | - (AddPullIntro, Tr) => { | |
| 236 | - "Bu depo boş. Çekme yansısı depoyu uzak bir depodan doldurur: dallar ve etiketler şimdi, aralıkla ve istendiğinde çekilir; göndermeler reddedilir. Yalnızca depoda hiç referans yokken eklenebilir." | |
| 237 | - } | |
| 238 | 194 | (AddPullMirror, En) => "Add pull mirror", |
| 239 | 195 | (AddPullMirror, Tr) => "Çekme yansısı ekle", |
| 240 | - (AddPushIntro, En) => { | |
| 241 | - "Our branches and tags are pushed to this remote after each push, and on the interval. The remote's own refs that we do not have are removed." | |
| 242 | - } | |
| 243 | - (AddPushIntro, Tr) => { | |
| 244 | - "Dallarımız ve etiketlerimiz her göndermeden sonra ve aralıkla bu uzak depoya gönderilir. Uzak depoda bizde olmayan kendi referansları silinir." | |
| 245 | - } | |
| 246 | 196 | (AddPushMirror, En) => "Add push mirror", |
| 247 | 197 | (AddPushMirror, Tr) => "Gönderme yansısı ekle", |
| 248 | 198 | (AddWebhook, En) => "Add webhook", |
| 249 | 199 | (AddWebhook, Tr) => "Web kancası ekle", |
| 250 | - (AddWebhookIntro, En) => { | |
| 251 | - "A ping event is sent to the URL as soon as the webhook is created." | |
| 252 | - } | |
| 253 | - (AddWebhookIntro, Tr) => { | |
| 254 | - "Web kancası oluşturulur oluşturulmaz URL'ye bir ping olayı gönderilir." | |
| 255 | - } | |
| 256 | 200 | (ArchivedNotice, En) => { |
| 257 | 201 | "This repository is archived. Mirrors are read-only: they cannot be changed, synced or deleted." |
| 258 | 202 | } |
| @@ -271,32 +215,14 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 271 | 215 | (Cancel, Tr) => "Vazgeç", |
| 272 | 216 | (DeleteConfirm, En) => "Delete it? This cannot be undone.", |
| 273 | 217 | (DeleteConfirm, Tr) => "Silinsin mi? Bu işlem geri alınamaz.", |
| 274 | - (DeleteIntro, En) => { | |
| 275 | - "Deleting removes the webhook and its delivery history. Events stop being sent to its URL at once." | |
| 276 | - } | |
| 277 | - (DeleteIntro, Tr) => { | |
| 278 | - "Silmek, web kancasını ve teslimat geçmişini kaldırır. Olaylar bu URL'ye hemen gönderilmez." | |
| 279 | - } | |
| 280 | 218 | (DeleteMirror, En) => "Delete mirror", |
| 281 | 219 | (DeleteMirror, Tr) => "Yansıyı sil", |
| 282 | - (DeleteTextPull, En) => { | |
| 283 | - "Stop mirroring; the repository becomes a normal repository. Its refs stay as they are." | |
| 284 | - } | |
| 285 | - (DeleteTextPull, Tr) => { | |
| 286 | - "Yansılamayı durdurun; depo normal bir depoya dönüşür. Referansları olduğu gibi kalır." | |
| 287 | - } | |
| 288 | - (DeleteTextPush, En) => "Stop pushing to this remote. The remote keeps the refs it has.", | |
| 289 | - (DeleteTextPush, Tr) => { | |
| 290 | - "Bu uzak depoya göndermeyi durdurun. Uzak depo sahip olduğu referansları korur." | |
| 291 | - } | |
| 292 | 220 | (DeleteWebhook, En) => "Delete webhook", |
| 293 | 221 | (DeleteWebhook, Tr) => "Web kancasını sil", |
| 294 | 222 | (DirectionPull, En) => "Pull", |
| 295 | 223 | (DirectionPull, Tr) => "Çekme", |
| 296 | 224 | (DirectionPush, En) => "Push", |
| 297 | 225 | (DirectionPush, Tr) => "Gönderme", |
| 298 | - (EditWebhook, En) => "Edit webhook", | |
| 299 | - (EditWebhook, Tr) => "Web kancasını düzenle", | |
| 300 | 226 | (EnabledField, En) => "Enabled: sync on the interval and after pushes", |
| 301 | 227 | (EnabledField, Tr) => "Etkin: aralıkla ve göndermelerden sonra eşitlenir", |
| 302 | 228 | (ErrIntervalMax, En) => "The sync interval can be at most one year.", |
| @@ -359,12 +285,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 359 | 285 | (ManualOnly, Tr) => "yalnızca elle", |
| 360 | 286 | (Mirrors, En) => "Mirrors", |
| 361 | 287 | (Mirrors, Tr) => "Yansılar", |
| 362 | - (MirrorsIntro, En) => { | |
| 363 | - "A pull mirror keeps this repository in step with a remote: branches and tags are fetched on the interval and on demand, and pushes are refused. A push mirror sends branches and tags to a remote after every push. Pull requests and issues stay local." | |
| 364 | - } | |
| 365 | - (MirrorsIntro, Tr) => { | |
| 366 | - "Çekme yansısı bu depoyu uzak bir depoyla eşit tutar: dallar ve etiketler aralıkla ya da istendiğinde çekilir, göndermeler reddedilir. Gönderme yansısı her göndermeden sonra dalları ve etiketleri uzak depoya gönderir. Çekme istekleri ve sorunlar yerel kalır." | |
| 367 | - } | |
| 368 | 288 | (NoDeliveries, En) => "No deliveries yet.", |
| 369 | 289 | (NoDeliveries, Tr) => "Henüz teslimat yok.", |
| 370 | 290 | (NoMirrors, En) => "No mirrors yet.", |
| @@ -429,12 +349,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 429 | 349 | (SaveWebhook, Tr) => "Web kancasını kaydet", |
| 430 | 350 | (Secret, En) => "Secret", |
| 431 | 351 | (Secret, Tr) => "Gizli anahtar", |
| 432 | - (SecretHintNew, En) => { | |
| 433 | - "Used to sign each request with HMAC-SHA256. It is stored sealed and is never shown again." | |
| 434 | - } | |
| 435 | - (SecretHintNew, Tr) => { | |
| 436 | - "Her isteği HMAC-SHA256 ile imzalamak için kullanılır. Mühürlü olarak saklanır ve bir daha gösterilmez." | |
| 437 | - } | |
| 438 | 352 | (SecretHintSet, En) => { |
| 439 | 353 | "A secret is set. Leave the field blank to keep it, or type a new one to replace it." |
| 440 | 354 | } |
| @@ -445,20 +359,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 445 | 359 | (SecretHintUnset, Tr) => "Gizli anahtar ayarlı değil. Eklemek için bir tane yazın.", |
| 446 | 360 | (SecretOptional, En) => "Password or token (optional)", |
| 447 | 361 | (SecretOptional, Tr) => "Parola veya belirteç (isteğe bağlı)", |
| 448 | - (SecretSet, En) => { | |
| 449 | - "A password or token is set. Leave the field blank to keep it, or type a new one to replace it." | |
| 450 | - } | |
| 451 | - (SecretSet, Tr) => { | |
| 452 | - "Bir parola veya belirteç ayarlı. Olduğu gibi bırakmak için alanı boş bırakın ya da yenisini yazarak değiştirin." | |
| 453 | - } | |
| 454 | - (SecretUnset, En) => "No password or token is set. Type one if the remote needs it.", | |
| 455 | - (SecretUnset, Tr) => { | |
| 456 | - "Parola veya belirteç ayarlı değil. Uzak sunucu gerektiriyorsa bir tane yazın." | |
| 457 | - } | |
| 458 | 362 | (SendTestPing, En) => "Send test ping", |
| 459 | 363 | (SendTestPing, Tr) => "Test pingi gönder", |
| 460 | - (SignedWith, En) => " Requests are signed with it, so the receiver can check them.", | |
| 461 | - (SignedWith, Tr) => " İstekler bununla imzalanır, böylece alıcı bunları doğrulayabilir.", | |
| 462 | 364 | (StateFailed, En) => "failed, will retry", |
| 463 | 365 | (StateFailed, Tr) => "başarısız, yeniden denenecek", |
| 464 | 366 | (StateGaveUp, En) => "gave up", |
| @@ -479,36 +381,14 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 479 | 381 | (StatusOk, Tr) => "tamam", |
| 480 | 382 | (SyncHeading, En) => "Sync", |
| 481 | 383 | (SyncHeading, Tr) => "Eşitleme", |
| 482 | - (SyncIntro, En) => "Queues a sync now. The result shows in the list.", | |
| 483 | - (SyncIntro, Tr) => "Şimdi bir eşitleme sıraya alır. Sonuç listede görünür.", | |
| 484 | 384 | (SyncNow, En) => "Sync now", |
| 485 | 385 | (SyncNow, Tr) => "Şimdi eşitle", |
| 486 | 386 | (Test, En) => "Test", |
| 487 | 387 | (Test, Tr) => "Test", |
| 488 | - (TestIntro, En) => { | |
| 489 | - "Sends a ping event to the URL, to check that it is reachable and signs requests correctly." | |
| 490 | - } | |
| 491 | - (TestIntro, Tr) => { | |
| 492 | - "URL'ye bir ping olayı gönderir; erişilebilir olduğunu ve istekleri doğru imzaladığını denetler." | |
| 493 | - } | |
| 494 | - (UrlHintKeep, En) => "Leave blank to keep the current URL.", | |
| 495 | - (UrlHintKeep, Tr) => "Mevcut URL'yi korumak için boş bırakın.", | |
| 496 | - (UrlHintNew, En) => { | |
| 497 | - "HTTPS only, unless the instance allows HTTP. Addresses inside the network are refused unless the instance allows them." | |
| 498 | - } | |
| 499 | - (UrlHintNew, Tr) => { | |
| 500 | - "Sunucu izin vermedikçe yalnızca HTTPS kullanılır. Ağ içindeki adresler de sunucu izin vermedikçe reddedilir." | |
| 501 | - } | |
| 502 | 388 | (UsernameOptional, En) => "Username (optional)", |
| 503 | 389 | (UsernameOptional, Tr) => "Kullanıcı adı (isteğe bağlı)", |
| 504 | 390 | (Webhooks, En) => "Webhooks", |
| 505 | 391 | (Webhooks, Tr) => "Web kancaları", |
| 506 | - (WebhooksIntro, En) => { | |
| 507 | - "Each active webhook receives the events it subscribes to as signed JSON POST requests. The last delivery shows whether the receiver answered with a 2xx status." | |
| 508 | - } | |
| 509 | - (WebhooksIntro, Tr) => { | |
| 510 | - "Etkin her web kancası, abone olduğu olayları imzalı JSON POST istekleri olarak alır. Son teslimat, alıcının 2xx durumuyla yanıt verip vermediğini gösterir." | |
| 511 | - } | |
| 512 | 392 | } |
| 513 | 393 | } |
| 514 | 394 |
crates/forge-web-base/src/i18n/issues.rsmodified+33 -62
| @@ -38,7 +38,6 @@ pub enum K { | ||
| 38 | 38 | PinIssue, |
| 39 | 39 | UnpinIssue, |
| 40 | 40 | PinnedTopNote, |
| 41 | - NotPinned, | |
| 42 | 41 | PinnedIssues, |
| 43 | 42 | |
| 44 | 43 | // Lock reasons: the lowercase reader text, then the select options. |
| @@ -73,7 +72,6 @@ pub enum K { | ||
| 73 | 72 | ReviewDismissedPrefix, |
| 74 | 73 | |
| 75 | 74 | // Item byline and edit forms. |
| 76 | - OpenedThis, | |
| 77 | 75 | StateClosedNotPlanned, |
| 78 | 76 | SaveChanges, |
| 79 | 77 | EditComment, |
| @@ -95,29 +93,26 @@ pub enum K { | ||
| 95 | 93 | SaveLabels, |
| 96 | 94 | NoneYet, |
| 97 | 95 | Assignees, |
| 98 | - CommaUsernames, | |
| 99 | 96 | SaveAssignees, |
| 100 | - NoOneAssigned, | |
| 101 | 97 | AssignToMe, |
| 102 | 98 | MilestoneBox, |
| 103 | 99 | NoneOption, |
| 104 | 100 | SaveMilestone, |
| 105 | - NoMilestone, | |
| 106 | 101 | ConversationBox, |
| 107 | 102 | Locked, |
| 108 | 103 | UnlockConversation, |
| 109 | 104 | NoReason, |
| 110 | - LockReasonAria, | |
| 111 | 105 | LockConversation, |
| 112 | 106 | LockedToCollaborators, |
| 113 | - OpenToEveryone, | |
| 114 | 107 | |
| 115 | 108 | // Comment form. |
| 116 | 109 | AddComment, |
| 117 | 110 | CloseCompleted, |
| 118 | 111 | CloseNotPlanned, |
| 119 | - ReopenWithComment, | |
| 120 | 112 | CommentEmpty, |
| 113 | + Add, | |
| 114 | + Close, | |
| 115 | + Reopen, | |
| 121 | 116 | |
| 122 | 117 | // Label page. |
| 123 | 118 | LabelsArchived, |
| @@ -130,7 +125,6 @@ pub enum K { | ||
| 130 | 125 | |
| 131 | 126 | // Milestone page. |
| 132 | 127 | MilestonesArchived, |
| 133 | - NoDueDate, | |
| 134 | 128 | Overdue, |
| 135 | 129 | MilestoneState, |
| 136 | 130 | NoClosedMilestones, |
| @@ -154,15 +148,12 @@ pub enum K { | ||
| 154 | 148 | NoIssuesMatch, |
| 155 | 149 | NoIssuesYet, |
| 156 | 150 | SearchTitles, |
| 157 | - IssuesByState, | |
| 158 | - LabelsAndMilestones, | |
| 159 | 151 | FiltersApplied, |
| 160 | 152 | ClearFilters, |
| 161 | 153 | Opened, |
| 162 | 154 | By, |
| 163 | 155 | ChooseTemplate, |
| 164 | 156 | BlankIssue, |
| 165 | - MarkdownSupported, | |
| 166 | 157 | SubmitNewIssue, |
| 167 | 158 | Newer, |
| 168 | 159 | Older, |
| @@ -172,7 +163,6 @@ pub enum K { | ||
| 172 | 163 | HistPullDescription, |
| 173 | 164 | HistComment, |
| 174 | 165 | HistReviewComment, |
| 175 | - NoTextChange, | |
| 176 | 166 | NoEarlierVersions, |
| 177 | 167 | } |
| 178 | 168 | |
| @@ -184,14 +174,6 @@ pub fn edited_after(lang: Lang) -> &'static str { | ||
| 184 | 174 | } |
| 185 | 175 | } |
| 186 | 176 | |
| 187 | -/// The text after the time in "opened this 3 days ago". Turkish puts the verb last. | |
| 188 | -pub fn opened_after(lang: Lang) -> &'static str { | |
| 189 | - match lang { | |
| 190 | - Lang::En => "", | |
| 191 | - Lang::Tr => " açtı", | |
| 192 | - } | |
| 193 | -} | |
| 194 | - | |
| 195 | 177 | pub fn t(lang: Lang, key: K) -> &'static str { |
| 196 | 178 | match (key, lang) { |
| 197 | 179 | (K::CouldNotSave, Lang::En) => "Could not save", |
| @@ -253,8 +235,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 253 | 235 | (K::UnpinIssue, Lang::Tr) => "Sabitlemeyi kaldır", |
| 254 | 236 | (K::PinnedTopNote, Lang::En) => "Pinned to the top of the issue list.", |
| 255 | 237 | (K::PinnedTopNote, Lang::Tr) => "Sorun listesinin en üstünde sabitlendi.", |
| 256 | - (K::NotPinned, Lang::En) => "Not pinned.", | |
| 257 | - (K::NotPinned, Lang::Tr) => "Sabitlenmemiş.", | |
| 258 | 238 | (K::PinnedIssues, Lang::En) => "Pinned issues", |
| 259 | 239 | (K::PinnedIssues, Lang::Tr) => "Sabitlenmiş sorunlar", |
| 260 | 240 | |
| @@ -322,8 +302,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 322 | 302 | (K::ReviewDismissedPrefix, Lang::En) => "dismissed a review: ", |
| 323 | 303 | (K::ReviewDismissedPrefix, Lang::Tr) => "bir incelemeyi iptal etti: ", |
| 324 | 304 | |
| 325 | - (K::OpenedThis, Lang::En) => " opened this ", | |
| 326 | - (K::OpenedThis, Lang::Tr) => " bunu ", | |
| 327 | 305 | (K::StateClosedNotPlanned, Lang::En) => "Closed as not planned", |
| 328 | 306 | (K::StateClosedNotPlanned, Lang::Tr) => "Planlanmadı olarak kapalı", |
| 329 | 307 | (K::SaveChanges, Lang::En) => "Save changes", |
| @@ -347,8 +325,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 347 | 325 | (K::ReviewedDismissed, Lang::Tr) => "inceledi (iptal edildi)", |
| 348 | 326 | (K::DismissedPrefix, Lang::En) => "dismissed: ", |
| 349 | 327 | (K::DismissedPrefix, Lang::Tr) => "iptal edildi: ", |
| 350 | - (K::AddReaction, Lang::En) => "Add reaction", | |
| 351 | - (K::AddReaction, Lang::Tr) => "Tepki ekle", | |
| 328 | + (K::AddReaction, Lang::En) => "React", | |
| 329 | + (K::AddReaction, Lang::Tr) => "Tepki ver", | |
| 352 | 330 | (K::NoDescription, Lang::En) => "_No description provided._", |
| 353 | 331 | (K::NoDescription, Lang::Tr) => "_Açıklama girilmedi._", |
| 354 | 332 | |
| @@ -360,12 +338,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 360 | 338 | (K::NoneYet, Lang::Tr) => "Henüz yok.", |
| 361 | 339 | (K::Assignees, Lang::En) => "Assignees", |
| 362 | 340 | (K::Assignees, Lang::Tr) => "Atananlar", |
| 363 | - (K::CommaUsernames, Lang::En) => "Comma-separated usernames.", | |
| 364 | - (K::CommaUsernames, Lang::Tr) => "Kullanıcı adlarını virgülle ayırın.", | |
| 365 | 341 | (K::SaveAssignees, Lang::En) => "Save assignees", |
| 366 | 342 | (K::SaveAssignees, Lang::Tr) => "Atananları kaydet", |
| 367 | - (K::NoOneAssigned, Lang::En) => "No one assigned.", | |
| 368 | - (K::NoOneAssigned, Lang::Tr) => "Kimse atanmadı.", | |
| 369 | 343 | (K::AssignToMe, Lang::En) => "Assign to me", |
| 370 | 344 | (K::AssignToMe, Lang::Tr) => "Bana ata", |
| 371 | 345 | (K::MilestoneBox, Lang::En) => "Milestone", |
| @@ -374,8 +348,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 374 | 348 | (K::NoneOption, Lang::Tr) => "Yok", |
| 375 | 349 | (K::SaveMilestone, Lang::En) => "Save milestone", |
| 376 | 350 | (K::SaveMilestone, Lang::Tr) => "Kilometre taşını kaydet", |
| 377 | - (K::NoMilestone, Lang::En) => "No milestone.", | |
| 378 | - (K::NoMilestone, Lang::Tr) => "Kilometre taşı yok.", | |
| 379 | 351 | (K::ConversationBox, Lang::En) => "Conversation", |
| 380 | 352 | (K::ConversationBox, Lang::Tr) => "Tartışma", |
| 381 | 353 | (K::Locked, Lang::En) => "Locked", |
| @@ -384,14 +356,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 384 | 356 | (K::UnlockConversation, Lang::Tr) => "Tartışmanın kilidini aç", |
| 385 | 357 | (K::NoReason, Lang::En) => "No reason", |
| 386 | 358 | (K::NoReason, Lang::Tr) => "Neden yok", |
| 387 | - (K::LockReasonAria, Lang::En) => "Lock reason", | |
| 388 | - (K::LockReasonAria, Lang::Tr) => "Kilit nedeni", | |
| 389 | 359 | (K::LockConversation, Lang::En) => "Lock conversation", |
| 390 | 360 | (K::LockConversation, Lang::Tr) => "Tartışmayı kilitle", |
| 391 | 361 | (K::LockedToCollaborators, Lang::En) => "Locked to collaborators", |
| 392 | 362 | (K::LockedToCollaborators, Lang::Tr) => "Katkıda bulunanlarla sınırlı", |
| 393 | - (K::OpenToEveryone, Lang::En) => "Open to everyone", | |
| 394 | - (K::OpenToEveryone, Lang::Tr) => "Herkese açık", | |
| 395 | 363 | |
| 396 | 364 | (K::AddComment, Lang::En) => "Add a comment", |
| 397 | 365 | (K::AddComment, Lang::Tr) => "Yorum ekle", |
| @@ -399,10 +367,14 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 399 | 367 | (K::CloseCompleted, Lang::Tr) => "Tamamlandı olarak kapat", |
| 400 | 368 | (K::CloseNotPlanned, Lang::En) => "Close as not planned", |
| 401 | 369 | (K::CloseNotPlanned, Lang::Tr) => "Planlanmadı olarak kapat", |
| 402 | - (K::ReopenWithComment, Lang::En) => "Reopen with comment", | |
| 403 | - (K::ReopenWithComment, Lang::Tr) => "Yorumla yeniden aç", | |
| 404 | 370 | (K::CommentEmpty, Lang::En) => "Comment cannot be empty.", |
| 405 | 371 | (K::CommentEmpty, Lang::Tr) => "Yorum boş olamaz.", |
| 372 | + (K::Add, Lang::En) => "Add", | |
| 373 | + (K::Add, Lang::Tr) => "Ekle", | |
| 374 | + (K::Close, Lang::En) => "Close", | |
| 375 | + (K::Close, Lang::Tr) => "Kapat", | |
| 376 | + (K::Reopen, Lang::En) => "Reopen", | |
| 377 | + (K::Reopen, Lang::Tr) => "Yeniden aç", | |
| 406 | 378 | |
| 407 | 379 | (K::LabelsArchived, Lang::En) => "This repository is archived. Labels are read-only.", |
| 408 | 380 | (K::LabelsArchived, Lang::Tr) => "Bu depo arşivlenmiş. Etiketler salt okunur.", |
| @@ -423,8 +395,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 423 | 395 | "This repository is archived. Milestones are read-only." |
| 424 | 396 | } |
| 425 | 397 | (K::MilestonesArchived, Lang::Tr) => "Bu depo arşivlenmiş. Kilometre taşları salt okunur.", |
| 426 | - (K::NoDueDate, Lang::En) => "No due date", | |
| 427 | - (K::NoDueDate, Lang::Tr) => "Bitiş tarihi yok", | |
| 428 | 398 | (K::Overdue, Lang::En) => "overdue", |
| 429 | 399 | (K::Overdue, Lang::Tr) => "gecikmiş", |
| 430 | 400 | (K::MilestoneState, Lang::En) => "Milestone state", |
| @@ -468,10 +438,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 468 | 438 | (K::NoIssuesYet, Lang::Tr) => "Henüz sorun yok. Konuşmayı başlatmak için bir sorun açın.", |
| 469 | 439 | (K::SearchTitles, Lang::En) => "Search titles", |
| 470 | 440 | (K::SearchTitles, Lang::Tr) => "Başlıklarda ara", |
| 471 | - (K::IssuesByState, Lang::En) => "Issues by state", | |
| 472 | - (K::IssuesByState, Lang::Tr) => "Duruma göre sorunlar", | |
| 473 | - (K::LabelsAndMilestones, Lang::En) => "Labels and milestones", | |
| 474 | - (K::LabelsAndMilestones, Lang::Tr) => "Etiketler ve kilometre taşları", | |
| 475 | 441 | (K::FiltersApplied, Lang::En) => "Filters applied · ", |
| 476 | 442 | (K::FiltersApplied, Lang::Tr) => "Filtreler uygulandı · ", |
| 477 | 443 | (K::ClearFilters, Lang::En) => "Clear filters", |
| @@ -484,8 +450,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 484 | 450 | (K::ChooseTemplate, Lang::Tr) => "Başlamak için bir şablon seçin.", |
| 485 | 451 | (K::BlankIssue, Lang::En) => "Open a blank issue", |
| 486 | 452 | (K::BlankIssue, Lang::Tr) => "Boş bir sorun aç", |
| 487 | - (K::MarkdownSupported, Lang::En) => "Markdown supported.", | |
| 488 | - (K::MarkdownSupported, Lang::Tr) => "Markdown desteklenir.", | |
| 489 | 453 | (K::SubmitNewIssue, Lang::En) => "Submit new issue", |
| 490 | 454 | (K::SubmitNewIssue, Lang::Tr) => "Yeni sorunu gönder", |
| 491 | 455 | (K::Newer, Lang::En) => "Newer", |
| @@ -501,8 +465,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 501 | 465 | (K::HistComment, Lang::Tr) => "yorum", |
| 502 | 466 | (K::HistReviewComment, Lang::En) => "review comment", |
| 503 | 467 | (K::HistReviewComment, Lang::Tr) => "inceleme yorumu", |
| 504 | - (K::NoTextChange, Lang::En) => "No change to the text.", | |
| 505 | - (K::NoTextChange, Lang::Tr) => "Metinde değişiklik yok.", | |
| 506 | 468 | (K::NoEarlierVersions, Lang::En) => "No earlier versions.", |
| 507 | 469 | (K::NoEarlierVersions, Lang::Tr) => "Önceki sürüm yok.", |
| 508 | 470 | } |
| @@ -709,6 +671,25 @@ pub fn reaction_more(lang: Lang, names: &str, more: usize) -> String { | ||
| 709 | 671 | |
| 710 | 672 | // Timeline event sentences. |
| 711 | 673 | |
| 674 | +/// Several label additions in one run: "added labels a, b and c". `names` holds at least two. | |
| 675 | +pub fn event_labels_added(lang: Lang, names: &[String]) -> String { | |
| 676 | + let (last, rest) = names.split_last().map_or(("", &[][..]), |(last, rest)| (last.as_str(), rest)); | |
| 677 | + let list = match lang { | |
| 678 | + Lang::En => match rest.is_empty() { | |
| 679 | + true => last.to_owned(), | |
| 680 | + false => format!("{} and {last}", rest.join(", ")), | |
| 681 | + }, | |
| 682 | + Lang::Tr => match rest.is_empty() { | |
| 683 | + true => last.to_owned(), | |
| 684 | + false => format!("{} ve {last}", rest.join(", ")), | |
| 685 | + }, | |
| 686 | + }; | |
| 687 | + match lang { | |
| 688 | + Lang::En => format!("added labels {list}"), | |
| 689 | + Lang::Tr => format!("{list} etiketlerini ekledi"), | |
| 690 | + } | |
| 691 | +} | |
| 692 | + | |
| 712 | 693 | pub fn event_label_added(lang: Lang, label: &str) -> String { |
| 713 | 694 | match lang { |
| 714 | 695 | Lang::En => format!("added the {label} label"), |
| @@ -943,7 +924,6 @@ mod tests { | ||
| 943 | 924 | K::PinIssue, |
| 944 | 925 | K::UnpinIssue, |
| 945 | 926 | K::PinnedTopNote, |
| 946 | - K::NotPinned, | |
| 947 | 927 | K::PinnedIssues, |
| 948 | 928 | K::LockOffTopic, |
| 949 | 929 | K::LockTooHeated, |
| @@ -972,7 +952,6 @@ mod tests { | ||
| 972 | 952 | K::DeletedHeadBranch, |
| 973 | 953 | K::InCommit, |
| 974 | 954 | K::ReviewDismissedPrefix, |
| 975 | - K::OpenedThis, | |
| 976 | 955 | K::StateClosedNotPlanned, |
| 977 | 956 | K::SaveChanges, |
| 978 | 957 | K::EditComment, |
| @@ -990,26 +969,23 @@ mod tests { | ||
| 990 | 969 | K::SaveLabels, |
| 991 | 970 | K::NoneYet, |
| 992 | 971 | K::Assignees, |
| 993 | - K::CommaUsernames, | |
| 994 | 972 | K::SaveAssignees, |
| 995 | - K::NoOneAssigned, | |
| 996 | 973 | K::AssignToMe, |
| 997 | 974 | K::MilestoneBox, |
| 998 | 975 | K::NoneOption, |
| 999 | 976 | K::SaveMilestone, |
| 1000 | - K::NoMilestone, | |
| 1001 | 977 | K::ConversationBox, |
| 1002 | 978 | K::Locked, |
| 1003 | 979 | K::UnlockConversation, |
| 1004 | 980 | K::NoReason, |
| 1005 | - K::LockReasonAria, | |
| 1006 | 981 | K::LockConversation, |
| 1007 | 982 | K::LockedToCollaborators, |
| 1008 | - K::OpenToEveryone, | |
| 1009 | 983 | K::AddComment, |
| 1010 | 984 | K::CloseCompleted, |
| 1011 | 985 | K::CloseNotPlanned, |
| 1012 | - K::ReopenWithComment, | |
| 986 | + K::Add, | |
| 987 | + K::Close, | |
| 988 | + K::Reopen, | |
| 1013 | 989 | K::CommentEmpty, |
| 1014 | 990 | K::LabelsArchived, |
| 1015 | 991 | K::NoLabelsYet, |
| @@ -1019,7 +995,6 @@ mod tests { | ||
| 1019 | 995 | K::CreateLabel, |
| 1020 | 996 | K::OpenLabelCount, |
| 1021 | 997 | K::MilestonesArchived, |
| 1022 | - K::NoDueDate, | |
| 1023 | 998 | K::Overdue, |
| 1024 | 999 | K::MilestoneState, |
| 1025 | 1000 | K::NoClosedMilestones, |
| @@ -1041,15 +1016,12 @@ mod tests { | ||
| 1041 | 1016 | K::NoIssuesMatch, |
| 1042 | 1017 | K::NoIssuesYet, |
| 1043 | 1018 | K::SearchTitles, |
| 1044 | - K::IssuesByState, | |
| 1045 | - K::LabelsAndMilestones, | |
| 1046 | 1019 | K::FiltersApplied, |
| 1047 | 1020 | K::ClearFilters, |
| 1048 | 1021 | K::Opened, |
| 1049 | 1022 | K::By, |
| 1050 | 1023 | K::ChooseTemplate, |
| 1051 | 1024 | K::BlankIssue, |
| 1052 | - K::MarkdownSupported, | |
| 1053 | 1025 | K::SubmitNewIssue, |
| 1054 | 1026 | K::Newer, |
| 1055 | 1027 | K::Older, |
| @@ -1057,7 +1029,6 @@ mod tests { | ||
| 1057 | 1029 | K::HistPullDescription, |
| 1058 | 1030 | K::HistComment, |
| 1059 | 1031 | K::HistReviewComment, |
| 1060 | - K::NoTextChange, | |
| 1061 | 1032 | K::NoEarlierVersions, |
| 1062 | 1033 | ]; |
| 1063 | 1034 |
crates/forge-web-base/src/i18n/merge_queue.rsmodified+4 -52
| @@ -6,10 +6,8 @@ use super::Lang; | ||
| 6 | 6 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] |
| 7 | 7 | pub enum K { |
| 8 | 8 | RequireMergeQueue, |
| 9 | - RequireMergeQueueHint, | |
| 10 | 9 | RuleMergeQueue, |
| 11 | 10 | AddToMergeQueue, |
| 12 | - MergeQueueHint, | |
| 13 | 11 | RemoveFromQueue, |
| 14 | 12 | MergeQueueTitle, |
| 15 | 13 | MergeQueueNav, |
| @@ -18,13 +16,6 @@ pub enum K { | ||
| 18 | 16 | QueueEmpty, |
| 19 | 17 | QueueNoBranch, |
| 20 | 18 | QueueColPosition, |
| 21 | - QueueColPull, | |
| 22 | - QueueColBranch, | |
| 23 | - QueueColState, | |
| 24 | - QueueColBy, | |
| 25 | - QueueColQueued, | |
| 26 | - QueueColRun, | |
| 27 | - QueueColReason, | |
| 28 | 19 | QueueNoRun, |
| 29 | 20 | StateQueued, |
| 30 | 21 | StateTesting, |
| @@ -49,10 +40,8 @@ pub enum K { | ||
| 49 | 40 | #[cfg(test)] |
| 50 | 41 | pub const ALL: &[K] = &[ |
| 51 | 42 | K::RequireMergeQueue, |
| 52 | - K::RequireMergeQueueHint, | |
| 53 | 43 | K::RuleMergeQueue, |
| 54 | 44 | K::AddToMergeQueue, |
| 55 | - K::MergeQueueHint, | |
| 56 | 45 | K::RemoveFromQueue, |
| 57 | 46 | K::MergeQueueTitle, |
| 58 | 47 | K::MergeQueueNav, |
| @@ -61,13 +50,6 @@ pub const ALL: &[K] = &[ | ||
| 61 | 50 | K::QueueEmpty, |
| 62 | 51 | K::QueueNoBranch, |
| 63 | 52 | K::QueueColPosition, |
| 64 | - K::QueueColPull, | |
| 65 | - K::QueueColBranch, | |
| 66 | - K::QueueColState, | |
| 67 | - K::QueueColBy, | |
| 68 | - K::QueueColQueued, | |
| 69 | - K::QueueColRun, | |
| 70 | - K::QueueColReason, | |
| 71 | 53 | K::QueueNoRun, |
| 72 | 54 | K::StateQueued, |
| 73 | 55 | K::StateTesting, |
| @@ -94,22 +76,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 94 | 76 | match (key, lang) { |
| 95 | 77 | (RequireMergeQueue, En) => "Merge queue", |
| 96 | 78 | (RequireMergeQueue, Tr) => "Birleştirme sırası", |
| 97 | - (RequireMergeQueueHint, En) => { | |
| 98 | - "Merges go through the merge queue. Each pull request is tested on top of the current branch tip, and the branch moves only to a tested commit." | |
| 99 | - } | |
| 100 | - (RequireMergeQueueHint, Tr) => { | |
| 101 | - "Birleştirmeler birleştirme sırasından geçer. Her çekme isteği güncel dal ucunun üstünde test edilir ve dal yalnızca test edilmiş bir commit'e ilerler." | |
| 102 | - } | |
| 103 | 79 | (RuleMergeQueue, En) => "merge queue required", |
| 104 | 80 | (RuleMergeQueue, Tr) => "birleştirme sırası zorunlu", |
| 105 | 81 | (AddToMergeQueue, En) => "Add to merge queue", |
| 106 | 82 | (AddToMergeQueue, Tr) => "Birleştirme sırasına ekle", |
| 107 | - (MergeQueueHint, En) => { | |
| 108 | - "This branch requires the merge queue. The pull request is tested on the current tip before it lands." | |
| 109 | - } | |
| 110 | - (MergeQueueHint, Tr) => { | |
| 111 | - "Bu dal birleştirme sırası gerektirir. Çekme isteği inmeden önce güncel uç üzerinde test edilir." | |
| 112 | - } | |
| 113 | 83 | (RemoveFromQueue, En) => "Remove from queue", |
| 114 | 84 | (RemoveFromQueue, Tr) => "Sıradan çıkar", |
| 115 | 85 | (MergeQueueTitle, En) => "Merge queue", |
| @@ -120,30 +90,12 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 120 | 90 | (QueueWaiting, Tr) => "Bekleyen", |
| 121 | 91 | (QueueHistory, En) => "History", |
| 122 | 92 | (QueueHistory, Tr) => "Geçmiş", |
| 123 | - (QueueEmpty, En) => "Nothing is waiting in the merge queue.", | |
| 124 | - (QueueEmpty, Tr) => "Birleştirme sırasında bekleyen yok.", | |
| 125 | - (QueueNoBranch, En) => { | |
| 126 | - "No protected branch requires the merge queue. Turn it on in the branch protection settings." | |
| 127 | - } | |
| 128 | - (QueueNoBranch, Tr) => { | |
| 129 | - "Birleştirme sırası isteyen korumalı bir dal yok. Dal koruma ayarlarından açabilirsiniz." | |
| 130 | - } | |
| 93 | + (QueueEmpty, En) => "Nothing waiting.", | |
| 94 | + (QueueEmpty, Tr) => "Bekleyen yok.", | |
| 95 | + (QueueNoBranch, En) => "No branch requires the merge queue.", | |
| 96 | + (QueueNoBranch, Tr) => "Birleştirme sırası isteyen dal yok.", | |
| 131 | 97 | (QueueColPosition, En) => "Position", |
| 132 | 98 | (QueueColPosition, Tr) => "Sıra", |
| 133 | - (QueueColPull, En) => "Pull request", | |
| 134 | - (QueueColPull, Tr) => "Çekme isteği", | |
| 135 | - (QueueColBranch, En) => "Branch", | |
| 136 | - (QueueColBranch, Tr) => "Dal", | |
| 137 | - (QueueColState, En) => "State", | |
| 138 | - (QueueColState, Tr) => "Durum", | |
| 139 | - (QueueColBy, En) => "Queued by", | |
| 140 | - (QueueColBy, Tr) => "Ekleyen", | |
| 141 | - (QueueColQueued, En) => "Queued", | |
| 142 | - (QueueColQueued, Tr) => "Eklendi", | |
| 143 | - (QueueColRun, En) => "CI run", | |
| 144 | - (QueueColRun, Tr) => "CI çalıştırması", | |
| 145 | - (QueueColReason, En) => "Reason", | |
| 146 | - (QueueColReason, Tr) => "Neden", | |
| 147 | 99 | (QueueNoRun, En) => "No run", |
| 148 | 100 | (QueueNoRun, Tr) => "Çalıştırma yok", |
| 149 | 101 | (StateQueued, En) => "Queued", |
crates/forge-web-base/src/i18n/migrate.rsmodified+0 -80
| @@ -10,7 +10,6 @@ pub enum K { | ||
| 10 | 10 | TabImport, |
| 11 | 11 | // Import form. |
| 12 | 12 | ImportTitle, |
| 13 | - ImportIntro, | |
| 14 | 13 | SrcGit, |
| 15 | 14 | SrcGitHub, |
| 16 | 15 | SrcGitLab, |
| @@ -23,24 +22,19 @@ pub enum K { | ||
| 23 | 22 | GitLabProject, |
| 24 | 23 | ForgejoInstance, |
| 25 | 24 | TokenOptional, |
| 26 | - TokenHelp, | |
| 27 | 25 | TargetOwner, |
| 28 | 26 | TargetName, |
| 29 | - TargetNameHelp, | |
| 30 | 27 | Description, |
| 31 | 28 | WhatToImport, |
| 32 | 29 | OptLabels, |
| 33 | 30 | OptIssues, |
| 34 | 31 | OptPulls, |
| 35 | 32 | OptReleases, |
| 36 | - OptionsNote, | |
| 37 | 33 | StartImport, |
| 38 | 34 | BulkLink, |
| 39 | 35 | BulkLinkButton, |
| 40 | - BulkOwnerHelp, | |
| 41 | 36 | // Bulk import. |
| 42 | 37 | BulkTitle, |
| 43 | - BulkIntro, | |
| 44 | 38 | BulkOwnerGitHub, |
| 45 | 39 | BulkOwnerGitLab, |
| 46 | 40 | BulkOwnerForgejo, |
| @@ -55,14 +49,11 @@ pub enum K { | ||
| 55 | 49 | // Jobs. |
| 56 | 50 | JobsTitle, |
| 57 | 51 | NoJobs, |
| 58 | - RecentImports, | |
| 59 | - ViewAll, | |
| 60 | 52 | JobQueued, |
| 61 | 53 | JobRunning, |
| 62 | 54 | JobDone, |
| 63 | 55 | JobFailed, |
| 64 | 56 | JobRetry, |
| 65 | - JobRetryHelp, | |
| 66 | 57 | JobOpenRepo, |
| 67 | 58 | JobProgress, |
| 68 | 59 | JobNoLog, |
| @@ -70,7 +61,6 @@ pub enum K { | ||
| 70 | 61 | RetryFailedTitle, |
| 71 | 62 | RetrySelected, |
| 72 | 63 | RetryNone, |
| 73 | - RetryTokenHelp, | |
| 74 | 64 | StageGit, |
| 75 | 65 | StageLabels, |
| 76 | 66 | StageMilestones, |
| @@ -86,8 +76,6 @@ pub enum K { | ||
| 86 | 76 | // Data export. |
| 87 | 77 | SettingsExport, |
| 88 | 78 | ExportTitle, |
| 89 | - ExportIntro, | |
| 90 | - ExportContents, | |
| 91 | 79 | ExportRequest, |
| 92 | 80 | ExportBuilding, |
| 93 | 81 | ExportReady, |
| @@ -96,7 +84,6 @@ pub enum K { | ||
| 96 | 84 | ExportNone, |
| 97 | 85 | ExportRequested, |
| 98 | 86 | ExportSize, |
| 99 | - ExportEmailNote, | |
| 100 | 87 | } |
| 101 | 88 | |
| 102 | 89 | #[cfg(test)] |
| @@ -104,7 +91,6 @@ const ALL: &[K] = &[ | ||
| 104 | 91 | K::TabCreate, |
| 105 | 92 | K::TabImport, |
| 106 | 93 | K::ImportTitle, |
| 107 | - K::ImportIntro, | |
| 108 | 94 | K::SrcGit, |
| 109 | 95 | K::SrcGitHub, |
| 110 | 96 | K::SrcGitLab, |
| @@ -117,23 +103,18 @@ const ALL: &[K] = &[ | ||
| 117 | 103 | K::GitLabProject, |
| 118 | 104 | K::ForgejoInstance, |
| 119 | 105 | K::TokenOptional, |
| 120 | - K::TokenHelp, | |
| 121 | 106 | K::TargetOwner, |
| 122 | 107 | K::TargetName, |
| 123 | - K::TargetNameHelp, | |
| 124 | 108 | K::Description, |
| 125 | 109 | K::WhatToImport, |
| 126 | 110 | K::OptLabels, |
| 127 | 111 | K::OptIssues, |
| 128 | 112 | K::OptPulls, |
| 129 | 113 | K::OptReleases, |
| 130 | - K::OptionsNote, | |
| 131 | 114 | K::StartImport, |
| 132 | 115 | K::BulkLink, |
| 133 | 116 | K::BulkLinkButton, |
| 134 | - K::BulkOwnerHelp, | |
| 135 | 117 | K::BulkTitle, |
| 136 | - K::BulkIntro, | |
| 137 | 118 | K::BulkOwnerGitHub, |
| 138 | 119 | K::BulkOwnerGitLab, |
| 139 | 120 | K::BulkOwnerForgejo, |
| @@ -147,14 +128,11 @@ const ALL: &[K] = &[ | ||
| 147 | 128 | K::BulkArchived, |
| 148 | 129 | K::JobsTitle, |
| 149 | 130 | K::NoJobs, |
| 150 | - K::RecentImports, | |
| 151 | - K::ViewAll, | |
| 152 | 131 | K::JobQueued, |
| 153 | 132 | K::JobRunning, |
| 154 | 133 | K::JobDone, |
| 155 | 134 | K::JobFailed, |
| 156 | 135 | K::JobRetry, |
| 157 | - K::JobRetryHelp, | |
| 158 | 136 | K::JobOpenRepo, |
| 159 | 137 | K::JobProgress, |
| 160 | 138 | K::JobNoLog, |
| @@ -162,7 +140,6 @@ const ALL: &[K] = &[ | ||
| 162 | 140 | K::RetryFailedTitle, |
| 163 | 141 | K::RetrySelected, |
| 164 | 142 | K::RetryNone, |
| 165 | - K::RetryTokenHelp, | |
| 166 | 143 | K::StageGit, |
| 167 | 144 | K::StageLabels, |
| 168 | 145 | K::StageMilestones, |
| @@ -176,8 +153,6 @@ const ALL: &[K] = &[ | ||
| 176 | 153 | K::ErrTooMany, |
| 177 | 154 | K::SettingsExport, |
| 178 | 155 | K::ExportTitle, |
| 179 | - K::ExportIntro, | |
| 180 | - K::ExportContents, | |
| 181 | 156 | K::ExportRequest, |
| 182 | 157 | K::ExportBuilding, |
| 183 | 158 | K::ExportReady, |
| @@ -186,7 +161,6 @@ const ALL: &[K] = &[ | ||
| 186 | 161 | K::ExportNone, |
| 187 | 162 | K::ExportRequested, |
| 188 | 163 | K::ExportSize, |
| 189 | - K::ExportEmailNote, | |
| 190 | 164 | ]; |
| 191 | 165 | |
| 192 | 166 | /// `(English, Turkish)` for each phrase. |
| @@ -195,10 +169,6 @@ fn pair(key: K) -> (&'static str, &'static str) { | ||
| 195 | 169 | K::TabCreate => ("Create", "Oluştur"), |
| 196 | 170 | K::TabImport => ("Import", "İçe aktar"), |
| 197 | 171 | K::ImportTitle => ("Import a repository", "Depo içe aktar"), |
| 198 | - K::ImportIntro => ( | |
| 199 | - "Copy a repository with all its branches and tags. The result is a normal repository, not a mirror.", | |
| 200 | - "Bir depoyu tüm dalları ve etiketleriyle kopyalayın. Sonuç yansı değil, normal bir depodur.", | |
| 201 | - ), | |
| 202 | 172 | K::SrcGit => ("Git URL", "Git URL'si"), |
| 203 | 173 | K::SrcGitHub => ("GitHub", "GitHub"), |
| 204 | 174 | K::SrcGitLab => ("GitLab", "GitLab"), |
| @@ -217,38 +187,18 @@ fn pair(key: K) -> (&'static str, &'static str) { | ||
| 217 | 187 | "Forgejo veya Gitea adresi (Codeberg da olur)", |
| 218 | 188 | ), |
| 219 | 189 | K::TokenOptional => ("Access token (optional)", "Erişim belirteci (isteğe bağlı)"), |
| 220 | - K::TokenHelp => ( | |
| 221 | - "Needed for private repositories and higher rate limits. It is used only while the import runs and is never stored.", | |
| 222 | - "Özel depolar ve daha yüksek istek sınırı için gerekir. Yalnızca içe aktarma sürerken kullanılır ve asla saklanmaz.", | |
| 223 | - ), | |
| 224 | 190 | K::TargetOwner => ("Owner", "Sahip"), |
| 225 | 191 | K::TargetName => ("New repository name", "Yeni depo adı"), |
| 226 | - K::TargetNameHelp => ( | |
| 227 | - "Leave blank to keep the original name.", | |
| 228 | - "Özgün adı korumak için boş bırakın.", | |
| 229 | - ), | |
| 230 | 192 | K::Description => ("Description (optional)", "Açıklama (isteğe bağlı)"), |
| 231 | 193 | K::WhatToImport => ("Also import", "Şunları da içe aktar"), |
| 232 | 194 | K::OptLabels => ("Labels and milestones", "Etiketler ve kilometre taşları"), |
| 233 | 195 | K::OptIssues => ("Issues and comments", "Konular ve yorumlar"), |
| 234 | 196 | K::OptPulls => ("Pull requests (as issues)", "Çekme istekleri (konu olarak)"), |
| 235 | 197 | K::OptReleases => ("Releases and their files", "Sürümler ve dosyaları"), |
| 236 | - K::OptionsNote => ( | |
| 237 | - "Authors with no account here are shown as \"originally by @name on the source site\". Pull requests become issues marked \"imported PR\", because their branches may be gone.", | |
| 238 | - "Burada hesabı olmayan yazarlar \"@ad tarafından, kaynak sitede\" olarak gösterilir. Çekme istekleri, dalları silinmiş olabileceğinden \"imported PR\" işaretli konulara dönüşür.", | |
| 239 | - ), | |
| 240 | 198 | K::StartImport => ("Start import", "İçe aktarmayı başlat"), |
| 241 | 199 | K::BulkLink => ("Import several repositories", "Birden çok depoyu içe aktar"), |
| 242 | 200 | K::BulkLinkButton => ("Choose repositories", "Depoları seç"), |
| 243 | - K::BulkOwnerHelp => ( | |
| 244 | - "The new repositories belong to this account. One whose name is taken there is skipped.", | |
| 245 | - "Yeni depolar bu hesaba ait olur. Adı orada zaten alınmış olan atlanır.", | |
| 246 | - ), | |
| 247 | 201 | K::BulkTitle => ("Import several repositories", "Birden çok depoyu içe aktar"), |
| 248 | - K::BulkIntro => ( | |
| 249 | - "List the repositories of a user or organization, tick the ones you want and import them together.", | |
| 250 | - "Bir kullanıcının veya kuruluşun depolarını listeleyin, istediklerinizi işaretleyin ve birlikte içe aktarın.", | |
| 251 | - ), | |
| 252 | 202 | K::BulkOwnerGitHub => ( |
| 253 | 203 | "GitHub user or organization", |
| 254 | 204 | "GitHub kullanıcısı veya kuruluşu", |
| @@ -271,17 +221,11 @@ fn pair(key: K) -> (&'static str, &'static str) { | ||
| 271 | 221 | K::BulkArchived => ("archived", "arşivlenmiş"), |
| 272 | 222 | K::JobsTitle => ("Import history", "İçe aktarma geçmişi"), |
| 273 | 223 | K::NoJobs => ("No imports yet.", "Henüz içe aktarma yok."), |
| 274 | - K::RecentImports => ("Recent imports", "Son içe aktarmalar"), | |
| 275 | - K::ViewAll => ("View all", "Tümünü gör"), | |
| 276 | 224 | K::JobQueued => ("Queued", "Sırada"), |
| 277 | 225 | K::JobRunning => ("Running", "Çalışıyor"), |
| 278 | 226 | K::JobDone => ("Done", "Bitti"), |
| 279 | 227 | K::JobFailed => ("Failed", "Başarısız"), |
| 280 | 228 | K::JobRetry => ("Retry", "Yeniden dene"), |
| 281 | - K::JobRetryHelp => ( | |
| 282 | - "Enter the token again to continue. What was already imported is kept and skipped.", | |
| 283 | - "Devam etmek için belirteci yeniden girin. İçe aktarılanlar korunur ve atlanır.", | |
| 284 | - ), | |
| 285 | 229 | K::JobOpenRepo => ("Open repository", "Depoyu aç"), |
| 286 | 230 | K::JobProgress => ("Progress", "İlerleme"), |
| 287 | 231 | K::JobNoLog => ("Nothing yet.", "Henüz bir şey yok."), |
| @@ -292,10 +236,6 @@ fn pair(key: K) -> (&'static str, &'static str) { | ||
| 292 | 236 | ), |
| 293 | 237 | K::RetrySelected => ("Retry selected", "Seçilenleri yeniden dene"), |
| 294 | 238 | K::RetryNone => ("No failed imports", "Başarısız içe aktarma yok"), |
| 295 | - K::RetryTokenHelp => ( | |
| 296 | - "Used for every import you select, then discarded. Retry imports from another account or provider separately with their own token. What was already imported is skipped.", | |
| 297 | - "Seçtiğiniz her içe aktarma için kullanılır, sonra silinir. Başka bir hesap veya sağlayıcıdan gelen içe aktarmaları kendi belirteçleriyle ayrı olarak yeniden deneyin. Daha önce içe aktarılanlar atlanır.", | |
| 298 | - ), | |
| 299 | 239 | K::StageGit => ("Git data", "Git verisi"), |
| 300 | 240 | K::StageLabels => ("Labels", "Etiketler"), |
| 301 | 241 | K::StageMilestones => ("Milestones", "Kilometre taşları"), |
| @@ -321,14 +261,6 @@ fn pair(key: K) -> (&'static str, &'static str) { | ||
| 321 | 261 | ), |
| 322 | 262 | K::SettingsExport => ("Data export", "Veri dışa aktarımı"), |
| 323 | 263 | K::ExportTitle => ("Export your data", "Verilerinizi dışa aktarın"), |
| 324 | - K::ExportIntro => ( | |
| 325 | - "Download an archive of your repositories as git bundles, with their issues, comments, releases and your profile as JSON.", | |
| 326 | - "Depolarınızı git paketleri olarak, konuları, yorumları, sürümleri ve profilinizi JSON olarak içeren bir arşiv indirin.", | |
| 327 | - ), | |
| 328 | - K::ExportContents => ( | |
| 329 | - "The archive holds profile.json and, for each repository, repo.bundle, repo.json, issues.json and releases.json. Release files are listed but not included.", | |
| 330 | - "Arşiv profile.json dosyasını ve her depo için repo.bundle, repo.json, issues.json ve releases.json dosyalarını içerir. Sürüm dosyaları listelenir ama dahil edilmez.", | |
| 331 | - ), | |
| 332 | 264 | K::ExportRequest => ("Request an export", "Dışa aktarım iste"), |
| 333 | 265 | K::ExportBuilding => ("Building", "Hazırlanıyor"), |
| 334 | 266 | K::ExportReady => ("Ready", "Hazır"), |
| @@ -337,10 +269,6 @@ fn pair(key: K) -> (&'static str, &'static str) { | ||
| 337 | 269 | K::ExportNone => ("No exports yet.", "Henüz dışa aktarım yok."), |
| 338 | 270 | K::ExportRequested => ("Requested", "İstendi"), |
| 339 | 271 | K::ExportSize => ("Size", "Boyut"), |
| 340 | - K::ExportEmailNote => ( | |
| 341 | - "This page updates when the archive is ready, and we send an email if your account has an address.", | |
| 342 | - "Arşiv hazır olunca bu sayfa güncellenir; hesabınızda adres varsa e-posta da gönderilir.", | |
| 343 | - ), | |
| 344 | 272 | } |
| 345 | 273 | } |
| 346 | 274 | |
| @@ -360,14 +288,6 @@ pub fn expires_label(lang: Lang) -> &'static str { | ||
| 360 | 288 | } |
| 361 | 289 | } |
| 362 | 290 | |
| 363 | -/// The note about when a finished archive is removed. | |
| 364 | -pub fn export_ttl_note(lang: Lang, days: u64) -> String { | |
| 365 | - match lang { | |
| 366 | - Lang::En => format!("Archives are removed after {days} days."), | |
| 367 | - Lang::Tr => format!("Arşivler {days} gün sonra silinir."), | |
| 368 | - } | |
| 369 | -} | |
| 370 | - | |
| 371 | 291 | /// The import list's note after a bulk import left some repositories out. `list` says which and why. |
| 372 | 292 | pub fn bulk_skipped(lang: Lang, list: &str) -> String { |
| 373 | 293 | match lang { |
crates/forge-web-base/src/i18n/misc.rsmodified+1 -246
| @@ -16,7 +16,6 @@ pub enum K { | ||
| 16 | 16 | Appearance, |
| 17 | 17 | ThemeLabel, |
| 18 | 18 | LanguageLabel, |
| 19 | - MatchSystemHelp, | |
| 20 | 19 | MatchSystem, |
| 21 | 20 | Light, |
| 22 | 21 | Dark, |
| @@ -34,24 +33,14 @@ pub enum K { | ||
| 34 | 33 | HueLabel, |
| 35 | 34 | VividnessLabel, |
| 36 | 35 | HexLabel, |
| 37 | - LightnessNote, | |
| 38 | 36 | BackgroundLabel, |
| 39 | 37 | ChooseBase, |
| 40 | 38 | // Appearance: which side the shell sidebar sits on. |
| 41 | - SidebarLabel, | |
| 42 | - SidebarLeft, | |
| 43 | - SidebarRight, | |
| 44 | 39 | ChooseSidebar, |
| 45 | 40 | // Appearance: the run-finished tone. |
| 46 | 41 | SoundLabel, |
| 47 | - SoundSwitch, | |
| 48 | - SoundOwnRuns, | |
| 49 | 42 | SoundPassed, |
| 50 | - SoundPassedNote, | |
| 51 | 43 | SoundFailed, |
| 52 | - SoundFailedNote, | |
| 53 | - SoundPlay, | |
| 54 | - SoundFootOwn, | |
| 55 | 44 | ChooseSound, |
| 56 | 45 | // Notifications: row kinds. |
| 57 | 46 | KindOpenIssue, |
| @@ -86,20 +75,9 @@ pub enum K { | ||
| 86 | 75 | VerbPushedTo, |
| 87 | 76 | VerbUpdated, |
| 88 | 77 | VerbDiscussionReply, |
| 89 | - // Notifications: why the viewer is subscribed (`receiving_because` wraps them). | |
| 90 | - WhyMentioned, | |
| 91 | - WhyAssigned, | |
| 92 | - WhyReviewRequested, | |
| 93 | - WhyAuthor, | |
| 94 | - WhyCommented, | |
| 95 | - WhySubscribed, | |
| 96 | - WhyWatching, | |
| 97 | - NotReceivingRepo, | |
| 98 | - NotReceivingThread, | |
| 99 | 78 | // Notifications: inbox page. |
| 100 | 79 | MarkAllAsRead, |
| 101 | 80 | MarkAllRead, |
| 102 | - ClearNotifications, | |
| 103 | 81 | MarkRead, |
| 104 | 82 | NoNotificationsYet, |
| 105 | 83 | NoUnreadNotifications, |
| @@ -113,20 +91,9 @@ pub enum K { | ||
| 113 | 91 | OptParticipating, |
| 114 | 92 | OptWatching, |
| 115 | 93 | OptIgnoring, |
| 116 | - WatchDescParticipating, | |
| 117 | - WatchDescWatching, | |
| 118 | - WatchDescIgnoring, | |
| 119 | 94 | // Repo security page. |
| 120 | 95 | SecurityOff, |
| 121 | - LockfilesRead, | |
| 122 | 96 | NoAlerts, |
| 123 | - ColAdvisory, | |
| 124 | - ColPackage, | |
| 125 | - ColVersion, | |
| 126 | - ColSeverity, | |
| 127 | - ColSummary, | |
| 128 | - ColState, | |
| 129 | - ColOpened, | |
| 130 | 97 | StateOpen, |
| 131 | 98 | StateDismissed, |
| 132 | 99 | StateFixed, |
| @@ -137,12 +104,9 @@ pub enum K { | ||
| 137 | 104 | RepoName, |
| 138 | 105 | DescriptionOptional, |
| 139 | 106 | VisibilityLegend, |
| 140 | - PrivateHelp, | |
| 141 | - PublicHelp, | |
| 142 | 107 | DefaultBranch, |
| 143 | 108 | AddDefaultLabels, |
| 144 | 109 | MirrorLegend, |
| 145 | - MirrorIntro, | |
| 146 | 110 | SourceUrl, |
| 147 | 111 | UsernameOptional, |
| 148 | 112 | PasswordOrToken, |
| @@ -151,10 +115,8 @@ pub enum K { | ||
| 151 | 115 | OwnerRefused, |
| 152 | 116 | InvalidRepoName, |
| 153 | 117 | ReadmeLabel, |
| 154 | - ReadmeHelp, | |
| 155 | 118 | LicenseLabel, |
| 156 | 119 | LicenseNone, |
| 157 | - LicenseHelp, | |
| 158 | 120 | UnknownLicense, |
| 159 | 121 | MirrorWithFiles, |
| 160 | 122 | // Dashboard contribution calendar (`views::heatmap`). |
| @@ -172,23 +134,18 @@ pub enum K { | ||
| 172 | 134 | ViewAllNotifications, |
| 173 | 135 | // Shell chrome (`views::mod`): breadcrumb landmark, theme picker, ref selector. |
| 174 | 136 | BreadcrumbNav, |
| 175 | - ApplyTheme, | |
| 176 | 137 | RefLabel, |
| 177 | 138 | // Top-bar user menu: the viewer's public profile and the settings editor. |
| 178 | 139 | YourProfile, |
| 179 | 140 | EditProfile, |
| 180 | 141 | EditOrganization, |
| 181 | 142 | // Profile corner, live strip and path bar search. |
| 182 | - AllNotifications, | |
| 183 | 143 | Passed, |
| 184 | 144 | Failed, |
| 185 | 145 | Cancelled, |
| 186 | 146 | YourCiRuns, |
| 187 | 147 | SearchPublicReposFor, |
| 188 | 148 | // The bell's popover: the newest notifications, opened from the profile corner. |
| 189 | - OpenNotifications, | |
| 190 | - PeekLoading, | |
| 191 | - PeekError, | |
| 192 | 149 | AllCaughtUp, |
| 193 | 150 | } |
| 194 | 151 | |
| @@ -198,7 +155,6 @@ const ALL: &[K] = &[ | ||
| 198 | 155 | K::Appearance, |
| 199 | 156 | K::ThemeLabel, |
| 200 | 157 | K::LanguageLabel, |
| 201 | - K::MatchSystemHelp, | |
| 202 | 158 | K::MatchSystem, |
| 203 | 159 | K::Light, |
| 204 | 160 | K::Dark, |
| @@ -215,22 +171,12 @@ const ALL: &[K] = &[ | ||
| 215 | 171 | K::HueLabel, |
| 216 | 172 | K::VividnessLabel, |
| 217 | 173 | K::HexLabel, |
| 218 | - K::LightnessNote, | |
| 219 | 174 | K::BackgroundLabel, |
| 220 | 175 | K::ChooseBase, |
| 221 | - K::SidebarLabel, | |
| 222 | - K::SidebarLeft, | |
| 223 | - K::SidebarRight, | |
| 224 | 176 | K::ChooseSidebar, |
| 225 | 177 | K::SoundLabel, |
| 226 | - K::SoundSwitch, | |
| 227 | - K::SoundOwnRuns, | |
| 228 | 178 | K::SoundPassed, |
| 229 | - K::SoundPassedNote, | |
| 230 | 179 | K::SoundFailed, |
| 231 | - K::SoundFailedNote, | |
| 232 | - K::SoundPlay, | |
| 233 | - K::SoundFootOwn, | |
| 234 | 180 | K::ChooseSound, |
| 235 | 181 | K::KindOpenIssue, |
| 236 | 182 | K::KindClosedIssue, |
| @@ -262,18 +208,8 @@ const ALL: &[K] = &[ | ||
| 262 | 208 | K::VerbPushedTo, |
| 263 | 209 | K::VerbUpdated, |
| 264 | 210 | K::VerbDiscussionReply, |
| 265 | - K::WhyMentioned, | |
| 266 | - K::WhyAssigned, | |
| 267 | - K::WhyReviewRequested, | |
| 268 | - K::WhyAuthor, | |
| 269 | - K::WhyCommented, | |
| 270 | - K::WhySubscribed, | |
| 271 | - K::WhyWatching, | |
| 272 | - K::NotReceivingRepo, | |
| 273 | - K::NotReceivingThread, | |
| 274 | 211 | K::MarkAllAsRead, |
| 275 | 212 | K::MarkAllRead, |
| 276 | - K::ClearNotifications, | |
| 277 | 213 | K::MarkRead, |
| 278 | 214 | K::NoNotificationsYet, |
| 279 | 215 | K::NoUnreadNotifications, |
| @@ -286,19 +222,8 @@ const ALL: &[K] = &[ | ||
| 286 | 222 | K::OptParticipating, |
| 287 | 223 | K::OptWatching, |
| 288 | 224 | K::OptIgnoring, |
| 289 | - K::WatchDescParticipating, | |
| 290 | - K::WatchDescWatching, | |
| 291 | - K::WatchDescIgnoring, | |
| 292 | 225 | K::SecurityOff, |
| 293 | - K::LockfilesRead, | |
| 294 | 226 | K::NoAlerts, |
| 295 | - K::ColAdvisory, | |
| 296 | - K::ColPackage, | |
| 297 | - K::ColVersion, | |
| 298 | - K::ColSeverity, | |
| 299 | - K::ColSummary, | |
| 300 | - K::ColState, | |
| 301 | - K::ColOpened, | |
| 302 | 227 | K::StateOpen, |
| 303 | 228 | K::StateDismissed, |
| 304 | 229 | K::StateFixed, |
| @@ -308,12 +233,9 @@ const ALL: &[K] = &[ | ||
| 308 | 233 | K::RepoName, |
| 309 | 234 | K::DescriptionOptional, |
| 310 | 235 | K::VisibilityLegend, |
| 311 | - K::PrivateHelp, | |
| 312 | - K::PublicHelp, | |
| 313 | 236 | K::DefaultBranch, |
| 314 | 237 | K::AddDefaultLabels, |
| 315 | 238 | K::MirrorLegend, |
| 316 | - K::MirrorIntro, | |
| 317 | 239 | K::SourceUrl, |
| 318 | 240 | K::UsernameOptional, |
| 319 | 241 | K::PasswordOrToken, |
| @@ -322,10 +244,8 @@ const ALL: &[K] = &[ | ||
| 322 | 244 | K::OwnerRefused, |
| 323 | 245 | K::InvalidRepoName, |
| 324 | 246 | K::ReadmeLabel, |
| 325 | - K::ReadmeHelp, | |
| 326 | 247 | K::LicenseLabel, |
| 327 | 248 | K::LicenseNone, |
| 328 | - K::LicenseHelp, | |
| 329 | 249 | K::UnknownLicense, |
| 330 | 250 | K::MirrorWithFiles, |
| 331 | 251 | K::ContributionsTitle, |
| @@ -341,20 +261,15 @@ const ALL: &[K] = &[ | ||
| 341 | 261 | K::NoContributionsDay, |
| 342 | 262 | K::ViewAllNotifications, |
| 343 | 263 | K::BreadcrumbNav, |
| 344 | - K::ApplyTheme, | |
| 345 | 264 | K::RefLabel, |
| 346 | 265 | K::YourProfile, |
| 347 | 266 | K::EditProfile, |
| 348 | 267 | K::EditOrganization, |
| 349 | - K::AllNotifications, | |
| 350 | 268 | K::Passed, |
| 351 | 269 | K::Failed, |
| 352 | 270 | K::Cancelled, |
| 353 | 271 | K::YourCiRuns, |
| 354 | 272 | K::SearchPublicReposFor, |
| 355 | - K::OpenNotifications, | |
| 356 | - K::PeekLoading, | |
| 357 | - K::PeekError, | |
| 358 | 273 | K::AllCaughtUp, |
| 359 | 274 | ]; |
| 360 | 275 | |
| @@ -368,12 +283,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 368 | 283 | (ThemeLabel, Tr) => "Tema", |
| 369 | 284 | (LanguageLabel, En) => "Language", |
| 370 | 285 | (LanguageLabel, Tr) => "Dil", |
| 371 | - (MatchSystemHelp, En) => { | |
| 372 | - "Match the system follows your operating system's light or dark setting." | |
| 373 | - } | |
| 374 | - (MatchSystemHelp, Tr) => { | |
| 375 | - "Sistem ile eşleştir, işletim sisteminizin açık veya koyu ayarını izler." | |
| 376 | - } | |
| 377 | 286 | (MatchSystem, En) => "Match the system", |
| 378 | 287 | (MatchSystem, Tr) => "Sistem ile eşleştir", |
| 379 | 288 | (Light, En) => "Light", |
| @@ -406,38 +315,18 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 406 | 315 | (VividnessLabel, Tr) => "Canlılık", |
| 407 | 316 | (HexLabel, En) => "Hex", |
| 408 | 317 | (HexLabel, Tr) => "Hex", |
| 409 | - (LightnessNote, En) => "Lightness is adjusted to keep text readable.", | |
| 410 | - (LightnessNote, Tr) => "Metnin okunur kalması için açıklık ayarlandı.", | |
| 411 | 318 | (BackgroundLabel, En) => "Background", |
| 412 | 319 | (BackgroundLabel, Tr) => "Arka plan", |
| 413 | 320 | (ChooseBase, En) => "Choose a background from the list.", |
| 414 | 321 | (ChooseBase, Tr) => "Listeden bir arka plan seçin.", |
| 415 | - (SidebarLabel, En) => "Settings menu side", | |
| 416 | - (SidebarLabel, Tr) => "Ayarlar menüsünün yanı", | |
| 417 | - (SidebarLeft, En) => "Left", | |
| 418 | - (SidebarLeft, Tr) => "Sol", | |
| 419 | - (SidebarRight, En) => "Right", | |
| 420 | - (SidebarRight, Tr) => "Sağ", | |
| 421 | 322 | (ChooseSidebar, En) => "Choose a sidebar position from the list.", |
| 422 | 323 | (ChooseSidebar, Tr) => "Listeden bir kenar çubuğu konumu seçin.", |
| 423 | 324 | (SoundLabel, En) => "Sound", |
| 424 | 325 | (SoundLabel, Tr) => "Ses", |
| 425 | - (SoundSwitch, En) => "Play a tone when my run finishes", | |
| 426 | - (SoundSwitch, Tr) => "Çalıştırmam bitince bir ses çal", | |
| 427 | - (SoundOwnRuns, En) => "Only your own runs", | |
| 428 | - (SoundOwnRuns, Tr) => "Yalnızca kendi çalıştırmalarınız", | |
| 429 | 326 | (SoundPassed, En) => "Run passed", |
| 430 | 327 | (SoundPassed, Tr) => "Çalıştırma başarılı", |
| 431 | - (SoundPassedNote, En) => "a bright rising chime", | |
| 432 | - (SoundPassedNote, Tr) => "parlak, yükselen bir çan", | |
| 433 | 328 | (SoundFailed, En) => "Run failed", |
| 434 | 329 | (SoundFailed, Tr) => "Çalıştırma başarısız", |
| 435 | - (SoundFailedNote, En) => "a low, rough double buzz", | |
| 436 | - (SoundFailedNote, Tr) => "pes ve sert, çift vızıltı", | |
| 437 | - (SoundPlay, En) => "Play", | |
| 438 | - (SoundPlay, Tr) => "Çal", | |
| 439 | - (SoundFootOwn, En) => "Never for a page you are looking at.", | |
| 440 | - (SoundFootOwn, Tr) => "Baktığınız sayfa için asla çalmaz.", | |
| 441 | 330 | (ChooseSound, En) => "Choose on or off.", |
| 442 | 331 | (ChooseSound, Tr) => "Açık ya da kapalı seçin.", |
| 443 | 332 | (KindOpenIssue, En) => "Open issue", |
| @@ -500,39 +389,15 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 500 | 389 | (VerbUpdated, Tr) => "güncellendi", |
| 501 | 390 | (VerbDiscussionReply, En) => "commented on your discussion", |
| 502 | 391 | (VerbDiscussionReply, Tr) => "tartışmanıza yorum yapıldı", |
| 503 | - (WhyMentioned, En) => "you were mentioned", | |
| 504 | - (WhyMentioned, Tr) => "sizden bahsedildiği için", | |
| 505 | - (WhyAssigned, En) => "you were assigned", | |
| 506 | - (WhyAssigned, Tr) => "size atandığınız için", | |
| 507 | - (WhyReviewRequested, En) => "you were asked to review", | |
| 508 | - (WhyReviewRequested, Tr) => "incelemeniz istendiği için", | |
| 509 | - (WhyAuthor, En) => "you authored this", | |
| 510 | - (WhyAuthor, Tr) => "bunu siz yazdığınız için", | |
| 511 | - (WhyCommented, En) => "you commented on this", | |
| 512 | - (WhyCommented, Tr) => "buna yorum yaptığınız için", | |
| 513 | - (WhySubscribed, En) => "you subscribed to this", | |
| 514 | - (WhySubscribed, Tr) => "buna abone olduğunuz için", | |
| 515 | - (WhyWatching, En) => "you are watching this repository", | |
| 516 | - (WhyWatching, Tr) => "bu depoyu izlediğiniz için", | |
| 517 | - (NotReceivingRepo, En) => { | |
| 518 | - "You're not receiving notifications from this repository. Mentions still notify you." | |
| 519 | - } | |
| 520 | - (NotReceivingRepo, Tr) => { | |
| 521 | - "Bu depodan bildirim almıyorsunuz. Yine de bahsedildiğinizde bildirim alırsınız." | |
| 522 | - } | |
| 523 | - (NotReceivingThread, En) => "You're not receiving notifications from this thread.", | |
| 524 | - (NotReceivingThread, Tr) => "Bu konudan bildirim almıyorsunuz.", | |
| 525 | 392 | (MarkAllAsRead, En) => "Mark all as read", |
| 526 | 393 | (MarkAllAsRead, Tr) => "Tümünü okundu olarak işaretle", |
| 527 | 394 | (MarkAllRead, En) => "Mark all read", |
| 528 | 395 | (MarkAllRead, Tr) => "Tümünü okundu işaretle", |
| 529 | - (ClearNotifications, En) => "Mark as read", | |
| 530 | - (ClearNotifications, Tr) => "Okundu işaretle", | |
| 531 | 396 | (MarkRead, En) => "Mark read", |
| 532 | 397 | (MarkRead, Tr) => "Okundu işaretle", |
| 533 | 398 | (NoNotificationsYet, En) => "No notifications yet.", |
| 534 | 399 | (NoNotificationsYet, Tr) => "Henüz bildirim yok.", |
| 535 | - (NoUnreadNotifications, En) => "You have no unread notifications.", | |
| 400 | + (NoUnreadNotifications, En) => "No unread notifications.", | |
| 536 | 401 | (NoUnreadNotifications, Tr) => "Okunmamış bildiriminiz yok.", |
| 537 | 402 | (NotificationFilter, En) => "Notification filter", |
| 538 | 403 | (NotificationFilter, Tr) => "Bildirim filtresi", |
| @@ -552,42 +417,14 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 552 | 417 | (OptWatching, Tr) => "İzleniyor", |
| 553 | 418 | (OptIgnoring, En) => "Ignoring", |
| 554 | 419 | (OptIgnoring, Tr) => "Yok sayılıyor", |
| 555 | - (WatchDescParticipating, En) => "Only threads you start, join or are mentioned in.", | |
| 556 | - (WatchDescParticipating, Tr) => { | |
| 557 | - "Yalnızca başlattığın, katıldığın veya adının geçtiği konular." | |
| 558 | - } | |
| 559 | - (WatchDescWatching, En) => "All activity in this repository.", | |
| 560 | - (WatchDescWatching, Tr) => "Bu depodaki tüm etkinlik.", | |
| 561 | - (WatchDescIgnoring, En) => "Nothing from this repository, except mentions.", | |
| 562 | - (WatchDescIgnoring, Tr) => "Bu depodan hiçbir şey, yalnızca adınızın geçtikleri hariç.", | |
| 563 | 420 | (SecurityOff, En) => { |
| 564 | 421 | "Security advisories are off on this instance, so no lockfile is scanned. An administrator can turn them on with the [advisories] section of the config." |
| 565 | 422 | } |
| 566 | 423 | (SecurityOff, Tr) => { |
| 567 | 424 | "Bu sunucuda güvenlik tavsiyeleri kapalı, bu yüzden hiçbir kilit dosyası taranmıyor. Bir yönetici bunları yapılandırma dosyasındaki [advisories] bölümünden açabilir." |
| 568 | 425 | } |
| 569 | - (LockfilesRead, En) => { | |
| 570 | - "Lockfiles read: Cargo.lock, package-lock.json (v2 and v3) and go.sum, up to three directories deep. Alerts open after a push to the default branch, and close when the dependency moves past the fix." | |
| 571 | - } | |
| 572 | - (LockfilesRead, Tr) => { | |
| 573 | - "Okunan kilit dosyaları: Cargo.lock, package-lock.json (v2 ve v3) ve go.sum; en fazla üç dizin derinliğine kadar. Uyarılar varsayılan dala gönderim yapıldıktan sonra açılır ve bağımlılık düzeltme sürümünü geçtiğinde kapanır." | |
| 574 | - } | |
| 575 | 426 | (NoAlerts, En) => "No alerts.", |
| 576 | 427 | (NoAlerts, Tr) => "Uyarı yok.", |
| 577 | - (ColAdvisory, En) => "Advisory", | |
| 578 | - (ColAdvisory, Tr) => "Güvenlik tavsiyesi", | |
| 579 | - (ColPackage, En) => "Package", | |
| 580 | - (ColPackage, Tr) => "Paket", | |
| 581 | - (ColVersion, En) => "Version", | |
| 582 | - (ColVersion, Tr) => "Sürüm", | |
| 583 | - (ColSeverity, En) => "Severity", | |
| 584 | - (ColSeverity, Tr) => "Önem", | |
| 585 | - (ColSummary, En) => "Summary", | |
| 586 | - (ColSummary, Tr) => "Özet", | |
| 587 | - (ColState, En) => "State", | |
| 588 | - (ColState, Tr) => "Durum", | |
| 589 | - (ColOpened, En) => "Opened", | |
| 590 | - (ColOpened, Tr) => "Açılış", | |
| 591 | 428 | (StateOpen, En) => "Open", |
| 592 | 429 | (StateOpen, Tr) => "Açık", |
| 593 | 430 | (StateDismissed, En) => "Dismissed", |
| @@ -606,10 +443,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 606 | 443 | (DescriptionOptional, Tr) => "Açıklama (isteğe bağlı)", |
| 607 | 444 | (VisibilityLegend, En) => "Visibility", |
| 608 | 445 | (VisibilityLegend, Tr) => "Görünürlük", |
| 609 | - (PrivateHelp, En) => "Private: only you and collaborators can see it", | |
| 610 | - (PrivateHelp, Tr) => "Özel: yalnızca siz ve ortak çalışanlar görebilir", | |
| 611 | - (PublicHelp, En) => "Public: anyone can read it", | |
| 612 | - (PublicHelp, Tr) => "Herkese açık: herkes okuyabilir", | |
| 613 | 446 | (DefaultBranch, En) => "Default branch", |
| 614 | 447 | (DefaultBranch, Tr) => "Varsayılan dal", |
| 615 | 448 | (AddDefaultLabels, En) => { |
| @@ -620,12 +453,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 620 | 453 | } |
| 621 | 454 | (MirrorLegend, En) => "Mirror an existing repository (optional)", |
| 622 | 455 | (MirrorLegend, Tr) => "Mevcut bir depoyu yansıt (isteğe bağlı)", |
| 623 | - (MirrorIntro, En) => { | |
| 624 | - "The new repository starts empty and is filled from this URL: branches and tags are fetched now and on the interval. Pushes to it are refused." | |
| 625 | - } | |
| 626 | - (MirrorIntro, Tr) => { | |
| 627 | - "Yeni depo boş başlar ve bu URL'den doldurulur: dallar ve etiketler şimdi ve belirli aralıklarla çekilir. Bu depoya yapılan gönderimler reddedilir." | |
| 628 | - } | |
| 629 | 456 | (SourceUrl, En) => "Source URL", |
| 630 | 457 | (SourceUrl, Tr) => "Kaynak URL", |
| 631 | 458 | (UsernameOptional, En) => "Username (optional)", |
| @@ -642,16 +469,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 642 | 469 | (InvalidRepoName, Tr) => "geçersiz depo adı", |
| 643 | 470 | (ReadmeLabel, En) => "Add a README", |
| 644 | 471 | (ReadmeLabel, Tr) => "README ekle", |
| 645 | - (ReadmeHelp, En) => { | |
| 646 | - "A README.md with the name and description, so the repository is not empty." | |
| 647 | - } | |
| 648 | - (ReadmeHelp, Tr) => "Adı ve açıklamasıyla bir README.md; depo boş başlamaz.", | |
| 649 | 472 | (LicenseLabel, En) => "License", |
| 650 | 473 | (LicenseLabel, Tr) => "Lisans", |
| 651 | 474 | (LicenseNone, En) => "None", |
| 652 | 475 | (LicenseNone, Tr) => "Yok", |
| 653 | - (LicenseHelp, En) => "Adds a LICENSE file with the full text.", | |
| 654 | - (LicenseHelp, Tr) => "Tam metniyle bir LICENSE dosyası ekler.", | |
| 655 | 476 | (UnknownLicense, En) => "unknown license", |
| 656 | 477 | (UnknownLicense, Tr) => "Bilinmeyen lisans.", |
| 657 | 478 | (MirrorWithFiles, En) => { |
| @@ -686,8 +507,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 686 | 507 | (ViewAllNotifications, Tr) => "Tüm bildirimleri gör", |
| 687 | 508 | (BreadcrumbNav, En) => "Path", |
| 688 | 509 | (BreadcrumbNav, Tr) => "Yol", |
| 689 | - (ApplyTheme, En) => "Apply", | |
| 690 | - (ApplyTheme, Tr) => "Uygula", | |
| 691 | 510 | (RefLabel, En) => "Ref", |
| 692 | 511 | (RefLabel, Tr) => "Referans", |
| 693 | 512 | (YourProfile, En) => "Your profile", |
| @@ -696,8 +515,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 696 | 515 | (EditProfile, Tr) => "Profili düzenle", |
| 697 | 516 | (EditOrganization, En) => "Edit organization", |
| 698 | 517 | (EditOrganization, Tr) => "Kuruluşu düzenle", |
| 699 | - (AllNotifications, En) => "All notifications", | |
| 700 | - (AllNotifications, Tr) => "Tüm bildirimler", | |
| 701 | 518 | (Passed, En) => "passed", |
| 702 | 519 | (Passed, Tr) => "geçti", |
| 703 | 520 | (Failed, En) => "failed", |
| @@ -706,12 +523,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 706 | 523 | (Cancelled, Tr) => "iptal edildi", |
| 707 | 524 | (YourCiRuns, En) => "Your CI runs", |
| 708 | 525 | (YourCiRuns, Tr) => "CI çalıştırmaların", |
| 709 | - (OpenNotifications, En) => "Open notifications", | |
| 710 | - (OpenNotifications, Tr) => "Bildirimleri aç", | |
| 711 | - (PeekLoading, En) => "Loading…", | |
| 712 | - (PeekLoading, Tr) => "Yükleniyor…", | |
| 713 | - (PeekError, En) => "Notifications could not be loaded.", | |
| 714 | - (PeekError, Tr) => "Bildirimler yüklenemedi.", | |
| 715 | 526 | (AllCaughtUp, En) => "You're all caught up", |
| 716 | 527 | (AllCaughtUp, Tr) => "Hepsini gördünüz", |
| 717 | 528 | (SearchPublicReposFor, En) => "Search public repositories for", |
| @@ -744,30 +555,6 @@ pub fn streak_days(lang: Lang, n: u64) -> String { | ||
| 744 | 555 | } |
| 745 | 556 | } |
| 746 | 557 | |
| 747 | -/// `2 review requests` / `1 review request`, and `2 inceleme isteği` in Turkish. | |
| 748 | -pub fn review_requests_count(lang: Lang, n: u64) -> String { | |
| 749 | - match lang { | |
| 750 | - Lang::En => format!("{n} review request{}", if n == 1 { "" } else { "s" }), | |
| 751 | - Lang::Tr => format!("{n} inceleme isteği"), | |
| 752 | - } | |
| 753 | -} | |
| 754 | - | |
| 755 | -/// `2 mentions` / `1 mention`, and `2 anılma` in Turkish. | |
| 756 | -pub fn mentions_count(lang: Lang, n: u64) -> String { | |
| 757 | - match lang { | |
| 758 | - Lang::En => format!("{n} mention{}", if n == 1 { "" } else { "s" }), | |
| 759 | - Lang::Tr => format!("{n} anılma"), | |
| 760 | - } | |
| 761 | -} | |
| 762 | - | |
| 763 | -/// `2 failing runs` / `1 failing run`, and `2 başarısız çalıştırma` in Turkish. | |
| 764 | -pub fn failing_runs_count(lang: Lang, n: u64) -> String { | |
| 765 | - match lang { | |
| 766 | - Lang::En => format!("{n} failing run{}", if n == 1 { "" } else { "s" }), | |
| 767 | - Lang::Tr => format!("{n} başarısız çalıştırma"), | |
| 768 | - } | |
| 769 | -} | |
| 770 | - | |
| 771 | 558 | /// `28 running` / `3 çalışıyor`: the live strip's counts. Each takes its number as `{n}` in the |
| 772 | 559 | /// strip's templates, so these phrases have no plural. |
| 773 | 560 | pub fn running_count(lang: Lang, n: u64) -> String { |
| @@ -837,25 +624,6 @@ pub fn date_range(lang: Lang, from: &str, to: &str) -> String { | ||
| 837 | 624 | } |
| 838 | 625 | } |
| 839 | 626 | |
| 840 | -/// The contribution calendar's motivating line. `today` is today's count, `streak` the current | |
| 841 | -/// streak (which counts today when `today > 0`). | |
| 842 | -pub fn heatmap_motivation(lang: Lang, today: u64, streak: u64) -> String { | |
| 843 | - match (lang, today > 0, streak > 0) { | |
| 844 | - (Lang::En, true, _) => format!("Nice, that's a {streak}-day streak!"), | |
| 845 | - (Lang::En, false, true) => format!( | |
| 846 | - "Keep it going: one commit today makes it a {}-day streak.", | |
| 847 | - streak + 1 | |
| 848 | - ), | |
| 849 | - (Lang::En, false, false) => "Start a new streak today.".to_owned(), | |
| 850 | - (Lang::Tr, true, _) => format!("Harika, {streak} günlük seri!"), | |
| 851 | - (Lang::Tr, false, true) => format!( | |
| 852 | - "Devam edin: bugün bir katkı, seriyi {} güne çıkarır.", | |
| 853 | - streak + 1 | |
| 854 | - ), | |
| 855 | - (Lang::Tr, false, false) => "Bugün yeni bir seri başlatın.".to_owned(), | |
| 856 | - } | |
| 857 | -} | |
| 858 | - | |
| 859 | 627 | /// The calendar's accessible summary, for the grid's `aria-label`. |
| 860 | 628 | pub fn heatmap_summary(lang: Lang, total: u64, current: u64, longest: u64) -> String { |
| 861 | 629 | let total = thousands(lang, total); |
| @@ -968,15 +736,6 @@ pub fn activity_line(lang: Lang, verb: K, actor: Option<&str>) -> String { | ||
| 968 | 736 | } |
| 969 | 737 | } |
| 970 | 738 | |
| 971 | -/// "You're receiving notifications because ..." for a reason fragment such as `WhyMentioned`. | |
| 972 | -pub fn receiving_because(lang: Lang, why: K) -> String { | |
| 973 | - let why = t(lang, why); | |
| 974 | - match lang { | |
| 975 | - Lang::En => format!("You're receiving notifications because {why}."), | |
| 976 | - Lang::Tr => format!("{} bildirim alıyorsunuz.", capitalize(why)), | |
| 977 | - } | |
| 978 | -} | |
| 979 | - | |
| 980 | 739 | /// "3 watching" / "3 izleyici", the watch control's count. |
| 981 | 740 | pub fn watchers_count(lang: Lang, watchers: u64) -> String { |
| 982 | 741 | match lang { |
| @@ -1081,9 +840,5 @@ mod tests { | ||
| 1081 | 840 | assert_eq!(new_alerts(Lang::En, 1), "1 new alert"); |
| 1082 | 841 | assert_eq!(new_alerts(Lang::En, 2), "2 new alerts"); |
| 1083 | 842 | assert_eq!(new_alerts(Lang::Tr, 3), "3 yeni uyarı"); |
| 1084 | - assert_eq!( | |
| 1085 | - receiving_because(Lang::En, K::WhySubscribed), | |
| 1086 | - "You're receiving notifications because you subscribed to this." | |
| 1087 | - ); | |
| 1088 | 843 | } |
| 1089 | 844 | } |
crates/forge-web-base/src/i18n/mod.rsmodified+4 -242
| @@ -137,10 +137,8 @@ pub enum Key { | ||
| 137 | 137 | AccessTokens, |
| 138 | 138 | Sessions, |
| 139 | 139 | Security, |
| 140 | - BackToSite, | |
| 141 | 140 | LogOut, |
| 142 | 141 | LogIn, |
| 143 | - SiteMenu, | |
| 144 | 142 | |
| 145 | 143 | // Shared form words. |
| 146 | 144 | Username, |
| @@ -161,7 +159,6 @@ pub enum Key { | ||
| 161 | 159 | |
| 162 | 160 | // Log in and two-factor. |
| 163 | 161 | TwoFactorCheck, |
| 164 | - TwoFactorCheckSub, | |
| 165 | 162 | ErrInvalidLogin, |
| 166 | 163 | ErrThrottled, |
| 167 | 164 | ErrInvalidCode, |
| @@ -169,7 +166,6 @@ pub enum Key { | ||
| 169 | 166 | // First-run setup. |
| 170 | 167 | Setup, |
| 171 | 168 | WelcomeToForge, |
| 172 | - SetupSub, | |
| 173 | 169 | AtLeast12Chars, |
| 174 | 170 | ConfirmPassword, |
| 175 | 171 | CreateAdmin, |
| @@ -184,20 +180,16 @@ pub enum Key { | ||
| 184 | 180 | OkAvatarUpdated, |
| 185 | 181 | OkAvatarRemoved, |
| 186 | 182 | OkProfileSaved, |
| 187 | - UsernameHint, | |
| 188 | 183 | Avatar, |
| 189 | 184 | AvatarAlt, |
| 190 | 185 | Image, |
| 191 | - AvatarHint, | |
| 192 | 186 | Edit, |
| 193 | 187 | UploadPhoto, |
| 194 | 188 | RemovePhoto, |
| 195 | 189 | About, |
| 196 | - AboutHint, | |
| 197 | 190 | Timezone, |
| 198 | 191 | ErrChooseImage, |
| 199 | 192 | DisplayName, |
| 200 | - DisplayNameHint, | |
| 201 | 193 | ErrDisplayNameControl, |
| 202 | 194 | |
| 203 | 195 | // Account security. |
| @@ -207,29 +199,21 @@ pub enum Key { | ||
| 207 | 199 | OkTwoFactorOff, |
| 208 | 200 | OkRecoveryCodesNew, |
| 209 | 201 | SecurityLog, |
| 210 | - SecurityLogRest, | |
| 211 | 202 | RecoveryCodes, |
| 212 | 203 | RecoveryCodesSave, |
| 213 | 204 | CurrentPassword, |
| 214 | 205 | NewPassword, |
| 215 | - NewPasswordHint, | |
| 216 | 206 | ConfirmNewPassword, |
| 217 | 207 | ChangePassword, |
| 218 | 208 | SaveEmail, |
| 219 | 209 | TwoFactorAuth, |
| 220 | 210 | RegenerateCodes, |
| 221 | - RegenerateCodesHint, | |
| 222 | - TurnOffTwoFactor, | |
| 223 | 211 | TurnOffTwoFactorButton, |
| 224 | - TwoFactorPendingIntro, | |
| 225 | 212 | SecretPrefix, |
| 226 | 213 | LinkPrefix, |
| 227 | 214 | CodeFromApp, |
| 228 | 215 | ConfirmAndTurnOn, |
| 229 | - TwoFactorOffIntro, | |
| 230 | - Enable2fa, | |
| 231 | 216 | DeleteAccount, |
| 232 | - DeleteAccountIntro, | |
| 233 | 217 | TypeUsernameToConfirm, |
| 234 | 218 | TransferOrDeleteRepos, |
| 235 | 219 | ErrConfirmUsername, |
| @@ -237,40 +221,27 @@ pub enum Key { | ||
| 237 | 221 | // SSH and GPG keys. |
| 238 | 222 | NoSshKeys, |
| 239 | 223 | NoGpgKeys, |
| 240 | - AddSshKeyTitle, | |
| 241 | - AddGpgKeyTitle, | |
| 242 | 224 | TitleOptional, |
| 243 | 225 | PublicKeyLabel, |
| 244 | - PublicKeyHint, | |
| 245 | 226 | AddKeyButton, |
| 246 | 227 | ArmoredPublicKeyLabel, |
| 247 | - ArmoredHint, | |
| 248 | 228 | GpgUnavailable, |
| 249 | 229 | |
| 250 | 230 | // Access tokens. |
| 251 | 231 | YourNewToken, |
| 252 | 232 | CopyNow, |
| 253 | - UseAsPassword, | |
| 254 | 233 | NoAccessTokens, |
| 255 | 234 | NewToken, |
| 256 | 235 | ExpiresIn30, |
| 257 | 236 | ExpiresIn90, |
| 258 | 237 | ExpiresIn365, |
| 259 | 238 | ExpiresNever, |
| 260 | - ScopeNote, | |
| 261 | 239 | CreateToken, |
| 262 | 240 | |
| 263 | 241 | // Web sessions. |
| 264 | 242 | UnknownBrowser, |
| 265 | 243 | ThisSession, |
| 266 | 244 | RevokeAllOthers, |
| 267 | - UserAgent, | |
| 268 | - SignInIp, | |
| 269 | - LastIp, | |
| 270 | - LastSeenAt, | |
| 271 | - ExpiresAt, | |
| 272 | - BackToSessions, | |
| 273 | - NotRecorded, | |
| 274 | 245 | Close, |
| 275 | 246 | |
| 276 | 247 | // Metadata lines (see the helpers below for the words in between). |
| @@ -292,31 +263,23 @@ pub enum Key { | ||
| 292 | 263 | ErrKeyMismatch, |
| 293 | 264 | // Account mail pages: reset, register, verify, invites. |
| 294 | 265 | ForgotTitle, |
| 295 | - ForgotSub, | |
| 296 | 266 | ForgotSubmit, |
| 297 | 267 | ForgotSent, |
| 298 | 268 | ResetTitle, |
| 299 | - ResetSub, | |
| 300 | 269 | ResetSubmit, |
| 301 | 270 | ResetInvalid, |
| 302 | 271 | ResetDone, |
| 303 | 272 | RegisterTitle, |
| 304 | - RegisterSub, | |
| 305 | - RegisterInviteSub, | |
| 306 | 273 | RegisterNeedsInvite, |
| 307 | 274 | RegisterInvalidInvite, |
| 308 | 275 | RegisterSubmit, |
| 309 | 276 | VerifyTitle, |
| 310 | - VerifyConfirmSub, | |
| 311 | 277 | VerifyConfirm, |
| 312 | 278 | VerifyDone, |
| 313 | 279 | VerifyInvalid, |
| 314 | - VerifyVerified, | |
| 315 | - VerifyUnverified, | |
| 316 | 280 | VerifyResend, |
| 317 | 281 | OkVerifySent, |
| 318 | 282 | InvitesTitle, |
| 319 | - InvitesSub, | |
| 320 | 283 | InvitesSubmit, |
| 321 | 284 | InvitesSent, |
| 322 | 285 | InvitesOff, |
| @@ -338,9 +301,7 @@ pub enum Key { | ||
| 338 | 301 | MailReasonComment, |
| 339 | 302 | MailReasonSubscribed, |
| 340 | 303 | MailReasonWatching, |
| 341 | - MenuNotificationEmails, | |
| 342 | 304 | EmailNotifyLabel, |
| 343 | - EmailNotifyHelp, | |
| 344 | 305 | EmailNotifyUnverified, |
| 345 | 306 | EmailNotifyServerOff, |
| 346 | 307 | EmailNotifySaved, |
| @@ -348,16 +309,13 @@ pub enum Key { | ||
| 348 | 309 | PillOn, |
| 349 | 310 | PillOff, |
| 350 | 311 | PillVerified, |
| 351 | - PillUnverified, | |
| 352 | 312 | EmailNotVerified, |
| 353 | 313 | EmailNoAddress, |
| 354 | 314 | EmailMailQueued, |
| 355 | 315 | EmailMailFailed, |
| 356 | - ChangeAction, | |
| 357 | 316 | SetUpAction, |
| 358 | 317 | SetupInProgress, |
| 359 | 318 | DeviceName, |
| 360 | - DeviceNameHint, | |
| 361 | 319 | ErrDeviceName, |
| 362 | 320 | CodesRunningLow, |
| 363 | 321 | DangerZone, |
| @@ -375,10 +333,8 @@ pub const ALL: &[Key] = &[ | ||
| 375 | 333 | Key::AccessTokens, |
| 376 | 334 | Key::Sessions, |
| 377 | 335 | Key::Security, |
| 378 | - Key::BackToSite, | |
| 379 | 336 | Key::LogOut, |
| 380 | 337 | Key::LogIn, |
| 381 | - Key::SiteMenu, | |
| 382 | 338 | Key::Username, |
| 383 | 339 | Key::Password, |
| 384 | 340 | Key::Email, |
| @@ -395,13 +351,11 @@ pub const ALL: &[Key] = &[ | ||
| 395 | 351 | Key::Remove, |
| 396 | 352 | Key::Create, |
| 397 | 353 | Key::TwoFactorCheck, |
| 398 | - Key::TwoFactorCheckSub, | |
| 399 | 354 | Key::ErrInvalidLogin, |
| 400 | 355 | Key::ErrThrottled, |
| 401 | 356 | Key::ErrInvalidCode, |
| 402 | 357 | Key::Setup, |
| 403 | 358 | Key::WelcomeToForge, |
| 404 | - Key::SetupSub, | |
| 405 | 359 | Key::AtLeast12Chars, |
| 406 | 360 | Key::ConfirmPassword, |
| 407 | 361 | Key::CreateAdmin, |
| @@ -412,20 +366,16 @@ pub const ALL: &[Key] = &[ | ||
| 412 | 366 | Key::OkAvatarUpdated, |
| 413 | 367 | Key::OkAvatarRemoved, |
| 414 | 368 | Key::OkProfileSaved, |
| 415 | - Key::UsernameHint, | |
| 416 | 369 | Key::Avatar, |
| 417 | 370 | Key::AvatarAlt, |
| 418 | 371 | Key::Image, |
| 419 | - Key::AvatarHint, | |
| 420 | 372 | Key::Edit, |
| 421 | 373 | Key::UploadPhoto, |
| 422 | 374 | Key::RemovePhoto, |
| 423 | 375 | Key::About, |
| 424 | - Key::AboutHint, | |
| 425 | 376 | Key::Timezone, |
| 426 | 377 | Key::ErrChooseImage, |
| 427 | 378 | Key::DisplayName, |
| 428 | - Key::DisplayNameHint, | |
| 429 | 379 | Key::ErrDisplayNameControl, |
| 430 | 380 | Key::OkPasswordChanged, |
| 431 | 381 | Key::OkEmailSaved, |
| @@ -433,64 +383,43 @@ pub const ALL: &[Key] = &[ | ||
| 433 | 383 | Key::OkTwoFactorOff, |
| 434 | 384 | Key::OkRecoveryCodesNew, |
| 435 | 385 | Key::SecurityLog, |
| 436 | - Key::SecurityLogRest, | |
| 437 | 386 | Key::RecoveryCodes, |
| 438 | 387 | Key::RecoveryCodesSave, |
| 439 | 388 | Key::CurrentPassword, |
| 440 | 389 | Key::NewPassword, |
| 441 | - Key::NewPasswordHint, | |
| 442 | 390 | Key::ConfirmNewPassword, |
| 443 | 391 | Key::ChangePassword, |
| 444 | 392 | Key::SaveEmail, |
| 445 | 393 | Key::TwoFactorAuth, |
| 446 | 394 | Key::RegenerateCodes, |
| 447 | - Key::RegenerateCodesHint, | |
| 448 | - Key::TurnOffTwoFactor, | |
| 449 | 395 | Key::TurnOffTwoFactorButton, |
| 450 | - Key::TwoFactorPendingIntro, | |
| 451 | 396 | Key::SecretPrefix, |
| 452 | 397 | Key::LinkPrefix, |
| 453 | 398 | Key::CodeFromApp, |
| 454 | 399 | Key::ConfirmAndTurnOn, |
| 455 | - Key::TwoFactorOffIntro, | |
| 456 | - Key::Enable2fa, | |
| 457 | 400 | Key::DeleteAccount, |
| 458 | - Key::DeleteAccountIntro, | |
| 459 | 401 | Key::TypeUsernameToConfirm, |
| 460 | 402 | Key::TransferOrDeleteRepos, |
| 461 | 403 | Key::ErrConfirmUsername, |
| 462 | 404 | Key::NoSshKeys, |
| 463 | 405 | Key::NoGpgKeys, |
| 464 | - Key::AddSshKeyTitle, | |
| 465 | - Key::AddGpgKeyTitle, | |
| 466 | 406 | Key::TitleOptional, |
| 467 | 407 | Key::PublicKeyLabel, |
| 468 | - Key::PublicKeyHint, | |
| 469 | 408 | Key::AddKeyButton, |
| 470 | 409 | Key::ArmoredPublicKeyLabel, |
| 471 | - Key::ArmoredHint, | |
| 472 | 410 | Key::GpgUnavailable, |
| 473 | 411 | Key::YourNewToken, |
| 474 | 412 | Key::CopyNow, |
| 475 | - Key::UseAsPassword, | |
| 476 | 413 | Key::NoAccessTokens, |
| 477 | 414 | Key::NewToken, |
| 478 | 415 | Key::ExpiresIn30, |
| 479 | 416 | Key::ExpiresIn90, |
| 480 | 417 | Key::ExpiresIn365, |
| 481 | 418 | Key::ExpiresNever, |
| 482 | - Key::ScopeNote, | |
| 483 | 419 | Key::CreateToken, |
| 484 | 420 | Key::UnknownBrowser, |
| 485 | 421 | Key::ThisSession, |
| 486 | 422 | Key::RevokeAllOthers, |
| 487 | - Key::UserAgent, | |
| 488 | - Key::SignInIp, | |
| 489 | - Key::LastIp, | |
| 490 | - Key::LastSeenAt, | |
| 491 | - Key::ExpiresAt, | |
| 492 | - Key::BackToSessions, | |
| 493 | - Key::NotRecorded, | |
| 494 | 423 | Key::Close, |
| 495 | 424 | Key::Added, |
| 496 | 425 | Key::LastUsed, |
| @@ -507,31 +436,23 @@ pub const ALL: &[Key] = &[ | ||
| 507 | 436 | Key::ErrKeyTruncated, |
| 508 | 437 | Key::ErrKeyMismatch, |
| 509 | 438 | Key::ForgotTitle, |
| 510 | - Key::ForgotSub, | |
| 511 | 439 | Key::ForgotSubmit, |
| 512 | 440 | Key::ForgotSent, |
| 513 | 441 | Key::ResetTitle, |
| 514 | - Key::ResetSub, | |
| 515 | 442 | Key::ResetSubmit, |
| 516 | 443 | Key::ResetInvalid, |
| 517 | 444 | Key::ResetDone, |
| 518 | 445 | Key::RegisterTitle, |
| 519 | - Key::RegisterSub, | |
| 520 | - Key::RegisterInviteSub, | |
| 521 | 446 | Key::RegisterNeedsInvite, |
| 522 | 447 | Key::RegisterInvalidInvite, |
| 523 | 448 | Key::RegisterSubmit, |
| 524 | 449 | Key::VerifyTitle, |
| 525 | - Key::VerifyConfirmSub, | |
| 526 | 450 | Key::VerifyConfirm, |
| 527 | 451 | Key::VerifyDone, |
| 528 | 452 | Key::VerifyInvalid, |
| 529 | - Key::VerifyVerified, | |
| 530 | - Key::VerifyUnverified, | |
| 531 | 453 | Key::VerifyResend, |
| 532 | 454 | Key::OkVerifySent, |
| 533 | 455 | Key::InvitesTitle, |
| 534 | - Key::InvitesSub, | |
| 535 | 456 | Key::InvitesSubmit, |
| 536 | 457 | Key::InvitesSent, |
| 537 | 458 | Key::InvitesOff, |
| @@ -553,9 +474,7 @@ pub const ALL: &[Key] = &[ | ||
| 553 | 474 | Key::MailReasonComment, |
| 554 | 475 | Key::MailReasonSubscribed, |
| 555 | 476 | Key::MailReasonWatching, |
| 556 | - Key::MenuNotificationEmails, | |
| 557 | 477 | Key::EmailNotifyLabel, |
| 558 | - Key::EmailNotifyHelp, | |
| 559 | 478 | Key::EmailNotifyUnverified, |
| 560 | 479 | Key::EmailNotifyServerOff, |
| 561 | 480 | Key::EmailNotifySaved, |
| @@ -563,16 +482,13 @@ pub const ALL: &[Key] = &[ | ||
| 563 | 482 | Key::PillOn, |
| 564 | 483 | Key::PillOff, |
| 565 | 484 | Key::PillVerified, |
| 566 | - Key::PillUnverified, | |
| 567 | 485 | Key::EmailNotVerified, |
| 568 | 486 | Key::EmailNoAddress, |
| 569 | 487 | Key::EmailMailQueued, |
| 570 | 488 | Key::EmailMailFailed, |
| 571 | - Key::ChangeAction, | |
| 572 | 489 | Key::SetUpAction, |
| 573 | 490 | Key::SetupInProgress, |
| 574 | 491 | Key::DeviceName, |
| 575 | - Key::DeviceNameHint, | |
| 576 | 492 | Key::ErrDeviceName, |
| 577 | 493 | Key::CodesRunningLow, |
| 578 | 494 | Key::DangerZone, |
| @@ -601,12 +517,8 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | ||
| 601 | 517 | (Sessions, Tr) => "Oturumlar", |
| 602 | 518 | (Security, En) => "Security", |
| 603 | 519 | (Security, Tr) => "Güvenlik", |
| 604 | - (BackToSite, En) => "Back to forge", | |
| 605 | - (BackToSite, Tr) => "Forge'a dön", | |
| 606 | 520 | (LogOut, En) => "Log out", |
| 607 | 521 | (LogOut, Tr) => "Çıkış yap", |
| 608 | - (SiteMenu, En) => "Menu", | |
| 609 | - (SiteMenu, Tr) => "Menü", | |
| 610 | 522 | (LogIn, En) => "Log in", |
| 611 | 523 | (LogIn, Tr) => "Giriş yap", |
| 612 | 524 | |
| @@ -643,12 +555,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | ||
| 643 | 555 | |
| 644 | 556 | (TwoFactorCheck, En) => "Two-factor check", |
| 645 | 557 | (TwoFactorCheck, Tr) => "İki faktörlü doğrulama", |
| 646 | - (TwoFactorCheckSub, En) => { | |
| 647 | - "Enter the 6-digit code from your authenticator app, or one of your recovery codes." | |
| 648 | - } | |
| 649 | - (TwoFactorCheckSub, Tr) => { | |
| 650 | - "Doğrulama uygulamanızdaki 6 haneli kodu ya da kurtarma kodlarından birini girin." | |
| 651 | - } | |
| 652 | 558 | (ErrInvalidLogin, En) => "invalid username or password", |
| 653 | 559 | (ErrInvalidLogin, Tr) => "Kullanıcı adı ya da parola yanlış.", |
| 654 | 560 | (ErrThrottled, En) => "Too many attempts. Try again later.", |
| @@ -664,10 +570,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | ||
| 664 | 570 | (Setup, Tr) => "Kurulum", |
| 665 | 571 | (WelcomeToForge, En) => "Welcome to forge", |
| 666 | 572 | (WelcomeToForge, Tr) => "forge'a hoş geldiniz", |
| 667 | - (SetupSub, En) => { | |
| 668 | - "Create the first administrator account. This page closes after it is created." | |
| 669 | - } | |
| 670 | - (SetupSub, Tr) => "İlk yönetici hesabını oluşturun. Hesap oluşturulunca bu sayfa kapanır.", | |
| 671 | 573 | (AtLeast12Chars, En) => "At least 12 characters.", |
| 672 | 574 | (AtLeast12Chars, Tr) => "En az 12 karakter.", |
| 673 | 575 | (ConfirmPassword, En) => "Confirm password", |
| @@ -698,24 +600,12 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | ||
| 698 | 600 | (OkAvatarRemoved, Tr) => "Avatar kaldırıldı.", |
| 699 | 601 | (OkProfileSaved, En) => "Profile saved.", |
| 700 | 602 | (OkProfileSaved, Tr) => "Profil kaydedildi.", |
| 701 | - (UsernameHint, En) => { | |
| 702 | - "Only the capitalization can be changed. Your lookup name stays the same." | |
| 703 | - } | |
| 704 | - (UsernameHint, Tr) => { | |
| 705 | - "Yalnızca büyük/küçük harf değiştirilebilir. Giriş adınız aynı kalır." | |
| 706 | - } | |
| 707 | 603 | (Avatar, En) => "Avatar", |
| 708 | 604 | (Avatar, Tr) => "Avatar", |
| 709 | 605 | (AvatarAlt, En) => "Your avatar", |
| 710 | 606 | (AvatarAlt, Tr) => "Avatarınız", |
| 711 | 607 | (Image, En) => "Image", |
| 712 | 608 | (Image, Tr) => "Görsel", |
| 713 | - (AvatarHint, En) => { | |
| 714 | - "PNG, JPEG, WebP or GIF, up to 5 MiB. Images are cropped to a square and resized to 256 by 256 pixels." | |
| 715 | - } | |
| 716 | - (AvatarHint, Tr) => { | |
| 717 | - "PNG, JPEG, WebP ya da GIF, en fazla 5 MiB. Görseller kareye kırpılır ve 256 x 256 piksele küçültülür." | |
| 718 | - } | |
| 719 | 609 | (Edit, En) => "Edit", |
| 720 | 610 | (Edit, Tr) => "Düzenle", |
| 721 | 611 | (UploadPhoto, En) => "Upload a photo…", |
| @@ -724,16 +614,12 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | ||
| 724 | 614 | (RemovePhoto, Tr) => "Fotoğrafı kaldır", |
| 725 | 615 | (About, En) => "About", |
| 726 | 616 | (About, Tr) => "Hakkında", |
| 727 | - (AboutHint, En) => "At most 2000 characters. Markdown is supported.", | |
| 728 | - (AboutHint, Tr) => "En fazla 2000 karakter. Markdown desteklenir.", | |
| 729 | 617 | (Timezone, En) => "Timezone", |
| 730 | 618 | (Timezone, Tr) => "Saat dilimi", |
| 731 | 619 | (ErrChooseImage, En) => "Choose an image to upload.", |
| 732 | 620 | (ErrChooseImage, Tr) => "Yüklemek için bir görsel seçin.", |
| 733 | 621 | (DisplayName, En) => "Name", |
| 734 | 622 | (DisplayName, Tr) => "Ad", |
| 735 | - (DisplayNameHint, En) => "Optional. Shown on your profile.", | |
| 736 | - (DisplayNameHint, Tr) => "İsteğe bağlı. Profilinizde gösterilir.", | |
| 737 | 623 | (ErrDisplayNameControl, En) => { |
| 738 | 624 | "The name must not contain line breaks or control characters." |
| 739 | 625 | } |
| @@ -751,22 +637,14 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | ||
| 751 | 637 | (OkRecoveryCodesNew, Tr) => "Yeni kurtarma kodları oluşturuldu. Eskileri artık çalışmaz.", |
| 752 | 638 | (SecurityLog, En) => "Security log", |
| 753 | 639 | (SecurityLog, Tr) => "Güvenlik günlüğü", |
| 754 | - (SecurityLogRest, En) => " lists your sign-ins and changes to your account.", | |
| 755 | - (SecurityLogRest, Tr) => " girişlerini ve hesabınızdaki değişiklikleri listeler.", | |
| 756 | 640 | (RecoveryCodes, En) => "Recovery codes", |
| 757 | 641 | (RecoveryCodes, Tr) => "Kurtarma kodları", |
| 758 | - (RecoveryCodesSave, En) => { | |
| 759 | - "Save these codes now. They are shown only once. Each code works one time, and a code can replace your authenticator app if you lose it." | |
| 760 | - } | |
| 761 | - (RecoveryCodesSave, Tr) => { | |
| 762 | - "Bu kodları şimdi kaydedin. Yalnızca bir kez gösterilir. Her kod bir kez çalışır; doğrulama uygulamanızı kaybederseniz kodlardan biri onun yerini tutabilir." | |
| 763 | - } | |
| 642 | + (RecoveryCodesSave, En) => "Shown once.", | |
| 643 | + (RecoveryCodesSave, Tr) => "Yalnızca bir kez gösterilir.", | |
| 764 | 644 | (CurrentPassword, En) => "Current password", |
| 765 | 645 | (CurrentPassword, Tr) => "Mevcut parola", |
| 766 | 646 | (NewPassword, En) => "New password", |
| 767 | 647 | (NewPassword, Tr) => "Yeni parola", |
| 768 | - (NewPasswordHint, En) => "At least 10 characters. Your other sessions will be signed out.", | |
| 769 | - (NewPasswordHint, Tr) => "En az 10 karakter. Diğer oturumlarınız kapatılır.", | |
| 770 | 648 | (ConfirmNewPassword, En) => "Confirm new password", |
| 771 | 649 | (ConfirmNewPassword, Tr) => "Yeni parolayı doğrula", |
| 772 | 650 | (ChangePassword, En) => "Change password", |
| @@ -777,22 +655,8 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | ||
| 777 | 655 | (TwoFactorAuth, Tr) => "İki faktörlü kimlik doğrulama", |
| 778 | 656 | (RegenerateCodes, En) => "Regenerate recovery codes", |
| 779 | 657 | (RegenerateCodes, Tr) => "Kurtarma kodlarını yenile", |
| 780 | - (RegenerateCodesHint, En) => { | |
| 781 | - "Creating new codes makes the old ones stop working. Enter a code from your authenticator app to continue." | |
| 782 | - } | |
| 783 | - (RegenerateCodesHint, Tr) => { | |
| 784 | - "Yeni kodlar oluşturmak eskilerini geçersiz kılar. Devam etmek için doğrulama uygulamanızdaki bir kodu girin." | |
| 785 | - } | |
| 786 | - (TurnOffTwoFactor, En) => "Turn off two-factor authentication", | |
| 787 | - (TurnOffTwoFactor, Tr) => "İki faktörlü kimlik doğrulamayı kapat", | |
| 788 | 658 | (TurnOffTwoFactorButton, En) => "Turn off two-factor", |
| 789 | 659 | (TurnOffTwoFactorButton, Tr) => "İki faktörlüyü kapat", |
| 790 | - (TwoFactorPendingIntro, En) => { | |
| 791 | - "Add this account to your authenticator app. Enter the secret, or open the link on a device that has the app." | |
| 792 | - } | |
| 793 | - (TwoFactorPendingIntro, Tr) => { | |
| 794 | - "Bu hesabı doğrulama uygulamanıza ekleyin. Anahtarı girin ya da uygulamanın yüklü olduğu bir cihazda bağlantıyı açın." | |
| 795 | - } | |
| 796 | 660 | (SecretPrefix, En) => "Secret: ", |
| 797 | 661 | (SecretPrefix, Tr) => "Anahtar: ", |
| 798 | 662 | (LinkPrefix, En) => "Link: ", |
| @@ -801,22 +665,8 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | ||
| 801 | 665 | (CodeFromApp, Tr) => "Uygulamadaki kod", |
| 802 | 666 | (ConfirmAndTurnOn, En) => "Confirm and turn on", |
| 803 | 667 | (ConfirmAndTurnOn, Tr) => "Doğrula ve aç", |
| 804 | - (TwoFactorOffIntro, En) => { | |
| 805 | - "Two-factor authentication is off. When it is on, signing in also asks for a code from an authenticator app. Git over HTTPS uses access tokens and is not affected." | |
| 806 | - } | |
| 807 | - (TwoFactorOffIntro, Tr) => { | |
| 808 | - "İki faktörlü kimlik doğrulama kapalı. Açıkken girişte doğrulama uygulamanızdan bir kod da istenir. HTTPS üzerinden Git erişim belirteçlerini kullanır; bu etkilenmez." | |
| 809 | - } | |
| 810 | - (Enable2fa, En) => "Enable 2FA", | |
| 811 | - (Enable2fa, Tr) => "2FA'yı aç", | |
| 812 | 668 | (DeleteAccount, En) => "Delete account", |
| 813 | 669 | (DeleteAccount, Tr) => "Hesabı sil", |
| 814 | - (DeleteAccountIntro, En) => { | |
| 815 | - "Deleting your account removes your sessions, SSH keys, access tokens and stars. Your issues, comments and reviews stay and are shown as written by a deleted user. This cannot be undone." | |
| 816 | - } | |
| 817 | - (DeleteAccountIntro, Tr) => { | |
| 818 | - "Hesabınızı silmek; oturumlarınızı, SSH anahtarlarınızı, erişim belirteçlerinizi ve yıldızlarınızı kaldırır. Sorunlarınız, yorumlarınız ve incelemeleriniz kalır; silinmiş bir kullanıcı tarafından yazılmış gibi gösterilir. Bu işlem geri alınamaz." | |
| 819 | - } | |
| 820 | 670 | (TypeUsernameToConfirm, En) => "Type your username to confirm", |
| 821 | 671 | (TypeUsernameToConfirm, Tr) => "Onaylamak için kullanıcı adınızı yazın", |
| 822 | 672 | (TransferOrDeleteRepos, En) => { |
| @@ -830,39 +680,21 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | ||
| 830 | 680 | (NoSshKeys, Tr) => "Henüz SSH anahtarı yok. SSH ile göndermek için bir tane ekleyin.", |
| 831 | 681 | (NoGpgKeys, En) => "No GPG keys yet.", |
| 832 | 682 | (NoGpgKeys, Tr) => "Henüz GPG anahtarı yok.", |
| 833 | - (AddSshKeyTitle, En) => "Add an SSH key", | |
| 834 | - (AddSshKeyTitle, Tr) => "SSH anahtarı ekle", | |
| 835 | - (AddGpgKeyTitle, En) => "Add a GPG key", | |
| 836 | - (AddGpgKeyTitle, Tr) => "GPG anahtarı ekle", | |
| 837 | 683 | (TitleOptional, En) => "Title (optional)", |
| 838 | 684 | (TitleOptional, Tr) => "Başlık (isteğe bağlı)", |
| 839 | 685 | (PublicKeyLabel, En) => "Public key", |
| 840 | 686 | (PublicKeyLabel, Tr) => "Ortak anahtar", |
| 841 | - (PublicKeyHint, En) => "Paste the contents of id_ed25519.pub. RSA keys are not accepted.", | |
| 842 | - (PublicKeyHint, Tr) => { | |
| 843 | - "id_ed25519.pub dosyasının içeriğini yapıştırın. RSA anahtarları kabul edilmez." | |
| 844 | - } | |
| 845 | 687 | (AddKeyButton, En) => "Add key", |
| 846 | 688 | (AddKeyButton, Tr) => "Anahtar ekle", |
| 847 | 689 | (ArmoredPublicKeyLabel, En) => "Public key (ASCII armored)", |
| 848 | 690 | (ArmoredPublicKeyLabel, Tr) => "Ortak anahtar (ASCII zırhlı)", |
| 849 | - (ArmoredHint, En) => "Paste the output of gpg --armor --export with your key ID.", | |
| 850 | - (ArmoredHint, Tr) => { | |
| 851 | - "Anahtar kimliğinizle birlikte gpg --armor --export çıktısını yapıştırın." | |
| 852 | - } | |
| 853 | 691 | (GpgUnavailable, En) => "GPG verification is unavailable on this server", |
| 854 | 692 | (GpgUnavailable, Tr) => "GPG doğrulaması bu sunucuda kullanılamıyor", |
| 855 | 693 | |
| 856 | 694 | (YourNewToken, En) => "Your new token", |
| 857 | 695 | (YourNewToken, Tr) => "Yeni belirteciniz", |
| 858 | - (CopyNow, En) => "Copy it now. It is shown only once and cannot be recovered later.", | |
| 859 | - (CopyNow, Tr) => "Şimdi kopyalayın. Yalnızca bir kez gösterilir ve sonradan geri alınamaz.", | |
| 860 | - (UseAsPassword, En) => { | |
| 861 | - "Use it as the password when a git client asks for one, with any username." | |
| 862 | - } | |
| 863 | - (UseAsPassword, Tr) => { | |
| 864 | - "Bir Git istemcisi parola istediğinde, herhangi bir kullanıcı adıyla birlikte bunu parola olarak kullanın." | |
| 865 | - } | |
| 696 | + (CopyNow, En) => "Shown once.", | |
| 697 | + (CopyNow, Tr) => "Yalnızca bir kez gösterilir.", | |
| 866 | 698 | (NoAccessTokens, En) => "No access tokens yet.", |
| 867 | 699 | (NoAccessTokens, Tr) => "Henüz erişim belirteci yok.", |
| 868 | 700 | (NewToken, En) => "New token", |
| @@ -875,8 +707,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | ||
| 875 | 707 | (ExpiresIn365, Tr) => "365 gün sonra", |
| 876 | 708 | (ExpiresNever, En) => "Never", |
| 877 | 709 | (ExpiresNever, Tr) => "Hiçbir zaman", |
| 878 | - (ScopeNote, En) => "Scope: repo (read and write repositories you can access).", | |
| 879 | - (ScopeNote, Tr) => "Kapsam: repo (erişebildiğiniz depoları okuyabilir ve yazabilirsiniz).", | |
| 880 | 710 | (CreateToken, En) => "Create token", |
| 881 | 711 | (CreateToken, Tr) => "Belirteç oluştur", |
| 882 | 712 | |
| @@ -884,20 +714,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | ||
| 884 | 714 | (UnknownBrowser, Tr) => "Bilinmeyen tarayıcı", |
| 885 | 715 | (ThisSession, En) => "This session", |
| 886 | 716 | (ThisSession, Tr) => "Bu oturum", |
| 887 | - (UserAgent, En) => "User agent", | |
| 888 | - (UserAgent, Tr) => "Kullanıcı aracısı", | |
| 889 | - (SignInIp, En) => "Sign-in IP", | |
| 890 | - (SignInIp, Tr) => "Giriş IP adresi", | |
| 891 | - (LastIp, En) => "Last IP", | |
| 892 | - (LastIp, Tr) => "Son IP adresi", | |
| 893 | - (LastSeenAt, En) => "Last seen", | |
| 894 | - (LastSeenAt, Tr) => "Son görülme", | |
| 895 | - (ExpiresAt, En) => "Expires", | |
| 896 | - (ExpiresAt, Tr) => "Bitiş", | |
| 897 | - (BackToSessions, En) => "Back to sessions", | |
| 898 | - (BackToSessions, Tr) => "Oturumlara dön", | |
| 899 | - (NotRecorded, En) => "Not recorded", | |
| 900 | - (NotRecorded, Tr) => "Kaydedilmedi", | |
| 901 | 717 | (Close, En) => "Close", |
| 902 | 718 | (Close, Tr) => "Kapat", |
| 903 | 719 | (RevokeAllOthers, En) => "Revoke all other sessions", |
| @@ -938,12 +754,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | ||
| 938 | 754 | (ErrKeyMismatch, Tr) => "Anahtar gövdesi anahtar türüyle eşleşmiyor.", |
| 939 | 755 | (ForgotTitle, En) => "Forgot password", |
| 940 | 756 | (ForgotTitle, Tr) => "Parolamı unuttum", |
| 941 | - (ForgotSub, En) => { | |
| 942 | - "Enter the address on your account. If it is a verified address, we send a reset link." | |
| 943 | - } | |
| 944 | - (ForgotSub, Tr) => { | |
| 945 | - "Hesabınızdaki e-posta adresini girin. Doğrulanmış bir adres ise sıfırlama bağlantısı gönderilir." | |
| 946 | - } | |
| 947 | 757 | (ForgotSubmit, En) => "Send reset link", |
| 948 | 758 | (ForgotSubmit, Tr) => "Sıfırlama bağlantısı gönder", |
| 949 | 759 | (ForgotSent, En) => { |
| @@ -954,10 +764,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | ||
| 954 | 764 | } |
| 955 | 765 | (ResetTitle, En) => "Set a new password", |
| 956 | 766 | (ResetTitle, Tr) => "Yeni parola belirle", |
| 957 | - (ResetSub, En) => "The link works once. Choose a new password for your account.", | |
| 958 | - (ResetSub, Tr) => { | |
| 959 | - "Bu bağlantı yalnızca bir kez kullanılabilir. Hesabınız için yeni bir parola seçin." | |
| 960 | - } | |
| 961 | 767 | (ResetSubmit, En) => "Save new password", |
| 962 | 768 | (ResetSubmit, Tr) => "Yeni parolayı kaydet", |
| 963 | 769 | (ResetInvalid, En) => "This reset link is invalid, used or expired. Request a new one.", |
| @@ -972,18 +778,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | ||
| 972 | 778 | } |
| 973 | 779 | (RegisterTitle, En) => "Create an account", |
| 974 | 780 | (RegisterTitle, Tr) => "Hesap oluştur", |
| 975 | - (RegisterSub, En) => { | |
| 976 | - "Pick a username and a password. We send a link to confirm your address." | |
| 977 | - } | |
| 978 | - (RegisterSub, Tr) => { | |
| 979 | - "Bir kullanıcı adı ve parola seçin. Adresinizi doğrulamak için bir bağlantı göndereceğiz." | |
| 980 | - } | |
| 981 | - (RegisterInviteSub, En) => { | |
| 982 | - "You were invited. This account uses the address the invite was sent to." | |
| 983 | - } | |
| 984 | - (RegisterInviteSub, Tr) => { | |
| 985 | - "Davet edildiniz. Bu hesap, davetin gönderildiği adresi kullanır." | |
| 986 | - } | |
| 987 | 781 | (RegisterNeedsInvite, En) => { |
| 988 | 782 | "Registration is by invitation only. Ask an admin for an invite link." |
| 989 | 783 | } |
| @@ -998,34 +792,18 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | ||
| 998 | 792 | (RegisterSubmit, Tr) => "Hesap oluştur", |
| 999 | 793 | (VerifyTitle, En) => "Confirm your email", |
| 1000 | 794 | (VerifyTitle, Tr) => "E-posta adresini doğrula", |
| 1001 | - (VerifyConfirmSub, En) => "Confirm that this address is yours.", | |
| 1002 | - (VerifyConfirmSub, Tr) => "Bu adresin size ait olduğunu doğrulayın.", | |
| 1003 | 795 | (VerifyConfirm, En) => "Confirm address", |
| 1004 | 796 | (VerifyConfirm, Tr) => "Adresi doğrula", |
| 1005 | 797 | (VerifyDone, En) => "Your email address is verified.", |
| 1006 | 798 | (VerifyDone, Tr) => "E-posta adresin doğrulandı.", |
| 1007 | 799 | (VerifyInvalid, En) => "This verification link is invalid, used or expired.", |
| 1008 | 800 | (VerifyInvalid, Tr) => "Bu doğrulama bağlantısı geçersiz, kullanılmış ya da süresi dolmuş.", |
| 1009 | - (VerifyVerified, En) => "Verified", | |
| 1010 | - (VerifyVerified, Tr) => "Doğrulandı", | |
| 1011 | - (VerifyUnverified, En) => { | |
| 1012 | - "Not verified. Password reset mail is only sent to verified addresses." | |
| 1013 | - } | |
| 1014 | - (VerifyUnverified, Tr) => { | |
| 1015 | - "Doğrulanmadı. Parola sıfırlama e-postaları yalnızca doğrulanmış adreslere gönderilir." | |
| 1016 | - } | |
| 1017 | 801 | (VerifyResend, En) => "Send the verification link again", |
| 1018 | 802 | (VerifyResend, Tr) => "Doğrulama bağlantısını yeniden gönder", |
| 1019 | 803 | (OkVerifySent, En) => "We sent a verification link to your address.", |
| 1020 | 804 | (OkVerifySent, Tr) => "Adresinize bir doğrulama bağlantısı gönderildi.", |
| 1021 | 805 | (InvitesTitle, En) => "Invite someone", |
| 1022 | 806 | (InvitesTitle, Tr) => "Birini davet et", |
| 1023 | - (InvitesSub, En) => { | |
| 1024 | - "We email an invite link. It works once, for that address only, and expires in 7 days." | |
| 1025 | - } | |
| 1026 | - (InvitesSub, Tr) => { | |
| 1027 | - "Bir davet bağlantısı e-posta ile gönderilir. Bağlantı yalnızca o adres için, bir kez kullanılabilir ve 7 gün geçerlidir." | |
| 1028 | - } | |
| 1029 | 807 | (InvitesSubmit, En) => "Send invite", |
| 1030 | 808 | (InvitesSubmit, Tr) => "Davet gönder", |
| 1031 | 809 | (InvitesSent, En) => "The invite was sent.", |
| @@ -1055,11 +833,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | ||
| 1055 | 833 | (MailReasonComment, En) => "you commented on it", |
| 1056 | 834 | (MailReasonSubscribed, En) => "you are subscribed to it", |
| 1057 | 835 | (MailReasonWatching, En) => "you watch this repository", |
| 1058 | - (MenuNotificationEmails, En) => "Notifications", | |
| 1059 | 836 | (EmailNotifyLabel, En) => "Email me about notifications", |
| 1060 | - (EmailNotifyHelp, En) => { | |
| 1061 | - "Each notification is sent to your verified address. Notifications on the site are not affected." | |
| 1062 | - } | |
| 1063 | 837 | (EmailNotifyUnverified, En) => { |
| 1064 | 838 | "Verify your email address first. Only verified addresses get notification emails." |
| 1065 | 839 | } |
| @@ -1084,11 +858,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | ||
| 1084 | 858 | (MailReasonComment, Tr) => "bunda yorum yaptınız", |
| 1085 | 859 | (MailReasonSubscribed, Tr) => "bunu takip ediyorsunuz", |
| 1086 | 860 | (MailReasonWatching, Tr) => "bu depoyu izliyorsunuz", |
| 1087 | - (MenuNotificationEmails, Tr) => "Bildirimler", | |
| 1088 | 861 | (EmailNotifyLabel, Tr) => "Bildirimler hakkında bana e-posta gönder", |
| 1089 | - (EmailNotifyHelp, Tr) => { | |
| 1090 | - "Her bildirim doğrulanmış adresinize gönderilir. Sitedeki bildirimler bundan etkilenmez." | |
| 1091 | - } | |
| 1092 | 862 | (EmailNotifyUnverified, Tr) => { |
| 1093 | 863 | "Önce e-posta adresinizi doğrulayın. Bildirim e-postaları yalnızca doğrulanmış adreslere gönderilir." |
| 1094 | 864 | } |
| @@ -1104,8 +874,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | ||
| 1104 | 874 | (PillOff, Tr) => "Kapalı", |
| 1105 | 875 | (PillVerified, En) => "Verified", |
| 1106 | 876 | (PillVerified, Tr) => "Doğrulandı", |
| 1107 | - (PillUnverified, En) => "Unverified", | |
| 1108 | - (PillUnverified, Tr) => "Doğrulanmadı", | |
| 1109 | 877 | (EmailNotVerified, En) => "Not verified", |
| 1110 | 878 | (EmailNotVerified, Tr) => "Doğrulanmadı", |
| 1111 | 879 | (EmailNoAddress, En) => "No email address", |
| @@ -1114,18 +882,12 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | ||
| 1114 | 882 | (EmailMailQueued, Tr) => "doğrulama iletisi kuyrukta", |
| 1115 | 883 | (EmailMailFailed, En) => "verification mail failed", |
| 1116 | 884 | (EmailMailFailed, Tr) => "doğrulama iletisi başarısız", |
| 1117 | - (ChangeAction, En) => "Change", | |
| 1118 | - (ChangeAction, Tr) => "Değiştir", | |
| 1119 | 885 | (SetUpAction, En) => "Set up", |
| 1120 | 886 | (SetUpAction, Tr) => "Kur", |
| 1121 | 887 | (SetupInProgress, En) => "Setup in progress", |
| 1122 | 888 | (SetupInProgress, Tr) => "Kurulum sürüyor", |
| 1123 | 889 | (DeviceName, En) => "Device name (optional)", |
| 1124 | 890 | (DeviceName, Tr) => "Cihaz adı (isteğe bağlı)", |
| 1125 | - (DeviceNameHint, En) => "Shown in your list of devices. Leave empty for the default name.", | |
| 1126 | - (DeviceNameHint, Tr) => { | |
| 1127 | - "Cihaz listenizde görünür. Boş bırakırsanız varsayılan ad kullanılır." | |
| 1128 | - } | |
| 1129 | 891 | (ErrDeviceName, En) => { |
| 1130 | 892 | "Use at most 40 characters for the device name, without line breaks." |
| 1131 | 893 | } |
crates/forge-web-base/src/i18n/needs.rsmodified+1 -1
| @@ -73,7 +73,7 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 73 | 73 | (AllMentions, Tr) => "Tüm bahsetmeler", |
| 74 | 74 | (BackToNeedsYou, En) => "Back to Needs you", |
| 75 | 75 | (BackToNeedsYou, Tr) => "Sizi bekleyenlere dön", |
| 76 | - (AllClear, En) => "Nothing is waiting on you.", | |
| 76 | + (AllClear, En) => "Nothing waiting.", | |
| 77 | 77 | (AllClear, Tr) => "Sizi bekleyen bir şey yok.", |
| 78 | 78 | } |
| 79 | 79 | } |
crates/forge-web-base/src/i18n/orgs.rsmodified+0 -74
| @@ -44,39 +44,30 @@ pub enum K { | ||
| 44 | 44 | NewRepository, |
| 45 | 45 | // Organization creation. |
| 46 | 46 | NewOrganization, |
| 47 | - NewOrgIntro, | |
| 48 | 47 | OrgName, |
| 49 | 48 | DescriptionOptional, |
| 50 | 49 | CreateOrg, |
| 51 | 50 | // Organization settings. |
| 52 | 51 | Settings, |
| 53 | 52 | General, |
| 54 | - BackToOrganization, | |
| 55 | 53 | Description, |
| 56 | 54 | DisplayNameLabel, |
| 57 | 55 | DefaultRoleLabel, |
| 58 | - DefaultRoleHelp, | |
| 59 | 56 | MembersCanCreate, |
| 60 | 57 | SaveSettings, |
| 61 | 58 | DeleteOrg, |
| 62 | - DeleteOrgIntro, | |
| 63 | 59 | // Members. |
| 64 | 60 | Members, |
| 65 | 61 | Teams, |
| 66 | 62 | Organization, |
| 67 | 63 | ViewAllMembers, |
| 68 | - MemberHeader, | |
| 69 | 64 | Role, |
| 70 | 65 | RoleOwner, |
| 71 | 66 | RoleMember, |
| 72 | 67 | Leave, |
| 73 | - AddMember, | |
| 74 | 68 | AddMemberButton, |
| 75 | - OwnersHelp, | |
| 76 | 69 | // Teams. |
| 77 | - TeamsIntro, | |
| 78 | 70 | NoTeamsYet, |
| 79 | - NewTeam, | |
| 80 | 71 | CoversAllRepos, |
| 81 | 72 | CreateTeam, |
| 82 | 73 | SaveTeam, |
| @@ -101,7 +92,6 @@ pub enum K { | ||
| 101 | 92 | Pages, |
| 102 | 93 | Previous, |
| 103 | 94 | Next, |
| 104 | - PublicReposIntro, | |
| 105 | 95 | Organizations, |
| 106 | 96 | SearchPublicRepos, |
| 107 | 97 | Search, |
| @@ -119,10 +109,8 @@ pub enum K { | ||
| 119 | 109 | Pinned, |
| 120 | 110 | PopularRepos, |
| 121 | 111 | CustomizePins, |
| 122 | - PinsIntro, | |
| 123 | 112 | SavePins, |
| 124 | 113 | PinsTooMany, |
| 125 | - NoPinnableRepos, | |
| 126 | 114 | TabOverview, |
| 127 | 115 | TabStars, |
| 128 | 116 | FilterRepos, |
| @@ -130,7 +118,6 @@ pub enum K { | ||
| 130 | 118 | ClearSearch, |
| 131 | 119 | // Landing. |
| 132 | 120 | Home, |
| 133 | - LandingTagline, | |
| 134 | 121 | LogIn, |
| 135 | 122 | SetUpForge, |
| 136 | 123 | } |
| @@ -217,16 +204,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 217 | 204 | (NewOrganization, Tr) => "Yeni kuruluş", |
| 218 | 205 | (General, En) => "General", |
| 219 | 206 | (General, Tr) => "Genel", |
| 220 | - (BackToOrganization, En) => "Back to organization", | |
| 221 | - (BackToOrganization, Tr) => "Kuruluşa dön", | |
| 222 | 207 | (ViewAllMembers, En) => "View all", |
| 223 | 208 | (ViewAllMembers, Tr) => "Tümünü gör", |
| 224 | - (NewOrgIntro, En) => { | |
| 225 | - "An organization owns repositories and shares them with its members through teams. You become its first owner." | |
| 226 | - } | |
| 227 | - (NewOrgIntro, Tr) => { | |
| 228 | - "Kuruluş depolara sahip olur ve bunları takımları aracılığıyla üyeleriyle paylaşır. Kuruluşun ilk sahibi siz olursunuz." | |
| 229 | - } | |
| 230 | 209 | (OrgName, En) => "Organization name", |
| 231 | 210 | (OrgName, Tr) => "Kuruluş adı", |
| 232 | 211 | (DescriptionOptional, En) => "Description (optional)", |
| @@ -241,32 +220,18 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 241 | 220 | (DisplayNameLabel, Tr) => "Görünen ad", |
| 242 | 221 | (DefaultRoleLabel, En) => "Default role on the organization's repositories", |
| 243 | 222 | (DefaultRoleLabel, Tr) => "Kuruluş depolarında varsayılan rol", |
| 244 | - (DefaultRoleHelp, En) => { | |
| 245 | - "Members get this role on every repository the organization owns, unless a team gives them more. Owners always have admin." | |
| 246 | - } | |
| 247 | - (DefaultRoleHelp, Tr) => { | |
| 248 | - "Üyeler, bir takım daha fazla yetki vermedikçe kuruluşa ait her depoda bu rolü alır. Sahipler her zaman yönetici yetkisine sahiptir." | |
| 249 | - } | |
| 250 | 223 | (MembersCanCreate, En) => "Members can create repositories for this organization", |
| 251 | 224 | (MembersCanCreate, Tr) => "Üyeler bu kuruluş için depo oluşturabilir", |
| 252 | 225 | (SaveSettings, En) => "Save settings", |
| 253 | 226 | (SaveSettings, Tr) => "Ayarları kaydet", |
| 254 | 227 | (DeleteOrg, En) => "Delete organization", |
| 255 | 228 | (DeleteOrg, Tr) => "Kuruluşu sil", |
| 256 | - (DeleteOrgIntro, En) => { | |
| 257 | - "Deleting removes the organization, its members and its teams. It is refused while the organization owns repositories." | |
| 258 | - } | |
| 259 | - (DeleteOrgIntro, Tr) => { | |
| 260 | - "Silme işlemi kuruluşu, üyelerini ve takımlarını kaldırır. Kuruluşun depoları varken reddedilir." | |
| 261 | - } | |
| 262 | 229 | (Members, En) => "Members", |
| 263 | 230 | (Members, Tr) => "Üyeler", |
| 264 | 231 | (Teams, En) => "Teams", |
| 265 | 232 | (Teams, Tr) => "Takımlar", |
| 266 | 233 | (Organization, En) => "Organization", |
| 267 | 234 | (Organization, Tr) => "Kuruluş", |
| 268 | - (MemberHeader, En) => "Member", | |
| 269 | - (MemberHeader, Tr) => "Üye", | |
| 270 | 235 | (Role, En) => "Role", |
| 271 | 236 | (Role, Tr) => "Rol", |
| 272 | 237 | (RoleOwner, En) => "owner", |
| @@ -275,26 +240,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 275 | 240 | (RoleMember, Tr) => "üye", |
| 276 | 241 | (Leave, En) => "Leave", |
| 277 | 242 | (Leave, Tr) => "Ayrıl", |
| 278 | - (AddMember, En) => "Add a member", | |
| 279 | - (AddMember, Tr) => "Bir üye ekle", | |
| 280 | 243 | (AddMemberButton, En) => "Add member", |
| 281 | 244 | (AddMemberButton, Tr) => "Üye ekle", |
| 282 | - (OwnersHelp, En) => { | |
| 283 | - "Owners manage the organization, its teams and its settings. Members get the repository access their teams give them." | |
| 284 | - } | |
| 285 | - (OwnersHelp, Tr) => { | |
| 286 | - "Sahipler kuruluşu, takımlarını ve ayarlarını yönetir. Üyeler, takımlarının verdiği depo erişimini alır." | |
| 287 | - } | |
| 288 | - (TeamsIntro, En) => { | |
| 289 | - "A team gives its members a role on the repositories it covers: every repository the organization owns when the team covers all of them, otherwise only the repositories linked to it." | |
| 290 | - } | |
| 291 | - (TeamsIntro, Tr) => { | |
| 292 | - "Takım, üyelerine kapsadığı depolarda bir rol verir: takım kuruluşun tüm depolarını kapsıyorsa kuruluşa ait her depo, aksi halde yalnızca takıma bağlı depolar." | |
| 293 | - } | |
| 294 | 245 | (NoTeamsYet, En) => "No teams yet.", |
| 295 | 246 | (NoTeamsYet, Tr) => "Henüz takım yok.", |
| 296 | - (NewTeam, En) => "New team", | |
| 297 | - (NewTeam, Tr) => "Yeni takım", | |
| 298 | 247 | (CoversAllRepos, En) => "Covers all of the organization's repositories", |
| 299 | 248 | (CoversAllRepos, Tr) => "Kuruluşun tüm depolarını kapsar", |
| 300 | 249 | (CreateTeam, En) => "Create team", |
| @@ -339,8 +288,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 339 | 288 | (Previous, Tr) => "Önceki", |
| 340 | 289 | (Next, En) => "Next", |
| 341 | 290 | (Next, Tr) => "Sonraki", |
| 342 | - (PublicReposIntro, En) => "Public repositories on this forge.", | |
| 343 | - (PublicReposIntro, Tr) => "Bu forge üzerindeki herkese açık depolar.", | |
| 344 | 291 | (Organizations, En) => "Organizations", |
| 345 | 292 | (Organizations, Tr) => "Kuruluşlar", |
| 346 | 293 | (SearchPublicRepos, En) => "Search public repositories", |
| @@ -373,14 +320,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 373 | 320 | (PopularRepos, Tr) => "Popüler depolar", |
| 374 | 321 | (CustomizePins, En) => "Customize pins", |
| 375 | 322 | (CustomizePins, Tr) => "Sabitlemeleri düzenle", |
| 376 | - (PinsIntro, En) => "Pick up to six repositories to show first on this profile.", | |
| 377 | - (PinsIntro, Tr) => "Bu profilde önce gösterilecek en fazla altı depoyu seç.", | |
| 378 | 323 | (SavePins, En) => "Save pins", |
| 379 | 324 | (SavePins, Tr) => "Sabitlemeleri kaydet", |
| 380 | 325 | (PinsTooMany, En) => "You can pin at most six repositories.", |
| 381 | 326 | (PinsTooMany, Tr) => "En fazla altı depo sabitleyebilirsin.", |
| 382 | - (NoPinnableRepos, En) => "No repositories to pin yet.", | |
| 383 | - (NoPinnableRepos, Tr) => "Henüz sabitlenecek depo yok.", | |
| 384 | 327 | (TabOverview, En) => "Overview", |
| 385 | 328 | (TabOverview, Tr) => "Genel bakış", |
| 386 | 329 | (TabStars, En) => "Stars", |
| @@ -393,10 +336,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 393 | 336 | (ClearSearch, Tr) => "Aramayı temizle", |
| 394 | 337 | (Home, En) => "Home", |
| 395 | 338 | (Home, Tr) => "Ana sayfa", |
| 396 | - (LandingTagline, En) => "Self-hosted git repositories with a small, fast web interface.", | |
| 397 | - (LandingTagline, Tr) => { | |
| 398 | - "Kendi sunucunuzda barındırılan git depoları, küçük ve hızlı bir web arayüzüyle." | |
| 399 | - } | |
| 400 | 339 | (LogIn, En) => "Log in", |
| 401 | 340 | (LogIn, Tr) => "Giriş yap", |
| 402 | 341 | (SetUpForge, En) => "Set up forge", |
| @@ -553,7 +492,6 @@ mod tests { | ||
| 553 | 492 | K::Explore, |
| 554 | 493 | K::NewRepository, |
| 555 | 494 | K::NewOrganization, |
| 556 | - K::NewOrgIntro, | |
| 557 | 495 | K::OrgName, |
| 558 | 496 | K::DescriptionOptional, |
| 559 | 497 | K::CreateOrg, |
| @@ -561,25 +499,18 @@ mod tests { | ||
| 561 | 499 | K::Description, |
| 562 | 500 | K::DisplayNameLabel, |
| 563 | 501 | K::DefaultRoleLabel, |
| 564 | - K::DefaultRoleHelp, | |
| 565 | 502 | K::MembersCanCreate, |
| 566 | 503 | K::SaveSettings, |
| 567 | 504 | K::DeleteOrg, |
| 568 | - K::DeleteOrgIntro, | |
| 569 | 505 | K::Members, |
| 570 | 506 | K::Teams, |
| 571 | 507 | K::Organization, |
| 572 | - K::MemberHeader, | |
| 573 | 508 | K::Role, |
| 574 | 509 | K::RoleOwner, |
| 575 | 510 | K::RoleMember, |
| 576 | 511 | K::Leave, |
| 577 | - K::AddMember, | |
| 578 | 512 | K::AddMemberButton, |
| 579 | - K::OwnersHelp, | |
| 580 | - K::TeamsIntro, | |
| 581 | 513 | K::NoTeamsYet, |
| 582 | - K::NewTeam, | |
| 583 | 514 | K::CoversAllRepos, |
| 584 | 515 | K::CreateTeam, |
| 585 | 516 | K::SaveTeam, |
| @@ -602,7 +533,6 @@ mod tests { | ||
| 602 | 533 | K::Pages, |
| 603 | 534 | K::Previous, |
| 604 | 535 | K::Next, |
| 605 | - K::PublicReposIntro, | |
| 606 | 536 | K::Organizations, |
| 607 | 537 | K::SearchPublicRepos, |
| 608 | 538 | K::Search, |
| @@ -619,19 +549,15 @@ mod tests { | ||
| 619 | 549 | K::Pinned, |
| 620 | 550 | K::PopularRepos, |
| 621 | 551 | K::CustomizePins, |
| 622 | - K::PinsIntro, | |
| 623 | 552 | K::SavePins, |
| 624 | 553 | K::PinsTooMany, |
| 625 | - K::NoPinnableRepos, | |
| 626 | 554 | K::TabOverview, |
| 627 | 555 | K::General, |
| 628 | - K::BackToOrganization, | |
| 629 | 556 | K::TabStars, |
| 630 | 557 | K::FilterRepos, |
| 631 | 558 | K::NoReposMatch, |
| 632 | 559 | K::ClearSearch, |
| 633 | 560 | K::Home, |
| 634 | - K::LandingTagline, | |
| 635 | 561 | K::LogIn, |
| 636 | 562 | K::SetUpForge, |
| 637 | 563 | ]; |
crates/forge-web-base/src/i18n/packages.rsmodified+0 -42
| @@ -7,7 +7,6 @@ use super::Lang; | ||
| 7 | 7 | pub enum K { |
| 8 | 8 | TabPackages, |
| 9 | 9 | PackagesHeading, |
| 10 | - PackagesHelp, | |
| 11 | 10 | NoPackages, |
| 12 | 11 | PackageVersions, |
| 13 | 12 | PackageVersionCount, |
| @@ -16,7 +15,6 @@ pub enum K { | ||
| 16 | 15 | PackageRepoLink, |
| 17 | 16 | VersionYanked, |
| 18 | 17 | Install, |
| 19 | - InstallHelp, | |
| 20 | 18 | InstallRegistryConfig, |
| 21 | 19 | InstallAdd, |
| 22 | 20 | InstallPublish, |
| @@ -25,21 +23,13 @@ pub enum K { | ||
| 25 | 23 | Readme, |
| 26 | 24 | NoReadme, |
| 27 | 25 | ScopePackages, |
| 28 | - ScopePackagesHelp, | |
| 29 | 26 | Cancel, |
| 30 | 27 | ContainerKind, |
| 31 | - ContainerInstallHelp, | |
| 32 | 28 | ContainerLogin, |
| 33 | 29 | ContainerPull, |
| 34 | 30 | ContainerPush, |
| 35 | 31 | ContainerTags, |
| 36 | - ContainerTag, | |
| 37 | - ContainerDigest, | |
| 38 | - ContainerSize, | |
| 39 | - ContainerCreated, | |
| 40 | 32 | DeleteTag, |
| 41 | - DeleteTagMessage, | |
| 42 | - DeleteTagConfirm, | |
| 43 | 33 | NoTags, |
| 44 | 34 | NoVersions, |
| 45 | 35 | PackageTagCount, |
| @@ -54,12 +44,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 54 | 44 | (Cancel, Tr) => "Vazgeç", |
| 55 | 45 | (ContainerKind, En) => "Container", |
| 56 | 46 | (ContainerKind, Tr) => "Konteyner", |
| 57 | - (ContainerInstallHelp, En) => { | |
| 58 | - "Log in with your username and a personal access token that has the packages scope." | |
| 59 | - } | |
| 60 | - (ContainerInstallHelp, Tr) => { | |
| 61 | - "Kullanıcı adınız ve packages kapsamına sahip bir kişisel erişim belirteciyle giriş yapın." | |
| 62 | - } | |
| 63 | 47 | (ContainerLogin, En) => "Log in", |
| 64 | 48 | (ContainerLogin, Tr) => "Giriş yap", |
| 65 | 49 | (ContainerPull, En) => "Pull the image", |
| @@ -68,20 +52,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 68 | 52 | (ContainerPush, Tr) => "Bir etiket gönder", |
| 69 | 53 | (ContainerTags, En) => "Tags", |
| 70 | 54 | (ContainerTags, Tr) => "Etiketler", |
| 71 | - (ContainerTag, En) => "Tag", | |
| 72 | - (ContainerTag, Tr) => "Etiket", | |
| 73 | - (ContainerDigest, En) => "Digest", | |
| 74 | - (ContainerDigest, Tr) => "Özet", | |
| 75 | - (ContainerSize, En) => "Size", | |
| 76 | - (ContainerSize, Tr) => "Boyut", | |
| 77 | - (ContainerCreated, En) => "Created", | |
| 78 | - (ContainerCreated, Tr) => "Oluşturuldu", | |
| 79 | 55 | (DeleteTag, En) => "Delete", |
| 80 | 56 | (DeleteTag, Tr) => "Sil", |
| 81 | - (DeleteTagMessage, En) => "Delete this tag? An image left with no tag is removed too.", | |
| 82 | - (DeleteTagMessage, Tr) => "Bu etiket silinsin mi? Etiketsiz kalan imaj da kaldırılır.", | |
| 83 | - (DeleteTagConfirm, En) => "Yes, delete", | |
| 84 | - (DeleteTagConfirm, Tr) => "Evet, sil", | |
| 85 | 57 | (NoTags, En) => "No tags yet. Push an image to see it here.", |
| 86 | 58 | (NoTags, Tr) => "Henüz etiket yok. Burada görmek için bir imaj gönderin.", |
| 87 | 59 | (NoVersions, En) => "No versions published yet.", |
| @@ -94,10 +66,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 94 | 66 | (TabPackages, Tr) => "Paketler", |
| 95 | 67 | (PackagesHeading, En) => "Packages", |
| 96 | 68 | (PackagesHeading, Tr) => "Paketler", |
| 97 | - (PackagesHelp, En) => "Packages this owner publishes: Cargo crates and container images.", | |
| 98 | - (PackagesHelp, Tr) => { | |
| 99 | - "Bu sahibin yayımladığı paketler: Cargo crate'leri ve konteyner imajları." | |
| 100 | - } | |
| 101 | 69 | (NoPackages, En) => "No packages yet.", |
| 102 | 70 | (NoPackages, Tr) => "Henüz paket yok.", |
| 103 | 71 | (PackageVersions, En) => "Versions", |
| @@ -114,10 +82,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 114 | 82 | (VersionYanked, Tr) => "geri çekildi", |
| 115 | 83 | (Install, En) => "Install", |
| 116 | 84 | (Install, Tr) => "Kurulum", |
| 117 | - (InstallHelp, En) => "Add this registry to your Cargo config, then add the crate.", | |
| 118 | - (InstallHelp, Tr) => { | |
| 119 | - "Bu kayıt defterini Cargo yapılandırmanıza ekleyin, sonra crate'i ekleyin." | |
| 120 | - } | |
| 121 | 85 | (InstallRegistryConfig, En) => "Registry config", |
| 122 | 86 | (InstallRegistryConfig, Tr) => "Kayıt defteri yapılandırması", |
| 123 | 87 | (InstallAdd, En) => "Add the crate", |
| @@ -134,11 +98,5 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 134 | 98 | (NoReadme, Tr) => "Bu crate'in README'si yok.", |
| 135 | 99 | (ScopePackages, En) => "Packages", |
| 136 | 100 | (ScopePackages, Tr) => "Paketler", |
| 137 | - (ScopePackagesHelp, En) => { | |
| 138 | - "Read private packages, publish, yank and unyank crates in the owner's registry." | |
| 139 | - } | |
| 140 | - (ScopePackagesHelp, Tr) => { | |
| 141 | - "Özel paketleri okuma, sahibin kayıt defterine crate yayımlama, geri çekme ve geri alma." | |
| 142 | - } | |
| 143 | 101 | } |
| 144 | 102 | } |
crates/forge-web-base/src/i18n/pulls.rsmodified+1 -21
| @@ -12,7 +12,6 @@ pub enum K { | ||
| 12 | 12 | StateOpen, |
| 13 | 13 | StateMerged, |
| 14 | 14 | StateClosed, |
| 15 | - ListStateNavLabel, | |
| 16 | 15 | NewPullRequest, |
| 17 | 16 | SearchTitles, |
| 18 | 17 | SortLabel, |
| @@ -24,22 +23,18 @@ pub enum K { | ||
| 24 | 23 | SortNewest, |
| 25 | 24 | SortOldest, |
| 26 | 25 | SortUpdated, |
| 27 | - MetaBeforeTime, | |
| 28 | - MetaAfterTime, | |
| 29 | 26 | Newer, |
| 30 | 27 | Older, |
| 31 | 28 | |
| 32 | 29 | // pull_files.rs |
| 33 | 30 | FinishReview, |
| 34 | 31 | ReviewSummary, |
| 35 | - ReviewType, | |
| 36 | 32 | CommentChoice, |
| 37 | 33 | ApproveChoice, |
| 38 | 34 | RequestChangesChoice, |
| 39 | 35 | SubmitReview, |
| 40 | 36 | DiscardPending, |
| 41 | 37 | ViewedFiles, |
| 42 | - ViewedHint, | |
| 43 | 38 | ViewedMark, |
| 44 | 39 | ChangedSinceViewed, |
| 45 | 40 | |
| @@ -102,8 +97,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 102 | 97 | (StateMerged, Tr) => "Birleştirildi", |
| 103 | 98 | (StateClosed, En) => "Closed", |
| 104 | 99 | (StateClosed, Tr) => "Kapatıldı", |
| 105 | - (ListStateNavLabel, En) => "Pull requests by state", | |
| 106 | - (ListStateNavLabel, Tr) => "Duruma göre çekme istekleri", | |
| 107 | 100 | (NewPullRequest, En) => "New pull request", |
| 108 | 101 | (NewPullRequest, Tr) => "Yeni çekme isteği", |
| 109 | 102 | (SearchTitles, En) => "Search titles", |
| @@ -122,7 +115,7 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 122 | 115 | (NoPullRequestsYet, Tr) => { |
| 123 | 116 | "Henüz çekme isteği yok. Bir dal gönderin, ardından değişikliklerini önermek için bir çekme isteği açın." |
| 124 | 117 | } |
| 125 | - (NoPullRequestsMatch, En) => "No pull requests match these filters.", | |
| 118 | + (NoPullRequestsMatch, En) => "No matches.", | |
| 126 | 119 | (NoPullRequestsMatch, Tr) => "Bu filtrelere uyan çekme isteği yok.", |
| 127 | 120 | (SortNewest, En) => "Newest", |
| 128 | 121 | (SortNewest, Tr) => "En yeni", |
| @@ -130,10 +123,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 130 | 123 | (SortOldest, Tr) => "En eski", |
| 131 | 124 | (SortUpdated, En) => "Recently updated", |
| 132 | 125 | (SortUpdated, Tr) => "Son güncellenen", |
| 133 | - (MetaBeforeTime, En) => " opened ", | |
| 134 | - (MetaBeforeTime, Tr) => " · ", | |
| 135 | - (MetaAfterTime, En) => " by ", | |
| 136 | - (MetaAfterTime, Tr) => " tarafından açıldı · ", | |
| 137 | 126 | (Newer, En) => "Newer", |
| 138 | 127 | (Newer, Tr) => "Daha yeni", |
| 139 | 128 | (Older, En) => "Older", |
| @@ -143,8 +132,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 143 | 132 | (FinishReview, Tr) => "İncelemeyi tamamla", |
| 144 | 133 | (ReviewSummary, En) => "Review summary", |
| 145 | 134 | (ReviewSummary, Tr) => "İnceleme özeti", |
| 146 | - (ReviewType, En) => "Review type", | |
| 147 | - (ReviewType, Tr) => "İnceleme türü", | |
| 148 | 135 | (CommentChoice, En) => " Comment", |
| 149 | 136 | (CommentChoice, Tr) => " Yorum", |
| 150 | 137 | (ApproveChoice, En) => " Approve", |
| @@ -157,8 +144,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 157 | 144 | (DiscardPending, Tr) => "Bekleyen yorumları sil", |
| 158 | 145 | (ViewedFiles, En) => "Viewed files", |
| 159 | 146 | (ViewedFiles, Tr) => "Görüntülenen dosyalar", |
| 160 | - (ViewedHint, En) => "v marks the focused file, n moves to the next unviewed one.", | |
| 161 | - (ViewedHint, Tr) => "v odaktaki dosyayı işaretler, n görülmemiş sonrakine geçer.", | |
| 162 | 147 | (ViewedMark, En) => "Mark as viewed", |
| 163 | 148 | (ViewedMark, Tr) => "Görüntülendi olarak işaretle", |
| 164 | 149 | (ChangedSinceViewed, En) => "Changed since you viewed", |
| @@ -335,7 +320,6 @@ mod tests { | ||
| 335 | 320 | K::StateOpen, |
| 336 | 321 | K::StateMerged, |
| 337 | 322 | K::StateClosed, |
| 338 | - K::ListStateNavLabel, | |
| 339 | 323 | K::NewPullRequest, |
| 340 | 324 | K::SearchTitles, |
| 341 | 325 | K::SortLabel, |
| @@ -347,20 +331,16 @@ mod tests { | ||
| 347 | 331 | K::SortNewest, |
| 348 | 332 | K::SortOldest, |
| 349 | 333 | K::SortUpdated, |
| 350 | - K::MetaBeforeTime, | |
| 351 | - K::MetaAfterTime, | |
| 352 | 334 | K::Newer, |
| 353 | 335 | K::Older, |
| 354 | 336 | K::FinishReview, |
| 355 | 337 | K::ReviewSummary, |
| 356 | - K::ReviewType, | |
| 357 | 338 | K::CommentChoice, |
| 358 | 339 | K::ApproveChoice, |
| 359 | 340 | K::RequestChangesChoice, |
| 360 | 341 | K::SubmitReview, |
| 361 | 342 | K::DiscardPending, |
| 362 | 343 | K::ViewedFiles, |
| 363 | - K::ViewedHint, | |
| 364 | 344 | K::ViewedMark, |
| 365 | 345 | K::ChangedSinceViewed, |
| 366 | 346 | K::BranchErrProtected, |
crates/forge-web-base/src/i18n/pulls_review.rsmodified+2 -14
| @@ -21,7 +21,6 @@ pub enum K { | ||
| 21 | 21 | MergeConflict, |
| 22 | 22 | MergeUpToDate, |
| 23 | 23 | MergeChecking, |
| 24 | - ReloadToCheck, | |
| 25 | 24 | MergeStyleLegend, |
| 26 | 25 | StyleMergeCommit, |
| 27 | 26 | StyleSquash, |
| @@ -41,7 +40,6 @@ pub enum K { | ||
| 41 | 40 | CheckErrored, |
| 42 | 41 | CheckMissing, |
| 43 | 42 | EnableAutoMerge, |
| 44 | - AutoMergeHint, | |
| 45 | 43 | DisableAutoMerge, |
| 46 | 44 | MergeMessageLabel, |
| 47 | 45 | MergeButton, |
| @@ -121,16 +119,14 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 121 | 119 | (TabConversation, Tr) => "Tartışma", |
| 122 | 120 | (PullPages, En) => "Pull request pages", |
| 123 | 121 | (PullPages, Tr) => "Çekme isteği sayfaları", |
| 124 | - (MergeClean, En) => "This branch has no conflicts with the base branch", | |
| 125 | - (MergeClean, Tr) => "Bu dalın taban dalla çakışması yok", | |
| 122 | + (MergeClean, En) => "Ready to merge", | |
| 123 | + (MergeClean, Tr) => "Birleştirmeye hazır", | |
| 126 | 124 | (MergeConflict, En) => "This branch has conflicts that must be resolved", |
| 127 | 125 | (MergeConflict, Tr) => "Bu dalda çözülmesi gereken çakışmalar var", |
| 128 | 126 | (MergeUpToDate, En) => "This branch is already up to date with base", |
| 129 | 127 | (MergeUpToDate, Tr) => "Bu dal zaten taban dalla güncel", |
| 130 | 128 | (MergeChecking, En) => "Checking mergeability\u{2026}", |
| 131 | 129 | (MergeChecking, Tr) => "Birleştirilebilirlik kontrol ediliyor\u{2026}", |
| 132 | - (ReloadToCheck, En) => "Reload to check again", | |
| 133 | - (ReloadToCheck, Tr) => "Yeniden kontrol etmek için sayfayı yenileyin", | |
| 134 | 130 | (MergeStyleLegend, En) => "Merge style", |
| 135 | 131 | (MergeStyleLegend, Tr) => "Birleştirme yöntemi", |
| 136 | 132 | (StyleMergeCommit, En) => " Create a merge commit", |
| @@ -181,12 +177,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 181 | 177 | (CheckMissing, Tr) => "Durum bekleniyor", |
| 182 | 178 | (EnableAutoMerge, En) => "Enable auto-merge", |
| 183 | 179 | (EnableAutoMerge, Tr) => "Otomatik birleştirmeyi aç", |
| 184 | - (AutoMergeHint, En) => { | |
| 185 | - "The pull request merges by itself as soon as the required checks and approvals pass." | |
| 186 | - } | |
| 187 | - (AutoMergeHint, Tr) => { | |
| 188 | - "Gerekli denetimler ve onaylar tamamlanır tamamlanmaz çekme isteği kendiliğinden birleşir." | |
| 189 | - } | |
| 190 | 180 | (DisableAutoMerge, En) => "Disable auto-merge", |
| 191 | 181 | (DisableAutoMerge, Tr) => "Otomatik birleştirmeyi kapat", |
| 192 | 182 | (MergeMessageLabel, En) => "Merge commit message (optional)", |
| @@ -464,7 +454,6 @@ pub const ALL: &[K] = &[ | ||
| 464 | 454 | K::MergeConflict, |
| 465 | 455 | K::MergeUpToDate, |
| 466 | 456 | K::MergeChecking, |
| 467 | - K::ReloadToCheck, | |
| 468 | 457 | K::MergeStyleLegend, |
| 469 | 458 | K::StyleMergeCommit, |
| 470 | 459 | K::StyleSquash, |
| @@ -484,7 +473,6 @@ pub const ALL: &[K] = &[ | ||
| 484 | 473 | K::CheckErrored, |
| 485 | 474 | K::CheckMissing, |
| 486 | 475 | K::EnableAutoMerge, |
| 487 | - K::AutoMergeHint, | |
| 488 | 476 | K::DisableAutoMerge, |
| 489 | 477 | K::MergeMessageLabel, |
| 490 | 478 | K::MergeButton, |
crates/forge-web-base/src/i18n/push.rsmodified+0 -7
| @@ -7,7 +7,6 @@ use super::Lang; | ||
| 7 | 7 | pub enum K { |
| 8 | 8 | // Settings card: this device. |
| 9 | 9 | DeviceHeading, |
| 10 | - DeviceHelp, | |
| 11 | 10 | DeviceUnsupported, |
| 12 | 11 | DeviceNeedsHttps, |
| 13 | 12 | DeviceIosHint, |
| @@ -36,12 +35,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 36 | 35 | match (key, lang) { |
| 37 | 36 | (DeviceHeading, Lang::En) => "Push notifications on this device", |
| 38 | 37 | (DeviceHeading, Lang::Tr) => "Bu cihazda anlık bildirimler", |
| 39 | - (DeviceHelp, Lang::En) => { | |
| 40 | - "Get a notification on this device even when Forge is closed. Each browser or installed app is a separate device." | |
| 41 | - } | |
| 42 | - (DeviceHelp, Lang::Tr) => { | |
| 43 | - "Forge kapalıyken bile bu cihazda bildirim alın. Her tarayıcı veya yüklü uygulama ayrı bir cihazdır." | |
| 44 | - } | |
| 45 | 38 | (DeviceUnsupported, Lang::En) => "This browser does not support push notifications.", |
| 46 | 39 | (DeviceUnsupported, Lang::Tr) => "Bu tarayıcı anlık bildirimleri desteklemiyor.", |
| 47 | 40 | (DeviceNeedsHttps, Lang::En) => "Push notifications need an HTTPS connection.", |
crates/forge-web-base/src/i18n/releases_ci.rsmodified+8 -102
| @@ -8,7 +8,6 @@ use super::Lang; | ||
| 8 | 8 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] |
| 9 | 9 | pub enum K { |
| 10 | 10 | // Repo home page: the latest release card. |
| 11 | - LatestReleaseHeading, | |
| 12 | 11 | |
| 13 | 12 | // CI notices, shown after a run action. |
| 14 | 13 | CiNoticeStarted, |
| @@ -22,7 +21,6 @@ pub enum K { | ||
| 22 | 21 | |
| 23 | 22 | // CI run list and run page. |
| 24 | 23 | RunWorkflow, |
| 25 | - RunWorkflowHelp, | |
| 26 | 24 | Branch, |
| 27 | 25 | ApproveAndRun, |
| 28 | 26 | Cancel, |
| @@ -34,12 +32,10 @@ pub enum K { | ||
| 34 | 32 | DownloadAll, |
| 35 | 33 | Download, |
| 36 | 34 | ConfigWarnings, |
| 37 | - ConfigWarningsHint, | |
| 38 | 35 | CiNoticeNoFailed, |
| 39 | 36 | CiNoticeNotDone, |
| 40 | 37 | CiNoticeTooBig, |
| 41 | 38 | CiNoticeOverwritten, |
| 42 | - CiCommitOverwritten, | |
| 43 | 39 | LogSearch, |
| 44 | 40 | LogPrev, |
| 45 | 41 | LogNext, |
| @@ -48,7 +44,6 @@ pub enum K { | ||
| 48 | 44 | LogExpandAll, |
| 49 | 45 | Runs, |
| 50 | 46 | NoRunsYet, |
| 51 | - NoRunsHint, | |
| 52 | 47 | TriggerScheduled, |
| 53 | 48 | NextScheduledRun, |
| 54 | 49 | NoJobs, |
| @@ -76,7 +71,6 @@ pub enum K { | ||
| 76 | 71 | |
| 77 | 72 | // CI status badge, on the run list. |
| 78 | 73 | BadgeHeading, |
| 79 | - BadgeHelp, | |
| 80 | 74 | BadgeSnippet, |
| 81 | 75 | |
| 82 | 76 | // CI state words. |
| @@ -94,8 +88,6 @@ pub enum K { | ||
| 94 | 88 | StoppingButton, |
| 95 | 89 | |
| 96 | 90 | // The failure block at the top of a failed run. |
| 97 | - FailHeading, | |
| 98 | - FailLine, | |
| 99 | 91 | FailOpenLog, |
| 100 | 92 | FailNoLog, |
| 101 | 93 | FailNoError, |
| @@ -123,7 +115,6 @@ pub enum K { | ||
| 123 | 115 | NewRelease, |
| 124 | 116 | EditRelease, |
| 125 | 117 | SaveRelease, |
| 126 | - TagHint, | |
| 127 | 118 | Tag, |
| 128 | 119 | TargetBranch, |
| 129 | 120 | Title, |
| @@ -146,13 +137,8 @@ pub enum K { | ||
| 146 | 137 | DeleteRelease, |
| 147 | 138 | BackToRelease, |
| 148 | 139 | UploadAsset, |
| 149 | - DeleteReleaseHelp, | |
| 150 | - YesDeleteRelease, | |
| 151 | - EditTagHelp, | |
| 152 | 140 | EditTargetLabel, |
| 153 | 141 | CurrentCommit, |
| 154 | - TargetMoveHelp, | |
| 155 | - TargetLockedHelp, | |
| 156 | 142 | ReplaceAsset, |
| 157 | 143 | |
| 158 | 144 | // CI time estimate: a running run past its expected total. |
| @@ -163,8 +149,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 163 | 149 | use K::*; |
| 164 | 150 | use Lang::*; |
| 165 | 151 | match (key, lang) { |
| 166 | - (LatestReleaseHeading, En) => "Latest release", | |
| 167 | - (LatestReleaseHeading, Tr) => "Son sürüm", | |
| 168 | 152 | (CiNoticeStarted, En) => "Workflow run queued.", |
| 169 | 153 | (CiNoticeStarted, Tr) => "İş akışı çalıştırması sıraya alındı.", |
| 170 | 154 | (CiNoticeCancelled, En) => { |
| @@ -192,12 +176,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 192 | 176 | |
| 193 | 177 | (RunWorkflow, En) => "Run workflow", |
| 194 | 178 | (RunWorkflow, Tr) => "İş akışını çalıştır", |
| 195 | - (RunWorkflowHelp, En) => { | |
| 196 | - "Starts the workflow on a branch's head, if its .forge/ci.toml allows manual runs." | |
| 197 | - } | |
| 198 | - (RunWorkflowHelp, Tr) => { | |
| 199 | - "Bir dalın ucundaki iş akışını başlatır; .forge/ci.toml dosyası elle çalıştırmaya izin veriyorsa." | |
| 200 | - } | |
| 201 | 179 | (Branch, En) => "Branch", |
| 202 | 180 | (Branch, Tr) => "Dal", |
| 203 | 181 | (ApproveAndRun, En) => "Approve and run", |
| @@ -216,12 +194,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 216 | 194 | (Download, Tr) => "İndir", |
| 217 | 195 | (ConfigWarnings, En) => "Config warnings", |
| 218 | 196 | (ConfigWarnings, Tr) => "Yapılandırma uyarıları", |
| 219 | - (ConfigWarningsHint, En) => { | |
| 220 | - "These keys of .forge/ci.toml were ignored, so they have no effect on this run." | |
| 221 | - } | |
| 222 | - (ConfigWarningsHint, Tr) => { | |
| 223 | - "Bu .forge/ci.toml anahtarları yok sayıldı, bu çalıştırmayı etkilemiyor." | |
| 224 | - } | |
| 225 | 197 | (CiNoticeNoFailed, En) => "This run has no failed or cancelled jobs to run again.", |
| 226 | 198 | (CiNoticeNoFailed, Tr) => { |
| 227 | 199 | "Bu çalıştırmada yeniden çalıştırılacak başarısız ya da iptal edilmiş iş yok." |
| @@ -238,8 +210,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 238 | 210 | (CiNoticeOverwritten, Tr) => { |
| 239 | 211 | "Bu commit'in üzerine yazıldı, bu yüzden yeniden çalıştırılamaz." |
| 240 | 212 | } |
| 241 | - (CiCommitOverwritten, En) => "This commit was overwritten by a force push.", | |
| 242 | - (CiCommitOverwritten, Tr) => "Bu commit'in üzerine yazıldı.", | |
| 243 | 213 | (LogSearch, En) => "Search the log", |
| 244 | 214 | (LogSearch, Tr) => "Günlükte ara", |
| 245 | 215 | (LogPrev, En) => "Previous match", |
| @@ -258,10 +228,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 258 | 228 | (Runs, Tr) => "Çalıştırmalar", |
| 259 | 229 | (NoRunsYet, En) => "No runs yet.", |
| 260 | 230 | (NoRunsYet, Tr) => "Henüz çalıştırma yok.", |
| 261 | - (NoRunsHint, En) => "Add a .forge/ci.toml to the repo, then push a commit or start a run.", | |
| 262 | - (NoRunsHint, Tr) => { | |
| 263 | - ".forge/ci.toml dosyası ekleyin, ardından bir commit gönderin ya da bir çalıştırma başlatın." | |
| 264 | - } | |
| 265 | 231 | (TriggerScheduled, En) => "scheduled", |
| 266 | 232 | (TriggerScheduled, Tr) => "zamanlanmış", |
| 267 | 233 | (NextScheduledRun, En) => "Next scheduled run", |
| @@ -296,22 +262,16 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 296 | 262 | (CopyDone, Tr) => "Kopyalandı", |
| 297 | 263 | (CopyFailed, En) => "Copy failed", |
| 298 | 264 | (CopyFailed, Tr) => "Kopyalanamadı", |
| 299 | - (FailHeading, En) => "Failed job", | |
| 300 | - (FailHeading, Tr) => "Başarısız iş", | |
| 301 | - (FailLine, En) => "line", | |
| 302 | - (FailLine, Tr) => "satır", | |
| 303 | 265 | (FailOpenLog, En) => "Open in full log", |
| 304 | 266 | (FailOpenLog, Tr) => "Tam günlükte aç", |
| 305 | - (FailNoLog, En) => "This job wrote no log.", | |
| 306 | - (FailNoLog, Tr) => "Bu iş günlük yazmadı.", | |
| 307 | - (FailNoError, En) => "No error line found. The last lines of the log are shown.", | |
| 308 | - (FailNoError, Tr) => "Hata satırı bulunamadı. Günlüğün son satırları gösteriliyor.", | |
| 267 | + (FailNoLog, En) => "No log.", | |
| 268 | + (FailNoLog, Tr) => "Günlük yok.", | |
| 269 | + (FailNoError, En) => "No error line.", | |
| 270 | + (FailNoError, Tr) => "Hata satırı yok.", | |
| 309 | 271 | (Duration, En) => "Duration", |
| 310 | 272 | (Duration, Tr) => "Süre", |
| 311 | - (LogTruncated, En) => "Showing the last 512 KiB of the log. The full log is linked above.", | |
| 312 | - (LogTruncated, Tr) => { | |
| 313 | - "Günlüğün son 512 KiB'ı gösteriliyor. Tam günlük yukarıda bağlantılı." | |
| 314 | - } | |
| 273 | + (LogTruncated, En) => "Showing the last 512 KiB.", | |
| 274 | + (LogTruncated, Tr) => "Günlüğün son 512 KiB'ı gösteriliyor.", | |
| 315 | 275 | (Artifacts, En) => "Artifacts", |
| 316 | 276 | (Artifacts, Tr) => "Yapıtlar", |
| 317 | 277 | (Timeline, En) => "Timeline", |
| @@ -322,14 +282,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 322 | 282 | (ExpandAll, Tr) => "Tümünü aç", |
| 323 | 283 | (CollapseAll, En) => "Collapse all", |
| 324 | 284 | (CollapseAll, Tr) => "Tümünü kapat", |
| 325 | - (BadgeHeading, En) => "Status badge", | |
| 326 | - (BadgeHeading, Tr) => "Durum rozeti", | |
| 327 | - (BadgeHelp, En) => { | |
| 328 | - "Embed this image in a README to show the newest run on the branch. It refreshes on every load." | |
| 329 | - } | |
| 330 | - (BadgeHelp, Tr) => { | |
| 331 | - "Bu resmi bir README'ye ekleyin; dalın en son çalıştırmasını gösterir. Her yüklemede yenilenir." | |
| 332 | - } | |
| 285 | + (BadgeHeading, En) => "Badge", | |
| 286 | + (BadgeHeading, Tr) => "Rozet", | |
| 333 | 287 | (BadgeSnippet, En) => "Markdown", |
| 334 | 288 | (BadgeSnippet, Tr) => "Markdown", |
| 335 | 289 | |
| @@ -420,12 +374,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 420 | 374 | (EditRelease, Tr) => "Sürümü düzenle", |
| 421 | 375 | (SaveRelease, En) => "Save release", |
| 422 | 376 | (SaveRelease, Tr) => "Sürümü kaydet", |
| 423 | - (TagHint, En) => { | |
| 424 | - "Use letters, digits, and . _ - +. Slashes are not allowed. If the tag does not exist yet, it is created at the head of the branch you choose." | |
| 425 | - } | |
| 426 | - (TagHint, Tr) => { | |
| 427 | - "Harf, rakam ve . _ - + kullanın; eğik çizgi kullanılamaz. Etiket yoksa, seçtiğiniz dalın ucunda oluşturulur." | |
| 428 | - } | |
| 429 | 377 | (Tag, En) => "Tag", |
| 430 | 378 | (Tag, Tr) => "Etiket", |
| 431 | 379 | (TargetBranch, En) => "Target branch", |
| @@ -470,30 +418,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 470 | 418 | (BackToRelease, Tr) => "Sürüme dön", |
| 471 | 419 | (UploadAsset, En) => "Upload asset", |
| 472 | 420 | (UploadAsset, Tr) => "Dosya yükle", |
| 473 | - (DeleteReleaseHelp, En) => { | |
| 474 | - "Deleting removes the release and its assets. The git tag is kept." | |
| 475 | - } | |
| 476 | - (DeleteReleaseHelp, Tr) => "Sürümü ve dosyalarını siler. Git etiketi korunur.", | |
| 477 | - (YesDeleteRelease, En) => "Yes, delete this release", | |
| 478 | - (YesDeleteRelease, Tr) => "Evet, bu sürümü sil", | |
| 479 | - (EditTagHelp, En) => { | |
| 480 | - "Enter a new name to create the tag at the target you pick, or at the current commit. Enter an existing tag name to adopt it; if you also pick a target, it must be that tag's commit." | |
| 481 | - } | |
| 482 | - (EditTagHelp, Tr) => { | |
| 483 | - "Yeni bir ad girerek etiketi seçtiğiniz dalda ya da mevcut commit'te oluşturun. Var olan bir etiket adı girerseniz o etiket kullanılır; hedef de seçtiyseniz o etiketin commit'i olmalıdır." | |
| 484 | - } | |
| 485 | 421 | (EditTargetLabel, En) => "Move tag to branch (optional)", |
| 486 | 422 | (EditTargetLabel, Tr) => "Etiketi dala taşı (isteğe bağlı)", |
| 487 | 423 | (CurrentCommit, En) => "Keep the current commit", |
| 488 | 424 | (CurrentCommit, Tr) => "Mevcut commit'i koru", |
| 489 | - (TargetMoveHelp, En) => "The tag can only move while the release is a draft.", | |
| 490 | - (TargetMoveHelp, Tr) => "Etiket yalnızca sürüm taslakken taşınabilir.", | |
| 491 | - (TargetLockedHelp, En) => { | |
| 492 | - "Published releases keep their commit. To point at another commit, enter a new tag." | |
| 493 | - } | |
| 494 | - (TargetLockedHelp, Tr) => { | |
| 495 | - "Yayımlanmış sürümler commit'lerini korur. Başka bir commit'i göstermek için yeni bir etiket girin." | |
| 496 | - } | |
| 497 | 425 | (ReplaceAsset, En) => "Replace", |
| 498 | 426 | (ReplaceAsset, Tr) => "Değiştir", |
| 499 | 427 | (TakingLonger, En) => "taking longer than usual", |
| @@ -525,14 +453,6 @@ pub fn page_label(lang: Lang, page: u32) -> String { | ||
| 525 | 453 | } |
| 526 | 454 | } |
| 527 | 455 | |
| 528 | -/// "scale: 0 to 80 min", the scale of the run list in minutes. | |
| 529 | -pub fn scale_label(lang: Lang, span: &str) -> String { | |
| 530 | - match lang { | |
| 531 | - Lang::En => format!("scale: 0 to {span}"), | |
| 532 | - Lang::Tr => format!("ölçek: 0 ile {span} arası"), | |
| 533 | - } | |
| 534 | -} | |
| 535 | - | |
| 536 | 456 | /// "needs test", for the names of the jobs a job needs. |
| 537 | 457 | pub fn needs_label(lang: Lang, names: &str) -> String { |
| 538 | 458 | match lang { |
| @@ -607,7 +527,6 @@ mod tests { | ||
| 607 | 527 | use super::*; |
| 608 | 528 | |
| 609 | 529 | const ALL: &[K] = &[ |
| 610 | - K::LatestReleaseHeading, | |
| 611 | 530 | K::CiNoticeStarted, |
| 612 | 531 | K::CiNoticeCancelled, |
| 613 | 532 | K::CiNoticeApproved, |
| @@ -617,7 +536,6 @@ mod tests { | ||
| 617 | 536 | K::CiNoticeNoBranch, |
| 618 | 537 | K::CiNoticeNoManual, |
| 619 | 538 | K::RunWorkflow, |
| 620 | - K::RunWorkflowHelp, | |
| 621 | 539 | K::Branch, |
| 622 | 540 | K::ApproveAndRun, |
| 623 | 541 | K::Cancel, |
| @@ -628,12 +546,10 @@ mod tests { | ||
| 628 | 546 | K::DownloadAll, |
| 629 | 547 | K::Download, |
| 630 | 548 | K::ConfigWarnings, |
| 631 | - K::ConfigWarningsHint, | |
| 632 | 549 | K::CiNoticeNoFailed, |
| 633 | 550 | K::CiNoticeNotDone, |
| 634 | 551 | K::CiNoticeTooBig, |
| 635 | 552 | K::CiNoticeOverwritten, |
| 636 | - K::CiCommitOverwritten, | |
| 637 | 553 | K::LogSearch, |
| 638 | 554 | K::LogPrev, |
| 639 | 555 | K::LogNext, |
| @@ -642,7 +558,6 @@ mod tests { | ||
| 642 | 558 | K::LogExpandAll, |
| 643 | 559 | K::Runs, |
| 644 | 560 | K::NoRunsYet, |
| 645 | - K::NoRunsHint, | |
| 646 | 561 | K::TriggerScheduled, |
| 647 | 562 | K::NextScheduledRun, |
| 648 | 563 | K::Jobs, |
| @@ -668,7 +583,6 @@ mod tests { | ||
| 668 | 583 | K::ExpandAll, |
| 669 | 584 | K::CollapseAll, |
| 670 | 585 | K::BadgeHeading, |
| 671 | - K::BadgeHelp, | |
| 672 | 586 | K::BadgeSnippet, |
| 673 | 587 | K::StateWaitingApproval, |
| 674 | 588 | K::StateQueued, |
| @@ -681,8 +595,6 @@ mod tests { | ||
| 681 | 595 | K::StateSkipped, |
| 682 | 596 | K::StateStopping, |
| 683 | 597 | K::StoppingButton, |
| 684 | - K::FailHeading, | |
| 685 | - K::FailLine, | |
| 686 | 598 | K::FailOpenLog, |
| 687 | 599 | K::FailNoLog, |
| 688 | 600 | K::FailNoError, |
| @@ -704,7 +616,6 @@ mod tests { | ||
| 704 | 616 | K::NewRelease, |
| 705 | 617 | K::EditRelease, |
| 706 | 618 | K::SaveRelease, |
| 707 | - K::TagHint, | |
| 708 | 619 | K::Tag, |
| 709 | 620 | K::TargetBranch, |
| 710 | 621 | K::Title, |
| @@ -727,13 +638,8 @@ mod tests { | ||
| 727 | 638 | K::DeleteRelease, |
| 728 | 639 | K::BackToRelease, |
| 729 | 640 | K::UploadAsset, |
| 730 | - K::DeleteReleaseHelp, | |
| 731 | - K::YesDeleteRelease, | |
| 732 | - K::EditTagHelp, | |
| 733 | 641 | K::EditTargetLabel, |
| 734 | 642 | K::CurrentCommit, |
| 735 | - K::TargetMoveHelp, | |
| 736 | - K::TargetLockedHelp, | |
| 737 | 643 | K::ReplaceAsset, |
| 738 | 644 | K::TakingLonger, |
| 739 | 645 | ]; |
crates/forge-web-base/src/i18n/repo_admin.rsmodified+14 -182
| @@ -7,18 +7,14 @@ pub enum K { | ||
| 7 | 7 | Accept, |
| 8 | 8 | AcceptTransfer, |
| 9 | 9 | AddCollaboratorButton, |
| 10 | - AddCollaboratorHeading, | |
| 11 | - AddCollaboratorHelp, | |
| 12 | 10 | AddOrUpdate, |
| 13 | 11 | AllowDeletion, |
| 14 | 12 | AllowForcePush, |
| 15 | 13 | AlreadyOwner, |
| 16 | 14 | ApprovalsRange, |
| 17 | 15 | ArchiveHeading, |
| 18 | - ArchiveHelp, | |
| 19 | 16 | ArchiveConfirm, |
| 20 | 17 | ArchiveRepo, |
| 21 | - ArchivedHelp, | |
| 22 | 18 | ArchivedSecrets, |
| 23 | 19 | Cancel, |
| 24 | 20 | BadForm, |
| @@ -26,7 +22,6 @@ pub enum K { | ||
| 26 | 22 | BranchMissing, |
| 27 | 23 | BranchPattern, |
| 28 | 24 | BranchProtection, |
| 29 | - BranchProtectionHelp, | |
| 30 | 25 | BranchRuleRemoved, |
| 31 | 26 | BranchRuleSaved, |
| 32 | 27 | BuiltinRowText, |
| @@ -36,8 +31,6 @@ pub enum K { | ||
| 36 | 31 | CollabAdded, |
| 37 | 32 | CollabRemoved, |
| 38 | 33 | Collaborators, |
| 39 | - CollaboratorsHelp, | |
| 40 | - ColUser, | |
| 41 | 34 | DangerZone, |
| 42 | 35 | Decline, |
| 43 | 36 | DeclineTransfer, |
| @@ -45,11 +38,8 @@ pub enum K { | ||
| 45 | 38 | DefaultBranchFailed, |
| 46 | 39 | Delete, |
| 47 | 40 | DeleteRepo, |
| 48 | - DeleteRepoHelp, | |
| 49 | - DeleteTrashHelp, | |
| 50 | 41 | DeletionAllowed, |
| 51 | 42 | Description, |
| 52 | - DescriptionHelp, | |
| 53 | 43 | DescriptionLong, |
| 54 | 44 | EditRule, |
| 55 | 45 | EnterUsername, |
| @@ -60,7 +50,6 @@ pub enum K { | ||
| 60 | 50 | MakePublic, |
| 61 | 51 | MakePublicConfirm, |
| 62 | 52 | InvalidRole, |
| 63 | - LastUpdated, | |
| 64 | 53 | Mirrors, |
| 65 | 54 | Name, |
| 66 | 55 | NameRule, |
| @@ -69,19 +58,14 @@ pub enum K { | ||
| 69 | 58 | AddRule, |
| 70 | 59 | NoBranchesYet, |
| 71 | 60 | NoCollaborators, |
| 72 | - NoPendingTransfer, | |
| 73 | 61 | NoSecrets, |
| 74 | 62 | NotCollaborator, |
| 75 | 63 | OwnerIsMember, |
| 76 | - PatternHelp, | |
| 77 | - PendingTransfers, | |
| 78 | 64 | PrivateOption, |
| 79 | 65 | PublicOption, |
| 80 | 66 | Remove, |
| 81 | 67 | RemoveRule, |
| 82 | - RenameHelp, | |
| 83 | 68 | RenameRepo, |
| 84 | - RenameTransferNav, | |
| 85 | 69 | RenamedNotice, |
| 86 | 70 | RepoArchived, |
| 87 | 71 | RepoDeletedAfter, |
| @@ -92,13 +76,8 @@ pub enum K { | ||
| 92 | 76 | RequiredApprovals, |
| 93 | 77 | RestrictPushTitle, |
| 94 | 78 | Role, |
| 95 | - RoleAdminDesc, | |
| 96 | - RoleMaintainDesc, | |
| 97 | - RoleReadDesc, | |
| 98 | 79 | Roles, |
| 99 | - RoleTriageDesc, | |
| 100 | 80 | RoleUpdated, |
| 101 | - RoleWriteDesc, | |
| 102 | 81 | RequiredChecks, |
| 103 | 82 | RecentContexts, |
| 104 | 83 | RuleChangesShort, |
| @@ -107,21 +86,15 @@ pub enum K { | ||
| 107 | 86 | RuleUpToDateShort, |
| 108 | 87 | SaveGeneral, |
| 109 | 88 | SaveRole, |
| 110 | - SaveRule, | |
| 111 | 89 | SaveSecret, |
| 112 | 90 | SecretDeleted, |
| 113 | - SecretLimits, | |
| 114 | 91 | SecretMissing, |
| 115 | 92 | SecretSaved, |
| 116 | 93 | Secrets, |
| 117 | - SecretsHelp, | |
| 118 | 94 | SectionChecks, |
| 119 | 95 | SectionPullRequests, |
| 120 | - SectionPattern, | |
| 121 | 96 | SectionPushes, |
| 122 | 97 | SettingsNavLabel, |
| 123 | - StartTransferLink, | |
| 124 | - TransferHelp, | |
| 125 | 98 | TransferRepo, |
| 126 | 99 | TransferTitle, |
| 127 | 100 | TransferredNotice, |
| @@ -137,6 +110,8 @@ pub enum K { | ||
| 137 | 110 | VisibilityHeading, |
| 138 | 111 | MakePrivateConfirm, |
| 139 | 112 | Webhooks, |
| 113 | + Features, | |
| 114 | + RenameHeading, | |
| 140 | 115 | } |
| 141 | 116 | |
| 142 | 117 | pub fn t(lang: Lang, key: K) -> &'static str { |
| @@ -149,14 +124,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 149 | 124 | (AcceptTransfer, Tr) => "Devri kabul et", |
| 150 | 125 | (AddCollaboratorButton, En) => "Add collaborator", |
| 151 | 126 | (AddCollaboratorButton, Tr) => "Ortak çalışan ekle", |
| 152 | - (AddCollaboratorHeading, En) => "Add a collaborator", | |
| 153 | - (AddCollaboratorHeading, Tr) => "Ortak çalışan ekle", | |
| 154 | - (AddCollaboratorHelp, En) => { | |
| 155 | - "Adding a user who is already a collaborator updates their role. The owner cannot be added." | |
| 156 | - } | |
| 157 | - (AddCollaboratorHelp, Tr) => { | |
| 158 | - "Zaten ortak çalışan olan bir kullanıcıyı eklemek rolünü günceller. Sahip eklenemez." | |
| 159 | - } | |
| 160 | 127 | (AddOrUpdate, En) => "Add or update a secret", |
| 161 | 128 | (AddOrUpdate, Tr) => "Gizli anahtar ekle veya güncelle", |
| 162 | 129 | (AllowDeletion, En) => "Deleting the branch", |
| @@ -169,24 +136,12 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 169 | 136 | (ApprovalsRange, Tr) => "Gerekli onay sayısı 0 ile 20 arasında bir tam sayı olmalıdır.", |
| 170 | 137 | (ArchiveHeading, En) => "Archive", |
| 171 | 138 | (ArchiveHeading, Tr) => "Arşiv", |
| 172 | - (ArchiveHelp, En) => { | |
| 173 | - "Archiving makes the repository read-only: pushes are refused, and issues, labels and milestones cannot change. You can unarchive it at any time." | |
| 174 | - } | |
| 175 | - (ArchiveHelp, Tr) => { | |
| 176 | - "Arşivleme depoyu salt okunur yapar: gönderimler reddedilir; sorunlar, etiketler ve kilometre taşları değiştirilemez. Arşivden istediğiniz zaman çıkarabilirsiniz." | |
| 177 | - } | |
| 178 | - (ArchiveConfirm, En) => "Archive this repository? You can unarchive it at any time.", | |
| 179 | - (ArchiveConfirm, Tr) => "Depo arşivlensin mi? İstediğiniz zaman arşivden çıkarabilirsiniz.", | |
| 139 | + (ArchiveConfirm, En) => "Archive this repository?", | |
| 140 | + (ArchiveConfirm, Tr) => "Depo arşivlensin mi?", | |
| 180 | 141 | (Cancel, En) => "Cancel", |
| 181 | 142 | (Cancel, Tr) => "Vazgeç", |
| 182 | 143 | (ArchiveRepo, En) => "Archive repository", |
| 183 | 144 | (ArchiveRepo, Tr) => "Depoyu arşivle", |
| 184 | - (ArchivedHelp, En) => { | |
| 185 | - "This repository is archived. Pushes are refused, and issues, labels and milestones are read-only. Unarchive it to allow changes again." | |
| 186 | - } | |
| 187 | - (ArchivedHelp, Tr) => { | |
| 188 | - "Bu depo arşivlenmiş. Gönderimler reddedilir; sorunlar, etiketler ve kilometre taşları salt okunurdur. Yeniden değişiklik yapmak için arşivden çıkarın." | |
| 189 | - } | |
| 190 | 145 | (ArchivedSecrets, En) => "This repository is archived. Secrets are read-only.", |
| 191 | 146 | (ArchivedSecrets, Tr) => "Bu depo arşivlenmiş. Gizli anahtarlar salt okunurdur.", |
| 192 | 147 | (BadForm, En) => "The form was not understood. Nothing was changed.", |
| @@ -199,12 +154,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 199 | 154 | (BranchPattern, Tr) => "Dal", |
| 200 | 155 | (BranchProtection, En) => "Branch protection", |
| 201 | 156 | (BranchProtection, Tr) => "Dal koruması", |
| 202 | - (BranchProtectionHelp, En) => { | |
| 203 | - "A push to a protected branch is checked against its rule before it is accepted." | |
| 204 | - } | |
| 205 | - (BranchProtectionHelp, Tr) => { | |
| 206 | - "Korumalı bir dala yapılan gönderim, kabul edilmeden önce kuralına göre denetlenir." | |
| 207 | - } | |
| 208 | 157 | (BranchRuleRemoved, En) => "Branch rule removed.", |
| 209 | 158 | (BranchRuleRemoved, Tr) => "Dal kuralı kaldırıldı.", |
| 210 | 159 | (BranchRuleSaved, En) => "Branch rule saved.", |
| @@ -223,14 +172,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 223 | 172 | (CollabRemoved, Tr) => "Ortak çalışan kaldırıldı.", |
| 224 | 173 | (Collaborators, En) => "Collaborators", |
| 225 | 174 | (Collaborators, Tr) => "Ortak çalışanlar", |
| 226 | - (CollaboratorsHelp, En) => { | |
| 227 | - "Collaborators get access to this repo beyond its visibility. On a private repo, adding a collaborator makes it visible to them." | |
| 228 | - } | |
| 229 | - (CollaboratorsHelp, Tr) => { | |
| 230 | - "Ortak çalışanlar, deponun görünürlüğünden bağımsız olarak bu depoya erişim alır. Özel bir depoda ortak çalışan eklemek depoyu onlara görünür kılar." | |
| 231 | - } | |
| 232 | - (ColUser, En) => "User", | |
| 233 | - (ColUser, Tr) => "Kullanıcı", | |
| 234 | 175 | (DangerZone, En) => "Danger zone", |
| 235 | 176 | (DangerZone, Tr) => "Tehlikeli bölge", |
| 236 | 177 | (Decline, En) => "Decline", |
| @@ -245,28 +186,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 245 | 186 | (Delete, Tr) => "Sil", |
| 246 | 187 | (DeleteRepo, En) => "Delete repository", |
| 247 | 188 | (DeleteRepo, Tr) => "Depoyu sil", |
| 248 | - (DeleteRepoHelp, En) => { | |
| 249 | - "Deleting a repository removes it from the forge. Its branches, tags, collaborators and push history stop being served." | |
| 250 | - } | |
| 251 | - (DeleteRepoHelp, Tr) => { | |
| 252 | - "Bir depoyu silmek onu forge üzerinden kaldırır. Dalları, etiketleri, ortak çalışanları ve gönderim geçmişi artık sunulmaz." | |
| 253 | - } | |
| 254 | - (DeleteTrashHelp, En) => { | |
| 255 | - "The bare repository is moved to the instance trash, not erased. Until an administrator purges it, it can be recovered by cloning from the trash directory." | |
| 256 | - } | |
| 257 | - (DeleteTrashHelp, Tr) => { | |
| 258 | - "Çıplak depo silinmez, sunucunun çöp klasörüne taşınır. Bir yönetici kalıcı olarak temizleyene kadar çöp klasöründen klonlanarak kurtarılabilir." | |
| 259 | - } | |
| 260 | 189 | (DeletionAllowed, En) => "Deletion allowed", |
| 261 | 190 | (DeletionAllowed, Tr) => "Silmeye izin var", |
| 262 | 191 | (Description, En) => "Description", |
| 263 | 192 | (Description, Tr) => "Açıklama", |
| 264 | - (DescriptionHelp, En) => { | |
| 265 | - "Up to 350 characters, on one line. It is shown under the repository name." | |
| 266 | - } | |
| 267 | - (DescriptionHelp, Tr) => { | |
| 268 | - "En fazla 350 karakter, tek satır. Depo adının altında gösterilir." | |
| 269 | - } | |
| 270 | 193 | (DescriptionLong, En) => { |
| 271 | 194 | "The description can be at most 350 characters. Nothing was saved." |
| 272 | 195 | } |
| @@ -287,16 +210,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 287 | 210 | (GeneralSaved, Tr) => "Genel ayarlar kaydedildi.", |
| 288 | 211 | (MakePublic, En) => "Make public", |
| 289 | 212 | (MakePublic, Tr) => "Herkese açık yap", |
| 290 | - (MakePublicConfirm, En) => { | |
| 291 | - "Make it public? Anyone will be able to read its code, issues and pull requests. It takes effect at once." | |
| 292 | - } | |
| 293 | - (MakePublicConfirm, Tr) => { | |
| 294 | - "Herkese açık yapılsın mı? Kodunu, sorunlarını ve çekme isteklerini herkes okuyabilir. Hemen geçerli olur." | |
| 295 | - } | |
| 213 | + (MakePublicConfirm, En) => "Make it public?", | |
| 214 | + (MakePublicConfirm, Tr) => "Herkese açık yapılsın mı?", | |
| 296 | 215 | (InvalidRole, En) => "Choose a valid role.", |
| 297 | 216 | (InvalidRole, Tr) => "Geçerli bir rol seçin.", |
| 298 | - (LastUpdated, En) => "Last updated", | |
| 299 | - (LastUpdated, Tr) => "Son güncelleme", | |
| 300 | 217 | (Mirrors, En) => "Mirrors", |
| 301 | 218 | (Mirrors, Tr) => "Yansılar", |
| 302 | 219 | (Name, En) => "Name", |
| @@ -319,8 +236,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 319 | 236 | (NoBranchesYet, Tr) => "Henüz dal yok. Varsayılan dal, ilk gönderimden sonra seçilebilir.", |
| 320 | 237 | (NoCollaborators, En) => "No collaborators yet.", |
| 321 | 238 | (NoCollaborators, Tr) => "Henüz ortak çalışan yok.", |
| 322 | - (NoPendingTransfer, En) => "No transfer is pending for this repository.", | |
| 323 | - (NoPendingTransfer, Tr) => "Bu depo için bekleyen bir devir yok.", | |
| 324 | 239 | (NoSecrets, En) => "No secrets yet.", |
| 325 | 240 | (NoSecrets, Tr) => "Henüz gizli anahtar yok.", |
| 326 | 241 | (NotCollaborator, En) => "That user is not a collaborator on this repo.", |
| @@ -331,10 +246,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 331 | 246 | (OwnerIsMember, Tr) => { |
| 332 | 247 | "Depo sahibi zaten tam erişimli bir üyedir ve ortak çalışan olarak eklenemez." |
| 333 | 248 | } |
| 334 | - (PatternHelp, En) => "A name, or * and ** patterns.", | |
| 335 | - (PatternHelp, Tr) => "Bir ad veya * ve ** desenleri.", | |
| 336 | - (PendingTransfers, En) => "Pending transfers", | |
| 337 | - (PendingTransfers, Tr) => "Bekleyen devirler", | |
| 338 | 249 | (PrivateOption, En) => { |
| 339 | 250 | "Private: only its owner, collaborators and instance admins can see it. Others get a 404." |
| 340 | 251 | } |
| @@ -347,16 +258,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 347 | 258 | (Remove, Tr) => "Kaldır", |
| 348 | 259 | (RemoveRule, En) => "Remove rule", |
| 349 | 260 | (RemoveRule, Tr) => "Kuralı kaldır", |
| 350 | - (RenameHelp, En) => { | |
| 351 | - "Letters, digits, '.', '_' and '-'. The old name keeps working: its web and clone URLs redirect to the new name." | |
| 352 | - } | |
| 353 | - (RenameHelp, Tr) => { | |
| 354 | - "Harfler, rakamlar, '.', '_' ve '-' kullanılabilir. Eski ad çalışmaya devam eder: web ve klonlama adresleri yeni ada yönlendirilir." | |
| 355 | - } | |
| 356 | 261 | (RenameRepo, En) => "Rename repository", |
| 357 | 262 | (RenameRepo, Tr) => "Depoyu yeniden adlandır", |
| 358 | - (RenameTransferNav, En) => "Rename & transfer", | |
| 359 | - (RenameTransferNav, Tr) => "Yeniden adlandır ve devret", | |
| 360 | 263 | (RenamedNotice, En) => "Repository renamed. The old name redirects to the new one.", |
| 361 | 264 | (RenamedNotice, Tr) => "Depo yeniden adlandırıldı. Eski ad yeni ada yönlendirir.", |
| 362 | 265 | (RepoArchived, En) => "Repository archived.", |
| @@ -377,20 +280,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 377 | 280 | (Role, En) => "Role", |
| 378 | 281 | (RestrictPushTitle, Tr) => "Yalnızca çekme istekleri üzerinden", |
| 379 | 282 | (Role, Tr) => "Rol", |
| 380 | - (RoleAdminDesc, En) => "full repo settings except delete and transfer", | |
| 381 | - (RoleAdminDesc, Tr) => "silme ve devir dışında tüm depo ayarları", | |
| 382 | - (RoleMaintainDesc, En) => "push and manage issues/settings without destructive actions", | |
| 383 | - (RoleMaintainDesc, Tr) => "yıkıcı işlemler dışında gönderme, sorunları ve ayarları yönetme", | |
| 384 | - (RoleReadDesc, En) => "view and clone", | |
| 385 | - (RoleReadDesc, Tr) => "görüntüleme ve klonlama", | |
| 386 | 283 | (Roles, En) => "Roles", |
| 387 | 284 | (Roles, Tr) => "Roller", |
| 388 | - (RoleTriageDesc, En) => "manage issues", | |
| 389 | - (RoleTriageDesc, Tr) => "sorunları yönetme", | |
| 390 | 285 | (RoleUpdated, En) => "Role updated.", |
| 391 | 286 | (RoleUpdated, Tr) => "Rol güncellendi.", |
| 392 | - (RoleWriteDesc, En) => "push", | |
| 393 | - (RoleWriteDesc, Tr) => "gönderme (push)", | |
| 394 | 287 | (RequiredChecks, En) => "Required status checks", |
| 395 | 288 | (RequiredChecks, Tr) => "Gerekli durum denetimleri", |
| 396 | 289 | (RecentContexts, En) => "Recently seen:", |
| @@ -407,44 +300,24 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 407 | 300 | (SaveGeneral, Tr) => "Genel ayarları kaydet", |
| 408 | 301 | (SaveRole, En) => "Save", |
| 409 | 302 | (SaveRole, Tr) => "Kaydet", |
| 410 | - (SaveRule, En) => "Save rule", | |
| 411 | - (SaveRule, Tr) => "Kuralı kaydet", | |
| 412 | 303 | (SaveSecret, En) => "Save secret", |
| 413 | 304 | (SaveSecret, Tr) => "Gizli anahtarı kaydet", |
| 414 | 305 | (SecretDeleted, En) => "Secret deleted.", |
| 415 | 306 | (SecretDeleted, Tr) => "Gizli anahtar silindi.", |
| 416 | - (SecretLimits, En) => "Up to 48 KiB. Names are capital letters, digits and underscores.", | |
| 417 | - (SecretLimits, Tr) => "En fazla 48 KiB. Adlar büyük harf, rakam ve alt çizgiden oluşur.", | |
| 418 | 307 | (SecretMissing, En) => "No secret has that name. Nothing was deleted.", |
| 419 | 308 | (SecretMissing, Tr) => "Bu adda bir gizli anahtar yok. Hiçbir şey silinmedi.", |
| 420 | 309 | (SecretSaved, En) => "Secret saved. Its value is not shown again.", |
| 421 | 310 | (SecretSaved, Tr) => "Gizli anahtar kaydedildi. Değeri bir daha gösterilmez.", |
| 422 | 311 | (Secrets, En) => "Secrets", |
| 423 | 312 | (Secrets, Tr) => "Gizli anahtarlar", |
| 424 | - (SecretsHelp, En) => { | |
| 425 | - "Secrets are passed to CI jobs of this repository as environment variables. Values are write-only: once saved, they cannot be read back, and updating a secret replaces its value." | |
| 426 | - } | |
| 427 | - (SecretsHelp, Tr) => { | |
| 428 | - "Gizli anahtarlar, bu deponun CI işlerine ortam değişkeni olarak aktarılır. Değerler yalnızca yazılabilir: kaydedildikten sonra geri okunamazlar ve bir gizli anahtarı güncellemek değerini değiştirir." | |
| 429 | - } | |
| 430 | 313 | (SectionChecks, En) => "Checks", |
| 431 | 314 | (SectionPullRequests, En) => "Pull requests", |
| 432 | - (SectionPattern, En) => "Pattern", | |
| 433 | 315 | (SectionPushes, En) => "Pushes", |
| 434 | 316 | (SettingsNavLabel, En) => "Settings", |
| 435 | 317 | (SectionChecks, Tr) => "Denetimler", |
| 436 | 318 | (SectionPullRequests, Tr) => "Çekme istekleri", |
| 437 | - (SectionPattern, Tr) => "Desen", | |
| 438 | 319 | (SectionPushes, Tr) => "Gönderimler", |
| 439 | 320 | (SettingsNavLabel, Tr) => "Ayarlar", |
| 440 | - (StartTransferLink, En) => "Start or change a transfer in the settings", | |
| 441 | - (StartTransferLink, Tr) => "Ayarlarda devir başlatın veya değiştirin", | |
| 442 | - (TransferHelp, En) => { | |
| 443 | - "Offers the repository to another user, or to an organization you own, keeping its name. The target has 7 days to accept; an instance admin's transfer happens at once. Collaborator rows stay, except the new owner's, which is removed. The old owner and name redirect to the new location. " | |
| 444 | - } | |
| 445 | - (TransferHelp, Tr) => { | |
| 446 | - "Depoyu, adını koruyarak başka bir kullanıcıya ya da sahibi olduğunuz bir kuruluşa devreder. Hedefin kabul etmesi için 7 günü vardır; sunucu yöneticisinin devri hemen gerçekleşir. Ortak çalışan kayıtları korunur, yalnızca yeni sahibinin kaydı kaldırılır. Eski sahibi ve adı yeni konuma yönlendirilir. " | |
| 447 | - } | |
| 448 | 321 | (TransferRepo, En) => "Transfer repository", |
| 449 | 322 | (TransferRepo, Tr) => "Depoyu devret", |
| 450 | 323 | (TransferTitle, En) => "Transfer", |
| @@ -473,30 +346,14 @@ pub fn t(lang: Lang, key: K) -> &'static str { | ||
| 473 | 346 | (VisibilityChanged, Tr) => "Görünürlük değiştirildi.", |
| 474 | 347 | (VisibilityHeading, En) => "Visibility", |
| 475 | 348 | (VisibilityHeading, Tr) => "Görünürlük", |
| 476 | - (MakePrivateConfirm, En) => { | |
| 477 | - "Make it private? Only its owner, collaborators and instance admins will see it; others get a 404. It takes effect at once." | |
| 478 | - } | |
| 479 | - (MakePrivateConfirm, Tr) => { | |
| 480 | - "Özel yapılsın mı? Yalnızca sahibi, ortak çalışanları ve sunucu yöneticileri görebilir; diğerleri 404 hatası alır. Hemen geçerli olur." | |
| 481 | - } | |
| 349 | + (MakePrivateConfirm, En) => "Make it private?", | |
| 350 | + (MakePrivateConfirm, Tr) => "Özel yapılsın mı?", | |
| 482 | 351 | (Webhooks, En) => "Webhooks", |
| 483 | 352 | (Webhooks, Tr) => "Web kancaları", |
| 484 | - } | |
| 485 | -} | |
| 486 | - | |
| 487 | -/// The page title of the rename and transfer page. | |
| 488 | -pub fn page_title(lang: Lang, title: &str) -> String { | |
| 489 | - match lang { | |
| 490 | - Lang::En => format!("{title} \u{b7} Rename or transfer"), | |
| 491 | - Lang::Tr => format!("{title} \u{b7} Yeniden adlandır veya devret"), | |
| 492 | - } | |
| 493 | -} | |
| 494 | - | |
| 495 | -/// The page title of the transfer status page. | |
| 496 | -pub fn transfer_page_title(lang: Lang, title: &str) -> String { | |
| 497 | - match lang { | |
| 498 | - Lang::En => format!("{title} \u{b7} Transfer"), | |
| 499 | - Lang::Tr => format!("{title} \u{b7} Devir"), | |
| 353 | + (Features, En) => "Features", | |
| 354 | + (Features, Tr) => "Özellikler", | |
| 355 | + (RenameHeading, En) => "Rename", | |
| 356 | + (RenameHeading, Tr) => "Yeniden adlandır", | |
| 500 | 357 | } |
| 501 | 358 | } |
| 502 | 359 | |
| @@ -633,18 +490,14 @@ mod tests { | ||
| 633 | 490 | K::Accept, |
| 634 | 491 | K::AcceptTransfer, |
| 635 | 492 | K::AddCollaboratorButton, |
| 636 | - K::AddCollaboratorHeading, | |
| 637 | - K::AddCollaboratorHelp, | |
| 638 | 493 | K::AddOrUpdate, |
| 639 | 494 | K::AllowDeletion, |
| 640 | 495 | K::AllowForcePush, |
| 641 | 496 | K::AlreadyOwner, |
| 642 | 497 | K::ApprovalsRange, |
| 643 | 498 | K::ArchiveHeading, |
| 644 | - K::ArchiveHelp, | |
| 645 | 499 | K::ArchiveConfirm, |
| 646 | 500 | K::ArchiveRepo, |
| 647 | - K::ArchivedHelp, | |
| 648 | 501 | K::ArchivedSecrets, |
| 649 | 502 | K::Cancel, |
| 650 | 503 | K::BadForm, |
| @@ -652,7 +505,6 @@ mod tests { | ||
| 652 | 505 | K::BranchMissing, |
| 653 | 506 | K::BranchPattern, |
| 654 | 507 | K::BranchProtection, |
| 655 | - K::BranchProtectionHelp, | |
| 656 | 508 | K::BranchRuleRemoved, |
| 657 | 509 | K::BranchRuleSaved, |
| 658 | 510 | K::BuiltinRowText, |
| @@ -662,8 +514,6 @@ mod tests { | ||
| 662 | 514 | K::CollabAdded, |
| 663 | 515 | K::CollabRemoved, |
| 664 | 516 | K::Collaborators, |
| 665 | - K::CollaboratorsHelp, | |
| 666 | - K::ColUser, | |
| 667 | 517 | K::DangerZone, |
| 668 | 518 | K::Decline, |
| 669 | 519 | K::DeclineTransfer, |
| @@ -671,11 +521,8 @@ mod tests { | ||
| 671 | 521 | K::DefaultBranchFailed, |
| 672 | 522 | K::Delete, |
| 673 | 523 | K::DeleteRepo, |
| 674 | - K::DeleteRepoHelp, | |
| 675 | - K::DeleteTrashHelp, | |
| 676 | 524 | K::DeletionAllowed, |
| 677 | 525 | K::Description, |
| 678 | - K::DescriptionHelp, | |
| 679 | 526 | K::DescriptionLong, |
| 680 | 527 | K::EditRule, |
| 681 | 528 | K::EnterUsername, |
| @@ -686,7 +533,6 @@ mod tests { | ||
| 686 | 533 | K::MakePublic, |
| 687 | 534 | K::MakePublicConfirm, |
| 688 | 535 | K::InvalidRole, |
| 689 | - K::LastUpdated, | |
| 690 | 536 | K::Mirrors, |
| 691 | 537 | K::Name, |
| 692 | 538 | K::NameRule, |
| @@ -695,19 +541,14 @@ mod tests { | ||
| 695 | 541 | K::AddRule, |
| 696 | 542 | K::NoBranchesYet, |
| 697 | 543 | K::NoCollaborators, |
| 698 | - K::NoPendingTransfer, | |
| 699 | 544 | K::NoSecrets, |
| 700 | 545 | K::NotCollaborator, |
| 701 | 546 | K::OwnerIsMember, |
| 702 | - K::PatternHelp, | |
| 703 | - K::PendingTransfers, | |
| 704 | 547 | K::PrivateOption, |
| 705 | 548 | K::PublicOption, |
| 706 | 549 | K::Remove, |
| 707 | 550 | K::RemoveRule, |
| 708 | - K::RenameHelp, | |
| 709 | 551 | K::RenameRepo, |
| 710 | - K::RenameTransferNav, | |
| 711 | 552 | K::RenamedNotice, |
| 712 | 553 | K::RepoArchived, |
| 713 | 554 | K::RepoDeletedAfter, |
| @@ -718,13 +559,8 @@ mod tests { | ||
| 718 | 559 | K::RequiredApprovals, |
| 719 | 560 | K::RestrictPushTitle, |
| 720 | 561 | K::Role, |
| 721 | - K::RoleAdminDesc, | |
| 722 | - K::RoleMaintainDesc, | |
| 723 | - K::RoleReadDesc, | |
| 724 | 562 | K::Roles, |
| 725 | - K::RoleTriageDesc, | |
| 726 | 563 | K::RoleUpdated, |
| 727 | - K::RoleWriteDesc, | |
| 728 | 564 | K::RequiredChecks, |
| 729 | 565 | K::RecentContexts, |
| 730 | 566 | K::RuleChangesShort, |
| @@ -733,21 +569,15 @@ mod tests { | ||
| 733 | 569 | K::RuleUpToDateShort, |
| 734 | 570 | K::SaveGeneral, |
| 735 | 571 | K::SaveRole, |
| 736 | - K::SaveRule, | |
| 737 | 572 | K::SaveSecret, |
| 738 | 573 | K::SecretDeleted, |
| 739 | - K::SecretLimits, | |
| 740 | 574 | K::SecretMissing, |
| 741 | 575 | K::SecretSaved, |
| 742 | 576 | K::Secrets, |
| 743 | - K::SecretsHelp, | |
| 744 | 577 | K::SectionChecks, |
| 745 | 578 | K::SectionPullRequests, |
| 746 | - K::SectionPattern, | |
| 747 | 579 | K::SectionPushes, |
| 748 | 580 | K::SettingsNavLabel, |
| 749 | - K::StartTransferLink, | |
| 750 | - K::TransferHelp, | |
| 751 | 581 | K::TransferRepo, |
| 752 | 582 | K::TransferTitle, |
| 753 | 583 | K::TransferredNotice, |
| @@ -763,6 +593,8 @@ mod tests { | ||
| 763 | 593 | K::VisibilityHeading, |
| 764 | 594 | K::MakePrivateConfirm, |
| 765 | 595 | K::Webhooks, |
| 596 | + K::Features, | |
| 597 | + K::RenameHeading, | |
| 766 | 598 | ]; |
| 767 | 599 | |
| 768 | 600 | #[test] |
crates/forge-web/assets/nav.jsmodified+45 -225
| @@ -765,7 +765,7 @@ | ||
| 765 | 765 | settings: function () { refreshLive(true); }, |
| 766 | 766 | // The inbox count changed (see `unreadChanged` above). |
| 767 | 767 | unread: unreadChanged, |
| 768 | - // The viewer's activity changed: the strip, ring and chips are fetched again. | |
| 768 | + // The viewer's activity changed: the strip and the corner dot are fetched again. | |
| 769 | 769 | activity: function () { refreshActivity(); } |
| 770 | 770 | }); |
| 771 | 771 | document.addEventListener('visibilitychange', function () { |
| @@ -871,60 +871,39 @@ | ||
| 871 | 871 | closeDropdowns(e.target && e.target.nodeType === 1 ? e.target : null); |
| 872 | 872 | }, false); |
| 873 | 873 | |
| 874 | - // A mouse that rests on the profile corner opens its account menu, or the bell popover on the bell, | |
| 875 | - // after a short rest; when it leaves, the menu or popover it opened closes. Touch and keyboard | |
| 876 | - // keep the click. hoverOn names what the mouse opened; hoverWait says whether the pending timer | |
| 877 | - // shows it or hides it. | |
| 878 | - var HOVER_OPEN = 120; // a mouse rests this long before a menu opens | |
| 874 | + // A mouse that rests on the profile corner opens its account menu after a short rest; when it | |
| 875 | + // leaves, the menu it opened closes. Touch and keyboard keep the click. hoverOn says the mouse | |
| 876 | + // opened the menu; hoverTimer is the pending show or hide, and hoverWait says which. | |
| 877 | + var HOVER_OPEN = 120; // a mouse rests this long before the menu opens | |
| 879 | 878 | var HOVER_CLOSE = 250; // and may leave this long, enough to cross the gap to the menu |
| 880 | - var hoverOn = null; // 'menu' or 'bell': what the mouse opened | |
| 879 | + var hoverOn = false; | |
| 881 | 880 | var hoverTimer = 0; |
| 882 | 881 | var hoverWait = ''; // 'show' or 'hide': what the pending timer does |
| 883 | - var hoverMute = false; // a click on the bell: it stays shut until the mouse leaves the bell | |
| 884 | - | |
| 885 | - // The part of the profile a node belongs to: 'bell' for the notifications row and its popover | |
| 886 | - // (tested first, as they sit inside the menu), 'menu' for the rest, null elsewhere. | |
| 887 | - function hoverKind(node) { | |
| 888 | - if (!node || !node.closest) { return null; } | |
| 889 | - if (node.closest('.corner-bell, .bell-pop')) { return 'bell'; } | |
| 890 | - if (node.closest('.corner-float')) { return 'menu'; } | |
| 891 | - return null; | |
| 882 | + | |
| 883 | + function inCorner(node) { | |
| 884 | + return !!(node && node.closest && node.closest('.corner-float')); | |
| 892 | 885 | } |
| 893 | 886 | |
| 894 | - // Whether the account menu or the bell popover is open right now. | |
| 895 | - function hoverIsOpen(kind) { | |
| 896 | - if (kind === 'menu') { | |
| 897 | - var details = document.querySelector('details.corner'); | |
| 898 | - return !!(details && details.open); | |
| 899 | - } | |
| 900 | - var pop = document.querySelector('.bell-pop'); | |
| 901 | - return !!(pop && isPeekOpen(pop)); | |
| 887 | + function menuOpen() { | |
| 888 | + var details = document.querySelector('details.corner'); | |
| 889 | + return !!(details && details.open); | |
| 902 | 890 | } |
| 903 | 891 | |
| 904 | - // Opens the menu, or the bell popover beside it, for a resting mouse. A menu the reader opened by | |
| 905 | - // click or keyboard is left alone. The popover sits inside the menu, so the menu stays open under it. | |
| 906 | - function hoverShow(kind) { | |
| 907 | - if (!hoverOn && hoverIsOpen(kind)) { return; } | |
| 892 | + // Opens the menu for a resting mouse. A menu the reader opened by click or keyboard is left alone. | |
| 893 | + function hoverShow() { | |
| 894 | + if (!hoverOn && menuOpen()) { return; } | |
| 908 | 895 | var details = document.querySelector('details.corner'); |
| 909 | - var pop = document.querySelector('.bell-pop'); | |
| 910 | - if (kind === 'menu') { | |
| 911 | - try { if (pop) { pop.hidePopover(); } } catch (err) { } | |
| 912 | - if (details) { details.open = true; } | |
| 913 | - } else { | |
| 914 | - try { if (pop) { pop.showPopover(); } } catch (err) { } | |
| 915 | - } | |
| 916 | - hoverOn = kind; | |
| 896 | + if (details) { details.open = true; } | |
| 897 | + hoverOn = true; | |
| 917 | 898 | } |
| 918 | 899 | |
| 919 | - // Closes what the mouse opened, and forgets it. | |
| 900 | + // Closes the menu the mouse opened, and forgets it. | |
| 920 | 901 | function hoverHide() { |
| 921 | 902 | if (hoverOn) { |
| 922 | - var pop = document.querySelector('.bell-pop'); | |
| 923 | 903 | var details = document.querySelector('details.corner'); |
| 924 | - try { if (pop) { pop.hidePopover(); } } catch (err) { } | |
| 925 | 904 | if (details) { details.open = false; } |
| 926 | 905 | } |
| 927 | - hoverOn = null; | |
| 906 | + hoverOn = false; | |
| 928 | 907 | } |
| 929 | 908 | |
| 930 | 909 | // A mouse entering the corner starts a show (a fresh rest each time it moves within it). Leaving the |
| @@ -932,19 +911,14 @@ | ||
| 932 | 911 | // page does not keep pushing the hide back. |
| 933 | 912 | document.addEventListener('pointerover', function (e) { |
| 934 | 913 | if (e.pointerType !== 'mouse') { return; } |
| 935 | - var kind = hoverKind(e.target); | |
| 936 | - if (hoverMute) { | |
| 937 | - if (kind === 'bell') { return; } | |
| 938 | - hoverMute = false; | |
| 939 | - } | |
| 940 | - if (kind) { | |
| 914 | + if (inCorner(e.target)) { | |
| 941 | 915 | clearTimeout(hoverTimer); |
| 942 | 916 | hoverTimer = 0; |
| 943 | - if (kind === hoverOn && hoverIsOpen(kind)) { return; } | |
| 917 | + if (hoverOn && menuOpen()) { return; } | |
| 944 | 918 | hoverWait = 'show'; |
| 945 | 919 | hoverTimer = setTimeout(function () { |
| 946 | 920 | hoverTimer = 0; |
| 947 | - hoverShow(kind); | |
| 921 | + hoverShow(); | |
| 948 | 922 | }, HOVER_OPEN); |
| 949 | 923 | return; |
| 950 | 924 | } |
| @@ -963,153 +937,14 @@ | ||
| 963 | 937 | |
| 964 | 938 | // A click on the menu's summary, while the mouse holds it open, does nothing: the menu stays open. |
| 965 | 939 | window.addEventListener('click', function (e) { |
| 966 | - if (hoverOn !== 'menu' || !e.target || !e.target.closest) { return; } | |
| 940 | + if (!hoverOn || !e.target || !e.target.closest) { return; } | |
| 967 | 941 | if (!e.target.closest('summary.corner-btn')) { return; } |
| 968 | 942 | e.preventDefault(); |
| 969 | 943 | }, true); |
| 970 | 944 | |
| 971 | - // The bell beside the profile corner opens a popover of the newest notifications instead of going | |
| 972 | - // to the inbox. A touch or keyboard click toggles it; a mouse has already opened it by hovering, so | |
| 973 | - // its click goes to the inbox. With a modifier or a middle click the link's own behaviour stays. | |
| 974 | - // The Popover API light-dismisses it and Escape closes it. Its list is fetched each time it opens | |
| 975 | - // (see the toggle handler). The bell and the popover are siblings. | |
| 976 | - var peekPress = null; // at a press: whether the popover was open (null before any press) | |
| 977 | - var peekHover = false; // at a press: whether the mouse held the popover open | |
| 978 | - | |
| 979 | - function isPeekOpen(pop) { | |
| 980 | - try { return pop.matches(':popover-open'); } catch (err) { return false; } | |
| 981 | - } | |
| 982 | - | |
| 983 | - // Beside the menu, level with the notifications row. When the window has no room for that, under | |
| 984 | - // the row. Either way it stays inside the window. | |
| 985 | - function placePeek(bell, pop) { | |
| 986 | - if (!bell) { return; } | |
| 987 | - var r = bell.getBoundingClientRect(); | |
| 988 | - var menu = bell.closest('.corner-menu'); | |
| 989 | - var right = (menu ? menu.getBoundingClientRect().right : r.right) + 8; | |
| 990 | - var beside = right + pop.offsetWidth + 8 <= window.innerWidth; | |
| 991 | - var left = beside ? right : Math.max(8, Math.min(r.left, window.innerWidth - pop.offsetWidth - 8)); | |
| 992 | - pop.style.left = left + 'px'; | |
| 993 | - pop.style.top = (beside ? r.top - 8 : r.bottom + 6) + 'px'; | |
| 994 | - pop.style.bottom = 'auto'; | |
| 995 | - } | |
| 996 | - | |
| 997 | - // Fills the popover's list with the server's fragment. The popover stays invisible until then, so it | |
| 998 | - // opens at its final height; a slow answer shows the loading note first. A reader who closed it | |
| 999 | - // meanwhile, or a newer open, leaves the answer unused. | |
| 1000 | - function loadPeek(pop) { | |
| 1001 | - var list = pop.querySelector('.bell-list'); | |
| 1002 | - if (!list) { return; } | |
| 1003 | - var seq = ++peekSeq; | |
| 1004 | - var slow = setTimeout(function () { | |
| 1005 | - if (seq !== peekSeq || !isPeekOpen(pop)) { return; } | |
| 1006 | - var note = document.createElement('p'); | |
| 1007 | - note.className = 'bell-empty muted'; | |
| 1008 | - note.textContent = pop.getAttribute('data-loading') || ''; | |
| 1009 | - list.replaceChildren(note); | |
| 1010 | - pop.classList.add('bell-ready'); | |
| 1011 | - }, PEEK_SLOW); | |
| 1012 | - fetch('/notifications/peek', { headers: { accept: 'text/html' }, credentials: 'same-origin' }).then(function (r) { | |
| 1013 | - if (!r.ok) { throw new Error('status ' + r.status); } | |
| 1014 | - return r.text(); | |
| 1015 | - }).then(function (html) { | |
| 1016 | - if (seq !== peekSeq || !isPeekOpen(pop)) { return; } | |
| 1017 | - var tpl = document.createElement('template'); | |
| 1018 | - tpl.innerHTML = html; | |
| 1019 | - list.replaceChildren(tpl.content); | |
| 1020 | - }).catch(function () { | |
| 1021 | - if (seq !== peekSeq || !isPeekOpen(pop)) { return; } | |
| 1022 | - var err = document.createElement('p'); | |
| 1023 | - err.className = 'bell-empty muted'; | |
| 1024 | - err.textContent = pop.getAttribute('data-error') || ''; | |
| 1025 | - list.replaceChildren(err); | |
| 1026 | - }).then(function () { | |
| 1027 | - clearTimeout(slow); | |
| 1028 | - if (seq === peekSeq && isPeekOpen(pop)) { pop.classList.add('bell-ready'); } | |
| 1029 | - }); | |
| 1030 | - } | |
| 1031 | - // Mark all read from the bell: the post goes in the background, so the page under the popover is | |
| 1032 | - // not fetched again. The list and the count change once the server has answered; the inbox page | |
| 1033 | - // follows through its own stream. | |
| 1034 | - document.addEventListener('submit', function (e) { | |
| 1035 | - var form = e.target; | |
| 1036 | - if (!form.matches || !form.matches('.bell-clear')) { return; } | |
| 1037 | - e.preventDefault(); | |
| 1038 | - if (form.classList.contains('is-busy')) { return; } | |
| 1039 | - form.classList.add('is-busy'); | |
| 1040 | - var pop = form.closest('.bell-pop'); | |
| 1041 | - fetch(form.action, { method: 'POST', credentials: 'same-origin', redirect: 'manual', body: new URLSearchParams(new FormData(form)) }).then(function (r) { | |
| 1042 | - form.classList.remove('is-busy'); | |
| 1043 | - if (r.type !== 'opaqueredirect') { throw new Error('status ' + r.status); } | |
| 1044 | - if (pop && isPeekOpen(pop)) { loadPeek(pop); } | |
| 1045 | - }).catch(function () { | |
| 1046 | - form.classList.remove('is-busy'); | |
| 1047 | - form.submit(); | |
| 1048 | - }); | |
| 1049 | - }, true); | |
| 1050 | - var PEEK_SLOW = 300; // ms before a slow list shows its loading note | |
| 1051 | - var peekSeq = 0; // a fetch's number: only the newest answer is drawn | |
| 1052 | - | |
| 1053 | - // Records whether the popover was open when the press began. Light dismiss closes it on the press, | |
| 1054 | - // so the click that follows must not reopen it. | |
| 1055 | - document.addEventListener('pointerdown', function (e) { | |
| 1056 | - var bell = e.target && e.target.closest ? e.target.closest('.corner-bell') : null; | |
| 1057 | - if (!bell) { return; } | |
| 1058 | - var pop = bell.nextElementSibling; | |
| 1059 | - peekPress = !!(pop && pop.classList.contains('bell-pop') && isPeekOpen(pop)); | |
| 1060 | - peekHover = hoverOn === 'bell'; | |
| 1061 | - }, true); | |
| 1062 | - | |
| 1063 | - // Capture on window, so it runs before the soft navigation (capture on document) follows the | |
| 1064 | - // bell's link to the inbox, which would swap the page and close the popover it just opened. | |
| 1065 | - window.addEventListener('click', function (e) { | |
| 1066 | - if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) { return; } | |
| 1067 | - var bell = e.target && e.target.closest ? e.target.closest('.corner-bell') : null; | |
| 1068 | - if (!bell) { return; } | |
| 1069 | - var pop = bell.nextElementSibling; | |
| 1070 | - if (!pop || !pop.classList.contains('bell-pop')) { return; } | |
| 1071 | - // The mouse opened the popover by resting on the bell: this click goes to the inbox instead. The | |
| 1072 | - // press decides, as light dismiss has closed the popover by now. | |
| 1073 | - clearTimeout(hoverTimer); | |
| 1074 | - hoverTimer = 0; | |
| 1075 | - if (peekHover) { peekHover = false; hoverOn = null; peekPress = null; hoverMute = true; return; } | |
| 1076 | - e.preventDefault(); | |
| 1077 | - // A keyboard click has no press: the popover's own state decides. | |
| 1078 | - var was = peekPress === null ? isPeekOpen(pop) : peekPress; | |
| 1079 | - peekPress = null; | |
| 1080 | - try { | |
| 1081 | - if (was) { pop.hidePopover(); } else { pop.showPopover(); } | |
| 1082 | - } catch (err) { } | |
| 1083 | - }, true); | |
| 1084 | - | |
| 1085 | - // The popover's open state drives its bell's aria-expanded; opening places it and fetches its list. | |
| 1086 | - document.addEventListener('toggle', function (e) { | |
| 1087 | - var pop = e.target; | |
| 1088 | - if (!pop || !pop.classList || !pop.classList.contains('bell-pop')) { return; } | |
| 1089 | - var bell = pop.previousElementSibling; | |
| 1090 | - var open = e.newState === 'open'; | |
| 1091 | - if (bell && bell.classList.contains('corner-bell')) { bell.setAttribute('aria-expanded', open ? 'true' : 'false'); } | |
| 1092 | - if (open) { | |
| 1093 | - placePeek(bell, pop); | |
| 1094 | - loadPeek(pop); | |
| 1095 | - } else { | |
| 1096 | - pop.classList.remove('bell-ready'); | |
| 1097 | - if (hoverOn === 'bell') { | |
| 1098 | - // Closed by Escape or a light dismiss: the mouse no longer holds it open. | |
| 1099 | - hoverOn = null; | |
| 1100 | - } | |
| 1101 | - } | |
| 1102 | - }, true); | |
| 1103 | - | |
| 1104 | - // A page swap re-renders the page and its corner; an open popover goes with the page it was opened on. | |
| 1105 | - document.addEventListener('forge:swapped', function () { | |
| 1106 | - document.querySelectorAll('.bell-pop').forEach(function (pop) { | |
| 1107 | - try { pop.hidePopover(); } catch (err) { } | |
| 1108 | - }); | |
| 1109 | - }); | |
| 1110 | - // A swap that took the mouse's popover or menu away leaves nothing for hover to close. | |
| 945 | + // A swap that took the mouse's menu away leaves nothing for hover to close. | |
| 1111 | 946 | document.addEventListener('forge:swapped', function () { |
| 1112 | - if (hoverOn && !hoverIsOpen(hoverOn)) { hoverOn = null; } | |
| 947 | + if (hoverOn && !menuOpen()) { hoverOn = false; } | |
| 1113 | 948 | }); |
| 1114 | 949 | |
| 1115 | 950 | // Escape closes the open dropdowns and returns focus to the summary of the one that held it. |
| @@ -1979,7 +1814,7 @@ | ||
| 1979 | 1814 | // looked up on each update. The count arrives as an `unread` event of the shell stream (see |
| 1980 | 1815 | // `/-/shell/events`, opened with the alive handlers above), which the server pushes on each change; |
| 1981 | 1816 | // nothing polls. Each `unread` event also refreshes the activity (below). The count shows on the |
| 1982 | - // bell of the floating profile corner. | |
| 1817 | + // notifications row of the floating profile corner. | |
| 1983 | 1818 | |
| 1984 | 1819 | // Shows the count in one link the way the server renders it: a span with the number, or no span at zero. |
| 1985 | 1820 | function setCount(el, cls, n) { |
| @@ -1996,10 +1831,22 @@ | ||
| 1996 | 1831 | } |
| 1997 | 1832 | } |
| 1998 | 1833 | |
| 1834 | + // Whether the last activity JSON counted a review request, a mention or a failed run for the viewer. | |
| 1835 | + var waitingNow = false; | |
| 1836 | + | |
| 1837 | + // The avatar's dot: the profile corner is `waiting` while the viewer has an unread notification or | |
| 1838 | + // something in `waitingNow`. The unread count is read from the page, so a swap keeps it right. | |
| 1839 | + function paintCorner() { | |
| 1840 | + var on = waitingNow || !!document.querySelector('.corner-bell .bell-count'); | |
| 1841 | + var corners = document.querySelectorAll('details.corner'); | |
| 1842 | + for (var i = 0; i < corners.length; i++) { corners[i].classList.toggle('waiting', on); } | |
| 1843 | + } | |
| 1844 | + | |
| 1999 | 1845 | function setUnread(n) { |
| 2000 | - // The bell of the profile corner, `.bell-count` as the server renders it. | |
| 2001 | - var bells = document.querySelectorAll('.corner-bell'); | |
| 2002 | - for (var i = 0; i < bells.length; i++) { setCount(bells[i], 'bell-count', n); } | |
| 1846 | + // The notifications row of the profile corner, `.bell-count` as the server renders it. | |
| 1847 | + var rows = document.querySelectorAll('.corner-bell'); | |
| 1848 | + for (var i = 0; i < rows.length; i++) { setCount(rows[i], 'bell-count', n); } | |
| 1849 | + paintCorner(); | |
| 2003 | 1850 | } |
| 2004 | 1851 | |
| 2005 | 1852 | // An `unread` event: the count, then the activity is fetched again. |
| @@ -2008,8 +1855,7 @@ | ||
| 2008 | 1855 | refreshActivity(); |
| 2009 | 1856 | } |
| 2010 | 1857 | |
| 2011 | - // The live activity: the profile corner (heat ring, chips) and the live strip after | |
| 2012 | - // the path bar. The server's activity JSON (GET /-/activity) is the source. An `activity` event of | |
| 1858 | + // The live activity: the profile corner's dot and the live strip after the path bar. The server's activity JSON (GET /-/activity) is the source. An `activity` event of | |
| 2013 | 1859 | // the shell stream, and every `unread` event, fetches it again and redraws whatever is on the page. |
| 2014 | 1860 | // Nothing changes before the JSON says so. A finished run leaves the strip when the server's window |
| 2015 | 1861 | // ends, so while any is listed the JSON is fetched again every 30 s. |
| @@ -2119,39 +1965,13 @@ | ||
| 2119 | 1965 | }); |
| 2120 | 1966 | } |
| 2121 | 1967 | |
| 2122 | - // The chips: one per non-zero count. The titles come from the chip box's templates, with `{n}` | |
| 2123 | - // standing for the count; the singular template is used for one. | |
| 2124 | - function drawChips(box, json) { | |
| 2125 | - // Each chip links to the newest thing it counts, or to the inbox when that is not listed. | |
| 2126 | - var newest = function (kind) { | |
| 2127 | - var item = (json.waiting || []).filter(function (w) { return w.kind === kind; })[0]; | |
| 2128 | - return item ? item.href : '/notifications'; | |
| 2129 | - }; | |
| 2130 | - var chips = [ | |
| 2131 | - { kind: 'review', cls: 'corner-link chip-review', n: json.reviews, tpl: 'data-review', href: newest('review') }, | |
| 2132 | - { kind: 'mention', cls: 'corner-link chip-mention', n: json.mentions, tpl: 'data-mention', href: newest('mention') }, | |
| 2133 | - { kind: 'failing', cls: 'corner-link chip-failing', n: json.failing, tpl: 'data-failing', href: json.failing_href || '/notifications' } | |
| 2134 | - ]; | |
| 2135 | - box.textContent = ''; | |
| 2136 | - chips.forEach(function (c) { | |
| 2137 | - var n = Number(c.n) || 0; | |
| 2138 | - if (n <= 0) { return; } | |
| 2139 | - var tpl = box.getAttribute(c.tpl + (n === 1 ? '-one' : '')) || ''; | |
| 2140 | - var chip = document.createElement('a'); | |
| 2141 | - chip.className = c.cls; | |
| 2142 | - chip.setAttribute('href', c.href); | |
| 2143 | - chip.textContent = tpl.split('{n}').join(String(n)); | |
| 2144 | - box.appendChild(chip); | |
| 2145 | - }); | |
| 2146 | - } | |
| 2147 | - | |
| 2148 | - // Redraws every strip and chip box on the page from one activity JSON. The | |
| 1968 | + // Redraws every strip from one activity JSON, and the avatar's dot from its waiting counts. The | |
| 2149 | 1969 | // elements are looked up here each time, since a swap may have replaced them. |
| 2150 | 1970 | function drawActivity(json) { |
| 2151 | 1971 | var strips = document.querySelectorAll('.live-strip[data-activity]'); |
| 2152 | 1972 | for (var i = 0; i < strips.length; i++) { drawStrip(strips[i], json); } |
| 2153 | - var boxes = document.querySelectorAll('.corner-chips'); | |
| 2154 | - for (var b = 0; b < boxes.length; b++) { drawChips(boxes[b], json); } | |
| 1973 | + waitingNow = (Number(json.reviews) || 0) + (Number(json.mentions) || 0) + (Number(json.failing) || 0) > 0; | |
| 1974 | + paintCorner(); | |
| 2155 | 1975 | // Finished runs leave the strip when the server's window ends, so the JSON is asked for again. |
| 2156 | 1976 | clearTimeout(activityTimer); |
| 2157 | 1977 | activityTimer = null; |
crates/forge-web/src/pages/admin_backups.rsmodified+107 -94
| @@ -1,9 +1,13 @@ | ||
| 1 | 1 | //! Page: backups (`/admin/backups`). Instance admins only; anyone else gets 404. |
| 2 | 2 | //! |
| 3 | -//! Shows the `[backup]` settings (the healthcheck URL only as its host, since it may hold a token), | |
| 4 | -//! the last 20 backup and fsck runs, and two POST buttons that start a run in the background. | |
| 5 | -//! A button press is audited and redirects back here with a notice. | |
| 3 | +//! Shows the backup settings as a settings topic, saved here (`POST /admin/backups`, the same rows | |
| 4 | +//! and save as the server settings), then the last 20 backup and fsck runs, and two POST buttons | |
| 5 | +//! that start a run in the background. A button press is audited and redirects back here with a | |
| 6 | +//! notice. The rail beside the page holds Replication too. | |
| 6 | 7 | |
| 8 | +use std::collections::HashMap; | |
| 9 | + | |
| 10 | +use forge_core::server_settings::Group; | |
| 7 | 11 | use forge_core::store::backup_runs::{BackupRun, RunKind}; |
| 8 | 12 | use forge_core::{AuditAction, Error, Store, User}; |
| 9 | 13 | use serde::Deserialize; |
| @@ -19,13 +23,16 @@ use crate::audit::{self, Actor, Target}; | ||
| 19 | 23 | use crate::auth::check_csrf; |
| 20 | 24 | use crate::backup::scheduler::{configured_dir, start_manual}; |
| 21 | 25 | use crate::i18n::admin::{self as g, K}; |
| 22 | -use crate::i18n::{self, Lang}; | |
| 26 | +use crate::i18n::{self, Key, Lang}; | |
| 23 | 27 | use crate::live::{Topic, stream_changes}; |
| 28 | +use crate::pages::admin_server::{ | |
| 29 | + BACKUP_KEYS, Row, notice_of, reset_form, save_topic, setting_lines, setting_rows, with_notice, | |
| 30 | +}; | |
| 24 | 31 | use crate::pages::admin_users::admin_only; |
| 25 | 32 | use crate::pages::issues_list::stamp_unix; |
| 26 | 33 | use crate::state::AppState; |
| 27 | -use crate::views::parts::{SubPart, head, post_act}; | |
| 28 | -use crate::views::{enc, rel_time, shell}; | |
| 34 | +use crate::views::parts::{RailItem, head, post_act, rail}; | |
| 35 | +use crate::views::{alert, enc, rel_time, shell}; | |
| 29 | 36 | |
| 30 | 37 | /// Runs shown on the page. |
| 31 | 38 | const RUN_LIMIT: u32 = 20; |
| @@ -52,35 +59,6 @@ struct RunRow { | ||
| 52 | 59 | detail: String, |
| 53 | 60 | } |
| 54 | 61 | |
| 55 | -/// The settings block, already formatted. | |
| 56 | -struct Settings { | |
| 57 | - enabled: bool, | |
| 58 | - dir: String, | |
| 59 | - interval: String, | |
| 60 | - keep: String, | |
| 61 | - fsck_interval: String, | |
| 62 | - healthcheck: String, | |
| 63 | -} | |
| 64 | - | |
| 65 | -fn settings_view(lang: Lang, config: &forge_core::config::BackupConfig) -> Settings { | |
| 66 | - let healthcheck = if config.healthcheck_url.is_empty() { | |
| 67 | - g::t(lang, K::HealthcheckNotSet).to_owned() | |
| 68 | - } else { | |
| 69 | - match reqwest::Url::parse(&config.healthcheck_url) { | |
| 70 | - Ok(url) => g::healthcheck_host(lang, url.host_str()), | |
| 71 | - Err(_) => g::t(lang, K::HealthcheckUrlInvalid).to_owned(), | |
| 72 | - } | |
| 73 | - }; | |
| 74 | - Settings { | |
| 75 | - enabled: config.enabled(), | |
| 76 | - dir: config.dir.display().to_string(), | |
| 77 | - interval: g::every_hours(lang, config.interval_hours), | |
| 78 | - keep: g::newest_sets(lang, config.keep), | |
| 79 | - fsck_interval: g::every_days(lang, config.fsck_interval_days), | |
| 80 | - healthcheck, | |
| 81 | - } | |
| 82 | -} | |
| 83 | - | |
| 84 | 62 | /// `"512 B"`, `"12.3 KiB"`, `"4.0 MiB"` and so on. |
| 85 | 63 | fn human_bytes(bytes: u64) -> String { |
| 86 | 64 | const UNITS: [&str; 4] = ["KiB", "MiB", "GiB", "TiB"]; |
| @@ -129,11 +107,34 @@ fn run_row(run: &BackupRun, lang: Lang) -> RunRow { | ||
| 129 | 107 | } |
| 130 | 108 | } |
| 131 | 109 | |
| 110 | +/// The rail of the Backups tab: Backups and Replication. | |
| 111 | +#[component] | |
| 112 | +pub(crate) async fn backups_rail(lang: Lang, current: &'static str) -> Result<impl View> { | |
| 113 | + let items = vec![ | |
| 114 | + RailItem { | |
| 115 | + name: g::t(lang, K::Backups).to_owned(), | |
| 116 | + val: String::new(), | |
| 117 | + href: "/admin/backups".to_owned(), | |
| 118 | + current: current == "backups", | |
| 119 | + }, | |
| 120 | + RailItem { | |
| 121 | + name: g::t(lang, K::Replication).to_owned(), | |
| 122 | + val: String::new(), | |
| 123 | + href: "/admin/replication".to_owned(), | |
| 124 | + current: current == "replication", | |
| 125 | + }, | |
| 126 | + ]; | |
| 127 | + Ok(view! { | |
| 128 | + rail(label: g::t(lang, K::Backups), items: items) | |
| 129 | + }) | |
| 130 | +} | |
| 131 | + | |
| 132 | 132 | #[component] |
| 133 | 133 | async fn backups_view( |
| 134 | 134 | lang: Lang, |
| 135 | 135 | csrf: String, |
| 136 | - settings: Settings, | |
| 136 | + enabled: bool, | |
| 137 | + settings: Vec<Row>, | |
| 137 | 138 | rows: Vec<RunRow>, |
| 138 | 139 | running: Option<RunKind>, |
| 139 | 140 | notice: Option<String>, |
| @@ -142,9 +143,8 @@ async fn backups_view( | ||
| 142 | 143 | matches!(running, Some(RunKind::Backup)).then(|| g::running_line(lang, RunKind::Backup)); |
| 143 | 144 | let fsck_running = |
| 144 | 145 | matches!(running, Some(RunKind::Fsck)).then(|| g::running_line(lang, RunKind::Fsck)); |
| 145 | - let sub = vec![SubPart::text(g::t(lang, K::BackupsIntro))]; | |
| 146 | 146 | Ok(view! { |
| 147 | - head(title: g::t(lang, K::Backups), sub: sub, | |
| 147 | + head(title: g::t(lang, K::Backups), | |
| 148 | 148 | <form id="run-backup" method="post" action="/admin/backups/run" class="act-form"> |
| 149 | 149 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 150 | 150 | <button type="submit" class="button">(g::t(lang, K::RunBackupNow))</button> |
| @@ -154,64 +154,51 @@ async fn backups_view( | ||
| 154 | 154 | if let Some(message) = notice { |
| 155 | 155 | <p class="state" role="status">(message.as_str())</p> |
| 156 | 156 | } |
| 157 | - <div class="sheet" data-live="/admin/backups/events"> | |
| 158 | - if let Some(line) = backup_running { | |
| 159 | - <p class="state">(line)</p> | |
| 160 | - } | |
| 161 | - if let Some(line) = fsck_running { | |
| 162 | - <p class="state">(line)</p> | |
| 163 | - } | |
| 164 | - <section class="sec"> | |
| 165 | - if settings.enabled { | |
| 166 | - <h2>(crate::pages::passkeys::s(lang, "Configuration", "Yapılandırma"))</h2> | |
| 167 | - <div class="line" data-kb-row=""> | |
| 168 | - <span class="name">(g::t(lang, K::Directory))</span> | |
| 169 | - <span class="val"><code>(settings.dir.as_str())</code></span> | |
| 170 | - </div> | |
| 171 | - <div class="line" data-kb-row=""> | |
| 172 | - <span class="name">(g::t(lang, K::BackupInterval))</span> | |
| 173 | - <span class="val">(settings.interval.as_str())</span> | |
| 174 | - </div> | |
| 175 | - <div class="line" data-kb-row=""> | |
| 176 | - <span class="name">(g::t(lang, K::Retention))</span> | |
| 177 | - <span class="val">(settings.keep.as_str())</span> | |
| 178 | - </div> | |
| 179 | - <div class="line" data-kb-row=""> | |
| 180 | - <span class="name">(g::t(lang, K::Fsck))</span> | |
| 181 | - <span class="val">(settings.fsck_interval.as_str())</span> | |
| 182 | - </div> | |
| 183 | - <div class="line" data-kb-row=""> | |
| 184 | - <span class="name">(g::t(lang, K::Healthcheck))</span> | |
| 185 | - <span class="val">(settings.healthcheck.as_str())</span> | |
| 186 | - </div> | |
| 187 | - } else { | |
| 188 | - <h2>(g::t(lang, K::Settings))</h2> | |
| 189 | - <p class="state">(g::t(lang, K::ScheduledBackupsOff))</p> | |
| 157 | + <div class="work"> | |
| 158 | + backups_rail(lang: lang, current: "backups") | |
| 159 | + <div class="sheet" data-live="/admin/backups/events"> | |
| 160 | + if let Some(line) = backup_running { | |
| 161 | + <p class="state">(line)</p> | |
| 162 | + } | |
| 163 | + if let Some(line) = fsck_running { | |
| 164 | + <p class="state">(line)</p> | |
| 190 | 165 | } |
| 191 | - </section> | |
| 192 | - <section class="sec"> | |
| 193 | - <h2>(g::t(lang, K::RecentRuns))</h2> | |
| 194 | - if rows.is_empty() { | |
| 195 | - <p class="state">(g::t(lang, K::NoRunsYet))</p> | |
| 196 | - <p class="hint">(g::t(lang, K::BackupsEmptyHint))</p> | |
| 197 | - } else { | |
| 198 | - for row in rows.into_iter() { | |
| 199 | - <div class="line" data-kb-row=""> | |
| 200 | - <span class="name">(row.kind.as_str()) " · " (row.trigger.as_str())</span> | |
| 201 | - <span class="val">(row.status.as_str()) " · " rel_time(lang: lang, stamp: row.started.as_str())</span> | |
| 166 | + <section class="sec"> | |
| 167 | + <h2>(g::t(lang, K::Settings))</h2> | |
| 168 | + if !enabled { | |
| 169 | + <p class="state">(g::t(lang, K::ScheduledBackupsOff))</p> | |
| 170 | + } | |
| 171 | + <form method="post" action="/admin/backups" class="srv-form"> | |
| 172 | + <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 173 | + <input type="hidden" name="back" value="/admin/backups"> | |
| 174 | + setting_lines(lang: lang, rows: settings) | |
| 175 | + <div class="acts srv-save"> | |
| 176 | + <button type="submit" class="primary">(i18n::t(lang, Key::Save))</button> | |
| 202 | 177 | </div> |
| 203 | - <p class="hint"> | |
| 204 | - (row.duration.as_str()) | |
| 205 | - if !row.size.is_empty() { | |
| 206 | - " · " (row.size.as_str()) | |
| 178 | + </form> | |
| 179 | + reset_form(csrf: csrf.clone(), back: "/admin/backups".to_owned()) | |
| 180 | + </section> | |
| 181 | + <section class="sec"> | |
| 182 | + <h2>(g::t(lang, K::RecentRuns))</h2> | |
| 183 | + if rows.is_empty() { | |
| 184 | + <p class="state">(g::t(lang, K::NoRunsYet))</p> | |
| 185 | + } else { | |
| 186 | + for row in rows.into_iter() { | |
| 187 | + <div class="line" data-kb-row=""> | |
| 188 | + <span class="name">(row.kind.as_str()) " · " (row.trigger.as_str())</span> | |
| 189 | + <span class="val">(row.status.as_str()) " · " rel_time(lang: lang, stamp: row.started.as_str()) " · " (row.duration.as_str()) | |
| 190 | + if !row.size.is_empty() { | |
| 191 | + " · " (row.size.as_str()) | |
| 192 | + } | |
| 193 | + </span> | |
| 194 | + </div> | |
| 195 | + if !row.detail.is_empty() { | |
| 196 | + alert(message: row.detail.as_str()) | |
| 207 | 197 | } |
| 208 | - </p> | |
| 209 | - if !row.detail.is_empty() { | |
| 210 | - <p class="hint bad">(row.detail.as_str())</p> | |
| 211 | 198 | } |
| 212 | 199 | } |
| 213 | - } | |
| 214 | - </section> | |
| 200 | + </section> | |
| 201 | + </div> | |
| 215 | 202 | </div> |
| 216 | 203 | }) |
| 217 | 204 | } |
| @@ -251,14 +238,40 @@ async fn backups_page(cx: &Cx) -> Result<impl View> { | ||
| 251 | 238 | let runs = state.store.recent_runs(RUN_LIMIT).await?; |
| 252 | 239 | let rows: Vec<RunRow> = runs.iter().map(|run| run_row(run, lang)).collect(); |
| 253 | 240 | let running = state.jobs.running(); |
| 254 | - let settings = settings_view(lang, &state.config.backup); | |
| 241 | + let settings = setting_rows(state, lang, BACKUP_KEYS).await?; | |
| 242 | + let enabled = state.config.backup.enabled(); | |
| 255 | 243 | let csrf = viewer.1.csrf_token.clone(); |
| 256 | 244 | let title = g::t(lang, K::Backups); |
| 257 | 245 | Ok(view! { |
| 258 | - shell(title: title, viewer: Some(&viewer), backups_view(lang: lang, csrf: csrf, settings: settings, rows: rows, running: running, notice: query.notice.clone())) | |
| 246 | + shell(title: title, viewer: Some(&viewer), backups_view(lang: lang, csrf: csrf, enabled: enabled, settings: settings, rows: rows, running: running, notice: query.notice.clone())) | |
| 259 | 247 | }) |
| 260 | 248 | } |
| 261 | 249 | |
| 250 | +/// Saves the backup settings from the page's form. Admins only, with the CSRF token. | |
| 251 | +#[route(POST "/admin/backups")] | |
| 252 | +async fn backups_save(cx: &Cx, Form(form): Form<HashMap<String, String>>) -> Result<Response> { | |
| 253 | + let viewer = admin_only(cx).await?; | |
| 254 | + if !check_csrf(&viewer.1, form.get("csrf").map_or("", String::as_str)) { | |
| 255 | + return Err(forbidden().into()); | |
| 256 | + } | |
| 257 | + let lang = i18n::lang(cx, Some(&viewer.0)); | |
| 258 | + let state = app_context::<AppState>(cx); | |
| 259 | + let notice = notice_of( | |
| 260 | + lang, | |
| 261 | + save_topic( | |
| 262 | + cx, | |
| 263 | + state, | |
| 264 | + &viewer.0, | |
| 265 | + Group::Backups, | |
| 266 | + BACKUP_KEYS, | |
| 267 | + form, | |
| 268 | + lang, | |
| 269 | + ) | |
| 270 | + .await, | |
| 271 | + ); | |
| 272 | + Err(see_other(with_notice("/admin/backups", ¬ice)).into()) | |
| 273 | +} | |
| 274 | + | |
| 262 | 275 | #[route(POST "/admin/backups/run")] |
| 263 | 276 | async fn backups_run(cx: &Cx, Form(form): Form<RunForm>) -> Result<Response> { |
| 264 | 277 | start_run(cx, form.csrf, RunKind::Backup).await |
| @@ -535,7 +548,7 @@ mod tests { | ||
| 535 | 548 | assert_eq!(status, 200); |
| 536 | 549 | assert!(body.contains("schedule")); |
| 537 | 550 | assert!(body.contains("disk full")); |
| 538 | - assert!(body.contains("hc.example.test")); | |
| 551 | + assert!(!body.contains("hc.example.test"), "a healthcheck URL is a secret and is never rendered"); | |
| 539 | 552 | assert!( |
| 540 | 553 | !body.contains("SECRET-TOKEN"), |
| 541 | 554 | "the healthcheck token must not be shown" |
crates/forge-web/src/pages/admin_health.rsmodified+1 -1
| @@ -510,7 +510,7 @@ async fn health_view( | ||
| 510 | 510 | class: "b health-sum ok", |
| 511 | 511 | } |
| 512 | 512 | }; |
| 513 | - let sub = vec![summary, SubPart::text(at(lang, A::HealthIntro))]; | |
| 513 | + let sub = vec![summary]; | |
| 514 | 514 | Ok(view! { |
| 515 | 515 | head(title: at(lang, A::Health), sub: sub, live: Some("/admin/health/events")) |
| 516 | 516 | <div class="sheet health-sheet"> |
crates/forge-web/src/pages/admin_mail.rsmodified+43 -28
| @@ -7,10 +7,12 @@ | ||
| 7 | 7 | //! saved setting re-renders the tab through `/admin/mail/events` with no reload and no polling. |
| 8 | 8 | //! Saving the settings and queuing a test are audited. |
| 9 | 9 | |
| 10 | -use forge_core::config::MailTransport; | |
| 10 | +use std::collections::HashMap; | |
| 11 | + | |
| 11 | 12 | use forge_core::mail::{ |
| 12 | 13 | MailKind, MailSettings, MailSettingsUpdate, MailState, OutboxEntry, Security, |
| 13 | 14 | }; |
| 15 | +use forge_core::server_settings::Group; | |
| 14 | 16 | use forge_core::time::now_stamp; |
| 15 | 17 | use forge_core::{AuditAction, Error}; |
| 16 | 18 | use futures_util::{Stream, stream}; |
| @@ -30,10 +32,13 @@ use crate::auth::check_csrf; | ||
| 30 | 32 | use crate::i18n::admin::{self as g, K}; |
| 31 | 33 | use crate::i18n::{self, Key, Lang}; |
| 32 | 34 | use crate::mail::{enqueue, live, templates}; |
| 35 | +use crate::pages::admin_server::{ | |
| 36 | + MAIL_KEYS, Row, refusal, save_topic, setting_lines, setting_rows, | |
| 37 | +}; | |
| 33 | 38 | use crate::pages::admin_users::admin_only; |
| 34 | 39 | use crate::pages::ci_runs::{changed_event, events_response}; |
| 35 | 40 | use crate::state::AppState; |
| 36 | -use crate::views::parts::{SubPart, confirm_act, head, post_act}; | |
| 41 | +use crate::views::parts::{confirm_act, head, post_act}; | |
| 37 | 42 | use crate::views::{enc, rel_time, shell}; |
| 38 | 43 | |
| 39 | 44 | /// Rows shown in the queue at most. |
| @@ -93,7 +98,8 @@ struct PageData { | ||
| 93 | 98 | from_name: String, |
| 94 | 99 | enabled: bool, |
| 95 | 100 | has_password: bool, |
| 96 | - transport: &'static str, | |
| 101 | + /// The delivery setting (`mail.transport`), a settings row saved with the settings form. | |
| 102 | + transport: Vec<Row>, | |
| 97 | 103 | tab: Tab, |
| 98 | 104 | queue: Option<QueueData>, |
| 99 | 105 | } |
| @@ -110,13 +116,6 @@ fn state_class(state: MailState) -> &'static str { | ||
| 110 | 116 | } |
| 111 | 117 | } |
| 112 | 118 | |
| 113 | -fn transport_name(transport: MailTransport) -> &'static str { | |
| 114 | - match transport { | |
| 115 | - MailTransport::Smtp => "smtp", | |
| 116 | - MailTransport::Log => "log", | |
| 117 | - } | |
| 118 | -} | |
| 119 | - | |
| 120 | 119 | fn row_view(entry: &OutboxEntry, now: &str, lang: Lang) -> QueueRow { |
| 121 | 120 | let state = entry.state_at(now); |
| 122 | 121 | QueueRow { |
| @@ -182,6 +181,7 @@ async fn page_data( | ||
| 182 | 181 | Tab::Queue => Some(queue_data(state, lang, filter).await?), |
| 183 | 182 | Tab::Settings => None, |
| 184 | 183 | }; |
| 184 | + let transport = setting_rows(state, lang, MAIL_KEYS).await?; | |
| 185 | 185 | Ok(PageData { |
| 186 | 186 | host: settings.host, |
| 187 | 187 | port: settings.port.to_string(), |
| @@ -191,7 +191,7 @@ async fn page_data( | ||
| 191 | 191 | from_name: settings.from_name, |
| 192 | 192 | enabled: settings.enabled, |
| 193 | 193 | has_password: settings.has_password, |
| 194 | - transport: transport_name(state.config.mail.transport), | |
| 194 | + transport, | |
| 195 | 195 | tab, |
| 196 | 196 | queue, |
| 197 | 197 | }) |
| @@ -207,20 +207,14 @@ async fn mail_view( | ||
| 207 | 207 | let starttls = data.security == Security::StartTls; |
| 208 | 208 | let tls = data.security == Security::Tls; |
| 209 | 209 | let plain = data.security == Security::Plain; |
| 210 | - let password_hint = if data.has_password { | |
| 211 | - g::t(lang, K::PasswordStoredHint) | |
| 212 | - } else { | |
| 213 | - g::t(lang, K::NoPasswordStored) | |
| 214 | - }; | |
| 215 | 210 | let settings_on = data.tab == Tab::Settings; |
| 216 | 211 | let filter_param = data |
| 217 | 212 | .queue |
| 218 | 213 | .as_ref() |
| 219 | 214 | .map(|q| q.filter_param.clone()) |
| 220 | 215 | .unwrap_or_default(); |
| 221 | - let sub = vec![SubPart::text(g::t(lang, K::MailIntro))]; | |
| 222 | 216 | Ok(view! { |
| 223 | - head(title: g::t(lang, K::Mail), sub: sub) | |
| 217 | + head(title: g::t(lang, K::Mail)) | |
| 224 | 218 | if let Some(message) = notice { |
| 225 | 219 | <p class="state" role="status">(message.as_str())</p> |
| 226 | 220 | } |
| @@ -232,12 +226,14 @@ async fn mail_view( | ||
| 232 | 226 | // Saved by any admin session: the stream re-renders the settings with the same signal |
| 233 | 227 | // as the queue (the save bumps it too), and the form keeps what was typed. |
| 234 | 228 | <div class="sheet" data-live="/admin/mail/events"> |
| 235 | - <form method="post" action="/admin/mail"> | |
| 229 | + <form method="post" action="/admin/mail" class="srv-form"> | |
| 236 | 230 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 231 | + <section class="sec"> | |
| 232 | + <h2>(crate::pages::passkeys::s(lang, "Delivery", "Teslimat"))</h2> | |
| 233 | + setting_lines(lang: lang, rows: data.transport) | |
| 234 | + </section> | |
| 237 | 235 | <section class="sec" id="smtp"> |
| 238 | 236 | <h2>(g::t(lang, K::SmtpServer))</h2> |
| 239 | - <p class="hint">(g::t(lang, K::MailTransportNote))</p> | |
| 240 | - <p class="hint">(g::t(lang, K::MailTransportInUse)) " " <code>(data.transport)</code></p> | |
| 241 | 237 | <div class="fields"> |
| 242 | 238 | <div class="field"> |
| 243 | 239 | <label for="mail-host">(g::t(lang, K::MailHost))</label> |
| @@ -262,8 +258,10 @@ async fn mail_view( | ||
| 262 | 258 | <div class="field"> |
| 263 | 259 | <label for="mail-password">(i18n::t(lang, Key::Password))</label> |
| 264 | 260 | <input id="mail-password" type="password" name="password" autocomplete="new-password" maxlength="1024"> |
| 265 | - <p class="hint">(password_hint)</p> | |
| 266 | 261 | </div> |
| 262 | + if !data.has_password { | |
| 263 | + <p class="state">(g::t(lang, K::NoPasswordStored))</p> | |
| 264 | + } | |
| 267 | 265 | </div> |
| 268 | 266 | </section> |
| 269 | 267 | <section class="sec"> |
| @@ -299,7 +297,6 @@ async fn mail_view( | ||
| 299 | 297 | <a class="act" href=(chip.href.as_str()) aria-current=(chip.current.then_some("page"))>(chip.label) " (" (chip.count) ")"</a> |
| 300 | 298 | } |
| 301 | 299 | </div> |
| 302 | - <p class="hint">(g::t(lang, K::MailQueueIntro))</p> | |
| 303 | 300 | if queue.rows.is_empty() { |
| 304 | 301 | if queue.filter_param.is_empty() { |
| 305 | 302 | <p class="state">(g::t(lang, K::MailQueueEmpty))</p> |
| @@ -323,7 +320,7 @@ async fn mail_view( | ||
| 323 | 320 | </span> |
| 324 | 321 | if row.failed { |
| 325 | 322 | post_act(label: g::t(lang, K::MailRetryNow), action: "/admin/mail/queue/retry", csrf: csrf.as_str(), fields: vec![("id".to_owned(), row.id.clone()), ("state".to_owned(), filter_param.clone())]) |
| 326 | - confirm_act(lang: lang, label: g::t(lang, K::MailDiscard), action: "/admin/mail/queue/discard", csrf: csrf.as_str(), fields: vec![("id".to_owned(), row.id.clone()), ("state".to_owned(), filter_param.clone())], note: Some(crate::pages::passkeys::s(lang, "The message will not be sent.", "İleti gönderilmez.").to_owned())) | |
| 323 | + confirm_act(lang: lang, label: g::t(lang, K::MailDiscard), action: "/admin/mail/queue/discard", csrf: csrf.as_str(), fields: vec![("id".to_owned(), row.id.clone()), ("state".to_owned(), filter_param.clone())], note: None) | |
| 327 | 324 | } |
| 328 | 325 | </div> |
| 329 | 326 | } |
| @@ -376,6 +373,9 @@ async fn mail_events(cx: &Cx) -> Result<Response> { | ||
| 376 | 373 | struct SettingsForm { |
| 377 | 374 | #[serde(default)] |
| 378 | 375 | csrf: String, |
| 376 | + /// The delivery setting, saved as an override like the server settings. | |
| 377 | + #[serde(default, rename = "mail.transport")] | |
| 378 | + transport: String, | |
| 379 | 379 | #[serde(default)] |
| 380 | 380 | host: String, |
| 381 | 381 | #[serde(default)] |
| @@ -402,10 +402,25 @@ async fn mail_save(cx: &Cx, Form(form): Form<SettingsForm>) -> Result<Response> | ||
| 402 | 402 | } |
| 403 | 403 | let lang = i18n::lang(cx, Some(&viewer.0)); |
| 404 | 404 | let state = app_context::<AppState>(cx); |
| 405 | - let notice = match save_settings(cx, state, &viewer.0, &form, lang).await { | |
| 406 | - Ok(()) => g::t(lang, K::MailSettingsSaved).to_owned(), | |
| 407 | - Err(Error::Invalid(message)) => message, | |
| 408 | - Err(other) => other.to_string(), | |
| 405 | + let saved = save_settings(cx, state, &viewer.0, &form, lang).await; | |
| 406 | + let transport = if form.transport.is_empty() { | |
| 407 | + Ok(None) | |
| 408 | + } else { | |
| 409 | + let posted = HashMap::from([("mail.transport".to_owned(), form.transport.clone())]); | |
| 410 | + save_topic( | |
| 411 | + cx, | |
| 412 | + state, | |
| 413 | + &viewer.0, | |
| 414 | + Group::Integrations, | |
| 415 | + MAIL_KEYS, | |
| 416 | + posted, | |
| 417 | + lang, | |
| 418 | + ) | |
| 419 | + .await | |
| 420 | + }; | |
| 421 | + let notice = match (saved, transport) { | |
| 422 | + (Ok(()), Ok(_)) => g::t(lang, K::MailSettingsSaved).to_owned(), | |
| 423 | + (Err(error), _) | (Ok(()), Err(error)) => refusal(error), | |
| 409 | 424 | }; |
| 410 | 425 | let location = format!("/admin/mail?notice={}", enc(¬ice)); |
| 411 | 426 | Err(see_other(&location).into()) |
crates/forge-web/src/pages/admin_replication.rsmodified+84 -68
| @@ -1,13 +1,16 @@ | ||
| 1 | 1 | //! Page: standby replication (`/admin/replication`). Instance admins only; anyone else gets 404. |
| 2 | 2 | //! |
| 3 | -//! Shows the `[replication]` target, the last database snapshot shipped, and one row per repo | |
| 4 | -//! with its health: ok, lagging (no success within twice the interval), error, or never replicated. | |
| 3 | +//! Shows the replication settings as a settings topic, saved here (`POST /admin/replication`, the | |
| 4 | +//! same rows and save as the server settings), the last database snapshot shipped, and one row per | |
| 5 | +//! repo with its health: ok, lagging (no success within twice the interval), error, or never | |
| 6 | +//! replicated. The rail beside the page holds Backups too. | |
| 5 | 7 | //! "Reconcile now" queues a full pass for the worker. It is a POST with a CSRF token, and it is |
| 6 | 8 | //! audited as `replication_reconcile_started`. |
| 7 | 9 | |
| 8 | 10 | use std::collections::HashMap; |
| 9 | 11 | use std::time::Duration; |
| 10 | 12 | |
| 13 | +use forge_core::server_settings::Group; | |
| 11 | 14 | use forge_core::store::replication::{DB_SUBJECT, ReplicationStatus}; |
| 12 | 15 | use forge_core::time::stamp_ago; |
| 13 | 16 | use forge_core::{AuditAction, Error}; |
| @@ -23,16 +26,21 @@ use topcoat::view::{View, component, view}; | ||
| 23 | 26 | use crate::audit::{self, Actor, Target}; |
| 24 | 27 | use crate::auth::check_csrf; |
| 25 | 28 | use crate::i18n::admin::{self as g, K}; |
| 26 | -use crate::i18n::{self, Lang}; | |
| 29 | +use crate::i18n::{self, Key, Lang}; | |
| 27 | 30 | use crate::live::{Topic, stream_changes}; |
| 31 | +use crate::pages::admin_backups::backups_rail; | |
| 32 | +use crate::pages::admin_server::{ | |
| 33 | + REPLICATION_KEYS, Row, notice_of, reset_form, save_topic, setting_lines, setting_rows, | |
| 34 | + with_notice, | |
| 35 | +}; | |
| 28 | 36 | use crate::pages::admin_users::admin_only; |
| 29 | -use crate::state::AppState; | |
| 30 | 37 | use crate::pages::issues_list::list_href; |
| 31 | 38 | use crate::pages::passkeys::s; |
| 39 | +use crate::state::AppState; | |
| 32 | 40 | use crate::views::find::{Finder, finder_field}; |
| 33 | -use crate::views::parts::{SubPart, head, post_act}; | |
| 41 | +use crate::views::parts::{head, post_act}; | |
| 34 | 42 | use crate::views::repo_list::{PageLink, pager, pager_links}; |
| 35 | -use crate::views::{enc, rel_time_or_never, shell}; | |
| 43 | +use crate::views::{alert, enc, rel_time_or_never, shell}; | |
| 36 | 44 | |
| 37 | 45 | #[query_params(error = bad_request)] |
| 38 | 46 | pub(crate) struct NoticeQuery { |
| @@ -148,14 +156,11 @@ impl RepoRow { | ||
| 148 | 156 | /// Everything the page shows, already formatted. |
| 149 | 157 | struct PageData { |
| 150 | 158 | enabled: bool, |
| 151 | - target: String, | |
| 152 | 159 | db_dot: &'static str, |
| 153 | 160 | db_health: &'static str, |
| 154 | 161 | db_last_ok: Option<String>, |
| 155 | 162 | db_last_attempt: Option<String>, |
| 156 | 163 | db_error: String, |
| 157 | - interval: String, | |
| 158 | - healthcheck: &'static str, | |
| 159 | 164 | repos: Vec<RepoRow>, |
| 160 | 165 | } |
| 161 | 166 | |
| @@ -213,18 +218,11 @@ async fn page_data(state: &AppState, lang: Lang) -> forge_core::Result<PageData> | ||
| 213 | 218 | |
| 214 | 219 | Ok(PageData { |
| 215 | 220 | enabled: config.enabled(), |
| 216 | - target: config.target.clone(), | |
| 217 | 221 | db_dot: health(db, &db_cutoff).dot(), |
| 218 | 222 | db_health: health(db, &db_cutoff).label(lang), |
| 219 | 223 | db_last_ok: db.and_then(|s| s.last_ok_at.clone()), |
| 220 | 224 | db_last_attempt: db.and_then(|s| s.last_attempt_at.clone()), |
| 221 | 225 | db_error: db.and_then(|s| s.last_error.clone()).unwrap_or_default(), |
| 222 | - interval: g::interval_line(lang, config.db_snapshot_minutes, config.reconcile_minutes), | |
| 223 | - healthcheck: if config.healthcheck_url.is_empty() { | |
| 224 | - g::t(lang, K::HealthcheckNotSet) | |
| 225 | - } else { | |
| 226 | - g::t(lang, K::HealthcheckSet) | |
| 227 | - }, | |
| 228 | 226 | repos, |
| 229 | 227 | }) |
| 230 | 228 | } |
| @@ -234,6 +232,7 @@ async fn replication_view( | ||
| 234 | 232 | lang: Lang, |
| 235 | 233 | csrf: String, |
| 236 | 234 | data: PageData, |
| 235 | + settings: Vec<Row>, | |
| 237 | 236 | notice: Option<String>, |
| 238 | 237 | list: RepoList, |
| 239 | 238 | ) -> Result<impl View> { |
| @@ -249,61 +248,56 @@ async fn replication_view( | ||
| 249 | 248 | let all_label = s(lang, "All", "Tümü"); |
| 250 | 249 | let health_label = s(lang, "Health", "Durum"); |
| 251 | 250 | let placeholder = s(lang, "Search repositories", "Depolarda ara"); |
| 252 | - let sub = vec![SubPart::text(g::t(lang, K::ReplicationIntro))]; | |
| 251 | + let db_error = format!("{}{}", g::t(lang, K::DatabaseErrorPrefix), data.db_error); | |
| 253 | 252 | Ok(view! { |
| 254 | - head(title: g::t(lang, K::Replication), sub: sub, | |
| 253 | + head(title: g::t(lang, K::Replication), | |
| 255 | 254 | post_act(label: g::t(lang, K::ReconcileNow), action: "/admin/replication/reconcile", csrf: csrf.as_str()) |
| 256 | 255 | ) |
| 257 | 256 | if let Some(message) = notice { |
| 258 | 257 | <p class="state" role="status">(message.as_str())</p> |
| 259 | 258 | } |
| 260 | - <div class="sheet" data-live="/admin/replication/events"> | |
| 261 | - if data.enabled { | |
| 259 | + <div class="work"> | |
| 260 | + backups_rail(lang: lang, current: "replication") | |
| 261 | + <div class="sheet" data-live="/admin/replication/events"> | |
| 262 | 262 | <section class="sec"> |
| 263 | - <h2>(crate::pages::passkeys::s(lang, "Target and schedule", "Hedef ve zamanlama"))</h2> | |
| 264 | - <div class="line" data-kb-row=""> | |
| 265 | - <span class="name">(g::t(lang, K::ReplicationTarget))</span> | |
| 266 | - <span class="val"><code>(data.target.as_str())</code></span> | |
| 267 | - </div> | |
| 268 | - <div class="line" data-kb-row=""> | |
| 269 | - <span class="name">(g::t(lang, K::Interval))</span> | |
| 270 | - <span class="val">(data.interval.as_str())</span> | |
| 271 | - </div> | |
| 272 | - <div class="line" data-kb-row=""> | |
| 273 | - <span class="name">(g::t(lang, K::Healthcheck))</span> | |
| 274 | - <span class="val">(data.healthcheck)</span> | |
| 275 | - </div> | |
| 276 | - </section> | |
| 277 | - <section class="sec"> | |
| 278 | - <h2>(crate::pages::passkeys::s(lang, "Status", "Durum"))</h2> | |
| 279 | - <div class="line" data-kb-row=""> | |
| 280 | - <span class="name">(g::t(lang, K::Database))</span> | |
| 281 | - <span class="val"><span class=(data.db_dot) aria-hidden="true"></span> (data.db_health)</span> | |
| 282 | - </div> | |
| 283 | - if !data.db_error.is_empty() { | |
| 284 | - <p class="hint bad">(g::t(lang, K::DatabaseErrorPrefix))(data.db_error.as_str())</p> | |
| 263 | + <h2>(g::t(lang, K::Settings))</h2> | |
| 264 | + if !data.enabled { | |
| 265 | + <p class="state">(g::t(lang, K::ReplicationOff))</p> | |
| 285 | 266 | } |
| 286 | - <div class="line" data-kb-row=""> | |
| 287 | - <span class="name">(g::t(lang, K::LastDbSnapshotShipped))</span> | |
| 288 | - <span class="val">rel_time_or_never(lang: lang, stamp: data.db_last_ok.as_deref())</span> | |
| 289 | - </div> | |
| 290 | - <div class="line" data-kb-row=""> | |
| 291 | - <span class="name">(g::t(lang, K::LastDbAttempt))</span> | |
| 292 | - <span class="val">rel_time_or_never(lang: lang, stamp: data.db_last_attempt.as_deref())</span> | |
| 293 | - </div> | |
| 294 | - </section> | |
| 295 | - } else { | |
| 296 | - <section class="sec"> | |
| 297 | - <h2>(g::t(lang, K::Replication))</h2> | |
| 298 | - <p class="state">(g::t(lang, K::ReplicationOff))</p> | |
| 267 | + <form method="post" action="/admin/replication" class="srv-form"> | |
| 268 | + <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 269 | + <input type="hidden" name="back" value="/admin/replication"> | |
| 270 | + setting_lines(lang: lang, rows: settings) | |
| 271 | + <div class="acts srv-save"> | |
| 272 | + <button type="submit" class="primary">(i18n::t(lang, Key::Save))</button> | |
| 273 | + </div> | |
| 274 | + </form> | |
| 275 | + reset_form(csrf: csrf.clone(), back: "/admin/replication".to_owned()) | |
| 299 | 276 | </section> |
| 300 | - } | |
| 277 | + if data.enabled { | |
| 278 | + <section class="sec"> | |
| 279 | + <h2>(crate::pages::passkeys::s(lang, "Status", "Durum"))</h2> | |
| 280 | + <div class="line" data-kb-row=""> | |
| 281 | + <span class="name">(g::t(lang, K::Database))</span> | |
| 282 | + <span class="val"><span class=(data.db_dot) aria-hidden="true"></span> (data.db_health)</span> | |
| 283 | + </div> | |
| 284 | + if !data.db_error.is_empty() { | |
| 285 | + alert(message: db_error.as_str()) | |
| 286 | + } | |
| 287 | + <div class="line" data-kb-row=""> | |
| 288 | + <span class="name">(g::t(lang, K::LastDbSnapshotShipped))</span> | |
| 289 | + <span class="val">rel_time_or_never(lang: lang, stamp: data.db_last_ok.as_deref())</span> | |
| 290 | + </div> | |
| 291 | + <div class="line" data-kb-row=""> | |
| 292 | + <span class="name">(g::t(lang, K::LastDbAttempt))</span> | |
| 293 | + <span class="val">rel_time_or_never(lang: lang, stamp: data.db_last_attempt.as_deref())</span> | |
| 294 | + </div> | |
| 295 | + </section> | |
| 296 | + } | |
| 301 | 297 | <section class="sec"> |
| 302 | 298 | <h2>(g::t(lang, K::Repos))</h2> |
| 303 | 299 | if !has_repos { |
| 304 | 300 | <p class="state">(g::t(lang, K::NoReposYet))</p> |
| 305 | - <p class="hint">(g::t(lang, K::ReposEmptyHint))</p> | |
| 306 | - <p class="hint">(g::t(lang, K::ReplicationConfigHint))</p> | |
| 307 | 301 | } else { |
| 308 | 302 | <form class="sec-tools" method="get" action="/admin/replication" role="search"> |
| 309 | 303 | finder_field(lang: lang, finder: finder, placeholder: placeholder, id: Some("replication-q")) |
| @@ -328,12 +322,13 @@ async fn replication_view( | ||
| 328 | 322 | <span class="val"><span class=(row.dot) aria-hidden="true"></span> <span class=(row.tone)>(row.health)</span> " · " (g::t(lang, K::LastSuccess)) ": " rel_time_or_never(lang: lang, stamp: row.last_ok.as_deref())</span> |
| 329 | 323 | </div> |
| 330 | 324 | if !row.error.is_empty() { |
| 331 | - <p class="hint bad">(row.error.as_str())</p> | |
| 325 | + alert(message: row.error.as_str()) | |
| 332 | 326 | } |
| 333 | 327 | } |
| 334 | 328 | } |
| 335 | 329 | </section> |
| 336 | 330 | pager(page: page, pages: pages, links: links, prev: prev, next: next, lang: lang) |
| 331 | + </div> | |
| 337 | 332 | </div> |
| 338 | 333 | }) |
| 339 | 334 | } |
| @@ -348,14 +343,8 @@ async fn page_fingerprint(state: &AppState) -> Result<String> { | ||
| 348 | 343 | .map(|row| (&row.name, row.health, &row.last_ok, &row.error)) |
| 349 | 344 | .collect(); |
| 350 | 345 | Ok(format!( |
| 351 | - "{}|{}|{:?}|{:?}|{}|{}|{:?}", | |
| 352 | - data.enabled, | |
| 353 | - data.db_health, | |
| 354 | - data.db_last_ok, | |
| 355 | - data.db_last_attempt, | |
| 356 | - data.db_error, | |
| 357 | - data.target, | |
| 358 | - rows | |
| 346 | + "{}|{}|{:?}|{:?}|{}|{:?}", | |
| 347 | + data.enabled, data.db_health, data.db_last_ok, data.db_last_attempt, data.db_error, rows | |
| 359 | 348 | )) |
| 360 | 349 | } |
| 361 | 350 | |
| @@ -439,13 +428,39 @@ async fn replication_page(cx: &Cx) -> Result<impl View> { | ||
| 439 | 428 | let state = app_context::<AppState>(cx); |
| 440 | 429 | let mut data = page_data(state, lang).await?; |
| 441 | 430 | let list = repo_list(&mut data, query); |
| 431 | + let settings = setting_rows(state, lang, REPLICATION_KEYS).await?; | |
| 442 | 432 | let csrf = viewer.1.csrf_token.clone(); |
| 443 | 433 | let title = g::t(lang, K::Replication); |
| 444 | 434 | Ok(view! { |
| 445 | - shell(title: title, viewer: Some(&viewer), replication_view(lang: lang, csrf: csrf, data: data, notice: query.notice.clone(), list: list)) | |
| 435 | + shell(title: title, viewer: Some(&viewer), replication_view(lang: lang, csrf: csrf, data: data, settings: settings, notice: query.notice.clone(), list: list)) | |
| 446 | 436 | }) |
| 447 | 437 | } |
| 448 | 438 | |
| 439 | +/// Saves the replication settings from the page's form. Admins only, with the CSRF token. | |
| 440 | +#[route(POST "/admin/replication")] | |
| 441 | +async fn replication_save(cx: &Cx, Form(form): Form<HashMap<String, String>>) -> Result<Response> { | |
| 442 | + let viewer = admin_only(cx).await?; | |
| 443 | + if !check_csrf(&viewer.1, form.get("csrf").map_or("", String::as_str)) { | |
| 444 | + return Err(forbidden().into()); | |
| 445 | + } | |
| 446 | + let lang = i18n::lang(cx, Some(&viewer.0)); | |
| 447 | + let state = app_context::<AppState>(cx); | |
| 448 | + let notice = notice_of( | |
| 449 | + lang, | |
| 450 | + save_topic( | |
| 451 | + cx, | |
| 452 | + state, | |
| 453 | + &viewer.0, | |
| 454 | + Group::Backups, | |
| 455 | + REPLICATION_KEYS, | |
| 456 | + form, | |
| 457 | + lang, | |
| 458 | + ) | |
| 459 | + .await, | |
| 460 | + ); | |
| 461 | + Err(see_other(with_notice("/admin/replication", ¬ice)).into()) | |
| 462 | +} | |
| 463 | + | |
| 449 | 464 | #[derive(Deserialize)] |
| 450 | 465 | struct ReconcileForm { |
| 451 | 466 | #[serde(default)] |
| @@ -531,6 +546,7 @@ mod tests { | ||
| 531 | 546 | config.replication.target = TARGET.into(); |
| 532 | 547 | } |
| 533 | 548 | state.config = std::sync::Arc::new(config); |
| 549 | + state.settings = crate::state::settings_for(&state.config); | |
| 534 | 550 | let admin = state |
| 535 | 551 | .store |
| 536 | 552 | .create_user("root", None, "h", true) |
crates/forge-web/src/pages/admin_runners.rsmodified+56 -186
| @@ -64,20 +64,20 @@ fn s(lang: Lang, en: &'static str, tr: &'static str) -> &'static str { | ||
| 64 | 64 | const EXTRA_NOTICES: [(&str, &str, &str, bool); 8] = [ |
| 65 | 65 | ( |
| 66 | 66 | "saved", |
| 67 | - "Saved. The runner picks it up on its next check-in.", | |
| 68 | - "Kaydedildi. Çalıştırıcı bir sonraki yoklamasında uygular.", | |
| 67 | + "Saved.", | |
| 68 | + "Kaydedildi.", | |
| 69 | 69 | false, |
| 70 | 70 | ), |
| 71 | 71 | ( |
| 72 | 72 | "saved-restart", |
| 73 | - "Saved. It applies when the runner next starts.", | |
| 74 | - "Kaydedildi. Çalıştırıcı yeniden başlayınca uygulanır.", | |
| 73 | + "Saved.", | |
| 74 | + "Kaydedildi.", | |
| 75 | 75 | false, |
| 76 | 76 | ), |
| 77 | 77 | ( |
| 78 | 78 | "reset", |
| 79 | - "Override removed. The runner.toml value is used again.", | |
| 80 | - "Üzerine yazma kaldırıldı. runner.toml değeri yeniden kullanılıyor.", | |
| 79 | + "Override removed.", | |
| 80 | + "Üzerine yazma kaldırıldı.", | |
| 81 | 81 | false, |
| 82 | 82 | ), |
| 83 | 83 | ( |
| @@ -88,8 +88,8 @@ const EXTRA_NOTICES: [(&str, &str, &str, bool); 8] = [ | ||
| 88 | 88 | ), |
| 89 | 89 | ( |
| 90 | 90 | "restart-requested", |
| 91 | - "Restart requested. The runner restarts as soon as it sees the request.", | |
| 92 | - "Yeniden başlatma istendi. Çalıştırıcı isteği görür görmez yeniden başlar.", | |
| 91 | + "Restart requested.", | |
| 92 | + "Yeniden başlatma istendi.", | |
| 93 | 93 | false, |
| 94 | 94 | ), |
| 95 | 95 | ( |
| @@ -329,7 +329,6 @@ async fn runners_view( | ||
| 329 | 329 | pages: u64, |
| 330 | 330 | nav: (Vec<PageLink>, Option<String>, Option<String>), |
| 331 | 331 | notice: Option<(&'static str, bool)>, |
| 332 | - note: String, | |
| 333 | 332 | ) -> Result<impl View> { |
| 334 | 333 | let (links, prev, next) = nav; |
| 335 | 334 | Ok(view! { |
| @@ -365,14 +364,12 @@ async fn runners_view( | ||
| 365 | 364 | pager(page: page, pages: pages, links: links, prev: prev, next: next, lang: lang) |
| 366 | 365 | } |
| 367 | 366 | </section> |
| 368 | - <section class="sec"> | |
| 369 | - <h2>(g::t(lang, K::AddARunner))</h2> | |
| 370 | - <p class="hint">(note.as_str())</p> | |
| 371 | - if rows.is_empty() { | |
| 372 | - <p class="hint">(g::t(lang, K::RunnersEmptyHint))</p> | |
| 367 | + if rows.is_empty() { | |
| 368 | + <section class="sec"> | |
| 369 | + <h2>(g::t(lang, K::AddARunner))</h2> | |
| 373 | 370 | <pre><code>"forge runner register --url <forge-url> --token <token> --name <name> --labels linux,x86_64"</code></pre> |
| 374 | - } | |
| 375 | - </section> | |
| 371 | + </section> | |
| 372 | + } | |
| 376 | 373 | </div> |
| 377 | 374 | }) |
| 378 | 375 | } |
| @@ -407,7 +404,7 @@ pub(crate) async fn confirm_post( | ||
| 407 | 404 | for (name, value) in fields.iter() { |
| 408 | 405 | <input type="hidden" name=(*name) value=(value.as_str())> |
| 409 | 406 | } |
| 410 | - <p class="hint">(message)</p> | |
| 407 | + <p class="state">(message)</p> | |
| 411 | 408 | <div class="acts"> |
| 412 | 409 | <button type="submit" class="small">(confirm)</button> |
| 413 | 410 | <button type="button" class="act" data-close-details="">(s(lang, "Keep it", "Vazgeç"))</button> |
| @@ -419,20 +416,20 @@ pub(crate) async fn confirm_post( | ||
| 419 | 416 | |
| 420 | 417 | fn delete_message(lang: Lang, name: &str) -> String { |
| 421 | 418 | match lang { |
| 422 | - Lang::Tr => format!("{name} silinsin mi? Makinenin sonrasında yeniden kaydolması gerekir."), | |
| 423 | - _ => format!("Delete runner {name}? The machine has to register again afterwards."), | |
| 419 | + Lang::Tr => format!("{name} silinsin mi?"), | |
| 420 | + _ => format!("Delete runner {name}?"), | |
| 424 | 421 | } |
| 425 | 422 | } |
| 426 | 423 | |
| 427 | 424 | fn disable_message(lang: Lang, name: &str) -> String { |
| 428 | 425 | match lang { |
| 429 | - Lang::Tr => format!("{name} devre dışı bırakılsın mı? Yeni iş almayı bırakır."), | |
| 430 | - _ => format!("Disable runner {name}? It stops taking new jobs."), | |
| 426 | + Lang::Tr => format!("{name} devre dışı bırakılsın mı?"), | |
| 427 | + _ => format!("Disable runner {name}?"), | |
| 431 | 428 | } |
| 432 | 429 | } |
| 433 | 430 | |
| 434 | 431 | /// The restart control of a runner: a confirm popover with the two ways to restart. A runner that |
| 435 | -/// reports no boot id is too old to obey, so the control is off with a hint. While a restart is | |
| 432 | +/// reports no boot id is too old to obey, so the control is off with a fact. While a restart is | |
| 436 | 433 | /// pending the control shows that instead, and the runner clears it by coming back with a new id. |
| 437 | 434 | #[component] |
| 438 | 435 | async fn restart_control( |
| @@ -445,18 +442,16 @@ async fn restart_control( | ||
| 445 | 442 | ) -> Result<impl View> { |
| 446 | 443 | Ok(view! { |
| 447 | 444 | if pending.is_some() { |
| 448 | - <p class="hint">(if pending == Some(RestartMode::Now) { s(lang, "Restarting now...", "Şimdi yeniden başlatılıyor...") } else { s(lang, "Restarting after the current jobs...", "Mevcut işlerden sonra yeniden başlatılıyor...") })</p> | |
| 445 | + <p class="state">(if pending == Some(RestartMode::Now) { s(lang, "Restarting now...", "Şimdi yeniden başlatılıyor...") } else { s(lang, "Restarting after the current jobs...", "Mevcut işlerden sonra yeniden başlatılıyor...") })</p> | |
| 449 | 446 | } else if can_restart { |
| 450 | 447 | reveal(label: s(lang, "Restart", "Yeniden başlat"), |
| 451 | - <p class="hint">(s(lang, "Restart this runner? It stops taking new jobs first.", "Bu çalıştırıcı yeniden başlatılsın mı? Önce yeni iş almayı bırakır."))</p> | |
| 452 | - <p class="hint">(s(lang, "The running jobs finish, then it restarts.", "Çalışan işler biter, sonra yeniden başlar."))</p> | |
| 453 | 448 | <div class="acts"> |
| 454 | 449 | post_act(label: s(lang, "Restart after current jobs", "Mevcut işlerden sonra yeniden başlat"), action: action, csrf: csrf, fields: vec![("mode".to_owned(), "drain".to_owned()), ("back".to_owned(), back.to_owned())]) |
| 455 | - confirm_act(lang: lang, label: s(lang, "Restart now", "Şimdi yeniden başlat"), action: action, csrf: csrf, fields: vec![("mode".to_owned(), "now".to_owned()), ("back".to_owned(), back.to_owned())], note: Some(s(lang, "The running jobs end as cancelled and can be run again.", "Çalışan işler iptal edilmiş olarak biter ve yeniden çalıştırılabilir.").to_owned())) | |
| 450 | + confirm_act(lang: lang, label: s(lang, "Restart now", "Şimdi yeniden başlat"), action: action, csrf: csrf, fields: vec![("mode".to_owned(), "now".to_owned()), ("back".to_owned(), back.to_owned())], note: None) | |
| 456 | 451 | </div> |
| 457 | 452 | ) |
| 458 | 453 | } else { |
| 459 | - <p class="hint">(s(lang, "Runner too old, update it first", "Çalıştırıcı çok eski, önce güncelleyin"))</p> | |
| 454 | + <p class="state">(s(lang, "Runner too old, update it first", "Çalıştırıcı çok eski, önce güncelleyin"))</p> | |
| 460 | 455 | } |
| 461 | 456 | }) |
| 462 | 457 | } |
| @@ -501,12 +496,10 @@ async fn token_view( | ||
| 501 | 496 | lang: Lang, |
| 502 | 497 | token: String, |
| 503 | 498 | command: String, |
| 504 | - expiry: String, | |
| 505 | 499 | ) -> Result<impl View> { |
| 506 | 500 | Ok(view! { |
| 507 | 501 | head(title: g::t(lang, K::RegistrationToken)) |
| 508 | 502 | <p class="state" role="status"><strong>(g::t(lang, K::CopyTokenNow))</strong></p> |
| 509 | - <p class="hint">(expiry.as_str())</p> | |
| 510 | 503 | <div class="sheet"> |
| 511 | 504 | <div class="sheet-tools"><strong>(g::t(lang, K::Token))</strong> <a class="act" href="/admin/runners">(g::t(lang, K::BackToRunners))</a></div> |
| 512 | 505 | <section class="sec" data-once=""> |
| @@ -515,7 +508,6 @@ async fn token_view( | ||
| 515 | 508 | <button type="button" class="act" data-copy="reg-token" data-copied=(s(lang, "Copied", "Kopyalandı")) data-failed=(s(lang, "Failed", "Başarısız"))>(s(lang, "Copy", "Kopyala"))</button> |
| 516 | 509 | </div> |
| 517 | 510 | <h2>(g::t(lang, K::RegisterARunner))</h2> |
| 518 | - <p class="hint">(g::t(lang, K::ReplacePrefix))<code>"<name>"</code>(g::t(lang, K::ReplaceSuffix))</p> | |
| 519 | 511 | <div class="copy-box"> |
| 520 | 512 | <code id="reg-command">(command.as_str())</code> |
| 521 | 513 | <button type="button" class="act" data-copy="reg-command" data-copied=(s(lang, "Copied", "Kopyalandı")) data-failed=(s(lang, "Failed", "Başarısız"))>(s(lang, "Copy", "Kopyala"))</button> |
| @@ -560,13 +552,9 @@ async fn runners_page(cx: &Cx) -> Result<impl View> { | ||
| 560 | 552 | String::new() |
| 561 | 553 | }; |
| 562 | 554 | let nav = pager_links(page as u64, pages as u64, |n| list_href(n, &kept)); |
| 563 | - let note = g::token_ttl_note( | |
| 564 | - lang, | |
| 565 | - &g::hours_text(lang, state.live().ci.registration_token_hours), | |
| 566 | - ); | |
| 567 | 555 | let title = g::t(lang, K::CiRunners); |
| 568 | 556 | Ok(view! { |
| 569 | - shell(title: title, viewer: Some(&viewer), runners_view(lang: lang, csrf: csrf, rows: rows, page: page as u64, pages: pages as u64, nav: nav, notice: notice, note: note)) | |
| 557 | + shell(title: title, viewer: Some(&viewer), runners_view(lang: lang, csrf: csrf, rows: rows, page: page as u64, pages: pages as u64, nav: nav, notice: notice)) | |
| 570 | 558 | }) |
| 571 | 559 | } |
| 572 | 560 | |
| @@ -606,10 +594,9 @@ async fn runner_token_create(cx: &Cx, Form(form): Form<CsrfForm>) -> Result<impl | ||
| 606 | 594 | ) |
| 607 | 595 | .await; |
| 608 | 596 | let command = register_command(&state.config.base_url, &token); |
| 609 | - let expiry = g::token_expiry_line(lang, &g::hours_text(lang, ttl_hours)); | |
| 610 | 597 | let title = g::t(lang, K::RegistrationToken); |
| 611 | 598 | Ok(view! { |
| 612 | - shell(title: title, viewer: Some(&viewer), token_view(lang: lang, token: token, command: command, expiry: expiry)) | |
| 599 | + shell(title: title, viewer: Some(&viewer), token_view(lang: lang, token: token, command: command)) | |
| 613 | 600 | }) |
| 614 | 601 | } |
| 615 | 602 | |
| @@ -816,143 +803,30 @@ fn tab_from_query(cx: &Cx) -> &'static str { | ||
| 816 | 803 | tab_slug(wanted.as_deref()) |
| 817 | 804 | } |
| 818 | 805 | |
| 819 | -/// The human label and the one-line hint of a config field. | |
| 820 | -fn field_text(lang: Lang, key: &str) -> (&'static str, &'static str) { | |
| 806 | +/// The human label of a config field. | |
| 807 | +fn field_text(lang: Lang, key: &str) -> &'static str { | |
| 821 | 808 | match key { |
| 822 | - "concurrency" => ( | |
| 823 | - s(lang, "Concurrency", "Eşzamanlılık"), | |
| 824 | - s( | |
| 825 | - lang, | |
| 826 | - "Jobs this runner runs at once, 1 to 64.", | |
| 827 | - "Bu çalıştırıcının aynı anda yürüttüğü iş sayısı, 1 ile 64 arası.", | |
| 828 | - ), | |
| 829 | - ), | |
| 830 | - "labels" => ( | |
| 831 | - s(lang, "Labels", "Etiketler"), | |
| 832 | - s( | |
| 833 | - lang, | |
| 834 | - "Comma separated. A job runs where its labels are all present.", | |
| 835 | - "Virgülle ayrılır. İş, etiketlerinin hepsinin bulunduğu yerde çalışır.", | |
| 836 | - ), | |
| 837 | - ), | |
| 838 | - "executor" => ( | |
| 839 | - s(lang, "Executor", "Yürütücü"), | |
| 840 | - s( | |
| 841 | - lang, | |
| 842 | - "How jobs run: builtin on the host, or podman in containers.", | |
| 843 | - "İşlerin nasıl çalışacağı: sunucuda yerleşik ya da podman kapsayıcılarında.", | |
| 844 | - ), | |
| 845 | - ), | |
| 846 | - "auto_update" => ( | |
| 847 | - s(lang, "Auto update", "Otomatik güncelleme"), | |
| 848 | - s( | |
| 849 | - lang, | |
| 850 | - "Replace the runner when the forge offers a newer build.", | |
| 851 | - "Forge daha yeni bir sürüm sunduğunda çalıştırıcıyı güncelle.", | |
| 852 | - ), | |
| 853 | - ), | |
| 854 | - "limits.memory" => ( | |
| 855 | - s(lang, "Memory limit", "Bellek sınırı"), | |
| 856 | - s( | |
| 857 | - lang, | |
| 858 | - "Per job, for example 2g or 512m.", | |
| 859 | - "İş başına, örneğin 2g veya 512m.", | |
| 860 | - ), | |
| 861 | - ), | |
| 862 | - "limits.reserve_memory" => ( | |
| 863 | - s(lang, "Default reservation", "Varsayılan ayırma"), | |
| 864 | - s( | |
| 865 | - lang, | |
| 866 | - "Memory held for a job that declares no memory, for example 1g.", | |
| 867 | - "Bellek bildirmeyen bir iş için ayrılan bellek, örneğin 1g.", | |
| 868 | - ), | |
| 869 | - ), | |
| 870 | - "limits.memory_budget" => ( | |
| 871 | - s(lang, "Memory budget", "Bellek bütçesi"), | |
| 872 | - s( | |
| 873 | - lang, | |
| 874 | - "All running jobs together may reserve this much: auto, or a size such as 6g.", | |
| 875 | - "Çalışan işlerin toplamda ayırabileceği bellek: auto veya 6g gibi bir boyut.", | |
| 876 | - ), | |
| 877 | - ), | |
| 878 | - "limits.cpus" => ( | |
| 879 | - s(lang, "CPU limit", "CPU sınırı"), | |
| 880 | - s( | |
| 881 | - lang, | |
| 882 | - "Per job, for example 2 or 1.5.", | |
| 883 | - "İş başına, örneğin 2 veya 1.5.", | |
| 884 | - ), | |
| 885 | - ), | |
| 886 | - "limits.pids" => ( | |
| 887 | - s(lang, "Process limit", "İşlem sınırı"), | |
| 888 | - s( | |
| 889 | - lang, | |
| 890 | - "Most processes one job may have running.", | |
| 891 | - "Bir işin aynı anda çalıştırabileceği en çok işlem.", | |
| 892 | - ), | |
| 893 | - ), | |
| 894 | - "work_dir" => ( | |
| 895 | - s(lang, "Work directory", "Çalışma dizini"), | |
| 896 | - s( | |
| 897 | - lang, | |
| 898 | - "Where checkouts and job files live on the runner host.", | |
| 899 | - "Çıkışların ve iş dosyalarının çalıştırıcı sunucusundaki yeri.", | |
| 900 | - ), | |
| 901 | - ), | |
| 902 | - "limits.image_max_gb" => ( | |
| 903 | - s( | |
| 904 | - lang, | |
| 905 | - "Image cache max (GB)", | |
| 906 | - "Kalıp önbelleği üst sınırı (GB)", | |
| 907 | - ), | |
| 908 | - s( | |
| 909 | - lang, | |
| 910 | - "Upper bound for stored container images.", | |
| 911 | - "Saklanan kapsayıcı kalıpları için üst sınır.", | |
| 912 | - ), | |
| 913 | - ), | |
| 914 | - "limits.job_disk_gb" => ( | |
| 915 | - s(lang, "Disk per job (GB)", "İş başına disk (GB)"), | |
| 916 | - s( | |
| 917 | - lang, | |
| 918 | - "A job that fills more than this (workspace, /tmp and its writes over the image) is stopped. 0 means no cap.", | |
| 919 | - "Bundan fazlasını (çalışma alanı, /tmp ve kalıbın üstüne yazdıkları) dolduran iş durdurulur. 0 sınır yok demektir.", | |
| 920 | - ), | |
| 921 | - ), | |
| 922 | - "images.keep_days" => ( | |
| 923 | - s(lang, "Keep images (days)", "Kalıpları sakla (gün)"), | |
| 924 | - s( | |
| 925 | - lang, | |
| 926 | - "Unused images older than this are removed.", | |
| 927 | - "Bundan eski ve kullanılmayan kalıplar silinir.", | |
| 928 | - ), | |
| 929 | - ), | |
| 930 | - "cache_max_gib" => ( | |
| 931 | - s( | |
| 932 | - lang, | |
| 933 | - "Build cache max (GiB)", | |
| 934 | - "Derleme önbelleği üst sınırı (GiB)", | |
| 935 | - ), | |
| 936 | - s( | |
| 937 | - lang, | |
| 938 | - "Upper bound for the shared build cache.", | |
| 939 | - "Ortak derleme önbelleği için üst sınır.", | |
| 940 | - ), | |
| 941 | - ), | |
| 942 | - "sandbox.userns" => ( | |
| 943 | - s(lang, "User namespaces", "Kullanıcı ad alanları"), | |
| 944 | - s( | |
| 945 | - lang, | |
| 946 | - "How the sandbox maps user ids: auto, single or subuid.", | |
| 947 | - "Kum havuzunun kullanıcı kimliklerini eşleme biçimi: auto, single veya subuid.", | |
| 948 | - ), | |
| 949 | - ), | |
| 950 | - "name" => (s(lang, "Name", "Ad"), ""), | |
| 951 | - "url" => (s(lang, "Forge URL", "Forge adresi"), ""), | |
| 952 | - "runner_id" => (s(lang, "Runner id", "Çalıştırıcı kimliği"), ""), | |
| 953 | - "runner_secret" => (s(lang, "Runner secret", "Çalıştırıcı sırrı"), ""), | |
| 954 | - "registry" => (s(lang, "Registry", "Kayıt sunucusu"), ""), | |
| 955 | - _ => ("", ""), | |
| 809 | + "concurrency" => s(lang, "Concurrency", "Eşzamanlılık"), | |
| 810 | + "labels" => s(lang, "Labels", "Etiketler"), | |
| 811 | + "executor" => s(lang, "Executor", "Yürütücü"), | |
| 812 | + "auto_update" => s(lang, "Auto update", "Otomatik güncelleme"), | |
| 813 | + "limits.memory" => s(lang, "Memory limit", "Bellek sınırı"), | |
| 814 | + "limits.reserve_memory" => s(lang, "Default reservation", "Varsayılan ayırma"), | |
| 815 | + "limits.memory_budget" => s(lang, "Memory budget", "Bellek bütçesi"), | |
| 816 | + "limits.cpus" => s(lang, "CPU limit", "CPU sınırı"), | |
| 817 | + "limits.pids" => s(lang, "Process limit", "İşlem sınırı"), | |
| 818 | + "work_dir" => s(lang, "Work directory", "Çalışma dizini"), | |
| 819 | + "limits.image_max_gb" => s(lang, "Image cache max (GB)", "Kalıp önbelleği üst sınırı (GB)"), | |
| 820 | + "limits.job_disk_gb" => s(lang, "Disk per job (GB)", "İş başına disk (GB)"), | |
| 821 | + "images.keep_days" => s(lang, "Keep images (days)", "Kalıpları sakla (gün)"), | |
| 822 | + "cache_max_gib" => s(lang, "Build cache max (GiB)", "Derleme önbelleği üst sınırı (GiB)"), | |
| 823 | + "sandbox.userns" => s(lang, "User namespaces", "Kullanıcı ad alanları"), | |
| 824 | + "name" => s(lang, "Name", "Ad"), | |
| 825 | + "url" => s(lang, "Forge URL", "Forge adresi"), | |
| 826 | + "runner_id" => s(lang, "Runner id", "Çalıştırıcı kimliği"), | |
| 827 | + "runner_secret" => s(lang, "Runner secret", "Çalıştırıcı sırrı"), | |
| 828 | + "registry" => s(lang, "Registry", "Kayıt sunucusu"), | |
| 829 | + _ => "", | |
| 956 | 830 | } |
| 957 | 831 | } |
| 958 | 832 | |
| @@ -972,7 +846,6 @@ type Choice = (&'static str, &'static str, bool); | ||
| 972 | 846 | struct DetailField { |
| 973 | 847 | key: &'static str, |
| 974 | 848 | label: &'static str, |
| 975 | - hint: &'static str, | |
| 976 | 849 | value: String, |
| 977 | 850 | kind_label: &'static str, |
| 978 | 851 | source_label: &'static str, |
| @@ -990,7 +863,7 @@ fn detail_fields(lang: Lang, tab: &str, fields: &[FieldRow]) -> Vec<DetailField> | ||
| 990 | 863 | .into_iter() |
| 991 | 864 | .filter_map(|key| fields.iter().find(|f| f.key == key)) |
| 992 | 865 | .map(|f| { |
| 993 | - let (label, hint) = field_text(lang, f.key); | |
| 866 | + let label = field_text(lang, f.key); | |
| 994 | 867 | let kind_label = if f.kind == FieldKind::Live { |
| 995 | 868 | g::t(lang, K::SrvKindLive) |
| 996 | 869 | } else { |
| @@ -1019,7 +892,6 @@ fn detail_fields(lang: Lang, tab: &str, fields: &[FieldRow]) -> Vec<DetailField> | ||
| 1019 | 892 | DetailField { |
| 1020 | 893 | key: f.key, |
| 1021 | 894 | label, |
| 1022 | - hint, | |
| 1023 | 895 | value: f.value.clone(), |
| 1024 | 896 | kind_label, |
| 1025 | 897 | source_label: source_text(lang, f.source), |
| @@ -1109,7 +981,7 @@ fn identity_rows(lang: Lang, fields: &[FieldRow]) -> Vec<(&'static str, String)> | ||
| 1109 | 981 | } else { |
| 1110 | 982 | f.value.clone() |
| 1111 | 983 | }; |
| 1112 | - (field_text(lang, f.key).0, value) | |
| 984 | + (field_text(lang, f.key), value) | |
| 1113 | 985 | }) |
| 1114 | 986 | .collect() |
| 1115 | 987 | } |
| @@ -1606,7 +1478,7 @@ async fn runner_detail_view( | ||
| 1606 | 1478 | <div class="mx-head"> |
| 1607 | 1479 | <h2 class="mx-caption">(c.caption.as_str())</h2> |
| 1608 | 1480 | if !fact.is_empty() { |
| 1609 | - <p class="hint mx-facts">(fact.as_str())</p> | |
| 1481 | + <p class="mx-facts">(fact.as_str())</p> | |
| 1610 | 1482 | } |
| 1611 | 1483 | if !c.legend.is_empty() { |
| 1612 | 1484 | <ul class="mx-legend"> |
| @@ -1654,7 +1526,7 @@ async fn runner_detail_view( | ||
| 1654 | 1526 | } |
| 1655 | 1527 | if metrics.empty { |
| 1656 | 1528 | <section class="sec"> |
| 1657 | - <p class="hint">(s(lang, "No metrics yet. A runner sends them from this version on; an older one sends nothing.", "Henüz ölçüm yok. Ölçümleri bu sürümden itibaren çalıştırıcı gönderir; eski sürüm hiçbir şey göndermez."))</p> | |
| 1529 | + <p class="state">(s(lang, "No metrics yet.", "Henüz ölçüm yok."))</p> | |
| 1658 | 1530 | </section> |
| 1659 | 1531 | } else { |
| 1660 | 1532 | <section class="sec"> |
| @@ -1684,8 +1556,7 @@ async fn runner_detail_view( | ||
| 1684 | 1556 | for (label, value) in identity.iter() { |
| 1685 | 1557 | <div class="line"><span class="name">(*label)</span><span class="val"><code class="srv-fixed">(value.as_str())</code></span></div> |
| 1686 | 1558 | } |
| 1687 | - <p class="hint">(g::t(lang, K::SrvKindReadOnly))</p> | |
| 1688 | - <p class="hint">(s(lang, "Set when the runner registered. These cannot be changed from the forge.", "Çalıştırıcı kaydolurken belirlenir. Forge üzerinden değiştirilemez."))</p> | |
| 1559 | + <p class="state">(g::t(lang, K::SrvKindReadOnly))</p> | |
| 1689 | 1560 | </section> |
| 1690 | 1561 | } else if editing { |
| 1691 | 1562 | <section class="sec"> |
| @@ -1706,8 +1577,7 @@ async fn runner_detail_view( | ||
| 1706 | 1577 | } else { |
| 1707 | 1578 | <input id=(format!("rf-{}", f.key)) type="text" name=(f.key) value=(f.value.as_str()) placeholder=(s(lang, "(from runner.toml)", "(runner.toml'dan)")) autocomplete="off" spellcheck="false"> |
| 1708 | 1579 | } |
| 1709 | - <p class="hint">(f.hint)</p> | |
| 1710 | - <p class="hint">(f.kind_label) " · " (f.source_label) | |
| 1580 | + <p class="state">(f.kind_label) " · " (f.source_label) | |
| 1711 | 1581 | if !f.pending_label.is_empty() { |
| 1712 | 1582 | " · " (f.pending_label) |
| 1713 | 1583 | } |
| @@ -1734,7 +1604,7 @@ async fn runner_detail_view( | ||
| 1734 | 1604 | } |
| 1735 | 1605 | <section class="sec"> |
| 1736 | 1606 | if log.is_empty() { |
| 1737 | - <p class="hint">(s(lang, "No log lines yet. Only a runner from the version that sends its log does so; an older runner sends nothing.", "Henüz günlük satırı yok. Günlüğünü yalnızca bunu destekleyen sürüm gönderir; eski sürüm hiçbir şey göndermez."))</p> | |
| 1607 | + <p class="state">(s(lang, "No log lines yet.", "Henüz günlük satırı yok."))</p> | |
| 1738 | 1608 | } else { |
| 1739 | 1609 | <pre id="runner-log" class="ci-log runner-log" role="log" aria-label=(s(lang, "Runner log", "Çalıştırıcı günlüğü"))> |
| 1740 | 1610 | for row in log.iter() { |
| @@ -1747,7 +1617,7 @@ async fn runner_detail_view( | ||
| 1747 | 1617 | <section class="sec"> |
| 1748 | 1618 | <h2>(s(lang, "Running now", "Şu an çalışan"))</h2> |
| 1749 | 1619 | if running_jobs.is_empty() { |
| 1750 | - <p class="hint">(s(lang, "Not running any job.", "Hiçbir iş çalıştırmıyor."))</p> | |
| 1620 | + <p class="state">(s(lang, "Not running any job.", "Hiçbir iş çalıştırmıyor."))</p> | |
| 1751 | 1621 | } |
| 1752 | 1622 | for job in running_jobs.iter() { |
| 1753 | 1623 | <div class="line"><span class=(job.state_class) title=(job.state_text.as_str()) aria-label=(job.state_text.as_str())></span><span class="name">(job.name.as_str())</span><span class="val">(job.repo.as_str())</span><span class="val"><a href=(job.run_href.as_str())>(job.run_text.as_str())</a></span><span class="val">(job.duration.as_str()) " · " (s(lang, "waited", "bekleme")) " " (job.waited.as_str())</span></div> |
| @@ -1756,7 +1626,7 @@ async fn runner_detail_view( | ||
| 1756 | 1626 | <section class="sec"> |
| 1757 | 1627 | <h2>(s(lang, "Recent", "Son"))</h2> |
| 1758 | 1628 | if recent_jobs.is_empty() { |
| 1759 | - <p class="hint">(s(lang, "No finished jobs yet.", "Henüz biten iş yok."))</p> | |
| 1629 | + <p class="state">(s(lang, "No finished jobs yet.", "Henüz biten iş yok."))</p> | |
| 1760 | 1630 | } |
| 1761 | 1631 | <div class="runner-recent"> |
| 1762 | 1632 | for job in recent_jobs.iter() { |
crates/forge-web/src/pages/admin_server.rsmodified+333 -123
| @@ -89,10 +89,9 @@ struct OptionRow { | ||
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | /// One field, already formatted for the template. A secret's value is never in here. |
| 92 | -struct Row { | |
| 92 | +pub(crate) struct Row { | |
| 93 | 93 | key: &'static str, |
| 94 | 94 | label: &'static str, |
| 95 | - help: &'static str, | |
| 96 | 95 | kind_label: &'static str, |
| 97 | 96 | /// What a line shows for the value: the text, the chosen option, On or Off, or the secret state. |
| 98 | 97 | value_text: String, |
| @@ -130,77 +129,109 @@ impl SrvPage { | ||
| 130 | 129 | } |
| 131 | 130 | } |
| 132 | 131 | |
| 133 | -/// The pages in rail order. Every setting is on exactly one page. | |
| 132 | +/// The pages in rail order. Every setting is on exactly one page: the backup and replication | |
| 133 | +/// settings are on their own pages (`BACKUP_KEYS`, `REPLICATION_KEYS`) and `mail.transport` is on | |
| 134 | +/// the Mail page (`MAIL_KEYS`). | |
| 134 | 135 | pub(crate) const PAGES: &[SrvPage] = &[ |
| 135 | 136 | SrvPage { |
| 136 | 137 | slug: "general", |
| 137 | 138 | group: Group::General, |
| 138 | 139 | en: "General", |
| 139 | 140 | tr: "Genel", |
| 140 | - keys: &["registration", "orgs.creation", "trusted_proxies", "banner.message", "banner.level", "banner.expires"], | |
| 141 | + keys: &[ | |
| 142 | + "registration", | |
| 143 | + "orgs.creation", | |
| 144 | + "trusted_proxies", | |
| 145 | + "banner.message", | |
| 146 | + "banner.level", | |
| 147 | + "banner.expires", | |
| 148 | + ], | |
| 141 | 149 | }, |
| 142 | 150 | SrvPage { |
| 143 | 151 | slug: "addresses", |
| 144 | 152 | group: Group::General, |
| 145 | 153 | en: "Addresses", |
| 146 | 154 | tr: "Adresler", |
| 147 | - keys: &["base_url", "user_content_base_url", "ssh_public_host", "ssh_public_port", "listen", "user_content_listen", "ssh_listen", "database", "data_dir"], | |
| 155 | + keys: &[ | |
| 156 | + "base_url", | |
| 157 | + "user_content_base_url", | |
| 158 | + "ssh_public_host", | |
| 159 | + "ssh_public_port", | |
| 160 | + "listen", | |
| 161 | + "user_content_listen", | |
| 162 | + "ssh_listen", | |
| 163 | + "database", | |
| 164 | + "data_dir", | |
| 165 | + ], | |
| 148 | 166 | }, |
| 149 | 167 | SrvPage { |
| 150 | 168 | slug: "limits", |
| 151 | 169 | group: Group::Limits, |
| 152 | 170 | en: "CI", |
| 153 | 171 | tr: "CI", |
| 154 | - keys: &["ci.enabled", "ci.registration_token_hours", "ci.max_log_mb", "ci.max_artifact_mb", "ci.max_artifacts_per_job", "ci.max_job_artifacts_mb"], | |
| 155 | - }, | |
| 156 | - SrvPage { | |
| 157 | - slug: "retention", | |
| 158 | - group: Group::Limits, | |
| 159 | - en: "Retention and uploads", | |
| 160 | - tr: "Saklama ve yüklemeler", | |
| 161 | - keys: &["ci.log_retention_days", "ci.artifact_retention_days", "ci.artifact_keep_runs", "ci.artifact_max_total_mb", "lfs.max_object_mb", "releases.max_asset_mb"], | |
| 172 | + keys: &[ | |
| 173 | + "ci.enabled", | |
| 174 | + "ci.registration_token_hours", | |
| 175 | + "ci.max_log_mb", | |
| 176 | + "ci.max_artifact_mb", | |
| 177 | + "ci.max_artifacts_per_job", | |
| 178 | + "ci.max_job_artifacts_mb", | |
| 179 | + "ci.log_retention_days", | |
| 180 | + "ci.artifact_retention_days", | |
| 181 | + "ci.artifact_keep_runs", | |
| 182 | + "ci.artifact_max_total_mb", | |
| 183 | + "lfs.max_object_mb", | |
| 184 | + "releases.max_asset_mb", | |
| 185 | + ], | |
| 162 | 186 | }, |
| 163 | 187 | SrvPage { |
| 164 | 188 | slug: "storage", |
| 165 | 189 | group: Group::Storage, |
| 166 | 190 | en: "Storage", |
| 167 | 191 | tr: "Depolama", |
| 168 | - keys: &["storage.backend", "storage.r2.account_id", "storage.r2.bucket", "storage.r2.jurisdiction", "storage.r2.prefix", "storage.r2.access_key_id", "storage.r2.secret_access_key_file"], | |
| 169 | - }, | |
| 170 | - SrvPage { | |
| 171 | - slug: "s3", | |
| 172 | - group: Group::Storage, | |
| 173 | - en: "S3 storage", | |
| 174 | - tr: "S3 depolama", | |
| 175 | - keys: &["storage.s3.bucket", "storage.s3.region", "storage.s3.endpoint", "storage.s3.prefix", "storage.s3.access_key_id", "storage.s3.secret_access_key_file", "storage.s3.allow_http", "storage.s3.virtual_hosted_style"], | |
| 176 | - }, | |
| 177 | - SrvPage { | |
| 178 | - slug: "backups", | |
| 179 | - group: Group::Backups, | |
| 180 | - en: "Backups", | |
| 181 | - tr: "Yedekler", | |
| 182 | - keys: &["backup.dir", "backup.interval_hours", "backup.keep", "backup.fsck_interval_days", "backup.healthcheck_url"], | |
| 183 | - }, | |
| 184 | - SrvPage { | |
| 185 | - slug: "replication", | |
| 186 | - group: Group::Backups, | |
| 187 | - en: "Replication", | |
| 188 | - tr: "Çoğaltma", | |
| 189 | - keys: &["replication.target", "replication.ssh_port", "replication.identity_file", "replication.known_hosts_file", "replication.db_snapshot_minutes", "replication.reconcile_minutes", "replication.healthcheck_url"], | |
| 192 | + keys: &[ | |
| 193 | + "storage.backend", | |
| 194 | + "storage.r2.account_id", | |
| 195 | + "storage.r2.bucket", | |
| 196 | + "storage.r2.jurisdiction", | |
| 197 | + "storage.r2.prefix", | |
| 198 | + "storage.r2.access_key_id", | |
| 199 | + "storage.r2.secret_access_key_file", | |
| 200 | + "storage.s3.bucket", | |
| 201 | + "storage.s3.region", | |
| 202 | + "storage.s3.endpoint", | |
| 203 | + "storage.s3.prefix", | |
| 204 | + "storage.s3.access_key_id", | |
| 205 | + "storage.s3.secret_access_key_file", | |
| 206 | + "storage.s3.allow_http", | |
| 207 | + "storage.s3.virtual_hosted_style", | |
| 208 | + ], | |
| 190 | 209 | }, |
| 191 | 210 | SrvPage { |
| 192 | 211 | slug: "integrations", |
| 193 | 212 | group: Group::Integrations, |
| 194 | 213 | en: "Integrations", |
| 195 | 214 | tr: "Entegrasyonlar", |
| 196 | - keys: &["mail.transport", "webhooks.allow_http", "webhooks.allowed_hosts", "advisories.enabled", "advisories.ecosystems", "advisories.refresh_hours"], | |
| 215 | + keys: &[ | |
| 216 | + "webhooks.allow_http", | |
| 217 | + "webhooks.allowed_hosts", | |
| 218 | + "advisories.enabled", | |
| 219 | + "advisories.ecosystems", | |
| 220 | + "advisories.refresh_hours", | |
| 221 | + ], | |
| 197 | 222 | }, |
| 198 | 223 | SrvPage { |
| 199 | 224 | slug: "self-update", |
| 200 | 225 | group: Group::Integrations, |
| 201 | 226 | en: "Self-update", |
| 202 | 227 | tr: "Kendini güncelleme", |
| 203 | - keys: &["self_update.enabled", "self_update.repo", "self_update.branch", "self_update.job", "self_update.artifact"], | |
| 228 | + keys: &[ | |
| 229 | + "self_update.enabled", | |
| 230 | + "self_update.repo", | |
| 231 | + "self_update.branch", | |
| 232 | + "self_update.job", | |
| 233 | + "self_update.artifact", | |
| 234 | + ], | |
| 204 | 235 | }, |
| 205 | 236 | SrvPage { |
| 206 | 237 | slug: "alerts", |
| @@ -208,21 +239,125 @@ pub(crate) const PAGES: &[SrvPage] = &[ | ||
| 208 | 239 | en: "Alerts", |
| 209 | 240 | tr: "Uyarılar", |
| 210 | 241 | // Each threshold sits under the alert it tunes. |
| 211 | - keys: &["alerts.enabled", "alerts.email", "alerts.on_runner_offline", "alerts.runner_offline_minutes", "alerts.on_disk", "alerts.disk_free_percent", "alerts.disk_free_gib", "alerts.on_backup", "alerts.on_ci_killed", "alerts.on_self_update", "alerts.on_replication"], | |
| 242 | + keys: &[ | |
| 243 | + "alerts.enabled", | |
| 244 | + "alerts.email", | |
| 245 | + "alerts.on_runner_offline", | |
| 246 | + "alerts.runner_offline_minutes", | |
| 247 | + "alerts.on_disk", | |
| 248 | + "alerts.disk_free_percent", | |
| 249 | + "alerts.disk_free_gib", | |
| 250 | + "alerts.on_backup", | |
| 251 | + "alerts.on_ci_killed", | |
| 252 | + "alerts.on_self_update", | |
| 253 | + "alerts.on_replication", | |
| 254 | + ], | |
| 212 | 255 | }, |
| 213 | 256 | ]; |
| 214 | 257 | |
| 215 | -/// The page named by `slug`. An old category slug opens that category's first page. | |
| 258 | +/// The settings of the Backups page. Their group is `Group::Backups`. | |
| 259 | +pub(crate) const BACKUP_KEYS: &[&str] = &[ | |
| 260 | + "backup.dir", | |
| 261 | + "backup.interval_hours", | |
| 262 | + "backup.keep", | |
| 263 | + "backup.fsck_interval_days", | |
| 264 | + "backup.healthcheck_url", | |
| 265 | +]; | |
| 266 | + | |
| 267 | +/// The settings of the Replication page. Their group is `Group::Backups`. | |
| 268 | +pub(crate) const REPLICATION_KEYS: &[&str] = &[ | |
| 269 | + "replication.target", | |
| 270 | + "replication.ssh_port", | |
| 271 | + "replication.identity_file", | |
| 272 | + "replication.known_hosts_file", | |
| 273 | + "replication.db_snapshot_minutes", | |
| 274 | + "replication.reconcile_minutes", | |
| 275 | + "replication.healthcheck_url", | |
| 276 | +]; | |
| 277 | + | |
| 278 | +/// The settings of the Mail page. Their group is `Group::Integrations`. | |
| 279 | +pub(crate) const MAIL_KEYS: &[&str] = &["mail.transport"]; | |
| 280 | + | |
| 281 | +/// The page named by `slug`. | |
| 216 | 282 | pub(crate) fn page_by_slug(slug: &str) -> Option<&'static SrvPage> { |
| 217 | 283 | PAGES.iter().find(|page| page.slug == slug) |
| 218 | 284 | } |
| 219 | 285 | |
| 220 | -/// The page that holds the setting `key`. | |
| 221 | -pub(crate) fn page_of(key: &str) -> &'static SrvPage { | |
| 222 | - PAGES | |
| 286 | +/// Where the old slugs of moved pages went: `retention`, `s3`, `backups` and `replication`. `None` | |
| 287 | +/// for every slug that still names a page. | |
| 288 | +fn moved_slug(slug: &str) -> Option<&'static str> { | |
| 289 | + match slug { | |
| 290 | + "retention" => Some("/admin/server?cat=limits"), | |
| 291 | + "s3" => Some("/admin/server?cat=storage"), | |
| 292 | + "backups" => Some("/admin/backups"), | |
| 293 | + "replication" => Some("/admin/replication"), | |
| 294 | + _ => None, | |
| 295 | + } | |
| 296 | +} | |
| 297 | + | |
| 298 | +/// Where a setting's row lives: the page's name and the link to the row. | |
| 299 | +pub(crate) struct Home { | |
| 300 | + /// The page's name, with the area it belongs to when that is not obvious ("Backups"). | |
| 301 | + pub(crate) label: String, | |
| 302 | + /// True for a setting on the server settings page, so the area name is written before it. | |
| 303 | + pub(crate) server: bool, | |
| 304 | + pub(crate) href: String, | |
| 305 | +} | |
| 306 | + | |
| 307 | +/// The page that holds the setting `key`, and the link to its row. | |
| 308 | +pub(crate) fn page_of(lang: Lang, key: &str) -> Home { | |
| 309 | + if BACKUP_KEYS.contains(&key) { | |
| 310 | + return Home { | |
| 311 | + label: g::t(lang, K::Backups).to_owned(), | |
| 312 | + server: false, | |
| 313 | + href: format!("/admin/backups#srv-{key}"), | |
| 314 | + }; | |
| 315 | + } | |
| 316 | + if REPLICATION_KEYS.contains(&key) { | |
| 317 | + return Home { | |
| 318 | + label: g::t(lang, K::Replication).to_owned(), | |
| 319 | + server: false, | |
| 320 | + href: format!("/admin/replication#srv-{key}"), | |
| 321 | + }; | |
| 322 | + } | |
| 323 | + if MAIL_KEYS.contains(&key) { | |
| 324 | + return Home { | |
| 325 | + label: g::t(lang, K::Mail).to_owned(), | |
| 326 | + server: false, | |
| 327 | + href: format!("/admin/mail#srv-{key}"), | |
| 328 | + }; | |
| 329 | + } | |
| 330 | + let page = PAGES | |
| 223 | 331 | .iter() |
| 224 | 332 | .find(|page| page.keys.contains(&key)) |
| 225 | - .unwrap_or(&PAGES[0]) | |
| 333 | + .unwrap_or(&PAGES[0]); | |
| 334 | + Home { | |
| 335 | + label: page.label(lang).to_owned(), | |
| 336 | + server: true, | |
| 337 | + href: format!("/admin/server?cat={}#srv-{key}", page.slug), | |
| 338 | + } | |
| 339 | +} | |
| 340 | + | |
| 341 | +/// The keys a topic shows, out of its `keys`, given the values now in effect. Storage shows the | |
| 342 | +/// fields of the chosen backend only: `fs` shows none, `s3` and `r2` their own. | |
| 343 | +fn shown_keys<'a>(keys: &[&'a str], views: &[FieldView]) -> Vec<&'a str> { | |
| 344 | + let backend = views | |
| 345 | + .iter() | |
| 346 | + .find(|view| view.field.key == "storage.backend") | |
| 347 | + .map_or("", |view| view.value.as_str()); | |
| 348 | + keys.iter() | |
| 349 | + .copied() | |
| 350 | + .filter(|key| { | |
| 351 | + let own = if key.starts_with("storage.s3.") { | |
| 352 | + "s3" | |
| 353 | + } else if key.starts_with("storage.r2.") { | |
| 354 | + "r2" | |
| 355 | + } else { | |
| 356 | + return true; | |
| 357 | + }; | |
| 358 | + own == backend | |
| 359 | + }) | |
| 360 | + .collect() | |
| 226 | 361 | } |
| 227 | 362 | |
| 228 | 363 | /// The words for a choice's stored value. Values that are names (smtp, s3, eu) read as they are. |
| @@ -290,14 +425,13 @@ fn row(lang: Lang, view: &FieldView) -> Row { | ||
| 290 | 425 | } else { |
| 291 | 426 | view.value.clone() |
| 292 | 427 | }; |
| 293 | - let (label, help) = match (lang, i18n::server_settings::field_tr(field.key)) { | |
| 294 | - (Lang::Tr, Some(tr)) => tr, | |
| 295 | - _ => (field.label, field.help), | |
| 428 | + let label = match (lang, i18n::server_settings::field_tr(field.key)) { | |
| 429 | + (Lang::Tr, Some((tr, _))) => tr, | |
| 430 | + _ => field.label, | |
| 296 | 431 | }; |
| 297 | 432 | Row { |
| 298 | 433 | key: field.key, |
| 299 | 434 | label, |
| 300 | - help, | |
| 301 | 435 | kind_label, |
| 302 | 436 | value_text, |
| 303 | 437 | value: view.value.clone(), |
| @@ -322,27 +456,128 @@ fn row(lang: Lang, view: &FieldView) -> Row { | ||
| 322 | 456 | } |
| 323 | 457 | } |
| 324 | 458 | |
| 325 | -/// The rows of one page, in the page's order. | |
| 459 | +/// The rows of the settings `keys`, in `keys` order. | |
| 460 | +fn rows_of(lang: Lang, views: &[FieldView], keys: &[&str]) -> Vec<Row> { | |
| 461 | + keys.iter() | |
| 462 | + .filter_map(|key| views.iter().find(|view| view.field.key == *key)) | |
| 463 | + .map(|view| row(lang, view)) | |
| 464 | + .collect() | |
| 465 | +} | |
| 466 | + | |
| 467 | +/// The rows of one server settings page, in the page's order. | |
| 326 | 468 | async fn rows_for(state: &AppState, lang: Lang, page: &SrvPage) -> forge_core::Result<Vec<Row>> { |
| 327 | 469 | let overrides = state.store.server_overrides().await?; |
| 328 | 470 | let views = state.settings.views(&overrides); |
| 329 | - Ok(page | |
| 330 | - .keys | |
| 471 | + Ok(rows_of(lang, &views, page.keys)) | |
| 472 | +} | |
| 473 | + | |
| 474 | +/// The rows of a settings topic outside the server page (Backups, Replication, Mail), in `keys` order. | |
| 475 | +pub(crate) async fn setting_rows( | |
| 476 | + state: &AppState, | |
| 477 | + lang: Lang, | |
| 478 | + keys: &[&str], | |
| 479 | +) -> forge_core::Result<Vec<Row>> { | |
| 480 | + let overrides = state.store.server_overrides().await?; | |
| 481 | + let views = state.settings.views(&overrides); | |
| 482 | + Ok(rows_of(lang, &views, keys)) | |
| 483 | +} | |
| 484 | + | |
| 485 | +/// Saves the posted values of one settings topic. `topic` is every key the topic can show; only | |
| 486 | +/// the ones it shows now (see `shown_keys`) are read, and an unchecked switch of those counts as | |
| 487 | +/// off. `Ok(None)` means nothing differed from what is in effect. | |
| 488 | +pub(crate) async fn save_topic( | |
| 489 | + cx: &Cx, | |
| 490 | + state: &AppState, | |
| 491 | + user: &forge_core::User, | |
| 492 | + group: Group, | |
| 493 | + topic: &[&str], | |
| 494 | + mut form: HashMap<String, String>, | |
| 495 | + lang: Lang, | |
| 496 | +) -> forge_core::Result<Option<()>> { | |
| 497 | + let existing = state.store.server_overrides().await?; | |
| 498 | + let shown = shown_keys(topic, &state.settings.views(&existing)); | |
| 499 | + for field in ss::FIELDS | |
| 331 | 500 | .iter() |
| 332 | - .filter_map(|key| views.iter().find(|view| view.field.key == *key)) | |
| 333 | - .map(|view| row(lang, view)) | |
| 334 | - .collect()) | |
| 501 | + .filter(|f| shown.contains(&f.key) && f.ty == Ty::Bool && f.kind != Kind::ReadOnly) | |
| 502 | + { | |
| 503 | + form.entry(field.key.to_owned()) | |
| 504 | + .or_insert_with(|| "false".to_owned()); | |
| 505 | + } | |
| 506 | + let submitted: BTreeMap<String, String> = form | |
| 507 | + .into_iter() | |
| 508 | + .filter(|(key, _)| shown.contains(&key.as_str())) | |
| 509 | + .collect(); | |
| 510 | + save(cx, state, user, group, &submitted, lang).await | |
| 335 | 511 | } |
| 336 | 512 | |
| 337 | -/// The settings from every category whose key, label or help matches the search. | |
| 338 | -async fn search_hits(state: &AppState, lang: Lang, finder: &Finder) -> forge_core::Result<Vec<Row>> { | |
| 513 | +/// The notice a settings save shows: saved, nothing changed, or why it was refused. | |
| 514 | +pub(crate) fn notice_of(lang: Lang, result: forge_core::Result<Option<()>>) -> String { | |
| 515 | + match result { | |
| 516 | + Ok(Some(())) => g::t(lang, K::SrvSaved).to_owned(), | |
| 517 | + Ok(None) => g::t(lang, K::SrvNothingChanged).to_owned(), | |
| 518 | + Err(other) => refusal(other), | |
| 519 | + } | |
| 520 | +} | |
| 521 | + | |
| 522 | +/// The words for an error a page shows: the message itself for a refusal the user can fix. | |
| 523 | +pub(crate) fn refusal(error: Error) -> String { | |
| 524 | + match error { | |
| 525 | + Error::Invalid(message) | Error::Config(message) => message, | |
| 526 | + other => other.to_string(), | |
| 527 | + } | |
| 528 | +} | |
| 529 | + | |
| 530 | +/// The page a settings form goes back to. Only a page of the admin area is taken; anything else | |
| 531 | +/// goes to the server settings. | |
| 532 | +pub(crate) fn back_to(raw: &str) -> &str { | |
| 533 | + if raw.starts_with("/admin/") && !raw.contains("//") && !raw.contains('\\') { | |
| 534 | + raw | |
| 535 | + } else { | |
| 536 | + "/admin/server" | |
| 537 | + } | |
| 538 | +} | |
| 539 | + | |
| 540 | +/// `back` with a notice on its query string. | |
| 541 | +pub(crate) fn with_notice(back: &str, notice: &str) -> String { | |
| 542 | + let sep = if back.contains('?') { '&' } else { '?' }; | |
| 543 | + format!("{back}{sep}notice={}", enc(notice)) | |
| 544 | +} | |
| 545 | + | |
| 546 | +/// The hidden form that resets one setting: the rows' "Reset to file value" buttons post to it by | |
| 547 | +/// id. It goes outside the forms that save, since a form cannot hold another. | |
| 548 | +#[component] | |
| 549 | +pub(crate) async fn reset_form(csrf: String, back: String) -> Result<impl View> { | |
| 550 | + Ok(view! { | |
| 551 | + <form id="srv-reset" method="post" action="/admin/server/reset"> | |
| 552 | + <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 553 | + <input type="hidden" name="back" value=(back.as_str())> | |
| 554 | + </form> | |
| 555 | + }) | |
| 556 | +} | |
| 557 | + | |
| 558 | +/// The rows of a settings topic, one line each. The caller's form holds them. | |
| 559 | +#[component] | |
| 560 | +pub(crate) async fn setting_lines(lang: Lang, rows: Vec<Row>) -> Result<impl View> { | |
| 561 | + Ok(view! { | |
| 562 | + for r in rows.iter() { | |
| 563 | + srv_row(lang: lang, row: r) | |
| 564 | + } | |
| 565 | + }) | |
| 566 | +} | |
| 567 | + | |
| 568 | +/// The settings from every category whose key or label matches the search. | |
| 569 | +async fn search_hits( | |
| 570 | + state: &AppState, | |
| 571 | + lang: Lang, | |
| 572 | + finder: &Finder, | |
| 573 | +) -> forge_core::Result<Vec<Row>> { | |
| 339 | 574 | let overrides = state.store.server_overrides().await?; |
| 340 | 575 | Ok(state |
| 341 | 576 | .settings |
| 342 | 577 | .views(&overrides) |
| 343 | 578 | .iter() |
| 344 | 579 | .map(|view| row(lang, view)) |
| 345 | - .filter(|hit| finder.matches_any(&[hit.key, hit.label, hit.help])) | |
| 580 | + .filter(|hit| finder.matches_any(&[hit.key, hit.label])) | |
| 346 | 581 | .collect()) |
| 347 | 582 | } |
| 348 | 583 | |
| @@ -382,18 +617,11 @@ async fn srv_row(lang: Lang, row: &Row) -> Result<impl View> { | ||
| 382 | 617 | }) |
| 383 | 618 | } |
| 384 | 619 | |
| 385 | -/// What a setting says after its control, one sentence after another: its help, its kind, a | |
| 386 | -/// secret's rule and its override. | |
| 620 | +/// The facts after a setting's control: its kind, whether a restart is needed, and its override. | |
| 387 | 621 | #[component] |
| 388 | 622 | async fn srv_hints(lang: Lang, row: &Row) -> Result<impl View> { |
| 389 | 623 | Ok(view! { |
| 390 | 624 | <span class="srv-hints"> |
| 391 | - if !row.help.is_empty() { | |
| 392 | - <span class="hint">(row.help)</span> | |
| 393 | - } | |
| 394 | - if row.is_secret { | |
| 395 | - <span class="hint">(g::t(lang, K::SrvSecretHint))</span> | |
| 396 | - } | |
| 397 | 625 | if !row.kind_label.is_empty() { |
| 398 | 626 | <span class="hint">(row.kind_label)</span> |
| 399 | 627 | } |
| @@ -446,27 +674,23 @@ async fn server_view( | ||
| 446 | 674 | current: search.is_none() && item.slug == page.slug, |
| 447 | 675 | }) |
| 448 | 676 | .collect(); |
| 449 | - let sub = vec![ | |
| 450 | - SubPart::text(g::t(lang, K::ServerSettingsIntro)), | |
| 451 | - SubPart::mono(format!( | |
| 452 | - "{} {}", | |
| 453 | - s(lang, "Version", "Sürüm"), | |
| 454 | - forge_ci::build::display() | |
| 455 | - )), | |
| 456 | - ]; | |
| 677 | + let sub = vec![SubPart::mono(format!( | |
| 678 | + "{} {}", | |
| 679 | + s(lang, "Version", "Sürüm"), | |
| 680 | + forge_ci::build::display() | |
| 681 | + ))]; | |
| 457 | 682 | let restart_label = s(lang, "Restart server", "Sunucuyu yeniden başlat"); |
| 458 | - let restart_note = s(lang, "Restart the server now? Requests in flight finish first, and the site is unavailable for a few seconds. Settings marked restart needed take effect, and so does a newly installed binary. Needs a supervisor such as systemd to start it again.", "Sunucu şimdi yeniden başlatılsın mı? Süren istekler önce biter, site birkaç saniye kullanılamaz. \"Yeniden başlatma gerekli\" işaretli ayarlar ve yeni kurulan ikili devreye girer. Yeniden başlatmak için systemd gibi bir gözetmen gerekir."); | |
| 459 | 683 | Ok(view! { |
| 460 | 684 | head(title: g::t(lang, K::ServerSettings), sub: sub, |
| 461 | 685 | if restart != Restart::Pending { |
| 462 | - confirm_act(lang: lang, label: restart_label, action: "/admin/server/restart", csrf: csrf.as_str(), fields: vec![("tab".to_owned(), tab.to_owned())], note: Some(restart_note.to_owned())) | |
| 686 | + confirm_act(lang: lang, label: restart_label, action: "/admin/server/restart", csrf: csrf.as_str(), fields: vec![("tab".to_owned(), tab.to_owned())], note: Some(s(lang, "Restart the server now?", "Sunucu şimdi yeniden başlatılsın mı?").to_owned())) | |
| 463 | 687 | } |
| 464 | 688 | ) |
| 465 | 689 | <div data-live=(live.as_str())> |
| 466 | 690 | if restart == Restart::Pending { |
| 467 | - <p class="state" role="status" aria-live="polite"><strong>(s(lang, "Restarting...", "Yeniden başlatılıyor..."))</strong> " " (s(lang, "This page comes back by itself when the server is up again.", "Sunucu tekrar ayağa kalkınca bu sayfa kendiliğinden geri gelir."))</p> | |
| 691 | + <p class="state" role="status" aria-live="polite"><strong>(s(lang, "Restarting...", "Yeniden başlatılıyor..."))</strong></p> | |
| 468 | 692 | } else if restart == Restart::Done { |
| 469 | - <p class="state" role="status">(s(lang, "The server restarted. Settings that needed a restart are applied now.", "Sunucu yeniden başladı. Yeniden başlatma gerektiren ayarlar artık uygulandı."))</p> | |
| 693 | + <p class="state" role="status">(s(lang, "The server restarted.", "Sunucu yeniden başladı."))</p> | |
| 470 | 694 | } |
| 471 | 695 | if let Some(message) = notice { |
| 472 | 696 | <p class="state" role="status">(message.as_str())</p> |
| @@ -485,9 +709,9 @@ async fn server_view( | ||
| 485 | 709 | <p class="state">(s(lang, "No setting matches.", "Eşleşen ayar yok."))</p> |
| 486 | 710 | } |
| 487 | 711 | for hit in hits.iter() { |
| 488 | - <a class="line" href=(format!("/admin/server?cat={}#srv-{}", page_of(hit.key).slug, hit.key))> | |
| 712 | + <a class="line" href=(page_of(lang, hit.key).href)> | |
| 489 | 713 | <span class="name">(hit.label)</span> |
| 490 | - <span class="val">(page_of(hit.key).label(lang))</span> | |
| 714 | + <span class="val">(page_of(lang, hit.key).label)</span> | |
| 491 | 715 | </a> |
| 492 | 716 | } |
| 493 | 717 | </section> |
| @@ -495,9 +719,7 @@ async fn server_view( | ||
| 495 | 719 | <form method="post" action="/admin/server" class="srv-form"> |
| 496 | 720 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 497 | 721 | <input type="hidden" name="tab" value=(tab)> |
| 498 | - for r in rows.iter() { | |
| 499 | - srv_row(lang: lang, row: r) | |
| 500 | - } | |
| 722 | + setting_lines(lang: lang, rows: rows) | |
| 501 | 723 | if any_editable { |
| 502 | 724 | <div class="acts srv-save"> |
| 503 | 725 | <button type="submit" class="primary">(i18n::t(lang, Key::Save))</button> |
| @@ -505,10 +727,7 @@ async fn server_view( | ||
| 505 | 727 | } |
| 506 | 728 | </form> |
| 507 | 729 | } |
| 508 | - <form id="srv-reset" method="post" action="/admin/server/reset"> | |
| 509 | - <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 510 | - <input type="hidden" name="tab" value=(tab)> | |
| 511 | - </form> | |
| 730 | + reset_form(csrf: csrf.clone(), back: format!("/admin/server?cat={tab}")) | |
| 512 | 731 | </div> |
| 513 | 732 | </div> |
| 514 | 733 | </div> |
| @@ -521,12 +740,11 @@ async fn server_page(cx: &Cx) -> Result<impl View> { | ||
| 521 | 740 | let query = query_params::<ServerQuery>(cx)?; |
| 522 | 741 | let state = app_context::<AppState>(cx); |
| 523 | 742 | let lang = i18n::lang(cx, Some(&viewer.0)); |
| 524 | - let page = query | |
| 525 | - .cat | |
| 526 | - .as_deref() | |
| 527 | - .or(query.tab.as_deref()) | |
| 528 | - .and_then(page_by_slug) | |
| 529 | - .unwrap_or(&PAGES[0]); | |
| 743 | + let slug = query.cat.as_deref().or(query.tab.as_deref()).unwrap_or(""); | |
| 744 | + if let Some(to) = moved_slug(slug) { | |
| 745 | + return Err(see_other(to).into()); | |
| 746 | + } | |
| 747 | + let page = page_by_slug(slug).unwrap_or(&PAGES[0]); | |
| 530 | 748 | let finder = Finder::new( |
| 531 | 749 | query.q.as_deref(), |
| 532 | 750 | query.exact.as_deref(), |
| @@ -545,7 +763,7 @@ async fn server_page(cx: &Cx) -> Result<impl View> { | ||
| 545 | 763 | } |
| 546 | 764 | |
| 547 | 765 | #[route(POST "/admin/server")] |
| 548 | -async fn server_save(cx: &Cx, Form(mut form): Form<HashMap<String, String>>) -> Result<Response> { | |
| 766 | +async fn server_save(cx: &Cx, Form(form): Form<HashMap<String, String>>) -> Result<Response> { | |
| 549 | 767 | let viewer = admin_only(cx).await?; |
| 550 | 768 | if !check_csrf(&viewer.1, form.get("csrf").map_or("", String::as_str)) { |
| 551 | 769 | return Err(forbidden().into()); |
| @@ -556,22 +774,10 @@ async fn server_save(cx: &Cx, Form(mut form): Form<HashMap<String, String>>) -> | ||
| 556 | 774 | .get("tab") |
| 557 | 775 | .and_then(|t| page_by_slug(t)) |
| 558 | 776 | .unwrap_or(&PAGES[0]); |
| 559 | - let group = page.group; | |
| 560 | - // An unchecked box is absent from the post. Only the page's own switches were on the form. | |
| 561 | - for field in ss::FIELDS.iter().filter(|f| { | |
| 562 | - page.keys.contains(&f.key) && f.ty == Ty::Bool && f.kind != Kind::ReadOnly | |
| 563 | - }) { | |
| 564 | - form.entry(field.key.to_owned()) | |
| 565 | - .or_insert_with(|| "false".to_owned()); | |
| 566 | - } | |
| 567 | - let submitted: BTreeMap<String, String> = form.into_iter().collect(); | |
| 568 | - let notice = match save(cx, state, &viewer.0, group, &submitted, lang).await { | |
| 569 | - Ok(Some(())) => g::t(lang, K::SrvSaved).to_owned(), | |
| 570 | - Ok(None) => g::t(lang, K::SrvNothingChanged).to_owned(), | |
| 571 | - Err(Error::Invalid(message)) => message, | |
| 572 | - Err(Error::Config(message)) => message, | |
| 573 | - Err(other) => other.to_string(), | |
| 574 | - }; | |
| 777 | + let notice = notice_of( | |
| 778 | + lang, | |
| 779 | + save_topic(cx, state, &viewer.0, page.group, page.keys, form, lang).await, | |
| 780 | + ); | |
| 575 | 781 | Err(see_other(format!( |
| 576 | 782 | "/admin/server?cat={}¬ice={}", |
| 577 | 783 | page.slug, |
| @@ -690,9 +896,10 @@ struct ResetForm { | ||
| 690 | 896 | #[serde(default)] |
| 691 | 897 | csrf: String, |
| 692 | 898 | #[serde(default)] |
| 693 | - tab: String, | |
| 694 | - #[serde(default)] | |
| 695 | 899 | key: String, |
| 900 | + /// The page the reset came from: where the viewer goes back to. | |
| 901 | + #[serde(default)] | |
| 902 | + back: String, | |
| 696 | 903 | } |
| 697 | 904 | |
| 698 | 905 | #[route(POST "/admin/server/reset")] |
| @@ -703,19 +910,13 @@ async fn server_reset(cx: &Cx, Form(form): Form<ResetForm>) -> Result<Response> | ||
| 703 | 910 | } |
| 704 | 911 | let lang = i18n::lang(cx, Some(&viewer.0)); |
| 705 | 912 | let state = app_context::<AppState>(cx); |
| 706 | - let group = Group::parse(&form.tab).unwrap_or(Group::General); | |
| 707 | 913 | let notice = match reset(cx, state, &viewer.0, &form.key).await { |
| 708 | 914 | Ok(()) => g::t(lang, K::SrvResetDone).to_owned(), |
| 709 | 915 | Err(Error::Invalid(message)) => message, |
| 710 | 916 | Err(Error::Config(message)) => message, |
| 711 | 917 | Err(other) => other.to_string(), |
| 712 | 918 | }; |
| 713 | - Err(see_other(format!( | |
| 714 | - "/admin/server?cat={}¬ice={}", | |
| 715 | - group.slug(), | |
| 716 | - enc(¬ice) | |
| 717 | - )) | |
| 718 | - .into()) | |
| 919 | + Err(see_other(with_notice(back_to(&form.back), ¬ice)).into()) | |
| 719 | 920 | } |
| 720 | 921 | |
| 721 | 922 | async fn reset( |
| @@ -845,6 +1046,15 @@ mod tests { | ||
| 845 | 1046 | admin_get(fx, &location).await |
| 846 | 1047 | } |
| 847 | 1048 | |
| 1049 | + /// Posts a settings topic of its own page (Backups, Replication) and reads the page it goes to. | |
| 1050 | + async fn save_topic_at(fx: &Fixture, path: &str, fields: &str) -> String { | |
| 1051 | + let form = format!("csrf={CSRF}&{fields}"); | |
| 1052 | + let (status, _, location) = | |
| 1053 | + send(&fx.router, "POST", path, Some(ADMIN_TOKEN), Some(form)).await; | |
| 1054 | + assert_eq!(status, 303); | |
| 1055 | + admin_get(fx, &location).await | |
| 1056 | + } | |
| 1057 | + | |
| 848 | 1058 | // Scenario: non-admins get 404 on every route, bad CSRF is refused and refused values are |
| 849 | 1059 | // never stored. Nothing here saves, so the store stays pristine for the next scenarios. |
| 850 | 1060 | #[tokio::test] |
| @@ -911,7 +1121,6 @@ mod tests { | ||
| 911 | 1121 | ("limits", "ci.max_log_mb=0"), |
| 912 | 1122 | ("limits", "ci.max_log_mb=lots"), |
| 913 | 1123 | ("storage", "storage.backend=r2"), |
| 914 | - ("backups", "backup.keep=0&backup.dir=%2Fvar%2Fbackups"), | |
| 915 | 1124 | ] { |
| 916 | 1125 | let body = save(&fx, tab, fields).await; |
| 917 | 1126 | assert!(!body.contains("Server settings saved."), "{fields}: {body}"); |
| @@ -987,18 +1196,19 @@ mod tests { | ||
| 987 | 1196 | |
| 988 | 1197 | // A secret is saved, never shown on any tab, and a blank post keeps it. |
| 989 | 1198 | let secret = "https://hc.example/ping/TOPSECRET-TOKEN"; |
| 990 | - let body = save( | |
| 1199 | + let body = save_topic_at( | |
| 991 | 1200 | &fx, |
| 992 | - "backups", | |
| 1201 | + "/admin/backups", | |
| 993 | 1202 | &format!("backup.healthcheck_url={}", enc(secret)), |
| 994 | 1203 | ) |
| 995 | 1204 | .await; |
| 996 | 1205 | assert!(body.contains("Server settings saved."), "{body}"); |
| 997 | - for tab in ["backups", "general", "limits", "storage", "integrations"] { | |
| 1206 | + for tab in ["general", "limits", "storage", "integrations"] { | |
| 998 | 1207 | let page = admin_get(&fx, &format!("/admin/server?tab={tab}")).await; |
| 999 | 1208 | assert!(!page.contains("TOPSECRET"), "tab {tab}"); |
| 1000 | 1209 | } |
| 1001 | - let page = admin_get(&fx, "/admin/server?tab=backups").await; | |
| 1210 | + let page = admin_get(&fx, "/admin/backups").await; | |
| 1211 | + assert!(!page.contains("TOPSECRET"), "backups page"); | |
| 1002 | 1212 | assert!(page.contains("set")); |
| 1003 | 1213 | assert_eq!( |
| 1004 | 1214 | fx.state |
| @@ -1010,7 +1220,7 @@ mod tests { | ||
| 1010 | 1220 | .map(String::as_str), |
| 1011 | 1221 | Some(secret) |
| 1012 | 1222 | ); |
| 1013 | - save(&fx, "backups", "backup.healthcheck_url=").await; | |
| 1223 | + save_topic_at(&fx, "/admin/backups", "backup.healthcheck_url=").await; | |
| 1014 | 1224 | assert!( |
| 1015 | 1225 | fx.state |
| 1016 | 1226 | .store |
crates/forge-web/src/pages/admin_user_detail.rsmodified+4 -16
| @@ -247,11 +247,6 @@ async fn detail_body( | ||
| 247 | 247 | let profile = format!("/{}", enc(&target.username)); |
| 248 | 248 | let repos_href = format!("/{}?tab=repositories", enc(&target.username)); |
| 249 | 249 | let snippets_href = format!("/{}?tab=snippets", enc(&target.username)); |
| 250 | - let reset_note = s( | |
| 251 | - lang, | |
| 252 | - "Their sessions end at once.", | |
| 253 | - "Oturumları hemen sonlanır.", | |
| 254 | - ); | |
| 255 | 250 | let passkeys_question = s( |
| 256 | 251 | lang, |
| 257 | 252 | "Remove every passkey of this user?", |
| @@ -383,11 +378,11 @@ async fn detail_body( | ||
| 383 | 378 | post_act(label: at(lang, A::Unsuspend), action: unsuspend_action.as_str(), csrf: csrf) |
| 384 | 379 | } |
| 385 | 380 | if !suspended && !own { |
| 386 | - <details class="reveal" id="suspend" title=(at(lang, A::SuspendHelp))> | |
| 381 | + <details class="reveal" id="suspend"> | |
| 387 | 382 | <summary class="act danger">(suspend_open.as_str())</summary> |
| 388 | 383 | <form class="opened" method="post" action=(suspend_action.as_str())> |
| 389 | 384 | <input type="hidden" name="csrf" value=(csrf)> |
| 390 | - <input type="text" name="reason" maxlength="300" autocomplete="off" placeholder=(reason_hint) aria-label=(reason_hint)> | |
| 385 | + <input type="text" name="reason" maxlength="300" autocomplete="off" aria-label=(reason_hint)> | |
| 391 | 386 | <button type="submit" class="danger small">(suspend_title)</button> |
| 392 | 387 | </form> |
| 393 | 388 | </details> |
| @@ -416,16 +411,11 @@ async fn detail_body( | ||
| 416 | 411 | <h2>(s(lang, "Recovery", "Kurtarma"))</h2> |
| 417 | 412 | <div class="line"> |
| 418 | 413 | <span class="key">(s(lang, "Password", "Parola"))</span> |
| 419 | - <span class="val">(at(lang, A::ResetHelp))</span> | |
| 420 | - confirm_act(lang: lang, label: at(lang, A::GenerateLink), action: reset_action.as_str(), csrf: csrf, note: Some(reset_note.to_owned())) | |
| 414 | + confirm_act(lang: lang, label: at(lang, A::GenerateLink), action: reset_action.as_str(), csrf: csrf, note: None) | |
| 421 | 415 | </div> |
| 422 | 416 | <div class="line"> |
| 423 | 417 | <span class="key">(at(lang, A::TwoFactor))</span> |
| 424 | - <span class="val">(tfa) | |
| 425 | - if tfa_on { | |
| 426 | - " · " (at(lang, A::Disable2faHelp)) | |
| 427 | - } | |
| 428 | - </span> | |
| 418 | + <span class="val">(tfa)</span> | |
| 429 | 419 | if tfa_on { |
| 430 | 420 | confirm_act(lang: lang, label: g::t(lang, K::Disable), action: tfa_action.as_str(), csrf: csrf) |
| 431 | 421 | } |
| @@ -443,7 +433,6 @@ async fn detail_body( | ||
| 443 | 433 | <h2>(i18n::t(lang, Key::DangerZone))</h2> |
| 444 | 434 | <div class="line"> |
| 445 | 435 | <span class="key">(i18n::t(lang, Key::Delete))</span> |
| 446 | - <span class="val">(at(lang, A::DeleteHelp))</span> | |
| 447 | 436 | <a class="act danger" href=(delete_href.as_str())>(i18n::t(lang, Key::Delete))</a> |
| 448 | 437 | </div> |
| 449 | 438 | </section> |
| @@ -537,7 +526,6 @@ async fn org_body( | ||
| 537 | 526 | <h2>(i18n::t(lang, Key::DangerZone))</h2> |
| 538 | 527 | <div class="line"> |
| 539 | 528 | <span class="key">(i18n::t(lang, Key::Delete))</span> |
| 540 | - <span class="val">(s(lang, "Shows what goes with it before anything is removed.", "Bir şey silinmeden önce neyin gideceğini gösterir."))</span> | |
| 541 | 529 | <a class="act danger" href=(delete_action.as_str())>(g::t(lang, K::DeleteOrgTitle))</a> |
| 542 | 530 | </div> |
| 543 | 531 | </section> |
crates/forge-web/src/pages/admin_users.rsmodified+70 -46
| @@ -20,11 +20,11 @@ use crate::i18n::admin::{self as g, K}; | ||
| 20 | 20 | use crate::i18n::orgs::{self as og, K as OG}; |
| 21 | 21 | use crate::i18n::{self, Key, Lang}; |
| 22 | 22 | use crate::live::{Topic, stream_changes}; |
| 23 | +use crate::pages::issues_list::list_href; | |
| 23 | 24 | use crate::pages::passkeys::s; |
| 24 | 25 | use crate::state::AppState; |
| 25 | -use crate::views::parts::{head, reveal}; | |
| 26 | -use crate::pages::issues_list::list_href; | |
| 27 | 26 | use crate::views::find::{Finder, finder_field}; |
| 27 | +use crate::views::parts::{RailItem, head, rail, reveal}; | |
| 28 | 28 | use crate::views::repo_list::{pager, pager_links}; |
| 29 | 29 | use crate::views::{alert, enc, rel_time, shell, user_facing_message}; |
| 30 | 30 | |
| @@ -198,17 +198,17 @@ async fn users_view( | ||
| 198 | 198 | let open = error.is_some(); |
| 199 | 199 | // The field says what the current tab lists. |
| 200 | 200 | let search_label = match kind { |
| 201 | - Kind::All => s(lang, "Search users and organizations", "Kullanıcı ve kuruluşlarda ara"), | |
| 201 | + Kind::All => s( | |
| 202 | + lang, | |
| 203 | + "Search users and organizations", | |
| 204 | + "Kullanıcı ve kuruluşlarda ara", | |
| 205 | + ), | |
| 202 | 206 | Kind::People => s(lang, "Search users", "Kullanıcılarda ara"), |
| 203 | 207 | Kind::Organizations => s(lang, "Search organizations", "Kuruluşlarda ara"), |
| 204 | 208 | }; |
| 205 | 209 | let filter_label = s(lang, "Filter", "Filtre"); |
| 206 | 210 | let all_label = format!("{} {}", s(lang, "All", "Tümü"), all_count); |
| 207 | - let people_label = format!( | |
| 208 | - "{} {}", | |
| 209 | - s(lang, "People", "Kişiler"), | |
| 210 | - all_count - org_count | |
| 211 | - ); | |
| 211 | + let people_label = format!("{} {}", s(lang, "People", "Kişiler"), all_count - org_count); | |
| 212 | 212 | let orgs_label = format!("{} {}", og::t(lang, OG::Organizations), org_count); |
| 213 | 213 | let all_href = users_href(&finder, Kind::All, 1); |
| 214 | 214 | let people_href = users_href(&finder, Kind::People, 1); |
| @@ -232,7 +232,6 @@ async fn users_view( | ||
| 232 | 232 | <div class="field"> |
| 233 | 233 | <label for="new-password">(i18n::t(lang, Key::Password))</label> |
| 234 | 234 | <input id="new-password" type="password" name="password" required=(true) autocomplete="new-password"> |
| 235 | - <p class="hint">(g::t(lang, K::AtLeast12Chars))</p> | |
| 236 | 235 | </div> |
| 237 | 236 | <label class="switch"> |
| 238 | 237 | <input type="checkbox" name="is_admin" value="yes"> |
| @@ -247,44 +246,69 @@ async fn users_view( | ||
| 247 | 246 | <a href=(people_href.as_str()) aria-current=((kind == Kind::People).then_some("page"))>(people_label.as_str())</a> |
| 248 | 247 | <a href=(orgs_href.as_str()) aria-current=((kind == Kind::Organizations).then_some("page"))>(orgs_label.as_str())</a> |
| 249 | 248 | </nav> |
| 250 | - <div class="sheet" data-live="/admin/users/events"> | |
| 251 | - <div class="sheet-tools"> | |
| 252 | - <form method="get" action="/admin/users" role="search"> | |
| 253 | - finder_field(lang: lang, finder: finder.clone(), placeholder: search_label, id: Some("user-search")) | |
| 254 | - <input type="hidden" name="kind" value=(kind.key())> | |
| 255 | - </form> | |
| 256 | - </div> | |
| 257 | - if empty { | |
| 258 | - <p class="state">(s(lang, "No account matches.", "Eşleşen hesap yok."))</p> | |
| 259 | - } | |
| 260 | - for row in rows.into_iter() { | |
| 261 | - if row.linkable { | |
| 262 | - <a class="line" href=(row.href.as_str()) data-kb-row=""> | |
| 263 | - <span class="name">(row.username.as_str())</span> | |
| 264 | - <span class="val"> | |
| 265 | - if !row.email.is_empty() { | |
| 266 | - (row.email.as_str()) " · " | |
| 267 | - } | |
| 268 | - (row.role.as_str()) " · " rel_time(lang: lang, stamp: row.created_at.as_str()) | |
| 269 | - </span> | |
| 270 | - </a> | |
| 271 | - } else { | |
| 272 | - <div class="line" data-kb-row=""> | |
| 273 | - <span class="name">(row.username.as_str())</span> | |
| 274 | - <span class="val"> | |
| 275 | - if !row.email.is_empty() { | |
| 276 | - (row.email.as_str()) " · " | |
| 277 | - } | |
| 278 | - (row.role.as_str()) " · " rel_time(lang: lang, stamp: row.created_at.as_str()) | |
| 279 | - </span> | |
| 280 | - </div> | |
| 249 | + <div class="work"> | |
| 250 | + users_rail(lang: lang, current: "users") | |
| 251 | + <div class="sheet" data-live="/admin/users/events"> | |
| 252 | + <div class="sheet-tools"> | |
| 253 | + <form method="get" action="/admin/users" role="search"> | |
| 254 | + finder_field(lang: lang, finder: finder.clone(), placeholder: search_label, id: Some("user-search")) | |
| 255 | + <input type="hidden" name="kind" value=(kind.key())> | |
| 256 | + </form> | |
| 257 | + </div> | |
| 258 | + if empty { | |
| 259 | + <p class="state">(s(lang, "No account matches.", "Eşleşen hesap yok."))</p> | |
| 281 | 260 | } |
| 282 | - } | |
| 283 | - pager(page: page, pages: pages, links: links, prev: prev, next: next, lang: lang) | |
| 261 | + for row in rows.into_iter() { | |
| 262 | + if row.linkable { | |
| 263 | + <a class="line" href=(row.href.as_str()) data-kb-row=""> | |
| 264 | + <span class="name">(row.username.as_str())</span> | |
| 265 | + <span class="val"> | |
| 266 | + if !row.email.is_empty() { | |
| 267 | + (row.email.as_str()) " · " | |
| 268 | + } | |
| 269 | + (row.role.as_str()) " · " rel_time(lang: lang, stamp: row.created_at.as_str()) | |
| 270 | + </span> | |
| 271 | + </a> | |
| 272 | + } else { | |
| 273 | + <div class="line" data-kb-row=""> | |
| 274 | + <span class="name">(row.username.as_str())</span> | |
| 275 | + <span class="val"> | |
| 276 | + if !row.email.is_empty() { | |
| 277 | + (row.email.as_str()) " · " | |
| 278 | + } | |
| 279 | + (row.role.as_str()) " · " rel_time(lang: lang, stamp: row.created_at.as_str()) | |
| 280 | + </span> | |
| 281 | + </div> | |
| 282 | + } | |
| 283 | + } | |
| 284 | + pager(page: page, pages: pages, links: links, prev: prev, next: next, lang: lang) | |
| 285 | + </div> | |
| 284 | 286 | </div> |
| 285 | 287 | }) |
| 286 | 288 | } |
| 287 | 289 | |
| 290 | +/// The rail of the Users tab: Users and Invites. `current` is `users` or `invites`. | |
| 291 | +#[component] | |
| 292 | +pub(crate) async fn users_rail(lang: Lang, current: &'static str) -> Result<impl View> { | |
| 293 | + let items = vec![ | |
| 294 | + RailItem { | |
| 295 | + name: g::t(lang, K::Users).to_owned(), | |
| 296 | + val: String::new(), | |
| 297 | + href: "/admin/users".to_owned(), | |
| 298 | + current: current == "users", | |
| 299 | + }, | |
| 300 | + RailItem { | |
| 301 | + name: g::t(lang, K::Invites).to_owned(), | |
| 302 | + val: String::new(), | |
| 303 | + href: "/admin/invites".to_owned(), | |
| 304 | + current: current == "invites", | |
| 305 | + }, | |
| 306 | + ]; | |
| 307 | + Ok(view! { | |
| 308 | + rail(label: g::t(lang, K::Users), items: items) | |
| 309 | + }) | |
| 310 | +} | |
| 311 | + | |
| 288 | 312 | /// What the account list shows, as one string: a change to any of it is sent to the page. |
| 289 | 313 | async fn list_fingerprint(store: &Store) -> topcoat::Result<String> { |
| 290 | 314 | let users = store.list_users().await?; |
| @@ -489,7 +513,7 @@ async fn delete_body( | ||
| 489 | 513 | <p class="state">(g::t(lang, K::DeletesAccount))<strong>(target.username.as_str())</strong>(g::t(lang, K::DeleteAccountRest))</p> |
| 490 | 514 | if has_repos { |
| 491 | 515 | <section class="sec"> |
| 492 | - <p class="hint">(g::t(lang, K::TransferOrDeleteFirst))</p> | |
| 516 | + <p class="state">(g::t(lang, K::TransferOrDeleteFirst))</p> | |
| 493 | 517 | <ul class="item-list"> |
| 494 | 518 | for name in repos.into_iter() { |
| 495 | 519 | <li>(name)</li> |
| @@ -500,13 +524,13 @@ async fn delete_body( | ||
| 500 | 524 | if let Some(impact) = impact { |
| 501 | 525 | <section class="sec"> |
| 502 | 526 | <h2>(g::t(lang, K::WhatHappens))</h2> |
| 503 | - <p class="hint">(g::t(lang, K::MovedToGhost))</p> | |
| 527 | + <p class="state">(g::t(lang, K::MovedToGhost))</p> | |
| 504 | 528 | <ul class="item-list"> |
| 505 | 529 | for line in impact.moved.into_iter() { |
| 506 | 530 | <li>(line)</li> |
| 507 | 531 | } |
| 508 | 532 | </ul> |
| 509 | - <p class="hint">(g::t(lang, K::RemovedWithAccount))</p> | |
| 533 | + <p class="state">(g::t(lang, K::RemovedWithAccount))</p> | |
| 510 | 534 | <ul class="item-list"> |
| 511 | 535 | for line in impact.removed.into_iter() { |
| 512 | 536 | <li>(line)</li> |
| @@ -553,7 +577,7 @@ async fn org_delete_note( | ||
| 553 | 577 | <p class="state"><strong>(target.username.as_str())</strong>(g::t(lang, K::OrgNotAUser))</p> |
| 554 | 578 | if has_repos { |
| 555 | 579 | <section class="sec"> |
| 556 | - <p class="hint">(g::t(lang, K::OrgReposFirst))</p> | |
| 580 | + <p class="state">(g::t(lang, K::OrgReposFirst))</p> | |
| 557 | 581 | <ul class="item-list"> |
| 558 | 582 | for name in repos.into_iter() { |
| 559 | 583 | <li>(name)</li> |
crates/forge-web/src/pages/audit_log.rsmodified+9 -15
| @@ -19,10 +19,10 @@ use crate::live::{Topic, stream_changes}; | ||
| 19 | 19 | use crate::pages::admin_users::admin_only; |
| 20 | 20 | use crate::pages::issues_list::list_href; |
| 21 | 21 | use crate::pages::passkeys::s; |
| 22 | -use crate::pages::settings_security::{security_rail_for, security_sub}; | |
| 22 | +use crate::pages::settings_security::security_rail_for; | |
| 23 | 23 | use crate::state::AppState; |
| 24 | 24 | use crate::views::find::{Finder, finder_field}; |
| 25 | -use crate::views::parts::{RailItem, SubPart, head, rail}; | |
| 25 | +use crate::views::parts::{RailItem, head, rail}; | |
| 26 | 26 | use crate::views::repo_list::{PageLink, pager, pager_links}; |
| 27 | 27 | use crate::views::{rel_time, shell}; |
| 28 | 28 | |
| @@ -497,12 +497,11 @@ async fn audit_table(lang: Lang, groups: Vec<Group>, show_actor: bool) -> Result | ||
| 497 | 497 | #[component] |
| 498 | 498 | async fn single_row(lang: Lang, mut group: Group, show_actor: bool) -> Result<impl View> { |
| 499 | 499 | let row = group.rows.remove(0); |
| 500 | - let title = row.details.clone(); | |
| 501 | 500 | let name = row.name.clone(); |
| 502 | 501 | let action = row.action.clone(); |
| 503 | 502 | Ok(view! { |
| 504 | - <div class="line" data-kb-row="" title=(title.as_str())> | |
| 505 | - <span class="name" title=(action.as_str())>(name.as_str())</span> | |
| 503 | + <div class="line" data-kb-row="" data-action=(action.as_str())> | |
| 504 | + <span class="name">(name.as_str())</span> | |
| 506 | 505 | <span class="val">entry_facts(lang: lang, row: row, show_actor: show_actor, show_target: true, show_ip: true, show_details: true)</span> |
| 507 | 506 | </div> |
| 508 | 507 | }) |
| @@ -538,8 +537,8 @@ async fn group_row(lang: Lang, mut group: Group, show_actor: bool) -> Result<imp | ||
| 538 | 537 | let rows = std::mem::take(&mut group.rows); |
| 539 | 538 | Ok(view! { |
| 540 | 539 | <details class="log-group"> |
| 541 | - <summary class="line" data-kb-row=""> | |
| 542 | - <span class="name" title=(action.as_str())>(name.as_str())</span> | |
| 540 | + <summary class="line" data-kb-row="" data-action=(action.as_str())> | |
| 541 | + <span class="name">(name.as_str())</span> | |
| 543 | 542 | <span class="count">"×" (count.as_str())</span> |
| 544 | 543 | <span class="val"> |
| 545 | 544 | rel_time(lang: lang, stamp: when.as_str()) |
| @@ -575,9 +574,8 @@ async fn item_line( | ||
| 575 | 574 | show_ip: bool, |
| 576 | 575 | show_details: bool, |
| 577 | 576 | ) -> Result<impl View> { |
| 578 | - let title = row.details.clone(); | |
| 579 | 577 | Ok(view! { |
| 580 | - <div class="line" title=(title.as_str())> | |
| 578 | + <div class="line"> | |
| 581 | 579 | <span class="val">entry_facts(lang: lang, row: row, show_actor: false, show_target: show_target, show_ip: show_ip, show_details: show_details)</span> |
| 582 | 580 | </div> |
| 583 | 581 | }) |
| @@ -599,9 +597,8 @@ async fn admin_audit_view( | ||
| 599 | 597 | nav: (Vec<PageLink>, Option<String>, Option<String>), |
| 600 | 598 | ) -> Result<impl View> { |
| 601 | 599 | let (links, prev, next) = nav; |
| 602 | - let sub = vec![SubPart::text(g::t(lang, K::AuditIntro))]; | |
| 603 | 600 | Ok(view! { |
| 604 | - head(title: g::t(lang, K::AuditLog), sub: sub) | |
| 601 | + head(title: g::t(lang, K::AuditLog)) | |
| 605 | 602 | <div class="sheet" data-live=(live.as_str())> |
| 606 | 603 | log_tools(lang: lang, form_action: "/admin/audit", finder: finder, action: action, actor: actor, span: span, total: total) |
| 607 | 604 | if let Some(message) = notice { |
| @@ -627,9 +624,8 @@ async fn own_log_view( | ||
| 627 | 624 | nav: (Vec<PageLink>, Option<String>, Option<String>), |
| 628 | 625 | ) -> Result<impl View> { |
| 629 | 626 | let (links, prev, next) = nav; |
| 630 | - let sub = vec![SubPart::text(security_sub(lang))]; | |
| 631 | 627 | Ok(view! { |
| 632 | - head(title: i18n::t(lang, i18n::Key::Security), sub: sub) | |
| 628 | + head(title: i18n::t(lang, i18n::Key::Security)) | |
| 633 | 629 | <div class="work"> |
| 634 | 630 | rail(label: i18n::t(lang, i18n::Key::Security), items: items) |
| 635 | 631 | <div class="sheet"> |
| @@ -923,8 +919,6 @@ mod tests { | ||
| 923 | 919 | ) |
| 924 | 920 | .await; |
| 925 | 921 | assert_eq!(status, 200); |
| 926 | - // One row of the viewer's own sign-in (the action filter lists it once more). | |
| 927 | - assert_eq!(body.matches("title=\"login_success\"").count(), 1); | |
| 928 | 922 | assert!(body.contains("password_reset_by_admin")); |
| 929 | 923 | |
| 930 | 924 | // The own log needs a session. |
crates/forge-web/src/pages/blame.rsmodified+1 -1
| @@ -117,7 +117,7 @@ async fn blame_table(rows: Vec<Row>, lang: Lang) -> Result<impl View> { | ||
| 117 | 117 | <span class="blame-author">(meta.author.as_str())</span> |
| 118 | 118 | <time class="hint" data-rel="true" datetime=(meta.iso.as_str())>(meta.age.as_str())</time> |
| 119 | 119 | if let Some(prior) = meta.prior_href { |
| 120 | - <a class="blame-prior" href=(prior.as_str()) title=(b::t(lang, b::K::BlamePrior)) aria-label=(b::t(lang, b::K::BlamePrior))>(s(lang, "Prior", "Önceki"))</a> | |
| 120 | + <a class="blame-prior" href=(prior.as_str()) aria-label=(b::t(lang, b::K::BlamePrior))>(s(lang, "Prior", "Önceki"))</a> | |
| 121 | 121 | } |
| 122 | 122 | </div> |
| 123 | 123 | <a class="blame-summary" href=(meta.commit_href.as_str()) title=(meta.summary.as_str())>commit_line(subject: meta.summary.clone())</a> |
crates/forge-web/src/pages/blob.rsmodified+1 -1
| @@ -354,7 +354,7 @@ async fn blob_page(cx: &Cx) -> Result<impl View> { | ||
| 354 | 354 | <a class="act" href=(raw.clone())>(g::t(lang, K::RawLink))</a> |
| 355 | 355 | <a class="act" href=(download_href) download=(download_name)>(g::t(lang, K::DownloadLink))</a> |
| 356 | 356 | if can_blame { |
| 357 | - <button type="button" class="act" data-copy-permalink="" title=(b::t(lang, b::K::PermalinkHint)) | |
| 357 | + <button type="button" class="act" data-copy-permalink="" | |
| 358 | 358 | data-copied=(b::t(lang, b::K::PermalinkCopied))>(b::t(lang, b::K::CopyPermalink))</button> |
| 359 | 359 | } |
| 360 | 360 | </div> |
crates/forge-web/src/pages/branches.rsmodified+1 -1
| @@ -119,7 +119,7 @@ async fn new_branch_form( | ||
| 119 | 119 | <div class="field"> |
| 120 | 120 | <label for="branch-from">(b::t(lang, b::K::BranchFromLabel))</label> |
| 121 | 121 | <input id="branch-from" type="text" name="from" list="branch-sources" value=(default_branch.as_str()) |
| 122 | - placeholder=(b::t(lang, b::K::BranchFromPlaceholder)) autocomplete="off" spellcheck="false"> | |
| 122 | + autocomplete="off" spellcheck="false"> | |
| 123 | 123 | </div> |
| 124 | 124 | <datalist id="branch-sources"> |
| 125 | 125 | for option in options.iter() { |
crates/forge-web/src/pages/ci_job.rsmodified+4 -5
| @@ -479,11 +479,11 @@ async fn job_body( | ||
| 479 | 479 | <strong>(g::t(lang, K::Log))</strong> |
| 480 | 480 | <div class="ci-tl-tools"> |
| 481 | 481 | <input type="search" class="ci-logsearch" data-log-q="true" placeholder=(g::t(lang, K::LogSearch)) aria-label=(g::t(lang, K::LogSearch)) autocomplete="off" spellcheck="false"> |
| 482 | - <label class="find-opt" title=(crate::pages::passkeys::s(lang, "Only the text as typed, as one piece", "Yalnızca yazılan metin, tek parça olarak"))><input type="checkbox" data-log-exact="true"><span>(crate::pages::passkeys::s(lang, "Exact", "Tam"))</span></label> | |
| 483 | - <label class="find-opt" title=(crate::pages::passkeys::s(lang, "Keep upper and lower case apart", "Büyük ve küçük harfi ayırt et"))><input type="checkbox" data-log-case="true"><span>"Aa"</span></label> | |
| 482 | + <label class="find-opt"><input type="checkbox" data-log-exact="true"><span>(crate::pages::passkeys::s(lang, "Exact", "Tam"))</span></label> | |
| 483 | + <label class="find-opt"><input type="checkbox" data-log-case="true"><span>"Aa"</span></label> | |
| 484 | 484 | <span class="ci-logcount" data-log-count="true" data-none=(g::t(lang, K::LogNoMatches)) aria-live="polite"></span> |
| 485 | - <button type="button" class="act" data-log-prev="true" aria-label=(g::t(lang, K::LogPrev)) title=(g::t(lang, K::LogPrev))>"\u{2191}"</button> | |
| 486 | - <button type="button" class="act" data-log-next="true" aria-label=(g::t(lang, K::LogNext)) title=(g::t(lang, K::LogNext))>"\u{2193}"</button> | |
| 485 | + <button type="button" class="act" data-log-prev="true" aria-label=(g::t(lang, K::LogPrev))>"\u{2191}"</button> | |
| 486 | + <button type="button" class="act" data-log-next="true" aria-label=(g::t(lang, K::LogNext))>"\u{2193}"</button> | |
| 487 | 487 | <button type="button" class="act" data-copy-log=(job.log_href.as_str()) data-palette-action="click" data-copied=(g::t(lang, K::CopyDone)) data-failed=(g::t(lang, K::CopyFailed))>(g::t(lang, K::CopyLog))</button> |
| 488 | 488 | <a class="act" href=(job.log_href.as_str())>(g::t(lang, K::FullLog))</a> |
| 489 | 489 | <span class="ci-logfold" data-log-fold-box="true" hidden="hidden"> |
| @@ -511,7 +511,6 @@ async fn job_body( | ||
| 511 | 511 | </div> |
| 512 | 512 | } |
| 513 | 513 | <div class="sec ci-dock"> |
| 514 | - <p class="hint">(crate::pages::passkeys::s(lang, "a bar's height is its lines changed, its colour its CI result", "çubuğun yüksekliği değişen satır sayısı, rengi CI sonucudur"))</p> | |
| 515 | 514 | <div class="dock-history"> |
| 516 | 515 | history_strip(lang: lang, owner: owner, repo: repo, bars: bars) |
| 517 | 516 | </div> |
crates/forge-web/src/pages/ci_runs.rsmodified+39 -41
| @@ -422,12 +422,11 @@ struct BadgeInfo { | ||
| 422 | 422 | snippet: String, |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | -/// The left column: the header menus, the scale, the rows and the pager. | |
| 425 | +/// The left column: the head's Run workflow menu, the sheet with its rows and the pager. | |
| 426 | 426 | struct ListView { |
| 427 | 427 | manual: Option<ManualRun>, |
| 428 | 428 | badge: BadgeInfo, |
| 429 | 429 | total: u64, |
| 430 | - scale: String, | |
| 431 | 430 | rows: Vec<RunRow>, |
| 432 | 431 | newer_href: Option<String>, |
| 433 | 432 | older_href: Option<String>, |
| @@ -1848,7 +1847,6 @@ async fn runs_split( | ||
| 1848 | 1847 | manual, |
| 1849 | 1848 | badge: badge_info(state, &title, &ctx.repo.default_branch), |
| 1850 | 1849 | total, |
| 1851 | - scale: g::scale_label(lang, &span_text(scale)), | |
| 1852 | 1850 | rows, |
| 1853 | 1851 | newer_href, |
| 1854 | 1852 | older_href, |
| @@ -2184,16 +2182,14 @@ fn query_value(cx: &Cx, key: &str) -> Option<String> { | ||
| 2184 | 2182 | .map(|(_, value)| value.into_owned()) |
| 2185 | 2183 | } |
| 2186 | 2184 | |
| 2187 | -/// The Run workflow and badge menus of the runs list. They sit in the list's head, beside its title. | |
| 2185 | +/// The head's one action on the runs list: Run workflow, for a writer. Its form sits in its menu. | |
| 2188 | 2186 | #[component] |
| 2189 | 2187 | async fn ci_menus(lang: Lang, list: &ListView) -> Result<impl View> { |
| 2190 | - let badge = &list.badge; | |
| 2191 | 2188 | Ok(view! { |
| 2192 | 2189 | if let Some(form) = list.manual.as_ref() { |
| 2193 | 2190 | <details class="menu ci-tool"> |
| 2194 | - <summary>(g::t(lang, K::RunWorkflow))</summary> | |
| 2191 | + <summary class="button primary">(g::t(lang, K::RunWorkflow))</summary> | |
| 2195 | 2192 | <div class="menu-list ci-pop"> |
| 2196 | - <p class="muted small">(g::t(lang, K::RunWorkflowHelp))</p> | |
| 2197 | 2193 | <form method="post" action=(form.action.as_str()) class="ci-manual-form"> |
| 2198 | 2194 | <input type="hidden" name="csrf" value=(form.csrf.as_str())> |
| 2199 | 2195 | <label> |
| @@ -2209,17 +2205,6 @@ async fn ci_menus(lang: Lang, list: &ListView) -> Result<impl View> { | ||
| 2209 | 2205 | </div> |
| 2210 | 2206 | </details> |
| 2211 | 2207 | } |
| 2212 | - <details class="menu ci-tool"> | |
| 2213 | - <summary>(g::t(lang, K::BadgeHeading))</summary> | |
| 2214 | - <div class="menu-list ci-pop"> | |
| 2215 | - <p class="muted small">(g::t(lang, K::BadgeHelp))</p> | |
| 2216 | - <p><img src=(badge.image.as_str()) alt="build"></p> | |
| 2217 | - <label class="small"> | |
| 2218 | - (g::t(lang, K::BadgeSnippet)) | |
| 2219 | - <textarea readonly="readonly" rows="2" class="ci-badge-snippet">(badge.snippet.as_str())</textarea> | |
| 2220 | - </label> | |
| 2221 | - </div> | |
| 2222 | - </details> | |
| 2223 | 2208 | }) |
| 2224 | 2209 | } |
| 2225 | 2210 | |
| @@ -2228,8 +2213,8 @@ async fn ci_menus(lang: Lang, list: &ListView) -> Result<impl View> { | ||
| 2228 | 2213 | #[component] |
| 2229 | 2214 | async fn runs_sheet(lang: Lang, list: &ListView) -> Result<impl View> { |
| 2230 | 2215 | let ListView { |
| 2216 | + badge, | |
| 2231 | 2217 | total, |
| 2232 | - scale, | |
| 2233 | 2218 | rows, |
| 2234 | 2219 | newer_href, |
| 2235 | 2220 | older_href, |
| @@ -2242,13 +2227,22 @@ async fn runs_sheet(lang: Lang, list: &ListView) -> Result<impl View> { | ||
| 2242 | 2227 | <div class="sheet-tools"> |
| 2243 | 2228 | <strong>(g::t(lang, K::Runs))</strong> |
| 2244 | 2229 | <span class="hint ci-count">(total)</span> |
| 2245 | - <span class="hint ci-scale">(scale.as_str())</span> | |
| 2230 | + <details class="menu ci-tool ci-badge-tool"> | |
| 2231 | + <summary class="act">(g::t(lang, K::BadgeHeading))</summary> | |
| 2232 | + <div class="menu-list ci-pop"> | |
| 2233 | + <p><img src=(badge.image.as_str()) alt="build"></p> | |
| 2234 | + <label class="small"> | |
| 2235 | + (g::t(lang, K::BadgeSnippet)) | |
| 2236 | + <textarea readonly="readonly" rows="2" class="ci-badge-snippet">(badge.snippet.as_str())</textarea> | |
| 2237 | + </label> | |
| 2238 | + </div> | |
| 2239 | + </details> | |
| 2246 | 2240 | </div> |
| 2247 | 2241 | if let Some(next) = next_scheduled.as_ref() { |
| 2248 | 2242 | <p class="ci-next hint">(g::t(lang, K::NextScheduledRun)) ": " rel_time(lang: lang, stamp: next.as_str())</p> |
| 2249 | 2243 | } |
| 2250 | 2244 | if rows.is_empty() { |
| 2251 | - empty_state(title: g::t(lang, K::NoRunsYet), hint: Some(g::t(lang, K::NoRunsHint))) | |
| 2245 | + empty_state(title: g::t(lang, K::NoRunsYet)) | |
| 2252 | 2246 | } else { |
| 2253 | 2247 | <div class="ci-run-list"> |
| 2254 | 2248 | for row in rows.iter() { |
| @@ -2263,9 +2257,17 @@ async fn runs_sheet(lang: Lang, list: &ListView) -> Result<impl View> { | ||
| 2263 | 2257 | </svg> |
| 2264 | 2258 | if let Some(est) = row.est.as_ref() { |
| 2265 | 2259 | <progress class="ci-est" max="100" value=(est.pct.as_str()) data-est="true" data-since=(row.since.as_deref()) data-expected=(est.expected.as_str())></progress> |
| 2266 | - <span class="val"><span class="ci-row-meta">(row.meta.head.as_str())<time datetime=(row.meta.at.as_str()) data-rel="true">(row.meta.age.as_str())</time>(row.meta.hint.as_str())</span> " · " <span class="ci-row-dur" data-since=(row.since.as_deref()) data-expected=(est.expected.as_str()) data-left=(est.left.as_str()) data-over=(est.over.as_str()) data-lm=(est.minutes.as_str())>(row.duration.as_str())</span></span> | |
| 2260 | + <span class="val"><span class="ci-row-meta">(row.meta.head.as_str())<time datetime=(row.meta.at.as_str()) data-rel="true">(row.meta.age.as_str())</time>(row.meta.hint.as_str())</span> | |
| 2261 | + if !row.duration.is_empty() { | |
| 2262 | + " · " <span class="ci-row-dur" data-since=(row.since.as_deref()) data-expected=(est.expected.as_str()) data-left=(est.left.as_str()) data-over=(est.over.as_str()) data-lm=(est.minutes.as_str())>(row.duration.as_str())</span> | |
| 2263 | + } | |
| 2264 | + </span> | |
| 2267 | 2265 | } else { |
| 2268 | - <span class="val"><span class="ci-row-meta">(row.meta.head.as_str())<time datetime=(row.meta.at.as_str()) data-rel="true">(row.meta.age.as_str())</time>(row.meta.hint.as_str())</span> " · " <span class="ci-row-dur" data-since=(row.since.as_deref())>(row.duration.as_str())</span></span> | |
| 2266 | + <span class="val"><span class="ci-row-meta">(row.meta.head.as_str())<time datetime=(row.meta.at.as_str()) data-rel="true">(row.meta.age.as_str())</time>(row.meta.hint.as_str())</span> | |
| 2267 | + if !row.duration.is_empty() { | |
| 2268 | + " · " <span class="ci-row-dur" data-since=(row.since.as_deref())>(row.duration.as_str())</span> | |
| 2269 | + } | |
| 2270 | + </span> | |
| 2269 | 2271 | } |
| 2270 | 2272 | </a> |
| 2271 | 2273 | if let Some((action, token)) = row.rerun.as_ref() { |
| @@ -2293,8 +2295,7 @@ async fn runs_sheet(lang: Lang, list: &ListView) -> Result<impl View> { | ||
| 2293 | 2295 | }) |
| 2294 | 2296 | } |
| 2295 | 2297 | |
| 2296 | -/// The runs page body: the repo head with the Run workflow and badge menus beside its title, then the | |
| 2297 | -/// runs sheet. The live region is the list's stream, so the list re-renders when a run changes. | |
| 2298 | +/// The runs page body: the repo head with its Run workflow menu beside its title, then the runs sheet. The live region is the list's stream, so the list re-renders when a run changes. | |
| 2298 | 2299 | #[component] |
| 2299 | 2300 | async fn runs_body( |
| 2300 | 2301 | head: RepoHead, |
| @@ -2447,12 +2448,13 @@ async fn run_head(lang: Lang, run: &RunDetail, all_href: Option<String>) -> Resu | ||
| 2447 | 2448 | if run.can_cancel && run.stopping { |
| 2448 | 2449 | <button type="button" class="ci-stopping" disabled="disabled">(g::t(lang, K::StoppingButton))</button> |
| 2449 | 2450 | } else if run.can_cancel { |
| 2450 | - confirm_post(lang: lang, csrf: csrf.as_str(), action: cancel_action.as_str(), label: g::t(lang, K::Cancel), message: crate::pages::passkeys::s(lang, "The run stops and its unfinished jobs are cancelled.", "Çalıştırma durur ve bitmemiş işleri iptal edilir.").to_owned(), confirm: crate::pages::passkeys::s(lang, "Yes, cancel", "Evet, iptal et"), fields: vec![]) | |
| 2451 | + confirm_post(lang: lang, csrf: csrf.as_str(), action: cancel_action.as_str(), label: g::t(lang, K::Cancel), message: crate::pages::passkeys::s(lang, "Cancel this run?", "Bu çalıştırma iptal edilsin mi?").to_owned(), confirm: crate::pages::passkeys::s(lang, "Yes, cancel", "Evet, iptal et"), fields: vec![]) | |
| 2451 | 2452 | } |
| 2452 | 2453 | if rerun_failed_shown { |
| 2453 | 2454 | action_button(action: format!("{}/rerun-failed", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::RerunFailed), primary: true) |
| 2454 | 2455 | } |
| 2455 | - if !run.can_approve && run.reachable { | |
| 2456 | + // Re-run is for a finished run; while it runs or waits, Cancel is the head's one action. | |
| 2457 | + if !run.can_approve && !run.can_cancel && run.reachable { | |
| 2456 | 2458 | action_button(action: format!("{}/rerun", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::Rerun), primary: !rerun_failed_shown) |
| 2457 | 2459 | } |
| 2458 | 2460 | } |
| @@ -2460,12 +2462,12 @@ async fn run_head(lang: Lang, run: &RunDetail, all_href: Option<String>) -> Resu | ||
| 2460 | 2462 | <p class="head-sub"> |
| 2461 | 2463 | <span class="b" data-run=(run.number) title=(run.title.as_str())>(run.title.as_str())</span> |
| 2462 | 2464 | <span class="sep" aria-hidden="true">"·"</span> |
| 2463 | - <span>(run.trigger.as_str()) " \u{b7} " (run.branch.as_str())</span> | |
| 2465 | + <span>(run.trigger.as_str()) if !run.branch.is_empty() { " \u{b7} " (run.branch.as_str()) }</span> | |
| 2464 | 2466 | <span class="sep" aria-hidden="true">"·"</span> |
| 2465 | 2467 | if let Some(href) = run.commit_href.as_ref() { |
| 2466 | 2468 | <a class="mono" href=(href.as_str())>(run.commit.as_str())</a> |
| 2467 | 2469 | } else { |
| 2468 | - <span class="mono" title=(g::t(lang, K::CiCommitOverwritten))>(run.commit.as_str())</span> | |
| 2470 | + <span class="mono">(run.commit.as_str())</span> | |
| 2469 | 2471 | } |
| 2470 | 2472 | if !run.actor.is_empty() { |
| 2471 | 2473 | <span class="sep" aria-hidden="true">"·"</span> |
| @@ -2574,12 +2576,7 @@ async fn run_artifacts(lang: Lang, run: &RunDetail) -> Result<impl View> { | ||
| 2574 | 2576 | Ok(view! { |
| 2575 | 2577 | if !run.artifacts.is_empty() { |
| 2576 | 2578 | <div class="sec"> |
| 2577 | - <div class="acts"> | |
| 2578 | - <h2>(g::t(lang, K::Artifacts))</h2> | |
| 2579 | - if let Some(href) = run.zip_href.as_ref() { | |
| 2580 | - <a class="act" href=(href.as_str()) download="">(g::t(lang, K::DownloadAll))</a> | |
| 2581 | - } | |
| 2582 | - </div> | |
| 2579 | + <h2>(g::t(lang, K::Artifacts))</h2> | |
| 2583 | 2580 | for artifact in run.artifacts.iter() { |
| 2584 | 2581 | <div class="line"> |
| 2585 | 2582 | <span class="name">(artifact.name.as_str())</span> |
| @@ -2623,13 +2620,16 @@ async fn run_log( | ||
| 2623 | 2620 | if let Some(log) = run.log.as_ref() { |
| 2624 | 2621 | <div class="ci-tl-tools"> |
| 2625 | 2622 | <input type="search" class="ci-logsearch" data-log-q="true" placeholder=(g::t(lang, K::LogSearch)) aria-label=(g::t(lang, K::LogSearch)) autocomplete="off" spellcheck="false"> |
| 2626 | - <label class="find-opt" title=(crate::pages::passkeys::s(lang, "Only the text as typed, as one piece", "Yalnızca yazılan metin, tek parça olarak"))><input type="checkbox" data-log-exact="true"><span>(crate::pages::passkeys::s(lang, "Exact", "Tam"))</span></label> | |
| 2627 | - <label class="find-opt" title=(crate::pages::passkeys::s(lang, "Keep upper and lower case apart", "Büyük ve küçük harfi ayırt et"))><input type="checkbox" data-log-case="true"><span>"Aa"</span></label> | |
| 2623 | + <label class="find-opt"><input type="checkbox" data-log-exact="true"><span>(crate::pages::passkeys::s(lang, "Exact", "Tam"))</span></label> | |
| 2624 | + <label class="find-opt"><input type="checkbox" data-log-case="true"><span>"Aa"</span></label> | |
| 2628 | 2625 | <span class="ci-logcount" data-log-count="true" data-none=(g::t(lang, K::LogNoMatches)) aria-live="polite"></span> |
| 2629 | - <button type="button" class="act" data-log-prev="true" aria-label=(g::t(lang, K::LogPrev)) title=(g::t(lang, K::LogPrev))>"\u{2191}"</button> | |
| 2630 | - <button type="button" class="act" data-log-next="true" aria-label=(g::t(lang, K::LogNext)) title=(g::t(lang, K::LogNext))>"\u{2193}"</button> | |
| 2626 | + <button type="button" class="act" data-log-prev="true" aria-label=(g::t(lang, K::LogPrev))>"\u{2191}"</button> | |
| 2627 | + <button type="button" class="act" data-log-next="true" aria-label=(g::t(lang, K::LogNext))>"\u{2193}"</button> | |
| 2631 | 2628 | <button type="button" class="act" data-copy-log=(log.log_href.as_str()) data-palette-action="click" data-copied=(g::t(lang, K::CopyDone)) data-failed=(g::t(lang, K::CopyFailed))>(g::t(lang, K::CopyLog))</button> |
| 2632 | 2629 | <a class="act" href=(log.href.as_str())>(g::t(lang, K::FullLog))</a> |
| 2630 | + if let Some(href) = run.zip_href.as_ref() { | |
| 2631 | + <a class="act" href=(href.as_str()) download="">(g::t(lang, K::DownloadAll))</a> | |
| 2632 | + } | |
| 2633 | 2633 | if let (Some(action), Some(csrf)) = (log.rerun.as_ref(), run.writer_csrf.as_ref()) { |
| 2634 | 2634 | <form method="post" action=(action.as_str()) class="act-form ci-job-rerun"> |
| 2635 | 2635 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| @@ -2650,7 +2650,6 @@ async fn run_log( | ||
| 2650 | 2650 | if !run.warnings.is_empty() { |
| 2651 | 2651 | <section class="ci-warnings" role="status"> |
| 2652 | 2652 | <p class="ci-warnings-title">(g::t(lang, K::ConfigWarnings))</p> |
| 2653 | - <p class="hint">(g::t(lang, K::ConfigWarningsHint))</p> | |
| 2654 | 2653 | <ul> |
| 2655 | 2654 | for warning in run.warnings.iter() { |
| 2656 | 2655 | <li><code>(warning.as_str())</code></li> |
| @@ -2680,7 +2679,6 @@ async fn run_log( | ||
| 2680 | 2679 | run_timeline(lang: lang, run: run) |
| 2681 | 2680 | run_artifacts(lang: lang, run: run) |
| 2682 | 2681 | <div class="sec ci-dock"> |
| 2683 | - <p class="hint">(crate::pages::passkeys::s(lang, "a bar's height is its lines changed, its colour its CI result", "çubuğun yüksekliği değişen satır sayısı, rengi CI sonucudur"))</p> | |
| 2684 | 2682 | <div class="dock-history"> |
| 2685 | 2683 | history_strip(lang: lang, owner: owner, repo: repo, bars: bars) |
| 2686 | 2684 | </div> |
crates/forge-web/src/pages/ci_tests.rsmodified+1 -1
| @@ -261,7 +261,7 @@ async fn access_follows_the_repo_role_on_every_route() { | ||
| 261 | 261 | let run = run_with(&fx, &["build"], false).await; |
| 262 | 262 | let run_url = format!("{RUN_BASE}/runs/{}", run.number); |
| 263 | 263 | let writer = get(&fx.app, &run_url, Some(&cookie_for("bob-token"))).await; |
| 264 | - assert!(writer.text().contains(">Re-run<"), "writer sees re-run"); | |
| 264 | + assert!(!writer.text().contains(">Re-run<"), "a queued run has no re-run yet"); | |
| 265 | 265 | assert!(writer.text().contains(">Cancel<"), "writer sees cancel"); |
| 266 | 266 | let reader = get(&fx.app, &run_url, Some(&cookie_for("dave-token"))).await; |
| 267 | 267 | assert_eq!(reader.status, 200); |
crates/forge-web/src/pages/code_search.rsmodified+1 -1
| @@ -224,7 +224,7 @@ async fn search_page(cx: &Cx) -> Result<impl View> { | ||
| 224 | 224 | </div> |
| 225 | 225 | <div class="field"> |
| 226 | 226 | <label for="search-path">(g::t(lang, K::PathField))</label> |
| 227 | - <input id="search-path" type="text" name="path" value=(path_value.as_str()) placeholder="src/**/*.rs" data-live-search=""> | |
| 227 | + <input id="search-path" type="text" name="path" value=(path_value.as_str()) data-live-search=""> | |
| 228 | 228 | </div> |
| 229 | 229 | <label class="switch"> |
| 230 | 230 | <input type="checkbox" name="case" value="1" checked=(match_case) data-autosubmit=(true)> |
crates/forge-web/src/pages/discussion_settings.rsmodified+14 -24
| @@ -1,6 +1,6 @@ | ||
| 1 | -//! The Discussions switch on the repo settings page. `POST /{owner}/{repo}/settings/discussions` | |
| 2 | -//! with `enabled=1` or `enabled=0`. Admins only. Turning discussions off hides the tab and makes | |
| 3 | -//! the discussion pages 404; the discussions themselves are kept. | |
| 1 | +//! The Discussions switch in the Features topic of the General settings page. `POST | |
| 2 | +//! /{owner}/{repo}/settings/discussions` with `enabled=1` or `enabled=0`. Admins only. Turning | |
| 3 | +//! discussions off hides the tab and makes the discussion pages 404; the discussions themselves are kept. | |
| 4 | 4 | |
| 5 | 5 | use forge_core::AuditAction; |
| 6 | 6 | use serde::Deserialize; |
| @@ -14,7 +14,6 @@ use topcoat::view::{View, component, view}; | ||
| 14 | 14 | use crate::audit::{self, Actor, Target}; |
| 15 | 15 | use crate::auth::require_csrf; |
| 16 | 16 | use crate::i18n::Lang; |
| 17 | -use crate::i18n::community::{self as g, K}; | |
| 18 | 17 | use crate::live::Topic; |
| 19 | 18 | use crate::pages::repo_ctx::load_repo; |
| 20 | 19 | use crate::state::AppState; |
| @@ -23,32 +22,24 @@ use crate::views::repo_href; | ||
| 23 | 22 | path_param!(owner); |
| 24 | 23 | path_param!(repo); |
| 25 | 24 | |
| 26 | -/// The Discussions topic: one switch, then its hint. `enabled` is the current state. The switch submits | |
| 25 | +/// The Discussions feature: one switch, then its hint. `enabled` is the current state. The switch submits | |
| 27 | 26 | /// the form on change (`data-autosubmit`); an unchecked box sends no `enabled`, which the handler reads as off. |
| 28 | 27 | #[component] |
| 29 | -pub(crate) async fn discussions_card( | |
| 28 | +pub(crate) async fn discussions_switch( | |
| 30 | 29 | lang: Lang, |
| 31 | 30 | action: String, |
| 32 | 31 | csrf: String, |
| 33 | 32 | enabled: bool, |
| 34 | 33 | ) -> Result<impl View> { |
| 35 | - let switch_label = if enabled { | |
| 36 | - g::t(lang, K::TurnOffDiscussions) | |
| 37 | - } else { | |
| 38 | - g::t(lang, K::TurnOnDiscussions) | |
| 39 | - }; | |
| 34 | + let switch_label = crate::pages::passkeys::s(lang, "Discussions", "Tartışmalar"); | |
| 40 | 35 | Ok(view! { |
| 41 | - <section class="sec" id="discussions"> | |
| 42 | - <h2>(g::t(lang, K::Discussions))</h2> | |
| 43 | - <form method="post" action=(action.as_str())> | |
| 44 | - <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 45 | - <label class="switch"> | |
| 46 | - <input type="checkbox" name="enabled" value="1" checked=(enabled) data-autosubmit="true"> | |
| 47 | - <span>(switch_label)</span> | |
| 48 | - </label> | |
| 49 | - <p class="hint">(g::t(lang, K::DiscussionsDescription))</p> | |
| 50 | - </form> | |
| 51 | - </section> | |
| 36 | + <form method="post" action=(action.as_str()) id="discussions"> | |
| 37 | + <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 38 | + <label class="switch"> | |
| 39 | + <input type="checkbox" name="enabled" value="1" checked=(enabled) data-autosubmit="true"> | |
| 40 | + <span>(switch_label)</span> | |
| 41 | + </label> | |
| 42 | + </form> | |
| 52 | 43 | }) |
| 53 | 44 | } |
| 54 | 45 | |
| @@ -94,6 +85,5 @@ async fn settings_discussions_save(cx: &Cx, Form(form): Form<ToggleForm>) -> Res | ||
| 94 | 85 | serde_json::Value::Null, |
| 95 | 86 | ) |
| 96 | 87 | .await; |
| 97 | - let back = repo_href(&ctx.repo.owner_name, &ctx.repo.name, "settings", ""); | |
| 98 | - Ok(see_other(format!("{back}?section=discussions"))) | |
| 88 | + Ok(see_other(repo_href(&ctx.repo.owner_name, &ctx.repo.name, "settings", ""))) | |
| 99 | 89 | } |
crates/forge-web/src/pages/discussion_view.rsmodified+1 -11
| @@ -32,15 +32,6 @@ path_param!(owner); | ||
| 32 | 32 | path_param!(repo); |
| 33 | 33 | path_param!(number); |
| 34 | 34 | |
| 35 | -/// What deleting the discussion costs. | |
| 36 | -fn delete_note(lang: Lang) -> &'static str { | |
| 37 | - crate::pages::passkeys::s( | |
| 38 | - lang, | |
| 39 | - "Its comments are deleted with it.", | |
| 40 | - "Yorumlarıyla birlikte silinir.", | |
| 41 | - ) | |
| 42 | -} | |
| 43 | - | |
| 44 | 35 | /// One comment, with every string the template shows already built. |
| 45 | 36 | pub(crate) struct CommentView { |
| 46 | 37 | lang: Lang, |
| @@ -457,7 +448,7 @@ async fn discussion_page( | ||
| 457 | 448 | <button type="submit" class="primary">(g::t(lang, K::Save))</button> |
| 458 | 449 | </form> |
| 459 | 450 | ) |
| 460 | - confirm_act(lang: lang, label: g::t(lang, K::DeleteDiscussion), action: delete_action.as_str(), csrf: csrf.as_str(), note: Some(delete_note(lang).to_owned())) | |
| 451 | + confirm_act(lang: lang, label: g::t(lang, K::DeleteDiscussion), action: delete_action.as_str(), csrf: csrf.as_str()) | |
| 461 | 452 | </div> |
| 462 | 453 | } |
| 463 | 454 | </article> |
| @@ -471,7 +462,6 @@ async fn discussion_page( | ||
| 471 | 462 | <div class="field"> |
| 472 | 463 | <label for="new-comment">(g::t(lang, K::AddComment))</label> |
| 473 | 464 | <textarea id="new-comment" name="body" rows="6"></textarea> |
| 474 | - <p class="hint">(g::t(lang, K::MarkdownSupported))</p> | |
| 475 | 465 | </div> |
| 476 | 466 | <button type="submit" class="primary">(g::t(lang, K::CommentButton))</button> |
| 477 | 467 | </form> |
crates/forge-web/src/pages/discussions.rsmodified+0 -1
| @@ -404,7 +404,6 @@ async fn new_discussion_body( | ||
| 404 | 404 | <div class="field"> |
| 405 | 405 | <label for="discussion-body">(g::t(lang, K::Description))</label> |
| 406 | 406 | <textarea id="discussion-body" name="body" rows="12">(draft.body.as_str())</textarea> |
| 407 | - <p class="hint">(g::t(lang, K::MarkdownSupported))</p> | |
| 408 | 407 | </div> |
| 409 | 408 | <div class="acts"> |
| 410 | 409 | <button type="submit" class="primary">(g::t(lang, K::StartDiscussion))</button> |
crates/forge-web/src/pages/edit_history.rsmodified+1 -3
| @@ -281,9 +281,7 @@ async fn history_entry(lang: Lang, entry: HistoryEntry) -> Result<impl View> { | ||
| 281 | 281 | if let Some(text) = title_text { |
| 282 | 282 | <p class="mono">(text.as_str())</p> |
| 283 | 283 | } |
| 284 | - if body_unchanged { | |
| 285 | - <p class="hint">(g::t(lang, K::NoTextChange))</p> | |
| 286 | - } else { | |
| 284 | + if !body_unchanged { | |
| 287 | 285 | <div class="diff-file"> |
| 288 | 286 | <div class="diff-file-body"> |
| 289 | 287 | <table class="diff-table"> |
crates/forge-web/src/pages/explore.rsmodified+2 -6
| @@ -17,7 +17,7 @@ use crate::i18n::orgs::{self as g, K}; | ||
| 17 | 17 | use crate::i18n::{self, Lang}; |
| 18 | 18 | use crate::live::{Topic, stream_changes}; |
| 19 | 19 | use crate::state::AppState; |
| 20 | -use crate::views::parts::{SubPart, head}; | |
| 20 | +use crate::views::parts::head; | |
| 21 | 21 | use crate::views::repo_list::{ |
| 22 | 22 | PageLink, RepoRow, SortLink, pager, pager_links, repo_rows, sort_chips, |
| 23 | 23 | }; |
| @@ -301,7 +301,7 @@ async fn explore_body( | ||
| 301 | 301 | g::t(lang, K::NoPublicReposMatch) |
| 302 | 302 | }; |
| 303 | 303 | Ok(view! { |
| 304 | - head(title: g::t(lang, K::Explore), sub: vec![SubPart::text(g::t(lang, K::PublicReposIntro))]) | |
| 304 | + head(title: g::t(lang, K::Explore)) | |
| 305 | 305 | <nav class="tabs" aria-label=(g::t(lang, K::Explore))> |
| 306 | 306 | for (label, href, count, on) in tabs.into_iter() { |
| 307 | 307 | <a href=(href) aria-current=(on.then_some("page"))>(label) " " <span class="tab-count">(count.to_string())</span></a> |
| @@ -374,11 +374,7 @@ mod tests { | ||
| 374 | 374 | |
| 375 | 375 | let body = get_with_language(&router, "/explore", "tr").await; |
| 376 | 376 | assert!(body.contains("Keşfet"), "heading in Turkish: {body}"); |
| 377 | - assert!(body.contains("Bu forge üzerindeki herkese açık depolar.")); | |
| 378 | 377 | assert!(body.contains("Herkese açık depolarda ara")); |
| 379 | 378 | assert!(!body.contains("Public repositories on this forge.")); |
| 380 | - | |
| 381 | - let body = get_with_language(&router, "/explore", "en").await; | |
| 382 | - assert!(body.contains("Public repositories on this forge.")); | |
| 383 | 379 | } |
| 384 | 380 | } |
crates/forge-web/src/pages/forgot.rsmodified+3 -8
| @@ -22,7 +22,7 @@ use crate::mail::account; | ||
| 22 | 22 | use crate::pages::register::check_new_password; |
| 23 | 23 | use crate::state::AppState; |
| 24 | 24 | use crate::throttle; |
| 25 | -use crate::views::parts::{SubPart, head}; | |
| 25 | +use crate::views::parts::head; | |
| 26 | 26 | use crate::views::{alert, shell}; |
| 27 | 27 | |
| 28 | 28 | /// Reset requests allowed per client IP inside the throttle window. |
| @@ -59,7 +59,7 @@ enum ResetMode { | ||
| 59 | 59 | #[component] |
| 60 | 60 | async fn forgot_form(lang: Lang, precsrf: &str) -> Result<impl View> { |
| 61 | 61 | Ok(view! { |
| 62 | - head(title: t(lang, Key::ForgotTitle), sub: vec![SubPart::text(t(lang, Key::ForgotSub))]) | |
| 62 | + head(title: t(lang, Key::ForgotTitle)) | |
| 63 | 63 | <div class="sheet fit"> |
| 64 | 64 | <form data-hard="true" method="post" action="/forgot" class="fields"> |
| 65 | 65 | <input type="hidden" name="precsrf" value=(precsrf)> |
| @@ -149,13 +149,8 @@ async fn reset_body( | ||
| 149 | 149 | mode: ResetMode, |
| 150 | 150 | error: Option<String>, |
| 151 | 151 | ) -> Result<impl View> { |
| 152 | - let sub = if mode == ResetMode::Form { | |
| 153 | - vec![SubPart::text(t(lang, Key::ResetSub))] | |
| 154 | - } else { | |
| 155 | - Vec::new() | |
| 156 | - }; | |
| 157 | 152 | Ok(view! { |
| 158 | - head(title: t(lang, Key::ResetTitle), sub: sub) | |
| 153 | + head(title: t(lang, Key::ResetTitle)) | |
| 159 | 154 | <div class="sheet fit"> |
| 160 | 155 | if mode == ResetMode::Form { |
| 161 | 156 | <form data-hard="true" method="post" action=(format!("/reset/{token}")) class="fields"> |
crates/forge-web/src/pages/home.rsmodified+237 -12
| @@ -1,40 +1,265 @@ | ||
| 1 | -//! Page: home. The landing page for visitors. A signed-in viewer is sent to their own profile. | |
| 1 | +//! Page: home (`/`). Visitors get the landing. A signed-in viewer gets Home: the head's actions, what | |
| 2 | +//! needs them (review requests, mentions, failed runs) and their own repositories, at most five rows | |
| 3 | +//! each with a link to the full list. | |
| 2 | 4 | |
| 5 | +use forge_core::User; | |
| 6 | +use forge_core::authz::{Action, authorize}; | |
| 7 | +use forge_core::store::RepoSort; | |
| 8 | +use forge_core::store::repo_listing::RepoScope; | |
| 3 | 9 | use topcoat::Result; |
| 4 | 10 | use topcoat::context::{Cx, app_context}; |
| 5 | -use topcoat::router::error::see_other; | |
| 6 | 11 | use topcoat::router::page; |
| 7 | 12 | use topcoat::view::{View, component, view}; |
| 8 | 13 | |
| 9 | 14 | use crate::auth::current_user; |
| 15 | +use crate::i18n::authoring::{self as ga}; | |
| 16 | +use crate::i18n::migrate::{self as mg, K as MGK}; | |
| 17 | +use crate::i18n::needs::{self as ni, K as NK}; | |
| 10 | 18 | use crate::i18n::orgs::{self as g, K}; |
| 11 | 19 | use crate::i18n::{self, Lang}; |
| 20 | +use crate::pages::ci_runs::run_href; | |
| 21 | +use crate::pages::org_new::may_create_org; | |
| 22 | +use crate::pages::passkeys::s; | |
| 12 | 23 | use crate::pages::repo_settings::{notice_banner_for, take_notice}; |
| 13 | 24 | use crate::state::AppState; |
| 14 | -use crate::views::parts::{SubPart, head}; | |
| 15 | -use crate::views::{enc, shell}; | |
| 25 | +use crate::views::parts::head; | |
| 26 | +use crate::views::repo_list::private_fact; | |
| 27 | +use crate::views::{repo_href, rel_time, shell, user_href}; | |
| 28 | + | |
| 29 | +/// Rows a topic lists on the home page, before its link to the full list. | |
| 30 | +const TOPIC_ROWS: usize = 5; | |
| 31 | + | |
| 32 | +/// The words around a row's time when the row's facts are not a repo's: " · " before, nothing after. | |
| 33 | +const FACT_JOIN: (&str, &str) = (" \u{b7} ", ""); | |
| 34 | + | |
| 35 | +/// One row of a home topic: its link, its name, its facts, and when it last changed. | |
| 36 | +struct HomeRow { | |
| 37 | + href: String, | |
| 38 | + name: String, | |
| 39 | + /// The facts before the time, as text. | |
| 40 | + detail: String, | |
| 41 | + /// The words that join the facts to the relative time, and that close it. | |
| 42 | + before: &'static str, | |
| 43 | + after: &'static str, | |
| 44 | + stamp: String, | |
| 45 | +} | |
| 46 | + | |
| 47 | +/// What the signed-in home shows. | |
| 48 | +struct SignedHome { | |
| 49 | + needs: Vec<HomeRow>, | |
| 50 | + repos: Vec<HomeRow>, | |
| 51 | + /// The viewer's repositories, as the profile's Repositories tab lists them. | |
| 52 | + repos_href: String, | |
| 53 | +} | |
| 16 | 54 | |
| 17 | 55 | #[page("/")] |
| 18 | 56 | async fn home(cx: &Cx) -> Result<impl View> { |
| 19 | 57 | let state = app_context::<AppState>(cx); |
| 20 | - if let Some((user, _)) = current_user(cx).await? { | |
| 21 | - return Err(see_other(format!("/{}", enc(&user.username))).into()); | |
| 22 | - } | |
| 23 | - let lang = i18n::lang(cx, None); | |
| 24 | - let has_users = state.store.user_count().await? > 0; | |
| 58 | + let viewer = current_user(cx).await?; | |
| 59 | + let lang = i18n::lang(cx, viewer.as_ref().map(|(user, _)| user)); | |
| 25 | 60 | let notice = take_notice(cx); |
| 61 | + let signed = match &viewer { | |
| 62 | + Some((user, _)) => Some(load_home(state, user, lang).await?), | |
| 63 | + None => None, | |
| 64 | + }; | |
| 65 | + let has_users = state.store.user_count().await? > 0; | |
| 66 | + let may_org = viewer | |
| 67 | + .as_ref() | |
| 68 | + .is_some_and(|(user, _)| may_create_org(state, user)); | |
| 26 | 69 | Ok(view! { |
| 27 | - shell(title: g::t(lang, K::Home), viewer: None, | |
| 70 | + shell(title: g::t(lang, K::Home), viewer: viewer.as_ref(), | |
| 28 | 71 | notice_banner_for(lang: lang, title: notice) |
| 29 | - landing(has_users: has_users, lang: lang) | |
| 72 | + if let Some(signed) = signed { | |
| 73 | + signed_home(lang: lang, data: signed, may_org: may_org) | |
| 74 | + } else { | |
| 75 | + landing(has_users: has_users, lang: lang) | |
| 76 | + } | |
| 77 | + ) | |
| 78 | + }) | |
| 79 | +} | |
| 80 | + | |
| 81 | +/// The signed-in viewer's home: what needs them, and their repositories. Review requests come first, | |
| 82 | +/// then mentions, then failed runs, five rows in all. A repo the viewer can no longer read is left out. | |
| 83 | +async fn load_home(state: &AppState, user: &User, lang: Lang) -> Result<SignedHome> { | |
| 84 | + let mut needs: Vec<HomeRow> = Vec::new(); | |
| 85 | + for item in state.store.review_requests_for_user(&user.id).await? { | |
| 86 | + if needs.len() >= TOPIC_ROWS { | |
| 87 | + break; | |
| 88 | + } | |
| 89 | + let Some(repo) = state | |
| 90 | + .store | |
| 91 | + .repo_by_owner_and_name(&item.repo_owner, &item.repo_name) | |
| 92 | + .await? | |
| 93 | + else { | |
| 94 | + continue; | |
| 95 | + }; | |
| 96 | + let role = state.store.collaborator_role(&repo.id, &user.id).await?; | |
| 97 | + let org_role = state | |
| 98 | + .store | |
| 99 | + .org_repo_role(&repo.owner_id, &user.id, &repo.id) | |
| 100 | + .await?; | |
| 101 | + if authorize(Some(user), &repo, role, org_role, Action::Read).is_err() { | |
| 102 | + continue; | |
| 103 | + } | |
| 104 | + needs.push(HomeRow { | |
| 105 | + href: repo_href( | |
| 106 | + &item.repo_owner, | |
| 107 | + &item.repo_name, | |
| 108 | + "pulls", | |
| 109 | + &item.number.to_string(), | |
| 110 | + ), | |
| 111 | + name: item.title.clone(), | |
| 112 | + detail: format!( | |
| 113 | + "{}/{} #{} \u{b7} {}", | |
| 114 | + item.repo_owner, | |
| 115 | + item.repo_name, | |
| 116 | + item.number, | |
| 117 | + ga::requested_by(lang, &item.requested_by) | |
| 118 | + ), | |
| 119 | + before: FACT_JOIN.0, | |
| 120 | + after: FACT_JOIN.1, | |
| 121 | + stamp: item.created_at.clone(), | |
| 122 | + }); | |
| 123 | + } | |
| 124 | + | |
| 125 | + for item in state | |
| 126 | + .store | |
| 127 | + .mentions_waiting(&user.id, TOPIC_ROWS as i64, 0) | |
| 128 | + .await? | |
| 129 | + { | |
| 130 | + if needs.len() >= TOPIC_ROWS { | |
| 131 | + break; | |
| 132 | + } | |
| 133 | + let section = if item.is_pull { "pulls" } else { "issues" }; | |
| 134 | + needs.push(HomeRow { | |
| 135 | + href: repo_href(&item.owner, &item.repo, section, &item.number.to_string()), | |
| 136 | + name: item.title.clone(), | |
| 137 | + detail: format!("{}/{} #{}", item.owner, item.repo, item.number), | |
| 138 | + before: FACT_JOIN.0, | |
| 139 | + after: FACT_JOIN.1, | |
| 140 | + stamp: item.updated_at.clone(), | |
| 141 | + }); | |
| 142 | + } | |
| 143 | + | |
| 144 | + for run in state | |
| 145 | + .store | |
| 146 | + .failing_runs(&user.id, TOPIC_ROWS as i64, 0) | |
| 147 | + .await? | |
| 148 | + { | |
| 149 | + if needs.len() >= TOPIC_ROWS { | |
| 150 | + break; | |
| 151 | + } | |
| 152 | + let title = format!("{}/{}", run.owner, run.repo); | |
| 153 | + needs.push(HomeRow { | |
| 154 | + href: run_href(&title, run.number), | |
| 155 | + name: format!("{title} #{}", run.number), | |
| 156 | + detail: run.git_ref.clone(), | |
| 157 | + before: FACT_JOIN.0, | |
| 158 | + after: FACT_JOIN.1, | |
| 159 | + stamp: run.created_at.clone(), | |
| 160 | + }); | |
| 161 | + } | |
| 162 | + | |
| 163 | + // The viewer's own repositories, newest activity first, as the profile's Repositories tab lists them. | |
| 164 | + let (listed, _) = state | |
| 165 | + .store | |
| 166 | + .list_visible_repos( | |
| 167 | + RepoScope::OwnedBy(&user.id), | |
| 168 | + Some(user), | |
| 169 | + None, | |
| 170 | + RepoSort::RecentlyUpdated, | |
| 171 | + 1, | |
| 172 | + TOPIC_ROWS as u64, | |
| 173 | + ) | |
| 174 | + .await?; | |
| 175 | + let (before, after) = g::updated_parts(lang); | |
| 176 | + let repos = listed | |
| 177 | + .into_iter() | |
| 178 | + .map(|(repo, stars, updated)| { | |
| 179 | + let private = private_fact(lang, repo.visibility).unwrap_or_default(); | |
| 180 | + HomeRow { | |
| 181 | + href: repo_href(&repo.owner_name, &repo.name, "", ""), | |
| 182 | + name: format!("{}/{}", repo.owner_name, repo.name), | |
| 183 | + detail: format!("{private}\u{2605} {stars}"), | |
| 184 | + before, | |
| 185 | + after, | |
| 186 | + stamp: updated, | |
| 187 | + } | |
| 188 | + }) | |
| 189 | + .collect(); | |
| 190 | + | |
| 191 | + Ok(SignedHome { | |
| 192 | + needs, | |
| 193 | + repos, | |
| 194 | + repos_href: format!("{}?tab=repositories", user_href(&user.username)), | |
| 195 | + }) | |
| 196 | +} | |
| 197 | + | |
| 198 | +/// The signed-in home: the head's actions, then the two topics on one sheet. | |
| 199 | +#[component] | |
| 200 | +async fn signed_home(lang: Lang, data: SignedHome, may_org: bool) -> Result<impl View> { | |
| 201 | + let SignedHome { | |
| 202 | + needs, | |
| 203 | + repos, | |
| 204 | + repos_href, | |
| 205 | + } = data; | |
| 206 | + let needs_heading = ni::t(lang, NK::NeedsYou); | |
| 207 | + let repos_heading = s(lang, "Your repositories", "Depolarınız"); | |
| 208 | + let all = s(lang, "View all", "Tümünü gör"); | |
| 209 | + let no_repos = s(lang, "You have no repositories yet.", "Henüz deponuz yok."); | |
| 210 | + let import_label = mg::t(lang, MGK::TabImport); | |
| 211 | + Ok(view! { | |
| 212 | + head(title: g::t(lang, K::Home), | |
| 213 | + <a class="button primary" href="/new">(g::t(lang, K::NewRepository))</a> | |
| 214 | + <a class="button" href="/new/import">(import_label)</a> | |
| 215 | + if may_org { | |
| 216 | + <a class="button" href="/org/new">(g::t(lang, K::NewOrganization))</a> | |
| 217 | + } | |
| 30 | 218 | ) |
| 219 | + <div class="sheet"> | |
| 220 | + <section class="sec"> | |
| 221 | + <h2>(needs_heading)</h2> | |
| 222 | + if needs.is_empty() { | |
| 223 | + <p class="state">(ni::t(lang, NK::AllClear))</p> | |
| 224 | + } | |
| 225 | + for row in needs.iter() { | |
| 226 | + <a class="line" href=(row.href.as_str()) data-kb-row=""> | |
| 227 | + <span class="name">(row.name.as_str())</span> | |
| 228 | + <span class="val">(row.detail.as_str())(row.before)rel_time(lang: lang, stamp: row.stamp.as_str())(row.after)</span> | |
| 229 | + </a> | |
| 230 | + } | |
| 231 | + if !needs.is_empty() { | |
| 232 | + <div class="acts"> | |
| 233 | + <a class="act" href="/needs-you">(all)</a> | |
| 234 | + </div> | |
| 235 | + } | |
| 236 | + </section> | |
| 237 | + <section class="sec"> | |
| 238 | + <h2>(repos_heading)</h2> | |
| 239 | + if repos.is_empty() { | |
| 240 | + <p class="state">(no_repos)</p> | |
| 241 | + } | |
| 242 | + for row in repos.iter() { | |
| 243 | + <a class="line" href=(row.href.as_str()) data-kb-row=""> | |
| 244 | + <span class="name">(row.name.as_str())</span> | |
| 245 | + <span class="val">(row.detail.as_str())(row.before)rel_time(lang: lang, stamp: row.stamp.as_str())(row.after)</span> | |
| 246 | + </a> | |
| 247 | + } | |
| 248 | + if !repos.is_empty() { | |
| 249 | + <div class="acts"> | |
| 250 | + <a class="act" href=(repos_href.as_str())>(all)</a> | |
| 251 | + </div> | |
| 252 | + } | |
| 253 | + </section> | |
| 254 | + </div> | |
| 31 | 255 | }) |
| 32 | 256 | } |
| 33 | 257 | |
| 258 | +/// The visitor's landing: the wordmark's tagline and the way in. | |
| 34 | 259 | #[component] |
| 35 | 260 | async fn landing(has_users: bool, lang: Lang) -> Result<impl View> { |
| 36 | 261 | Ok(view! { |
| 37 | - head(title: "forge", sub: vec![SubPart::text(g::t(lang, K::LandingTagline))], | |
| 262 | + head(title: "forge", | |
| 38 | 263 | <a class="button primary" href="/login">(g::t(lang, K::LogIn))</a> |
| 39 | 264 | if !has_users { |
| 40 | 265 | <a class="button" href="/setup">(g::t(lang, K::SetUpForge))</a> |
crates/forge-web/src/pages/import.rsmodified+2 -11
| @@ -207,7 +207,6 @@ pub(crate) async fn visibility_pick(lang: Lang, private: bool) -> Result<impl Vi | ||
| 207 | 207 | <label><input type="radio" name="visibility" value="private" checked=(private)><span>(crate::i18n::community::t(lang, crate::i18n::community::K::VisibilityPrivate))</span></label> |
| 208 | 208 | <label><input type="radio" name="visibility" value="public" checked=(!private)><span>(crate::i18n::community::t(lang, crate::i18n::community::K::VisibilityPublic))</span></label> |
| 209 | 209 | </div> |
| 210 | - <p class="hint">(crate::i18n::misc::t(lang, crate::i18n::misc::K::PrivateHelp)) ". " (crate::i18n::misc::t(lang, crate::i18n::misc::K::PublicHelp)) "."</p> | |
| 211 | 210 | </div> |
| 212 | 211 | }) |
| 213 | 212 | } |
| @@ -223,7 +222,6 @@ async fn option_boxes(lang: Lang, opts: ImportOptions) -> Result<impl View> { | ||
| 223 | 222 | <label class="switch"><input type="checkbox" name="opt_pulls" value="on" checked=(opts.pulls)><span>(g::t(lang, K::OptPulls))</span></label> |
| 224 | 223 | <label class="switch"><input type="checkbox" name="opt_releases" value="on" checked=(opts.releases)><span>(g::t(lang, K::OptReleases))</span></label> |
| 225 | 224 | </div> |
| 226 | - <p class="hint">(g::t(lang, K::OptionsNote))</p> | |
| 227 | 225 | </div> |
| 228 | 226 | }) |
| 229 | 227 | } |
| @@ -325,7 +323,7 @@ async fn import_form( | ||
| 325 | 323 | let private = draft.private; |
| 326 | 324 | let opts = draft.opts; |
| 327 | 325 | Ok(view! { |
| 328 | - head(title: g::t(lang, K::ImportTitle), sub: vec![SubPart::text(g::t(lang, K::ImportIntro))]) | |
| 326 | + head(title: g::t(lang, K::ImportTitle)) | |
| 329 | 327 | crate::pages::profile::own_profile_tabs(lang: lang, username: username, current: "repositories".to_owned()) |
| 330 | 328 | newrepo_tabs(lang: lang, active: "import") |
| 331 | 329 | <div class="sheet fit"> |
| @@ -355,7 +353,6 @@ async fn import_form( | ||
| 355 | 353 | <div class="field"> |
| 356 | 354 | <label for="import-token">(token_label)</label> |
| 357 | 355 | <input id="import-token" type="password" name="token" autocomplete="new-password" maxlength="1024"> |
| 358 | - <p class="hint">(g::t(lang, K::TokenHelp))</p> | |
| 359 | 356 | </div> |
| 360 | 357 | if !is_git { |
| 361 | 358 | option_boxes(lang: lang, opts: opts) |
| @@ -371,7 +368,6 @@ async fn import_form( | ||
| 371 | 368 | <div class="field"> |
| 372 | 369 | <label for="import-name">(g::t(lang, K::TargetName))</label> |
| 373 | 370 | <input id="import-name" type="text" name="name" value=(draft.name.as_str()) maxlength="64" autocomplete="off"> |
| 374 | - <p class="hint">(g::t(lang, K::TargetNameHelp))</p> | |
| 375 | 371 | </div> |
| 376 | 372 | <div class="field"> |
| 377 | 373 | <label for="import-description">(g::t(lang, K::Description))</label> |
| @@ -383,7 +379,6 @@ async fn import_form( | ||
| 383 | 379 | if !is_git { |
| 384 | 380 | <section class="sec"> |
| 385 | 381 | <h2>(g::t(lang, K::BulkLink))</h2> |
| 386 | - <p class="hint">(g::t(lang, K::BulkIntro))</p> | |
| 387 | 382 | <div class="acts"> |
| 388 | 383 | <a class="act" href=(bulk_href.as_str())>(g::t(lang, K::BulkLinkButton))</a> |
| 389 | 384 | </div> |
| @@ -613,7 +608,7 @@ async fn bulk_form( | ||
| 613 | 608 | // A Forgejo token can list its own repositories, so the owner may stay empty. |
| 614 | 609 | let owner_required = source != Source::Forgejo; |
| 615 | 610 | Ok(view! { |
| 616 | - head(title: g::t(lang, K::BulkTitle), sub: vec![SubPart::text(g::t(lang, K::BulkIntro))]) | |
| 611 | + head(title: g::t(lang, K::BulkTitle)) | |
| 617 | 612 | crate::pages::profile::own_profile_tabs(lang: lang, username: username, current: "repositories".to_owned()) |
| 618 | 613 | newrepo_tabs(lang: lang, active: "import") |
| 619 | 614 | <div class="sheet fit"> |
| @@ -638,7 +633,6 @@ async fn bulk_form( | ||
| 638 | 633 | <div class="field"> |
| 639 | 634 | <label for="bulk-token">(g::t(lang, K::TokenOptional))</label> |
| 640 | 635 | <input id="bulk-token" type="password" name="token" autocomplete="new-password" maxlength="1024"> |
| 641 | - <p class="hint">(g::t(lang, K::TokenHelp))</p> | |
| 642 | 636 | </div> |
| 643 | 637 | <input type="hidden" name="owner" value=(owners.first().map(String::as_str).unwrap_or(""))> |
| 644 | 638 | <button type="submit" class="primary">(g::t(lang, K::BulkListButton))</button> |
| @@ -696,7 +690,6 @@ async fn bulk_select( | ||
| 696 | 690 | <option value=(name.as_str()) selected=(*name == selected_owner)>(name.as_str())</option> |
| 697 | 691 | } |
| 698 | 692 | </select> |
| 699 | - <p class="hint">(g::t(lang, K::BulkOwnerHelp))</p> | |
| 700 | 693 | </div> |
| 701 | 694 | visibility_pick(lang: lang, private: private) |
| 702 | 695 | if form.source != "git" { |
| @@ -1240,7 +1233,6 @@ async fn job_view( | ||
| 1240 | 1233 | <div class="field"> |
| 1241 | 1234 | <label for="retry-token">(g::t(lang, K::TokenOptional))</label> |
| 1242 | 1235 | <input id="retry-token" type="password" name="token" autocomplete="new-password" maxlength="1024"> |
| 1243 | - <p class="hint">(g::t(lang, K::JobRetryHelp))</p> | |
| 1244 | 1236 | </div> |
| 1245 | 1237 | <button type="submit" class="primary">(g::t(lang, K::JobRetry))</button> |
| 1246 | 1238 | </form> |
| @@ -1438,7 +1430,6 @@ async fn retry_list(lang: Lang, username: String, csrf: &str, rows: Vec<(ImportJ | ||
| 1438 | 1430 | <div class="field"> |
| 1439 | 1431 | <label for="retry-token">(g::t(lang, K::TokenOptional))</label> |
| 1440 | 1432 | <input id="retry-token" type="password" name="token" autocomplete="new-password" maxlength="1024"> |
| 1441 | - <p class="hint">(g::t(lang, K::RetryTokenHelp))</p> | |
| 1442 | 1433 | </div> |
| 1443 | 1434 | <label class="line" data-kb-row=""> |
| 1444 | 1435 | <input type="checkbox" data-select-all=".import-pick-list"> |
crates/forge-web/src/pages/invites.rsmodified+22 -18
| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | //! Page: admin invites (`/admin/invites`). An admin mails an invite link to one address. The link |
| 2 | -//! creates that address's account once, and it expires after seven days. | |
| 2 | +//! creates that address's account once, and it expires after seven days. It is a rail item of the | |
| 3 | +//! Users tab, so the rail beside the form is the Users tab's. | |
| 3 | 4 | |
| 4 | 5 | use forge_core::store::validate_email; |
| 5 | 6 | use forge_core::{AuditAction, Registration}; |
| @@ -15,9 +16,9 @@ use crate::audit::{self, Actor, Target}; | ||
| 15 | 16 | use crate::auth::check_csrf; |
| 16 | 17 | use crate::i18n::{self, Key, Lang, t}; |
| 17 | 18 | use crate::mail::account; |
| 18 | -use crate::pages::admin_users::admin_only; | |
| 19 | +use crate::pages::admin_users::{admin_only, users_rail}; | |
| 19 | 20 | use crate::state::AppState; |
| 20 | -use crate::views::parts::{SubPart, head}; | |
| 21 | +use crate::views::parts::head; | |
| 21 | 22 | use crate::views::{alert, shell, user_facing_message}; |
| 22 | 23 | |
| 23 | 24 | #[derive(Deserialize)] |
| @@ -36,21 +37,24 @@ async fn invite_body( | ||
| 36 | 37 | error: Option<String>, |
| 37 | 38 | ) -> Result<impl View> { |
| 38 | 39 | Ok(view! { |
| 39 | - head(title: t(lang, Key::InvitesTitle), sub: vec![SubPart::text(t(lang, Key::InvitesSub))]) | |
| 40 | - <div class="sheet"> | |
| 41 | - <section class="sec"> | |
| 42 | - if let Some(message) = error { | |
| 43 | - alert(message: message.as_str()) | |
| 44 | - } | |
| 45 | - <form method="post" action="/admin/invites" class="fields"> | |
| 46 | - <input type="hidden" name="csrf" value=(csrf)> | |
| 47 | - <div class="field"> | |
| 48 | - <label for="invite-email">(t(lang, Key::Email))</label> | |
| 49 | - <input id="invite-email" type="email" name="email" autocomplete="off" maxlength="254" required=(true)> | |
| 50 | - </div> | |
| 51 | - <button type="submit" class="primary">(t(lang, Key::InvitesSubmit))</button> | |
| 52 | - </form> | |
| 53 | - </section> | |
| 40 | + head(title: t(lang, Key::InvitesTitle)) | |
| 41 | + <div class="work"> | |
| 42 | + users_rail(lang: lang, current: "invites") | |
| 43 | + <div class="sheet"> | |
| 44 | + <section class="sec"> | |
| 45 | + if let Some(message) = error { | |
| 46 | + alert(message: message.as_str()) | |
| 47 | + } | |
| 48 | + <form method="post" action="/admin/invites" class="fields"> | |
| 49 | + <input type="hidden" name="csrf" value=(csrf)> | |
| 50 | + <div class="field"> | |
| 51 | + <label for="invite-email">(t(lang, Key::Email))</label> | |
| 52 | + <input id="invite-email" type="email" name="email" autocomplete="off" maxlength="254" required=(true)> | |
| 53 | + </div> | |
| 54 | + <button type="submit" class="primary">(t(lang, Key::InvitesSubmit))</button> | |
| 55 | + </form> | |
| 56 | + </section> | |
| 57 | + </div> | |
| 54 | 58 | </div> |
| 55 | 59 | if let Some(message) = notice { |
| 56 | 60 | <p class="state" role="status">(message)</p> |
crates/forge-web/src/pages/issue_parts.rsmodified+315 -125
| @@ -19,7 +19,7 @@ use crate::i18n::Lang; | ||
| 19 | 19 | use crate::i18n::issues::{self as g, K}; |
| 20 | 20 | use crate::notify::{self, Activity}; |
| 21 | 21 | use crate::pages::edit_history::{edit_counts, history_href, thread_edit_counts}; |
| 22 | -use crate::pages::notifications::{NotifyBox, notify_box}; | |
| 22 | +use crate::pages::notifications::{NotifyBox, notify_pill}; | |
| 23 | 23 | use crate::pages::pull_reviews::suggest_states; |
| 24 | 24 | use crate::pages::repo_ctx::RepoCtx; |
| 25 | 25 | use crate::pages::tree::link_context; |
| @@ -31,7 +31,7 @@ use crate::views::{ | ||
| 31 | 31 | alert, avatar_url, avatar_url_unknown, display_name, iso_time, now_unix, relative_time, repo_href, short_oid, |
| 32 | 32 | user_href, user_link, |
| 33 | 33 | }; |
| 34 | -use crate::views::parts::{confirm_act, reveal}; | |
| 34 | +use crate::views::parts::{confirm_act, post_act, reveal}; | |
| 35 | 35 | use crate::webhooks::emit::{Sender, emit_comment, emit_item_action}; |
| 36 | 36 | |
| 37 | 37 | /// Which kind of item a page shows. It decides the URL segment of the item's own links and which |
| @@ -291,13 +291,21 @@ pub(crate) struct ReactionBar { | ||
| 291 | 291 | /// One timeline event as a line: the actor, `before`, an optional commit link, then `after`. |
| 292 | 292 | pub(crate) struct EventLine { |
| 293 | 293 | actor: String, |
| 294 | + actor_id: String, | |
| 294 | 295 | when: When, |
| 296 | + /// Unix seconds, and the event kind and label name, for folding runs. | |
| 297 | + at: i64, | |
| 298 | + kind: String, | |
| 299 | + label: String, | |
| 295 | 300 | before: String, |
| 296 | 301 | link_href: Option<String>, |
| 297 | 302 | link_label: String, |
| 298 | 303 | after: String, |
| 299 | 304 | } |
| 300 | 305 | |
| 306 | +/// Events by the same actor this close together fold into one line. | |
| 307 | +const RUN_GAP_SECS: i64 = 300; | |
| 308 | + | |
| 301 | 309 | /// A submitted review of a pull request: its verb, its body (when it has one) and the threads it |
| 302 | 310 | /// opened, which render under it with their diff hunks. |
| 303 | 311 | pub(crate) struct ReviewView { |
| @@ -317,6 +325,8 @@ pub(crate) struct ReviewView { | ||
| 317 | 325 | pub(crate) enum Entry { |
| 318 | 326 | Comment(CommentView), |
| 319 | 327 | Event(EventLine), |
| 328 | + /// Consecutive events by one actor within a few minutes, one line. | |
| 329 | + Run(Vec<EventLine>), | |
| 320 | 330 | Review(ReviewView), |
| 321 | 331 | } |
| 322 | 332 | |
| @@ -410,7 +420,11 @@ fn event_line( | ||
| 410 | 420 | }; |
| 411 | 421 | EventLine { |
| 412 | 422 | actor, |
| 423 | + actor_id: event.actor_id.clone().unwrap_or_default(), | |
| 413 | 424 | when, |
| 425 | + at: stamp_unix(&event.created_at), | |
| 426 | + kind: event.kind.clone(), | |
| 427 | + label: text("label"), | |
| 414 | 428 | before, |
| 415 | 429 | link_href, |
| 416 | 430 | link_label, |
| @@ -435,7 +449,13 @@ pub(crate) async fn comment_item(lang: Lang, item: CommentView) -> Result<impl V | ||
| 435 | 449 | reactions, |
| 436 | 450 | } = item; |
| 437 | 451 | let profile = user_href(&login); |
| 438 | - let has_acts = edit_href.is_some() || delete_href.is_some(); | |
| 452 | + let (chips, picker) = match reactions { | |
| 453 | + Some(bar) if bar.enabled => (bar.chips, bar.picker), | |
| 454 | + Some(bar) => (bar.chips, Vec::new()), | |
| 455 | + None => (Vec::new(), Vec::new()), | |
| 456 | + }; | |
| 457 | + let has_react = !picker.is_empty(); | |
| 458 | + let has_tools = has_react || edit_href.is_some() || delete_href.is_some(); | |
| 439 | 459 | Ok(view! { |
| 440 | 460 | <article class="sec thread-entry" id=(anchor.as_str())> |
| 441 | 461 | <header class="thread-head"> |
| @@ -451,19 +471,28 @@ pub(crate) async fn comment_item(lang: Lang, item: CommentView) -> Result<impl V | ||
| 451 | 471 | } else { |
| 452 | 472 | <div class="issue-item-body markdown-body">(Unescaped::new_unchecked(html))</div> |
| 453 | 473 | } |
| 454 | - if let Some(bar) = reactions { | |
| 455 | - reaction_row(lang: lang, bar: bar) | |
| 456 | - } | |
| 457 | - if has_acts { | |
| 458 | - <div class="acts"> | |
| 459 | - if let Some(href) = edit_href { | |
| 460 | - <a class="act" href=(href.as_str())>(g::t(lang, K::Edit))</a> | |
| 461 | - } | |
| 462 | - if let Some(action) = delete_href { | |
| 463 | - confirm_act(lang: lang, label: g::t(lang, K::Delete), action: action.as_str(), csrf: csrf.as_str()) | |
| 474 | + if !chips.is_empty() { | |
| 475 | + <div class="reactions"> | |
| 476 | + for chip in chips.into_iter() { | |
| 477 | + reaction_button(button: chip) | |
| 464 | 478 | } |
| 465 | 479 | </div> |
| 466 | 480 | } |
| 481 | + if has_tools { | |
| 482 | + <div> | |
| 483 | + <div class="acts"> | |
| 484 | + if has_react { | |
| 485 | + reaction_picker(lang: lang, picker: picker) | |
| 486 | + } | |
| 487 | + if let Some(href) = edit_href { | |
| 488 | + <a class="act" href=(href.as_str())>(g::t(lang, K::Edit))</a> | |
| 489 | + } | |
| 490 | + if let Some(action) = delete_href { | |
| 491 | + confirm_act(lang: lang, label: g::t(lang, K::Delete), action: action.as_str(), csrf: csrf.as_str()) | |
| 492 | + } | |
| 493 | + </div> | |
| 494 | + </div> | |
| 495 | + } | |
| 467 | 496 | </article> |
| 468 | 497 | }) |
| 469 | 498 | } |
| @@ -482,19 +511,27 @@ pub(crate) async fn reaction_row(lang: Lang, bar: ReactionBar) -> Result<impl Vi | ||
| 482 | 511 | reaction_button(button: chip) |
| 483 | 512 | } |
| 484 | 513 | if enabled { |
| 485 | - <details class="reaction-picker"> | |
| 486 | - <summary>(g::t(lang, K::AddReaction))</summary> | |
| 487 | - <div class="reaction-options"> | |
| 488 | - for option in picker.into_iter() { | |
| 489 | - reaction_button(button: option) | |
| 490 | - } | |
| 491 | - </div> | |
| 492 | - </details> | |
| 514 | + reaction_picker(lang: lang, picker: picker) | |
| 493 | 515 | } |
| 494 | 516 | </div> |
| 495 | 517 | }) |
| 496 | 518 | } |
| 497 | 519 | |
| 520 | +/// The React tool: a word that opens the reaction options in place. | |
| 521 | +#[component] | |
| 522 | +pub(crate) async fn reaction_picker(lang: Lang, picker: Vec<ReactionButton>) -> Result<impl View> { | |
| 523 | + Ok(view! { | |
| 524 | + <details class="reaction-picker"> | |
| 525 | + <summary class="act">(g::t(lang, K::AddReaction))</summary> | |
| 526 | + <div class="reaction-options"> | |
| 527 | + for option in picker.into_iter() { | |
| 528 | + reaction_button(button: option) | |
| 529 | + } | |
| 530 | + </div> | |
| 531 | + </details> | |
| 532 | + }) | |
| 533 | +} | |
| 534 | + | |
| 498 | 535 | /// One reaction button. Enabled buttons are POST forms that toggle the viewer's reaction; the |
| 499 | 536 | /// others only show the emoji and count. |
| 500 | 537 | #[component] |
| @@ -552,6 +589,7 @@ pub(crate) async fn event_item(line: EventLine) -> Result<impl View> { | ||
| 552 | 589 | link_href, |
| 553 | 590 | link_label, |
| 554 | 591 | after, |
| 592 | + .. | |
| 555 | 593 | } = line; |
| 556 | 594 | Ok(view! { |
| 557 | 595 | <div class="thread-event"> |
| @@ -576,6 +614,43 @@ pub(crate) async fn event_item(line: EventLine) -> Result<impl View> { | ||
| 576 | 614 | }) |
| 577 | 615 | } |
| 578 | 616 | |
| 617 | +/// Consecutive events by one actor, one line: the actor, each event's words joined with " · ", then | |
| 618 | +/// the time of the last one. | |
| 619 | +#[component] | |
| 620 | +pub(crate) async fn event_run(lines: Vec<EventLine>) -> Result<impl View> { | |
| 621 | + let actor = lines.first().map(|line| line.actor.clone()).unwrap_or_default(); | |
| 622 | + let when = lines.last().map(|line| line.when.clone()); | |
| 623 | + Ok(view! { | |
| 624 | + <div class="thread-event"> | |
| 625 | + <strong>(actor.as_str())</strong> | |
| 626 | + for (n, line) in lines.into_iter().enumerate() { | |
| 627 | + if n == 0 { | |
| 628 | + " " | |
| 629 | + } else { | |
| 630 | + " · " | |
| 631 | + } | |
| 632 | + (line.before.as_str()) | |
| 633 | + if !line.link_label.is_empty() { | |
| 634 | + " " | |
| 635 | + if let Some(href) = line.link_href { | |
| 636 | + <a class="mono" href=(href.as_str())>(line.link_label.as_str())</a> | |
| 637 | + } else { | |
| 638 | + <span class="mono">(line.link_label.as_str())</span> | |
| 639 | + } | |
| 640 | + } | |
| 641 | + if !line.after.is_empty() { | |
| 642 | + " " | |
| 643 | + (line.after.as_str()) | |
| 644 | + } | |
| 645 | + } | |
| 646 | + if let Some(when) = when { | |
| 647 | + " " | |
| 648 | + <time data-rel="true" datetime=(when.iso.as_str()) title=(when.absolute.as_str())>(when.relative.as_str())</time> | |
| 649 | + } | |
| 650 | + </div> | |
| 651 | + }) | |
| 652 | +} | |
| 653 | + | |
| 579 | 654 | /// The verb of a dismissed review: the verb it had before dismissal, marked as dismissed. Reviews |
| 580 | 655 | /// dismissed before the previous state was recorded keep the generic verb. |
| 581 | 656 | fn dismissed_verb(lang: Lang, from: Option<ReviewState>) -> &'static str { |
| @@ -635,6 +710,7 @@ pub(crate) async fn timeline_entry(lang: Lang, entry: Entry) -> Result<impl View | ||
| 635 | 710 | match entry { |
| 636 | 711 | Entry::Comment(item) => comment_item(lang: lang, item: item), |
| 637 | 712 | Entry::Event(line) => event_item(line: line), |
| 713 | + Entry::Run(lines) => event_run(lines: lines), | |
| 638 | 714 | Entry::Review(review) => review_item(lang: lang, review: review), |
| 639 | 715 | } |
| 640 | 716 | }) |
| @@ -824,7 +900,7 @@ pub(crate) async fn load_discussion( | ||
| 824 | 900 | keyed.extend(review_entries(lang, state, ctx, item, &link, &tz, now).await?); |
| 825 | 901 | } |
| 826 | 902 | keyed.sort_by(|a, b| a.0.cmp(&b.0)); |
| 827 | - let entries: Vec<Entry> = keyed.into_iter().map(|(_, entry)| entry).collect(); | |
| 903 | + let entries = fold_runs(lang, keyed.into_iter().map(|(_, entry)| entry).collect()); | |
| 828 | 904 | |
| 829 | 905 | Ok(Discussion { |
| 830 | 906 | author: display_name(lang, &author), |
| @@ -835,6 +911,74 @@ pub(crate) async fn load_discussion( | ||
| 835 | 911 | }) |
| 836 | 912 | } |
| 837 | 913 | |
| 914 | +/// Folds each run of events by one actor, close in time and with nothing between them, into one | |
| 915 | +/// `Entry::Run`. A single event stays `Entry::Event`. | |
| 916 | +fn fold_runs(lang: Lang, entries: Vec<Entry>) -> Vec<Entry> { | |
| 917 | + let mut out = Vec::new(); | |
| 918 | + let mut run: Vec<EventLine> = Vec::new(); | |
| 919 | + for entry in entries { | |
| 920 | + match entry { | |
| 921 | + Entry::Event(line) => { | |
| 922 | + let joins = run.last().is_some_and(|last| { | |
| 923 | + last.actor_id == line.actor_id && line.at - last.at <= RUN_GAP_SECS | |
| 924 | + }); | |
| 925 | + if !joins { | |
| 926 | + flush_run(lang, &mut run, &mut out); | |
| 927 | + } | |
| 928 | + run.push(line); | |
| 929 | + } | |
| 930 | + other => { | |
| 931 | + flush_run(lang, &mut run, &mut out); | |
| 932 | + out.push(other); | |
| 933 | + } | |
| 934 | + } | |
| 935 | + } | |
| 936 | + flush_run(lang, &mut run, &mut out); | |
| 937 | + out | |
| 938 | +} | |
| 939 | + | |
| 940 | +fn flush_run(lang: Lang, run: &mut Vec<EventLine>, out: &mut Vec<Entry>) { | |
| 941 | + let mut lines = merge_label_adds(lang, std::mem::take(run)); | |
| 942 | + match lines.len() { | |
| 943 | + 0 => {} | |
| 944 | + 1 => out.push(Entry::Event(lines.remove(0))), | |
| 945 | + _ => out.push(Entry::Run(lines)), | |
| 946 | + } | |
| 947 | +} | |
| 948 | + | |
| 949 | +/// Consecutive label additions in a run become one "added labels a, b and c" line, at the time of | |
| 950 | +/// the last of them. | |
| 951 | +fn merge_label_adds(lang: Lang, lines: Vec<EventLine>) -> Vec<EventLine> { | |
| 952 | + let mut out = Vec::new(); | |
| 953 | + let mut group: Vec<EventLine> = Vec::new(); | |
| 954 | + for line in lines { | |
| 955 | + if line.kind == "labeled" { | |
| 956 | + group.push(line); | |
| 957 | + continue; | |
| 958 | + } | |
| 959 | + push_label_group(lang, &mut group, &mut out); | |
| 960 | + out.push(line); | |
| 961 | + } | |
| 962 | + push_label_group(lang, &mut group, &mut out); | |
| 963 | + out | |
| 964 | +} | |
| 965 | + | |
| 966 | +fn push_label_group(lang: Lang, group: &mut Vec<EventLine>, out: &mut Vec<EventLine>) { | |
| 967 | + if group.len() < 2 { | |
| 968 | + out.append(group); | |
| 969 | + return; | |
| 970 | + } | |
| 971 | + let names: Vec<String> = group.iter().map(|line| line.label.clone()).collect(); | |
| 972 | + let when = group.last().map(|line| line.when.clone()); | |
| 973 | + let mut first = group.remove(0); | |
| 974 | + group.clear(); | |
| 975 | + first.before = g::event_labels_added(lang, &names); | |
| 976 | + if let Some(when) = when { | |
| 977 | + first.when = when; | |
| 978 | + } | |
| 979 | + out.push(first); | |
| 980 | +} | |
| 981 | + | |
| 838 | 982 | /// The reaction bar of one target, or `None` when there is nothing to show (no reactions and no |
| 839 | 983 | /// way to react). Every reaction in the set gets a picker button. |
| 840 | 984 | pub(crate) fn reaction_bar_for( |
| @@ -1082,26 +1226,28 @@ pub(crate) async fn labels_box( | ||
| 1082 | 1226 | labels: Vec<LabelRow>, |
| 1083 | 1227 | ) -> Result<impl View> { |
| 1084 | 1228 | let any_attached = labels.iter().any(|row| row.attached); |
| 1229 | + let tool = if any_attached { | |
| 1230 | + g::t(lang, K::Edit) | |
| 1231 | + } else { | |
| 1232 | + g::t(lang, K::Add) | |
| 1233 | + }; | |
| 1085 | 1234 | Ok(view! { |
| 1086 | 1235 | <section class="sec meta"> |
| 1087 | 1236 | <h2>(g::t(lang, K::Labels))</h2> |
| 1088 | - <p class="hint"> | |
| 1089 | - if !any_attached { | |
| 1090 | - (g::t(lang, K::NoneYet)) | |
| 1091 | - } | |
| 1092 | - for row in labels.iter() { | |
| 1093 | - if row.attached { | |
| 1094 | - <span class=(row.chip.as_str())>(row.name.as_str())</span> | |
| 1237 | + <div class="line"> | |
| 1238 | + <span class="val"> | |
| 1239 | + for row in labels.iter() { | |
| 1240 | + if row.attached { | |
| 1241 | + <span class=(row.chip.as_str())>(row.name.as_str())</span> | |
| 1242 | + } | |
| 1095 | 1243 | } |
| 1096 | - } | |
| 1097 | - </p> | |
| 1098 | - if write { | |
| 1099 | - <div class="acts"> | |
| 1100 | - reveal(label: g::t(lang, K::Edit), | |
| 1244 | + </span> | |
| 1245 | + if write { | |
| 1246 | + reveal(label: tool, | |
| 1101 | 1247 | <form method="post" action=(action.as_str()) class="fields" data-apply="true"> |
| 1102 | 1248 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 1103 | 1249 | if labels.is_empty() { |
| 1104 | - <p class="hint">(g::t(lang, K::NoRepoLabels))</p> | |
| 1250 | + <p class="state">(g::t(lang, K::NoRepoLabels))</p> | |
| 1105 | 1251 | } |
| 1106 | 1252 | for row in labels.iter() { |
| 1107 | 1253 | <label class="switch"> |
| @@ -1112,8 +1258,8 @@ pub(crate) async fn labels_box( | ||
| 1112 | 1258 | <noscript><div><button type="submit" class="primary">(g::t(lang, K::SaveLabels))</button></div></noscript> |
| 1113 | 1259 | </form> |
| 1114 | 1260 | ) |
| 1115 | - </div> | |
| 1116 | - } | |
| 1261 | + } | |
| 1262 | + </div> | |
| 1117 | 1263 | </section> |
| 1118 | 1264 | }) |
| 1119 | 1265 | } |
| @@ -1128,38 +1274,38 @@ pub(crate) async fn assignees_box( | ||
| 1128 | 1274 | assign_next: Option<String>, |
| 1129 | 1275 | ) -> Result<impl View> { |
| 1130 | 1276 | let text = names.join(", "); |
| 1277 | + let tool = if names.is_empty() { | |
| 1278 | + g::t(lang, K::Add) | |
| 1279 | + } else { | |
| 1280 | + g::t(lang, K::Edit) | |
| 1281 | + }; | |
| 1131 | 1282 | Ok(view! { |
| 1132 | 1283 | <section class="sec meta"> |
| 1133 | 1284 | <h2>(g::t(lang, K::Assignees))</h2> |
| 1134 | - <p class="hint"> | |
| 1135 | - if names.is_empty() { | |
| 1136 | - (g::t(lang, K::NoOneAssigned)) | |
| 1137 | - } else { | |
| 1138 | - (text.as_str()) | |
| 1285 | + <div class="line"> | |
| 1286 | + if !names.is_empty() { | |
| 1287 | + <span class="val">(text.as_str())</span> | |
| 1139 | 1288 | } |
| 1140 | - </p> | |
| 1141 | - if write { | |
| 1142 | - <div class="acts"> | |
| 1143 | - reveal(label: g::t(lang, K::Edit), | |
| 1144 | - if let Some(next) = assign_next { | |
| 1145 | - <form method="post" action=(action.as_str()) class="act-form"> | |
| 1289 | + if write { | |
| 1290 | + reveal(label: tool, | |
| 1291 | + if let Some(next) = assign_next { | |
| 1292 | + <form method="post" action=(action.as_str()) class="act-form"> | |
| 1293 | + <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 1294 | + <input type="hidden" name="assignees" value=(next.as_str())> | |
| 1295 | + <button type="submit" class="act" data-palette-action="post">(g::t(lang, K::AssignToMe))</button> | |
| 1296 | + </form> | |
| 1297 | + } | |
| 1298 | + <form method="post" action=(action.as_str()) class="fields" data-apply="true"> | |
| 1146 | 1299 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 1147 | - <input type="hidden" name="assignees" value=(next.as_str())> | |
| 1148 | - <button type="submit" class="act" data-palette-action="post">(g::t(lang, K::AssignToMe))</button> | |
| 1300 | + <div class="field"> | |
| 1301 | + <label for="issue-assignees">(g::t(lang, K::Assignees))</label> | |
| 1302 | + <input id="issue-assignees" type="text" name="assignees" value=(text.as_str()) autocomplete="off" spellcheck="false"> | |
| 1303 | + </div> | |
| 1304 | + <noscript><div><button type="submit" class="primary">(g::t(lang, K::SaveAssignees))</button></div></noscript> | |
| 1149 | 1305 | </form> |
| 1150 | - } | |
| 1151 | - <form method="post" action=(action.as_str()) class="fields" data-apply="true"> | |
| 1152 | - <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 1153 | - <div class="field"> | |
| 1154 | - <label for="issue-assignees">(g::t(lang, K::Assignees))</label> | |
| 1155 | - <input id="issue-assignees" type="text" name="assignees" value=(text.as_str()) autocomplete="off" spellcheck="false" placeholder=(crate::pages::passkeys::s(lang, "Type a username", "Kullanıcı adı yaz"))> | |
| 1156 | - <p class="hint">(g::t(lang, K::CommaUsernames))</p> | |
| 1157 | - </div> | |
| 1158 | - <noscript><div><button type="submit" class="primary">(g::t(lang, K::SaveAssignees))</button></div></noscript> | |
| 1159 | - </form> | |
| 1160 | - ) | |
| 1161 | - </div> | |
| 1162 | - } | |
| 1306 | + ) | |
| 1307 | + } | |
| 1308 | + </div> | |
| 1163 | 1309 | </section> |
| 1164 | 1310 | }) |
| 1165 | 1311 | } |
| @@ -1174,19 +1320,20 @@ pub(crate) async fn milestone_box( | ||
| 1174 | 1320 | current: String, |
| 1175 | 1321 | none_selected: bool, |
| 1176 | 1322 | ) -> Result<impl View> { |
| 1323 | + let tool = if current.is_empty() { | |
| 1324 | + g::t(lang, K::Add) | |
| 1325 | + } else { | |
| 1326 | + g::t(lang, K::Edit) | |
| 1327 | + }; | |
| 1177 | 1328 | Ok(view! { |
| 1178 | 1329 | <section class="sec meta"> |
| 1179 | 1330 | <h2>(g::t(lang, K::MilestoneBox))</h2> |
| 1180 | - <p class="hint"> | |
| 1181 | - if current.is_empty() { | |
| 1182 | - (g::t(lang, K::NoMilestone)) | |
| 1183 | - } else { | |
| 1184 | - (current.as_str()) | |
| 1331 | + <div class="line"> | |
| 1332 | + if !current.is_empty() { | |
| 1333 | + <span class="val">(current.as_str())</span> | |
| 1185 | 1334 | } |
| 1186 | - </p> | |
| 1187 | - if write { | |
| 1188 | - <div class="acts"> | |
| 1189 | - reveal(label: g::t(lang, K::Edit), | |
| 1335 | + if write { | |
| 1336 | + reveal(label: tool, | |
| 1190 | 1337 | <form method="post" action=(action.as_str()) class="fields" data-apply="true"> |
| 1191 | 1338 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 1192 | 1339 | <div class="field"> |
| @@ -1201,14 +1348,14 @@ pub(crate) async fn milestone_box( | ||
| 1201 | 1348 | <noscript><div><button type="submit" class="primary">(g::t(lang, K::SaveMilestone))</button></div></noscript> |
| 1202 | 1349 | </form> |
| 1203 | 1350 | ) |
| 1204 | - </div> | |
| 1205 | - } | |
| 1351 | + } | |
| 1352 | + </div> | |
| 1206 | 1353 | </section> |
| 1207 | 1354 | }) |
| 1208 | 1355 | } |
| 1209 | 1356 | |
| 1210 | -/// The conversation lock. Triage holders get a form that locks it, with a reason, or unlocks it. | |
| 1211 | -/// Everyone else sees the lock state only when there is one. | |
| 1357 | +/// The conversation row, shown only when the conversation is locked, with its unlock word for | |
| 1358 | +/// triage holders. Locking is one of the tools at the foot of the sidebar (`item_tools`). | |
| 1212 | 1359 | #[component] |
| 1213 | 1360 | pub(crate) async fn lock_box( |
| 1214 | 1361 | lang: Lang, |
| @@ -1225,27 +1372,47 @@ pub(crate) async fn lock_box( | ||
| 1225 | 1372 | .to_owned(); |
| 1226 | 1373 | let none = reason.is_none(); |
| 1227 | 1374 | Ok(view! { |
| 1228 | - <section class="sec meta"> | |
| 1229 | - <h2>(g::t(lang, K::ConversationBox))</h2> | |
| 1230 | - <p class="hint"> | |
| 1231 | - if locked { | |
| 1232 | - (g::t(lang, K::LockedToCollaborators)) | |
| 1233 | - if !none { | |
| 1234 | - " (" (reason_text.as_str()) ")" | |
| 1375 | + if locked { | |
| 1376 | + <section class="sec meta"> | |
| 1377 | + <h2>(g::t(lang, K::ConversationBox))</h2> | |
| 1378 | + <div class="line"> | |
| 1379 | + <span class="val"> | |
| 1380 | + (g::t(lang, K::LockedToCollaborators)) | |
| 1381 | + if !none { | |
| 1382 | + " (" (reason_text.as_str()) ")" | |
| 1383 | + } | |
| 1384 | + </span> | |
| 1385 | + if write { | |
| 1386 | + post_act(label: g::t(lang, K::UnlockConversation), action: action.as_str(), csrf: csrf.as_str(), fields: vec![("locked".to_owned(), "0".to_owned())]) | |
| 1235 | 1387 | } |
| 1236 | - } else { | |
| 1237 | - (g::t(lang, K::OpenToEveryone)) | |
| 1238 | - } | |
| 1239 | - </p> | |
| 1240 | - if write { | |
| 1241 | - <div class="acts"> | |
| 1242 | - reveal(label: g::t(lang, K::Edit), | |
| 1243 | - <form method="post" action=(action.as_str()) class="fields"> | |
| 1244 | - <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 1245 | - if locked { | |
| 1246 | - <input type="hidden" name="locked" value="0"> | |
| 1247 | - <button type="submit" class="primary">(g::t(lang, K::UnlockConversation))</button> | |
| 1248 | - } else { | |
| 1388 | + </div> | |
| 1389 | + </section> | |
| 1390 | + } | |
| 1391 | + }) | |
| 1392 | +} | |
| 1393 | + | |
| 1394 | +/// The tools at the foot of the sidebar, one quiet line: Pin issue, and Lock conversation with its | |
| 1395 | +/// reason. `pin` is the pin action when the issue is not pinned and the viewer may pin it. | |
| 1396 | +#[component] | |
| 1397 | +pub(crate) async fn item_tools( | |
| 1398 | + lang: Lang, | |
| 1399 | + pin: Option<String>, | |
| 1400 | + lock: Option<String>, | |
| 1401 | + csrf: String, | |
| 1402 | +) -> Result<impl View> { | |
| 1403 | + let pin_label = g::t(lang, K::PinIssue); | |
| 1404 | + let lock_label = g::t(lang, K::LockConversation); | |
| 1405 | + Ok(view! { | |
| 1406 | + if pin.is_some() || lock.is_some() { | |
| 1407 | + <section class="sec"> | |
| 1408 | + <div class="line"> | |
| 1409 | + if let Some(action) = pin { | |
| 1410 | + post_act(label: pin_label, action: action.as_str(), csrf: csrf.as_str(), fields: vec![("pinned".to_owned(), "1".to_owned())]) | |
| 1411 | + } | |
| 1412 | + if let Some(action) = lock { | |
| 1413 | + reveal(label: lock_label, | |
| 1414 | + <form method="post" action=(action.as_str()) class="fields"> | |
| 1415 | + <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 1249 | 1416 | <div class="field"> |
| 1250 | 1417 | <label for="issue-lock-reason">(g::t(lang, K::Reason))</label> |
| 1251 | 1418 | <select id="issue-lock-reason" name="reason"> |
| @@ -1258,17 +1425,18 @@ pub(crate) async fn lock_box( | ||
| 1258 | 1425 | </div> |
| 1259 | 1426 | <input type="hidden" name="locked" value="1"> |
| 1260 | 1427 | <button type="submit" class="primary">(g::t(lang, K::LockConversation))</button> |
| 1261 | - } | |
| 1262 | - </form> | |
| 1263 | - ) | |
| 1428 | + </form> | |
| 1429 | + ) | |
| 1430 | + } | |
| 1264 | 1431 | </div> |
| 1265 | - } | |
| 1266 | - </section> | |
| 1432 | + </section> | |
| 1433 | + } | |
| 1267 | 1434 | }) |
| 1268 | 1435 | } |
| 1269 | 1436 | |
| 1270 | -/// The sidebar boxes. `base` is the item's URL; the forms post to `{base}/labels`, `/assignees` | |
| 1271 | -/// and `/milestone`. `write` shows the forms instead of the read-only lists. | |
| 1437 | +/// The sidebar facts. `base` is the item's URL; the forms post to `{base}/labels`, `/assignees`, | |
| 1438 | +/// `/milestone` and `/lock`. `write` shows the forms instead of the read-only lists. `pin` is | |
| 1439 | +/// `(pinned, action)` for an issue; the pinned row sits in the page (`pin_box`). | |
| 1272 | 1440 | #[component] |
| 1273 | 1441 | pub(crate) async fn item_sidebar( |
| 1274 | 1442 | lang: Lang, |
| @@ -1277,7 +1445,7 @@ pub(crate) async fn item_sidebar( | ||
| 1277 | 1445 | csrf: String, |
| 1278 | 1446 | viewer: Option<String>, |
| 1279 | 1447 | sidebar: Sidebar, |
| 1280 | - notify: Option<NotifyBox>, | |
| 1448 | + pin: Option<(bool, String)>, | |
| 1281 | 1449 | ) -> Result<impl View> { |
| 1282 | 1450 | let Sidebar { |
| 1283 | 1451 | labels, |
| @@ -1301,56 +1469,78 @@ pub(crate) async fn item_sidebar( | ||
| 1301 | 1469 | let assignees_action = format!("{base}/assignees"); |
| 1302 | 1470 | let milestone_action = format!("{base}/milestone"); |
| 1303 | 1471 | let lock_action = format!("{base}/lock"); |
| 1472 | + let pin_tool = pin.and_then(|(pinned, action)| (write && !pinned).then_some(action)); | |
| 1473 | + let lock_tool = (write && !locked).then(|| lock_action.clone()); | |
| 1304 | 1474 | Ok(view! { |
| 1305 | 1475 | labels_box(lang: lang, write: write, action: labels_action, csrf: csrf.clone(), labels: labels) |
| 1306 | 1476 | assignees_box(lang: lang, write: write, action: assignees_action, csrf: csrf.clone(), names: assignees, assign_next: assign_next) |
| 1307 | 1477 | milestone_box(lang: lang, write: write, action: milestone_action, csrf: csrf.clone(), |
| 1308 | 1478 | options: milestones, current: current_milestone, none_selected: none_selected) |
| 1309 | 1479 | lock_box(lang: lang, write: write, action: lock_action, csrf: csrf.clone(), locked: locked, reason: lock_reason) |
| 1310 | - if let Some(notify) = notify { | |
| 1311 | - notify_box(lang: lang, action: notify.action, csrf: notify.csrf, subscribed: notify.subscribed, reason: notify.reason) | |
| 1312 | - } | |
| 1480 | + item_tools(lang: lang, pin: pin_tool, lock: lock_tool, csrf: csrf.clone()) | |
| 1313 | 1481 | }) |
| 1314 | 1482 | } |
| 1315 | 1483 | |
| 1316 | 1484 | // Comment form |
| 1317 | 1485 | |
| 1318 | -/// The comment box with its close, reopen and comment buttons. The comment is posted to | |
| 1319 | -/// `action`; the close and reopen buttons post to `state_action` (the same URL for issues). | |
| 1486 | +/// The id of the comment form. The head's Close and Reopen buttons post it with `form=`, so a | |
| 1487 | +/// close can carry the draft text as its comment, as it always did. | |
| 1488 | +pub(crate) const COMMENT_FORM: &str = "item-comment"; | |
| 1489 | + | |
| 1490 | +/// The head tools of an item: Close (a menu of the two ways) or Reopen when closed, and the | |
| 1491 | +/// Subscribe or Unsubscribe pill, whose reason is its title. `close` is `(open, state action)` | |
| 1492 | +/// and is given only when the viewer may close the item. | |
| 1493 | +#[component] | |
| 1494 | +pub(crate) async fn item_head_tools( | |
| 1495 | + lang: Lang, | |
| 1496 | + close: Option<(bool, String)>, | |
| 1497 | + notify: Option<NotifyBox>, | |
| 1498 | +) -> Result<impl View> { | |
| 1499 | + let close_label = g::t(lang, K::Close); | |
| 1500 | + let reopen_label = g::t(lang, K::Reopen); | |
| 1501 | + let completed = g::t(lang, K::CloseCompleted); | |
| 1502 | + let not_planned = g::t(lang, K::CloseNotPlanned); | |
| 1503 | + Ok(view! { | |
| 1504 | + if let Some((open, state_action)) = close { | |
| 1505 | + if open { | |
| 1506 | + reveal(label: close_label, | |
| 1507 | + <div class="acts"> | |
| 1508 | + <button type="submit" class="act" form=(COMMENT_FORM) name="action" value="close_completed" formaction=(state_action.as_str())>(completed)</button> | |
| 1509 | + <button type="submit" class="act" form=(COMMENT_FORM) name="action" value="close_not_planned" formaction=(state_action.as_str())>(not_planned)</button> | |
| 1510 | + </div> | |
| 1511 | + ) | |
| 1512 | + } else { | |
| 1513 | + <button type="submit" class="act" form=(COMMENT_FORM) name="action" value="reopen" formaction=(state_action.as_str())>(reopen_label)</button> | |
| 1514 | + } | |
| 1515 | + } | |
| 1516 | + if let Some(notify) = notify { | |
| 1517 | + notify_pill(lang: lang, action: notify.action, csrf: notify.csrf, subscribed: notify.subscribed) | |
| 1518 | + } | |
| 1519 | + }) | |
| 1520 | +} | |
| 1521 | + | |
| 1522 | +/// The comment box: the text, and Comment as its one filled button. Its label is for screen | |
| 1523 | +/// readers only. | |
| 1320 | 1524 | #[component] |
| 1321 | 1525 | pub(crate) async fn comment_form( |
| 1322 | 1526 | lang: Lang, |
| 1323 | 1527 | action: String, |
| 1324 | - state_action: String, | |
| 1325 | 1528 | csrf: String, |
| 1326 | 1529 | draft: String, |
| 1327 | 1530 | error: Option<String>, |
| 1328 | - can_close: bool, | |
| 1329 | - open: bool, | |
| 1330 | 1531 | ) -> Result<impl View> { |
| 1331 | 1532 | Ok(view! { |
| 1332 | 1533 | <section class="sec issue-comment"> |
| 1333 | - <h2>(g::t(lang, K::AddComment))</h2> | |
| 1334 | 1534 | if let Some(message) = error { |
| 1335 | 1535 | alert(message: message.as_str()) |
| 1336 | 1536 | } |
| 1337 | - <form method="post" action=(action.as_str()) class="fields"> | |
| 1537 | + <form id=(COMMENT_FORM) method="post" action=(action.as_str()) class="fields"> | |
| 1338 | 1538 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 1339 | 1539 | <div class="field"> |
| 1340 | - <label for="issue-comment-body">(g::t(lang, K::Comment))</label> | |
| 1540 | + <label class="sr-only" for="issue-comment-body">(g::t(lang, K::Comment))</label> | |
| 1341 | 1541 | <textarea id="issue-comment-body" name="body" rows="3">(draft.as_str())</textarea> |
| 1342 | 1542 | </div> |
| 1343 | 1543 | <button type="submit" class="primary" name="action" value="comment">(g::t(lang, K::Comment))</button> |
| 1344 | - if can_close { | |
| 1345 | - <div class="acts"> | |
| 1346 | - if open { | |
| 1347 | - <button type="submit" class="act" name="action" value="close_completed" formaction=(state_action.as_str()) data-palette-action="post">(g::t(lang, K::CloseCompleted))</button> | |
| 1348 | - <button type="submit" class="act" name="action" value="close_not_planned" formaction=(state_action.as_str()) data-palette-action="post">(g::t(lang, K::CloseNotPlanned))</button> | |
| 1349 | - } else { | |
| 1350 | - <button type="submit" class="act" name="action" value="reopen" formaction=(state_action.as_str()) data-palette-action="post">(g::t(lang, K::ReopenWithComment))</button> | |
| 1351 | - } | |
| 1352 | - </div> | |
| 1353 | - } | |
| 1354 | 1544 | </form> |
| 1355 | 1545 | </section> |
| 1356 | 1546 | }) |
crates/forge-web/src/pages/issue_pin.rsmodified+12 -22
| @@ -75,8 +75,8 @@ async fn issue_pin_save(cx: &Cx, Form(form): Form<PinForm>) -> Result<impl View> | ||
| 75 | 75 | Err(see_other(back).into()) |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | -/// The sidebar box for pinning. Triage holders get the button, which posts the opposite of the | |
| 79 | -/// current state; others see whether the issue is pinned. | |
| 78 | +/// The pinned row, shown only while the issue is pinned, with its unpin word for triage holders. | |
| 79 | +/// Pinning is a tool at the foot of the sidebar (`item_tools`). | |
| 80 | 80 | #[component] |
| 81 | 81 | pub(crate) async fn pin_box( |
| 82 | 82 | lang: Lang, |
| @@ -85,27 +85,17 @@ pub(crate) async fn pin_box( | ||
| 85 | 85 | action: String, |
| 86 | 86 | csrf: String, |
| 87 | 87 | ) -> Result<impl View> { |
| 88 | - let next = if pinned { "0" } else { "1" }; | |
| 89 | - let label = if pinned { | |
| 90 | - g::t(lang, K::UnpinIssue) | |
| 91 | - } else { | |
| 92 | - g::t(lang, K::PinIssue) | |
| 93 | - }; | |
| 94 | 88 | Ok(view! { |
| 95 | - <section class="sec meta"> | |
| 96 | - <h2>(g::t(lang, K::Pinned))</h2> | |
| 97 | - <p class="hint"> | |
| 98 | - if pinned { | |
| 99 | - (g::t(lang, K::PinnedTopNote)) | |
| 100 | - } else { | |
| 101 | - (g::t(lang, K::NotPinned)) | |
| 102 | - } | |
| 103 | - </p> | |
| 104 | - if write { | |
| 105 | - <div class="acts"> | |
| 106 | - post_act(label: label, action: action.as_str(), csrf: csrf.as_str(), fields: vec![("pinned".to_owned(), next.to_owned())]) | |
| 89 | + if pinned { | |
| 90 | + <section class="sec meta"> | |
| 91 | + <h2>(g::t(lang, K::Pinned))</h2> | |
| 92 | + <div class="line"> | |
| 93 | + <span class="val">(g::t(lang, K::PinnedTopNote))</span> | |
| 94 | + if write { | |
| 95 | + post_act(label: g::t(lang, K::UnpinIssue), action: action.as_str(), csrf: csrf.as_str(), fields: vec![("pinned".to_owned(), "0".to_owned())]) | |
| 96 | + } | |
| 107 | 97 | </div> |
| 108 | - } | |
| 109 | - </section> | |
| 98 | + </section> | |
| 99 | + } | |
| 110 | 100 | }) |
| 111 | 101 | } |
crates/forge-web/src/pages/issue_view.rsmodified+8 -6
| @@ -21,8 +21,8 @@ use crate::i18n::issues::{self as g, K}; | ||
| 21 | 21 | use crate::notify; |
| 22 | 22 | use crate::pages::issue_parts::{ |
| 23 | 23 | CommentForm, ItemKind, Posted, bump_live, check_write, comment_for, comment_form, csrf_of, |
| 24 | - discussion_timeline, issue_for, item_for, item_sidebar, load_discussion, load_sidebar, | |
| 25 | - lock_message, may_change, may_converse, parse_number, post_comment, triage, | |
| 24 | + discussion_timeline, issue_for, item_for, item_head_tools, item_sidebar, load_discussion, | |
| 25 | + load_sidebar, lock_message, may_change, may_converse, parse_number, post_comment, triage, | |
| 26 | 26 | }; |
| 27 | 27 | use crate::pages::issue_pin::pin_box; |
| 28 | 28 | use crate::pages::issues_live::item_live_url; |
| @@ -60,7 +60,7 @@ async fn issue_page( | ||
| 60 | 60 | let viewer_login = ctx.viewer.as_ref().map(|(u, _)| u.username.clone()); |
| 61 | 61 | let pinned = state.store.is_pinned(&ctx.repo.id, &issue.id).await?; |
| 62 | 62 | let pin_action = format!("{issue_href}/pin"); |
| 63 | - let notify = notify_box_for(state, &ctx, lang, &issue.id, &issue_href).await?; | |
| 63 | + let notify = notify_box_for(state, &ctx, &issue.id, &issue_href).await?; | |
| 64 | 64 | let author = discussion.author.clone(); |
| 65 | 65 | let author_login = discussion.author_login.clone(); |
| 66 | 66 | let opened = discussion.opened.clone(); |
| @@ -74,6 +74,8 @@ async fn issue_page( | ||
| 74 | 74 | let locked_for_viewer = !may_converse(&ctx, &issue); |
| 75 | 75 | let lock_notice = lock_message(lang, &issue); |
| 76 | 76 | let open = matches!(issue.state, IssueState::Open); |
| 77 | + // Close, or Reopen when closed, is offered to whoever may comment and may change the state. | |
| 78 | + let close = (can_comment && editable_issue).then(|| (open, format!("{issue_href}/comment"))); | |
| 77 | 79 | |
| 78 | 80 | let (state_class, state_text) = match (&issue.state, &issue.state_reason) { |
| 79 | 81 | (IssueState::Open, _) => ("issue-badge issue-badge-open", g::t(lang, K::Open)), |
| @@ -106,13 +108,13 @@ async fn issue_page( | ||
| 106 | 108 | shell(title: page_title.as_str(), viewer: ctx.viewer.as_ref(), extra_stylesheet: Some(labels_href.as_str()), |
| 107 | 109 | repo_head(head: header, title: Some(issue.title.clone()), sub: sub, |
| 108 | 110 | <span class="num">(number_label.as_str())</span> |
| 111 | + item_head_tools(lang: lang, close: close, notify: notify) | |
| 109 | 112 | ) |
| 110 | 113 | <div class="work" data-live=(live_href.as_str()) data-live-now=""> |
| 111 | 114 | <div class="sheet"> |
| 112 | 115 | discussion_timeline(lang: lang, discussion: discussion) |
| 113 | 116 | if can_comment { |
| 114 | - comment_form(lang: lang, action: comment_action.clone(), state_action: comment_action.clone(), | |
| 115 | - csrf: csrf.clone(), draft: draft, error: error, can_close: editable_issue, open: open) | |
| 117 | + comment_form(lang: lang, action: comment_action.clone(), csrf: csrf.clone(), draft: draft, error: error) | |
| 116 | 118 | } |
| 117 | 119 | if archived { |
| 118 | 120 | <p class="state">(g::t(lang, K::ArchivedIssuesReadOnly))</p> |
| @@ -123,7 +125,7 @@ async fn issue_page( | ||
| 123 | 125 | <p class="state">(g::comment_login_lead(lang))<a href=(login_href.as_str())>(g::t(lang, K::LogInLink))</a>(g::t(lang, K::ToComment))</p> |
| 124 | 126 | } |
| 125 | 127 | pin_box(lang: lang, write: write_meta, pinned: pinned, action: pin_action.clone(), csrf: csrf.clone()) |
| 126 | - item_sidebar(lang: lang, write: write_meta, base: issue_href.clone(), csrf: csrf.clone(), viewer: viewer_login, sidebar: sidebar, notify: notify) | |
| 128 | + item_sidebar(lang: lang, write: write_meta, base: issue_href.clone(), csrf: csrf.clone(), viewer: viewer_login, sidebar: sidebar, pin: Some((pinned, pin_action.clone()))) | |
| 127 | 129 | </div> |
| 128 | 130 | </div> |
| 129 | 131 | ) |
crates/forge-web/src/pages/issues_list.rsmodified+1 -2
| @@ -604,7 +604,7 @@ async fn issues_list_page(cx: &Cx) -> Result<impl View> { | ||
| 604 | 604 | <a class="act" href=(milestones_href.as_str())>(g::t(lang, K::Milestones))</a> |
| 605 | 605 | </form> |
| 606 | 606 | if has_filters { |
| 607 | - <p class="hint">(g::t(lang, K::FiltersApplied)) " " <a class="act" href=(clear_href.as_str())>(g::t(lang, K::ClearFilters))</a></p> | |
| 607 | + <p class="state">(g::t(lang, K::FiltersApplied)) " " <a class="act" href=(clear_href.as_str())>(g::t(lang, K::ClearFilters))</a></p> | |
| 608 | 608 | } |
| 609 | 609 | if !pinned.is_empty() { |
| 610 | 610 | <section class="sec" aria-label=(g::t(lang, K::PinnedIssues))> |
| @@ -788,7 +788,6 @@ async fn new_issue_body( | ||
| 788 | 788 | <div class="field"> |
| 789 | 789 | <label for="issue-body">(g::t(lang, K::Description))</label> |
| 790 | 790 | <textarea id="issue-body" name="body" rows="12">(draft.body.as_str())</textarea> |
| 791 | - <p class="hint">(g::t(lang, K::MarkdownSupported))</p> | |
| 792 | 791 | </div> |
| 793 | 792 | if has_labels { |
| 794 | 793 | <div class="field"> |
crates/forge-web/src/pages/labels_page.rsmodified+2 -3
| @@ -148,7 +148,7 @@ async fn labels_body( | ||
| 148 | 148 | </span> |
| 149 | 149 | </summary> |
| 150 | 150 | <div class="opened"> |
| 151 | - <p class="hint"><a class="label-open" href=(row.issues_href.as_str())>(row.open_text.as_str())</a></p> | |
| 151 | + <p><a class="label-open" href=(row.issues_href.as_str())>(row.open_text.as_str())</a></p> | |
| 152 | 152 | if can_triage { |
| 153 | 153 | <div class="acts"> |
| 154 | 154 | reveal(label: g::t(lang, K::Edit), |
| @@ -169,8 +169,7 @@ async fn labels_body( | ||
| 169 | 169 | <button type="submit">(g::t(lang, K::SaveLabel))</button> |
| 170 | 170 | </form> |
| 171 | 171 | ) |
| 172 | - confirm_act(lang: lang, label: g::t(lang, K::Delete), action: row.delete_action.as_str(), csrf: csrf.as_str(), | |
| 173 | - note: Some(crate::pages::passkeys::s(lang, "It is removed from every issue that has it.", "Onu taşıyan her konudan kaldırılır.").to_owned())) | |
| 172 | + confirm_act(lang: lang, label: g::t(lang, K::Delete), action: row.delete_action.as_str(), csrf: csrf.as_str()) | |
| 174 | 173 | </div> |
| 175 | 174 | } |
| 176 | 175 | </div> |
crates/forge-web/src/pages/login.rsmodified+2 -2
| @@ -25,7 +25,7 @@ use crate::i18n::{self, Key, Lang, t}; | ||
| 25 | 25 | use crate::pages::passkeys::{available as passkeys_available, login_passkey, s}; |
| 26 | 26 | use crate::state::AppState; |
| 27 | 27 | use crate::throttle::{self, LOGIN_IP_LIMIT, LOGIN_USER_LIMIT, TWO_FACTOR_USER_LIMIT}; |
| 28 | -use crate::views::parts::{SubPart, head}; | |
| 28 | +use crate::views::parts::head; | |
| 29 | 29 | use crate::views::{alert, shell}; |
| 30 | 30 | |
| 31 | 31 | /// Hash checked when the username is unknown, so both paths spend one argon2 verify. |
| @@ -279,7 +279,7 @@ async fn login_submit(cx: &Cx, Form(form): Form<LoginForm>) -> Result<impl View> | ||
| 279 | 279 | #[component] |
| 280 | 280 | async fn two_factor_form(lang: Lang, precsrf: &str, error: Option<String>) -> Result<impl View> { |
| 281 | 281 | Ok(view! { |
| 282 | - head(title: t(lang, Key::TwoFactorCheck), sub: vec![SubPart::text(t(lang, Key::TwoFactorCheckSub))]) | |
| 282 | + head(title: t(lang, Key::TwoFactorCheck)) | |
| 283 | 283 | <div class="sheet fit"> |
| 284 | 284 | <form data-hard="true" method="post" action="/login/2fa" class="fields"> |
| 285 | 285 | if let Some(message) = error { |
crates/forge-web/src/pages/merge_queue.rsmodified+2 -8
| @@ -359,11 +359,10 @@ async fn queue_body( | ||
| 359 | 359 | csrf: String, |
| 360 | 360 | ) -> Result<impl View> { |
| 361 | 361 | let remove_label = g::t(lang, K::RemoveFromQueue); |
| 362 | - let hint = g::t(lang, K::RequireMergeQueueHint); | |
| 363 | 362 | let remove_note = crate::pages::passkeys::s( |
| 364 | 363 | lang, |
| 365 | - "The pull request leaves the queue. It can join again later.", | |
| 366 | - "Çekme isteği sıradan çıkar. Daha sonra yeniden ekleyebilirsin.", | |
| 364 | + "Remove it from the queue?", | |
| 365 | + "Sıradan çıkarılsın mı?", | |
| 367 | 366 | ) |
| 368 | 367 | .to_owned(); |
| 369 | 368 | Ok(view! { |
| @@ -430,11 +429,6 @@ async fn queue_body( | ||
| 430 | 429 | } |
| 431 | 430 | } |
| 432 | 431 | } |
| 433 | - if protected { | |
| 434 | - <section class="sec"> | |
| 435 | - <p class="hint">(hint)</p> | |
| 436 | - </section> | |
| 437 | - } | |
| 438 | 432 | </div> |
| 439 | 433 | }) |
| 440 | 434 | } |
crates/forge-web/src/pages/milestones_page.rsmodified+5 -8
| @@ -136,16 +136,14 @@ async fn milestone_row( | ||
| 136 | 136 | <span class="val">(open_text.as_str()) " \u{b7} " (closed_text.as_str())</span> |
| 137 | 137 | </summary> |
| 138 | 138 | <div class="opened"> |
| 139 | - <p class="hint"> | |
| 140 | - if let Some(due) = row.due.as_deref() { | |
| 139 | + if let Some(due) = row.due.as_deref() { | |
| 140 | + <p> | |
| 141 | 141 | (g::due_text(lang, due)) |
| 142 | 142 | if row.overdue { |
| 143 | 143 | " " <span class="badge overdue">(g::t(lang, K::Overdue))</span> |
| 144 | 144 | } |
| 145 | - } else { | |
| 146 | - (g::t(lang, K::NoDueDate)) | |
| 147 | - } | |
| 148 | - </p> | |
| 145 | + </p> | |
| 146 | + } | |
| 149 | 147 | <progress value=(row.closed) max=(max)></progress> |
| 150 | 148 | <div class="acts"> |
| 151 | 149 | <a class="act" href=(row.open_href.as_str())>(open_text.as_str())</a> |
| @@ -157,8 +155,7 @@ async fn milestone_row( | ||
| 157 | 155 | if can_triage { |
| 158 | 156 | <div class="acts"> |
| 159 | 157 | <a class="act" href=(row.edit_href.as_str())>(g::t(lang, K::Edit))</a> |
| 160 | - confirm_act(lang: lang, label: g::t(lang, K::Delete), action: row.delete_action.as_str(), csrf: csrf.as_str(), | |
| 161 | - note: Some(crate::pages::passkeys::s(lang, "Its issues stay open or closed and lose the milestone.", "Konular açık ya da kapalı kalır, yalnızca kilometre taşını kaybeder.").to_owned())) | |
| 158 | + confirm_act(lang: lang, label: g::t(lang, K::Delete), action: row.delete_action.as_str(), csrf: csrf.as_str()) | |
| 162 | 159 | </div> |
| 163 | 160 | } |
| 164 | 161 | </div> |
crates/forge-web/src/pages/needs_you.rsmodified+2 -4
| @@ -20,9 +20,8 @@ use crate::i18n::needs::{self as ni, K}; | ||
| 20 | 20 | use crate::i18n::{self, Lang}; |
| 21 | 21 | use crate::live::{Topic, stream_wakes}; |
| 22 | 22 | use crate::pages::ci_runs::run_href; |
| 23 | -use crate::pages::passkeys::s; | |
| 24 | 23 | use crate::state::AppState; |
| 25 | -use crate::views::parts::{SubPart, head}; | |
| 24 | +use crate::views::parts::head; | |
| 26 | 25 | use crate::views::repo_list::{PageLink, pager, pager_links}; |
| 27 | 26 | use crate::views::{rel_time, repo_href, shell}; |
| 28 | 27 | |
| @@ -411,10 +410,9 @@ async fn needs_you(cx: &Cx) -> Result<impl View> { | ||
| 411 | 410 | let back = full.as_ref().map(|_| ni::t(lang, K::BackToNeedsYou)); |
| 412 | 411 | let heading = ni::t(lang, K::NeedsYou); |
| 413 | 412 | let unread = state.store.unread_count(&user.id).await?; |
| 414 | - let sub = vec![SubPart::text(s(lang, "Waiting on you", "Senden beklenenler"))]; | |
| 415 | 413 | Ok(view! { |
| 416 | 414 | shell(title: heading, viewer: Some(&viewer), |
| 417 | - head(title: heading, sub: sub, live: Some(live.as_str()), | |
| 415 | + head(title: heading, live: Some(live.as_str()), | |
| 418 | 416 | if let Some(back) = back { |
| 419 | 417 | <a class="act" href="/needs-you">(back)</a> |
| 420 | 418 | } |
crates/forge-web/src/pages/new_repo.rsmodified+0 -3
| @@ -273,7 +273,6 @@ async fn new_repo_form( | ||
| 273 | 273 | <input type="checkbox" name="add_readme" value="on" checked=(add_readme)> |
| 274 | 274 | <span>(g::t(lang, K::ReadmeLabel))</span> |
| 275 | 275 | </label> |
| 276 | - <p class="hint">(g::t(lang, K::ReadmeHelp))</p> | |
| 277 | 276 | <div class="field"> |
| 278 | 277 | <label for="new-license">(g::t(lang, K::LicenseLabel))</label> |
| 279 | 278 | <select id="new-license" name="license"> |
| @@ -282,10 +281,8 @@ async fn new_repo_form( | ||
| 282 | 281 | <option value=(*id) selected=(*id == draft_license.as_str())>(*label)</option> |
| 283 | 282 | } |
| 284 | 283 | </select> |
| 285 | - <p class="hint">(g::t(lang, K::LicenseHelp))</p> | |
| 286 | 284 | </div> |
| 287 | 285 | reveal(label: g::t(lang, K::MirrorLegend), id: Some("new-mirror"), open: mirror_open, |
| 288 | - <p class="hint">(g::t(lang, K::MirrorIntro))</p> | |
| 289 | 286 | <div class="field"> |
| 290 | 287 | <label for="new-mirror-url">(g::t(lang, K::SourceUrl))</label> |
| 291 | 288 | <input id="new-mirror-url" type="url" name="mirror_url" value=(draft_mirror_url.as_str()) autocomplete="off" spellcheck="false" maxlength="2048"> |
crates/forge-web/src/pages/notifications.rsmodified+15 -44
| @@ -1009,7 +1009,6 @@ pub(crate) async fn can_read(state: &AppState, user: &User, repo_id: &str) -> Re | ||
| 1009 | 1009 | pub(crate) async fn notify_box_for( |
| 1010 | 1010 | state: &AppState, |
| 1011 | 1011 | ctx: &RepoCtx, |
| 1012 | - lang: Lang, | |
| 1013 | 1012 | issue_id: &str, |
| 1014 | 1013 | base: &str, |
| 1015 | 1014 | ) -> Result<Option<NotifyBox>> { |
| @@ -1020,47 +1019,28 @@ pub(crate) async fn notify_box_for( | ||
| 1020 | 1019 | publish_unread(state, &user.id).await; |
| 1021 | 1020 | let level = state.store.watch_level(&user.id, &ctx.repo.id).await?; |
| 1022 | 1021 | let subscription = state.store.subscription(&user.id, issue_id).await?; |
| 1023 | - let (subscribed, reason) = if level == WatchLevel::Ignoring { | |
| 1024 | - (false, g::t(lang, K::NotReceivingRepo).to_owned()) | |
| 1022 | + let subscribed = if level == WatchLevel::Ignoring { | |
| 1023 | + false | |
| 1025 | 1024 | } else { |
| 1026 | 1025 | match subscription { |
| 1027 | - Some((SubState::Ignored, _)) => (false, g::t(lang, K::NotReceivingThread).to_owned()), | |
| 1028 | - Some((SubState::Subscribed, reason)) => (true, because(lang, reason)), | |
| 1029 | - None if level == WatchLevel::Watching => { | |
| 1030 | - (true, g::receiving_because(lang, K::WhyWatching)) | |
| 1031 | - } | |
| 1032 | - None => (false, g::t(lang, K::NotReceivingThread).to_owned()), | |
| 1026 | + Some((SubState::Ignored, _)) => false, | |
| 1027 | + Some((SubState::Subscribed, _)) => true, | |
| 1028 | + None => level == WatchLevel::Watching, | |
| 1033 | 1029 | } |
| 1034 | 1030 | }; |
| 1035 | 1031 | Ok(Some(NotifyBox { |
| 1036 | 1032 | action: format!("{base}/subscription"), |
| 1037 | 1033 | csrf: session.csrf_token.clone(), |
| 1038 | 1034 | subscribed, |
| 1039 | - reason, | |
| 1040 | 1035 | })) |
| 1041 | 1036 | } |
| 1042 | 1037 | |
| 1043 | -/// The notification sidebar box data: where the form posts, the session CSRF token, whether the | |
| 1044 | -/// viewer is receiving notifications, and the sentence explaining why. | |
| 1038 | +/// The notification sidebar box data: where the form posts, the session CSRF token, and whether the | |
| 1039 | +/// viewer is receiving notifications. | |
| 1045 | 1040 | pub(crate) struct NotifyBox { |
| 1046 | 1041 | pub(crate) action: String, |
| 1047 | 1042 | pub(crate) csrf: String, |
| 1048 | 1043 | pub(crate) subscribed: bool, |
| 1049 | - pub(crate) reason: String, | |
| 1050 | -} | |
| 1051 | - | |
| 1052 | -/// "You're receiving notifications because ..." for a stored subscription reason. | |
| 1053 | -fn because(lang: Lang, reason: Reason) -> String { | |
| 1054 | - let why = match reason { | |
| 1055 | - Reason::Mention => K::WhyMentioned, | |
| 1056 | - Reason::Assign => K::WhyAssigned, | |
| 1057 | - Reason::ReviewRequested => K::WhyReviewRequested, | |
| 1058 | - Reason::Author => K::WhyAuthor, | |
| 1059 | - Reason::Comment => K::WhyCommented, | |
| 1060 | - Reason::StateChange | Reason::Subscribed => K::WhySubscribed, | |
| 1061 | - Reason::Watching => K::WhyWatching, | |
| 1062 | - }; | |
| 1063 | - g::receiving_because(lang, why) | |
| 1064 | 1044 | } |
| 1065 | 1045 | |
| 1066 | 1046 | /// The human label of a notification reason. |
| @@ -1158,7 +1138,6 @@ async fn inbox_list( | ||
| 1158 | 1138 | let filters = inbox_items(lang, if all { "all" } else { "unread" }, unread_count); |
| 1159 | 1139 | Ok(view! { |
| 1160 | 1140 | head(title: i18n::t(lang, Key::Notifications), |
| 1161 | - sub: vec![crate::views::parts::SubPart::text(crate::pages::passkeys::s(lang, "What happened where you take part", "Katıldığın yerlerde olanlar"))], | |
| 1162 | 1141 | if !empty { |
| 1163 | 1142 | <form method="post" action="/notifications/mark_all_read" class="act-form"> |
| 1164 | 1143 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| @@ -1211,15 +1190,13 @@ async fn inbox_list( | ||
| 1211 | 1190 | }) |
| 1212 | 1191 | } |
| 1213 | 1192 | |
| 1214 | -/// The Notifications box in the issue and pull sidebar: the reason and a Subscribe or | |
| 1215 | -/// Unsubscribe button. | |
| 1193 | +/// The Subscribe or Unsubscribe pill of an issue or pull request, in its head. | |
| 1216 | 1194 | #[component] |
| 1217 | -pub(crate) async fn notify_box( | |
| 1195 | +pub(crate) async fn notify_pill( | |
| 1218 | 1196 | lang: Lang, |
| 1219 | 1197 | action: String, |
| 1220 | 1198 | csrf: String, |
| 1221 | 1199 | subscribed: bool, |
| 1222 | - reason: String, | |
| 1223 | 1200 | ) -> Result<impl View> { |
| 1224 | 1201 | let (label, value_text) = if subscribed { |
| 1225 | 1202 | (g::t(lang, K::Unsubscribe), "unsubscribe") |
| @@ -1227,13 +1204,11 @@ pub(crate) async fn notify_box( | ||
| 1227 | 1204 | (g::t(lang, K::Subscribe), "subscribe") |
| 1228 | 1205 | }; |
| 1229 | 1206 | Ok(view! { |
| 1230 | - <section class="sec meta"> | |
| 1231 | - <h2>(i18n::t(lang, Key::Notifications))</h2> | |
| 1232 | - <p class="hint">(reason.as_str())</p> | |
| 1233 | - <div class="acts"> | |
| 1234 | - post_act(label: label, action: action.as_str(), csrf: csrf.as_str(), fields: vec![("action".to_owned(), value_text.to_owned())]) | |
| 1235 | - </div> | |
| 1236 | - </section> | |
| 1207 | + <form class="act-form" method="post" action=(action.as_str())> | |
| 1208 | + <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 1209 | + <input type="hidden" name="action" value=(value_text)> | |
| 1210 | + <button type="submit" class="act">(label)</button> | |
| 1211 | + </form> | |
| 1237 | 1212 | }) |
| 1238 | 1213 | } |
| 1239 | 1214 | |
| @@ -1277,7 +1252,6 @@ pub(crate) async fn watch_form( | ||
| 1277 | 1252 | <input type="hidden" name="level" value="participating"> |
| 1278 | 1253 | <button type="submit" class=(cls_participating)> |
| 1279 | 1254 | <span class="watch-option-title">(g::t(lang, K::OptParticipating))</span> |
| 1280 | - <span class="watch-option-desc">(g::t(lang, K::WatchDescParticipating))</span> | |
| 1281 | 1255 | </button> |
| 1282 | 1256 | </form> |
| 1283 | 1257 | </li> |
| @@ -1287,7 +1261,6 @@ pub(crate) async fn watch_form( | ||
| 1287 | 1261 | <input type="hidden" name="level" value="watching"> |
| 1288 | 1262 | <button type="submit" class=(cls_watching) data-palette-action="post" data-palette-label=(g::t(lang, K::OptWatching))> |
| 1289 | 1263 | <span class="watch-option-title">(g::t(lang, K::OptWatching))</span> |
| 1290 | - <span class="watch-option-desc">(g::t(lang, K::WatchDescWatching))</span> | |
| 1291 | 1264 | </button> |
| 1292 | 1265 | </form> |
| 1293 | 1266 | </li> |
| @@ -1297,7 +1270,6 @@ pub(crate) async fn watch_form( | ||
| 1297 | 1270 | <input type="hidden" name="level" value="ignoring"> |
| 1298 | 1271 | <button type="submit" class=(cls_ignoring)> |
| 1299 | 1272 | <span class="watch-option-title">(g::t(lang, K::OptIgnoring))</span> |
| 1300 | - <span class="watch-option-desc">(g::t(lang, K::WatchDescIgnoring))</span> | |
| 1301 | 1273 | </button> |
| 1302 | 1274 | </form> |
| 1303 | 1275 | </li> |
| @@ -1474,7 +1446,7 @@ mod tests { | ||
| 1474 | 1446 | let unread = get(&site, "/notifications", Some(&cookie)).await; |
| 1475 | 1447 | assert_eq!(unread.status, 200); |
| 1476 | 1448 | assert!(!unread.body.contains("tahinli/demo #1 First")); |
| 1477 | - assert!(unread.body.contains("You have no unread notifications.")); | |
| 1449 | + assert!(unread.body.contains("No unread notifications.")); | |
| 1478 | 1450 | |
| 1479 | 1451 | let all = get(&site, "/notifications?all=1", Some(&cookie)).await; |
| 1480 | 1452 | assert_eq!(all.status, 200); |
| @@ -1624,7 +1596,6 @@ mod tests { | ||
| 1624 | 1596 | assert_eq!(sub, Some((SubState::Subscribed, Reason::Subscribed))); |
| 1625 | 1597 | |
| 1626 | 1598 | let page = get(&site, "/tahinli/demo/issues/1", Some(&cookie)).await; |
| 1627 | - assert!(page.body.contains("because you subscribed to this.")); | |
| 1628 | 1599 | assert!(page.body.contains("value=\"unsubscribe\"")); |
| 1629 | 1600 | |
| 1630 | 1601 | post( |
crates/forge-web/src/pages/org_ctx.rsmodified+0 -11
| @@ -184,17 +184,6 @@ pub fn take_notice(cx: &Cx, lang: Lang) -> Option<(&'static str, bool)> { | ||
| 184 | 184 | .map(|(_, key, is_error)| (g::t(lang, *key), *is_error)) |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | -/// The org's name for screen readers (the path bar shows it), and its description as one hint line. | |
| 188 | -#[component] | |
| 189 | -pub async fn org_head(name: String, description: String) -> Result<impl View> { | |
| 190 | - Ok(view! { | |
| 191 | - <h1 class="sr-only">(name.as_str())</h1> | |
| 192 | - if !description.is_empty() { | |
| 193 | - <p class="hint">(description.as_str())</p> | |
| 194 | - } | |
| 195 | - }) | |
| 196 | -} | |
| 197 | - | |
| 198 | 187 | /// The counts on an organization's tab labels: the repos the viewer may read and the packages the |
| 199 | 188 | /// viewer may see, as the profile counts them. |
| 200 | 189 | pub async fn org_tab_counts(state: &AppState, org: &User, viewer: &User) -> Result<(u64, usize)> { |
crates/forge-web/src/pages/org_members.rsmodified+43 -91
| @@ -24,7 +24,7 @@ use crate::pages::org_ctx::{ | ||
| 24 | 24 | }; |
| 25 | 25 | use crate::pages::passkeys; |
| 26 | 26 | use crate::state::AppState; |
| 27 | -use crate::views::parts::{SubPart, confirm_act, head, reveal}; | |
| 27 | +use crate::views::parts::{PeopleList, PersonRow, SubPart, head, people_list}; | |
| 28 | 28 | use crate::views::{avatar_url, display_name, shell}; |
| 29 | 29 | |
| 30 | 30 | path_param!(org); |
| @@ -57,25 +57,15 @@ struct RemoveForm { | ||
| 57 | 57 | user_id: String, |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | -/// One table row: a member, their org role, and whether it is the viewer. | |
| 61 | -struct MemberRow { | |
| 62 | - user_id: String, | |
| 63 | - username: String, | |
| 64 | - /// What to show: the login name, or "Deleted user" for the ghost account. | |
| 65 | - label: String, | |
| 66 | - avatar: String, | |
| 67 | - is_owner: bool, | |
| 68 | - is_self: bool, | |
| 69 | -} | |
| 70 | - | |
| 71 | -/// The members table and the add form. Owners get the role, remove and add controls. | |
| 60 | +/// The members list and its add form. Owners get the role, remove and add controls; everyone | |
| 61 | +/// else sees the plain list. | |
| 72 | 62 | #[component] |
| 73 | 63 | async fn members_body( |
| 74 | 64 | name: String, |
| 75 | 65 | description: String, |
| 76 | 66 | base: String, |
| 77 | 67 | owner: bool, |
| 78 | - rows: Vec<MemberRow>, | |
| 68 | + rows: Vec<PersonRow>, | |
| 79 | 69 | csrf: String, |
| 80 | 70 | notice: Option<(&'static str, bool)>, |
| 81 | 71 | lang: Lang, |
| @@ -83,85 +73,41 @@ async fn members_body( | ||
| 83 | 73 | repo_count: u64, |
| 84 | 74 | package_count: usize, |
| 85 | 75 | ) -> Result<impl View> { |
| 86 | - let role_action = format!("{base}/members/role"); | |
| 87 | - let remove_action = format!("{base}/members/remove"); | |
| 88 | - let add_action = format!("{base}/members/add"); | |
| 89 | 76 | let sub = if description.is_empty() { |
| 90 | 77 | Vec::new() |
| 91 | 78 | } else { |
| 92 | 79 | vec![SubPart::text(description)] |
| 93 | 80 | }; |
| 81 | + let list = PeopleList { | |
| 82 | + lang, | |
| 83 | + title: g::t(lang, K::Members).to_owned(), | |
| 84 | + rows, | |
| 85 | + roles: vec![ | |
| 86 | + ("owner".to_owned(), g::t(lang, K::RoleOwner).to_owned()), | |
| 87 | + ("member".to_owned(), g::t(lang, K::RoleMember).to_owned()), | |
| 88 | + ], | |
| 89 | + manage: owner, | |
| 90 | + csrf, | |
| 91 | + role_action: format!("{base}/members/role"), | |
| 92 | + remove_action: format!("{base}/members/remove"), | |
| 93 | + remove_note: None, | |
| 94 | + add_action: format!("{base}/members/add"), | |
| 95 | + add_id: "add-member".to_owned(), | |
| 96 | + add_label: g::t(lang, K::AddMemberButton).to_owned(), | |
| 97 | + add_open: false, | |
| 98 | + add_default_role: "member".to_owned(), | |
| 99 | + username_label: g::t(lang, K::Username).to_owned(), | |
| 100 | + role_label: g::t(lang, K::Role).to_owned(), | |
| 101 | + save_label: g::t(lang, K::Save).to_owned(), | |
| 102 | + open_label: passkeys::s(lang, "Open profile", "Profili aç").to_owned(), | |
| 103 | + empty: None, | |
| 104 | + }; | |
| 94 | 105 | Ok(view! { |
| 95 | 106 | head(title: name.as_str(), sub: sub, live: Some(live.as_str())) |
| 96 | 107 | org_tabs(lang: lang, name: name.clone(), current: "members".to_owned(), owner: owner, repo_count: repo_count, package_count: package_count) |
| 97 | 108 | org_notice(notice: notice) |
| 98 | 109 | <div class="sheet"> |
| 99 | - <div class="sheet-tools"> | |
| 100 | - <strong>(g::t(lang, K::Members))</strong> | |
| 101 | - if owner { | |
| 102 | - reveal(label: g::t(lang, K::AddMemberButton), id: Some("add-member"), | |
| 103 | - <form method="post" action=(add_action.as_str()) class="fields"> | |
| 104 | - <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 105 | - <div class="field"> | |
| 106 | - <label for="add-member-username">(g::t(lang, K::Username))</label> | |
| 107 | - <input id="add-member-username" type="text" name="username" autocomplete="off" spellcheck="false" required=(true)> | |
| 108 | - </div> | |
| 109 | - <div class="field"> | |
| 110 | - <label for="add-member-role">(g::t(lang, K::Role))</label> | |
| 111 | - <select id="add-member-role" name="role"> | |
| 112 | - <option value="member" selected=(true)>(g::t(lang, K::RoleMember))</option> | |
| 113 | - <option value="owner">(g::t(lang, K::RoleOwner))</option> | |
| 114 | - </select> | |
| 115 | - </div> | |
| 116 | - <button type="submit" class="primary">(g::t(lang, K::AddMemberButton))</button> | |
| 117 | - </form> | |
| 118 | - ) | |
| 119 | - } | |
| 120 | - </div> | |
| 121 | - if owner { | |
| 122 | - <p class="hint">(g::t(lang, K::OwnersHelp))</p> | |
| 123 | - } | |
| 124 | - for row in rows.iter() { | |
| 125 | - if owner || row.is_self { | |
| 126 | - <details class="row-open"> | |
| 127 | - <summary class="line" data-kb-row=""> | |
| 128 | - <span class="name org-who"> | |
| 129 | - <img class="avatar avatar-sm" src=(row.avatar.as_str()) alt="" width="24" height="24"> | |
| 130 | - <span>(row.label.as_str())</span> | |
| 131 | - </span> | |
| 132 | - <span class="val">(if row.is_owner { g::t(lang, K::RoleOwner) } else { g::t(lang, K::RoleMember) })</span> | |
| 133 | - </summary> | |
| 134 | - <div class="opened"> | |
| 135 | - if owner { | |
| 136 | - <form method="post" action=(role_action.as_str()) class="fields"> | |
| 137 | - <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 138 | - <input type="hidden" name="user_id" value=(row.user_id.as_str())> | |
| 139 | - <div class="field"> | |
| 140 | - <label for=(format!("role-{}", row.user_id))>(g::t(lang, K::Role))</label> | |
| 141 | - <select id=(format!("role-{}", row.user_id)) name="role"> | |
| 142 | - <option value="owner" selected=(row.is_owner)>(g::t(lang, K::RoleOwner))</option> | |
| 143 | - <option value="member" selected=(!row.is_owner)>(g::t(lang, K::RoleMember))</option> | |
| 144 | - </select> | |
| 145 | - </div> | |
| 146 | - <button type="submit" class="primary small">(g::t(lang, K::Save))</button> | |
| 147 | - </form> | |
| 148 | - } | |
| 149 | - <div class="acts"> | |
| 150 | - <a class="act" href=(format!("/{}", row.username.as_str()))>(passkeys::s(lang, "Open profile", "Profili aç"))</a> | |
| 151 | - confirm_act(lang: lang, label: g::t(lang, if row.is_self { K::Leave } else { K::Remove }), action: remove_action.as_str(), csrf: csrf.as_str(), fields: vec![("user_id".to_owned(), row.user_id.clone())]) | |
| 152 | - </div> | |
| 153 | - </div> | |
| 154 | - </details> | |
| 155 | - } else { | |
| 156 | - <a class="line" href=(format!("/{}", row.username.as_str())) data-kb-row=""> | |
| 157 | - <span class="name org-who"> | |
| 158 | - <img class="avatar avatar-sm" src=(row.avatar.as_str()) alt="" width="24" height="24"> | |
| 159 | - <span>(row.label.as_str())</span> | |
| 160 | - </span> | |
| 161 | - <span class="val">(if row.is_owner { g::t(lang, K::RoleOwner) } else { g::t(lang, K::RoleMember) })</span> | |
| 162 | - </a> | |
| 163 | - } | |
| 164 | - } | |
| 110 | + people_list(list: list) | |
| 165 | 111 | </div> |
| 166 | 112 | }) |
| 167 | 113 | } |
| @@ -174,15 +120,21 @@ async fn org_members_page(cx: &Cx) -> Result<impl View> { | ||
| 174 | 120 | let lang = i18n::lang(cx, Some(&ctx.viewer.0)); |
| 175 | 121 | let state = app_context::<AppState>(cx); |
| 176 | 122 | let members = state.store.org_members(&ctx.org.id).await?; |
| 177 | - let rows: Vec<MemberRow> = members | |
| 123 | + let rows: Vec<PersonRow> = members | |
| 178 | 124 | .into_iter() |
| 179 | - .map(|(user, role)| MemberRow { | |
| 180 | - is_self: user.id == ctx.viewer.0.id, | |
| 181 | - user_id: user.id.clone(), | |
| 182 | - avatar: avatar_url(&user.username, user.avatar_hash.as_deref()), | |
| 183 | - label: display_name(lang, &user.username), | |
| 184 | - username: user.username, | |
| 185 | - is_owner: role == OrgMemberRole::Owner, | |
| 125 | + .map(|(user, role)| { | |
| 126 | + let is_owner = role == OrgMemberRole::Owner; | |
| 127 | + let is_self = user.id == ctx.viewer.0.id; | |
| 128 | + PersonRow { | |
| 129 | + is_self, | |
| 130 | + user_id: user.id.clone(), | |
| 131 | + avatar: avatar_url(&user.username, user.avatar_hash.as_deref()), | |
| 132 | + label: display_name(lang, &user.username), | |
| 133 | + username: user.username, | |
| 134 | + role: if is_owner { "owner" } else { "member" }.to_owned(), | |
| 135 | + role_name: g::t(lang, if is_owner { K::RoleOwner } else { K::RoleMember }).to_owned(), | |
| 136 | + remove_label: g::t(lang, if is_self { K::Leave } else { K::Remove }).to_owned(), | |
| 137 | + } | |
| 186 | 138 | }) |
| 187 | 139 | .collect(); |
| 188 | 140 | let owner = ctx.is_owner(); |
crates/forge-web/src/pages/org_new.rsmodified+2 -2
| @@ -18,7 +18,7 @@ use crate::i18n::orgs::{self as g, K}; | ||
| 18 | 18 | use crate::i18n::{self, Lang}; |
| 19 | 19 | use crate::live::Topic; |
| 20 | 20 | use crate::state::AppState; |
| 21 | -use crate::views::parts::{SubPart, head}; | |
| 21 | +use crate::views::parts::head; | |
| 22 | 22 | use crate::views::{alert, csrf_field, shell, user_facing_message}; |
| 23 | 23 | |
| 24 | 24 | const MAX_DESCRIPTION_CHARS: usize = 2000; |
| @@ -51,7 +51,7 @@ async fn new_org_form( | ||
| 51 | 51 | username: String, |
| 52 | 52 | ) -> Result<impl View> { |
| 53 | 53 | Ok(view! { |
| 54 | - head(title: g::t(lang, K::NewOrganization), sub: vec![SubPart::text(g::t(lang, K::NewOrgIntro))]) | |
| 54 | + head(title: g::t(lang, K::NewOrganization), sub: Vec::new()) | |
| 55 | 55 | crate::pages::profile::own_profile_tabs(lang: lang, username: username, current: "organizations".to_owned()) |
| 56 | 56 | <div class="sheet fit"> |
| 57 | 57 | if let Some(message) = error { |
crates/forge-web/src/pages/org_settings.rsmodified+0 -3
| @@ -114,7 +114,6 @@ async fn settings_body( | ||
| 114 | 114 | <option value=(*choice) selected=(*choice == default_role.as_str())>(g::role_name(lang, choice))</option> |
| 115 | 115 | } |
| 116 | 116 | </select> |
| 117 | - <p class="hint">(g::t(lang, K::DefaultRoleHelp))</p> | |
| 118 | 117 | </div> |
| 119 | 118 | <label class="switch"> |
| 120 | 119 | <input type="checkbox" name="members_can_create" value="on" checked=(members_can_create)> |
| @@ -128,7 +127,6 @@ async fn settings_body( | ||
| 128 | 127 | <section class="sec"> |
| 129 | 128 | <h2>(t(lang, Key::Avatar))</h2> |
| 130 | 129 | <img class="avatar profile-settings-avatar-img" src=(avatar_src.as_str()) alt=(t(lang, Key::AvatarAlt)) width="40" height="40"> |
| 131 | - <p class="hint">(t(lang, Key::AvatarHint))</p> | |
| 132 | 130 | <div class="acts"> |
| 133 | 131 | reveal(label: t(lang, Key::UploadPhoto), id: Some("org-avatar"), |
| 134 | 132 | <form method="post" action=(avatar_action.as_str()) enctype="multipart/form-data" class="fields"> |
| @@ -147,7 +145,6 @@ async fn settings_body( | ||
| 147 | 145 | </section> |
| 148 | 146 | <section class="sec"> |
| 149 | 147 | <h2>(g::t(lang, K::DeleteOrg))</h2> |
| 150 | - <p class="hint">(g::t(lang, K::DeleteOrgIntro))</p> | |
| 151 | 148 | <div class="acts"> |
| 152 | 149 | <details class="reveal"> |
| 153 | 150 | <summary class="act danger">(g::t(lang, K::DeleteOrg))</summary> |
crates/forge-web/src/pages/org_teams.rsmodified+0 -1
| @@ -237,7 +237,6 @@ async fn teams_body( | ||
| 237 | 237 | ) |
| 238 | 238 | } |
| 239 | 239 | </div> |
| 240 | - <p class="hint">(g::t(lang, K::TeamsIntro))</p> | |
| 241 | 240 | if rows.is_empty() { |
| 242 | 241 | <p class="state">(g::t(lang, K::NoTeamsYet))</p> |
| 243 | 242 | } |
crates/forge-web/src/pages/packages.rsmodified+0 -1
| @@ -334,7 +334,6 @@ async fn package_view(page: PackagePage) -> Result<impl View> { | ||
| 334 | 334 | <p>(description.as_str())</p> |
| 335 | 335 | } |
| 336 | 336 | <h2>(install)</h2> |
| 337 | - <p class="hint">(pk::t(lang, K::InstallHelp))</p> | |
| 338 | 337 | <p class="hint">(pk::t(lang, K::InstallRegistryConfig))</p> |
| 339 | 338 | <div class="copy-box"> |
| 340 | 339 | <code id="pkg-config">(config_block.as_str())</code> |
crates/forge-web/src/pages/packages_oci.rsmodified+1 -3
| @@ -127,7 +127,6 @@ pub async fn oci_package_view(page: OciPage) -> Result<impl View> { | ||
| 127 | 127 | <div class="sheet"> |
| 128 | 128 | <section class="sec"> |
| 129 | 129 | <h2>(pk::t(lang, K::Install))</h2> |
| 130 | - <p class="hint">(pk::t(lang, K::ContainerInstallHelp))</p> | |
| 131 | 130 | <p class="state">(pk::t(lang, K::ContainerLogin))</p> |
| 132 | 131 | <div class="copy-box"> |
| 133 | 132 | <code id="oci-login">(login.as_str())</code> |
| @@ -156,8 +155,7 @@ pub async fn oci_package_view(page: OciPage) -> Result<impl View> { | ||
| 156 | 155 | <span class="val"><code>(short.as_str())</code> " · " (size.as_str()) " · " rel_time(lang: lang, stamp: created.as_str()) " · " <code>(full.as_str())</code></span> |
| 157 | 156 | if can_delete { |
| 158 | 157 | confirm_act(lang: lang, label: pk::t(lang, K::DeleteTag), action: delete_action.as_str(), csrf: csrf.as_str(), |
| 159 | - fields: vec![("package".to_owned(), package.name.clone()), ("tag".to_owned(), tag.clone())], | |
| 160 | - note: Some(pk::t(lang, K::DeleteTagMessage).to_owned())) | |
| 158 | + fields: vec![("package".to_owned(), package.name.clone()), ("tag".to_owned(), tag.clone())]) | |
| 161 | 159 | } |
| 162 | 160 | </div> |
| 163 | 161 | } |
crates/forge-web/src/pages/palette.rsmodified+41 -15
| @@ -318,12 +318,13 @@ fn repo_pages(lang: Lang) -> Vec<Value> { | ||
| 318 | 318 | "settings", |
| 319 | 319 | true, |
| 320 | 320 | &[ |
| 321 | - "Visibility", | |
| 322 | - "Görünürlük", | |
| 323 | - "Archive", | |
| 324 | - "Arşiv", | |
| 325 | 321 | "Description", |
| 326 | 322 | "Açıklama", |
| 323 | + "Features", | |
| 324 | + "Özellikler", | |
| 325 | + "Wiki", | |
| 326 | + "Discussions", | |
| 327 | + "Tartışmalar", | |
| 327 | 328 | ], |
| 328 | 329 | ), |
| 329 | 330 | repo_page( |
| @@ -338,12 +339,6 @@ fn repo_pages(lang: Lang) -> Vec<Value> { | ||
| 338 | 339 | true, |
| 339 | 340 | &["Access", "Erişim", "Members"], |
| 340 | 341 | ), |
| 341 | - repo_page( | |
| 342 | - admin(RK::RenameTransferNav), | |
| 343 | - "settings/rename", | |
| 344 | - true, | |
| 345 | - &["Rename", "Transfer"], | |
| 346 | - ), | |
| 347 | 342 | repo_page(admin(RK::Webhooks), "settings/hooks", true, &["Hooks"]), |
| 348 | 343 | repo_page( |
| 349 | 344 | admin(RK::Mirrors), |
| @@ -357,12 +352,20 @@ fn repo_pages(lang: Lang) -> Vec<Value> { | ||
| 357 | 352 | true, |
| 358 | 353 | &["Variables", "Env"], |
| 359 | 354 | ), |
| 360 | - repo_page(code(CK::TabWiki), "settings/wiki", true, &[]), | |
| 361 | 355 | repo_page( |
| 362 | 356 | admin(RK::DangerZone), |
| 363 | 357 | "settings?section=danger", |
| 364 | 358 | true, |
| 365 | - &["Delete repository", "Depoyu sil"], | |
| 359 | + &[ | |
| 360 | + "Rename", | |
| 361 | + "Transfer", | |
| 362 | + "Visibility", | |
| 363 | + "Görünürlük", | |
| 364 | + "Archive", | |
| 365 | + "Arşiv", | |
| 366 | + "Delete repository", | |
| 367 | + "Depoyu sil", | |
| 368 | + ], | |
| 366 | 369 | ), |
| 367 | 370 | ] |
| 368 | 371 | } |
| @@ -445,6 +448,25 @@ async fn palette(cx: &Cx) -> Result<Response> { | ||
| 445 | 448 | let terms = terms_for(ADMIN_TERMS, &item.href); |
| 446 | 449 | push_terms(&mut items, &mut seen, &label, &item.href, "page", terms); |
| 447 | 450 | } |
| 451 | + // The rail pages of Users and Backups: their tabs are the ones above. | |
| 452 | + let users = crate::i18n::admin::t(lang, crate::i18n::admin::K::Users); | |
| 453 | + let backups = crate::i18n::admin::t(lang, crate::i18n::admin::K::Backups); | |
| 454 | + for (tab, rail_page, href) in [ | |
| 455 | + ( | |
| 456 | + users, | |
| 457 | + crate::i18n::admin::t(lang, crate::i18n::admin::K::Invites), | |
| 458 | + "/admin/invites", | |
| 459 | + ), | |
| 460 | + ( | |
| 461 | + backups, | |
| 462 | + crate::i18n::admin::t(lang, crate::i18n::admin::K::Replication), | |
| 463 | + "/admin/replication", | |
| 464 | + ), | |
| 465 | + ] { | |
| 466 | + let label = format!("{admin_area} \u{b7} {tab} \u{b7} {rail_page}"); | |
| 467 | + let terms = terms_for(ADMIN_TERMS, href); | |
| 468 | + push_terms(&mut items, &mut seen, &label, href, "page", terms); | |
| 469 | + } | |
| 448 | 470 | let queue = format!( |
| 449 | 471 | "{admin_area} \u{b7} {}", |
| 450 | 472 | s(lang, "Mail queue", "E-posta kuyruğu") |
| @@ -467,9 +489,13 @@ async fn palette(cx: &Cx) -> Result<Response> { | ||
| 467 | 489 | (Lang::Tr, Some((tr, _))) => tr, |
| 468 | 490 | _ => field.label, |
| 469 | 491 | }; |
| 470 | - let page = page_of(field.key); | |
| 471 | - let label = format!("{server} \u{b7} {} \u{b7} {name}", page.label(lang)); | |
| 472 | - let href = format!("/admin/server?cat={}#srv-{}", page.slug, field.key); | |
| 492 | + let home = page_of(lang, field.key); | |
| 493 | + let label = if home.server { | |
| 494 | + format!("{server} \u{b7} {} \u{b7} {name}", home.label) | |
| 495 | + } else { | |
| 496 | + format!("{} \u{b7} {name}", home.label) | |
| 497 | + }; | |
| 498 | + let href = home.href; | |
| 473 | 499 | let terms = [field.key, field.label]; |
| 474 | 500 | push_terms(&mut items, &mut seen, &label, &href, "page", &terms); |
| 475 | 501 | } |
crates/forge-web/src/pages/passkeys.rsmodified+1 -3
| @@ -675,8 +675,6 @@ pub async fn passkeys_panel(lang: Lang, csrf: &str, panel: PasskeyPanel) -> Resu | ||
| 675 | 675 | } |
| 676 | 676 | if let Some(text) = problem_text { |
| 677 | 677 | <p class="hint topic-warn">(text)</p> |
| 678 | - } else { | |
| 679 | - <p class="hint">(s(lang, "Sign in with your fingerprint, face or device PIN. A passkey counts as two factors, so it skips the code step.", "Parmak izi, yüz veya cihaz PIN'inizle giriş yapın. Geçiş anahtarı iki doğrulama sayılır, bu yüzden kod adımı atlanır."))</p> | |
| 680 | 678 | } |
| 681 | 679 | for (item, rename_action, delete_action, field) in rows.into_iter() { |
| 682 | 680 | <details class="row-open"> |
| @@ -696,7 +694,7 @@ pub async fn passkeys_panel(lang: Lang, csrf: &str, panel: PasskeyPanel) -> Resu | ||
| 696 | 694 | <button type="submit" class="primary">(t(lang, Key::Save))</button> |
| 697 | 695 | </form> |
| 698 | 696 | ) |
| 699 | - confirm_act(lang: lang, label: t(lang, Key::Delete), action: delete_action.as_str(), csrf: csrf, note: Some(s(lang, "Delete this passkey? You can no longer sign in with it.", "Bu geçiş anahtarı silinsin mi? Artık onunla giriş yapamazsınız.").to_owned())) | |
| 697 | + confirm_act(lang: lang, label: t(lang, Key::Delete), action: delete_action.as_str(), csrf: csrf) | |
| 700 | 698 | </div> |
| 701 | 699 | </div> |
| 702 | 700 | </details> |
crates/forge-web/src/pages/passkeys_tests.rsmodified+0 -1
| @@ -589,7 +589,6 @@ async fn passkey_pages_show_the_ui_and_admins_remove_all_passkeys() { | ||
| 589 | 589 | passkeys[0].id |
| 590 | 590 | ); |
| 591 | 591 | assert!(page.body.contains(&delete_action)); |
| 592 | - assert!(page.body.contains("Delete this passkey?")); | |
| 593 | 592 | let login = send(&fx.router, "GET", "/login", None, &[]).await; |
| 594 | 593 | assert!(login.body.contains("data-passkey-signin")); |
| 595 | 594 | assert!(login.body.contains("autocomplete=\"username webauthn\"")); |
crates/forge-web/src/pages/profile.rsmodified+1 -2
| @@ -771,7 +771,7 @@ async fn profile_card( | ||
| 771 | 771 | if let Some(summary) = org { |
| 772 | 772 | <section class="sec profile-org"> |
| 773 | 773 | <h2>(g::t(lang, K::Members))</h2> |
| 774 | - <p class="hint">(g::members_and_teams(lang, summary.total, summary.teams))</p> | |
| 774 | + <p class="state">(g::members_and_teams(lang, summary.total, summary.teams))</p> | |
| 775 | 775 | if summary.members.is_empty() { |
| 776 | 776 | <p class="state">(g::t(lang, K::NoMembers))</p> |
| 777 | 777 | } else { |
| @@ -816,7 +816,6 @@ async fn profile_card( | ||
| 816 | 816 | if packages_on { |
| 817 | 817 | <section class="sec package-listing" data-live=(packages_events.as_str())> |
| 818 | 818 | <h2>(pk::t(lang, PK::PackagesHeading))</h2> |
| 819 | - <p class="hint">(pk::t(lang, PK::PackagesHelp))</p> | |
| 820 | 819 | if has_packages { |
| 821 | 820 | for row in package_rows.into_iter() { |
| 822 | 821 | <div class="line" data-kb-row=""> |
crates/forge-web/src/pages/profile_pins.rsmodified+0 -1
| @@ -70,7 +70,6 @@ pub(crate) async fn pins_menu( | ||
| 70 | 70 | <summary class="act">(g::t(lang, K::CustomizePins))</summary> |
| 71 | 71 | <form method="post" action=(action.as_str()) class="menu-list"> |
| 72 | 72 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 73 | - <p class="hint">(g::t(lang, K::PinsIntro))</p> | |
| 74 | 73 | <ul class="pin-options"> |
| 75 | 74 | for option in options.into_iter() { |
| 76 | 75 | <li> |
crates/forge-web/src/pages/pull_files.rsmodified+5 -14
| @@ -214,12 +214,11 @@ async fn files_rail( | ||
| 214 | 214 | ) -> Result<impl View> { |
| 215 | 215 | let mark = g::t(lang, K::ViewedMark); |
| 216 | 216 | let changed = g::t(lang, K::ChangedSinceViewed); |
| 217 | - let hint = g::t(lang, K::ViewedHint); | |
| 218 | 217 | let viewed_files = g::t(lang, K::ViewedFiles); |
| 219 | 218 | let heading = passkeys::s(lang, "Files", "Dosyalar"); |
| 220 | 219 | Ok(view! { |
| 221 | 220 | <nav class="rail" aria-label=(viewed_files)> |
| 222 | - <h2>(heading) " " <span title=(hint)>(done_text.as_str())</span></h2> | |
| 221 | + <h2>(heading) " " <span>(done_text.as_str())</span></h2> | |
| 223 | 222 | <div class="rail-list"> |
| 224 | 223 | for file in rows.into_iter() { |
| 225 | 224 | <div class=(file.class.as_str()) data-viewed-row="" data-state=(file.state.name()) data-label=(file.label.as_str())> |
| @@ -359,15 +358,7 @@ async fn review_bar( | ||
| 359 | 358 | let comment = g::t(lang, K::CommentChoice).trim(); |
| 360 | 359 | let approve = review_strings::t(lang, review_strings::K::ApproveChoice).trim(); |
| 361 | 360 | let changes = review_strings::t(lang, review_strings::K::RequestChangesChoice).trim(); |
| 362 | - let placeholder = passkeys::s(lang, "Optional", "İsteğe bağlı"); | |
| 363 | 361 | let next_text = passkeys::s(lang, "Next file", "Sonraki dosya"); |
| 364 | - let approve_hint = passkeys::s(lang, "Ready to merge", "Birleştirmeye hazır"); | |
| 365 | - let changes_hint = passkeys::s( | |
| 366 | - lang, | |
| 367 | - "Blocks the merge until you approve", | |
| 368 | - "Siz onaylayana kadar birleştirmeyi engeller", | |
| 369 | - ); | |
| 370 | - let comment_hint = passkeys::s(lang, "No decision", "Karar yok"); | |
| 371 | 362 | let threads_text = match lang { |
| 372 | 363 | Lang::Tr => format!("{open_threads} açık konu"), |
| 373 | 364 | Lang::En if open_threads == 1 => "1 open thread".to_owned(), |
| @@ -388,14 +379,14 @@ async fn review_bar( | ||
| 388 | 379 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 389 | 380 | <div class="field"> |
| 390 | 381 | <label for="review-body">(summary)</label> |
| 391 | - <textarea id="review-body" name="body" rows="3" placeholder=(placeholder)></textarea> | |
| 382 | + <textarea id="review-body" name="body" rows="3"></textarea> | |
| 392 | 383 | </div> |
| 393 | 384 | // An author cannot approve or block their own pull, so they only comment. |
| 394 | 385 | if !is_author { |
| 395 | - <label class="opt"><input type="radio" name="state" value="approve"><span>(approve)<small>(approve_hint)</small></span></label> | |
| 396 | - <label class="opt"><input type="radio" name="state" value="request_changes"><span>(changes)<small>(changes_hint)</small></span></label> | |
| 386 | + <label class="opt"><input type="radio" name="state" value="approve"><span>(approve)</span></label> | |
| 387 | + <label class="opt"><input type="radio" name="state" value="request_changes"><span>(changes)</span></label> | |
| 397 | 388 | } |
| 398 | - <label class="opt"><input type="radio" name="state" value="comment" checked=(true)><span>(comment)<small>(comment_hint)</small></span></label> | |
| 389 | + <label class="opt"><input type="radio" name="state" value="comment" checked=(true)><span>(comment)</span></label> | |
| 399 | 390 | <div class="acts decide-send"> |
| 400 | 391 | <button type="submit" class="primary">(submit)</button> |
| 401 | 392 | <span class="hint">(pending_text.as_str())</span> |
crates/forge-web/src/pages/pull_view.rsmodified+46 -56
| @@ -17,7 +17,7 @@ use topcoat::router::content::Form; | ||
| 17 | 17 | use topcoat::router::error::{not_found, see_other}; |
| 18 | 18 | use topcoat::router::request::uri; |
| 19 | 19 | use topcoat::router::{page, path_param}; |
| 20 | -use topcoat::view::{View, component, view}; | |
| 20 | +use topcoat::view::{Child, View, component, view}; | |
| 21 | 21 | |
| 22 | 22 | use crate::auth::require_user; |
| 23 | 23 | use crate::i18n::pulls_review::{self as g, K}; |
| @@ -26,8 +26,8 @@ use crate::pages::commits::{CommitRow, now_secs}; | ||
| 26 | 26 | use crate::pages::issue_meta::item_href; |
| 27 | 27 | use crate::pages::issue_parts::{ |
| 28 | 28 | CommentForm, ItemKind, Posted, When, check_write, comment_form, csrf_of, discussion_timeline, |
| 29 | - item_sidebar, load_discussion, load_sidebar, lock_message, may_change, may_converse, | |
| 30 | - parse_number, post_comment, reachable_among, triage, viewer, | |
| 29 | + item_head_tools, item_sidebar, load_discussion, load_sidebar, lock_message, may_change, | |
| 30 | + may_converse, parse_number, post_comment, reachable_among, triage, viewer, | |
| 31 | 31 | }; |
| 32 | 32 | use crate::pages::notifications::notify_box_for; |
| 33 | 33 | use crate::pages::pull_branch::{self, branch_box, branch_error_from}; |
| @@ -191,7 +191,11 @@ pub(crate) async fn frame_in( | ||
| 191 | 191 | /// The head of every pull request tab: the title with the review buttons beside it, the byline, |
| 192 | 192 | /// then the pull request's tabs. `active` names the tab that is open. |
| 193 | 193 | #[component] |
| 194 | -pub(crate) async fn pull_header(frame: Frame, active: String) -> Result<impl View> { | |
| 194 | +pub(crate) async fn pull_header( | |
| 195 | + frame: Frame, | |
| 196 | + active: String, | |
| 197 | + #[default] child: Child<'_>, | |
| 198 | +) -> Result<impl View> { | |
| 195 | 199 | let Frame { |
| 196 | 200 | title, |
| 197 | 201 | number, |
| @@ -235,6 +239,7 @@ pub(crate) async fn pull_header(frame: Frame, active: String) -> Result<impl Vie | ||
| 235 | 239 | <section class="head" data-live=(live_url.as_str())> |
| 236 | 240 | <div class="head-title"> |
| 237 | 241 | <h1>(title.as_str()) " " <span class="num">(number_label.as_str())</span></h1> |
| 242 | + (child) | |
| 238 | 243 | </div> |
| 239 | 244 | <p class="head-sub"> |
| 240 | 245 | <span class=(state_class)>(state_text)</span> |
| @@ -315,7 +320,6 @@ async fn merge_box( | ||
| 315 | 320 | headline: String, |
| 316 | 321 | tone: String, |
| 317 | 322 | conflicts: Vec<String>, |
| 318 | - reload: Option<String>, | |
| 319 | 323 | form: Option<MergeForm>, |
| 320 | 324 | merge_error: Option<String>, |
| 321 | 325 | approvals: Option<String>, |
| @@ -326,13 +330,11 @@ async fn merge_box( | ||
| 326 | 330 | lang: Lang, |
| 327 | 331 | ) -> Result<impl View> { |
| 328 | 332 | let class = format!("sec merge-{tone}"); |
| 329 | - let heading = crate::pages::passkeys::s(lang, "Merge", "Birleştirme"); | |
| 330 | 333 | let required_heading = g::t(lang, K::RequiredChecksHeading); |
| 331 | 334 | let style_rebase = g::t(lang, K::StyleRebase); |
| 332 | 335 | let style_merge_option = g::t(lang, K::StyleMergeCommit); |
| 333 | 336 | let style_squash_option = g::t(lang, K::StyleSquash); |
| 334 | 337 | let enable_auto = g::t(lang, K::EnableAutoMerge); |
| 335 | - let auto_hint = g::t(lang, K::AutoMergeHint); | |
| 336 | 338 | let disable_auto = g::t(lang, K::DisableAutoMerge); |
| 337 | 339 | let FlowView { |
| 338 | 340 | csrf: flow_csrf, |
| @@ -346,8 +348,6 @@ async fn merge_box( | ||
| 346 | 348 | crate::i18n::merge_queue::t(lang, crate::i18n::merge_queue::K::AddToMergeQueue); |
| 347 | 349 | let queue_remove_label = |
| 348 | 350 | crate::i18n::merge_queue::t(lang, crate::i18n::merge_queue::K::RemoveFromQueue); |
| 349 | - let queue_hint = crate::i18n::merge_queue::t(lang, crate::i18n::merge_queue::K::MergeQueueHint); | |
| 350 | - let reload_text = g::t(lang, K::ReloadToCheck); | |
| 351 | 351 | let style_legend = g::t(lang, K::MergeStyleLegend); |
| 352 | 352 | let style_merge = g::t(lang, K::StyleMergeCommit); |
| 353 | 353 | let style_squash = g::t(lang, K::StyleSquash); |
| @@ -356,27 +356,28 @@ async fn merge_box( | ||
| 356 | 356 | let merge_button = g::t(lang, K::MergeButton); |
| 357 | 357 | Ok(view! { |
| 358 | 358 | <section class=(class.as_str())> |
| 359 | - <h2>(heading)</h2> | |
| 360 | 359 | if let Some(text) = merge_error { |
| 361 | 360 | <p class="alert merge-error" role="alert">(text.as_str())</p> |
| 362 | 361 | } |
| 363 | - <p class="state merge-headline">(headline.as_str())</p> | |
| 364 | - if let Some(summary) = checks { | |
| 365 | - checks_summary(summary: summary, lang: StatusLang(lang)) | |
| 366 | - } | |
| 362 | + <div class="line merge-state"> | |
| 363 | + <span class="val merge-headline">(headline.as_str())</span> | |
| 364 | + if let Some(summary) = checks { | |
| 365 | + checks_summary(summary: summary, lang: StatusLang(lang)) | |
| 366 | + } | |
| 367 | + </div> | |
| 367 | 368 | if !required.is_empty() { |
| 368 | 369 | <div> |
| 369 | - <p class="hint">(required_heading)</p> | |
| 370 | + <p class="state">(required_heading)</p> | |
| 370 | 371 | for row in required.iter() { |
| 371 | 372 | <div class=(format!("line {}", row.class))><span class="name"><code>(row.context.as_str())</code></span><span class="val">(row.label)</span></div> |
| 372 | 373 | } |
| 373 | 374 | </div> |
| 374 | 375 | } |
| 375 | 376 | if let Some(text) = approvals { |
| 376 | - <p class="hint">(text.as_str())</p> | |
| 377 | + <p class="state">(text.as_str())</p> | |
| 377 | 378 | } |
| 378 | 379 | if let Some(text) = blocked { |
| 379 | - <p class="hint merge-blocked">(text.as_str())</p> | |
| 380 | + <p class="state merge-blocked">(text.as_str())</p> | |
| 380 | 381 | } |
| 381 | 382 | if !conflicts.is_empty() { |
| 382 | 383 | <div> |
| @@ -385,11 +386,6 @@ async fn merge_box( | ||
| 385 | 386 | } |
| 386 | 387 | </div> |
| 387 | 388 | } |
| 388 | - if let Some(href) = reload { | |
| 389 | - <div class="acts"> | |
| 390 | - <a class="act" href=(href.as_str())>(reload_text)</a> | |
| 391 | - </div> | |
| 392 | - } | |
| 393 | 389 | if let Some(f) = form { |
| 394 | 390 | <form method="post" action=(f.action.as_str()) class="fields merge-form"> |
| 395 | 391 | <input type="hidden" name="csrf" value=(f.csrf.as_str())> |
| @@ -413,15 +409,14 @@ async fn merge_box( | ||
| 413 | 409 | </form> |
| 414 | 410 | } |
| 415 | 411 | if let Some((text, action)) = queue_position { |
| 416 | - <p class="state">(text.as_str())</p> | |
| 417 | - <div class="acts"> | |
| 412 | + <div class="line"> | |
| 413 | + <span class="val">(text.as_str())</span> | |
| 418 | 414 | confirm_act(lang: lang, label: queue_remove_label, action: action.as_str(), csrf: flow_csrf.as_str()) |
| 419 | 415 | </div> |
| 420 | 416 | } |
| 421 | 417 | if let Some(action) = queue_add { |
| 422 | 418 | <form method="post" action=(action.as_str()) class="fields"> |
| 423 | 419 | <input type="hidden" name="csrf" value=(flow_csrf.as_str())> |
| 424 | - <p class="hint">(queue_hint)</p> | |
| 425 | 420 | <div class="field"> |
| 426 | 421 | <label for="queue-style">(queue_add_label)</label> |
| 427 | 422 | <select id="queue-style" name="style"> |
| @@ -434,15 +429,14 @@ async fn merge_box( | ||
| 434 | 429 | </form> |
| 435 | 430 | } |
| 436 | 431 | if let Some((text, action)) = auto_on { |
| 437 | - <p class="state">(text.as_str())</p> | |
| 438 | - <div class="acts"> | |
| 432 | + <div class="line"> | |
| 433 | + <span class="val">(text.as_str())</span> | |
| 439 | 434 | post_act(label: disable_auto, action: action.as_str(), csrf: flow_csrf.as_str()) |
| 440 | 435 | </div> |
| 441 | 436 | } |
| 442 | 437 | if let Some(action) = auto_enable { |
| 443 | 438 | <form method="post" action=(action.as_str()) class="fields"> |
| 444 | 439 | <input type="hidden" name="csrf" value=(flow_csrf.as_str())> |
| 445 | - <p class="hint">(auto_hint)</p> | |
| 446 | 440 | <div class="field"> |
| 447 | 441 | <label for="auto-style">(enable_auto)</label> |
| 448 | 442 | <select id="auto-style" name="style"> |
| @@ -455,7 +449,7 @@ async fn merge_box( | ||
| 455 | 449 | </form> |
| 456 | 450 | } |
| 457 | 451 | if let Some((action, label)) = draft_toggle { |
| 458 | - <div class="acts"> | |
| 452 | + <div class="line"> | |
| 459 | 453 | post_act(label: label, action: action.as_str(), csrf: flow_csrf.as_str()) |
| 460 | 454 | </div> |
| 461 | 455 | } |
| @@ -524,7 +518,7 @@ async fn review_box( | ||
| 524 | 518 | <p class="state">(text.as_str())</p> |
| 525 | 519 | } |
| 526 | 520 | if let Some(text) = approved_before { |
| 527 | - <p class="hint">(text.as_str())</p> | |
| 521 | + <p class="state">(text.as_str())</p> | |
| 528 | 522 | } |
| 529 | 523 | if let Some(text) = changes { |
| 530 | 524 | <p class="state">(text.as_str())</p> |
| @@ -640,7 +634,7 @@ async fn pull_conversation( | ||
| 640 | 634 | .await?; |
| 641 | 635 | let sidebar = load_sidebar(state, &ctx.repo.id, &pr.issue).await?; |
| 642 | 636 | let viewer_login = ctx.viewer.as_ref().map(|(u, _)| u.username.clone()); |
| 643 | - let notify = notify_box_for(state, &ctx, lang, &pr.issue.id, &href).await?; | |
| 637 | + let notify = notify_box_for(state, &ctx, &pr.issue.id, &href).await?; | |
| 644 | 638 | let reviewers = load_reviewers(cx, state, &ctx, &pr.issue, &href).await?; |
| 645 | 639 | let csrf = csrf_of(&ctx); |
| 646 | 640 | let checks = head_checks(state, &ctx, &pr).await?; |
| @@ -655,32 +649,27 @@ async fn pull_conversation( | ||
| 655 | 649 | let write_meta = !archived && triage(&ctx); |
| 656 | 650 | let comment_action = format!("{href}/comments"); |
| 657 | 651 | let state_action = format!("{href}/state"); |
| 652 | + // Close, or Reopen when closed, in the head, for whoever may comment and may close. | |
| 653 | + let close = (can_comment && can_close).then(|| (open, state_action.clone())); | |
| 658 | 654 | let login_href = "/login".to_owned(); |
| 659 | 655 | let archived_text = g::t(lang, K::ArchivedReadOnly); |
| 660 | 656 | let login_before = g::t(lang, K::LoginBefore); |
| 661 | 657 | let login_link = g::t(lang, K::LoginLink); |
| 662 | 658 | let login_after = g::t(lang, K::LoginAfter); |
| 663 | 659 | |
| 664 | - let (headline, tone, conflicts, reload) = match pr.mergeable { | |
| 665 | - Mergeable::Clean => (g::t(lang, K::MergeClean).to_owned(), "ok", Vec::new(), None), | |
| 660 | + // A result still being computed arrives on the page's live stream (`refresh_mergeability` | |
| 661 | + // bumps the pull), so the state line updates by itself and needs no reload control. | |
| 662 | + let (headline, tone, conflicts) = match pr.mergeable { | |
| 663 | + Mergeable::Clean => (g::t(lang, K::MergeClean).to_owned(), "ok", Vec::new()), | |
| 666 | 664 | Mergeable::Conflict => ( |
| 667 | 665 | g::t(lang, K::MergeConflict).to_owned(), |
| 668 | 666 | "bad", |
| 669 | 667 | pr.conflict_files.clone(), |
| 670 | - None, | |
| 671 | - ), | |
| 672 | - Mergeable::UpToDate => ( | |
| 673 | - g::t(lang, K::MergeUpToDate).to_owned(), | |
| 674 | - "muted", | |
| 675 | - Vec::new(), | |
| 676 | - None, | |
| 677 | - ), | |
| 678 | - Mergeable::Unknown | Mergeable::Merged => ( | |
| 679 | - g::t(lang, K::MergeChecking).to_owned(), | |
| 680 | - "muted", | |
| 681 | - Vec::new(), | |
| 682 | - Some(href.clone()), | |
| 683 | 668 | ), |
| 669 | + Mergeable::UpToDate => (g::t(lang, K::MergeUpToDate).to_owned(), "muted", Vec::new()), | |
| 670 | + Mergeable::Unknown | Mergeable::Merged => { | |
| 671 | + (g::t(lang, K::MergeChecking).to_owned(), "muted", Vec::new()) | |
| 672 | + } | |
| 684 | 673 | }; |
| 685 | 674 | let can_write = !archived |
| 686 | 675 | && authorize( |
| @@ -914,7 +903,9 @@ async fn pull_conversation( | ||
| 914 | 903 | let live = format!("{href}/events"); |
| 915 | 904 | Ok(view! { cx => |
| 916 | 905 | shell(title: page_title.as_str(), viewer: ctx.viewer.as_ref(), extra_stylesheet: Some(labels_href.as_str()), |
| 917 | - pull_header(frame: frame.clone(), active: "conversation".to_owned()) | |
| 906 | + pull_header(frame: frame.clone(), active: "conversation".to_owned(), | |
| 907 | + item_head_tools(lang: lang, close: close, notify: notify) | |
| 908 | + ) | |
| 918 | 909 | if let Some(message) = review_error { |
| 919 | 910 | alert(message: message) |
| 920 | 911 | } |
| @@ -926,7 +917,7 @@ async fn pull_conversation( | ||
| 926 | 917 | } |
| 927 | 918 | if open { |
| 928 | 919 | merge_box(headline: headline, tone: tone.to_owned(), conflicts: conflicts, |
| 929 | - reload: reload, form: merge_form, merge_error: merge_error, | |
| 920 | + form: merge_form, merge_error: merge_error, | |
| 930 | 921 | approvals: approvals, blocked: blocked, checks: checks, |
| 931 | 922 | required: required, flow: flow, lang: lang) |
| 932 | 923 | } |
| @@ -938,19 +929,18 @@ async fn pull_conversation( | ||
| 938 | 929 | branch_box(lang: lang, action: branch, error: branch_error) |
| 939 | 930 | } |
| 940 | 931 | if can_comment { |
| 941 | - comment_form(lang: lang, action: comment_action, state_action: state_action, | |
| 942 | - csrf: csrf.clone(), draft: draft, error: error, can_close: can_close, open: open) | |
| 932 | + comment_form(lang: lang, action: comment_action, csrf: csrf.clone(), draft: draft, error: error) | |
| 943 | 933 | } |
| 944 | 934 | // What the pull request is filed under comes after the conversation, as on an issue. |
| 945 | 935 | reviewers_box(lang: lang, reviewers: reviewers) |
| 946 | - item_sidebar(lang: lang, write: write_meta, base: href.clone(), csrf: csrf.clone(), viewer: viewer_login, sidebar: sidebar, notify: notify) | |
| 936 | + item_sidebar(lang: lang, write: write_meta, base: href.clone(), csrf: csrf.clone(), viewer: viewer_login, sidebar: sidebar, pin: None) | |
| 947 | 937 | if archived { |
| 948 | - <p class="hint">(archived_text)</p> | |
| 938 | + <p class="state">(archived_text)</p> | |
| 949 | 939 | } |
| 950 | 940 | if locked_for_viewer { |
| 951 | - <p class="hint">(lock_notice.as_str())</p> | |
| 941 | + <p class="state">(lock_notice.as_str())</p> | |
| 952 | 942 | } else if !signed_in { |
| 953 | - <p class="hint">(login_before)<a href=(login_href.as_str())>(login_link)</a>(login_after)</p> | |
| 943 | + <p class="state">(login_before)<a href=(login_href.as_str())>(login_link)</a>(login_after)</p> | |
| 954 | 944 | } |
| 955 | 945 | </div> |
| 956 | 946 | ) |
| @@ -1314,7 +1304,7 @@ mod tests { | ||
| 1314 | 1304 | assert!(body.contains("Add feature"), "clean: {body}"); |
| 1315 | 1305 | assert!(body.contains("issue-badge-open\">Open<"), "clean: {body}"); |
| 1316 | 1306 | assert!( |
| 1317 | - body.contains("This branch has no conflicts with the base branch"), | |
| 1307 | + body.contains("Ready to merge"), | |
| 1318 | 1308 | "clean: {body}" |
| 1319 | 1309 | ); |
| 1320 | 1310 | assert!( |
| @@ -1333,7 +1323,7 @@ mod tests { | ||
| 1333 | 1323 | let (status, _, body) = send(&fx.router, "GET", &uri, Some("bob-token"), None).await; |
| 1334 | 1324 | assert_eq!(status, 200, "reader"); |
| 1335 | 1325 | assert!( |
| 1336 | - body.contains("This branch has no conflicts with the base branch"), | |
| 1326 | + body.contains("Ready to merge"), | |
| 1337 | 1327 | "reader: {body}" |
| 1338 | 1328 | ); |
| 1339 | 1329 | assert!(!body.contains("name=\"style\""), "reader: {body}"); |
crates/forge-web/src/pages/pulls_list.rsmodified+1 -1
| @@ -333,7 +333,7 @@ async fn pulls_list_page(cx: &Cx) -> Result<impl View> { | ||
| 333 | 333 | </div> |
| 334 | 334 | </form> |
| 335 | 335 | if has_filters { |
| 336 | - <p class="hint">(g::t(lang, K::FiltersApplied)) " " <a class="act" href=(clear_href.as_str())>(g::t(lang, K::ClearFilters))</a></p> | |
| 336 | + <p class="state">(g::t(lang, K::FiltersApplied)) " " <a class="act" href=(clear_href.as_str())>(g::t(lang, K::ClearFilters))</a></p> | |
| 337 | 337 | } |
| 338 | 338 | if rows.is_empty() { |
| 339 | 339 | <p class="state">(empty_text)</p> |
crates/forge-web/src/pages/register.rsmodified+3 -13
| @@ -26,7 +26,7 @@ use crate::mail::account; | ||
| 26 | 26 | use crate::pages::settings_security::mail_can_send; |
| 27 | 27 | use crate::state::AppState; |
| 28 | 28 | use crate::throttle; |
| 29 | -use crate::views::parts::{SubPart, head}; | |
| 29 | +use crate::views::parts::head; | |
| 30 | 30 | use crate::views::{alert, shell, user_facing_message}; |
| 31 | 31 | |
| 32 | 32 | const MIN_PASSWORD_CHARS: usize = 12; |
| @@ -129,13 +129,8 @@ async fn register_form( | ||
| 129 | 129 | precsrf: &str, |
| 130 | 130 | error: Option<String>, |
| 131 | 131 | ) -> Result<impl View> { |
| 132 | - let sub = match (gate, invited) { | |
| 133 | - (Gate::Form, true) => vec![SubPart::text(t(lang, Key::RegisterInviteSub))], | |
| 134 | - (Gate::Form, false) => vec![SubPart::text(t(lang, Key::RegisterSub))], | |
| 135 | - _ => Vec::new(), | |
| 136 | - }; | |
| 137 | 132 | Ok(view! { |
| 138 | - head(title: t(lang, Key::RegisterTitle), sub: sub) | |
| 133 | + head(title: t(lang, Key::RegisterTitle)) | |
| 139 | 134 | <div class="sheet fit"> |
| 140 | 135 | if gate == Gate::NeedsInvite { |
| 141 | 136 | <p class="state">(t(lang, Key::RegisterNeedsInvite))</p> |
| @@ -353,13 +348,8 @@ async fn verify_body( | ||
| 353 | 348 | precsrf: &str, |
| 354 | 349 | mode: VerifyMode, |
| 355 | 350 | ) -> Result<impl View> { |
| 356 | - let sub = if mode == VerifyMode::Confirm { | |
| 357 | - vec![SubPart::text(t(lang, Key::VerifyConfirmSub))] | |
| 358 | - } else { | |
| 359 | - Vec::new() | |
| 360 | - }; | |
| 361 | 351 | Ok(view! { |
| 362 | - head(title: t(lang, Key::VerifyTitle), sub: sub) | |
| 352 | + head(title: t(lang, Key::VerifyTitle)) | |
| 363 | 353 | <div class="sheet fit"> |
| 364 | 354 | if mode == VerifyMode::Confirm { |
| 365 | 355 | <form data-hard="true" method="post" action=(format!("/verify/{token}")) class="sec"> |
crates/forge-web/src/pages/releases.rsmodified+1 -10
| @@ -353,8 +353,6 @@ async fn release_form( | ||
| 353 | 353 | branches: Vec<String>, |
| 354 | 354 | submit: &'static str, |
| 355 | 355 | ) -> Result<impl View> { |
| 356 | - let tag_hint = g::t(lang, K::TagHint); | |
| 357 | - let edit_tag_help = g::t(lang, K::EditTagHelp); | |
| 358 | 356 | Ok(view! { |
| 359 | 357 | <form method="post" action=(action.as_str()) class="fields release-form"> |
| 360 | 358 | if let Some(message) = draft.error { |
| @@ -365,7 +363,6 @@ async fn release_form( | ||
| 365 | 363 | <div class="field"> |
| 366 | 364 | <label for="release-tag">(g::t(lang, K::Tag))</label> |
| 367 | 365 | <input id="release-tag" type="text" name="tag" value=(draft.tag.as_str()) required="required" maxlength="100" autocomplete="off" spellcheck="false"> |
| 368 | - <p class="hint">(tag_hint)</p> | |
| 369 | 366 | </div> |
| 370 | 367 | <div class="field"> |
| 371 | 368 | <label for="release-target">(g::t(lang, K::TargetBranch))</label> |
| @@ -374,13 +371,11 @@ async fn release_form( | ||
| 374 | 371 | <option value=(branch.as_str()) selected=(branch.as_str() == draft.target.as_str())>(branch.as_str())</option> |
| 375 | 372 | } |
| 376 | 373 | </select> |
| 377 | - <p class="hint">(crate::pages::passkeys::s(lang, "Used only when the tag is created.", "Yalnızca etiket oluşturulurken kullanılır."))</p> | |
| 378 | 374 | </div> |
| 379 | 375 | } else { |
| 380 | 376 | <div class="field"> |
| 381 | 377 | <label for="release-tag">(g::t(lang, K::Tag))</label> |
| 382 | 378 | <input id="release-tag" type="text" name="tag" value=(draft.tag.as_str()) required="required" maxlength="100" autocomplete="off" spellcheck="false"> |
| 383 | - <p class="hint">(edit_tag_help)</p> | |
| 384 | 379 | </div> |
| 385 | 380 | if move_target { |
| 386 | 381 | <div class="field"> |
| @@ -391,10 +386,7 @@ async fn release_form( | ||
| 391 | 386 | <option value=(branch.as_str()) selected=(branch.as_str() == draft.target.as_str())>(branch.as_str())</option> |
| 392 | 387 | } |
| 393 | 388 | </select> |
| 394 | - <p class="hint">(g::t(lang, K::TargetMoveHelp))</p> | |
| 395 | 389 | </div> |
| 396 | - } else { | |
| 397 | - <p class="hint">(g::t(lang, K::TargetLockedHelp))</p> | |
| 398 | 390 | } |
| 399 | 391 | } |
| 400 | 392 | <div class="field"> |
| @@ -859,7 +851,7 @@ async fn release_tag_page(cx: &Cx) -> Result<impl View> { | ||
| 859 | 851 | if writer { |
| 860 | 852 | <section class="sec"> |
| 861 | 853 | confirm_act(lang: lang, label: g::t(lang, K::DeleteRelease), action: delete_href.as_str(), csrf: csrf.as_str(), |
| 862 | - fields: vec![("confirm".to_owned(), "on".to_owned())], note: Some(g::t(lang, K::DeleteReleaseHelp).to_owned())) | |
| 854 | + fields: vec![("confirm".to_owned(), "on".to_owned())]) | |
| 863 | 855 | </section> |
| 864 | 856 | } |
| 865 | 857 | </div> |
| @@ -918,7 +910,6 @@ async fn edit_body( | ||
| 918 | 910 | </section> |
| 919 | 911 | <section class="sec"> |
| 920 | 912 | <h2>(g::t(lang, K::DeleteRelease))</h2> |
| 921 | - <p class="hint">(g::t(lang, K::DeleteReleaseHelp))</p> | |
| 922 | 913 | <div class="acts"> |
| 923 | 914 | confirm_act(lang: lang, label: g::t(lang, K::DeleteRelease), action: delete_href.as_str(), csrf: csrf.as_str(), |
| 924 | 915 | fields: vec![("confirm".to_owned(), "on".to_owned())]) |
crates/forge-web/src/pages/releases_tests.rsmodified+0 -4
| @@ -668,10 +668,6 @@ async fn the_edit_page_and_its_form_follow_the_publish_state() { | ||
| 668 | 668 | !html.contains("name=\"target\""), |
| 669 | 669 | "published hides the target" |
| 670 | 670 | ); |
| 671 | - assert!( | |
| 672 | - html.contains("Published releases keep their commit"), | |
| 673 | - "{html}" | |
| 674 | - ); | |
| 675 | 671 | } |
| 676 | 672 | |
| 677 | 673 | // A published release can be retagged through the form and keeps its commit. |
crates/forge-web/src/pages/repo.rsmodified+1 -2
| @@ -243,7 +243,6 @@ async fn clone_popover( | ||
| 243 | 243 | <button type="button" class="act" data-copy="clone-https-text" data-copied=(g::t(lang, K::CloneCopied)) data-failed=(g::t(lang, K::CloneCopyFailed)) data-palette-action="click">(g::t(lang, K::CopyCloneUrl))</button> |
| 244 | 244 | <label for="clone-ssh">"SSH"</label> |
| 245 | 245 | <input id="clone-ssh" class="mono" type="text" readonly=(true) value=(ssh.as_str())> |
| 246 | - <p class="hint">(g::t(lang, K::SshRequiresKey))</p> | |
| 247 | 246 | if let Some((zip, tar)) = downloads { |
| 248 | 247 | <nav class="sub" aria-label=(g::t(lang, K::DownloadNav))> |
| 249 | 248 | <a href=(zip)>(g::t(lang, K::DownloadZip))</a> |
| @@ -711,7 +710,7 @@ mod tests { | ||
| 711 | 710 | assert!(body.contains("default"), "default branch marked"); |
| 712 | 711 | let (status, body) = get(&router, "/tahinli/demo/tags").await; |
| 713 | 712 | assert_eq!(status, 200); |
| 714 | - assert!(body.contains("Nothing here yet. Push a commit and it shows up.")); | |
| 713 | + assert!(body.contains("Nothing here yet.")); | |
| 715 | 714 | let (status, body) = get(&router, "/tahinli/demo/tree/main").await; |
| 716 | 715 | assert_eq!(status, 200); |
| 717 | 716 | assert!(body.contains("README.md")); |
crates/forge-web/src/pages/repo_collaborators.rsmodified+59 -119
| @@ -31,7 +31,7 @@ use crate::pages::repo_ctx::{RepoCtx, RepoHead, load_repo}; | ||
| 31 | 31 | use crate::pages::repo_settings::settings_frame; |
| 32 | 32 | use crate::pages::repo_settings_live::settings_head; |
| 33 | 33 | use crate::state::AppState; |
| 34 | -use crate::views::parts::{confirm_act, reveal}; | |
| 34 | +use crate::views::parts::{PeopleList, PersonRow, people_list}; | |
| 35 | 35 | use crate::views::{alert, avatar_url, display_name, shell}; |
| 36 | 36 | |
| 37 | 37 | path_param!(owner); |
| @@ -62,15 +62,6 @@ const ROLES: [Role; 5] = [ | ||
| 62 | 62 | Role::Admin, |
| 63 | 63 | ]; |
| 64 | 64 | |
| 65 | -/// What each role may do, for the legend. | |
| 66 | -const LEGEND: [(Role, K); 5] = [ | |
| 67 | - (Role::Read, K::RoleReadDesc), | |
| 68 | - (Role::Triage, K::RoleTriageDesc), | |
| 69 | - (Role::Write, K::RoleWriteDesc), | |
| 70 | - (Role::Maintain, K::RoleMaintainDesc), | |
| 71 | - (Role::Admin, K::RoleAdminDesc), | |
| 72 | -]; | |
| 73 | - | |
| 74 | 65 | #[derive(Deserialize)] |
| 75 | 66 | struct AddForm { |
| 76 | 67 | #[serde(default)] |
| @@ -99,16 +90,6 @@ struct RemoveForm { | ||
| 99 | 90 | user_id: String, |
| 100 | 91 | } |
| 101 | 92 | |
| 102 | -/// One table row: a collaborator and their current role. | |
| 103 | -struct CollabRow { | |
| 104 | - user_id: String, | |
| 105 | - username: String, | |
| 106 | - /// What to show: the login name, or "Deleted user" for the ghost account. | |
| 107 | - label: String, | |
| 108 | - avatar: String, | |
| 109 | - role: Role, | |
| 110 | -} | |
| 111 | - | |
| 112 | 93 | /// Sets the notice shown on the next collaborators page view. |
| 113 | 94 | fn set_notice(cx: &Cx, word: &'static str) { |
| 114 | 95 | cookies(cx).add( |
| @@ -157,94 +138,6 @@ fn collaborators_redirect(title: &str) -> SeeOther { | ||
| 157 | 138 | see_other(format!("/{title}/settings/collaborators")) |
| 158 | 139 | } |
| 159 | 140 | |
| 160 | -/// The collaborators topic: one row per collaborator (role and removal inside it), then the add form | |
| 161 | -/// in place. The role legend sits in the add form. | |
| 162 | -#[component] | |
| 163 | -async fn collaborators_pane( | |
| 164 | - lang: Lang, | |
| 165 | - rows: Vec<CollabRow>, | |
| 166 | - role_action: String, | |
| 167 | - remove_action: String, | |
| 168 | - add_action: String, | |
| 169 | - csrf: String, | |
| 170 | - add_open: bool, | |
| 171 | -) -> Result<impl View> { | |
| 172 | - Ok(view! { | |
| 173 | - <section class="sec"> | |
| 174 | - <h2>(g::t(lang, K::Collaborators))</h2> | |
| 175 | - if rows.is_empty() { | |
| 176 | - <p class="state">(g::t(lang, K::NoCollaborators))</p> | |
| 177 | - } else { | |
| 178 | - <p class="hint">(g::t(lang, K::CollaboratorsHelp))</p> | |
| 179 | - } | |
| 180 | - <div> | |
| 181 | - for row in rows.iter() { | |
| 182 | - <details class="row-open"> | |
| 183 | - <summary class="line"> | |
| 184 | - <span class="name"> | |
| 185 | - <img class="avatar avatar-sm" src=(row.avatar.as_str()) alt="" width="24" height="24"> | |
| 186 | - " " (row.label.as_str()) | |
| 187 | - </span> | |
| 188 | - <span class="val">(crate::i18n::orgs::role_name(lang, row.role.as_str()))</span> | |
| 189 | - </summary> | |
| 190 | - <div class="opened"> | |
| 191 | - if row.label == row.username { | |
| 192 | - <p class="hint"><a href=(format!("/{}", row.username.as_str()))>(row.username.as_str())</a></p> | |
| 193 | - } | |
| 194 | - <form method="post" action=(role_action.as_str()) class="fields"> | |
| 195 | - <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 196 | - <input type="hidden" name="user_id" value=(row.user_id.as_str())> | |
| 197 | - <div class="field"> | |
| 198 | - <label for=(format!("collab-role-{}", row.user_id.as_str()))>(g::t(lang, K::Role))</label> | |
| 199 | - <select id=(format!("collab-role-{}", row.user_id.as_str())) name="role" aria-label=(g::role_for(lang, row.username.as_str()))> | |
| 200 | - for role in ROLES.iter() { | |
| 201 | - <option value=(role.as_str()) selected=(*role == row.role)>(crate::i18n::orgs::role_name(lang, role.as_str()))</option> | |
| 202 | - } | |
| 203 | - </select> | |
| 204 | - </div> | |
| 205 | - <button type="submit" class="primary">(g::t(lang, K::SaveRole))</button> | |
| 206 | - </form> | |
| 207 | - <div class="acts"> | |
| 208 | - confirm_act(lang: lang, label: g::t(lang, K::Remove), action: remove_action.as_str(), csrf: csrf.as_str(), | |
| 209 | - fields: vec![("user_id".to_owned(), row.user_id.clone())], | |
| 210 | - note: Some(passkeys::s(lang, "They lose access to this repo at once.", "Bu repoya erişimi hemen kaybeder.").to_owned())) | |
| 211 | - </div> | |
| 212 | - </div> | |
| 213 | - </details> | |
| 214 | - } | |
| 215 | - </div> | |
| 216 | - <div class="acts"> | |
| 217 | - reveal(label: g::t(lang, K::AddCollaboratorButton), id: Some("collab-add"), open: add_open, | |
| 218 | - <p class="state">(g::t(lang, K::Roles))</p> | |
| 219 | - <dl class="role-list"> | |
| 220 | - for entry in LEGEND.iter() { | |
| 221 | - <dt>(crate::i18n::orgs::role_name(lang, entry.0.as_str()))</dt> | |
| 222 | - <dd>(g::t(lang, entry.1))</dd> | |
| 223 | - } | |
| 224 | - </dl> | |
| 225 | - <form method="post" action=(add_action.as_str()) class="fields" id="add-collaborator"> | |
| 226 | - <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 227 | - <div class="field"> | |
| 228 | - <label for="collab-username">(g::t(lang, K::Username))</label> | |
| 229 | - <input id="collab-username" type="text" name="username" autocomplete="off" spellcheck="false" required=(true)> | |
| 230 | - </div> | |
| 231 | - <div class="field"> | |
| 232 | - <label for="collab-role">(g::t(lang, K::Role))</label> | |
| 233 | - <select id="collab-role" name="role"> | |
| 234 | - for role in ROLES.iter() { | |
| 235 | - <option value=(role.as_str()) selected=(*role == Role::Read)>(crate::i18n::orgs::role_name(lang, role.as_str()))</option> | |
| 236 | - } | |
| 237 | - </select> | |
| 238 | - <p class="hint">(g::t(lang, K::AddCollaboratorHelp))</p> | |
| 239 | - </div> | |
| 240 | - <button type="submit" class="primary">(g::t(lang, K::AddCollaboratorButton))</button> | |
| 241 | - </form> | |
| 242 | - ) | |
| 243 | - </div> | |
| 244 | - </section> | |
| 245 | - }) | |
| 246 | -} | |
| 247 | - | |
| 248 | 141 | /// Everything the collaborators page shows besides the repo header. |
| 249 | 142 | struct FrameData { |
| 250 | 143 | page_title: String, |
| @@ -268,7 +161,7 @@ impl FrameData { | ||
| 268 | 161 | async fn collaborators_body( |
| 269 | 162 | lang: Lang, |
| 270 | 163 | frame: FrameData, |
| 271 | - rows: Vec<CollabRow>, | |
| 164 | + rows: Vec<PersonRow>, | |
| 272 | 165 | csrf: String, |
| 273 | 166 | notice: Option<(K, bool)>, |
| 274 | 167 | ) -> Result<impl View> { |
| @@ -280,11 +173,47 @@ async fn collaborators_body( | ||
| 280 | 173 | // A refused add (or role change) reopens the add panel; a missing collaborator does not. |
| 281 | 174 | let add_open = matches!(notice, Some((key, true)) if !matches!(key, K::NotCollaborator)); |
| 282 | 175 | let notice = notice.map(|(key, is_error)| (g::t(lang, key), is_error)); |
| 283 | - let can_delete = header.can_delete; | |
| 284 | 176 | let section_name = g::t(lang, K::Collaborators).to_owned(); |
| 177 | + let roles: Vec<(String, String)> = ROLES | |
| 178 | + .iter() | |
| 179 | + .map(|role| { | |
| 180 | + ( | |
| 181 | + role.as_str().to_owned(), | |
| 182 | + crate::i18n::orgs::role_name(lang, role.as_str()).to_owned(), | |
| 183 | + ) | |
| 184 | + }) | |
| 185 | + .collect(); | |
| 186 | + let list = PeopleList { | |
| 187 | + lang, | |
| 188 | + title: section_name.clone(), | |
| 189 | + rows, | |
| 190 | + roles, | |
| 191 | + manage: true, | |
| 192 | + csrf, | |
| 193 | + role_action, | |
| 194 | + remove_action, | |
| 195 | + remove_note: Some( | |
| 196 | + passkeys::s( | |
| 197 | + lang, | |
| 198 | + "They lose access to this repo at once.", | |
| 199 | + "Bu repoya erişimi hemen kaybeder.", | |
| 200 | + ) | |
| 201 | + .to_owned(), | |
| 202 | + ), | |
| 203 | + add_action, | |
| 204 | + add_id: "add-collaborator".to_owned(), | |
| 205 | + add_label: g::t(lang, K::AddCollaboratorButton).to_owned(), | |
| 206 | + add_open, | |
| 207 | + add_default_role: Role::Read.as_str().to_owned(), | |
| 208 | + username_label: g::t(lang, K::Username).to_owned(), | |
| 209 | + role_label: g::t(lang, K::Role).to_owned(), | |
| 210 | + save_label: g::t(lang, K::SaveRole).to_owned(), | |
| 211 | + open_label: passkeys::s(lang, "Open profile", "Profili aç").to_owned(), | |
| 212 | + empty: Some(g::t(lang, K::NoCollaborators).to_owned()), | |
| 213 | + }; | |
| 285 | 214 | Ok(view! { |
| 286 | 215 | repo_head(head: header, title: Some(section_name)) |
| 287 | - settings_frame(lang: lang, title: nav_title, current: "collaborators", can_delete: can_delete, | |
| 216 | + settings_frame(lang: lang, title: nav_title, current: "collaborators", | |
| 288 | 217 | if let Some((text, is_error)) = notice { |
| 289 | 218 | if is_error { |
| 290 | 219 | alert(message: text) |
| @@ -292,8 +221,7 @@ async fn collaborators_body( | ||
| 292 | 221 | <p class="state" role="status">(text)</p> |
| 293 | 222 | } |
| 294 | 223 | } |
| 295 | - collaborators_pane(lang: lang, rows: rows, role_action: role_action, | |
| 296 | - remove_action: remove_action, add_action: add_action, csrf: csrf, add_open: add_open) | |
| 224 | + people_list(list: list) | |
| 297 | 225 | ) |
| 298 | 226 | }) |
| 299 | 227 | } |
| @@ -312,14 +240,26 @@ async fn collaborators_page(cx: &Cx) -> Result<impl View> { | ||
| 312 | 240 | let lang = i18n::lang(cx, Some(&user)); |
| 313 | 241 | let state = app_context::<AppState>(cx); |
| 314 | 242 | let collaborators = state.store.list_collaborators(&ctx.repo.id).await?; |
| 243 | + let viewer_id = user.id.clone(); | |
| 315 | 244 | let rows = collaborators |
| 316 | 245 | .into_iter() |
| 317 | - .map(|(user, role)| CollabRow { | |
| 318 | - user_id: user.id.clone(), | |
| 319 | - avatar: avatar_url(&user.username, user.avatar_hash.as_deref()), | |
| 320 | - label: display_name(lang, &user.username), | |
| 321 | - username: user.username, | |
| 322 | - role, | |
| 246 | + .map(|(member, role)| { | |
| 247 | + let is_self = member.id == viewer_id; | |
| 248 | + PersonRow { | |
| 249 | + user_id: member.id.clone(), | |
| 250 | + avatar: avatar_url(&member.username, member.avatar_hash.as_deref()), | |
| 251 | + label: display_name(lang, &member.username), | |
| 252 | + role: role.as_str().to_owned(), | |
| 253 | + role_name: crate::i18n::orgs::role_name(lang, role.as_str()).to_owned(), | |
| 254 | + is_self, | |
| 255 | + remove_label: if is_self { | |
| 256 | + crate::i18n::orgs::t(lang, crate::i18n::orgs::K::Leave) | |
| 257 | + } else { | |
| 258 | + g::t(lang, K::Remove) | |
| 259 | + } | |
| 260 | + .to_owned(), | |
| 261 | + username: member.username, | |
| 262 | + } | |
| 323 | 263 | }) |
| 324 | 264 | .collect(); |
| 325 | 265 | let notice = take_notice(cx); |
crates/forge-web/src/pages/repo_ctx.rsmodified+0 -3
| @@ -62,8 +62,6 @@ pub struct RepoHead { | ||
| 62 | 62 | pub active: &'static str, |
| 63 | 63 | /// Whether the viewer may open the Settings tab. |
| 64 | 64 | pub can_admin: bool, |
| 65 | - /// Whether the viewer may delete the repo: the settings nav lists Danger zone only then. | |
| 66 | - pub can_delete: bool, | |
| 67 | 65 | /// Open issues, for the Issues tab count. |
| 68 | 66 | pub open_issues: u64, |
| 69 | 67 | /// Open pull requests, for the Pull requests tab count. |
| @@ -258,7 +256,6 @@ impl RepoCtx { | ||
| 258 | 256 | archived: self.repo.archived, |
| 259 | 257 | active, |
| 260 | 258 | can_admin: self.can_admin(), |
| 261 | - can_delete: self.can_delete(), | |
| 262 | 259 | open_issues: self.open_issues(state).await?, |
| 263 | 260 | open_pulls, |
| 264 | 261 | forked_from, |
crates/forge-web/src/pages/repo_mirrors.rsmodified+3 -31
| @@ -399,10 +399,9 @@ async fn frame_top( | ||
| 399 | 399 | lang: Lang, |
| 400 | 400 | #[default] child: Child<'_>, |
| 401 | 401 | ) -> Result<impl View> { |
| 402 | - let can_delete = head.can_delete; | |
| 403 | 402 | Ok(view! { |
| 404 | 403 | repo_head(head: head, title: Some(heading)) |
| 405 | - settings_frame(lang: lang, title: title, current: "mirrors", can_delete: can_delete, | |
| 404 | + settings_frame(lang: lang, title: title, current: "mirrors", | |
| 406 | 405 | if let Some((text, is_error)) = notice { |
| 407 | 406 | if is_error { |
| 408 | 407 | alert(message: text) |
| @@ -442,16 +441,6 @@ async fn mirror_form( | ||
| 442 | 441 | } else { |
| 443 | 442 | g::t(lang, K::RemoteUrl) |
| 444 | 443 | }; |
| 445 | - let url_hint = if current_url.is_empty() { | |
| 446 | - g::t(lang, K::UrlHintNew) | |
| 447 | - } else { | |
| 448 | - g::t(lang, K::UrlHintKeep) | |
| 449 | - }; | |
| 450 | - let secret_hint = if has_secret { | |
| 451 | - g::t(lang, K::SecretSet) | |
| 452 | - } else { | |
| 453 | - g::t(lang, K::SecretUnset) | |
| 454 | - }; | |
| 455 | 444 | let url_id = format!("{prefix}-url"); |
| 456 | 445 | let username_id = format!("{prefix}-username"); |
| 457 | 446 | let secret_id = format!("{prefix}-secret"); |
| @@ -471,7 +460,6 @@ async fn mirror_form( | ||
| 471 | 460 | <div class="field"> |
| 472 | 461 | <label for=(url_id.as_str())>(url_label)</label> |
| 473 | 462 | <input id=(url_id.as_str()) type="url" name="url" value=(url.as_str()) autocomplete="off" spellcheck="false" required=(current_url.is_empty())> |
| 474 | - <p class="hint">(url_hint)</p> | |
| 475 | 463 | </div> |
| 476 | 464 | <div class="field"> |
| 477 | 465 | <label for=(username_id.as_str())>(g::t(lang, K::UsernameOptional))</label> |
| @@ -480,7 +468,6 @@ async fn mirror_form( | ||
| 480 | 468 | <div class="field"> |
| 481 | 469 | <label for=(secret_id.as_str())>(g::t(lang, K::SecretOptional))</label> |
| 482 | 470 | <input id=(secret_id.as_str()) type="password" name="secret" autocomplete="new-password" maxlength="1024"> |
| 483 | - <p class="hint">(secret_hint)</p> | |
| 484 | 471 | </div> |
| 485 | 472 | if has_secret { |
| 486 | 473 | <label class="switch"> |
| @@ -519,7 +506,6 @@ async fn mirrors_list_body( | ||
| 519 | 506 | ) -> Result<impl View> { |
| 520 | 507 | let add_action = mirrors_href(&title); |
| 521 | 508 | let empty = rows.is_empty(); |
| 522 | - let can_pull = pull_form.is_some(); | |
| 523 | 509 | let pull_open = pull_form.as_ref().is_some_and(|pull| pull.error.is_some()); |
| 524 | 510 | let push_open = draft.error.is_some(); |
| 525 | 511 | Ok(view! { |
| @@ -562,10 +548,6 @@ async fn mirrors_list_body( | ||
| 562 | 548 | if let Some(pull) = pull_form { |
| 563 | 549 | <section class="sec" id="add-pull-mirror"> |
| 564 | 550 | <h2>(g::t(lang, K::AddPullMirror))</h2> |
| 565 | - <p class="hint">(g::t(lang, K::MirrorsIntro))</p> | |
| 566 | - if !empty { | |
| 567 | - <p class="hint">(g::t(lang, K::AddPullIntro))</p> | |
| 568 | - } | |
| 569 | 551 | <div class="acts"> |
| 570 | 552 | reveal(label: g::t(lang, K::AddPullMirror), open: pull_open, |
| 571 | 553 | mirror_form(action: add_action.clone(), csrf: csrf.clone(), prefix: "pull-mirror", pull: true, current_url: String::new(), |
| @@ -577,9 +559,6 @@ async fn mirrors_list_body( | ||
| 577 | 559 | } |
| 578 | 560 | <section class="sec" id="add-push-mirror"> |
| 579 | 561 | <h2>(g::t(lang, K::AddPushMirror))</h2> |
| 580 | - if !empty || can_pull { | |
| 581 | - <p class="hint">(g::t(lang, K::AddPushIntro))</p> | |
| 582 | - } | |
| 583 | 562 | <div class="acts"> |
| 584 | 563 | reveal(label: g::t(lang, K::AddPushMirror), open: push_open, |
| 585 | 564 | mirror_form(action: add_action.clone(), csrf: csrf.clone(), prefix: "push-mirror", pull: false, current_url: String::new(), |
| @@ -803,11 +782,6 @@ async fn mirror_body( | ||
| 803 | 782 | let sync_action = format!("{edit_action}/sync"); |
| 804 | 783 | let delete_action = format!("{edit_action}/delete"); |
| 805 | 784 | let pull = mirror.direction == MirrorDirection::Pull; |
| 806 | - let delete_text = if pull { | |
| 807 | - g::t(lang, K::DeleteTextPull) | |
| 808 | - } else { | |
| 809 | - g::t(lang, K::DeleteTextPush) | |
| 810 | - }; | |
| 811 | 785 | let current_url = redacted_url(&mirror.url); |
| 812 | 786 | let heading = current_url.clone(); |
| 813 | 787 | Ok(view! { |
| @@ -816,7 +790,7 @@ async fn mirror_body( | ||
| 816 | 790 | <section class="sec"> |
| 817 | 791 | <h2>(mirror_kind(lang, mirror.direction))</h2> |
| 818 | 792 | <p class="state"><code>(current_url.as_str())</code></p> |
| 819 | - <p class="hint">(g::t(lang, K::LastSync))" " rel_time_or_never(lang: lang, stamp: mirror.last_sync_at.as_deref())</p> | |
| 793 | + <p class="state">(g::t(lang, K::LastSync))" " rel_time_or_never(lang: lang, stamp: mirror.last_sync_at.as_deref())</p> | |
| 820 | 794 | if let Some(error) = mirror.last_error.clone() { |
| 821 | 795 | <pre class="mirror-error">(error.as_str())</pre> |
| 822 | 796 | } |
| @@ -833,16 +807,14 @@ async fn mirror_body( | ||
| 833 | 807 | if !archived { |
| 834 | 808 | <section class="sec"> |
| 835 | 809 | <h2>(g::t(lang, K::SyncHeading))</h2> |
| 836 | - <p class="hint">(g::t(lang, K::SyncIntro))</p> | |
| 837 | 810 | <div class="acts"> |
| 838 | 811 | post_act(label: g::t(lang, K::SyncNow), action: sync_action.as_str(), csrf: csrf.as_str()) |
| 839 | 812 | </div> |
| 840 | 813 | </section> |
| 841 | 814 | <section class="sec"> |
| 842 | 815 | <h2>(g::t(lang, K::DeleteMirror))</h2> |
| 843 | - <p class="hint">(delete_text)</p> | |
| 844 | 816 | <div class="acts"> |
| 845 | - confirm_act(lang: lang, label: g::t(lang, K::DeleteMirror), action: delete_action.as_str(), csrf: csrf.as_str(), fields: vec![("confirm".to_owned(), "on".to_owned())], note: Some(g::t(lang, K::DeleteConfirm).to_owned())) | |
| 817 | + confirm_act(lang: lang, label: g::t(lang, K::DeleteMirror), action: delete_action.as_str(), csrf: csrf.as_str(), fields: vec![("confirm".to_owned(), "on".to_owned())]) | |
| 846 | 818 | </div> |
| 847 | 819 | </section> |
| 848 | 820 | } |
crates/forge-web/src/pages/repo_rename.rsmodified+57 -187
| @@ -1,45 +1,34 @@ | ||
| 1 | -//! Page: rename and transfer a repo (`/{owner}/{repo}/settings/rename`). Renaming needs `Action::Admin` | |
| 2 | -//! (owner, instance admin, or an Admin collaborator). Transferring needs `Action::Delete` (owner or | |
| 3 | -//! instance admin) and a typed `owner/name` confirmation. A non-admin transfer is only offered: the | |
| 4 | -//! target accepts it on `pages::repo_transfer`, and an instance admin's moves at once. The old | |
| 5 | -//! owner/name keeps working through a redirect (see `store::move_repo` and `pages::repo_ctx`). The | |
| 6 | -//! bare repo on disk never moves. | |
| 1 | +//! Rename and transfer, the first two topics of the danger zone (`/{owner}/{repo}/settings?section=danger`, | |
| 2 | +//! see `pages::repo_settings`). `POST /{owner}/{repo}/settings/rename` renames the repo and needs | |
| 3 | +//! `Action::Admin` (owner, instance admin, or an Admin collaborator). `POST /{owner}/{repo}/settings/transfer` | |
| 4 | +//! needs `Action::Delete` (owner or instance admin) and a typed `owner/name` confirmation. A non-admin | |
| 5 | +//! transfer is only offered: the target accepts it on `pages::repo_transfer`, and an instance admin's | |
| 6 | +//! moves happen at once. The old owner/name keeps working through a redirect (see `store::move_repo` and | |
| 7 | +//! `pages::repo_ctx`). The bare repo on disk never moves. | |
| 7 | 8 | |
| 8 | 9 | use forge_core::store::orgs::OrgMemberRole; |
| 9 | 10 | use forge_core::{AuditAction, Error as CoreError}; |
| 10 | 11 | use serde::Deserialize; |
| 11 | 12 | use topcoat::Result; |
| 12 | 13 | use topcoat::context::{Cx, app_context}; |
| 13 | -use topcoat::cookie::{Cookie, Cookies, SameSite, cookies}; | |
| 14 | 14 | use topcoat::router::content::Form; |
| 15 | -use topcoat::router::error::{forbidden, see_other}; | |
| 16 | -use topcoat::router::{page, path_param}; | |
| 15 | +use topcoat::router::error::{SeeOther, forbidden, see_other}; | |
| 16 | +use topcoat::router::{page, path_param, route}; | |
| 17 | 17 | use topcoat::view::{View, component, view}; |
| 18 | 18 | |
| 19 | 19 | use crate::audit::{self, Actor, Target}; |
| 20 | -use crate::auth::{require_csrf, require_user}; | |
| 20 | +use crate::auth::require_csrf; | |
| 21 | 21 | use crate::i18n::repo_admin::{self as g, K}; |
| 22 | 22 | use crate::i18n::{self, Lang}; |
| 23 | -use crate::pages::repo::repo_head; | |
| 24 | -use crate::pages::repo_ctx::{RepoCtx, RepoHead, load_repo}; | |
| 25 | -use crate::pages::repo_settings::settings_frame; | |
| 26 | -use crate::pages::repo_settings_live::settings_head; | |
| 23 | +use crate::pages::repo_ctx::load_repo; | |
| 24 | +use crate::pages::repo_settings::{DangerForms, Shown, render_settings, set_settings_notice}; | |
| 27 | 25 | use crate::state::AppState; |
| 26 | +use crate::views::alert; | |
| 28 | 27 | use crate::views::parts::reveal; |
| 29 | -use crate::views::{alert, shell}; | |
| 30 | 28 | |
| 31 | 29 | path_param!(owner); |
| 32 | 30 | path_param!(repo); |
| 33 | 31 | |
| 34 | -/// Cookie that carries a one-shot notice to the next rename page view. Its value is one of the fixed | |
| 35 | -/// words in `NOTICES`, never user text. | |
| 36 | -const NOTICE_COOKIE: &str = "forge_rename_notice"; | |
| 37 | - | |
| 38 | -const NOTICES: [(&str, K); 2] = [ | |
| 39 | - ("renamed", K::RenamedNotice), | |
| 40 | - ("transferred", K::TransferredNotice), | |
| 41 | -]; | |
| 42 | - | |
| 43 | 32 | #[derive(Deserialize)] |
| 44 | 33 | struct RenameForm { |
| 45 | 34 | #[serde(default)] |
| @@ -58,170 +47,50 @@ struct TransferForm { | ||
| 58 | 47 | confirm: String, |
| 59 | 48 | } |
| 60 | 49 | |
| 61 | -/// What the two forms show: the drafts the viewer typed and any error for each form. | |
| 62 | -struct Forms { | |
| 63 | - rename_name: String, | |
| 64 | - rename_error: Option<String>, | |
| 65 | - transfer_owner: String, | |
| 66 | - transfer_error: Option<String>, | |
| 67 | -} | |
| 68 | - | |
| 69 | -impl Forms { | |
| 70 | - fn fresh(ctx: &RepoCtx) -> Self { | |
| 71 | - Self { | |
| 72 | - rename_name: ctx.repo.name.clone(), | |
| 73 | - rename_error: None, | |
| 74 | - transfer_owner: String::new(), | |
| 75 | - transfer_error: None, | |
| 76 | - } | |
| 77 | - } | |
| 78 | -} | |
| 79 | - | |
| 80 | -fn set_notice(cx: &Cx, word: &'static str) { | |
| 81 | - cookies(cx).add( | |
| 82 | - Cookie::build((NOTICE_COOKIE, word)) | |
| 83 | - .path("/") | |
| 84 | - .http_only(true) | |
| 85 | - .same_site(SameSite::Lax) | |
| 86 | - .build(), | |
| 87 | - ); | |
| 88 | -} | |
| 89 | - | |
| 90 | -/// Reads and clears the notice cookie. Only the fixed words are shown. | |
| 91 | -fn take_notice(cx: &Cx) -> Option<K> { | |
| 92 | - let jar = cookies(cx); | |
| 93 | - let value = jar.get(NOTICE_COOKIE)?.value().to_owned(); | |
| 94 | - jar.remove(Cookie::build((NOTICE_COOKIE, "")).path("/")); | |
| 95 | - NOTICES | |
| 96 | - .iter() | |
| 97 | - .find(|(word, _)| *word == value) | |
| 98 | - .map(|(_, key)| *key) | |
| 99 | -} | |
| 100 | - | |
| 101 | -/// Rename and transfer forms. The transfer section is shown only when the viewer may delete the repo. | |
| 50 | +/// The Rename topic of the danger zone: the form opens in place. `error` is a refused name, and the | |
| 51 | +/// form opens with it and keeps the typed `name`. | |
| 102 | 52 | #[component] |
| 103 | -async fn rename_body( | |
| 53 | +pub(crate) async fn rename_section( | |
| 104 | 54 | lang: Lang, |
| 105 | - head: RepoHead, | |
| 106 | 55 | title: String, |
| 107 | 56 | csrf: String, |
| 108 | - can_delete: bool, | |
| 109 | - notice: Option<K>, | |
| 110 | - forms: Forms, | |
| 57 | + name: String, | |
| 58 | + error: Option<String>, | |
| 111 | 59 | ) -> Result<impl View> { |
| 112 | - let rename_action = format!("/{title}/settings/rename"); | |
| 113 | - let transfer_action = format!("/{title}/settings/transfer"); | |
| 114 | - let status_href = format!("/{title}/transfer"); | |
| 115 | - let nav_title = title.clone(); | |
| 116 | - let Forms { | |
| 117 | - rename_name, | |
| 118 | - rename_error, | |
| 119 | - transfer_owner, | |
| 120 | - transfer_error, | |
| 121 | - } = forms; | |
| 122 | - // A form whose submit was refused opens in place, so its message is visible. | |
| 123 | - let rename_open = rename_error.is_some(); | |
| 124 | - let transfer_open = transfer_error.is_some(); | |
| 60 | + let action = format!("/{title}/settings/rename"); | |
| 61 | + let open = error.is_some(); | |
| 125 | 62 | Ok(view! { |
| 126 | - repo_head(head: head, title: Some(g::t(lang, K::RenameTransferNav).to_owned())) | |
| 127 | - settings_frame(lang: lang, title: nav_title, current: "rename", can_delete: can_delete, | |
| 128 | - if let Some(key) = notice { | |
| 129 | - <p class="state" role="status">(g::t(lang, key))</p> | |
| 130 | - } | |
| 131 | 63 | <section class="sec"> |
| 132 | - <h2>(g::t(lang, K::RenameRepo))</h2> | |
| 133 | - <p class="hint">(g::t(lang, K::RenameHelp))</p> | |
| 64 | + <h2>(g::t(lang, K::RenameHeading))</h2> | |
| 134 | 65 | <div class="acts"> |
| 135 | - reveal(label: g::t(lang, K::RenameRepo), open: rename_open, | |
| 136 | - if let Some(message) = rename_error { | |
| 66 | + reveal(label: g::t(lang, K::RenameRepo), open: open, | |
| 67 | + if let Some(message) = error { | |
| 137 | 68 | alert(message: message.as_str()) |
| 138 | 69 | } |
| 139 | - <form method="post" action=(rename_action.as_str()) class="fields"> | |
| 70 | + <form method="post" action=(action.as_str()) class="fields"> | |
| 140 | 71 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 141 | 72 | <div class="field"> |
| 142 | 73 | <label for="rename-name">(g::t(lang, K::NewName))</label> |
| 143 | - <input id="rename-name" type="text" name="name" value=(rename_name.as_str()) autocomplete="off" spellcheck="false" required=(true)> | |
| 74 | + <input id="rename-name" type="text" name="name" value=(name.as_str()) autocomplete="off" spellcheck="false" required=(true)> | |
| 144 | 75 | </div> |
| 145 | 76 | <button type="submit" class="primary">(g::t(lang, K::RenameRepo))</button> |
| 146 | 77 | </form> |
| 147 | 78 | ) |
| 148 | 79 | </div> |
| 149 | 80 | </section> |
| 150 | - if can_delete { | |
| 151 | - <section class="sec"> | |
| 152 | - <h2>(g::t(lang, K::TransferRepo))</h2> | |
| 153 | - <p class="hint">(g::t(lang, K::TransferHelp)) <a href=(status_href.as_str())>(g::t(lang, K::PendingTransfers))</a></p> | |
| 154 | - <div class="acts"> | |
| 155 | - reveal(label: g::t(lang, K::TransferRepo), open: transfer_open, | |
| 156 | - if let Some(message) = transfer_error { | |
| 157 | - alert(message: message.as_str()) | |
| 158 | - } | |
| 159 | - <form method="post" action=(transfer_action.as_str()) class="fields"> | |
| 160 | - <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 161 | - <div class="field"> | |
| 162 | - <label for="transfer-owner">(g::t(lang, K::NewOwnerLabel))</label> | |
| 163 | - <input id="transfer-owner" type="text" name="new_owner" value=(transfer_owner.as_str()) autocomplete="off" spellcheck="false" required=(true)> | |
| 164 | - </div> | |
| 165 | - <div class="field"> | |
| 166 | - <label for="transfer-confirm">(g::t(lang, K::TypeToConfirmBefore))<code>(title.clone())</code>(g::t(lang, K::TypeToConfirmAfter))</label> | |
| 167 | - <input id="transfer-confirm" type="text" name="confirm" autocomplete="off" spellcheck="false" required=(true)> | |
| 168 | - </div> | |
| 169 | - <button type="submit" class="danger small">(g::t(lang, K::TransferRepo))</button> | |
| 170 | - </form> | |
| 171 | - ) | |
| 172 | - </div> | |
| 173 | - </section> | |
| 174 | - } | |
| 175 | - ) | |
| 176 | 81 | }) |
| 177 | 82 | } |
| 178 | 83 | |
| 179 | -/// The repo fields the page shows, copied out of the context so the view borrows nothing from it. | |
| 180 | -struct Frame { | |
| 181 | - page_title: String, | |
| 182 | - title: String, | |
| 183 | - can_delete: bool, | |
| 184 | - head: RepoHead, | |
| 185 | -} | |
| 186 | - | |
| 187 | -impl Frame { | |
| 188 | - async fn new(ctx: &RepoCtx, state: &AppState, lang: Lang) -> Result<Self> { | |
| 189 | - let title = format!("{}/{}", ctx.repo.owner_name, ctx.repo.name); | |
| 190 | - Ok(Self { | |
| 191 | - page_title: g::page_title(lang, &title), | |
| 192 | - title, | |
| 193 | - can_delete: ctx.can_delete(), | |
| 194 | - head: settings_head(ctx, state).await?, | |
| 195 | - }) | |
| 196 | - } | |
| 197 | -} | |
| 198 | - | |
| 199 | -/// The rename and transfer page. Anonymous viewers go to login; signed-in viewers without the | |
| 200 | -/// Admin right get 403. | |
| 201 | -#[page("/{owner}/{repo}/settings/rename")] | |
| 202 | -async fn rename_get(cx: &Cx) -> Result<impl View> { | |
| 84 | +/// The rename form moved into the danger zone; the old address goes there. | |
| 85 | +#[route(GET "/{owner}/{repo}/settings/rename")] | |
| 86 | +async fn rename_get(cx: &Cx) -> Result<SeeOther> { | |
| 203 | 87 | let owner = path_param::<Owner>(cx); |
| 204 | 88 | let name = path_param::<Repo>(cx); |
| 205 | - let ctx = load_repo(cx, owner, name).await?; | |
| 206 | - let (user, session) = require_user(cx).await?; | |
| 207 | - if !ctx.can_admin() { | |
| 208 | - return Err(forbidden().into()); | |
| 209 | - } | |
| 210 | - let lang = i18n::lang(cx, Some(&user)); | |
| 211 | - let notice = take_notice(cx); | |
| 212 | - let forms = Forms::fresh(&ctx); | |
| 213 | - let frame = Frame::new(&ctx, app_context::<AppState>(cx), lang).await?; | |
| 214 | - let csrf = session.csrf_token.clone(); | |
| 215 | - Ok(view! { | |
| 216 | - shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(), | |
| 217 | - rename_body(lang: lang, head: frame.head, title: frame.title, csrf: csrf, | |
| 218 | - can_delete: frame.can_delete, | |
| 219 | - notice: notice, forms: forms)) | |
| 220 | - }) | |
| 89 | + Ok(see_other(format!("/{owner}/{name}/settings?section=danger"))) | |
| 221 | 90 | } |
| 222 | 91 | |
| 223 | 92 | /// Renames the repo. The store validates the name with `validate_name`; an invalid name or a name |
| 224 | -/// taken by another repo of the owner re-renders the form with the message. | |
| 93 | +/// taken by another repo of the owner re-renders the danger zone with the message. | |
| 225 | 94 | #[page(POST "/{owner}/{repo}/settings/rename")] |
| 226 | 95 | async fn rename_post(cx: &Cx, Form(form): Form<RenameForm>) -> Result<impl View> { |
| 227 | 96 | let owner = path_param::<Owner>(cx); |
| @@ -270,27 +139,28 @@ async fn rename_post(cx: &Cx, Form(form): Form<RenameForm>) -> Result<impl View> | ||
| 270 | 139 | serde_json::json!({ "from": ctx.repo.name }), |
| 271 | 140 | ) |
| 272 | 141 | .await; |
| 273 | - set_notice(cx, "renamed"); | |
| 142 | + set_settings_notice(cx, "renamed"); | |
| 274 | 143 | Err(see_other(format!( |
| 275 | - "/{}/{new_name}/settings/rename", | |
| 144 | + "/{}/{new_name}/settings?section=danger", | |
| 276 | 145 | ctx.repo.owner_name |
| 277 | 146 | )) |
| 278 | 147 | .into()) |
| 279 | 148 | } |
| 280 | 149 | Err(CoreError::InvalidName(message) | CoreError::Conflict(message)) => { |
| 281 | - let forms = Forms { | |
| 150 | + let danger = DangerForms { | |
| 282 | 151 | rename_name: new_name, |
| 283 | 152 | rename_error: Some(message), |
| 284 | - ..Forms::fresh(&ctx) | |
| 153 | + ..DangerForms::fresh(&ctx) | |
| 285 | 154 | }; |
| 286 | - let frame = Frame::new(&ctx, app_context::<AppState>(cx), lang).await?; | |
| 287 | - let csrf = session.csrf_token.clone(); | |
| 288 | - Ok(view! { | |
| 289 | - shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(), | |
| 290 | - rename_body(lang: lang, head: frame.head, title: frame.title, csrf: csrf, | |
| 291 | - can_delete: frame.can_delete, | |
| 292 | - notice: None, forms: forms)) | |
| 293 | - }) | |
| 155 | + render_settings( | |
| 156 | + cx, | |
| 157 | + ctx, | |
| 158 | + user, | |
| 159 | + session.csrf_token.clone(), | |
| 160 | + lang, | |
| 161 | + Shown::danger(danger), | |
| 162 | + ) | |
| 163 | + .await | |
| 294 | 164 | } |
| 295 | 165 | Err(other) => Err(other.into()), |
| 296 | 166 | } |
| @@ -357,8 +227,7 @@ async fn transfer_post(cx: &Cx, Form(form): Form<TransferForm>) -> Result<impl V | ||
| 357 | 227 | ) |
| 358 | 228 | .await; |
| 359 | 229 | return Err(see_other(format!( |
| 360 | - "/{}/{}/transfer", | |
| 361 | - ctx.repo.owner_name, ctx.repo.name | |
| 230 | + "/{title}/settings?section=danger" | |
| 362 | 231 | )) |
| 363 | 232 | .into()); |
| 364 | 233 | } |
| @@ -390,9 +259,9 @@ async fn transfer_post(cx: &Cx, Form(form): Form<TransferForm>) -> Result<impl V | ||
| 390 | 259 | serde_json::json!({ "to": new_owner.username }), |
| 391 | 260 | ) |
| 392 | 261 | .await; |
| 393 | - set_notice(cx, "transferred"); | |
| 262 | + set_settings_notice(cx, "transferred"); | |
| 394 | 263 | return Err(see_other(format!( |
| 395 | - "/{}/{}/settings/rename", | |
| 264 | + "/{}/{}/settings?section=danger", | |
| 396 | 265 | new_owner.username, ctx.repo.name |
| 397 | 266 | )) |
| 398 | 267 | .into()); |
| @@ -402,17 +271,18 @@ async fn transfer_post(cx: &Cx, Form(form): Form<TransferForm>) -> Result<impl V | ||
| 402 | 271 | } |
| 403 | 272 | }; |
| 404 | 273 | |
| 405 | - let forms = Forms { | |
| 274 | + let danger = DangerForms { | |
| 406 | 275 | transfer_owner: target, |
| 407 | 276 | transfer_error: error, |
| 408 | - ..Forms::fresh(&ctx) | |
| 277 | + ..DangerForms::fresh(&ctx) | |
| 409 | 278 | }; |
| 410 | - let frame = Frame::new(&ctx, state, lang).await?; | |
| 411 | - let csrf = session.csrf_token.clone(); | |
| 412 | - Ok(view! { | |
| 413 | - shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(), | |
| 414 | - rename_body(lang: lang, head: frame.head, title: frame.title, csrf: csrf, | |
| 415 | - can_delete: frame.can_delete, | |
| 416 | - notice: None, forms: forms)) | |
| 417 | - }) | |
| 279 | + render_settings( | |
| 280 | + cx, | |
| 281 | + ctx, | |
| 282 | + user, | |
| 283 | + session.csrf_token.clone(), | |
| 284 | + lang, | |
| 285 | + Shown::danger(danger), | |
| 286 | + ) | |
| 287 | + .await | |
| 418 | 288 | } |
crates/forge-web/src/pages/repo_scrub.rsmodified+1 -5
| @@ -19,7 +19,6 @@ use topcoat::view::{View, component, view}; | ||
| 19 | 19 | |
| 20 | 20 | use crate::i18n::Lang; |
| 21 | 21 | use crate::i18n::code::{self as g}; |
| 22 | -use crate::pages::passkeys::s; | |
| 23 | 22 | use crate::pages::repo_ctx::{RepoCtx, load_repo}; |
| 24 | 23 | use crate::pages::tree::{entry_rows, load_readme, read_dir, readme_card}; |
| 25 | 24 | use crate::state::AppState; |
| @@ -205,10 +204,7 @@ async fn scrub_page(cx: &Cx) -> Result<impl View> { | ||
| 205 | 204 | let readme = parts.readme.clone(); |
| 206 | 205 | let lang = ctx.lang; |
| 207 | 206 | let short: String = oid.chars().take(7).collect(); |
| 208 | - let sub = vec![ | |
| 209 | - SubPart::text(s(lang, "Files at this commit", "Bu commit'teki dosyalar")), | |
| 210 | - SubPart::text(title.clone()), | |
| 211 | - ]; | |
| 207 | + let sub = vec![SubPart::text(title.clone())]; | |
| 212 | 208 | Ok(view! { |
| 213 | 209 | shell(title: title.as_str(), viewer: ctx.viewer.as_ref(), |
| 214 | 210 | head(title: short.as_str(), sub: sub) |
crates/forge-web/src/pages/repo_secrets.rsmodified+3 -10
| @@ -18,7 +18,6 @@ use crate::audit::{self, Actor, Target}; | ||
| 18 | 18 | use crate::auth::{require_csrf, require_user}; |
| 19 | 19 | use crate::i18n::repo_admin::{self as g, K}; |
| 20 | 20 | use crate::i18n::{self, Lang}; |
| 21 | -use crate::pages::passkeys; | |
| 22 | 21 | use crate::pages::repo::repo_head; |
| 23 | 22 | use crate::pages::repo_ctx::{RepoCtx, RepoHead, load_repo}; |
| 24 | 23 | use crate::pages::repo_settings::settings_frame; |
| @@ -160,10 +159,9 @@ async fn frame_top( | ||
| 160 | 159 | #[default] child: Child<'_>, |
| 161 | 160 | ) -> Result<impl View> { |
| 162 | 161 | let notice = notice.map(|(key, is_error)| (g::t(lang, key), is_error)); |
| 163 | - let can_delete = head.can_delete; | |
| 164 | 162 | Ok(view! { |
| 165 | 163 | repo_head(head: head, title: Some(g::t(lang, K::Secrets).to_owned())) |
| 166 | - settings_frame(lang: lang, title: title, current: "secrets", can_delete: can_delete, | |
| 164 | + settings_frame(lang: lang, title: title, current: "secrets", | |
| 167 | 165 | if let Some((text, is_error)) = notice { |
| 168 | 166 | if is_error { |
| 169 | 167 | alert(message: text) |
| @@ -212,13 +210,11 @@ async fn secrets_body( | ||
| 212 | 210 | <div class="field"> |
| 213 | 211 | <label for="secret-name">(g::t(lang, K::Name))</label> |
| 214 | 212 | <input id="secret-name" type="text" name="name" value=(draft_name.as_str()) required=(true) maxlength="64" |
| 215 | - pattern="[A-Z_][A-Z0-9_]{0,63}" autocomplete="off" spellcheck="false" | |
| 216 | - placeholder="DEPLOY_TOKEN"> | |
| 213 | + pattern="[A-Z_][A-Z0-9_]{0,63}" autocomplete="off" spellcheck="false"> | |
| 217 | 214 | </div> |
| 218 | 215 | <div class="field"> |
| 219 | 216 | <label for="secret-value">(g::t(lang, K::Value))</label> |
| 220 | 217 | <textarea id="secret-value" name="value" required=(true) rows="6" autocomplete="off" spellcheck="false"></textarea> |
| 221 | - <p class="hint">(g::t(lang, K::SecretLimits))</p> | |
| 222 | 218 | </div> |
| 223 | 219 | <button type="submit" class="primary">(g::t(lang, K::SaveSecret))</button> |
| 224 | 220 | </form> |
| @@ -230,8 +226,6 @@ async fn secrets_body( | ||
| 230 | 226 | <h2>(g::t(lang, K::Secrets))</h2> |
| 231 | 227 | if rows.is_empty() { |
| 232 | 228 | <p class="state">(g::t(lang, K::NoSecrets))</p> |
| 233 | - } else { | |
| 234 | - <p class="hint">(g::t(lang, K::SecretsHelp))</p> | |
| 235 | 229 | } |
| 236 | 230 | <div> |
| 237 | 231 | for row in rows.iter() { |
| @@ -245,8 +239,7 @@ async fn secrets_body( | ||
| 245 | 239 | <span class="name"><code>(row.name.as_str())</code></span> |
| 246 | 240 | <span class="val">rel_time(lang: lang, stamp: row.updated_at.as_str())</span> |
| 247 | 241 | confirm_act(lang: lang, label: g::t(lang, K::Delete), action: delete_action.as_str(), csrf: csrf.as_str(), |
| 248 | - fields: vec![("name".to_owned(), row.name.clone())], | |
| 249 | - note: Some(passkeys::s(lang, "Jobs that use it fail until it is set again.", "Onu kullanan işler, yeniden ayarlanana kadar başarısız olur.").to_owned())) | |
| 242 | + fields: vec![("name".to_owned(), row.name.clone())]) | |
| 250 | 243 | </div> |
| 251 | 244 | } |
| 252 | 245 | } |
crates/forge-web/src/pages/repo_security.rsmodified+0 -1
| @@ -129,7 +129,6 @@ async fn security_body( | ||
| 129 | 129 | <p class="state">(g::t(lang, K::SecurityOff))</p> |
| 130 | 130 | } else { |
| 131 | 131 | <p class="state">(g::dependencies_summary(lang, dependencies, open_count))</p> |
| 132 | - <p class="hint">(g::t(lang, K::LockfilesRead))</p> | |
| 133 | 132 | } |
| 134 | 133 | if rows.is_empty() { |
| 135 | 134 | <p class="state">(g::t(lang, K::NoAlerts))</p> |
crates/forge-web/src/pages/repo_settings.rsmodified+272 -176
| @@ -1,9 +1,10 @@ | ||
| 1 | 1 | //! Page: repo settings (`/{owner}/{repo}/settings`). The owner, an instance admin and collaborators |
| 2 | 2 | //! with the Admin role get the page. It shows one section at a time, chosen by `?section=`: General |
| 3 | -//! (description, default branch, visibility, archive; the default), branch protection rules (Admin), | |
| 4 | -//! discussions and the danger zone (Delete: owner or instance admin only). Deleting moves the bare repo into `data_dir/trash` and removes its database | |
| 5 | -//! rows in one transaction. The repo is never erased from disk, so an admin can recover it from the | |
| 6 | -//! trash. | |
| 3 | +//! (description, default branch, and the Features switches: discussions and wiki; the default), branch | |
| 4 | +//! protection rules (Admin), and the danger zone (rename, then transfer, visibility, archive and | |
| 5 | +//! delete). Transfer and delete need Delete: owner or instance admin only. Deleting moves the bare repo | |
| 6 | +//! into `data_dir/trash` and removes its database rows in one transaction. The repo is never erased | |
| 7 | +//! from disk, so an admin can recover it from the trash. | |
| 7 | 8 | |
| 8 | 9 | use std::path::Path; |
| 9 | 10 | |
| @@ -12,7 +13,7 @@ use forge_core::protection::{ | ||
| 12 | 13 | validate_required_approvals, |
| 13 | 14 | }; |
| 14 | 15 | use forge_core::store::MAX_DESCRIPTION_CHARS; |
| 15 | -use forge_core::{AuditAction, Repo as RepoRow, Visibility}; | |
| 16 | +use forge_core::{AuditAction, Repo as RepoRow, User, Visibility}; | |
| 16 | 17 | use forge_git::browse::RefKind; |
| 17 | 18 | use forge_git::command::{GitCommand, GitEnv}; |
| 18 | 19 | use forge_git::repo::{ |
| @@ -33,12 +34,15 @@ use crate::auth::{require_csrf, require_user}; | ||
| 33 | 34 | use crate::i18n::merge_queue as mq; |
| 34 | 35 | use crate::i18n::repo_admin::{self as g, K}; |
| 35 | 36 | use crate::i18n::{self, Lang}; |
| 36 | -use crate::pages::discussion_settings::discussions_card; | |
| 37 | +use crate::pages::discussion_settings::discussions_switch; | |
| 37 | 38 | use crate::pages::passkeys; |
| 38 | 39 | use crate::pages::refs::load_refs; |
| 39 | 40 | use crate::pages::repo::repo_head; |
| 40 | 41 | use crate::pages::repo_ctx::{RepoCtx, RepoHead, load_repo}; |
| 42 | +use crate::pages::repo_rename::rename_section; | |
| 41 | 43 | use crate::pages::repo_settings_live::settings_head; |
| 44 | +use crate::pages::repo_transfer::{TransferStatus, transfer_section, transfer_status}; | |
| 45 | +use crate::pages::wiki::wiki_switch; | |
| 42 | 46 | use crate::state::AppState; |
| 43 | 47 | use crate::views::parts::{RailItem, confirm_act, post_act, rail}; |
| 44 | 48 | use crate::views::{alert, enc, shell}; |
| @@ -52,13 +56,12 @@ pub(crate) struct SectionQuery { | ||
| 52 | 56 | section: Option<String>, |
| 53 | 57 | } |
| 54 | 58 | |
| 55 | -/// The section to show: `branches`, `discussions`, or `danger` (only for a viewer who may delete the | |
| 56 | -/// repo). Anything else is `general`. | |
| 57 | -fn pick_section(raw: Option<&str>, can_delete: bool) -> &'static str { | |
| 59 | +/// The section to show: `branches`, or `danger` (the danger zone, for a viewer who may admin the | |
| 60 | +/// repo, which the page requires). Anything else, including the old `discussions`, is `general`. | |
| 61 | +fn pick_section(raw: Option<&str>) -> &'static str { | |
| 58 | 62 | match raw { |
| 59 | 63 | Some("branches") => "branches", |
| 60 | - Some("discussions") => "discussions", | |
| 61 | - Some("danger") if can_delete => "danger", | |
| 64 | + Some("danger") => "danger", | |
| 62 | 65 | _ => "general", |
| 63 | 66 | } |
| 64 | 67 | } |
| @@ -71,13 +74,15 @@ pub const NOTICE_COOKIE: &str = "forge_notice"; | ||
| 71 | 74 | const SETTINGS_NOTICE_COOKIE: &str = "forge_settings_notice"; |
| 72 | 75 | |
| 73 | 76 | /// Notice words, the text each one shows, and whether it is an error (shown as an alert). |
| 74 | -const SETTINGS_NOTICES: [(&str, K, bool); 11] = [ | |
| 77 | +const SETTINGS_NOTICES: [(&str, K, bool); 13] = [ | |
| 75 | 78 | ("saved", K::BranchRuleSaved, false), |
| 76 | 79 | ("removed", K::BranchRuleRemoved, false), |
| 77 | 80 | ("general", K::GeneralSaved, false), |
| 78 | 81 | ("visibility", K::VisibilityChanged, false), |
| 79 | 82 | ("archived", K::RepoArchived, false), |
| 80 | 83 | ("unarchived", K::RepoUnarchived, false), |
| 84 | + ("renamed", K::RenamedNotice, false), | |
| 85 | + ("transferred", K::TransferredNotice, false), | |
| 81 | 86 | ("description_long", K::DescriptionLong, true), |
| 82 | 87 | ("branch_missing", K::BranchMissing, true), |
| 83 | 88 | ("git_failed", K::DefaultBranchFailed, true), |
| @@ -192,7 +197,7 @@ pub fn take_notice(cx: &Cx) -> Option<String> { | ||
| 192 | 197 | } |
| 193 | 198 | |
| 194 | 199 | /// Sets the one-line notice shown on the next settings page view. |
| 195 | -fn set_settings_notice(cx: &Cx, word: &'static str) { | |
| 200 | +pub(crate) fn set_settings_notice(cx: &Cx, word: &'static str) { | |
| 196 | 201 | cookies(cx).add( |
| 197 | 202 | Cookie::build((SETTINGS_NOTICE_COOKIE, word)) |
| 198 | 203 | .path("/") |
| @@ -266,9 +271,131 @@ pub async fn notice_banner_for(lang: Lang, title: Option<String>) -> Result<impl | ||
| 266 | 271 | }) |
| 267 | 272 | } |
| 268 | 273 | |
| 269 | -/// The danger zone: explains what deleting does and holds the confirmation form. | |
| 274 | +/// What the danger zone's forms show when one came back with an error: the drafts the viewer typed and | |
| 275 | +/// the error each form got. A fresh page has the repo's own name in the rename form and nothing else. | |
| 276 | +pub(crate) struct DangerForms { | |
| 277 | + pub(crate) rename_name: String, | |
| 278 | + pub(crate) rename_error: Option<String>, | |
| 279 | + pub(crate) transfer_owner: String, | |
| 280 | + pub(crate) transfer_error: Option<String>, | |
| 281 | + pub(crate) delete_error: Option<String>, | |
| 282 | +} | |
| 283 | + | |
| 284 | +impl DangerForms { | |
| 285 | + pub(crate) fn fresh(ctx: &RepoCtx) -> Self { | |
| 286 | + Self { | |
| 287 | + rename_name: ctx.repo.name.clone(), | |
| 288 | + rename_error: None, | |
| 289 | + transfer_owner: String::new(), | |
| 290 | + transfer_error: None, | |
| 291 | + delete_error: None, | |
| 292 | + } | |
| 293 | + } | |
| 294 | +} | |
| 295 | + | |
| 296 | +/// The Visibility topic: the current value as a line, and the other side behind a confirm. | |
| 297 | +#[component] | |
| 298 | +async fn visibility_section( | |
| 299 | + lang: Lang, | |
| 300 | + title: String, | |
| 301 | + csrf: String, | |
| 302 | + visibility: Visibility, | |
| 303 | +) -> Result<impl View> { | |
| 304 | + let visibility_action = format!("/{title}/settings/visibility"); | |
| 305 | + let (current_visibility, flip_label, flip_confirm, flip_to) = | |
| 306 | + if visibility == Visibility::Public { | |
| 307 | + ( | |
| 308 | + g::t(lang, K::PublicOption), | |
| 309 | + g::t(lang, K::MakePrivate), | |
| 310 | + g::t(lang, K::MakePrivateConfirm), | |
| 311 | + "private", | |
| 312 | + ) | |
| 313 | + } else { | |
| 314 | + ( | |
| 315 | + g::t(lang, K::PrivateOption), | |
| 316 | + g::t(lang, K::MakePublic), | |
| 317 | + g::t(lang, K::MakePublicConfirm), | |
| 318 | + "public", | |
| 319 | + ) | |
| 320 | + }; | |
| 321 | + Ok(view! { | |
| 322 | + <section class="sec"> | |
| 323 | + <h2>(g::t(lang, K::VisibilityHeading))</h2> | |
| 324 | + <p class="state">(current_visibility)</p> | |
| 325 | + <div class="acts"> | |
| 326 | + confirm_act(lang: lang, label: flip_label, action: visibility_action.as_str(), csrf: csrf.as_str(), | |
| 327 | + fields: vec![("visibility".to_owned(), flip_to.to_owned()), ("understand".to_owned(), "on".to_owned())], | |
| 328 | + note: Some(flip_confirm.to_owned())) | |
| 329 | + </div> | |
| 330 | + </section> | |
| 331 | + }) | |
| 332 | +} | |
| 333 | + | |
| 334 | +/// The Archive topic: what archiving does, and the one action for the repo's state. | |
| 335 | +#[component] | |
| 336 | +async fn archive_section( | |
| 337 | + lang: Lang, | |
| 338 | + title: String, | |
| 339 | + csrf: String, | |
| 340 | + archived: bool, | |
| 341 | +) -> Result<impl View> { | |
| 342 | + let archive_action = format!("/{title}/settings/archive"); | |
| 343 | + Ok(view! { | |
| 344 | + <section class="sec"> | |
| 345 | + <h2>(g::t(lang, K::ArchiveHeading))</h2> | |
| 346 | + if archived { | |
| 347 | + <div class="acts"> | |
| 348 | + post_act(label: g::t(lang, K::UnarchiveRepo), action: archive_action.as_str(), csrf: csrf.as_str(), | |
| 349 | + fields: vec![("archived".to_owned(), "0".to_owned())]) | |
| 350 | + </div> | |
| 351 | + } else { | |
| 352 | + <div class="acts"> | |
| 353 | + confirm_act(lang: lang, label: g::t(lang, K::ArchiveRepo), action: archive_action.as_str(), csrf: csrf.as_str(), | |
| 354 | + fields: vec![("archived".to_owned(), "1".to_owned())], note: Some(g::t(lang, K::ArchiveConfirm).to_owned())) | |
| 355 | + </div> | |
| 356 | + } | |
| 357 | + </section> | |
| 358 | + }) | |
| 359 | +} | |
| 360 | + | |
| 361 | +/// The danger zone, in order: Rename; Transfer, Visibility, Archive and Delete for a viewer who may | |
| 362 | +/// delete the repo (Transfer and Delete are hidden from the rest). Every topic is a `.sec` whose own | |
| 363 | +/// action is a small pill that opens its form or confirm in place. | |
| 270 | 364 | #[component] |
| 271 | -async fn danger_zone( | |
| 365 | +async fn danger_section( | |
| 366 | + lang: Lang, | |
| 367 | + title: String, | |
| 368 | + csrf: String, | |
| 369 | + can_delete: bool, | |
| 370 | + visibility: Visibility, | |
| 371 | + archived: bool, | |
| 372 | + forms: DangerForms, | |
| 373 | + transfer: TransferStatus, | |
| 374 | +) -> Result<impl View> { | |
| 375 | + let DangerForms { | |
| 376 | + rename_name, | |
| 377 | + rename_error, | |
| 378 | + transfer_owner, | |
| 379 | + transfer_error, | |
| 380 | + delete_error, | |
| 381 | + } = forms; | |
| 382 | + Ok(view! { | |
| 383 | + rename_section(lang: lang, title: title.clone(), csrf: csrf.clone(), name: rename_name, error: rename_error) | |
| 384 | + if can_delete { | |
| 385 | + transfer_section(lang: lang, title: title.clone(), csrf: csrf.clone(), status: transfer, | |
| 386 | + new_owner: transfer_owner, error: transfer_error) | |
| 387 | + } | |
| 388 | + visibility_section(lang: lang, title: title.clone(), csrf: csrf.clone(), visibility: visibility) | |
| 389 | + archive_section(lang: lang, title: title.clone(), csrf: csrf.clone(), archived: archived) | |
| 390 | + if can_delete { | |
| 391 | + delete_section(lang: lang, csrf: csrf, title: title, error: delete_error) | |
| 392 | + } | |
| 393 | + }) | |
| 394 | +} | |
| 395 | + | |
| 396 | +/// The Delete topic: what deleting does, and the confirmation form, which opens in place. | |
| 397 | +#[component] | |
| 398 | +async fn delete_section( | |
| 272 | 399 | lang: Lang, |
| 273 | 400 | csrf: String, |
| 274 | 401 | title: String, |
| @@ -278,9 +405,7 @@ async fn danger_zone( | ||
| 278 | 405 | let open = error.is_some(); |
| 279 | 406 | Ok(view! { |
| 280 | 407 | <section class="sec"> |
| 281 | - <h2>(g::t(lang, K::DangerZone))</h2> | |
| 282 | - <p class="hint">(g::t(lang, K::DeleteRepoHelp))</p> | |
| 283 | - <p class="hint">(g::t(lang, K::DeleteTrashHelp))</p> | |
| 408 | + <h2>(g::t(lang, K::Delete))</h2> | |
| 284 | 409 | <div class="acts"> |
| 285 | 410 | <details class="reveal" open=(open)> |
| 286 | 411 | <summary class="act danger">(g::t(lang, K::DeleteRepo))</summary> |
| @@ -308,37 +433,30 @@ async fn danger_zone( | ||
| 308 | 433 | |
| 309 | 434 | /// The settings frame: the rail of settings pages beside the sheet holding the page's own content |
| 310 | 435 | /// (its children). Every settings page shows the same rail, one list of every page. `current` names |
| 311 | -/// the page shown (`general`, `branches`, `webhooks`, ...) and marks its rail item. Danger zone is | |
| 312 | -/// listed only for a viewer who may delete the repo (`can_delete`). | |
| 436 | +/// the page shown (`general`, `branches`, `webhooks`, ...) and marks its rail item. Every settings | |
| 437 | +/// page is for a repo admin, so the Danger zone is always listed. | |
| 313 | 438 | #[component] |
| 314 | 439 | pub async fn settings_frame( |
| 315 | 440 | lang: Lang, |
| 316 | 441 | title: String, |
| 317 | 442 | current: &'static str, |
| 318 | - can_delete: bool, | |
| 319 | 443 | #[default] child: Child<'_>, |
| 320 | 444 | ) -> Result<impl View> { |
| 321 | - let discussions_label = crate::i18n::community::t(lang, crate::i18n::community::K::Discussions); | |
| 322 | 445 | let item = |name: &str, href: String, on: bool| RailItem { |
| 323 | 446 | name: name.to_owned(), |
| 324 | 447 | val: String::new(), |
| 325 | 448 | href, |
| 326 | 449 | current: on, |
| 327 | 450 | }; |
| 328 | - let mut items = vec![ | |
| 451 | + let items = vec![ | |
| 329 | 452 | item(g::t(lang, K::General), format!("/{title}/settings"), current == "general"), |
| 330 | 453 | item(g::t(lang, K::Collaborators), format!("/{title}/settings/collaborators"), current == "collaborators"), |
| 331 | 454 | item(g::t(lang, K::BranchProtection), format!("/{title}/settings?section=branches"), current == "branches"), |
| 332 | - item(discussions_label, format!("/{title}/settings?section=discussions"), current == "discussions"), | |
| 333 | 455 | item(g::t(lang, K::Webhooks), format!("/{title}/settings/hooks"), current == "webhooks"), |
| 334 | 456 | item(g::t(lang, K::Mirrors), format!("/{title}/settings/mirrors"), current == "mirrors"), |
| 335 | 457 | item(g::t(lang, K::Secrets), format!("/{title}/settings/secrets"), current == "secrets"), |
| 336 | - item(crate::i18n::code::t(lang, crate::i18n::code::K::TabWiki), format!("/{title}/settings/wiki"), current == "wiki"), | |
| 337 | - item(g::t(lang, K::RenameTransferNav), format!("/{title}/settings/rename"), current == "rename"), | |
| 458 | + item(g::t(lang, K::DangerZone), format!("/{title}/settings?section=danger"), current == "danger"), | |
| 338 | 459 | ]; |
| 339 | - if can_delete { | |
| 340 | - items.push(item(g::t(lang, K::DangerZone), format!("/{title}/settings?section=danger"), current == "danger")); | |
| 341 | - } | |
| 342 | 460 | Ok(view! { |
| 343 | 461 | <div class="work"> |
| 344 | 462 | rail(label: g::t(lang, K::SettingsNavLabel), items: items) |
| @@ -349,8 +467,10 @@ pub async fn settings_frame( | ||
| 349 | 467 | }) |
| 350 | 468 | } |
| 351 | 469 | |
| 352 | -/// The General section: description and default branch (one form), then visibility and archive. | |
| 353 | -/// Each form carries its own CSRF token. An empty repo shows "No branches yet" and no selector. | |
| 470 | + | |
| 471 | +/// The General section: description and default branch in one form, under no heading (the page's | |
| 472 | +/// head names it), then the Features topic with one switch per feature. Each form carries its own | |
| 473 | +/// CSRF token. An empty repo shows "No branches yet" and no selector. | |
| 354 | 474 | #[component] |
| 355 | 475 | async fn general_section( |
| 356 | 476 | lang: Lang, |
| @@ -359,29 +479,10 @@ async fn general_section( | ||
| 359 | 479 | description: String, |
| 360 | 480 | default_branch: String, |
| 361 | 481 | branches: Vec<String>, |
| 362 | - visibility: Visibility, | |
| 363 | - archived: bool, | |
| 482 | + discussions_on: bool, | |
| 483 | + wiki_on: bool, | |
| 364 | 484 | ) -> Result<impl View> { |
| 365 | 485 | let general_action = format!("/{title}/settings/general"); |
| 366 | - let visibility_action = format!("/{title}/settings/visibility"); | |
| 367 | - let archive_action = format!("/{title}/settings/archive"); | |
| 368 | - // The visibility row shows where the repo is now and offers the other side behind a confirm. | |
| 369 | - let (current_visibility, flip_label, flip_confirm, flip_to) = | |
| 370 | - if visibility == Visibility::Public { | |
| 371 | - ( | |
| 372 | - g::t(lang, K::PublicOption), | |
| 373 | - g::t(lang, K::MakePrivate), | |
| 374 | - g::t(lang, K::MakePrivateConfirm), | |
| 375 | - "private", | |
| 376 | - ) | |
| 377 | - } else { | |
| 378 | - ( | |
| 379 | - g::t(lang, K::PrivateOption), | |
| 380 | - g::t(lang, K::MakePublic), | |
| 381 | - g::t(lang, K::MakePublicConfirm), | |
| 382 | - "public", | |
| 383 | - ) | |
| 384 | - }; | |
| 385 | 486 | let options: Vec<(String, bool)> = branches |
| 386 | 487 | .into_iter() |
| 387 | 488 | .map(|b| { |
| @@ -391,12 +492,10 @@ async fn general_section( | ||
| 391 | 492 | .collect(); |
| 392 | 493 | Ok(view! { |
| 393 | 494 | <section class="sec"> |
| 394 | - <h2>(g::t(lang, K::General))</h2> | |
| 395 | 495 | <form method="post" action=(general_action) class="fields"> |
| 396 | 496 | <div class="field"> |
| 397 | 497 | <label for="repo-description">(g::t(lang, K::Description))</label> |
| 398 | 498 | <input id="repo-description" type="text" name="description" value=(description) maxlength="350" autocomplete="off"> |
| 399 | - <p class="hint">(g::t(lang, K::DescriptionHelp))</p> | |
| 400 | 499 | </div> |
| 401 | 500 | if options.is_empty() { |
| 402 | 501 | <p class="state">(g::t(lang, K::DefaultBranch)) ": " (g::t(lang, K::NoBranchesYet))</p> |
| @@ -416,30 +515,9 @@ async fn general_section( | ||
| 416 | 515 | </section> |
| 417 | 516 | |
| 418 | 517 | <section class="sec"> |
| 419 | - <h2>(g::t(lang, K::VisibilityHeading))</h2> | |
| 420 | - <p class="state">(current_visibility)</p> | |
| 421 | - <div class="acts"> | |
| 422 | - confirm_act(lang: lang, label: flip_label, action: visibility_action.as_str(), csrf: csrf.as_str(), | |
| 423 | - fields: vec![("visibility".to_owned(), flip_to.to_owned()), ("understand".to_owned(), "on".to_owned())], | |
| 424 | - note: Some(flip_confirm.to_owned())) | |
| 425 | - </div> | |
| 426 | - </section> | |
| 427 | - | |
| 428 | - <section class="sec"> | |
| 429 | - <h2>(g::t(lang, K::ArchiveHeading))</h2> | |
| 430 | - if archived { | |
| 431 | - <p class="hint">(g::t(lang, K::ArchivedHelp))</p> | |
| 432 | - <div class="acts"> | |
| 433 | - post_act(label: g::t(lang, K::UnarchiveRepo), action: archive_action.as_str(), csrf: csrf.as_str(), | |
| 434 | - fields: vec![("archived".to_owned(), "0".to_owned())]) | |
| 435 | - </div> | |
| 436 | - } else { | |
| 437 | - <p class="hint">(g::t(lang, K::ArchiveHelp))</p> | |
| 438 | - <div class="acts"> | |
| 439 | - confirm_act(lang: lang, label: g::t(lang, K::ArchiveRepo), action: archive_action.as_str(), csrf: csrf.as_str(), | |
| 440 | - fields: vec![("archived".to_owned(), "1".to_owned())], note: Some(g::t(lang, K::ArchiveConfirm).to_owned())) | |
| 441 | - </div> | |
| 442 | - } | |
| 518 | + <h2>(g::t(lang, K::Features))</h2> | |
| 519 | + discussions_switch(lang: lang, action: format!("/{title}/settings/discussions"), csrf: csrf.clone(), enabled: discussions_on) | |
| 520 | + wiki_switch(action: format!("/{title}/settings/wiki"), csrf: csrf.clone(), enabled: wiki_on) | |
| 443 | 521 | </section> |
| 444 | 522 | }) |
| 445 | 523 | } |
| @@ -648,7 +726,6 @@ async fn branch_rule_form( | ||
| 648 | 726 | <div class="field"> |
| 649 | 727 | <label for=(pattern_id.as_str())>(g::t(lang, K::BranchPattern))</label> |
| 650 | 728 | <input id=(pattern_id.as_str()) type="text" name="pattern" value=(pattern.as_str()) autocomplete="off" spellcheck="false" required=(true)> |
| 651 | - <p class="hint">(g::t(lang, K::PatternHelp))</p> | |
| 652 | 729 | </div> |
| 653 | 730 | } |
| 654 | 731 | <div class="rule-section"> |
| @@ -694,7 +771,7 @@ async fn branch_rule_form( | ||
| 694 | 771 | </div> |
| 695 | 772 | <div class="field"> |
| 696 | 773 | <label for=(checks_id.as_str())>(g::t(lang, K::SectionChecks))</label> |
| 697 | - <input id=(checks_id.as_str()) type="text" name="required_checks" value=(required_checks.as_str()) autocomplete="off" spellcheck="false" placeholder="ci/test, ci/lint" aria-label=(g::t(lang, K::RequiredChecks))> | |
| 774 | + <input id=(checks_id.as_str()) type="text" name="required_checks" value=(required_checks.as_str()) autocomplete="off" spellcheck="false" aria-label=(g::t(lang, K::RequiredChecks))> | |
| 698 | 775 | if !contexts.is_empty() { |
| 699 | 776 | <div class="acts recent-checks"> |
| 700 | 777 | <span class="hint">(g::t(lang, K::RecentContexts))</span> |
| @@ -781,13 +858,80 @@ struct SettingsView { | ||
| 781 | 858 | /// A settings notice: its text and whether it is an error. |
| 782 | 859 | notice: Option<(K, bool)>, |
| 783 | 860 | draft: RuleDraft, |
| 784 | - delete_error: Option<String>, | |
| 861 | + danger: DangerForms, | |
| 862 | + transfer: TransferStatus, | |
| 863 | + wiki_on: bool, | |
| 785 | 864 | /// Recently reported status contexts, offered as required-check suggestions. |
| 786 | 865 | contexts: Vec<String>, |
| 787 | 866 | } |
| 788 | 867 | |
| 868 | +/// What a settings page shows: its section, a notice, a rule draft and the danger zone's forms. A | |
| 869 | +/// page drawn again after a refused POST passes what the viewer had typed. | |
| 870 | +pub(crate) struct Shown { | |
| 871 | + section: &'static str, | |
| 872 | + notice: Option<(K, bool)>, | |
| 873 | + draft: Option<RuleDraft>, | |
| 874 | + danger: DangerForms, | |
| 875 | +} | |
| 876 | + | |
| 877 | +impl Shown { | |
| 878 | + /// The danger zone, with its forms as they came back. | |
| 879 | + pub(crate) fn danger(danger: DangerForms) -> Self { | |
| 880 | + Self { | |
| 881 | + section: "danger", | |
| 882 | + notice: None, | |
| 883 | + draft: None, | |
| 884 | + danger, | |
| 885 | + } | |
| 886 | + } | |
| 887 | +} | |
| 888 | + | |
| 889 | +/// Draws the settings page at `shown.section`. The page and every POST that is refused draw through | |
| 890 | +/// here, so a refused form comes back as the same page with its message. | |
| 891 | +pub(crate) async fn render_settings( | |
| 892 | + cx: &Cx, | |
| 893 | + ctx: RepoCtx, | |
| 894 | + user: User, | |
| 895 | + csrf: String, | |
| 896 | + lang: Lang, | |
| 897 | + shown: Shown, | |
| 898 | +) -> Result<impl View> { | |
| 899 | + let state = app_context::<AppState>(cx); | |
| 900 | + let Shown { | |
| 901 | + section, | |
| 902 | + notice, | |
| 903 | + draft, | |
| 904 | + danger, | |
| 905 | + } = shown; | |
| 906 | + let transfer = if ctx.can_delete() { | |
| 907 | + transfer_status(state, lang, &ctx.repo.id, &user).await? | |
| 908 | + } else { | |
| 909 | + TransferStatus::default() | |
| 910 | + }; | |
| 911 | + let page = SettingsView { | |
| 912 | + rules: state.store.list_branch_rules(&ctx.repo.id).await?, | |
| 913 | + notice, | |
| 914 | + draft: draft.unwrap_or_else(|| RuleDraft::for_default_branch(&ctx.repo.default_branch)), | |
| 915 | + danger, | |
| 916 | + transfer, | |
| 917 | + wiki_on: state.store.wiki_enabled(&ctx.repo.id).await?, | |
| 918 | + contexts: state | |
| 919 | + .store | |
| 920 | + .recent_status_contexts(&ctx.repo.id, 20) | |
| 921 | + .await?, | |
| 922 | + }; | |
| 923 | + let frame = SettingsFrame::new(&ctx, state, lang).await?; | |
| 924 | + let branches = load_branch_names(&ctx).await?; | |
| 925 | + Ok(view! { cx => | |
| 926 | + shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(), | |
| 927 | + settings_body(lang: lang, head: frame.head, default_branch: frame.default_branch, archived: frame.archived, | |
| 928 | + branches: branches, title: frame.title, csrf: csrf, | |
| 929 | + can_delete: frame.can_delete, section: section, page: page)) | |
| 930 | + }) | |
| 931 | +} | |
| 932 | + | |
| 789 | 933 | /// The settings body: the repo header with Settings active, then the rail and one section (`section`: |
| 790 | -/// general, branches, discussions or danger) in the sheet. | |
| 934 | +/// general, branches or danger) in the sheet. | |
| 791 | 935 | #[component] |
| 792 | 936 | async fn settings_body( |
| 793 | 937 | lang: Lang, |
| @@ -811,7 +955,9 @@ async fn settings_body( | ||
| 811 | 955 | rules, |
| 812 | 956 | notice, |
| 813 | 957 | draft, |
| 814 | - delete_error, | |
| 958 | + danger, | |
| 959 | + transfer, | |
| 960 | + wiki_on, | |
| 815 | 961 | contexts, |
| 816 | 962 | } = page; |
| 817 | 963 | // A card takes the draft when the draft has an error and the pattern is its rule's pattern. |
| @@ -848,15 +994,13 @@ async fn settings_body( | ||
| 848 | 994 | let notice = notice.map(|(key, is_error)| (g::t(lang, key), is_error)); |
| 849 | 995 | let section_name = match section { |
| 850 | 996 | "branches" => g::t(lang, K::BranchProtection), |
| 851 | - "discussions" => crate::i18n::community::t(lang, crate::i18n::community::K::Discussions), | |
| 852 | 997 | "danger" => g::t(lang, K::DangerZone), |
| 853 | 998 | _ => g::t(lang, K::General), |
| 854 | 999 | }; |
| 855 | - // Only one section is rendered. The danger section is only chosen for a viewer who may delete | |
| 856 | - // (see `pick_section`), and it is last so that its moves come after every clone. | |
| 1000 | + // Only one section is rendered. | |
| 857 | 1001 | Ok(view! { |
| 858 | 1002 | repo_head(head: head, title: Some(section_name.to_owned())) |
| 859 | - settings_frame(lang: lang, title: title.clone(), current: section, can_delete: can_delete, | |
| 1003 | + settings_frame(lang: lang, title: title.clone(), current: section, | |
| 860 | 1004 | if let Some((text, is_error)) = notice { |
| 861 | 1005 | if is_error { |
| 862 | 1006 | alert(message: text) |
| @@ -867,22 +1011,19 @@ async fn settings_body( | ||
| 867 | 1011 | if section == "general" { |
| 868 | 1012 | general_section(lang: lang, title: title.clone(), csrf: csrf.clone(), description: description, |
| 869 | 1013 | default_branch: default_branch.clone(), branches: branches, |
| 870 | - visibility: visibility, archived: archived) | |
| 1014 | + discussions_on: discussions_on, wiki_on: wiki_on) | |
| 871 | 1015 | } |
| 872 | 1016 | if section == "branches" { |
| 873 | 1017 | <section class="sec"> |
| 874 | 1018 | <h2>(g::t(lang, K::BranchProtection))</h2> |
| 875 | - <p class="hint">(g::t(lang, K::BranchProtectionHelp))</p> | |
| 876 | 1019 | branch_rule_cards(lang: lang, cards: cards, builtin_row: builtin_row, default_branch: default_branch.clone(), |
| 877 | 1020 | new_draft: new_draft, new_open: new_open, csrf: csrf.clone(), save_action: rules_action, |
| 878 | 1021 | delete_action: delete_action, contexts: contexts) |
| 879 | 1022 | </section> |
| 880 | 1023 | } |
| 881 | - if section == "discussions" { | |
| 882 | - discussions_card(lang: lang, action: format!("/{title}/settings/discussions"), csrf: csrf.clone(), enabled: discussions_on) | |
| 883 | - } | |
| 884 | - if section == "danger" && can_delete { | |
| 885 | - danger_zone(lang: lang, csrf: csrf, title: title, error: delete_error) | |
| 1024 | + if section == "danger" { | |
| 1025 | + danger_section(lang: lang, title: title, csrf: csrf, can_delete: can_delete, | |
| 1026 | + visibility: visibility, archived: archived, forms: danger, transfer: transfer) | |
| 886 | 1027 | } |
| 887 | 1028 | ) |
| 888 | 1029 | }) |
| @@ -925,30 +1066,13 @@ async fn settings_page(cx: &Cx) -> Result<impl View> { | ||
| 925 | 1066 | } |
| 926 | 1067 | let lang = i18n::lang(cx, Some(&user)); |
| 927 | 1068 | let query = query_params::<SectionQuery>(cx)?; |
| 928 | - let section = pick_section(query.section.as_deref(), ctx.can_delete()); | |
| 929 | - let rules = app_context::<AppState>(cx) | |
| 930 | - .store | |
| 931 | - .list_branch_rules(&ctx.repo.id) | |
| 932 | - .await?; | |
| 933 | - let page = SettingsView { | |
| 934 | - rules, | |
| 1069 | + let shown = Shown { | |
| 1070 | + section: pick_section(query.section.as_deref()), | |
| 935 | 1071 | notice: take_settings_notice(cx), |
| 936 | - draft: RuleDraft::for_default_branch(&ctx.repo.default_branch), | |
| 937 | - delete_error: None, | |
| 938 | - contexts: app_context::<AppState>(cx) | |
| 939 | - .store | |
| 940 | - .recent_status_contexts(&ctx.repo.id, 20) | |
| 941 | - .await?, | |
| 1072 | + draft: None, | |
| 1073 | + danger: DangerForms::fresh(&ctx), | |
| 942 | 1074 | }; |
| 943 | - let csrf = session.csrf_token.clone(); | |
| 944 | - let frame = SettingsFrame::new(&ctx, app_context::<AppState>(cx), lang).await?; | |
| 945 | - let branches = load_branch_names(&ctx).await?; | |
| 946 | - Ok(view! { | |
| 947 | - shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(), | |
| 948 | - settings_body(lang: lang, head: frame.head, default_branch: frame.default_branch, archived: frame.archived, | |
| 949 | - branches: branches, title: frame.title, csrf: csrf, | |
| 950 | - can_delete: frame.can_delete, section: section, page: page)) | |
| 951 | - }) | |
| 1075 | + render_settings(cx, ctx, user, session.csrf_token.clone(), lang, shown).await | |
| 952 | 1076 | } |
| 953 | 1077 | |
| 954 | 1078 | /// Saves the description and the default branch together. The form is checked for CSRF and |
| @@ -1035,12 +1159,12 @@ async fn settings_visibility_save(cx: &Cx, Form(form): Form<VisibilityForm>) -> | ||
| 1035 | 1159 | let title = format!("{}/{}", ctx.repo.owner_name, ctx.repo.name); |
| 1036 | 1160 | let Ok(target) = form.visibility.parse::<Visibility>() else { |
| 1037 | 1161 | set_settings_notice(cx, "bad_form"); |
| 1038 | - return Ok(back_to_settings(&title)); | |
| 1162 | + return Ok(back_to_section(&title, "danger")); | |
| 1039 | 1163 | }; |
| 1040 | 1164 | if target != ctx.repo.visibility { |
| 1041 | 1165 | if form.understand.is_none() { |
| 1042 | 1166 | set_settings_notice(cx, "understand"); |
| 1043 | - return Ok(back_to_settings(&title)); | |
| 1167 | + return Ok(back_to_section(&title, "danger")); | |
| 1044 | 1168 | } |
| 1045 | 1169 | let state = app_context::<AppState>(cx); |
| 1046 | 1170 | state |
| @@ -1070,7 +1194,7 @@ async fn settings_visibility_save(cx: &Cx, Form(form): Form<VisibilityForm>) -> | ||
| 1070 | 1194 | .await; |
| 1071 | 1195 | set_settings_notice(cx, "visibility"); |
| 1072 | 1196 | } |
| 1073 | - Ok(back_to_settings(&title)) | |
| 1197 | + Ok(back_to_section(&title, "danger")) | |
| 1074 | 1198 | } |
| 1075 | 1199 | |
| 1076 | 1200 | /// Archives (`archived=1`) or unarchives (`archived=0`) the repo. Archiving is an Admin action, and |
| @@ -1090,7 +1214,7 @@ async fn settings_archive_save(cx: &Cx, Form(form): Form<ArchiveForm>) -> Result | ||
| 1090 | 1214 | "0" => false, |
| 1091 | 1215 | _ => { |
| 1092 | 1216 | set_settings_notice(cx, "bad_form"); |
| 1093 | - return Ok(back_to_settings(&title)); | |
| 1217 | + return Ok(back_to_section(&title, "danger")); | |
| 1094 | 1218 | } |
| 1095 | 1219 | }; |
| 1096 | 1220 | let state = app_context::<AppState>(cx); |
| @@ -1125,7 +1249,7 @@ async fn settings_archive_save(cx: &Cx, Form(form): Form<ArchiveForm>) -> Result | ||
| 1125 | 1249 | "repo archive flag changed" |
| 1126 | 1250 | ); |
| 1127 | 1251 | set_settings_notice(cx, if archived { "archived" } else { "unarchived" }); |
| 1128 | - Ok(back_to_settings(&title)) | |
| 1252 | + Ok(back_to_section(&title, "danger")) | |
| 1129 | 1253 | } |
| 1130 | 1254 | |
| 1131 | 1255 | /// Deletes the repo when the viewer may delete it, the CSRF token is valid and the confirmation |
| @@ -1237,30 +1361,17 @@ async fn settings_delete(cx: &Cx, Form(form): Form<DeleteForm>) -> Result<impl V | ||
| 1237 | 1361 | return Err(see_other(format!("/{}?tab=repositories", enc(&ctx.repo.owner_name))).into()); |
| 1238 | 1362 | } |
| 1239 | 1363 | |
| 1240 | - let rules = app_context::<AppState>(cx) | |
| 1241 | - .store | |
| 1242 | - .list_branch_rules(&ctx.repo.id) | |
| 1243 | - .await?; | |
| 1244 | - let page = SettingsView { | |
| 1245 | - rules, | |
| 1364 | + // The delete form lives in the danger zone, so a failed confirmation draws that section again. | |
| 1365 | + let shown = Shown { | |
| 1366 | + section: "danger", | |
| 1246 | 1367 | notice: None, |
| 1247 | - draft: RuleDraft::for_default_branch(&ctx.repo.default_branch), | |
| 1248 | - delete_error: error, | |
| 1249 | - contexts: app_context::<AppState>(cx) | |
| 1250 | - .store | |
| 1251 | - .recent_status_contexts(&ctx.repo.id, 20) | |
| 1252 | - .await?, | |
| 1368 | + draft: None, | |
| 1369 | + danger: DangerForms { | |
| 1370 | + delete_error: error, | |
| 1371 | + ..DangerForms::fresh(&ctx) | |
| 1372 | + }, | |
| 1253 | 1373 | }; |
| 1254 | - let csrf = session.csrf_token.clone(); | |
| 1255 | - let frame = SettingsFrame::new(&ctx, app_context::<AppState>(cx), lang).await?; | |
| 1256 | - let branches = load_branch_names(&ctx).await?; | |
| 1257 | - // The delete form lives in the danger section, so a failed confirmation re-renders that section. | |
| 1258 | - Ok(view! { | |
| 1259 | - shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(), | |
| 1260 | - settings_body(lang: lang, head: frame.head, default_branch: frame.default_branch, archived: frame.archived, | |
| 1261 | - branches: branches, title: frame.title, csrf: csrf, | |
| 1262 | - can_delete: frame.can_delete, section: "danger", page: page)) | |
| 1263 | - }) | |
| 1374 | + render_settings(cx, ctx, user, session.csrf_token.clone(), lang, shown).await | |
| 1264 | 1375 | } |
| 1265 | 1376 | |
| 1266 | 1377 | /// Adds a branch rule or updates the one with the same pattern. The form is checked for CSRF and |
| @@ -1299,41 +1410,26 @@ async fn settings_branch_save(cx: &Cx, Form(form): Form<BranchForm>) -> Result<i | ||
| 1299 | 1410 | let flags = match checked.and_then(|()| parse_rule_flags(lang, &form)) { |
| 1300 | 1411 | Ok(flags) => flags, |
| 1301 | 1412 | Err(message) => { |
| 1302 | - let rules = app_context::<AppState>(cx) | |
| 1303 | - .store | |
| 1304 | - .list_branch_rules(&ctx.repo.id) | |
| 1305 | - .await?; | |
| 1306 | - let page = SettingsView { | |
| 1307 | - rules, | |
| 1413 | + let draft = RuleDraft { | |
| 1414 | + pattern, | |
| 1415 | + allow_force_push: form.allow_force_push.is_some(), | |
| 1416 | + allow_deletion: form.allow_deletion.is_some(), | |
| 1417 | + required_approvals: form.required_approvals.clone(), | |
| 1418 | + block_on_changes_requested: form.block_on_changes_requested.is_some(), | |
| 1419 | + require_up_to_date: form.require_up_to_date.is_some(), | |
| 1420 | + restrict_push: form.restrict_push.is_some(), | |
| 1421 | + require_merge_queue: form.require_merge_queue.is_some(), | |
| 1422 | + required_checks: form.required_checks.clone(), | |
| 1423 | + error: Some(message), | |
| 1424 | + is_new, | |
| 1425 | + }; | |
| 1426 | + let shown = Shown { | |
| 1427 | + section: "branches", | |
| 1308 | 1428 | notice: None, |
| 1309 | - draft: RuleDraft { | |
| 1310 | - pattern, | |
| 1311 | - allow_force_push: form.allow_force_push.is_some(), | |
| 1312 | - allow_deletion: form.allow_deletion.is_some(), | |
| 1313 | - required_approvals: form.required_approvals.clone(), | |
| 1314 | - block_on_changes_requested: form.block_on_changes_requested.is_some(), | |
| 1315 | - require_up_to_date: form.require_up_to_date.is_some(), | |
| 1316 | - restrict_push: form.restrict_push.is_some(), | |
| 1317 | - require_merge_queue: form.require_merge_queue.is_some(), | |
| 1318 | - required_checks: form.required_checks.clone(), | |
| 1319 | - error: Some(message), | |
| 1320 | - is_new, | |
| 1321 | - }, | |
| 1322 | - delete_error: None, | |
| 1323 | - contexts: app_context::<AppState>(cx) | |
| 1324 | - .store | |
| 1325 | - .recent_status_contexts(&ctx.repo.id, 20) | |
| 1326 | - .await?, | |
| 1429 | + draft: Some(draft), | |
| 1430 | + danger: DangerForms::fresh(&ctx), | |
| 1327 | 1431 | }; |
| 1328 | - let csrf = session.csrf_token.clone(); | |
| 1329 | - let frame = SettingsFrame::new(&ctx, app_context::<AppState>(cx), lang).await?; | |
| 1330 | - let branches = load_branch_names(&ctx).await?; | |
| 1331 | - return Ok(view! { | |
| 1332 | - shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(), | |
| 1333 | - settings_body(lang: lang, head: frame.head, default_branch: frame.default_branch, archived: frame.archived, | |
| 1334 | - branches: branches, title: frame.title, csrf: csrf, | |
| 1335 | - can_delete: frame.can_delete, section: "branches", page: page)) | |
| 1336 | - }); | |
| 1432 | + return render_settings(cx, ctx, user, session.csrf_token.clone(), lang, shown).await; | |
| 1337 | 1433 | } |
| 1338 | 1434 | }; |
| 1339 | 1435 |
crates/forge-web/src/pages/repo_settings_live.rsmodified+0 -15
| @@ -39,11 +39,6 @@ pub fn security_live_url(owner: &str, repo: &str) -> String { | ||
| 39 | 39 | format!("/{owner}/{repo}/security/live") |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | -/// The stream URL of the transfer page of `owner/repo`. | |
| 43 | -pub fn transfer_live_url(owner: &str, repo: &str) -> String { | |
| 44 | - format!("/{owner}/{repo}/transfer/live") | |
| 45 | -} | |
| 46 | - | |
| 47 | 42 | /// The header of a settings page. It follows the settings stream, which carries the refs too, since |
| 48 | 43 | /// the branch picker of the protection rules lists them. |
| 49 | 44 | pub async fn settings_head(ctx: &RepoCtx, state: &AppState) -> Result<RepoHead> { |
| @@ -83,16 +78,6 @@ async fn security_live(cx: &Cx) -> Result<Response> { | ||
| 83 | 78 | stream_wakes(cx, &state.live, &[Topic::RepoSettings(ctx.repo.id.clone())]) |
| 84 | 79 | } |
| 85 | 80 | |
| 86 | -/// The transfer page's stream. It takes the check of the transfer page: a signed-in viewer who may | |
| 87 | -/// read the repo. | |
| 88 | -#[route(GET "/{owner}/{repo}/transfer/live")] | |
| 89 | -async fn transfer_live(cx: &Cx) -> Result<Response> { | |
| 90 | - let ctx = load_repo(cx, path_param::<Owner>(cx), path_param::<Repo>(cx)).await?; | |
| 91 | - require_user(cx).await?; | |
| 92 | - let state = app_context::<AppState>(cx); | |
| 93 | - stream_wakes(cx, &state.live, &[Topic::RepoSettings(ctx.repo.id.clone())]) | |
| 94 | -} | |
| 95 | - | |
| 96 | 81 | // The write layer |
| 97 | 82 | |
| 98 | 83 | /// Wraps every request. Only a POST under the settings or security paths does anything. Registered |
crates/forge-web/src/pages/repo_settings_live_tests.rsmodified+1 -1
| @@ -102,7 +102,7 @@ async fn the_streams_check_who_may_open_them() { | ||
| 102 | 102 | let anonymous = get(&site, "/owner/proj/settings/live", None).await; |
| 103 | 103 | assert_ne!(anonymous.status().as_u16(), 200, "settings: anonymous"); |
| 104 | 104 | |
| 105 | - for path in ["/owner/proj/security/live", "/owner/proj/transfer/live"] { | |
| 105 | + for path in ["/owner/proj/security/live"] { | |
| 106 | 106 | let reader = get(&site, path, Some(&reader_cookie)).await; |
| 107 | 107 | assert_eq!(reader.status().as_u16(), 200, "{path}: reader"); |
| 108 | 108 | let anonymous = get(&site, path, None).await; |
crates/forge-web/src/pages/repo_transfer.rsmodified+94 -87
| @@ -1,10 +1,10 @@ | ||
| 1 | -//! Repo transfer status and actions. `GET /{owner}/{repo}/transfer` shows the open transfer of a | |
| 2 | -//! repo, if any, to viewers who can read it. The POST actions accept, decline and cancel a transfer | |
| 3 | -//! by its repo id under `/-/transfers/{id}/...`: a target who cannot read a private repo can still | |
| 4 | -//! act on it from the inbox (`transfer_list_for`), so those routes check the transfer rules in the | |
| 5 | -//! store and the repo rules here, not the read rule of `load_repo`. | |
| 1 | +//! Repo transfer status and actions. The Transfer topic of the danger zone (`pages::repo_settings`) | |
| 2 | +//! shows the open transfer of a repo, and `GET /{owner}/{repo}/transfer` goes there. The POST actions | |
| 3 | +//! accept, decline and cancel a transfer by its repo id under `/-/transfers/{id}/...`: a target who | |
| 4 | +//! cannot read a private repo can still act on it from the inbox (`transfer_list_for`), so those | |
| 5 | +//! routes check the transfer rules in the store and the repo rules here, not the read rule of `load_repo`. | |
| 6 | 6 | //! |
| 7 | -//! Starting a transfer is on the settings page (see `pages::repo_rename`). Instance admins skip | |
| 7 | +//! Starting a transfer is the form in the danger zone (see `pages::repo_rename`). Instance admins skip | |
| 8 | 8 | //! acceptance entirely. |
| 9 | 9 | |
| 10 | 10 | use forge_core::authz::{Action, authorize}; |
| @@ -15,19 +15,17 @@ use topcoat::Result; | ||
| 15 | 15 | use topcoat::context::{Cx, app_context}; |
| 16 | 16 | use topcoat::router::content::Form; |
| 17 | 17 | use topcoat::router::error::{SeeOther, forbidden, see_other}; |
| 18 | -use topcoat::router::{page, path_param, route}; | |
| 18 | +use topcoat::router::{path_param, route}; | |
| 19 | 19 | use topcoat::view::{View, component, view}; |
| 20 | 20 | |
| 21 | 21 | use crate::audit::{self, Actor, Target}; |
| 22 | -use crate::auth::{require_csrf, require_user}; | |
| 22 | +use crate::auth::require_csrf; | |
| 23 | +use crate::i18n::Lang; | |
| 23 | 24 | use crate::i18n::repo_admin::{self as g, K}; |
| 24 | -use crate::i18n::{self, Lang}; | |
| 25 | -use crate::pages::repo::repo_head; | |
| 26 | -use crate::pages::repo_ctx::{RepoHead, load_repo}; | |
| 27 | -use crate::pages::repo_settings_live::{bump_settings, transfer_live_url}; | |
| 25 | +use crate::pages::repo_settings_live::bump_settings; | |
| 28 | 26 | use crate::state::AppState; |
| 29 | -use crate::views::parts::{confirm_act, post_act}; | |
| 30 | -use crate::views::{rel_time, shell}; | |
| 27 | +use crate::views::parts::{confirm_act, post_act, reveal}; | |
| 28 | +use crate::views::{alert, rel_time}; | |
| 31 | 29 | |
| 32 | 30 | path_param!(owner); |
| 33 | 31 | path_param!(repo); |
| @@ -39,7 +37,7 @@ struct ActionForm { | ||
| 39 | 37 | csrf: String, |
| 40 | 38 | } |
| 41 | 39 | |
| 42 | -/// One line describing an open transfer, for the repo page. | |
| 40 | +/// One line describing an open transfer, for the danger zone. | |
| 43 | 41 | fn summary_text(lang: Lang, transfer: &PendingTransfer) -> TransferSummary { |
| 44 | 42 | let (before, after) = g::transfer_summary( |
| 45 | 43 | lang, |
| @@ -55,93 +53,102 @@ fn summary_text(lang: Lang, transfer: &PendingTransfer) -> TransferSummary { | ||
| 55 | 53 | } |
| 56 | 54 | |
| 57 | 55 | /// The pending-transfer sentence, with its expiry as a live relative time between two parts. |
| 58 | -struct TransferSummary { | |
| 56 | +pub(crate) struct TransferSummary { | |
| 59 | 57 | before: String, |
| 60 | 58 | expires_at: String, |
| 61 | 59 | after: &'static str, |
| 62 | 60 | } |
| 63 | 61 | |
| 64 | -/// The open transfer and the action forms the viewer may use. Each action is `None` when hidden. | |
| 65 | -#[component] | |
| 66 | -async fn transfer_body( | |
| 67 | - lang: Lang, | |
| 68 | - head: RepoHead, | |
| 62 | +/// The open transfer of a repo as the danger zone shows it: its sentence, and the action forms the | |
| 63 | +/// viewer may use. An action is `None` when hidden. | |
| 64 | +#[derive(Default)] | |
| 65 | +pub(crate) struct TransferStatus { | |
| 69 | 66 | summary: Option<TransferSummary>, |
| 70 | 67 | accept: Option<String>, |
| 71 | 68 | decline: Option<String>, |
| 72 | 69 | cancel: Option<String>, |
| 70 | +} | |
| 71 | + | |
| 72 | +/// Reads the open transfer of the repo for the viewer. Only the danger zone shows it, to a viewer who | |
| 73 | +/// may delete the repo, so cancel is always offered when there is one. | |
| 74 | +pub(crate) async fn transfer_status( | |
| 75 | + state: &AppState, | |
| 76 | + lang: Lang, | |
| 77 | + repo_id: &str, | |
| 78 | + user: &forge_core::User, | |
| 79 | +) -> Result<TransferStatus> { | |
| 80 | + let Some(transfer) = state.store.pending_transfer(repo_id).await? else { | |
| 81 | + return Ok(TransferStatus::default()); | |
| 82 | + }; | |
| 83 | + let may_accept = state.store.can_accept_transfer(&user.id, &transfer).await?; | |
| 84 | + Ok(TransferStatus { | |
| 85 | + summary: Some(summary_text(lang, &transfer)), | |
| 86 | + accept: may_accept.then(|| format!("/-/transfers/{}/accept", transfer.repo_id)), | |
| 87 | + decline: may_accept.then(|| format!("/-/transfers/{}/decline", transfer.repo_id)), | |
| 88 | + cancel: Some(format!("/-/transfers/{}/cancel", transfer.repo_id)), | |
| 89 | + }) | |
| 90 | +} | |
| 91 | + | |
| 92 | +/// The Transfer topic of the danger zone: the open transfer with its actions, then the form that | |
| 93 | +/// starts one (`POST /{owner}/{repo}/settings/transfer`), which opens in place. A form that came back | |
| 94 | +/// with an error opens with it. | |
| 95 | +#[component] | |
| 96 | +pub(crate) async fn transfer_section( | |
| 97 | + lang: Lang, | |
| 98 | + title: String, | |
| 73 | 99 | csrf: String, |
| 74 | - settings: Option<String>, | |
| 100 | + status: TransferStatus, | |
| 101 | + new_owner: String, | |
| 102 | + error: Option<String>, | |
| 75 | 103 | ) -> Result<impl View> { |
| 104 | + let action = format!("/{title}/settings/transfer"); | |
| 105 | + let open = error.is_some(); | |
| 76 | 106 | Ok(view! { |
| 77 | - repo_head(head: head, title: Some(g::t(lang, K::TransferTitle).to_owned())) | |
| 78 | - <div class="sheet"> | |
| 79 | - <section class="sec"> | |
| 80 | - <h2>(g::t(lang, K::TransferTitle))</h2> | |
| 81 | - if let Some(summary) = summary.as_ref() { | |
| 82 | - <p class="state">(summary.before.as_str()) rel_time(lang: lang, stamp: summary.expires_at.as_str()) (summary.after)</p> | |
| 83 | - <div class="acts"> | |
| 84 | - if let Some(action) = accept { | |
| 85 | - post_act(label: g::t(lang, K::AcceptTransfer), action: action.as_str(), csrf: csrf.as_str()) | |
| 86 | - } | |
| 87 | - if let Some(action) = decline { | |
| 88 | - confirm_act(lang: lang, label: g::t(lang, K::DeclineTransfer), action: action.as_str(), csrf: csrf.as_str()) | |
| 89 | - } | |
| 90 | - if let Some(action) = cancel { | |
| 91 | - confirm_act(lang: lang, label: g::t(lang, K::CancelTransfer), action: action.as_str(), csrf: csrf.as_str()) | |
| 92 | - } | |
| 93 | - </div> | |
| 94 | - } | |
| 95 | - if summary.is_none() { | |
| 96 | - <p class="state">(g::t(lang, K::NoPendingTransfer))</p> | |
| 97 | - } | |
| 98 | - if let Some(href) = settings { | |
| 99 | - <div class="acts"> | |
| 100 | - <a class="act" href=(href.as_str())>(g::t(lang, K::StartTransferLink))</a> | |
| 101 | - </div> | |
| 102 | - } | |
| 103 | - </section> | |
| 104 | - </div> | |
| 107 | + <section class="sec"> | |
| 108 | + <h2>(g::t(lang, K::TransferTitle))</h2> | |
| 109 | + if let Some(summary) = status.summary.as_ref() { | |
| 110 | + <p class="state">(summary.before.as_str()) rel_time(lang: lang, stamp: summary.expires_at.as_str()) (summary.after)</p> | |
| 111 | + <div class="acts"> | |
| 112 | + if let Some(accept) = status.accept.as_ref() { | |
| 113 | + post_act(label: g::t(lang, K::AcceptTransfer), action: accept.as_str(), csrf: csrf.as_str()) | |
| 114 | + } | |
| 115 | + if let Some(decline) = status.decline.as_ref() { | |
| 116 | + confirm_act(lang: lang, label: g::t(lang, K::DeclineTransfer), action: decline.as_str(), csrf: csrf.as_str()) | |
| 117 | + } | |
| 118 | + if let Some(cancel) = status.cancel.as_ref() { | |
| 119 | + confirm_act(lang: lang, label: g::t(lang, K::CancelTransfer), action: cancel.as_str(), csrf: csrf.as_str()) | |
| 120 | + } | |
| 121 | + </div> | |
| 122 | + } | |
| 123 | + <div class="acts"> | |
| 124 | + reveal(label: g::t(lang, K::TransferRepo), open: open, | |
| 125 | + if let Some(message) = error { | |
| 126 | + alert(message: message.as_str()) | |
| 127 | + } | |
| 128 | + <form method="post" action=(action.as_str()) class="fields"> | |
| 129 | + <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 130 | + <div class="field"> | |
| 131 | + <label for="transfer-owner">(g::t(lang, K::NewOwnerLabel))</label> | |
| 132 | + <input id="transfer-owner" type="text" name="new_owner" value=(new_owner.as_str()) autocomplete="off" spellcheck="false" required=(true)> | |
| 133 | + </div> | |
| 134 | + <div class="field"> | |
| 135 | + <label for="transfer-confirm">(g::t(lang, K::TypeToConfirmBefore))<code>(title.clone())</code>(g::t(lang, K::TypeToConfirmAfter))</label> | |
| 136 | + <input id="transfer-confirm" type="text" name="confirm" autocomplete="off" spellcheck="false" required=(true)> | |
| 137 | + </div> | |
| 138 | + <button type="submit" class="danger small">(g::t(lang, K::TransferRepo))</button> | |
| 139 | + </form> | |
| 140 | + ) | |
| 141 | + </div> | |
| 142 | + </section> | |
| 105 | 143 | }) |
| 106 | 144 | } |
| 107 | 145 | |
| 108 | -/// The transfer status page. Anonymous viewers go to login; viewers who cannot read the repo get | |
| 109 | -/// 404 from `load_repo`. | |
| 110 | -#[page("/{owner}/{repo}/transfer")] | |
| 111 | -async fn transfer_get(cx: &Cx) -> Result<impl View> { | |
| 146 | +/// The transfer page moved into the danger zone; the old address goes there. | |
| 147 | +#[route(GET "/{owner}/{repo}/transfer")] | |
| 148 | +async fn transfer_get(cx: &Cx) -> Result<SeeOther> { | |
| 112 | 149 | let owner = path_param::<Owner>(cx); |
| 113 | - let name = path_param::<Repo>(cx); | |
| 114 | - let ctx = load_repo(cx, owner, name).await?; | |
| 115 | - let (user, session) = require_user(cx).await?; | |
| 116 | - let lang = i18n::lang(cx, Some(&user)); | |
| 117 | - let state = app_context::<AppState>(cx); | |
| 118 | - let title = format!("{}/{}", ctx.repo.owner_name, ctx.repo.name); | |
| 119 | - let may_delete = ctx.can_delete(); | |
| 120 | - let pending = state.store.pending_transfer(&ctx.repo.id).await?; | |
| 121 | - | |
| 122 | - let (summary, accept, decline, cancel) = match &pending { | |
| 123 | - Some(transfer) => { | |
| 124 | - let may_accept = state.store.can_accept_transfer(&user.id, transfer).await?; | |
| 125 | - let may_cancel = may_delete || transfer.initiated_by_id == user.id; | |
| 126 | - ( | |
| 127 | - Some(summary_text(lang, transfer)), | |
| 128 | - may_accept.then(|| format!("/-/transfers/{}/accept", transfer.repo_id)), | |
| 129 | - may_accept.then(|| format!("/-/transfers/{}/decline", transfer.repo_id)), | |
| 130 | - may_cancel.then(|| format!("/-/transfers/{}/cancel", transfer.repo_id)), | |
| 131 | - ) | |
| 132 | - } | |
| 133 | - None => (None, None, None, None), | |
| 134 | - }; | |
| 135 | - let settings = may_delete.then(|| format!("/{title}/settings/rename")); | |
| 136 | - let mut head = ctx.head(state, "settings").await?; | |
| 137 | - head.live = transfer_live_url(&ctx.repo.owner_name, &ctx.repo.name); | |
| 138 | - let page_title = g::transfer_page_title(lang, &title); | |
| 139 | - let csrf = session.csrf_token.clone(); | |
| 140 | - Ok(view! { | |
| 141 | - shell(title: page_title.as_str(), viewer: ctx.viewer.as_ref(), | |
| 142 | - transfer_body(lang: lang, head: head, summary: summary, accept: accept, decline: decline, | |
| 143 | - cancel: cancel, csrf: csrf, settings: settings)) | |
| 144 | - }) | |
| 150 | + let repo = path_param::<Repo>(cx); | |
| 151 | + Ok(see_other(format!("/{owner}/{repo}/settings?section=danger"))) | |
| 145 | 152 | } |
| 146 | 153 | |
| 147 | 154 | /// The open transfer `repo_id`, or `NotFound`. |
| @@ -252,7 +259,7 @@ async fn cancel_post(cx: &Cx, Form(form): Form<ActionForm>) -> Result<SeeOther> | ||
| 252 | 259 | ) |
| 253 | 260 | .await; |
| 254 | 261 | Ok(see_other(format!( |
| 255 | - "/{}/{}/transfer", | |
| 262 | + "/{}/{}/settings?section=danger", | |
| 256 | 263 | pending.from_owner_name, pending.repo_name |
| 257 | 264 | ))) |
| 258 | 265 | } |
crates/forge-web/src/pages/repo_webhooks.rsmodified+8 -15
| @@ -499,14 +499,13 @@ async fn frame_top( | ||
| 499 | 499 | #[default] action: Option<(String, &'static str)>, |
| 500 | 500 | #[default] child: Child<'_>, |
| 501 | 501 | ) -> Result<impl View> { |
| 502 | - let can_delete = head.can_delete; | |
| 503 | 502 | Ok(view! { |
| 504 | 503 | repo_head(head: head, title: Some(heading), |
| 505 | 504 | if let Some((href, label)) = action { |
| 506 | 505 | <a class="button primary" href=(href.as_str())>(label)</a> |
| 507 | 506 | } |
| 508 | 507 | ) |
| 509 | - settings_frame(lang: lang, title: title, current: "webhooks", can_delete: can_delete, | |
| 508 | + settings_frame(lang: lang, title: title, current: "webhooks", | |
| 510 | 509 | if let Some((text, is_error)) = notice { |
| 511 | 510 | if is_error { |
| 512 | 511 | alert(message: text) |
| @@ -546,12 +545,13 @@ async fn hook_form( | ||
| 546 | 545 | <div class="field"> |
| 547 | 546 | <label for="hook-url">(g::t(lang, K::PayloadUrl))</label> |
| 548 | 547 | <input id="hook-url" type="url" name="url" value=(url.as_str()) autocomplete="off" spellcheck="false" required=(true)> |
| 549 | - <p class="hint">(g::t(lang, K::UrlHintNew))</p> | |
| 550 | 548 | </div> |
| 551 | 549 | <div class="field"> |
| 552 | 550 | <label for="hook-secret">(g::t(lang, K::Secret))</label> |
| 553 | 551 | <input id="hook-secret" type="password" name="secret" autocomplete="new-password" maxlength="256"> |
| 554 | - <p class="hint">(secret_hint.as_str()) " " (g::t(lang, K::SignedWith))</p> | |
| 552 | + if !secret_hint.is_empty() { | |
| 553 | + <p class="state">(secret_hint.as_str())</p> | |
| 554 | + } | |
| 555 | 555 | </div> |
| 556 | 556 | </section> |
| 557 | 557 | <section class="sec"> |
| @@ -599,8 +599,6 @@ async fn hooks_list_body( | ||
| 599 | 599 | <section class="sec"> |
| 600 | 600 | if empty { |
| 601 | 601 | <p class="state">(g::t(lang, K::NoWebhooks))</p> |
| 602 | - } else { | |
| 603 | - <p class="hint">(g::t(lang, K::WebhooksIntro))</p> | |
| 604 | 602 | } |
| 605 | 603 | for row in rows.iter() { |
| 606 | 604 | <a class="line" href=(row.href.as_str()) data-kb-row=""> |
| @@ -646,7 +644,7 @@ async fn delivery_list( | ||
| 646 | 644 | <span class="val"><time data-rel="true" datetime=(row.time_iso.as_str()) title=(row.time_full.as_str())>(row.time_rel.as_str())</time> " · " (row.duration.as_str()) " · " (g::t(lang, K::StatusLower)) " " (row.status.as_str())</span> |
| 647 | 645 | </summary> |
| 648 | 646 | <div class="opened"> |
| 649 | - <p class="hint">"Guid " <code>(row.guid.as_str())</code></p> | |
| 647 | + <p class="state">"Guid " <code>(row.guid.as_str())</code></p> | |
| 650 | 648 | <h3 class="part-title">(g::t(lang, K::RequestHeaders))</h3> |
| 651 | 649 | <pre class="code">(row.request_headers.as_str())</pre> |
| 652 | 650 | <h3 class="part-title">(g::t(lang, K::RequestBody))</h3> |
| @@ -655,7 +653,7 @@ async fn delivery_list( | ||
| 655 | 653 | if !row.error.is_empty() { |
| 656 | 654 | alert(message: row.error.as_str()) |
| 657 | 655 | } |
| 658 | - <p class="hint">(g::t(lang, K::Status))" " (row.status.as_str())</p> | |
| 656 | + <p class="state">(g::t(lang, K::Status))" " (row.status.as_str())</p> | |
| 659 | 657 | <h3 class="part-title">(g::t(lang, K::ResponseHeaders))</h3> |
| 660 | 658 | <pre class="code">(row.response_headers.as_str())</pre> |
| 661 | 659 | <h3 class="part-title">(g::t(lang, K::ResponseBody))</h3> |
| @@ -700,7 +698,6 @@ async fn hook_body( | ||
| 700 | 698 | <section class="sec"> |
| 701 | 699 | <h2>(crate::pages::passkeys::s(lang, "Endpoint", "Uç nokta"))</h2> |
| 702 | 700 | <p class="state">(draft.url.as_str())</p> |
| 703 | - <p class="hint">(g::t(lang, K::ArchivedHookNote))</p> | |
| 704 | 701 | </section> |
| 705 | 702 | } else { |
| 706 | 703 | hook_form(action: edit_action.clone(), csrf: csrf.clone(), url: draft.url, |
| @@ -710,7 +707,6 @@ async fn hook_body( | ||
| 710 | 707 | if !archived { |
| 711 | 708 | <section class="sec"> |
| 712 | 709 | <h2>(g::t(lang, K::Test))</h2> |
| 713 | - <p class="hint">(g::t(lang, K::TestIntro))</p> | |
| 714 | 710 | <div class="acts"> |
| 715 | 711 | post_act(label: g::t(lang, K::SendTestPing), action: test_action.as_str(), csrf: csrf.as_str()) |
| 716 | 712 | </div> |
| @@ -718,15 +714,13 @@ async fn hook_body( | ||
| 718 | 714 | } |
| 719 | 715 | <section class="sec"> |
| 720 | 716 | <h2>(g::t(lang, K::RecentDeliveries))</h2> |
| 721 | - <p class="hint">(g::recent_deliveries(lang, DELIVERIES_SHOWN))</p> | |
| 722 | 717 | delivery_list(deliveries: deliveries, csrf: csrf.clone(), archived: archived, lang: lang) |
| 723 | 718 | </section> |
| 724 | 719 | if !archived { |
| 725 | 720 | <section class="sec"> |
| 726 | 721 | <h2>(g::t(lang, K::DeleteWebhook))</h2> |
| 727 | - <p class="hint">(g::t(lang, K::DeleteIntro))</p> | |
| 728 | 722 | <div class="acts"> |
| 729 | - confirm_act(lang: lang, label: g::t(lang, K::DeleteWebhook), action: delete_action.as_str(), csrf: csrf.as_str(), fields: vec![("confirm".to_owned(), "on".to_owned())], note: Some(g::t(lang, K::DeleteConfirm).to_owned())) | |
| 723 | + confirm_act(lang: lang, label: g::t(lang, K::DeleteWebhook), action: delete_action.as_str(), csrf: csrf.as_str(), fields: vec![("confirm".to_owned(), "on".to_owned())]) | |
| 730 | 724 | </div> |
| 731 | 725 | </section> |
| 732 | 726 | } |
| @@ -812,13 +806,12 @@ async fn hook_new_body( | ||
| 812 | 806 | Ok(view! { |
| 813 | 807 | frame_top(head: head, title: title.clone(), heading: g::t(lang, K::AddWebhook).to_owned(), notice: None, archived: archived, lang: lang, |
| 814 | 808 | <section class="sec"> |
| 815 | - <p class="hint">(g::t(lang, K::AddWebhookIntro))</p> | |
| 816 | 809 | <div class="acts"> |
| 817 | 810 | <a class="act quiet" href=(back.as_str())>(g::t(lang, K::BackToWebhooks))</a> |
| 818 | 811 | </div> |
| 819 | 812 | </section> |
| 820 | 813 | hook_form(action: action, csrf: csrf, url: draft.url, events: events, |
| 821 | - active: draft.active, secret_hint: g::t(lang, K::SecretHintNew).to_owned(), | |
| 814 | + active: draft.active, secret_hint: String::new(), | |
| 822 | 815 | error: draft.error, submit: g::t(lang, K::CreateWebhook), lang: lang) |
| 823 | 816 | ) |
| 824 | 817 | }) |
crates/forge-web/src/pages/review_requests.rsmodified+10 -13
| @@ -17,14 +17,14 @@ use topcoat::view::{View, component, view}; | ||
| 17 | 17 | |
| 18 | 18 | use crate::auth::{current_user, require_user}; |
| 19 | 19 | use crate::i18n::authoring::{self as ga, K as AK}; |
| 20 | +use crate::i18n::issues::{self as ig, K as IK}; | |
| 20 | 21 | use crate::i18n::{self, Lang}; |
| 21 | 22 | use crate::live::{Topic, stream_wakes}; |
| 22 | 23 | use crate::notify; |
| 23 | 24 | use crate::pages::issue_parts::{ItemKind, check_write, may_change, parse_number}; |
| 24 | -use crate::pages::passkeys::s; | |
| 25 | 25 | use crate::pages::repo_ctx::{RepoCtx, load_repo}; |
| 26 | 26 | use crate::state::AppState; |
| 27 | -use crate::views::parts::{SubPart, head, post_act, reveal}; | |
| 27 | +use crate::views::parts::{head, post_act, reveal}; | |
| 28 | 28 | use crate::views::{alert, rel_time, repo_href, shell}; |
| 29 | 29 | |
| 30 | 30 | path_param!(owner); |
| @@ -210,15 +210,17 @@ pub(crate) async fn reviewers_box(lang: Lang, reviewers: ReviewersView) -> Resul | ||
| 210 | 210 | error, |
| 211 | 211 | } = reviewers; |
| 212 | 212 | let message = error.map(|code| error_text(lang, code)); |
| 213 | + let tool = if names.is_empty() { | |
| 214 | + ig::t(lang, IK::Add) | |
| 215 | + } else { | |
| 216 | + ig::t(lang, IK::Edit) | |
| 217 | + }; | |
| 213 | 218 | Ok(view! { |
| 214 | 219 | <section class="sec meta" id="reviewers"> |
| 215 | 220 | <h2>(ga::t(lang, AK::Reviewers))</h2> |
| 216 | 221 | if let Some(message) = message { |
| 217 | 222 | alert(message: message) |
| 218 | 223 | } |
| 219 | - if names.is_empty() { | |
| 220 | - <p class="hint">(ga::t(lang, AK::NoReviewers))</p> | |
| 221 | - } | |
| 222 | 224 | for name in names.iter() { |
| 223 | 225 | <div class="line"> |
| 224 | 226 | <span class="name"><a href=(format!("/{name}"))>(name.as_str())</a></span> |
| @@ -228,8 +230,8 @@ pub(crate) async fn reviewers_box(lang: Lang, reviewers: ReviewersView) -> Resul | ||
| 228 | 230 | </div> |
| 229 | 231 | } |
| 230 | 232 | if write { |
| 231 | - <div class="acts"> | |
| 232 | - reveal(label: ga::t(lang, AK::RequestReview), id: Some("request-review"), | |
| 233 | + <div class="line"> | |
| 234 | + reveal(label: tool, id: Some("request-review"), | |
| 233 | 235 | <form method="post" action=(action.as_str()) class="fields"> |
| 234 | 236 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 235 | 237 | <div class="field"> |
| @@ -287,14 +289,9 @@ async fn review_requests(cx: &Cx) -> Result<impl View> { | ||
| 287 | 289 | let heading = ga::t(lang, AK::ReviewRequests); |
| 288 | 290 | let empty = rows.is_empty(); |
| 289 | 291 | let unread = state.store.unread_count(&user.id).await?; |
| 290 | - let sub = vec![SubPart::text(s( | |
| 291 | - lang, | |
| 292 | - "Pull requests waiting for your review", | |
| 293 | - "İncelemeni bekleyen değişiklik istekleri", | |
| 294 | - ))]; | |
| 295 | 292 | Ok(view! { |
| 296 | 293 | shell(title: heading, viewer: Some(&viewer), |
| 297 | - head(title: heading, sub: sub, live: Some("/review-requests/events")) | |
| 294 | + head(title: heading, live: Some("/review-requests/events")) | |
| 298 | 295 | <div class="work"> |
| 299 | 296 | crate::pages::notifications::inbox_rail(lang: lang, current: "reviews", unread_count: unread) |
| 300 | 297 | <div class="sheet"> |
crates/forge-web/src/pages/settings_appearance.rsmodified+4 -17
| @@ -98,7 +98,7 @@ struct Stripe { | ||
| 98 | 98 | const ACCENT_VIVID: u8 = 50; |
| 99 | 99 | const BASE_VIVID: u8 = 30; |
| 100 | 100 | |
| 101 | -/// The lightness a row's hex box and its note use, in one theme: the accent's, or the background's. | |
| 101 | +/// The lightness a row's hex box uses, in one theme: the accent's, or the background's. | |
| 102 | 102 | fn row_lightness(base: bool, dark: bool) -> f64 { |
| 103 | 103 | match (base, dark) { |
| 104 | 104 | (false, true) => 0.75, |
| @@ -133,7 +133,6 @@ struct ColourGroup { | ||
| 133 | 133 | hue: &'static str, |
| 134 | 134 | vividness: &'static str, |
| 135 | 135 | hex: &'static str, |
| 136 | - note: &'static str, | |
| 137 | 136 | bases: Vec<Choice>, |
| 138 | 137 | accents: Vec<Choice>, |
| 139 | 138 | base_stripe: Stripe, |
| @@ -153,7 +152,6 @@ struct ColourRow { | ||
| 153 | 152 | hue_label: &'static str, |
| 154 | 153 | vivid_label: &'static str, |
| 155 | 154 | hex_label: &'static str, |
| 156 | - note: &'static str, | |
| 157 | 155 | } |
| 158 | 156 | |
| 159 | 157 | struct AppearancePage { |
| @@ -274,7 +272,6 @@ fn colour_group(lang: Lang, dark: bool, base: &str, accent_id: &str) -> ColourGr | ||
| 274 | 272 | hue: g::t(lang, K::HueLabel), |
| 275 | 273 | vividness: g::t(lang, K::VividnessLabel), |
| 276 | 274 | hex: g::t(lang, K::HexLabel), |
| 277 | - note: g::t(lang, K::LightnessNote), | |
| 278 | 275 | bases: with_hues( |
| 279 | 276 | choices(&base_codes, base_shown, |id| base_name(lang, id)), |
| 280 | 277 | preset_base_hue, |
| @@ -304,7 +301,6 @@ async fn colour_row(row: ColourRow) -> Result<impl View> { | ||
| 304 | 301 | hue_label, |
| 305 | 302 | vivid_label, |
| 306 | 303 | hex_label, |
| 307 | - note, | |
| 308 | 304 | } = row; |
| 309 | 305 | let value = custom_id(stripe.hue, stripe.vivid); |
| 310 | 306 | let hue_value = stripe.hue.to_string(); |
| @@ -353,7 +349,6 @@ async fn colour_row(row: ColourRow) -> Result<impl View> { | ||
| 353 | 349 | <input type="range" class="vivid-stripe" min="0" max="100" value=(vivid_value.as_str()) aria-label=(vivid_label) aria-valuetext=(vivid_text.as_str()) data-vivid-stripe="true" data-vivid-label=(vivid_label) data-autosubmit="true"> |
| 354 | 350 | <input type="text" class="hex-input" maxlength="7" value=(stripe.hex.as_str()) aria-label=(hex_label) title=(hex_label) spellcheck="false" autocomplete="off" data-hex-input="true" data-autosubmit="true"> |
| 355 | 351 | </div> |
| 356 | - <small class="hex-note" data-hex-note="true" data-message=(note)></small> | |
| 357 | 352 | </div> |
| 358 | 353 | </div> |
| 359 | 354 | </div> |
| @@ -372,7 +367,6 @@ async fn colour_panel(group: ColourGroup) -> Result<impl View> { | ||
| 372 | 367 | hue, |
| 373 | 368 | vividness, |
| 374 | 369 | hex, |
| 375 | - note, | |
| 376 | 370 | bases, |
| 377 | 371 | accents, |
| 378 | 372 | base_stripe, |
| @@ -392,7 +386,6 @@ async fn colour_panel(group: ColourGroup) -> Result<impl View> { | ||
| 392 | 386 | hue_label: hue, |
| 393 | 387 | vivid_label: vividness, |
| 394 | 388 | hex_label: hex, |
| 395 | - note, | |
| 396 | 389 | }; |
| 397 | 390 | let accent_row = ColourRow { |
| 398 | 391 | dark, |
| @@ -405,7 +398,6 @@ async fn colour_panel(group: ColourGroup) -> Result<impl View> { | ||
| 405 | 398 | hue_label: hue, |
| 406 | 399 | vivid_label: vividness, |
| 407 | 400 | hex_label: hex, |
| 408 | - note, | |
| 409 | 401 | }; |
| 410 | 402 | Ok(view! { |
| 411 | 403 | <div class="colour-panel" data-colour-panel=(panel)> |
| @@ -490,9 +482,8 @@ async fn appearance_body(page: AppearancePage) -> Result<impl View> { | ||
| 490 | 482 | <span>(s(lang, "Off", "Kapalı"))</span> |
| 491 | 483 | </label> |
| 492 | 484 | </div> |
| 493 | - <span class="hint">(g::t(lang, K::SoundOwnRuns))</span> | |
| 494 | - <button type="button" class="act play" data-sound-play="passed" title=(g::t(lang, K::SoundPassedNote))>(g::t(lang, K::SoundPassed))</button> | |
| 495 | - <button type="button" class="act play" data-sound-play="failed" title=(g::t(lang, K::SoundFailedNote))>(g::t(lang, K::SoundFailed))</button> | |
| 485 | + <button type="button" class="act play" data-sound-play="passed">(g::t(lang, K::SoundPassed))</button> | |
| 486 | + <button type="button" class="act play" data-sound-play="failed">(g::t(lang, K::SoundFailed))</button> | |
| 496 | 487 | </div> |
| 497 | 488 | </div> |
| 498 | 489 | </section> |
| @@ -605,11 +596,7 @@ async fn appearance_page(cx: &Cx) -> Result<impl View> { | ||
| 605 | 596 | .user_prefs(&viewer.0.id) |
| 606 | 597 | .await?; |
| 607 | 598 | let page = page_for(&viewer, lang, &prefs); |
| 608 | - let sub = vec![SubPart::text(s( | |
| 609 | - lang, | |
| 610 | - "Saved to your account, follows you on every device", | |
| 611 | - "Hesabına kaydedilir, her cihazda seninle gelir", | |
| 612 | - ))]; | |
| 599 | + let sub = Vec::<SubPart>::new(); | |
| 613 | 600 | Ok(view! { |
| 614 | 601 | shell(title: g::t(lang, K::Appearance), viewer: Some(&viewer), |
| 615 | 602 | head(title: g::t(lang, K::Appearance), sub: sub) |
crates/forge-web/src/pages/settings_export.rsmodified+185 -27
| @@ -2,10 +2,13 @@ | ||
| 2 | 2 | //! profile, watch it build, and download it until it expires. The page follows an event stream |
| 3 | 3 | //! while an export is building, so it turns ready with no reload and no polling. |
| 4 | 4 | |
| 5 | +use std::time::Duration; | |
| 6 | + | |
| 5 | 7 | use forge_core::store::exports::{DataExport, ExportState}; |
| 8 | +use forge_core::{Session, User}; | |
| 6 | 9 | use futures_util::{TryStreamExt, stream}; |
| 7 | 10 | use http::header::{ |
| 8 | - CACHE_CONTROL, CONTENT_DISPOSITION, CONTENT_LENGTH, CONTENT_TYPE, HeaderValue, | |
| 11 | + CACHE_CONTROL, CONTENT_DISPOSITION, CONTENT_LENGTH, CONTENT_TYPE, HeaderValue, RETRY_AFTER, | |
| 9 | 12 | X_CONTENT_TYPE_OPTIONS, |
| 10 | 13 | }; |
| 11 | 14 | use http_body::Frame; |
| @@ -17,16 +20,16 @@ use topcoat::context::{Cx, app_context}; | ||
| 17 | 20 | use topcoat::router::content::Form; |
| 18 | 21 | use topcoat::router::error::{SeeOther, not_found, see_other}; |
| 19 | 22 | use topcoat::router::response::Response; |
| 20 | -use topcoat::router::{Body, page, path_param, query_params, route}; | |
| 23 | +use topcoat::router::{Body, HeaderMap, StatusCode, page, path_param, query_params, route}; | |
| 21 | 24 | use topcoat::view::{View, component, view}; |
| 22 | 25 | |
| 23 | -use crate::auth::{require_csrf, require_user}; | |
| 26 | +use crate::auth::{require_csrf, require_user, two_factor_enabled}; | |
| 24 | 27 | use crate::exporter; |
| 25 | 28 | use crate::i18n::migrate::{self as g, K}; |
| 26 | -use crate::i18n::{self, Lang}; | |
| 29 | +use crate::i18n::{self, Key, Lang}; | |
| 27 | 30 | use crate::pages::ci_runs::{changed_event, events_response}; |
| 28 | 31 | use crate::state::AppState; |
| 29 | -use crate::views::parts::{SubPart, confirm_act, head}; | |
| 32 | +use crate::views::parts::{RailItem, SubPart, confirm_act, head, rail}; | |
| 30 | 33 | use crate::views::{alert, csrf_field, human_size, rel_time, shell}; |
| 31 | 34 | |
| 32 | 35 | path_param!(export_id); |
| @@ -42,6 +45,11 @@ struct SeenQuery { | ||
| 42 | 45 | v: Option<String>, |
| 43 | 46 | } |
| 44 | 47 | |
| 48 | +#[query_params(error = bad_request)] | |
| 49 | +struct TopicQuery { | |
| 50 | + part: Option<String>, | |
| 51 | +} | |
| 52 | + | |
| 45 | 53 | /// One word per export and its state, so the stream can tell the page is out of date. |
| 46 | 54 | fn signature(exports: &[DataExport]) -> String { |
| 47 | 55 | exports |
| @@ -51,8 +59,27 @@ fn signature(exports: &[DataExport]) -> String { | ||
| 51 | 59 | .join(",") |
| 52 | 60 | } |
| 53 | 61 | |
| 62 | +/// The rail of the Data page: the archives, and the delete-account topic. | |
| 63 | +fn data_rail_items(lang: Lang, delete: bool) -> Vec<RailItem> { | |
| 64 | + vec![ | |
| 65 | + RailItem { | |
| 66 | + name: crate::pages::passkeys::s(lang, "Export", "Dışa aktar").to_owned(), | |
| 67 | + val: String::new(), | |
| 68 | + href: "/settings/export".to_owned(), | |
| 69 | + current: !delete, | |
| 70 | + }, | |
| 71 | + RailItem { | |
| 72 | + name: i18n::t(lang, Key::DeleteAccount).to_owned(), | |
| 73 | + val: String::new(), | |
| 74 | + href: "/settings/export?part=delete".to_owned(), | |
| 75 | + current: delete, | |
| 76 | + }, | |
| 77 | + ] | |
| 78 | +} | |
| 79 | + | |
| 80 | +/// The archives sheet: the request's state, and each archive with its download and delete. | |
| 54 | 81 | #[component] |
| 55 | -async fn export_view(lang: Lang, csrf: &str, exports: Vec<DataExport>) -> Result<impl View> { | |
| 82 | +async fn export_sheet(lang: Lang, csrf: &str, exports: Vec<DataExport>) -> Result<impl View> { | |
| 56 | 83 | let building = exports.iter().any(|e| e.state == ExportState::Building); |
| 57 | 84 | let live = building.then(|| { |
| 58 | 85 | format!( |
| @@ -65,20 +92,8 @@ async fn export_view(lang: Lang, csrf: &str, exports: Vec<DataExport>) -> Result | ||
| 65 | 92 | .iter() |
| 66 | 93 | .map(|e| format!("/settings/export/{}/delete", e.id)) |
| 67 | 94 | .collect(); |
| 68 | - let ttl_note = g::export_ttl_note(lang, exporter::EXPORT_TTL_DAYS); | |
| 69 | 95 | Ok(view! { |
| 70 | - head(title: g::t(lang, K::ExportTitle), sub: vec![SubPart::text(g::t(lang, K::ExportIntro))], | |
| 71 | - <form method="post" action="/settings/export"> | |
| 72 | - csrf_field(token: csrf) | |
| 73 | - <button type="submit" class="primary" disabled=(building)>(g::t(lang, K::ExportRequest))</button> | |
| 74 | - </form> | |
| 75 | - ) | |
| 76 | - <div class="sheet fit export-page" data-live=(live.as_deref()) data-live-state=(if building { "building" } else { "idle" })> | |
| 77 | - <section class="sec"> | |
| 78 | - <h2>(crate::pages::passkeys::s(lang, "Archive", "Arşiv"))</h2> | |
| 79 | - <p class="hint">(g::t(lang, K::ExportContents))</p> | |
| 80 | - <p class="hint">(g::t(lang, K::ExportEmailNote)) " " (ttl_note.as_str())</p> | |
| 81 | - </section> | |
| 96 | + <div class="sheet export-page" data-live=(live.as_deref()) data-live-state=(if building { "building" } else { "idle" })> | |
| 82 | 97 | <section class="sec"> |
| 83 | 98 | <h2>(crate::pages::passkeys::s(lang, "Your archives", "Arşivleriniz"))</h2> |
| 84 | 99 | if empty { |
| @@ -104,7 +119,7 @@ async fn export_view(lang: Lang, csrf: &str, exports: Vec<DataExport>) -> Result | ||
| 104 | 119 | <a class="act" href=(format!("/settings/export/{}/download", export.id))>(g::t(lang, K::ExportDownload))</a> |
| 105 | 120 | } |
| 106 | 121 | if export.state != ExportState::Building { |
| 107 | - confirm_act(lang: lang, label: crate::pages::passkeys::s(lang, "Delete", "Sil"), action: delete.as_str(), csrf: csrf, note: Some(crate::pages::passkeys::s(lang, "The archive is deleted from the server.", "Arşiv sunucudan silinir.").to_owned())) | |
| 122 | + confirm_act(lang: lang, label: crate::pages::passkeys::s(lang, "Delete", "Sil"), action: delete.as_str(), csrf: csrf) | |
| 108 | 123 | } |
| 109 | 124 | </div> |
| 110 | 125 | if export.state == ExportState::Building { |
| @@ -120,18 +135,161 @@ async fn export_view(lang: Lang, csrf: &str, exports: Vec<DataExport>) -> Result | ||
| 120 | 135 | }) |
| 121 | 136 | } |
| 122 | 137 | |
| 138 | +/// The delete-account sheet. It asks for the password, the code when two-factor is on, and the | |
| 139 | +/// username, in one reveal. Repositories still owned by the user block it, and are listed. | |
| 140 | +#[component] | |
| 141 | +async fn delete_sheet( | |
| 142 | + lang: Lang, | |
| 143 | + csrf: &str, | |
| 144 | + two_factor_on: bool, | |
| 145 | + owned_repos: Vec<String>, | |
| 146 | + error: Option<String>, | |
| 147 | +) -> Result<impl View> { | |
| 148 | + let blocked = !owned_repos.is_empty(); | |
| 149 | + let open = error.is_some(); | |
| 150 | + Ok(view! { | |
| 151 | + <div class="sheet"> | |
| 152 | + <section class="sec" id="danger"> | |
| 153 | + <h2>(i18n::t(lang, Key::DangerZone))</h2> | |
| 154 | + if blocked { | |
| 155 | + <p class="state">(i18n::t(lang, Key::TransferOrDeleteRepos))</p> | |
| 156 | + <ul class="topic-list"> | |
| 157 | + for name in owned_repos.iter() { | |
| 158 | + <li class="line"><span class="name">(name.as_str())</span></li> | |
| 159 | + } | |
| 160 | + </ul> | |
| 161 | + } else { | |
| 162 | + <div class="acts"> | |
| 163 | + <details class="reveal" open=(open)> | |
| 164 | + <summary class="act danger">(i18n::t(lang, Key::DeleteAccount))</summary> | |
| 165 | + <div class="opened"> | |
| 166 | + if let Some(message) = error.as_deref() { | |
| 167 | + alert(message: message) | |
| 168 | + } | |
| 169 | + <form data-hard="true" method="post" action="/settings/security/delete" class="fields"> | |
| 170 | + <input type="hidden" name="csrf" value=(csrf)> | |
| 171 | + <div class="field"> | |
| 172 | + <label for="delete-password">(i18n::t(lang, Key::CurrentPassword))</label> | |
| 173 | + <input id="delete-password" type="password" name="current_password" autocomplete="current-password" required=(true)> | |
| 174 | + </div> | |
| 175 | + if two_factor_on { | |
| 176 | + <div class="field"> | |
| 177 | + <label for="delete-code">(i18n::t(lang, Key::Code))</label> | |
| 178 | + <input id="delete-code" type="text" name="code" autocomplete="one-time-code" required=(true)> | |
| 179 | + </div> | |
| 180 | + } | |
| 181 | + <div class="field"> | |
| 182 | + <label for="delete-username">(i18n::t(lang, Key::TypeUsernameToConfirm))</label> | |
| 183 | + <input id="delete-username" type="text" name="confirm_username" autocomplete="off" required=(true)> | |
| 184 | + </div> | |
| 185 | + <button type="submit" class="act danger">(i18n::t(lang, Key::DeleteAccount))</button> | |
| 186 | + </form> | |
| 187 | + </div> | |
| 188 | + </details> | |
| 189 | + </div> | |
| 190 | + } | |
| 191 | + </section> | |
| 192 | + </div> | |
| 193 | + }) | |
| 194 | +} | |
| 195 | + | |
| 196 | +/// The Data page body: the head of the topic, then the rail beside its sheet. | |
| 197 | +#[component] | |
| 198 | +async fn data_body( | |
| 199 | + lang: Lang, | |
| 200 | + csrf: &str, | |
| 201 | + delete: bool, | |
| 202 | + exports: Vec<DataExport>, | |
| 203 | + two_factor_on: bool, | |
| 204 | + owned_repos: Vec<String>, | |
| 205 | + delete_error: Option<String>, | |
| 206 | +) -> Result<impl View> { | |
| 207 | + let items = data_rail_items(lang, delete); | |
| 208 | + let title = if delete { | |
| 209 | + i18n::t(lang, Key::DeleteAccount) | |
| 210 | + } else { | |
| 211 | + g::t(lang, K::ExportTitle) | |
| 212 | + }; | |
| 213 | + let building = exports.iter().any(|e| e.state == ExportState::Building); | |
| 214 | + Ok(view! { | |
| 215 | + head(title: title, sub: Vec::<SubPart>::new(), | |
| 216 | + if !delete { | |
| 217 | + <form method="post" action="/settings/export"> | |
| 218 | + csrf_field(token: csrf) | |
| 219 | + <button type="submit" class="primary" disabled=(building)>(g::t(lang, K::ExportRequest))</button> | |
| 220 | + </form> | |
| 221 | + } | |
| 222 | + ) | |
| 223 | + <div class="work"> | |
| 224 | + rail(label: crate::pages::passkeys::s(lang, "Data", "Veri"), items: items) | |
| 225 | + if delete { | |
| 226 | + delete_sheet(lang: lang, csrf: csrf, two_factor_on: two_factor_on, owned_repos: owned_repos, error: delete_error) | |
| 227 | + } else { | |
| 228 | + export_sheet(lang: lang, csrf: csrf, exports: exports) | |
| 229 | + } | |
| 230 | + </div> | |
| 231 | + }) | |
| 232 | +} | |
| 233 | + | |
| 234 | +/// Renders the Data page on one of its topics. A refused delete answers 429 when it is throttled. | |
| 235 | +async fn page_view( | |
| 236 | + cx: &Cx, | |
| 237 | + viewer: (User, Session), | |
| 238 | + delete: bool, | |
| 239 | + delete_error: Option<String>, | |
| 240 | + throttled: Option<Duration>, | |
| 241 | +) -> Result<impl View> { | |
| 242 | + let state = app_context::<AppState>(cx); | |
| 243 | + let lang = i18n::lang(cx, Some(&viewer.0)); | |
| 244 | + let user_id = viewer.0.id.clone(); | |
| 245 | + let exports = state.store.list_exports(&user_id).await?; | |
| 246 | + let two_factor_on = two_factor_enabled(&state.store, &user_id).await?; | |
| 247 | + let owned_repos: Vec<String> = state | |
| 248 | + .store | |
| 249 | + .list_repos_by_owner(&user_id) | |
| 250 | + .await? | |
| 251 | + .into_iter() | |
| 252 | + .map(|repo| format!("{}/{}", repo.owner_name, repo.name)) | |
| 253 | + .collect(); | |
| 254 | + let mut headers = HeaderMap::new(); | |
| 255 | + let status = match throttled { | |
| 256 | + Some(retry) => { | |
| 257 | + headers.insert(RETRY_AFTER, HeaderValue::from(retry.as_secs().max(1))); | |
| 258 | + StatusCode::TOO_MANY_REQUESTS | |
| 259 | + } | |
| 260 | + None => StatusCode::OK, | |
| 261 | + }; | |
| 262 | + let csrf = viewer.1.csrf_token.clone(); | |
| 263 | + // `view!` expects the `__cx` binding that `#[page]` and `#[component]` provide. This plain | |
| 264 | + // helper has to bind it itself. | |
| 265 | + let __cx = cx; | |
| 266 | + Ok(view! { | |
| 267 | + (status) | |
| 268 | + (headers) | |
| 269 | + shell(title: g::t(lang, K::SettingsExport), viewer: Some(&viewer), | |
| 270 | + data_body(lang: lang, csrf: csrf.as_str(), delete: delete, exports: exports, | |
| 271 | + two_factor_on: two_factor_on, owned_repos: owned_repos, delete_error: delete_error)) | |
| 272 | + }) | |
| 273 | +} | |
| 274 | + | |
| 275 | +/// Renders the Data page on its delete topic with the refusal open. Called by the account delete | |
| 276 | +/// form, which lives in the security module. | |
| 277 | +pub(crate) async fn respond_delete( | |
| 278 | + cx: &Cx, | |
| 279 | + viewer: (User, Session), | |
| 280 | + error: Option<String>, | |
| 281 | + throttled: Option<Duration>, | |
| 282 | +) -> Result<impl View> { | |
| 283 | + page_view(cx, viewer, true, error, throttled).await | |
| 284 | +} | |
| 285 | + | |
| 123 | 286 | #[page("/settings/export")] |
| 124 | 287 | async fn export_page(cx: &Cx) -> Result<impl View> { |
| 125 | 288 | let viewer = require_user(cx).await?; |
| 126 | - let lang = i18n::lang(cx, Some(&viewer.0)); | |
| 127 | 289 | let state = app_context::<AppState>(cx); |
| 128 | 290 | exporter::sweep_expired(state).await; |
| 129 | - let exports = state.store.list_exports(&viewer.0.id).await?; | |
| 130 | - let csrf = viewer.1.csrf_token.clone(); | |
| 131 | - Ok(view! { cx => | |
| 132 | - shell(title: g::t(lang, K::SettingsExport), viewer: Some(&viewer), | |
| 133 | - export_view(lang: lang, csrf: csrf.as_str(), exports: exports)) | |
| 134 | - }) | |
| 291 | + let query = query_params::<TopicQuery>(cx)?; | |
| 292 | + page_view(cx, viewer, query.part.as_deref() == Some("delete"), None, None).await | |
| 135 | 293 | } |
| 136 | 294 | |
| 137 | 295 | #[route(POST "/settings/export")] |
crates/forge-web/src/pages/settings_gpg.rsmodified+0 -1
| @@ -62,7 +62,6 @@ pub(crate) async fn gpg_section( | ||
| 62 | 62 | <div class="field"> |
| 63 | 63 | <label for="gpg-key">(t(lang, Key::ArmoredPublicKeyLabel))</label> |
| 64 | 64 | <textarea id="gpg-key" name="armored" rows="8" spellcheck="false" required=(true)>(armored)</textarea> |
| 65 | - <p class="hint">(t(lang, Key::ArmoredHint))</p> | |
| 66 | 65 | </div> |
| 67 | 66 | <div class="acts asks"> |
| 68 | 67 | <button type="submit" class="primary">(t(lang, Key::AddKeyButton))</button> |
crates/forge-web/src/pages/settings_keys.rsmodified+1 -29
| @@ -185,22 +185,6 @@ impl KeyKind { | ||
| 185 | 185 | KeyKind::Tokens => t(lang, Key::NewToken), |
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | - | |
| 189 | - fn about(self, lang: Lang) -> &'static str { | |
| 190 | - match self { | |
| 191 | - KeyKind::Ssh => s(lang, "Push and pull over SSH", "SSH ile gönder ve çek"), | |
| 192 | - KeyKind::Gpg => s( | |
| 193 | - lang, | |
| 194 | - "Verify the commits you sign", | |
| 195 | - "İmzaladığın commit'leri doğrula", | |
| 196 | - ), | |
| 197 | - KeyKind::Tokens => s( | |
| 198 | - lang, | |
| 199 | - "Sign in from the command line and from scripts", | |
| 200 | - "Komut satırından ve betiklerden giriş yap", | |
| 201 | - ), | |
| 202 | - } | |
| 203 | - } | |
| 204 | 188 | } |
| 205 | 189 | |
| 206 | 190 | #[query_params(error = bad_request)] |
| @@ -236,10 +220,7 @@ pub(crate) async fn keys_page_view( | ||
| 236 | 220 | current: k == kind, |
| 237 | 221 | }) |
| 238 | 222 | .collect(); |
| 239 | - let sub = vec![ | |
| 240 | - SubPart::text(kind.about(lang)), | |
| 241 | - SubPart::text(key_count(lang, count(kind))), | |
| 242 | - ]; | |
| 223 | + let sub = Vec::<SubPart>::new(); | |
| 243 | 224 | let add_href = format!("{}?add", kind.href()); |
| 244 | 225 | let add_open = draft.add |
| 245 | 226 | || draft.ssh_error.is_some() |
| @@ -268,14 +249,6 @@ pub(crate) async fn keys_page_view( | ||
| 268 | 249 | }) |
| 269 | 250 | } |
| 270 | 251 | |
| 271 | -fn key_count(lang: Lang, n: usize) -> String { | |
| 272 | - match lang { | |
| 273 | - Lang::Tr => format!("{n} anahtar"), | |
| 274 | - Lang::En if n == 1 => "1 key".to_owned(), | |
| 275 | - Lang::En => format!("{n} keys"), | |
| 276 | - } | |
| 277 | -} | |
| 278 | - | |
| 279 | 252 | fn pk_title(lang: Lang) -> &'static str { |
| 280 | 253 | crate::pages::passkeys::s(lang, "Keys", "Anahtarlar") |
| 281 | 254 | } |
| @@ -305,7 +278,6 @@ async fn ssh_section( | ||
| 305 | 278 | <div class="field"> |
| 306 | 279 | <label for="ssh-key">(t(lang, Key::PublicKeyLabel))</label> |
| 307 | 280 | <textarea id="ssh-key" name="public_key" rows="4" spellcheck="false" required=(true)>(public_key)</textarea> |
| 308 | - <p class="hint">(t(lang, Key::PublicKeyHint))</p> | |
| 309 | 281 | </div> |
| 310 | 282 | <div class="acts asks"> |
| 311 | 283 | <button type="submit" class="primary">(t(lang, Key::AddKeyButton))</button> |
crates/forge-web/src/pages/settings_notifications.rsmodified+1 -3
| @@ -71,7 +71,7 @@ async fn notifications_body(page: NotificationsPage) -> Result<impl View> { | ||
| 71 | 71 | // locked and the notes below say why. |
| 72 | 72 | let blocked = unverified_note.is_some() || server_note.is_some(); |
| 73 | 73 | Ok(view! { |
| 74 | - head(title: t(lang, Key::Notifications), sub: vec![SubPart::text(s(lang, "Email, and push to your devices", "E-posta ve cihazlarına bildirim"))]) | |
| 74 | + head(title: t(lang, Key::Notifications), sub: Vec::<SubPart>::new()) | |
| 75 | 75 | if let Some(message) = notice { |
| 76 | 76 | <p class="state" role="status">(message.as_str())</p> |
| 77 | 77 | } |
| @@ -85,7 +85,6 @@ async fn notifications_body(page: NotificationsPage) -> Result<impl View> { | ||
| 85 | 85 | <input type="checkbox" form="notify-form" name="email_notifications" value="1" checked=(on) disabled=(blocked) data-autosubmit="true"> |
| 86 | 86 | <span>(t(lang, Key::EmailNotifyLabel))</span> |
| 87 | 87 | </label> |
| 88 | - <p class="hint">(t(lang, Key::EmailNotifyHelp))</p> | |
| 89 | 88 | if let Some(message) = server_note { |
| 90 | 89 | <p class="hint warn" role="note">(message)</p> |
| 91 | 90 | } |
| @@ -102,7 +101,6 @@ async fn notifications_body(page: NotificationsPage) -> Result<impl View> { | ||
| 102 | 101 | <h2>(push_text::t(lang, push_text::K::DeviceHeading))</h2> |
| 103 | 102 | <p class="state" data-push-state="on" hidden=(true)>(push_text::t(lang, push_text::K::DeviceOn))</p> |
| 104 | 103 | <p class="state" data-push-state="off" hidden=(true)>(push_text::t(lang, push_text::K::DeviceOff))</p> |
| 105 | - <p class="hint">(push_text::t(lang, push_text::K::DeviceHelp))</p> | |
| 106 | 104 | <p class="hint" role="note" data-push-state="unsupported" hidden=(true)>(push_text::t(lang, push_text::K::DeviceUnsupported))</p> |
| 107 | 105 | <p class="hint" role="note" data-push-state="https" hidden=(true)>(push_text::t(lang, push_text::K::DeviceNeedsHttps))</p> |
| 108 | 106 | <p class="hint" role="note" data-push-state="ios" hidden=(true)>(push_text::t(lang, push_text::K::DeviceIosHint))</p> |
crates/forge-web/src/pages/settings_profile.rsmodified+4 -9
| @@ -23,7 +23,6 @@ use crate::audit::{self, Actor, Target}; | ||
| 23 | 23 | use crate::auth::{require_csrf, require_user}; |
| 24 | 24 | use crate::i18n::{self, Key, Lang, about_too_long, display_name_too_long, t}; |
| 25 | 25 | use crate::live::Topic; |
| 26 | -use crate::pages::passkeys::s; | |
| 27 | 26 | use crate::state::AppState; |
| 28 | 27 | use crate::views::parts::{SubPart, confirm_act, head, reveal}; |
| 29 | 28 | use crate::views::{alert, avatar_url, shell, user_facing_message}; |
| @@ -141,7 +140,7 @@ async fn profile_body(page: ProfilePage) -> Result<impl View> { | ||
| 141 | 140 | } = page; |
| 142 | 141 | let avatar_open = errors.avatar.is_some(); |
| 143 | 142 | Ok(view! { |
| 144 | - head(title: t(lang, Key::Profile), sub: vec![SubPart::text(s(lang, "What others see on your profile", "Başkalarının profilinde gördükleri"))]) | |
| 143 | + head(title: t(lang, Key::Profile), sub: Vec::<SubPart>::new()) | |
| 145 | 144 | if let Some(message) = notice { |
| 146 | 145 | <p class="state" role="status">(message)</p> |
| 147 | 146 | } |
| @@ -149,7 +148,6 @@ async fn profile_body(page: ProfilePage) -> Result<impl View> { | ||
| 149 | 148 | <section class="sec"> |
| 150 | 149 | <h2>(t(lang, Key::Avatar))</h2> |
| 151 | 150 | <img class="avatar" src=(avatar_src.as_str()) alt=(t(lang, Key::AvatarAlt)) width="48" height="48"> |
| 152 | - <p class="hint">(t(lang, Key::AvatarHint))</p> | |
| 153 | 151 | <div class="acts"> |
| 154 | 152 | reveal(label: t(lang, Key::UploadPhoto), open: avatar_open, |
| 155 | 153 | if let Some(message) = errors.avatar { |
| @@ -174,8 +172,7 @@ async fn profile_body(page: ProfilePage) -> Result<impl View> { | ||
| 174 | 172 | <section class="sec"> |
| 175 | 173 | <div class="field"> |
| 176 | 174 | <label for="profile-display-name">(t(lang, Key::DisplayName))</label> |
| 177 | - <input id="profile-display-name" type="text" name="display_name" maxlength="80" autocomplete="name" value=(draft.display_name.as_str()) aria-describedby="profile-display-name-hint"> | |
| 178 | - <p class="hint" id="profile-display-name-hint">(t(lang, Key::DisplayNameHint))</p> | |
| 175 | + <input id="profile-display-name" type="text" name="display_name" maxlength="80" autocomplete="name" value=(draft.display_name.as_str())> | |
| 179 | 176 | </div> |
| 180 | 177 | if let Some(message) = errors.display_name { |
| 181 | 178 | alert(message: message.as_str()) |
| @@ -184,8 +181,7 @@ async fn profile_body(page: ProfilePage) -> Result<impl View> { | ||
| 184 | 181 | <section class="sec"> |
| 185 | 182 | <div class="field"> |
| 186 | 183 | <label for="profile-username">(t(lang, Key::Username))</label> |
| 187 | - <input id="profile-username" type="text" name="username" maxlength="64" required=(true) autocomplete="username" value=(draft.username.as_str()) aria-describedby="profile-username-hint"> | |
| 188 | - <p class="hint" id="profile-username-hint">(t(lang, Key::UsernameHint))</p> | |
| 184 | + <input id="profile-username" type="text" name="username" maxlength="64" required=(true) autocomplete="username" value=(draft.username.as_str())> | |
| 189 | 185 | </div> |
| 190 | 186 | if let Some(message) = errors.username { |
| 191 | 187 | alert(message: message.as_str()) |
| @@ -194,8 +190,7 @@ async fn profile_body(page: ProfilePage) -> Result<impl View> { | ||
| 194 | 190 | <section class="sec"> |
| 195 | 191 | <div class="field"> |
| 196 | 192 | <label for="profile-about">(t(lang, Key::About))</label> |
| 197 | - <textarea id="profile-about" name="about" rows="6" maxlength="2000" aria-describedby="profile-about-hint">(draft.about.as_str())</textarea> | |
| 198 | - <p class="hint" id="profile-about-hint">(t(lang, Key::AboutHint))</p> | |
| 193 | + <textarea id="profile-about" name="about" rows="6" maxlength="2000">(draft.about.as_str())</textarea> | |
| 199 | 194 | </div> |
| 200 | 195 | if let Some(message) = errors.about { |
| 201 | 196 | alert(message: message.as_str()) |
crates/forge-web/src/pages/settings_security.rsmodified+22 -110
| @@ -26,6 +26,7 @@ use crate::i18n::packages::{self as pk, K as PK}; | ||
| 26 | 26 | use crate::i18n::releases_ci::{self as rc, K as RC}; |
| 27 | 27 | use crate::i18n::{self, Key, Lang, password_too_long, password_too_short, t}; |
| 28 | 28 | use crate::pages::passkeys::{PasskeyPanel, build_panel, passkeys_panel, s}; |
| 29 | +use crate::pages::settings_export; | |
| 29 | 30 | use crate::pages::settings_sessions::session_label; |
| 30 | 31 | use crate::state::AppState; |
| 31 | 32 | use crate::throttle::{self, LOGIN_USER_LIMIT, TWO_FACTOR_USER_LIMIT}; |
| @@ -45,7 +46,7 @@ const MAX_DEVICE_NAME_CHARS: usize = 40; | ||
| 45 | 46 | #[query_params(error = bad_request)] |
| 46 | 47 | struct SecurityQuery { |
| 47 | 48 | saved: Option<String>, |
| 48 | - /// The topic to show: password, email, two-factor, passkeys, sessions or danger. | |
| 49 | + /// The topic to show: password, email, two-factor, passkeys or sessions. | |
| 49 | 50 | part: Option<String>, |
| 50 | 51 | } |
| 51 | 52 | |
| @@ -124,7 +125,6 @@ struct DeleteAccountForm { | ||
| 124 | 125 | #[derive(Default)] |
| 125 | 126 | struct Shown { |
| 126 | 127 | notice: Option<&'static str>, |
| 127 | - delete_error: Option<String>, | |
| 128 | 128 | password_error: Option<String>, |
| 129 | 129 | email_error: Option<String>, |
| 130 | 130 | email_draft: Option<String>, |
| @@ -187,10 +187,7 @@ struct SecurityPage { | ||
| 187 | 187 | password_changed: Option<String>, |
| 188 | 188 | /// The enabled device. `None` when two-factor is off. |
| 189 | 189 | two_factor: Option<DeviceView>, |
| 190 | - delete_error: Option<String>, | |
| 191 | 190 | passkeys: PasskeyPanel, |
| 192 | - /// Repositories still owned by the user. Deletion is refused while there are any. | |
| 193 | - owned_repos: Vec<String>, | |
| 194 | 191 | /// Web sessions open on the account, listed by the Sessions topic. |
| 195 | 192 | sessions: Vec<Session>, |
| 196 | 193 | /// The id of the session that is viewing the page. |
| @@ -250,24 +247,9 @@ pub(crate) fn security_rail_items( | ||
| 250 | 247 | href: "/settings/security/log".to_owned(), |
| 251 | 248 | current: active == "log", |
| 252 | 249 | }, |
| 253 | - RailItem { | |
| 254 | - name: t(lang, Key::DangerZone).to_owned(), | |
| 255 | - val: String::new(), | |
| 256 | - href: "/settings/security?part=danger".to_owned(), | |
| 257 | - current: active == "danger", | |
| 258 | - }, | |
| 259 | 250 | ] |
| 260 | 251 | } |
| 261 | 252 | |
| 262 | -/// The Security tab's head line, shared by the topics and the security log. | |
| 263 | -pub(crate) fn security_sub(lang: Lang) -> &'static str { | |
| 264 | - s( | |
| 265 | - lang, | |
| 266 | - "Sign-in, email, two-factor, passkeys and sessions", | |
| 267 | - "Giriş, e-posta, iki adımlı doğrulama, geçiş anahtarları ve oturumlar", | |
| 268 | - ) | |
| 269 | -} | |
| 270 | - | |
| 271 | 253 | /// The rail for a page outside the topics (the security log), with live counts. |
| 272 | 254 | pub(crate) async fn security_rail_for( |
| 273 | 255 | state: &AppState, |
| @@ -310,9 +292,7 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> { | ||
| 310 | 292 | pending, |
| 311 | 293 | password_changed, |
| 312 | 294 | two_factor, |
| 313 | - delete_error, | |
| 314 | 295 | passkeys, |
| 315 | - owned_repos, | |
| 316 | 296 | sessions, |
| 317 | 297 | current_session_id, |
| 318 | 298 | part, |
| @@ -338,17 +318,8 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> { | ||
| 338 | 318 | let setup_error = two_factor_error.filter(|_| two_factor_panel == TwoFactorPanel::Setup); |
| 339 | 319 | let regenerate_open = regenerate_error.is_some(); |
| 340 | 320 | let disable_open = disable_error.is_some(); |
| 341 | - let delete_open = delete_error.is_some(); | |
| 342 | - let delete_blocked = !owned_repos.is_empty(); | |
| 343 | 321 | // One topic shows at a time: the one with an error or fresh codes, else the one asked for. |
| 344 | - const TOPICS: [&str; 6] = [ | |
| 345 | - "password", | |
| 346 | - "email", | |
| 347 | - "two-factor", | |
| 348 | - "passkeys", | |
| 349 | - "sessions", | |
| 350 | - "danger", | |
| 351 | - ]; | |
| 322 | + const TOPICS: [&str; 5] = ["password", "email", "two-factor", "passkeys", "sessions"]; | |
| 352 | 323 | let active: &'static str = if password_open { |
| 353 | 324 | "password" |
| 354 | 325 | } else if email_open { |
| @@ -360,8 +331,6 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> { | ||
| 360 | 331 | || (pending_set && part.is_none()) |
| 361 | 332 | { |
| 362 | 333 | "two-factor" |
| 363 | - } else if delete_open { | |
| 364 | - "danger" | |
| 365 | 334 | } else { |
| 366 | 335 | part.as_deref() |
| 367 | 336 | .and_then(|asked| TOPICS.into_iter().find(|topic| *topic == asked)) |
| @@ -369,7 +338,7 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> { | ||
| 369 | 338 | }; |
| 370 | 339 | let items = security_rail_items(lang, active, two_factor_on, passkey_count, session_count); |
| 371 | 340 | Ok(view! { |
| 372 | - head(title: t(lang, Key::Security), sub: vec![SubPart::text(security_sub(lang))]) | |
| 341 | + head(title: t(lang, Key::Security), sub: Vec::<SubPart>::new()) | |
| 373 | 342 | if let Some(message) = notice { |
| 374 | 343 | <p class="state" role="status">(message)</p> |
| 375 | 344 | } |
| @@ -393,7 +362,6 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> { | ||
| 393 | 362 | <div class="field"> |
| 394 | 363 | <label for="new-password">(t(lang, Key::NewPassword))</label> |
| 395 | 364 | <input id="new-password" type="password" name="new_password" autocomplete="new-password" minlength="10" maxlength="1024" required=(true)> |
| 396 | - <p class="hint">(t(lang, Key::NewPasswordHint))</p> | |
| 397 | 365 | </div> |
| 398 | 366 | <div class="field"> |
| 399 | 367 | <label for="confirm-password">(t(lang, Key::ConfirmNewPassword))</label> |
| @@ -448,7 +416,7 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> { | ||
| 448 | 416 | } |
| 449 | 417 | if let Some(device) = two_factor { |
| 450 | 418 | <p class="state">(t(lang, Key::PillOn)) " · " (device.name.as_str())</p> |
| 451 | - <p class="hint">added_status(lang: lang, added: device.added.as_deref(), used: device.used.as_deref())</p> | |
| 419 | + <p class="state">added_status(lang: lang, added: device.added.as_deref(), used: device.used.as_deref())</p> | |
| 452 | 420 | <div class="line"> |
| 453 | 421 | <span class="name">(t(lang, Key::RecoveryCodes))</span> |
| 454 | 422 | <span class="val">(device.codes_line.as_str())</span> |
| @@ -464,7 +432,6 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> { | ||
| 464 | 432 | } |
| 465 | 433 | <form data-hard="true" method="post" action="/settings/security/2fa/recovery" class="fields"> |
| 466 | 434 | <input type="hidden" name="csrf" value=(csrf)> |
| 467 | - <p class="hint">(t(lang, Key::RegenerateCodesHint))</p> | |
| 468 | 435 | <div class="field"> |
| 469 | 436 | <label for="regenerate-password">(t(lang, Key::CurrentPassword))</label> |
| 470 | 437 | <input id="regenerate-password" type="password" name="current_password" autocomplete="current-password" required=(true)> |
| @@ -501,7 +468,6 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> { | ||
| 501 | 468 | <p class="state">(t(lang, Key::SetupInProgress))</p> |
| 502 | 469 | } else { |
| 503 | 470 | <p class="state">(t(lang, Key::PillOff))</p> |
| 504 | - <p class="hint">(t(lang, Key::TwoFactorOffIntro))</p> | |
| 505 | 471 | <div class="acts"> |
| 506 | 472 | <form data-hard="true" method="post" action="/settings/security/2fa/enable" class="act-form"> |
| 507 | 473 | <input type="hidden" name="csrf" value=(csrf)> |
| @@ -510,9 +476,8 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> { | ||
| 510 | 476 | </div> |
| 511 | 477 | } |
| 512 | 478 | if let Some((secret, uri)) = pending { |
| 513 | - <p class="hint">(t(lang, Key::TwoFactorPendingIntro))</p> | |
| 514 | - <p class="hint">(t(lang, Key::SecretPrefix)) <code>(secret)</code></p> | |
| 515 | - <p class="hint">(t(lang, Key::LinkPrefix)) <code>(uri)</code></p> | |
| 479 | + <p class="state">(t(lang, Key::SecretPrefix)) <code>(secret)</code></p> | |
| 480 | + <p class="state">(t(lang, Key::LinkPrefix)) <code>(uri)</code></p> | |
| 516 | 481 | if let Some(message) = setup_error { |
| 517 | 482 | alert(message: message.as_str()) |
| 518 | 483 | } |
| @@ -525,7 +490,6 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> { | ||
| 525 | 490 | <div class="field"> |
| 526 | 491 | <label for="enrol-name">(t(lang, Key::DeviceName))</label> |
| 527 | 492 | <input id="enrol-name" type="text" name="name" autocomplete="off" maxlength="40" placeholder=(t(lang, Key::AuthenticatorApp))> |
| 528 | - <p class="hint">(t(lang, Key::DeviceNameHint))</p> | |
| 529 | 493 | </div> |
| 530 | 494 | <button type="submit" class="primary">(t(lang, Key::ConfirmAndTurnOn))</button> |
| 531 | 495 | </form> |
| @@ -536,7 +500,7 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> { | ||
| 536 | 500 | <h2>(t(lang, Key::Sessions))</h2> |
| 537 | 501 | if others > 0 { |
| 538 | 502 | <div class="acts"> |
| 539 | - confirm_act(lang: lang, label: t(lang, Key::RevokeAllOthers), action: "/settings/sessions/revoke-others", csrf: csrf, note: Some(s(lang, "Every other browser is signed out at once. This one stays signed in.", "Diğer tüm tarayıcılarda oturum hemen kapanır. Bu tarayıcıda oturum açık kalır.").to_owned())) | |
| 503 | + confirm_act(lang: lang, label: t(lang, Key::RevokeAllOthers), action: "/settings/sessions/revoke-others", csrf: csrf) | |
| 540 | 504 | </div> |
| 541 | 505 | } |
| 542 | 506 | for session in sessions.into_iter() { |
| @@ -552,49 +516,8 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> { | ||
| 552 | 516 | (i18n::dated_label(lang, Key::LastSeen)) " " rel_time(lang: lang, stamp: session.last_seen.as_str()) " · " (t(lang, Key::SignedIn)) " " rel_time(lang: lang, stamp: session.created_at.as_str()) |
| 553 | 517 | </span> |
| 554 | 518 | if session.id != current_session_id { |
| 555 | - confirm_act(lang: lang, label: t(lang, Key::Revoke), action: "/settings/sessions/revoke", csrf: csrf, fields: vec![("id".to_owned(), session.id.clone())], note: Some(s(lang, "This browser is signed out at once.", "Bu tarayıcıda oturum hemen kapanır.").to_owned())) | |
| 556 | - } | |
| 557 | - </div> | |
| 558 | - } | |
| 559 | - </section> | |
| 560 | - <section class="sec" id="danger"> | |
| 561 | - <h2>(t(lang, Key::DangerZone))</h2> | |
| 562 | - if delete_blocked { | |
| 563 | - <p class="state">(t(lang, Key::TransferOrDeleteRepos))</p> | |
| 564 | - <ul class="topic-list"> | |
| 565 | - for name in owned_repos.into_iter() { | |
| 566 | - <li class="line"><span class="name">(name)</span></li> | |
| 519 | + confirm_act(lang: lang, label: t(lang, Key::Revoke), action: "/settings/sessions/revoke", csrf: csrf, fields: vec![("id".to_owned(), session.id.clone())]) | |
| 567 | 520 | } |
| 568 | - </ul> | |
| 569 | - } else { | |
| 570 | - <p class="state">(t(lang, Key::DeleteAccountIntro))</p> | |
| 571 | - <div class="acts"> | |
| 572 | - <details class="reveal" open=(delete_open)> | |
| 573 | - <summary class="act danger">(t(lang, Key::DeleteAccount))</summary> | |
| 574 | - <div class="opened"> | |
| 575 | - if let Some(message) = delete_error { | |
| 576 | - alert(message: message.as_str()) | |
| 577 | - } | |
| 578 | - <form data-hard="true" method="post" action="/settings/security/delete" class="fields"> | |
| 579 | - <input type="hidden" name="csrf" value=(csrf)> | |
| 580 | - <div class="field"> | |
| 581 | - <label for="delete-password">(t(lang, Key::CurrentPassword))</label> | |
| 582 | - <input id="delete-password" type="password" name="current_password" autocomplete="current-password" required=(true)> | |
| 583 | - </div> | |
| 584 | - if two_factor_on { | |
| 585 | - <div class="field"> | |
| 586 | - <label for="delete-code">(t(lang, Key::Code))</label> | |
| 587 | - <input id="delete-code" type="text" name="code" autocomplete="one-time-code" required=(true)> | |
| 588 | - </div> | |
| 589 | - } | |
| 590 | - <div class="field"> | |
| 591 | - <label for="delete-username">(t(lang, Key::TypeUsernameToConfirm))</label> | |
| 592 | - <input id="delete-username" type="text" name="confirm_username" autocomplete="off" required=(true)> | |
| 593 | - </div> | |
| 594 | - <button type="submit" class="act danger">(t(lang, Key::DeleteAccount))</button> | |
| 595 | - </form> | |
| 596 | - </div> | |
| 597 | - </details> | |
| 598 | 521 | </div> |
| 599 | 522 | } |
| 600 | 523 | </section> |
| @@ -683,13 +606,6 @@ async fn build_page( | ||
| 683 | 606 | None => (None, None), |
| 684 | 607 | }; |
| 685 | 608 | let password_changed = state.store.password_changed_at(&viewer.0.id).await?; |
| 686 | - let owned_repos = state | |
| 687 | - .store | |
| 688 | - .list_repos_by_owner(&viewer.0.id) | |
| 689 | - .await? | |
| 690 | - .into_iter() | |
| 691 | - .map(|repo| format!("{}/{}", repo.owner_name, repo.name)) | |
| 692 | - .collect(); | |
| 693 | 609 | let stored_email = viewer.0.email.clone().unwrap_or_default(); |
| 694 | 610 | let email_verified = state.store.email_is_verified(&viewer.0.id).await?; |
| 695 | 611 | let mut email_sent = None; |
| @@ -714,9 +630,7 @@ async fn build_page( | ||
| 714 | 630 | }; |
| 715 | 631 | Ok(SecurityPage { |
| 716 | 632 | lang, |
| 717 | - delete_error: shown.delete_error, | |
| 718 | 633 | passkeys: build_panel(state, &viewer.0.id).await?, |
| 719 | - owned_repos, | |
| 720 | 634 | email_verified, |
| 721 | 635 | stored_email, |
| 722 | 636 | email_status, |
| @@ -836,6 +750,10 @@ async fn security_page(cx: &Cx) -> Result<impl View> { | ||
| 836 | 750 | let viewer = require_user(cx).await?; |
| 837 | 751 | let lang = i18n::lang(cx, Some(&viewer.0)); |
| 838 | 752 | let query = query_params::<SecurityQuery>(cx)?; |
| 753 | + // Delete account moved to the Data page. The old address still opens it. | |
| 754 | + if query.part.as_deref() == Some("danger") { | |
| 755 | + return Err(see_other("/settings/export?part=delete").into()); | |
| 756 | + } | |
| 839 | 757 | let saved = query.saved.clone(); |
| 840 | 758 | // A notice belongs to a topic: the page opens on it. |
| 841 | 759 | let part = query.part.clone().or_else(|| { |
| @@ -1065,27 +983,24 @@ async fn account_delete(cx: &Cx, Form(form): Form<DeleteAccountForm>) -> Result< | ||
| 1065 | 983 | let lang = i18n::lang(cx, Some(&viewer.0)); |
| 1066 | 984 | let state = app_context::<AppState>(cx); |
| 1067 | 985 | let user_id = viewer.0.id.clone(); |
| 1068 | - let mut shown = Shown::default(); | |
| 1069 | 986 | if form.confirm_username != viewer.0.username { |
| 1070 | - shown.delete_error = Some(t(lang, Key::ErrConfirmUsername).into()); | |
| 1071 | - return respond(cx, viewer, shown).await; | |
| 987 | + let error = Some(t(lang, Key::ErrConfirmUsername).into()); | |
| 988 | + return settings_export::respond_delete(cx, viewer, error, None).await; | |
| 1072 | 989 | } |
| 1073 | 990 | if let Err(refused) = require_password(lang, state, &viewer.0, &form.current_password).await? { |
| 1074 | - shown.delete_error = Some(refused.message.into()); | |
| 1075 | - shown.throttled = refused.retry; | |
| 1076 | - return respond(cx, viewer, shown).await; | |
| 991 | + let error = Some(refused.message.into()); | |
| 992 | + return settings_export::respond_delete(cx, viewer, error, refused.retry).await; | |
| 1077 | 993 | } |
| 1078 | 994 | if two_factor_enabled(&state.store, &user_id).await? { |
| 1079 | 995 | if let Some(retry) = second_factor_blocked(state, &user_id) { |
| 1080 | - shown.delete_error = Some(t(lang, Key::ErrThrottled).into()); | |
| 1081 | - shown.throttled = Some(retry); | |
| 1082 | - return respond(cx, viewer, shown).await; | |
| 996 | + let error = Some(t(lang, Key::ErrThrottled).into()); | |
| 997 | + return settings_export::respond_delete(cx, viewer, error, Some(retry)).await; | |
| 1083 | 998 | } |
| 1084 | 999 | let key = throttle::two_factor_key(&user_id); |
| 1085 | 1000 | if !verify_second_factor(&state.store, &state.key, &user_id, &form.code).await? { |
| 1086 | 1001 | state.throttle.record_failure(&key, Instant::now()); |
| 1087 | - shown.delete_error = Some(t(lang, Key::ErrWrongCode).into()); | |
| 1088 | - return respond(cx, viewer, shown).await; | |
| 1002 | + let error = Some(t(lang, Key::ErrWrongCode).into()); | |
| 1003 | + return settings_export::respond_delete(cx, viewer, error, None).await; | |
| 1089 | 1004 | } |
| 1090 | 1005 | state.throttle.clear(&key); |
| 1091 | 1006 | } |
| @@ -1111,10 +1026,7 @@ async fn account_delete(cx: &Cx, Form(form): Form<DeleteAccountForm>) -> Result< | ||
| 1111 | 1026 | Err(see_other("/").into()) |
| 1112 | 1027 | } |
| 1113 | 1028 | Err(e) => match user_facing_message(&e) { |
| 1114 | - Some(message) => { | |
| 1115 | - shown.delete_error = Some(message); | |
| 1116 | - respond(cx, viewer, shown).await | |
| 1117 | - } | |
| 1029 | + Some(message) => settings_export::respond_delete(cx, viewer, Some(message), None).await, | |
| 1118 | 1030 | None => Err(e.into()), |
| 1119 | 1031 | }, |
| 1120 | 1032 | } |
crates/forge-web/src/pages/settings_tokens.rsmodified+1 -11
| @@ -53,14 +53,6 @@ struct DeleteTokenForm { | ||
| 53 | 53 | id: String, |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | -/// What deleting a token costs. | |
| 57 | -fn delete_message(lang: Lang) -> &'static str { | |
| 58 | - match lang { | |
| 59 | - Lang::Tr => "Bu token ile çalışan her şey hemen durur.", | |
| 60 | - _ => "Anything using it stops working at once.", | |
| 61 | - } | |
| 62 | -} | |
| 63 | - | |
| 64 | 56 | /// Maps the form's expiry choice to a lifetime. `None` means the token never expires. |
| 65 | 57 | /// An unrecognised value falls back to the 90-day default. |
| 66 | 58 | fn expiry_days(choice: &str) -> Option<u64> { |
| @@ -91,7 +83,6 @@ pub(crate) async fn tokens_section( | ||
| 91 | 83 | <pre class="code"><code id="new-token">(token)</code></pre> |
| 92 | 84 | <button type="button" class="small" data-copy="new-token" data-copied=(rc::t(lang, RC::CopyDone)) data-failed=(rc::t(lang, RC::CopyFailed))>(pk::t(lang, PK::CopyCommand))</button> |
| 93 | 85 | </div> |
| 94 | - <p class="hint">(t(lang, Key::UseAsPassword))</p> | |
| 95 | 86 | </div> |
| 96 | 87 | } |
| 97 | 88 | if add { |
| @@ -118,7 +109,6 @@ pub(crate) async fn tokens_section( | ||
| 118 | 109 | <input type="checkbox" name="packages" value="on"> |
| 119 | 110 | <span>(pk::t(lang, PK::ScopePackages))</span> |
| 120 | 111 | </label> |
| 121 | - <p class="hint">(pk::t(lang, PK::ScopePackagesHelp)) " " (t(lang, Key::ScopeNote))</p> | |
| 122 | 112 | <div class="acts asks"> |
| 123 | 113 | <button type="submit" class="primary">(t(lang, Key::CreateToken))</button> |
| 124 | 114 | <a class="act" href="/settings/tokens">(s(lang, "Keep it", "Vazgeç"))</a> |
| @@ -133,7 +123,7 @@ pub(crate) async fn tokens_section( | ||
| 133 | 123 | <div class="line"> |
| 134 | 124 | <span class="name">(token.name.clone())</span> |
| 135 | 125 | <span class="val">(i18n::dated_label(lang, Key::LastUsed)) " " rel_time_or_never(lang: lang, stamp: token.last_used_at.as_deref()) " · " (i18n::dated_label(lang, Key::ExpiresLabel)) " " rel_time_or_never(lang: lang, stamp: token.expires_at.as_deref()) " · " (i18n::dated_label(lang, Key::Created)) " " rel_time(lang: lang, stamp: token.created_at.as_str())</span> |
| 136 | - confirm_act(lang: lang, label: t(lang, Key::Delete), action: "/settings/tokens/delete", csrf: csrf, fields: vec![("id".to_owned(), token.id.clone())], note: Some(delete_message(lang).to_owned())) | |
| 126 | + confirm_act(lang: lang, label: t(lang, Key::Delete), action: "/settings/tokens/delete", csrf: csrf, fields: vec![("id".to_owned(), token.id.clone())], note: None) | |
| 137 | 127 | </div> |
| 138 | 128 | } |
| 139 | 129 | }) |
crates/forge-web/src/pages/setup.rsmodified+2 -2
| @@ -14,7 +14,7 @@ use crate::audit::{self, Actor, Target}; | ||
| 14 | 14 | use crate::auth::{check_pre_csrf, clear_pre_csrf, hash_password_async, login, pre_csrf_token}; |
| 15 | 15 | use crate::i18n::{self, Key, Lang, password_too_long, password_too_short, t}; |
| 16 | 16 | use crate::state::AppState; |
| 17 | -use crate::views::parts::{SubPart, head}; | |
| 17 | +use crate::views::parts::head; | |
| 18 | 18 | use crate::views::{alert, shell, user_facing_message}; |
| 19 | 19 | |
| 20 | 20 | const MIN_PASSWORD_CHARS: usize = 12; |
| @@ -43,7 +43,7 @@ async fn setup_form( | ||
| 43 | 43 | error: Option<String>, |
| 44 | 44 | ) -> Result<impl View> { |
| 45 | 45 | Ok(view! { |
| 46 | - head(title: t(lang, Key::WelcomeToForge), sub: vec![SubPart::text(t(lang, Key::SetupSub))]) | |
| 46 | + head(title: t(lang, Key::WelcomeToForge)) | |
| 47 | 47 | <div class="sheet fit"> |
| 48 | 48 | <form data-hard="true" method="post" action="/setup" class="fields"> |
| 49 | 49 | if let Some(message) = error { |
crates/forge-web/src/pages/snippets.rsmodified+0 -1
| @@ -485,7 +485,6 @@ async fn snippet_body( | ||
| 485 | 485 | } |
| 486 | 486 | <p class="hint">(g::updated_before(lang)) rel_time(lang: lang, stamp: updated_at) (g::updated_after(lang))</p> |
| 487 | 487 | if !is_owner { |
| 488 | - <p class="hint">(g::t(lang, K::OnlyOwnerEdits))</p> | |
| 489 | 488 | } |
| 490 | 489 | </section> |
| 491 | 490 | for file in files.into_iter() { |
crates/forge-web/src/pages/wiki.rsmodified+15 -46
| @@ -26,7 +26,6 @@ use crate::i18n::{self, Lang}; | ||
| 26 | 26 | use crate::live::Topic; |
| 27 | 27 | use crate::pages::repo::repo_head; |
| 28 | 28 | use crate::pages::repo_ctx::{RepoCtx, load_repo}; |
| 29 | -use crate::pages::repo_settings::settings_frame; | |
| 30 | 29 | use crate::pages::wiki_live::{bump_wiki, page_live_url, wiki_live_url}; |
| 31 | 30 | use crate::render::markdown::render_markdown; |
| 32 | 31 | use crate::state::AppState; |
| @@ -343,13 +342,11 @@ async fn wiki_edit_body( | ||
| 343 | 342 | <div class="field"> |
| 344 | 343 | <label for="wiki-name">(g::t(lang, K::PageName))</label> |
| 345 | 344 | <input id="wiki-name" type="text" name="name" value=(name.as_str()) maxlength="100" required=(true) pattern="[A-Za-z0-9_-]+"> |
| 346 | - <p class="hint">(g::t(lang, K::PageNameHint))</p> | |
| 347 | 345 | </div> |
| 348 | 346 | } |
| 349 | 347 | <div class="field"> |
| 350 | 348 | <label for="wiki-content">(g::t(lang, K::ContentMarkdown))</label> |
| 351 | 349 | <textarea id="wiki-content" name="content" rows="24" spellcheck="false">(content.as_str())</textarea> |
| 352 | - <p class="hint">(g::t(lang, K::WikiLinkHint))</p> | |
| 353 | 350 | </div> |
| 354 | 351 | <div class="field"> |
| 355 | 352 | <label for="wiki-message">(g::t(lang, K::Summary))</label> |
| @@ -764,59 +761,31 @@ async fn save(cx: &Cx, ctx: &RepoCtx, form: &EditForm, name: &str) -> Result<Sav | ||
| 764 | 761 | Ok(SaveOutcome::Saved(page_href(ctx, name))) |
| 765 | 762 | } |
| 766 | 763 | |
| 764 | +/// The Wiki feature in the Features topic of the General settings page: one switch that submits on | |
| 765 | +/// change (`data-autosubmit`), then its hint. `enabled` is the current state. | |
| 767 | 766 | #[component] |
| 768 | -async fn wiki_settings_body( | |
| 769 | - lang: Lang, | |
| 767 | +pub(crate) async fn wiki_switch( | |
| 770 | 768 | action: String, |
| 771 | 769 | csrf: String, |
| 772 | 770 | enabled: bool, |
| 773 | 771 | ) -> Result<impl View> { |
| 774 | 772 | Ok(view! { |
| 775 | - <section class="sec"> | |
| 776 | - <h2>(g::t(lang, K::WikiSettings))</h2> | |
| 777 | - <form method="post" action=(action.as_str()) class="fields wiki-form"> | |
| 778 | - <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 779 | - <label class="switch"> | |
| 780 | - <input type="checkbox" name="enabled" value="1" checked=(enabled)> | |
| 781 | - <span>(g::t(lang, K::EnableWiki))</span> | |
| 782 | - </label> | |
| 783 | - <p class="hint">(g::t(lang, K::WikiDisabledHint))</p> | |
| 784 | - <button type="submit" class="primary">(g::t(lang, K::Save))</button> | |
| 785 | - </form> | |
| 786 | - </section> | |
| 773 | + <form method="post" action=(action.as_str()) id="wiki"> | |
| 774 | + <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 775 | + <label class="switch"> | |
| 776 | + <input type="checkbox" name="enabled" value="1" checked=(enabled) data-autosubmit="true"> | |
| 777 | + <span>"Wiki"</span> | |
| 778 | + </label> | |
| 779 | + </form> | |
| 787 | 780 | }) |
| 788 | 781 | } |
| 789 | 782 | |
| 790 | -#[page("/{owner}/{repo}/settings/wiki")] | |
| 791 | -async fn wiki_settings_page(cx: &Cx) -> Result<impl View> { | |
| 783 | +/// The wiki switch moved to the General settings page; the old address goes there. | |
| 784 | +#[route(GET "/{owner}/{repo}/settings/wiki")] | |
| 785 | +async fn wiki_settings_page(cx: &Cx) -> Result<SeeOther> { | |
| 792 | 786 | let owner = path_param::<Owner>(cx); |
| 793 | 787 | let repo_param = path_param::<Repo>(cx); |
| 794 | - let ctx = load_repo(cx, owner, repo_param).await?; | |
| 795 | - let (user, session) = require_user(cx).await?; | |
| 796 | - if !ctx.can_admin() { | |
| 797 | - return Err(not_found().into()); | |
| 798 | - } | |
| 799 | - let lang = i18n::lang(cx, Some(&user)); | |
| 800 | - let state = app_context::<AppState>(cx); | |
| 801 | - let enabled = state.store.wiki_enabled(&ctx.repo.id).await?; | |
| 802 | - let title = format!( | |
| 803 | - "{}/{} \u{b7} {}", | |
| 804 | - ctx.repo.owner_name, | |
| 805 | - ctx.repo.name, | |
| 806 | - g::t(lang, K::WikiSettings) | |
| 807 | - ); | |
| 808 | - let header = ctx.head(state, "settings").await?; | |
| 809 | - let action = repo_href(&ctx.repo.owner_name, &ctx.repo.name, "settings/wiki", ""); | |
| 810 | - let csrf = session.csrf_token.clone(); | |
| 811 | - Ok(view! { cx => | |
| 812 | - shell(title: title.as_str(), viewer: ctx.viewer.as_ref(), | |
| 813 | - repo_head(head: header, title: Some(g::t(lang, K::Wiki).to_owned())) | |
| 814 | - settings_frame(lang: lang, title: format!("{}/{}", ctx.repo.owner_name, ctx.repo.name), current: "wiki", | |
| 815 | - can_delete: ctx.can_delete(), | |
| 816 | - wiki_settings_body(lang: lang, action: action, csrf: csrf, enabled: enabled) | |
| 817 | - ) | |
| 818 | - ) | |
| 819 | - }) | |
| 788 | + Ok(see_other(repo_href(owner, repo_param, "settings", ""))) | |
| 820 | 789 | } |
| 821 | 790 | |
| 822 | 791 | #[derive(Deserialize)] |
| @@ -865,7 +834,7 @@ async fn wiki_settings_post(cx: &Cx, Form(form): Form<WikiSettingsForm>) -> Resu | ||
| 865 | 834 | Ok(see_other(repo_href( |
| 866 | 835 | &ctx.repo.owner_name, |
| 867 | 836 | &ctx.repo.name, |
| 868 | - "settings/wiki", | |
| 837 | + "settings", | |
| 869 | 838 | "", |
| 870 | 839 | ))) |
| 871 | 840 | } |
crates/forge-web/src/views/heatmap.rsmodified+0 -2
| @@ -368,7 +368,6 @@ pub async fn contribution_calendar( | ||
| 368 | 368 | calendar.current_streak, |
| 369 | 369 | calendar.longest_streak, |
| 370 | 370 | ); |
| 371 | - let motivation = g::heatmap_motivation(lang, calendar.today_count, calendar.current_streak); | |
| 372 | 371 | let total = g::thousands(lang, calendar.total); |
| 373 | 372 | let current = g::streak_days(lang, calendar.current_streak); |
| 374 | 373 | let longest = g::streak_days(lang, calendar.longest_streak); |
| @@ -489,7 +488,6 @@ pub async fn contribution_calendar( | ||
| 489 | 488 | </div> |
| 490 | 489 | </div> |
| 491 | 490 | <div class="heat-foot"> |
| 492 | - <p class="muted small">(motivation.as_str())</p> | |
| 493 | 491 | <div class="legend" aria-hidden="true"> |
| 494 | 492 | <span>(less)</span> |
| 495 | 493 | <span class="cell l0"></span> |
crates/forge-web/src/views/mod.rsmodified+31 -142
| @@ -475,8 +475,8 @@ fn no_runs() -> ActorRuns { | ||
| 475 | 475 | } |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | -/// What the profile corner shows: the viewer, their unread notification count, their inbox counts | |
| 479 | -/// with where each leads, and whether any of their runs is going (the ring glows). | |
| 478 | +/// What the profile corner shows: the viewer, their unread notification count, and whether review | |
| 479 | +/// requests, mentions or failed runs wait for them (the avatar's dot says so with the count). | |
| 480 | 480 | #[derive(Clone)] |
| 481 | 481 | struct ProfileCorner { |
| 482 | 482 | username: String, |
| @@ -484,125 +484,48 @@ struct ProfileCorner { | ||
| 484 | 484 | name: String, |
| 485 | 485 | avatar: String, |
| 486 | 486 | csrf: String, |
| 487 | - back: String, | |
| 488 | 487 | is_admin: bool, |
| 489 | - theme: String, | |
| 490 | - /// Unread notifications, shown as a count on the bell. | |
| 488 | + /// Unread notifications, shown as a count on the notifications row. | |
| 491 | 489 | unread: u64, |
| 492 | - reviews: u64, | |
| 493 | - mentions: u64, | |
| 494 | - failing: u64, | |
| 495 | - /// The newest waiting review request, mention and failed run, each chip's link. | |
| 496 | - review_href: String, | |
| 497 | - mention_href: String, | |
| 498 | - failing_href: String, | |
| 490 | + /// Whether a review request, a mention or a failed run waits for the viewer. | |
| 491 | + waiting: bool, | |
| 499 | 492 | } |
| 500 | 493 | |
| 501 | 494 | /// The profile at the start of the top bar (signed in only): the avatar, with a dot when something |
| 502 | -/// waits. Its menu holds the name, notifications with their popover, what waits on the viewer, the | |
| 503 | -/// profile, settings and admin links, the theme choice and log out. | |
| 495 | +/// waits. Its menu holds the name, notifications with their count, the settings and admin links and | |
| 496 | +/// log out. | |
| 504 | 497 | #[component] |
| 505 | 498 | async fn profile_corner(lang: Lang, corner: ProfileCorner) -> Result<impl View> { |
| 506 | - let review_chip = (corner.reviews > 0).then(|| mi::review_requests_count(lang, corner.reviews)); | |
| 507 | - let mention_chip = (corner.mentions > 0).then(|| mi::mentions_count(lang, corner.mentions)); | |
| 508 | - let failing_chip = (corner.failing > 0).then(|| mi::failing_runs_count(lang, corner.failing)); | |
| 509 | - let bell_label = mi::t(lang, MK::AllNotifications); | |
| 510 | - let theme_label = mi::t(lang, MK::ThemeLabel); | |
| 511 | - let match_label = mi::t(lang, MK::MatchSystem); | |
| 512 | - let light_label = mi::t(lang, MK::Light); | |
| 513 | - let dark_label = mi::t(lang, MK::Dark); | |
| 514 | - let auto_pressed = if corner.theme == "auto" { | |
| 515 | - "true" | |
| 516 | - } else { | |
| 517 | - "false" | |
| 518 | - }; | |
| 519 | - let light_pressed = if corner.theme == "light" { | |
| 520 | - "true" | |
| 521 | - } else { | |
| 522 | - "false" | |
| 523 | - }; | |
| 524 | - let dark_pressed = if corner.theme == "dark" { | |
| 525 | - "true" | |
| 526 | - } else { | |
| 527 | - "false" | |
| 528 | - }; | |
| 529 | - // The chips' titles as nav.js rebuilds them: the server's phrase with `{n}` for the count. The | |
| 530 | - // singular and plural forms are separate, as English puts "request" and "requests" apart. | |
| 531 | - let review_template = count_template(&mi::review_requests_count(lang, 2), 2); | |
| 532 | - let review_one = count_template(&mi::review_requests_count(lang, 1), 1); | |
| 533 | - let mention_template = count_template(&mi::mentions_count(lang, 2), 2); | |
| 534 | - let mention_one = count_template(&mi::mentions_count(lang, 1), 1); | |
| 535 | - let failing_template = count_template(&mi::failing_runs_count(lang, 2), 2); | |
| 536 | - let failing_one = count_template(&mi::failing_runs_count(lang, 1), 1); | |
| 537 | 499 | let profile_href = user_href(&corner.username); |
| 538 | 500 | let profile_label = mi::t(lang, MK::YourProfile); |
| 539 | 501 | let settings_label = o::t(lang, OK::Settings); |
| 540 | 502 | let admin_label = ad::t(lang, AK::AdminArea); |
| 541 | 503 | let logout_label = t(lang, Key::LogOut); |
| 542 | - let bell_title = i18n::t(lang, Key::Notifications); | |
| 543 | - let open_label = mi::t(lang, MK::OpenNotifications); | |
| 544 | - let clear_label = mi::t(lang, MK::ClearNotifications); | |
| 545 | - let clear_title = mi::t(lang, MK::MarkAllRead); | |
| 546 | - let loading_label = mi::t(lang, MK::PeekLoading); | |
| 547 | - let error_label = mi::t(lang, MK::PeekError); | |
| 504 | + let inbox_label = t(lang, Key::Notifications); | |
| 505 | + let class = if corner.unread > 0 || corner.waiting { | |
| 506 | + "corner waiting" | |
| 507 | + } else { | |
| 508 | + "corner" | |
| 509 | + }; | |
| 548 | 510 | Ok(view! { |
| 549 | - <details class="corner" data-unread-stream=""> | |
| 511 | + <details class=(class) data-unread-stream=""> | |
| 550 | 512 | <summary class="corner-btn" aria-label=(corner.username.as_str())> |
| 551 | 513 | <img class="avatar corner-avatar" src=(corner.avatar.as_str()) alt="" width="32" height="32"> |
| 552 | 514 | </summary> |
| 553 | 515 | <div class="corner-menu"> |
| 554 | 516 | <a class="corner-who" href=(profile_href.as_str()) title=(profile_label)>(corner.name.as_str())</a> |
| 555 | - <a class="corner-link corner-bell" href="/notifications" title=(bell_label) aria-expanded="false"> | |
| 556 | - <span>(bell_title)</span> | |
| 517 | + <a class="corner-link corner-bell" href="/notifications"> | |
| 518 | + <span>(inbox_label)</span> | |
| 557 | 519 | if corner.unread > 0 { |
| 558 | 520 | <span class="bell-count">(corner.unread.to_string())</span> |
| 559 | 521 | } |
| 560 | 522 | </a> |
| 561 | - <div class="bell-pop" popover="auto" role="dialog" aria-label=(bell_title) data-loading=(loading_label) data-error=(error_label)> | |
| 562 | - <div class="bell-box"> | |
| 563 | - <div class="bell-head"> | |
| 564 | - <span>(bell_title)</span> | |
| 565 | - <form method="post" action="/notifications/mark_all_read" class="bell-clear"> | |
| 566 | - <input type="hidden" name="csrf" value=(corner.csrf.as_str())> | |
| 567 | - <button type="submit" class="link-button" title=(clear_title)>(clear_label)</button> | |
| 568 | - </form> | |
| 569 | - </div> | |
| 570 | - <div class="bell-list"></div> | |
| 571 | - <a class="button small bell-open" href="/notifications">(open_label)</a> | |
| 572 | - </div> | |
| 573 | - </div> | |
| 574 | - <div class="corner-chips" data-review=(review_template.as_str()) data-review-one=(review_one.as_str()) data-mention=(mention_template.as_str()) data-mention-one=(mention_one.as_str()) data-failing=(failing_template.as_str()) data-failing-one=(failing_one.as_str())> | |
| 575 | - if let Some(title) = review_chip { | |
| 576 | - <a class="corner-link chip-review" href=(corner.review_href.as_str())>(title.as_str())</a> | |
| 577 | - } | |
| 578 | - if let Some(title) = mention_chip { | |
| 579 | - <a class="corner-link chip-mention" href=(corner.mention_href.as_str())>(title.as_str())</a> | |
| 580 | - } | |
| 581 | - if let Some(title) = failing_chip { | |
| 582 | - <a class="corner-link chip-failing" href=(corner.failing_href.as_str())>(title.as_str())</a> | |
| 583 | - } | |
| 584 | - </div> | |
| 585 | 523 | <div class="corner-sep"></div> |
| 586 | 524 | <a class="corner-link" href="/settings/profile">(settings_label)</a> |
| 587 | 525 | if corner.is_admin { |
| 588 | 526 | <a class="corner-link" href="/admin/users">(admin_label)</a> |
| 589 | 527 | } |
| 590 | 528 | <div class="corner-sep"></div> |
| 591 | - <div class="corner-theme"><span>(theme_label)</span> | |
| 592 | - <form method="post" action="/-/theme" class="corner-theme-set" data-no-tick="true"> | |
| 593 | - <input type="hidden" name="csrf" value=(corner.csrf.as_str())> | |
| 594 | - <input type="hidden" name="back" value=(corner.back.as_str())> | |
| 595 | - <button type="submit" name="theme" value="auto" aria-pressed=(auto_pressed) title=(match_label) aria-label=(match_label)> | |
| 596 | - <svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="4" width="18" height="12" rx="2"/><path d="M8 20h8M12 16v4"/></svg> | |
| 597 | - </button> | |
| 598 | - <button type="submit" name="theme" value="light" aria-pressed=(light_pressed) title=(light_label) aria-label=(light_label)> | |
| 599 | - <svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/></svg> | |
| 600 | - </button> | |
| 601 | - <button type="submit" name="theme" value="dark" aria-pressed=(dark_pressed) title=(dark_label) aria-label=(dark_label)> | |
| 602 | - <svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><path d="M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z"/></svg> | |
| 603 | - </button> | |
| 604 | - </form> | |
| 605 | - </div> | |
| 606 | 529 | <form data-hard="true" method="post" action="/logout"> |
| 607 | 530 | <input type="hidden" name="csrf" value=(corner.csrf.as_str())> |
| 608 | 531 | <button type="submit" class="corner-link link-button">(logout_label)</button> |
| @@ -628,17 +551,16 @@ pub async fn shell( | ||
| 628 | 551 | let full_title = format!("{title} \u{b7} forge"); |
| 629 | 552 | // The unread count, the profile corner's inbox counts, their CI runs and the items waiting on |
| 630 | 553 | // them. Signed-in only. |
| 631 | - let (unread, inbox, runs, waiting) = match viewer { | |
| 554 | + let (unread, inbox, runs) = match viewer { | |
| 632 | 555 | Some((user, _)) => match try_app_context::<AppState>(__cx) { |
| 633 | 556 | Some(state) => ( |
| 634 | 557 | state.store.unread_count(&user.id).await?, |
| 635 | 558 | state.store.inbox_kind_counts(&user.id).await?, |
| 636 | 559 | state.store.actor_runs(&user.id, 120).await?, |
| 637 | - state.store.waiting_on(&user.id, 5).await?, | |
| 638 | 560 | ), |
| 639 | - None => (0, InboxKinds::default(), no_runs(), Vec::new()), | |
| 561 | + None => (0, InboxKinds::default(), no_runs()), | |
| 640 | 562 | }, |
| 641 | - None => (0, InboxKinds::default(), no_runs(), Vec::new()), | |
| 563 | + None => (0, InboxKinds::default(), no_runs()), | |
| 642 | 564 | }; |
| 643 | 565 | let signed_in = viewer.is_some(); |
| 644 | 566 | // Both kinds of visitor post to `/-/theme`. Signed-in users send their CSRF token and get the |
| @@ -725,6 +647,7 @@ pub async fn shell( | ||
| 725 | 647 | ); |
| 726 | 648 | let palette_label = br::t(lang, br::K::PaletteOpen).to_owned(); |
| 727 | 649 | let explore_label = t(lang, Key::Explore); |
| 650 | + let home_label = o::t(lang, OK::Home); | |
| 728 | 651 | // The path bar: one segment per part of the request path, the last one unlinked. |
| 729 | 652 | let mut segments = path_segments(lang, uri(__cx).path(), title); |
| 730 | 653 | // A page with no place of its own in the path, such as settings, names its section and itself. |
| @@ -778,32 +701,8 @@ pub async fn shell( | ||
| 778 | 701 | let cancelled_tpl = count_template(&mi::cancelled_count(lang, 2), 2); |
| 779 | 702 | let runs_label = mi::t(lang, MK::YourCiRuns); |
| 780 | 703 | let search_for_label = mi::t(lang, MK::SearchPublicReposFor); |
| 781 | - // The profile corner, the signed-in account panel. | |
| 782 | - // Each chip leads to the newest thing it counts; a review or mention past the five newest | |
| 783 | - // waiting items falls back to the inbox. | |
| 784 | - let newest_waiting = |review: bool| { | |
| 785 | - waiting | |
| 786 | - .iter() | |
| 787 | - .find(|item| { | |
| 788 | - matches!( | |
| 789 | - item.reason, | |
| 790 | - forge_core::notifications::Reason::ReviewRequested | |
| 791 | - ) == review | |
| 792 | - }) | |
| 793 | - .map_or_else( | |
| 794 | - || "/notifications".to_owned(), | |
| 795 | - |item| { | |
| 796 | - let section = if item.is_pull { "pulls" } else { "issues" }; | |
| 797 | - repo_href(&item.owner, &item.repo, section, &item.number.to_string()) | |
| 798 | - }, | |
| 799 | - ) | |
| 800 | - }; | |
| 801 | - let review_href = newest_waiting(true); | |
| 802 | - let mention_href = newest_waiting(false); | |
| 803 | - let failing_href = runs.newest_failing.as_ref().map_or_else( | |
| 804 | - || "/notifications".to_owned(), | |
| 805 | - |(owner, repo, number)| repo_href(owner, repo, "ci", &format!("runs/{number}")), | |
| 806 | - ); | |
| 704 | + // The profile corner, the signed-in account panel. Its dot says something waits: an unread | |
| 705 | + // notification, a review request, a mention or a failed run. | |
| 807 | 706 | let corner = viewer.map(|(user, session)| ProfileCorner { |
| 808 | 707 | username: user.username.clone(), |
| 809 | 708 | name: user |
| @@ -815,16 +714,9 @@ pub async fn shell( | ||
| 815 | 714 | .to_owned(), |
| 816 | 715 | avatar: avatar_url(&user.username, user.avatar_hash.as_deref()), |
| 817 | 716 | csrf: session.csrf_token.clone(), |
| 818 | - back: back.clone().unwrap_or_else(|| "/".to_owned()), | |
| 819 | 717 | is_admin: user.is_admin, |
| 820 | - theme: theme_pref.to_owned(), | |
| 821 | 718 | unread, |
| 822 | - reviews: inbox.reviews, | |
| 823 | - mentions: inbox.mentions, | |
| 824 | - failing: runs.failing, | |
| 825 | - review_href, | |
| 826 | - mention_href, | |
| 827 | - failing_href, | |
| 719 | + waiting: inbox.reviews + inbox.mentions + runs.failing > 0, | |
| 828 | 720 | }); |
| 829 | 721 | Ok(view! { |
| 830 | 722 | <!DOCTYPE html> |
| @@ -857,7 +749,7 @@ pub async fn shell( | ||
| 857 | 749 | profile_corner(lang: lang, corner: corner) |
| 858 | 750 | </div> |
| 859 | 751 | } |
| 860 | - <a class="wordmark" href="/">"forge"</a> | |
| 752 | + <a class="wordmark" href="/" title=(home_label)>"forge"</a> | |
| 861 | 753 | </div> |
| 862 | 754 | <nav class="pathbar" aria-label=(mi::t(lang, MK::BreadcrumbNav))> |
| 863 | 755 | <ol class="pathbar-segs"> |
| @@ -1013,16 +905,10 @@ pub fn admin_items(lang: Lang) -> Vec<NavItem> { | ||
| 1013 | 905 | }; |
| 1014 | 906 | vec![ |
| 1015 | 907 | item("users", "/admin/users", ad::t(lang, AK::Users)), |
| 1016 | - item("invites", "/admin/invites", ad::t(lang, AK::Invites)), | |
| 1017 | 908 | item("runners", "/admin/runners", ad::t(lang, AK::Runners)), |
| 1018 | 909 | item("server", "/admin/server", ad::t(lang, AK::ServerSettings)), |
| 1019 | 910 | item("mail", "/admin/mail", ad::t(lang, AK::Mail)), |
| 1020 | 911 | item("backups", "/admin/backups", ad::t(lang, AK::Backups)), |
| 1021 | - item( | |
| 1022 | - "replication", | |
| 1023 | - "/admin/replication", | |
| 1024 | - ad::t(lang, AK::Replication), | |
| 1025 | - ), | |
| 1026 | 912 | item( |
| 1027 | 913 | "health", |
| 1028 | 914 | "/admin/health", |
| @@ -1156,10 +1042,13 @@ pub fn section_for(lang: Lang, path: &str) -> Option<Section> { | ||
| 1156 | 1042 | ), |
| 1157 | 1043 | _ => return None, |
| 1158 | 1044 | }; |
| 1159 | - let second = match second { | |
| 1160 | - "sessions" => "security", | |
| 1161 | - "gpg" | "tokens" => "keys", | |
| 1162 | - other => other, | |
| 1045 | + let second = match (first, second) { | |
| 1046 | + (_, "sessions") => "security", | |
| 1047 | + (_, "gpg" | "tokens") => "keys", | |
| 1048 | + // Invites are a rail item of Users, replication one of Backups. | |
| 1049 | + ("admin", "invites") => "users", | |
| 1050 | + ("admin", "replication") => "backups", | |
| 1051 | + (_, other) => other, | |
| 1163 | 1052 | }; |
| 1164 | 1053 | let current = items |
| 1165 | 1054 | .iter() |
crates/forge-web/src/views/parts.rsmodified+161 -0
| @@ -81,6 +81,167 @@ pub async fn post_act( | ||
| 81 | 81 | }) |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | +/// One person in a people list: an organization member or a repository collaborator. | |
| 85 | +pub struct PersonRow { | |
| 86 | + pub user_id: String, | |
| 87 | + pub username: String, | |
| 88 | + /// What to show: the login name, or "Deleted user" for the ghost account. | |
| 89 | + pub label: String, | |
| 90 | + pub avatar: String, | |
| 91 | + /// The role's option value, as the form posts it, and its word. | |
| 92 | + pub role: String, | |
| 93 | + pub role_name: String, | |
| 94 | + /// The viewer's own row. The viewer may leave it even without managing the list. | |
| 95 | + pub is_self: bool, | |
| 96 | + /// The remove action's word: "Leave" on the viewer's own row, "Remove" otherwise. | |
| 97 | + pub remove_label: String, | |
| 98 | +} | |
| 99 | + | |
| 100 | +/// A people list with its add form: the part that organization members and repository | |
| 101 | +/// collaborators share. Managers get a role select and a remove on each row, and the add form in | |
| 102 | +/// a reveal beside the title. Everyone else sees plain rows. | |
| 103 | +pub struct PeopleList { | |
| 104 | + pub lang: Lang, | |
| 105 | + /// The list's name, beside its add button ("Members", "Collaborators"). | |
| 106 | + pub title: String, | |
| 107 | + pub rows: Vec<PersonRow>, | |
| 108 | + /// The role options in order, as (value, word). The add form and each row's select share them. | |
| 109 | + pub roles: Vec<(String, String)>, | |
| 110 | + /// Whether the viewer may change roles, add and remove people. | |
| 111 | + pub manage: bool, | |
| 112 | + pub csrf: String, | |
| 113 | + pub role_action: String, | |
| 114 | + pub remove_action: String, | |
| 115 | + /// What the remove confirm says will be lost, if anything. | |
| 116 | + pub remove_note: Option<String>, | |
| 117 | + pub add_action: String, | |
| 118 | + /// The add reveal's id. The add form's fields are `{add_id}-username` and `{add_id}-role`. | |
| 119 | + pub add_id: String, | |
| 120 | + pub add_label: String, | |
| 121 | + /// Whether the add reveal starts open, as after a refused add. | |
| 122 | + pub add_open: bool, | |
| 123 | + /// The role the add form starts on. | |
| 124 | + pub add_default_role: String, | |
| 125 | + pub username_label: String, | |
| 126 | + pub role_label: String, | |
| 127 | + pub save_label: String, | |
| 128 | + pub open_label: String, | |
| 129 | + /// The line shown when there are no rows, if any. | |
| 130 | + pub empty: Option<String>, | |
| 131 | +} | |
| 132 | + | |
| 133 | +/// The people list and its add form. The caller puts it in a sheet. | |
| 134 | +#[component] | |
| 135 | +pub async fn people_list(list: PeopleList) -> Result<impl View> { | |
| 136 | + let PeopleList { | |
| 137 | + lang, | |
| 138 | + title, | |
| 139 | + rows, | |
| 140 | + roles, | |
| 141 | + manage, | |
| 142 | + csrf, | |
| 143 | + role_action, | |
| 144 | + remove_action, | |
| 145 | + remove_note, | |
| 146 | + add_action, | |
| 147 | + add_id, | |
| 148 | + add_label, | |
| 149 | + add_open, | |
| 150 | + add_default_role, | |
| 151 | + username_label, | |
| 152 | + role_label, | |
| 153 | + save_label, | |
| 154 | + open_label, | |
| 155 | + empty, | |
| 156 | + } = list; | |
| 157 | + let username_id = format!("{add_id}-username"); | |
| 158 | + let role_id = format!("{add_id}-role"); | |
| 159 | + let no_rows = rows.is_empty(); | |
| 160 | + Ok(view! { | |
| 161 | + <div class="sheet-tools"> | |
| 162 | + <strong>(title.as_str())</strong> | |
| 163 | + if manage { | |
| 164 | + reveal(label: add_label.as_str(), id: Some(add_id.as_str()), open: add_open, | |
| 165 | + <form method="post" action=(add_action.as_str()) class="fields"> | |
| 166 | + <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 167 | + <div class="field"> | |
| 168 | + <label for=(username_id.as_str())>(username_label.as_str())</label> | |
| 169 | + <input id=(username_id.as_str()) type="text" name="username" autocomplete="off" spellcheck="false" required=(true)> | |
| 170 | + </div> | |
| 171 | + <div class="field"> | |
| 172 | + <label for=(role_id.as_str())>(role_label.as_str())</label> | |
| 173 | + <select id=(role_id.as_str()) name="role"> | |
| 174 | + for (value, word) in roles.iter() { | |
| 175 | + <option value=(value.as_str()) selected=(*value == add_default_role)>(word.as_str())</option> | |
| 176 | + } | |
| 177 | + </select> | |
| 178 | + </div> | |
| 179 | + <button type="submit" class="primary">(add_label.as_str())</button> | |
| 180 | + </form> | |
| 181 | + ) | |
| 182 | + } | |
| 183 | + </div> | |
| 184 | + if no_rows { | |
| 185 | + if let Some(line) = empty.as_deref() { | |
| 186 | + <p class="state">(line)</p> | |
| 187 | + } | |
| 188 | + } | |
| 189 | + for row in rows.iter() { | |
| 190 | + if manage { | |
| 191 | + <details class="row-open"> | |
| 192 | + <summary class="line" data-kb-row=""> | |
| 193 | + <span class="name org-who"> | |
| 194 | + <img class="avatar avatar-sm" src=(row.avatar.as_str()) alt="" width="24" height="24"> | |
| 195 | + <span>(row.label.as_str())</span> | |
| 196 | + </span> | |
| 197 | + <span class="val">(row.role_name.as_str())</span> | |
| 198 | + </summary> | |
| 199 | + <div class="opened"> | |
| 200 | + <form method="post" action=(role_action.as_str()) class="fields"> | |
| 201 | + <input type="hidden" name="csrf" value=(csrf.as_str())> | |
| 202 | + <input type="hidden" name="user_id" value=(row.user_id.as_str())> | |
| 203 | + <div class="field"> | |
| 204 | + <label for=(format!("role-{}", row.user_id))>(role_label.as_str())</label> | |
| 205 | + <select id=(format!("role-{}", row.user_id)) name="role" aria-label=(crate::i18n::orgs::role_for(lang, row.username.as_str()))> | |
| 206 | + for (value, word) in roles.iter() { | |
| 207 | + <option value=(value.as_str()) selected=(*value == row.role)>(word.as_str())</option> | |
| 208 | + } | |
| 209 | + </select> | |
| 210 | + </div> | |
| 211 | + <button type="submit" class="primary small">(save_label.as_str())</button> | |
| 212 | + </form> | |
| 213 | + <div class="acts"> | |
| 214 | + <a class="act" href=(format!("/{}", row.username))>(open_label.as_str())</a> | |
| 215 | + confirm_act(lang: lang, label: row.remove_label.as_str(), action: remove_action.as_str(), csrf: csrf.as_str(), | |
| 216 | + fields: vec![("user_id".to_owned(), row.user_id.clone())], note: remove_note.clone()) | |
| 217 | + </div> | |
| 218 | + </div> | |
| 219 | + </details> | |
| 220 | + } | |
| 221 | + if !manage && row.is_self { | |
| 222 | + <div class="line" data-kb-row=""> | |
| 223 | + <span class="name org-who"> | |
| 224 | + <img class="avatar avatar-sm" src=(row.avatar.as_str()) alt="" width="24" height="24"> | |
| 225 | + <span>(row.label.as_str())</span> | |
| 226 | + </span> | |
| 227 | + <span class="val">(row.role_name.as_str())</span> | |
| 228 | + confirm_act(lang: lang, label: row.remove_label.as_str(), action: remove_action.as_str(), csrf: csrf.as_str(), | |
| 229 | + fields: vec![("user_id".to_owned(), row.user_id.clone())], note: remove_note.clone()) | |
| 230 | + </div> | |
| 231 | + } | |
| 232 | + if !manage && !row.is_self { | |
| 233 | + <a class="line" href=(format!("/{}", row.username)) data-kb-row=""> | |
| 234 | + <span class="name org-who"> | |
| 235 | + <img class="avatar avatar-sm" src=(row.avatar.as_str()) alt="" width="24" height="24"> | |
| 236 | + <span>(row.label.as_str())</span> | |
| 237 | + </span> | |
| 238 | + <span class="val">(row.role_name.as_str())</span> | |
| 239 | + </a> | |
| 240 | + } | |
| 241 | + } | |
| 242 | + }) | |
| 243 | +} | |
| 244 | + | |
| 84 | 245 | /// One piece of a head's sub line. Pieces are joined with a middle dot. |
| 85 | 246 | #[derive(Clone, Default)] |
| 86 | 247 | pub struct SubPart { |
docs/ui-language.mdmodified+23 -5
| @@ -76,8 +76,7 @@ no `margin-left:auto`, no `justify-content:space-between`, no second column at t | ||
| 76 | 76 | list itself carries no second "New ..." line under it. |
| 77 | 77 | - **Facts**: a page that describes one thing (an account, an organization) lists it as `.sec.facts`: |
| 78 | 78 | compact 34px lines of a `.key` on the label column, the `.val`, and the action for that fact on the |
| 79 | - same line. No hints stacked under a heading: what a fact means or why its action is missing goes in | |
| 80 | - its value. | |
| 79 | + same line. No hints under a heading or a fact. | |
| 81 | 80 | - **Time range**: every log has a When filter (Any time, Last hour, Last 24 hours, Last 7 days, Last |
| 82 | 81 | 30 days, Today, Dates…). Dates… shows From and To day fields in the viewer's timezone, and the tools |
| 83 | 82 | row starts with the count of entries that match, so "how many sign-ins last week" is one glance. |
| @@ -99,12 +98,12 @@ no `margin-left:auto`, no `justify-content:space-between`, no second column at t | ||
| 99 | 98 | |
| 100 | 99 | ```html |
| 101 | 100 | <form class="fields"> |
| 102 | - <div class="field"><label for="x">Name</label><input id="x"><p class="hint">One line.</p></div> | |
| 101 | + <div class="field"><label for="x">Name</label><input id="x"></div> | |
| 103 | 102 | <button type="submit" class="primary">Save</button> |
| 104 | 103 | </form> |
| 105 | 104 | ``` |
| 106 | 105 | |
| 107 | -The label sits beside its control in one column, the hint after the control. `.field-pair` for two short | |
| 106 | +The label sits beside its control in one column. `.field-pair` for two short | |
| 108 | 107 | fields. A checkbox is `<label class="switch"><input type="checkbox"><span>..</span></label>`, the box right |
| 109 | 108 | before its label. Few fixed options are `.choice`: |
| 110 | 109 | |
| @@ -160,7 +159,9 @@ letter-spacing, no Archivo. `h1` 26/34 bold; `h2` 13 semibold dim; body 15/22; t | ||
| 160 | 159 | |
| 161 | 160 | ## Words |
| 162 | 161 | |
| 163 | -Short, plain, sentence case, no em dashes. All text goes through i18n, or | |
| 162 | +No microcopy: no hints, helper text, subtext, intros or explanations, on any page. A head's sub holds | |
| 163 | +facts only (state, author, time, branch), or nothing. Labels, values, errors and one-line empty states | |
| 164 | +stay. Short, plain, sentence case, no em dashes. All text goes through i18n, or | |
| 164 | 165 | `crate::pages::passkeys::s(lang, "English", "Türkçe")`, in proper Turkish ("çevrim içi" is two words). A |
| 165 | 166 | Turkish page shows no English, an English page no Turkish. |
| 166 | 167 | |
| @@ -177,6 +178,23 @@ Turkish page shows no English, an English page no Turkish. | ||
| 177 | 178 | `fit` sheet takes the whole width there. |
| 178 | 179 | - Pages fit one screen where they can: use tabs and the rail, not stacked unrelated topics. |
| 179 | 180 | |
| 181 | +## Fewer places | |
| 182 | + | |
| 183 | +- One place for each thing. A setting, a count or an action shows on exactly one page; another page | |
| 184 | + links to it instead of repeating it. The unread count is in the profile corner and the inbox, nowhere | |
| 185 | + else; the theme is chosen in Appearance only. | |
| 186 | +- One door per audience. An area holds what its people do: a repository's settings say what the repo | |
| 187 | + is (General), who works on it, how branches are guarded, what it talks to, and its Danger zone | |
| 188 | + (rename, transfer, visibility, archive, delete). Admin is Users, Runners, Server, Mail, Backups, | |
| 189 | + Health and Audit log; what belongs to one of those (invites, replication, a backup's settings) is a | |
| 190 | + rail item there, never a tab or a second copy in Server. | |
| 191 | +- One main action per head. What is rare (a badge snippet, a raw log, a download) is a tool word in the | |
| 192 | + sheet's tools row, not a pill beside the title. | |
| 193 | +- A conversation is quiet: a comment's tools are words (React · Edit · Delete), a run of events by one | |
| 194 | + person folds into one line, a fact that holds the usual value (not pinned, no milestone, open to | |
| 195 | + everyone) shows only its key and its word. | |
| 196 | +- No chatty lines. A sentence the page would read the same without goes. | |
| 197 | + | |
| 180 | 198 | ## Fixed places |
| 181 | 199 | |
| 182 | 200 | - Every head on a page with tabs is one height (a 38px title line and one sub line), so the tabs and the |
style/_min_menus.scssmodified+1 -2
| @@ -56,8 +56,7 @@ | ||
| 56 | 56 | .corner-menu, |
| 57 | 57 | .ref-menu, |
| 58 | 58 | .pop-panel, |
| 59 | -.row-menu-panel, | |
| 60 | -.bell-pop { | |
| 59 | +.row-menu-panel { | |
| 61 | 60 | max-width: calc(100vw - 32px); |
| 62 | 61 | transition: none; |
| 63 | 62 | animation: none; |
style/_one.scssmodified+18 -55
| @@ -590,6 +590,18 @@ input[type="radio"] { | ||
| 590 | 590 | margin-left: 0; |
| 591 | 591 | } |
| 592 | 592 | |
| 593 | +.field:has(> label.sr-only) { | |
| 594 | + grid-template-columns: minmax(0, 1fr); | |
| 595 | + | |
| 596 | + > :not(label) { | |
| 597 | + grid-column: 1; | |
| 598 | + } | |
| 599 | +} | |
| 600 | + | |
| 601 | +.fields:has(> .field > label.sr-only) > :is(button[type="submit"], .button, .acts) { | |
| 602 | + margin-left: 0; | |
| 603 | +} | |
| 604 | + | |
| 593 | 605 | // A quiet action leading the row keeps its words, not its padding, on the fields' edge. |
| 594 | 606 | .fields > .acts > .act:first-child { |
| 595 | 607 | margin-left: -10px; |
| @@ -879,24 +891,15 @@ summary.corner-btn { | ||
| 879 | 891 | } |
| 880 | 892 | } |
| 881 | 893 | |
| 882 | -.corner-chips { | |
| 883 | - display: flex; | |
| 884 | - flex-direction: column; | |
| 885 | - gap: 2px; | |
| 886 | -} | |
| 887 | - | |
| 888 | -.corner-chips:empty { | |
| 889 | - display: none; | |
| 890 | -} | |
| 891 | - | |
| 892 | 894 | .bell-count { |
| 893 | 895 | color: var(--muted); |
| 894 | 896 | font-family: var(--mono); |
| 895 | 897 | font-size: 12.5px; |
| 896 | 898 | } |
| 897 | 899 | |
| 898 | -// Something waits for the viewer: a dot on the avatar. It follows the menu's own rows. | |
| 899 | -details.corner:has(.bell-count, .corner-chips > a) > .corner-btn::after { | |
| 900 | +// Something waits for the viewer (an unread notification, a review request, a mention or a failed | |
| 901 | +// run): a dot on the avatar. nav.js keeps the `waiting` class in step with the counts. | |
| 902 | +details.corner.waiting > .corner-btn::after { | |
| 900 | 903 | content: ""; |
| 901 | 904 | position: absolute; |
| 902 | 905 | top: -1px; |
| @@ -955,43 +958,6 @@ button.corner-link { | ||
| 955 | 958 | } |
| 956 | 959 | } |
| 957 | 960 | |
| 958 | -.corner-theme { | |
| 959 | - display: flex; | |
| 960 | - align-items: center; | |
| 961 | - gap: 8px; | |
| 962 | - padding: 4px 12px; | |
| 963 | - color: var(--muted); | |
| 964 | - font-size: 14px; | |
| 965 | -} | |
| 966 | - | |
| 967 | -.corner-theme-set { | |
| 968 | - display: inline-flex; | |
| 969 | - gap: 2px; | |
| 970 | - padding: 3px; | |
| 971 | - border-radius: 19px; | |
| 972 | - background: var(--surface-2); | |
| 973 | - | |
| 974 | - button { | |
| 975 | - width: 32px; | |
| 976 | - height: 28px; | |
| 977 | - padding: 0; | |
| 978 | - border-radius: 14px; | |
| 979 | - background: none; | |
| 980 | - color: var(--muted); | |
| 981 | - | |
| 982 | - &:hover { | |
| 983 | - background: none; | |
| 984 | - color: var(--text); | |
| 985 | - } | |
| 986 | - | |
| 987 | - &[aria-pressed="true"] { | |
| 988 | - background: var(--surface); | |
| 989 | - box-shadow: 0 0 0 1px var(--border); | |
| 990 | - color: var(--text); | |
| 991 | - } | |
| 992 | - } | |
| 993 | -} | |
| 994 | - | |
| 995 | 961 | // The avatar is the whole button: no inset, so it sits on the top bar's middle line. |
| 996 | 962 | .corner-float summary.corner-btn { |
| 997 | 963 | padding: 0; |
| @@ -1580,7 +1546,6 @@ a.line:hover .name, | ||
| 1580 | 1546 | .ci-tl-more > p, |
| 1581 | 1547 | .dock-expand > .dock-message, |
| 1582 | 1548 | details > .status-list, |
| 1583 | -.bell-box, | |
| 1584 | 1549 | .palette-box { |
| 1585 | 1550 | border: 0 !important; |
| 1586 | 1551 | border-radius: 20px !important; |
| @@ -2471,8 +2436,7 @@ dialog[data-finder] { | ||
| 2471 | 2436 | text-transform: none; |
| 2472 | 2437 | } |
| 2473 | 2438 | |
| 2474 | -.select-search-none, | |
| 2475 | -.bell-empty { | |
| 2439 | +.select-search-none { | |
| 2476 | 2440 | padding: 8px 12px; |
| 2477 | 2441 | color: var(--muted); |
| 2478 | 2442 | font-size: 14px; |
| @@ -3160,13 +3124,12 @@ details:not([open])::details-content { | ||
| 3160 | 3124 | } |
| 3161 | 3125 | } |
| 3162 | 3126 | |
| 3163 | -// Every head of a page with tabs is one height: a 38px title line (as tall as the button beside a | |
| 3164 | -// title) and one sub line, so switching tabs never moves the tabs or what is under them. | |
| 3165 | 3127 | .head-title { |
| 3166 | 3128 | min-height: 38px; |
| 3167 | 3129 | } |
| 3168 | 3130 | |
| 3169 | -main:has(> nav.tabs) > .head { | |
| 3131 | +main:has(> nav.tabs) > .head:has(.head-sub), | |
| 3132 | +main:has(> nav.tabs[data-section="admin"]) > .head { | |
| 3170 | 3133 | min-height: 64px; |
| 3171 | 3134 | } |
| 3172 | 3135 |
style/_one_admin.scssmodified+12 -0
| @@ -396,3 +396,15 @@ $repo: 'main:has(> section.repo-head .tab.active[href$="/settings"])'; | ||
| 396 | 396 | #{$repo} .recent-checks { |
| 397 | 397 | margin-left: 0; |
| 398 | 398 | } |
| 399 | + | |
| 400 | +#{$admin} .sheet:has(select[name="storage.backend"]) { | |
| 401 | + [id^="srv-storage.s3."], | |
| 402 | + [id^="srv-storage.r2."] { | |
| 403 | + display: none; | |
| 404 | + } | |
| 405 | +} | |
| 406 | + | |
| 407 | +#{$admin} .sheet:has(select[name="storage.backend"] option[value="s3"]:checked) [id^="srv-storage.s3."], | |
| 408 | +#{$admin} .sheet:has(select[name="storage.backend"] option[value="r2"]:checked) [id^="srv-storage.r2."] { | |
| 409 | + display: grid; | |
| 410 | +} |
style/_one_ci.scssmodified+15 -0
| @@ -125,6 +125,21 @@ | ||
| 125 | 125 | right: auto; |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | +// The badge is a quiet tool word in the runs sheet's tools row, not a head pill. | |
| 129 | +.sheet-tools > .ci-badge-tool > summary.act { | |
| 130 | + height: 30px; | |
| 131 | + padding: 0 10px; | |
| 132 | + border-radius: 12px; | |
| 133 | + background: none; | |
| 134 | + color: var(--accent-ink); | |
| 135 | + font-size: 14px; | |
| 136 | + font-weight: 600; | |
| 137 | +} | |
| 138 | + | |
| 139 | +.sheet-tools > .ci-badge-tool > summary.act:hover { | |
| 140 | + background: none; | |
| 141 | +} | |
| 142 | + | |
| 128 | 143 | // The run's estimate bar is the step strip's job: the head keeps only the words. |
| 129 | 144 | .ci-run > .head progress.ci-est-run { |
| 130 | 145 | display: none; |
style/_shell.scssmodified+2 -246
| @@ -636,13 +636,6 @@ | ||
| 636 | 636 | } |
| 637 | 637 | } |
| 638 | 638 | |
| 639 | -.corner-chips { | |
| 640 | - display: flex; | |
| 641 | - align-items: center; | |
| 642 | - gap: 4px; | |
| 643 | - margin-left: auto; | |
| 644 | -} | |
| 645 | - | |
| 646 | 639 | // Chips count what waits on the user. They never take the accent. |
| 647 | 640 | .chip { |
| 648 | 641 | display: inline-flex; |
| @@ -676,192 +669,6 @@ a.chip { | ||
| 676 | 669 | } |
| 677 | 670 | } |
| 678 | 671 | |
| 679 | -// The bell beside the summary, inside the floating panel. It opens the popover of the newest | |
| 680 | -// notifications, and its unread count sits on its top right corner. | |
| 681 | -.corner-bell { | |
| 682 | - position: relative; | |
| 683 | - display: grid; | |
| 684 | - flex: none; | |
| 685 | - place-items: center; | |
| 686 | - width: 28px; | |
| 687 | - height: 28px; | |
| 688 | - border-radius: var(--radius-md); | |
| 689 | - color: var(--muted); | |
| 690 | - | |
| 691 | - &:hover { | |
| 692 | - background: color-mix(in srgb, var(--text) 8%, transparent); | |
| 693 | - color: var(--text); | |
| 694 | - } | |
| 695 | - | |
| 696 | - .ico { | |
| 697 | - width: 18px; | |
| 698 | - height: 18px; | |
| 699 | - } | |
| 700 | -} | |
| 701 | - | |
| 702 | -// The unread count on the bell: a small badge over its top right corner. | |
| 703 | -.corner-bell .bell-count { | |
| 704 | - position: absolute; | |
| 705 | - top: -4px; | |
| 706 | - right: -4px; | |
| 707 | - min-width: 16px; | |
| 708 | - height: 16px; | |
| 709 | - padding: 0 4px; | |
| 710 | - font-size: 10px; | |
| 711 | - line-height: 16px; | |
| 712 | - box-shadow: 0 0 0 2px var(--surface); | |
| 713 | -} | |
| 714 | - | |
| 715 | -// The bell's popover: the newest notifications, opened upward from the bell (nav.js places it). The | |
| 716 | -// UA's centring is reset so the fixed placement holds. It has no display of its own: the UA hides it | |
| 717 | -// while closed. | |
| 718 | -.bell-pop { | |
| 719 | - position: fixed; | |
| 720 | - inset: auto; | |
| 721 | - margin: 0; | |
| 722 | - box-sizing: border-box; | |
| 723 | - width: 320px; | |
| 724 | - max-width: calc(100vw - 16px); | |
| 725 | - max-height: min(420px, 70vh); | |
| 726 | - padding: 0; | |
| 727 | - overflow: hidden; | |
| 728 | - background: var(--surface); | |
| 729 | - color: var(--text); | |
| 730 | - border: 1px solid var(--border); | |
| 731 | - border-radius: var(--radius-md); | |
| 732 | - box-shadow: var(--shadow); | |
| 733 | - opacity: 0; | |
| 734 | -} | |
| 735 | - | |
| 736 | -// Hidden until its list is in (loadPeek in nav.js), so it opens at its final height. | |
| 737 | -.bell-pop.bell-ready { | |
| 738 | - opacity: 1; | |
| 739 | -} | |
| 740 | - | |
| 741 | -.bell-box { | |
| 742 | - display: flex; | |
| 743 | - flex-direction: column; | |
| 744 | - max-height: min(420px, 70vh); | |
| 745 | -} | |
| 746 | - | |
| 747 | -.bell-head { | |
| 748 | - display: flex; | |
| 749 | - align-items: center; | |
| 750 | - justify-content: space-between; | |
| 751 | - gap: 8px; | |
| 752 | - padding: 10px 14px 8px; | |
| 753 | - border-bottom: 1px solid var(--border); | |
| 754 | - font-size: 14px; | |
| 755 | - font-weight: 600; | |
| 756 | -} | |
| 757 | - | |
| 758 | -.bell-clear { | |
| 759 | - display: none; | |
| 760 | - margin: 0; | |
| 761 | - font-size: 13px; | |
| 762 | - font-weight: 400; | |
| 763 | -} | |
| 764 | - | |
| 765 | -.bell-box:has(.bell-item) .bell-clear { | |
| 766 | - display: block; | |
| 767 | -} | |
| 768 | - | |
| 769 | -.bell-list { | |
| 770 | - flex: 1 1 auto; | |
| 771 | - min-height: 0; | |
| 772 | - overflow-y: auto; | |
| 773 | - padding: 4px; | |
| 774 | - border-bottom: 1px solid var(--border); | |
| 775 | -} | |
| 776 | - | |
| 777 | -.bell-rows { | |
| 778 | - margin: 0; | |
| 779 | - padding: 0; | |
| 780 | - list-style: none; | |
| 781 | -} | |
| 782 | - | |
| 783 | -.bell-item { | |
| 784 | - display: grid; | |
| 785 | - grid-template-columns: 8px minmax(0, 1fr); | |
| 786 | - gap: 10px; | |
| 787 | - align-items: start; | |
| 788 | - padding: 8px 10px; | |
| 789 | - border-radius: var(--radius-md); | |
| 790 | - color: var(--text); | |
| 791 | - text-decoration: none; | |
| 792 | - | |
| 793 | - &:hover { | |
| 794 | - background: var(--surface-2); | |
| 795 | - text-decoration: none; | |
| 796 | - } | |
| 797 | -} | |
| 798 | - | |
| 799 | -.bell-dot { | |
| 800 | - width: 8px; | |
| 801 | - height: 8px; | |
| 802 | - margin-top: 6px; | |
| 803 | - border-radius: 50%; | |
| 804 | - | |
| 805 | - &.unread { | |
| 806 | - background: var(--accent); | |
| 807 | - } | |
| 808 | -} | |
| 809 | - | |
| 810 | -.bell-text { | |
| 811 | - display: grid; | |
| 812 | - gap: 2px; | |
| 813 | - min-width: 0; | |
| 814 | -} | |
| 815 | - | |
| 816 | -.bell-line { | |
| 817 | - font-size: 13.5px; | |
| 818 | - line-height: 1.3; | |
| 819 | - overflow-wrap: break-word; | |
| 820 | - display: -webkit-box; | |
| 821 | - -webkit-line-clamp: 2; | |
| 822 | - -webkit-box-orient: vertical; | |
| 823 | - overflow: hidden; | |
| 824 | -} | |
| 825 | - | |
| 826 | -.bell-meta { | |
| 827 | - display: flex; | |
| 828 | - flex-wrap: wrap; | |
| 829 | - gap: 6px; | |
| 830 | - font-size: 12px; | |
| 831 | -} | |
| 832 | - | |
| 833 | -.bell-empty { | |
| 834 | - margin: 0; | |
| 835 | - padding: 10px; | |
| 836 | - font-size: 13px; | |
| 837 | -} | |
| 838 | - | |
| 839 | -.bell-open { | |
| 840 | - flex: none; | |
| 841 | - align-self: stretch; | |
| 842 | - justify-content: center; | |
| 843 | - margin: 8px; | |
| 844 | - text-decoration: none; | |
| 845 | -} | |
| 846 | - | |
| 847 | -.chip-review { | |
| 848 | - color: var(--important); | |
| 849 | - background: color-mix(in srgb, var(--important) 12%, var(--surface)); | |
| 850 | - border-color: color-mix(in srgb, var(--important) 35%, transparent); | |
| 851 | -} | |
| 852 | - | |
| 853 | -.chip-mention { | |
| 854 | - color: var(--info); | |
| 855 | - background: color-mix(in srgb, var(--info) 12%, var(--surface)); | |
| 856 | - border-color: color-mix(in srgb, var(--info) 35%, transparent); | |
| 857 | -} | |
| 858 | - | |
| 859 | -.chip-failing { | |
| 860 | - color: var(--danger); | |
| 861 | - background: var(--danger-bg); | |
| 862 | - border-color: color-mix(in srgb, var(--danger) 35%, transparent); | |
| 863 | -} | |
| 864 | - | |
| 865 | 672 | .corner-menu { |
| 866 | 673 | position: absolute; |
| 867 | 674 | bottom: calc(100% + 8px); |
| @@ -876,8 +683,8 @@ a.chip { | ||
| 876 | 683 | box-shadow: var(--shadow); |
| 877 | 684 | } |
| 878 | 685 | |
| 879 | -// The profile corner: a small panel fixed at the bottom left of the window, the avatar, the name, the | |
| 880 | -// chips and the bell. The name is always shown in full (see `.corner-name` below). | |
| 686 | +// The profile corner: a small panel fixed at the bottom left of the window, the avatar, the name and | |
| 687 | +// the notifications row. The name is always shown in full (see `.corner-name` below). | |
| 881 | 688 | .corner-float { |
| 882 | 689 | position: fixed; |
| 883 | 690 | left: 16px; |
| @@ -977,57 +784,6 @@ button.corner-link.link-button { | ||
| 977 | 784 | } |
| 978 | 785 | } |
| 979 | 786 | |
| 980 | -.corner-theme { | |
| 981 | - display: flex; | |
| 982 | - align-items: center; | |
| 983 | - justify-content: space-between; | |
| 984 | - padding: 4px 6px 4px 10px; | |
| 985 | - font-size: 14px; | |
| 986 | - color: var(--muted); | |
| 987 | - | |
| 988 | - span { | |
| 989 | - color: var(--text-2); | |
| 990 | - } | |
| 991 | -} | |
| 992 | - | |
| 993 | -.corner-theme-set { | |
| 994 | - display: flex; | |
| 995 | - gap: 2px; | |
| 996 | - margin: 0; | |
| 997 | - | |
| 998 | - button { | |
| 999 | - display: grid; | |
| 1000 | - place-items: center; | |
| 1001 | - width: 28px; | |
| 1002 | - height: 26px; | |
| 1003 | - padding: 0; | |
| 1004 | - border: 0; | |
| 1005 | - border-radius: var(--radius-sm); | |
| 1006 | - background: none; | |
| 1007 | - color: var(--muted); | |
| 1008 | - cursor: pointer; | |
| 1009 | - | |
| 1010 | - &:hover { | |
| 1011 | - color: var(--text); | |
| 1012 | - } | |
| 1013 | - | |
| 1014 | - &[aria-pressed="true"] { | |
| 1015 | - background: var(--surface-2); | |
| 1016 | - color: var(--text); | |
| 1017 | - } | |
| 1018 | - | |
| 1019 | - // An icon button has no room for the spinner: dimming alone shows it is busy. | |
| 1020 | - &.is-busy::after { | |
| 1021 | - display: none; | |
| 1022 | - } | |
| 1023 | - } | |
| 1024 | - | |
| 1025 | - .ico { | |
| 1026 | - width: 16px; | |
| 1027 | - height: 16px; | |
| 1028 | - } | |
| 1029 | -} | |
| 1030 | - | |
| 1031 | 787 | // Page column and footer. The footer sits under the page in the same column, so a short page and |
| 1032 | 788 | // its footer fit in the viewport the shell fills (no scroll for a footer's height). |
| 1033 | 789 |