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 +2534 -4352
- 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 +42 -222
- crates/forge-web/src/pages/admin_backups.rs +84 -71
- 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 +65 -49
- crates/forge-web/src/pages/admin_runners.rs +53 -183
- crates/forge-web/src/pages/admin_server.rs +330 -120
- crates/forge-web/src/pages/admin_user_detail.rs +4 -16
- crates/forge-web/src/pages/admin_users.rs +37 -13
- 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 +38 -40
- 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 +8 -18
- 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 +236 -11
- crates/forge-web/src/pages/import.rs +2 -11
- crates/forge-web/src/pages/invites.rs +8 -4
- crates/forge-web/src/pages/issue_parts.rs +269 -79
- crates/forge-web/src/pages/issue_pin.rs +8 -18
- 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 +3 -6
- 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 +39 -87
- 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 +43 -53
- 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 +261 -165
- 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 +82 -75
- 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 +11 -42
- 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 | .await; | 469 | .await; |
| 470 | assert_eq!(audit.status, 200, "audit page"); | 470 | assert_eq!(audit.status, 200, "audit page"); |
| 471 | assert!( | 471 | assert!( |
| 472 | - audit.body.contains("title=\"org_settings_updated\""), | 472 | + audit.body.contains("data-action=\"org_settings_updated\""), |
| 473 | "settings change is audited" | 473 | "settings change is audited" |
| 474 | ); | 474 | ); |
| 475 | let audit = http | 475 | let audit = http |
| 476 | .get("/admin/audit?action=org_deleted", Some(&root_session)) | 476 | .get("/admin/audit?action=org_deleted", Some(&root_session)) |
| 477 | .await; | 477 | .await; |
| 478 | assert!( | 478 | assert!( |
| 479 | - audit.body.contains("title=\"org_deleted\""), | 479 | + audit.body.contains("data-action=\"org_deleted\""), |
| 480 | "org deletion is audited" | 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 | assert_eq!(http.get("/olivia/priv", Some(&bob)).await.status, 404); | 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 | let owner_page = http.get(page, Some(&olivia)).await; | 160 | let owner_page = http.get(page, Some(&olivia)).await; |
| 162 | assert_eq!(owner_page.status, 200, "owner page"); | 161 | assert_eq!(owner_page.status, 200, "owner page"); |
| 163 | - assert!(owner_page.body.contains("view and clone"), "legend missing"); | ||
| 164 | 162 | ||
| 165 | // The owner adds bob as Write: bob now sees the private repo, and the row shows the role. | 163 | // The owner adds bob as Write: bob now sees the private repo, and the row shows the role. |
| 166 | let csrf = csrf_for(&http, &olivia).await; | 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 | assert_eq!(renamed.status, 303, "rename: {}", renamed.body); | 243 | assert_eq!(renamed.status, 303, "rename: {}", renamed.body); |
| 244 | assert_eq!( | 244 | assert_eq!( |
| 245 | renamed.header(LOCATION).as_deref(), | 245 | renamed.header(LOCATION).as_deref(), |
| 246 | - Some("/bob/newpub/settings/rename") | 246 | + Some("/bob/newpub/settings?section=danger") |
| 247 | ); | 247 | ); |
| 248 | assert_eq!( | 248 | assert_eq!( |
| 249 | http.get("/bob/newpub/tree/main/src", None).await.status, | 249 | http.get("/bob/newpub/tree/main/src", None).await.status, |
| @@ -381,14 +381,14 @@ async fn repo_rename_end_to_end() { | |||
| 381 | assert_eq!(transfer.status, 303, "transfer offered: {}", transfer.body); | 381 | assert_eq!(transfer.status, 303, "transfer offered: {}", transfer.body); |
| 382 | assert_eq!( | 382 | assert_eq!( |
| 383 | transfer.header(LOCATION).as_deref(), | 383 | transfer.header(LOCATION).as_deref(), |
| 384 | - Some("/bob/newpub/transfer") | 384 | + Some("/bob/newpub/settings?section=danger") |
| 385 | ); | 385 | ); |
| 386 | assert_eq!( | 386 | assert_eq!( |
| 387 | http.get("/bob/newpub/tree/main/src", None).await.status, | 387 | http.get("/bob/newpub/tree/main/src", None).await.status, |
| 388 | 200, | 388 | 200, |
| 389 | "repo unchanged until accepted" | 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 | assert!(offered.body.contains("Pending transfer to carol")); | 392 | assert!(offered.body.contains("Pending transfer to carol")); |
| 393 | let inbox = http.get("/notifications", Some(&carol)).await; | 393 | let inbox = http.get("/notifications", Some(&carol)).await; |
| 394 | let accept_action = form_action(&inbox.body, "/accept"); | 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 | .await; | 138 | .await; |
| 139 | assert_eq!(carol_page.status, 200, "admin collaborator settings page"); | 139 | assert_eq!(carol_page.status, 200, "admin collaborator settings page"); |
| 140 | assert!( | 140 | assert!( |
| 141 | - !carol_page.body.contains("Danger zone"), | 141 | + !carol_page.body.contains("/bob/priv/settings/delete\""), |
| 142 | - "admin collaborator must not see the danger zone" | 142 | + "admin collaborator must not see the delete form" |
| 143 | ); | 143 | ); |
| 144 | let carol_csrf = csrf_for(&http, &carol).await; | 144 | let carol_csrf = csrf_for(&http, &carol).await; |
| 145 | let carol_delete = http | 145 | let carol_delete = http |
| @@ -246,10 +246,10 @@ async fn repo_settings_end_to_end() { | |||
| 246 | "trash entry is a bare repo" | 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 | let home = http.get("/", Some(&bob)).await; | 250 | let home = http.get("/", Some(&bob)).await; |
| 251 | - assert_eq!(home.status, 303, "home page for a signed-in viewer"); | 251 | + assert_eq!(home.status, 200, "home page for a signed-in viewer"); |
| 252 | - assert_eq!(home.header(LOCATION).as_deref(), Some("/bob")); | 252 | + assert!(home.body.contains("Your repositories"), "home lists their repositories"); |
| 253 | 253 | ||
| 254 | // An admin who does not own the repo can delete it. | 254 | // An admin who does not own the repo can delete it. |
| 255 | let admin_page = http.get("/bob/priv/settings", Some(&tahinli)).await; | 255 | let admin_page = http.get("/bob/priv/settings", Some(&tahinli)).await; |
| @@ -662,8 +662,8 @@ async fn branch_protection_end_to_end() { | |||
| 662 | .get("/bob/app/settings?section=danger", Some(&carol)) | 662 | .get("/bob/app/settings?section=danger", Some(&carol)) |
| 663 | .await; | 663 | .await; |
| 664 | assert!( | 664 | assert!( |
| 665 | - !carol_danger.body.contains("Danger zone"), | 665 | + !carol_danger.body.contains("/bob/app/settings/delete\""), |
| 666 | - "admin collaborator must not see the danger zone" | 666 | + "admin collaborator must not see the delete form" |
| 667 | ); | 667 | ); |
| 668 | assert!( | 668 | assert!( |
| 669 | http.get("/bob/app", Some(&carol)) | 669 | http.get("/bob/app", Some(&carol)) |
| @@ -864,7 +864,7 @@ async fn general_settings_end_to_end() { | |||
| 864 | page.body | 864 | page.body |
| 865 | .contains("href=\"/bob/gen/settings/collaborators\"") | 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 | // Description: control characters are stripped and it shows on the repo header. | 869 | // Description: control characters are stripped and it shows on the repo header. |
| 870 | let csrf = csrf_for(&http, &bob).await; | 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 | assert_eq!(offered.status, 303, "offer: {}", offered.body); | 146 | assert_eq!(offered.status, 303, "offer: {}", offered.body); |
| 147 | assert_eq!( | 147 | assert_eq!( |
| 148 | offered.header(LOCATION).as_deref(), | 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 | assert!(status.body.contains("Pending transfer to carol")); | 152 | assert!(status.body.contains("Pending transfer to carol")); |
| 153 | // Carol cannot read the private repo, yet the inbox offers her the actions. | 153 | // Carol cannot read the private repo, yet the inbox offers her the actions. |
| 154 | assert_eq!(http.get("/bob/priv", Some(&carol)).await.status, 404); | 154 | assert_eq!(http.get("/bob/priv", Some(&carol)).await.status, 404); |
| 155 | let declined = act_from(&http, &carol, "/notifications", "/decline").await; | 155 | let declined = act_from(&http, &carol, "/notifications", "/decline").await; |
| 156 | assert_eq!(declined.status, 303, "decline: {}", declined.body); | 156 | assert_eq!(declined.status, 303, "decline: {}", declined.body); |
| 157 | assert_eq!(declined.header(LOCATION).as_deref(), Some("/notifications")); | 157 | assert_eq!(declined.header(LOCATION).as_deref(), Some("/notifications")); |
| 158 | - let after = http.get("/bob/priv/transfer", Some(&bob)).await; | 158 | + let after = http.get("/bob/priv/settings?section=danger", Some(&bob)).await; |
| 159 | - assert!(after.body.contains("No transfer is pending")); | 159 | + assert!(!after.body.contains("Pending transfer")); |
| 160 | assert_eq!(http.get("/bob/priv", Some(&bob)).await.status, 200); | 160 | assert_eq!(http.get("/bob/priv", Some(&bob)).await.status, 200); |
| 161 | 161 | ||
| 162 | // Offer again, then the initiator cancels it. | 162 | // Offer again, then the initiator cancels it. |
| 163 | assert_eq!(offer(&http, &bob, "bob", "priv", "carol").await.status, 303); | 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 | assert_eq!(cancelled.status, 303, "cancel: {}", cancelled.body); | 165 | assert_eq!(cancelled.status, 303, "cancel: {}", cancelled.body); |
| 166 | assert_eq!( | 166 | assert_eq!( |
| 167 | cancelled.header(LOCATION).as_deref(), | 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; | 170 | + let after = http.get("/bob/priv/settings?section=danger", Some(&bob)).await; |
| 171 | - assert!(after.body.contains("No transfer is pending")); | 171 | + assert!(!after.body.contains("Pending transfer")); |
| 172 | 172 | ||
| 173 | // A transfer to an org: plain members get no accept form, owners do. | 173 | // A transfer to an org: plain members get no accept form, owners do. |
| 174 | let to_org = offer(&http, &bob, "bob", "pub", "acme").await; | 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 | let session = login(&env.http, "tahinli", PW).await; | 170 | let session = login(&env.http, "tahinli", PW).await; |
| 171 | let want = [ | 171 | let want = [ |
| 172 | "/admin/users", | 172 | "/admin/users", |
| 173 | - "/admin/invites", | ||
| 174 | - "/admin/audit", | ||
| 175 | "/admin/runners", | 173 | "/admin/runners", |
| 176 | - "/admin/mail", | ||
| 177 | "/admin/server", | 174 | "/admin/server", |
| 175 | + "/admin/mail", | ||
| 178 | "/admin/backups", | 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 | let page = env.http.get(path, Some(&session)).await; | 190 | let page = env.http.get(path, Some(&session)).await; |
| 183 | assert_eq!(page.status, 200, "GET {path}"); | 191 | assert_eq!(page.status, 200, "GET {path}"); |
| 184 | - assert_tabs(&page.body, path, &want); | 192 | + assert_tabs(&page.body, current, &want); |
| 185 | assert!( | 193 | assert!( |
| 186 | !tab_links(&page.body).iter().any(|(h, _)| h == "/explore"), | 194 | !tab_links(&page.body).iter().any(|(h, _)| h == "/explore"), |
| 187 | "global links are swapped out" | 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 | /// The option value that is selected in the `<select name="...">` on a page. | 59 | /// The option value that is selected in the `<select name="...">` on a page. |
| 60 | fn selected_option(body: &str, select: &str) -> Option<String> { | 60 | fn selected_option(body: &str, select: &str) -> Option<String> { |
| 61 | let doc = scraper::Html::parse_document(body); | 61 | let doc = scraper::Html::parse_document(body); |
| 62 | - // A select's chosen option, or the pressed button of a choice row. | ||
| 63 | let selector = scraper::Selector::parse(&format!( | 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 | .expect("selector"); | 65 | .expect("selector"); |
| 67 | doc.select(&selector) | 66 | doc.select(&selector) |
| @@ -95,17 +94,6 @@ fn theme_button(body: &str) -> (String, String) { | |||
| 95 | (value, label) | 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 | /// Runs an admin subcommand with the password in FORGE_PASSWORD and asserts it succeeded. | 97 | /// Runs an admin subcommand with the password in FORGE_PASSWORD and asserts it succeeded. |
| 110 | fn admin(config: &Path, args: &[&str]) { | 98 | fn admin(config: &Path, args: &[&str]) { |
| 111 | let out = Command::new(bin()) | 99 | let out = Command::new(bin()) |
| @@ -646,7 +634,6 @@ async fn theme_button_cycles_light_dark_auto_light_for_signed_in_users() { | |||
| 646 | let page = env.http.get(back, Some(&session)).await; | 634 | let page = env.http.get(back, Some(&session)).await; |
| 647 | let csrf = input_value(&page.body, "csrf"); | 635 | let csrf = input_value(&page.body, "csrf"); |
| 648 | assert_eq!(html_theme(&page.body).as_deref(), Some("light")); | 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 | let step = env | 638 | let step = env |
| 652 | .http | 639 | .http |
| @@ -659,7 +646,6 @@ async fn theme_button_cycles_light_dark_auto_light_for_signed_in_users() { | |||
| 659 | assert_eq!(step.status, 303, "light to dark: {}", step.body); | 646 | assert_eq!(step.status, 303, "light to dark: {}", step.body); |
| 660 | let page = env.http.get(back, Some(&session)).await; | 647 | let page = env.http.get(back, Some(&session)).await; |
| 661 | assert_eq!(html_theme(&page.body).as_deref(), Some("dark")); | 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 | let step = env | 650 | let step = env |
| 665 | .http | 651 | .http |
| @@ -677,7 +663,6 @@ async fn theme_button_cycles_light_dark_auto_light_for_signed_in_users() { | |||
| 677 | "signed-in toggle to auto stores 'auto'" | 663 | "signed-in toggle to auto stores 'auto'" |
| 678 | ); | 664 | ); |
| 679 | assert_eq!(html_theme(&page.body), None, "auto renders no data-theme"); | 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 | let step = env | 667 | let step = env |
| 683 | .http | 668 | .http |
| @@ -690,7 +675,6 @@ async fn theme_button_cycles_light_dark_auto_light_for_signed_in_users() { | |||
| 690 | assert_eq!(step.status, 303, "auto to light: {}", step.body); | 675 | assert_eq!(step.status, 303, "auto to light: {}", step.body); |
| 691 | let page = env.http.get(back, Some(&session)).await; | 676 | let page = env.http.get(back, Some(&session)).await; |
| 692 | assert_eq!(html_theme(&page.body).as_deref(), Some("light")); | 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 | #[tokio::test] | 680 | #[tokio::test] |
crates/forge-e2e/tests/e2e/wiki_e2e.rsmodified+5 -5
| @@ -242,7 +242,7 @@ async fn wiki_end_to_end() { | |||
| 242 | .await; | 242 | .await; |
| 243 | assert_eq!(audit.status, 200, "audit page"); | 243 | assert_eq!(audit.status, 200, "audit page"); |
| 244 | assert!( | 244 | assert!( |
| 245 | - audit.body.contains("title=\"wiki_pushed\""), | 245 | + audit.body.contains("data-action=\"wiki_pushed\""), |
| 246 | "the wiki push is audited: {}", | 246 | "the wiki push is audited: {}", |
| 247 | audit.body | 247 | audit.body |
| 248 | ); | 248 | ); |
| @@ -299,15 +299,15 @@ async fn wiki_end_to_end() { | |||
| 299 | assert!(!denied.status.success(), "read-only push must fail"); | 299 | assert!(!denied.status.success(), "read-only push must fail"); |
| 300 | 300 | ||
| 301 | // Bob turns the wiki off on the settings page. Carol, who is not an admin, cannot. | 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 | assert!( | 303 | assert!( |
| 304 | - settings.body.contains("Enable the wiki"), | 304 | + settings.body.contains("action=\"/bob/proj/settings/wiki\""), |
| 305 | "{}", | 305 | "{}", |
| 306 | settings.body | 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 | assert_eq!( | 309 | assert_eq!( |
| 310 | - forbidden_toggle.status, 404, | 310 | + forbidden_toggle.status, 403, |
| 311 | "only admins see wiki settings" | 311 | "only admins see wiki settings" |
| 312 | ); | 312 | ); |
| 313 | let off = http | 313 | let off = http |
crates/forge-web-base/src/i18n/accounts.rsmodified+0 -34
| @@ -15,16 +15,12 @@ pub enum A { | |||
| 15 | Suspend, | 15 | Suspend, |
| 16 | Unsuspend, | 16 | Unsuspend, |
| 17 | SuspendReason, | 17 | SuspendReason, |
| 18 | - SuspendHelp, | ||
| 19 | GrantAdmin, | 18 | GrantAdmin, |
| 20 | RevokeAdmin, | 19 | RevokeAdmin, |
| 21 | AdminHelp, | 20 | AdminHelp, |
| 22 | - ResetPassword, | ||
| 23 | GenerateLink, | 21 | GenerateLink, |
| 24 | - ResetHelp, | ||
| 25 | ResetLinkReady, | 22 | ResetLinkReady, |
| 26 | Disable2fa, | 23 | Disable2fa, |
| 27 | - Disable2faHelp, | ||
| 28 | Actions, | 24 | Actions, |
| 29 | OkSuspended, | 25 | OkSuspended, |
| 30 | OkUnsuspended, | 26 | OkUnsuspended, |
| @@ -53,15 +49,11 @@ pub enum A { | |||
| 53 | Ok, | 49 | Ok, |
| 54 | Error, | 50 | Error, |
| 55 | Lagging, | 51 | Lagging, |
| 56 | - HealthIntro, | ||
| 57 | Storage, | 52 | Storage, |
| 58 | Services, | 53 | Services, |
| 59 | Fine, | 54 | Fine, |
| 60 | DiskUsed, | 55 | DiskUsed, |
| 61 | Joined, | 56 | Joined, |
| 62 | - NoPasskeysToRemove, | ||
| 63 | - TwoFactorNotOn, | ||
| 64 | - DeleteHelp, | ||
| 65 | } | 57 | } |
| 66 | 58 | ||
| 67 | pub fn t(lang: Lang, key: A) -> &'static str { | 59 | pub fn t(lang: Lang, key: A) -> &'static str { |
| @@ -90,36 +82,18 @@ pub fn t(lang: Lang, key: A) -> &'static str { | |||
| 90 | (Unsuspend, Tr) => "Askıyı kaldır", | 82 | (Unsuspend, Tr) => "Askıyı kaldır", |
| 91 | (SuspendReason, En) => "Reason shown on the login page", | 83 | (SuspendReason, En) => "Reason shown on the login page", |
| 92 | (SuspendReason, Tr) => "Giriş sayfasında gösterilen neden", | 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 | (GrantAdmin, En) => "Make administrator", | 85 | (GrantAdmin, En) => "Make administrator", |
| 100 | (GrantAdmin, Tr) => "Yönetici yap", | 86 | (GrantAdmin, Tr) => "Yönetici yap", |
| 101 | (RevokeAdmin, En) => "Remove administrator", | 87 | (RevokeAdmin, En) => "Remove administrator", |
| 102 | (RevokeAdmin, Tr) => "Yöneticiliği kaldır", | 88 | (RevokeAdmin, Tr) => "Yöneticiliği kaldır", |
| 103 | (AdminHelp, En) => "The last administrator cannot be demoted.", | 89 | (AdminHelp, En) => "The last administrator cannot be demoted.", |
| 104 | (AdminHelp, Tr) => "Son yönetici yetkisiz bırakılamaz.", | 90 | (AdminHelp, Tr) => "Son yönetici yetkisiz bırakılamaz.", |
| 105 | - (ResetPassword, En) => "Reset password", | ||
| 106 | - (ResetPassword, Tr) => "Parolayı sıfırla", | ||
| 107 | (GenerateLink, En) => "Generate reset link", | 91 | (GenerateLink, En) => "Generate reset link", |
| 108 | (GenerateLink, Tr) => "Sıfırlama bağlantısı üret", | 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 | (ResetLinkReady, En) => "One-time reset link. It is shown only now:", | 93 | (ResetLinkReady, En) => "One-time reset link. It is shown only now:", |
| 116 | (ResetLinkReady, Tr) => "Tek kullanımlık sıfırlama bağlantısı. Yalnızca şimdi gösterilir:", | 94 | (ResetLinkReady, Tr) => "Tek kullanımlık sıfırlama bağlantısı. Yalnızca şimdi gösterilir:", |
| 117 | (Disable2fa, En) => "Disable two-factor", | 95 | (Disable2fa, En) => "Disable two-factor", |
| 118 | (Disable2fa, Tr) => "İki adımlı doğrulamayı kapat", | 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 | (Actions, En) => "Actions", | 97 | (Actions, En) => "Actions", |
| 124 | (Actions, Tr) => "İşlemler", | 98 | (Actions, Tr) => "İşlemler", |
| 125 | (OkSuspended, En) => "Account suspended.", | 99 | (OkSuspended, En) => "Account suspended.", |
| @@ -176,8 +150,6 @@ pub fn t(lang: Lang, key: A) -> &'static str { | |||
| 176 | (Error, Tr) => "Hata", | 150 | (Error, Tr) => "Hata", |
| 177 | (Lagging, En) => "Lagging", | 151 | (Lagging, En) => "Lagging", |
| 178 | (Lagging, Tr) => "Geride", | 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 | (Storage, En) => "Storage", | 153 | (Storage, En) => "Storage", |
| 182 | (Storage, Tr) => "Depolama", | 154 | (Storage, Tr) => "Depolama", |
| 183 | (Services, En) => "Services", | 155 | (Services, En) => "Services", |
| @@ -188,12 +160,6 @@ pub fn t(lang: Lang, key: A) -> &'static str { | |||
| 188 | (DiskUsed, Tr) => "kullanıldı", | 160 | (DiskUsed, Tr) => "kullanıldı", |
| 189 | (Joined, En) => "Joined", | 161 | (Joined, En) => "Joined", |
| 190 | (Joined, Tr) => "Katılım", | 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 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] | 9 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] |
| 10 | pub enum K { | 10 | pub enum K { |
| 11 | ActionLabel, | 11 | ActionLabel, |
| 12 | - ActorUsername, | ||
| 13 | AddARunner, | 12 | AddARunner, |
| 14 | AdminArea, | 13 | AdminArea, |
| 15 | Administrator, | 14 | Administrator, |
| 16 | AllActions, | 15 | AllActions, |
| 17 | - RowActions, | ||
| 18 | Anonymous, | 16 | Anonymous, |
| 19 | - AtLeast12Chars, | ||
| 20 | - AuditIntro, | ||
| 21 | AuditLog, | 17 | AuditLog, |
| 22 | BackToRunners, | 18 | BackToRunners, |
| 23 | BackToUsers, | 19 | BackToUsers, |
| 24 | - BackupInterval, | ||
| 25 | Backups, | 20 | Backups, |
| 26 | - BackupsIntro, | ||
| 27 | CiRunners, | 21 | CiRunners, |
| 28 | CopyTokenNow, | 22 | CopyTokenNow, |
| 29 | - CreateAUser, | ||
| 30 | CreateRegistrationToken, | 23 | CreateRegistrationToken, |
| 31 | CreateUser, | 24 | CreateUser, |
| 32 | Database, | 25 | Database, |
| @@ -54,27 +47,16 @@ pub enum K { | |||
| 54 | FromName, | 47 | FromName, |
| 55 | Fsck, | 48 | Fsck, |
| 56 | Healthcheck, | 49 | Healthcheck, |
| 57 | - HealthcheckNotSet, | ||
| 58 | - HealthcheckSet, | ||
| 59 | - HealthcheckUrlInvalid, | ||
| 60 | HealthError, | 50 | HealthError, |
| 61 | HealthLagging, | 51 | HealthLagging, |
| 62 | HealthNever, | 52 | HealthNever, |
| 63 | HealthOk, | 53 | HealthOk, |
| 64 | - Interval, | ||
| 65 | Invites, | 54 | Invites, |
| 66 | LastDbAttempt, | 55 | LastDbAttempt, |
| 67 | LastDbSnapshotShipped, | 56 | LastDbSnapshotShipped, |
| 68 | LastSeen, | 57 | LastSeen, |
| 69 | LastSuccess, | 58 | LastSuccess, |
| 70 | ServerSettings, | 59 | ServerSettings, |
| 71 | - ServerSettingsIntro, | ||
| 72 | - SrvTabGeneral, | ||
| 73 | - SrvTabLimits, | ||
| 74 | - SrvTabStorage, | ||
| 75 | - SrvTabBackups, | ||
| 76 | - SrvTabIntegrations, | ||
| 77 | - SrvTabAlerts, | ||
| 78 | SrvSaved, | 60 | SrvSaved, |
| 79 | SrvNothingChanged, | 61 | SrvNothingChanged, |
| 80 | SrvResetDone, | 62 | SrvResetDone, |
| @@ -83,17 +65,12 @@ pub enum K { | |||
| 83 | SrvKindLive, | 65 | SrvKindLive, |
| 84 | SrvKindRestart, | 66 | SrvKindRestart, |
| 85 | SrvKindReadOnly, | 67 | SrvKindReadOnly, |
| 86 | - SrvSourceDefault, | ||
| 87 | - SrvSourceFile, | ||
| 88 | - SrvSourceUi, | ||
| 89 | SrvSecretSet, | 68 | SrvSecretSet, |
| 90 | SrvSecretNotSet, | 69 | SrvSecretNotSet, |
| 91 | - SrvSecretHint, | ||
| 92 | SrvFileValue, | 70 | SrvFileValue, |
| 93 | SrvEmpty, | 71 | SrvEmpty, |
| 94 | Mail, | 72 | Mail, |
| 95 | MailHost, | 73 | MailHost, |
| 96 | - MailIntro, | ||
| 97 | MailTabSettings, | 74 | MailTabSettings, |
| 98 | MailTabQueue, | 75 | MailTabQueue, |
| 99 | MailFilterAll, | 76 | MailFilterAll, |
| @@ -103,9 +80,6 @@ pub enum K { | |||
| 103 | MailNotFailed, | 80 | MailNotFailed, |
| 104 | MailDiscarded, | 81 | MailDiscarded, |
| 105 | MailSentAt, | 82 | MailSentAt, |
| 106 | - MailTransportNote, | ||
| 107 | - MailTransportInUse, | ||
| 108 | - MailQueueIntro, | ||
| 109 | MailNothingMatches, | 83 | MailNothingMatches, |
| 110 | MailQueueEmpty, | 84 | MailQueueEmpty, |
| 111 | MailPort, | 85 | MailPort, |
| @@ -117,25 +91,15 @@ pub enum K { | |||
| 117 | NoRunnersYet, | 91 | NoRunnersYet, |
| 118 | NoRunnerWithId, | 92 | NoRunnerWithId, |
| 119 | NoRunsYet, | 93 | NoRunsYet, |
| 120 | - BackupsEmptyHint, | ||
| 121 | - ReplicationConfigHint, | ||
| 122 | - ReposEmptyHint, | ||
| 123 | - RunnersEmptyHint, | ||
| 124 | Older, | 94 | Older, |
| 125 | - OwnLogIntro, | ||
| 126 | - PasswordStoredHint, | ||
| 127 | RecentRuns, | 95 | RecentRuns, |
| 128 | ReconcileNow, | 96 | ReconcileNow, |
| 129 | ReconcileStarted, | 97 | ReconcileStarted, |
| 130 | RegisterARunner, | 98 | RegisterARunner, |
| 131 | RegistrationToken, | 99 | RegistrationToken, |
| 132 | RemovedWithAccount, | 100 | RemovedWithAccount, |
| 133 | - ReplacePrefix, | ||
| 134 | - ReplaceSuffix, | ||
| 135 | Replication, | 101 | Replication, |
| 136 | - ReplicationIntro, | ||
| 137 | ReplicationOff, | 102 | ReplicationOff, |
| 138 | - ReplicationTarget, | ||
| 139 | Repos, | 103 | Repos, |
| 140 | Retention, | 104 | Retention, |
| 141 | Role, | 105 | Role, |
| @@ -159,22 +123,9 @@ pub enum K { | |||
| 159 | StatusFailed, | 123 | StatusFailed, |
| 160 | StatusInProgress, | 124 | StatusInProgress, |
| 161 | StatusOk, | 125 | StatusOk, |
| 162 | - TableActor, | ||
| 163 | - TableDetails, | ||
| 164 | - TableDuration, | ||
| 165 | - TableKind, | ||
| 166 | TableLastError, | 126 | TableLastError, |
| 167 | TableQueued, | 127 | TableQueued, |
| 168 | - TableResult, | ||
| 169 | - TableSize, | ||
| 170 | - TableStarted, | ||
| 171 | - TableState, | ||
| 172 | - TableSubject, | ||
| 173 | - TableTarget, | ||
| 174 | - TableTo, | ||
| 175 | TableTries, | 128 | TableTries, |
| 176 | - TableTrigger, | ||
| 177 | - TableWhen, | ||
| 178 | TestQueued, | 129 | TestQueued, |
| 179 | Token, | 130 | Token, |
| 180 | TokenCreateFailed, | 131 | TokenCreateFailed, |
| @@ -194,8 +145,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 194 | match (key, lang) { | 145 | match (key, lang) { |
| 195 | (ActionLabel, En) => "Action", | 146 | (ActionLabel, En) => "Action", |
| 196 | (ActionLabel, Tr) => "İşlem", | 147 | (ActionLabel, Tr) => "İşlem", |
| 197 | - (ActorUsername, En) => "Actor username", | ||
| 198 | - (ActorUsername, Tr) => "Yapan kullanıcı adı", | ||
| 199 | (AddARunner, En) => "Add a runner", | 148 | (AddARunner, En) => "Add a runner", |
| 200 | (AddARunner, Tr) => "Çalıştırıcı ekle", | 149 | (AddARunner, Tr) => "Çalıştırıcı ekle", |
| 201 | (AdminArea, En) => "Admin", | 150 | (AdminArea, En) => "Admin", |
| @@ -204,44 +153,20 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 204 | (Administrator, Tr) => "Yönetici", | 153 | (Administrator, Tr) => "Yönetici", |
| 205 | (AllActions, En) => "All actions", | 154 | (AllActions, En) => "All actions", |
| 206 | (AllActions, Tr) => "Tüm işlemler", | 155 | (AllActions, Tr) => "Tüm işlemler", |
| 207 | - (RowActions, En) => "Actions", | ||
| 208 | - (RowActions, Tr) => "İşlemler", | ||
| 209 | (Anonymous, En) => "anonymous", | 156 | (Anonymous, En) => "anonymous", |
| 210 | (Anonymous, Tr) => "anonim", | 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 | (AuditLog, En) => "Audit log", | 158 | (AuditLog, En) => "Audit log", |
| 220 | (AuditLog, Tr) => "Denetim günlüğü", | 159 | (AuditLog, Tr) => "Denetim günlüğü", |
| 221 | (BackToRunners, En) => "Back to runners", | 160 | (BackToRunners, En) => "Back to runners", |
| 222 | (BackToRunners, Tr) => "Çalıştırıcılara dön", | 161 | (BackToRunners, Tr) => "Çalıştırıcılara dön", |
| 223 | (BackToUsers, En) => "Back to users", | 162 | (BackToUsers, En) => "Back to users", |
| 224 | (BackToUsers, Tr) => "Kullanıcılara dön", | 163 | (BackToUsers, Tr) => "Kullanıcılara dön", |
| 225 | - (BackupInterval, En) => "Backup interval", | ||
| 226 | - (BackupInterval, Tr) => "Yedekleme aralığı", | ||
| 227 | (Backups, En) => "Backups", | 164 | (Backups, En) => "Backups", |
| 228 | (Backups, Tr) => "Yedeklemeler", | 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 | (CiRunners, En) => "CI runners", | 166 | (CiRunners, En) => "CI runners", |
| 236 | (CiRunners, Tr) => "CI çalıştırıcıları", | 167 | (CiRunners, Tr) => "CI çalıştırıcıları", |
| 237 | - (CopyTokenNow, En) => { | 168 | + (CopyTokenNow, En) => "Shown once.", |
| 238 | - "Copy this token now. It is shown once and cannot be looked up again." | 169 | + (CopyTokenNow, Tr) => "Bir kez gösterilir.", |
| 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", | ||
| 245 | (CreateRegistrationToken, En) => "Create registration token", | 170 | (CreateRegistrationToken, En) => "Create registration token", |
| 246 | (CreateRegistrationToken, Tr) => "Kayıt belirteci oluştur", | 171 | (CreateRegistrationToken, Tr) => "Kayıt belirteci oluştur", |
| 247 | (CreateUser, En) => "Create user", | 172 | (CreateUser, En) => "Create user", |
| @@ -250,12 +175,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 250 | (Database, Tr) => "Veritabanı", | 175 | (Database, Tr) => "Veritabanı", |
| 251 | (DatabaseErrorPrefix, En) => "Database: ", | 176 | (DatabaseErrorPrefix, En) => "Database: ", |
| 252 | (DatabaseErrorPrefix, Tr) => "Veritabanı: ", | 177 | (DatabaseErrorPrefix, Tr) => "Veritabanı: ", |
| 253 | - (DeleteAccountRest, En) => { | 178 | + (DeleteAccountRest, En) => ". This cannot be undone.", |
| 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." | 179 | + (DeleteAccountRest, Tr) => " hesabını siler. Bu işlem geri alınamaz.", |
| 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 | - } | ||
| 259 | (DeletesAccount, En) => "This deletes the account ", | 180 | (DeletesAccount, En) => "This deletes the account ", |
| 260 | (DeletesAccount, Tr) => "Bu işlem ", | 181 | (DeletesAccount, Tr) => "Bu işlem ", |
| 261 | (DeleteOrgTitle, En) => "Delete organization", | 182 | (DeleteOrgTitle, En) => "Delete organization", |
| @@ -272,14 +193,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 272 | (Enable, Tr) => "Etkinleştir", | 193 | (Enable, Tr) => "Etkinleştir", |
| 273 | (OpenOrgSettings, En) => "Open organization settings", | 194 | (OpenOrgSettings, En) => "Open organization settings", |
| 274 | (OpenOrgSettings, Tr) => "Kuruluş ayarlarını aç", | 195 | (OpenOrgSettings, Tr) => "Kuruluş ayarlarını aç", |
| 275 | - (OrgNotAUser, En) => { | 196 | + (OrgNotAUser, En) => " is an organization.", |
| 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." | 197 | + (OrgNotAUser, Tr) => " bir kuruluştur.", |
| 277 | - } | 198 | + (OrgReposFirst, En) => "Repositories it still owns:", |
| 278 | - (OrgNotAUser, Tr) => { | 199 | + (OrgReposFirst, Tr) => "Hâlâ sahip olduğu depolar:", |
| 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:", | ||
| 283 | (ErrAccountCannotBeDeleted, En) => "this account cannot be deleted", | 200 | (ErrAccountCannotBeDeleted, En) => "this account cannot be deleted", |
| 284 | (ErrAccountCannotBeDeleted, Tr) => "bu hesap silinemez", | 201 | (ErrAccountCannotBeDeleted, Tr) => "bu hesap silinemez", |
| 285 | (ErrBackupsNotConfigured, En) => { | 202 | (ErrBackupsNotConfigured, En) => { |
| @@ -320,12 +237,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 320 | (Fsck, Tr) => "Fsck", | 237 | (Fsck, Tr) => "Fsck", |
| 321 | (Healthcheck, En) => "Healthcheck", | 238 | (Healthcheck, En) => "Healthcheck", |
| 322 | (Healthcheck, Tr) => "Sağlık denetimi", | 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 | (HealthError, En) => "error", | 240 | (HealthError, En) => "error", |
| 330 | (HealthError, Tr) => "hata", | 241 | (HealthError, Tr) => "hata", |
| 331 | (HealthLagging, En) => "lagging", | 242 | (HealthLagging, En) => "lagging", |
| @@ -334,8 +245,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 334 | (HealthNever, Tr) => "hiç çoğaltılmadı", | 245 | (HealthNever, Tr) => "hiç çoğaltılmadı", |
| 335 | (HealthOk, En) => "ok", | 246 | (HealthOk, En) => "ok", |
| 336 | (HealthOk, Tr) => "tamam", | 247 | (HealthOk, Tr) => "tamam", |
| 337 | - (Interval, En) => "Interval", | ||
| 338 | - (Interval, Tr) => "Aralık", | ||
| 339 | (Invites, En) => "Invites", | 248 | (Invites, En) => "Invites", |
| 340 | (Invites, Tr) => "Davetler", | 249 | (Invites, Tr) => "Davetler", |
| 341 | (LastDbAttempt, En) => "Last database attempt", | 250 | (LastDbAttempt, En) => "Last database attempt", |
| @@ -348,24 +257,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 348 | (LastSuccess, Tr) => "Son başarı", | 257 | (LastSuccess, Tr) => "Son başarı", |
| 349 | (ServerSettings, En) => "Server", | 258 | (ServerSettings, En) => "Server", |
| 350 | (ServerSettings, Tr) => "Sunucu", | 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 | (SrvSaved, En) => "Server settings saved.", | 260 | (SrvSaved, En) => "Server settings saved.", |
| 370 | (SrvSaved, Tr) => "Sunucu ayarları kaydedildi.", | 261 | (SrvSaved, Tr) => "Sunucu ayarları kaydedildi.", |
| 371 | (SrvNothingChanged, En) => "Nothing changed.", | 262 | (SrvNothingChanged, En) => "Nothing changed.", |
| @@ -382,18 +273,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 382 | (SrvKindRestart, Tr) => "yeniden başlatma", | 273 | (SrvKindRestart, Tr) => "yeniden başlatma", |
| 383 | (SrvKindReadOnly, En) => "read-only", | 274 | (SrvKindReadOnly, En) => "read-only", |
| 384 | (SrvKindReadOnly, Tr) => "salt okunur", | 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 | (SrvSecretSet, En) => "set", | 276 | (SrvSecretSet, En) => "set", |
| 392 | (SrvSecretSet, Tr) => "ayarlı", | 277 | (SrvSecretSet, Tr) => "ayarlı", |
| 393 | (SrvSecretNotSet, En) => "not set", | 278 | (SrvSecretNotSet, En) => "not set", |
| 394 | (SrvSecretNotSet, Tr) => "ayarlı değil", | 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 | (SrvFileValue, En) => "File value", | 280 | (SrvFileValue, En) => "File value", |
| 398 | (SrvFileValue, Tr) => "Dosya değeri", | 281 | (SrvFileValue, Tr) => "Dosya değeri", |
| 399 | (SrvEmpty, En) => "(empty)", | 282 | (SrvEmpty, En) => "(empty)", |
| @@ -422,32 +305,12 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 422 | (MailDiscarded, Tr) => "Mesajdan vazgeçildi.", | 305 | (MailDiscarded, Tr) => "Mesajdan vazgeçildi.", |
| 423 | (MailSentAt, En) => "Sent", | 306 | (MailSentAt, En) => "Sent", |
| 424 | (MailSentAt, Tr) => "Gönderildi", | 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 | (MailNothingMatches, En) => "No message is in this state.", | 308 | (MailNothingMatches, En) => "No message is in this state.", |
| 440 | (MailNothingMatches, Tr) => "Bu durumda ileti yok.", | 309 | (MailNothingMatches, Tr) => "Bu durumda ileti yok.", |
| 441 | (MailQueueEmpty, En) => "Nothing waiting to be sent.", | 310 | (MailQueueEmpty, En) => "Nothing waiting to be sent.", |
| 442 | (MailQueueEmpty, Tr) => "Gönderilmeyi bekleyen ileti yok.", | 311 | (MailQueueEmpty, Tr) => "Gönderilmeyi bekleyen ileti yok.", |
| 443 | (MailHost, En) => "Host", | 312 | (MailHost, En) => "Host", |
| 444 | (MailHost, Tr) => "Sunucu", | 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 | (MailPort, En) => "Port", | 314 | (MailPort, En) => "Port", |
| 452 | (MailPort, Tr) => "Bağlantı noktası", | 315 | (MailPort, Tr) => "Bağlantı noktası", |
| 453 | (MailSettingsSaved, En) => "Mail settings saved.", | 316 | (MailSettingsSaved, En) => "Mail settings saved.", |
| @@ -466,34 +329,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 466 | (NoRunnerWithId, Tr) => "Bu kimlikte bir çalıştırıcı yok. Hiçbir şey değiştirilmedi.", | 329 | (NoRunnerWithId, Tr) => "Bu kimlikte bir çalıştırıcı yok. Hiçbir şey değiştirilmedi.", |
| 467 | (NoRunsYet, En) => "No runs yet.", | 330 | (NoRunsYet, En) => "No runs yet.", |
| 468 | (NoRunsYet, Tr) => "Henüz çalıştırma yok.", | 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 | (Older, En) => "Older", | 332 | (Older, En) => "Older", |
| 486 | (Older, Tr) => "Daha eski", | 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 | (RecentRuns, En) => "Recent runs", | 334 | (RecentRuns, En) => "Recent runs", |
| 498 | (RecentRuns, Tr) => "Son çalıştırmalar", | 335 | (RecentRuns, Tr) => "Son çalıştırmalar", |
| 499 | (ReconcileNow, En) => "Reconcile now", | 336 | (ReconcileNow, En) => "Reconcile now", |
| @@ -506,26 +343,14 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 506 | (RegistrationToken, Tr) => "Kayıt belirteci", | 343 | (RegistrationToken, Tr) => "Kayıt belirteci", |
| 507 | (RemovedWithAccount, En) => "Removed with the account:", | 344 | (RemovedWithAccount, En) => "Removed with the account:", |
| 508 | (RemovedWithAccount, Tr) => "Hesapla birlikte silinenler:", | 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 | (Replication, En) => "Replication", | 346 | (Replication, En) => "Replication", |
| 514 | (Replication, Tr) => "Çoğaltma", | 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 | (ReplicationOff, En) => { | 348 | (ReplicationOff, En) => { |
| 522 | "Replication is off. Set target, identity_file and known_hosts_file in the [replication] section to turn it on." | 349 | "Replication is off. Set target, identity_file and known_hosts_file in the [replication] section to turn it on." |
| 523 | } | 350 | } |
| 524 | (ReplicationOff, Tr) => { | 351 | (ReplicationOff, Tr) => { |
| 525 | "Çoğaltma kapalı. Açmak için [replication] bölümünde target, identity_file ve known_hosts_file ayarlarını yapın." | 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 | (Repos, En) => "Repos", | 354 | (Repos, En) => "Repos", |
| 530 | (Repos, Tr) => "Depolar", | 355 | (Repos, Tr) => "Depolar", |
| 531 | (Retention, En) => "Retention", | 356 | (Retention, En) => "Retention", |
| @@ -551,10 +376,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 551 | (Runners, En) => "Runners", | 376 | (Runners, En) => "Runners", |
| 552 | (Runners, Tr) => "Çalıştırıcılar", | 377 | (Runners, Tr) => "Çalıştırıcılar", |
| 553 | (ScheduledBackupsOff, En) => { | 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 | (ScheduledBackupsOff, Tr) => { | 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 | (SecurityLogTitle, En) => "Security log", | 384 | (SecurityLogTitle, En) => "Security log", |
| 560 | (SecurityLogTitle, Tr) => "Güvenlik günlüğü", | 385 | (SecurityLogTitle, Tr) => "Güvenlik günlüğü", |
| @@ -576,38 +401,12 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 576 | (StatusInProgress, Tr) => "sürüyor", | 401 | (StatusInProgress, Tr) => "sürüyor", |
| 577 | (StatusOk, En) => "ok", | 402 | (StatusOk, En) => "ok", |
| 578 | (StatusOk, Tr) => "tamam", | 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 | (TableLastError, En) => "Last error", | 404 | (TableLastError, En) => "Last error", |
| 588 | (TableLastError, Tr) => "Son hata", | 405 | (TableLastError, Tr) => "Son hata", |
| 589 | (TableQueued, En) => "Queued", | 406 | (TableQueued, En) => "Queued", |
| 590 | (TableQueued, Tr) => "Kuyruğa alındı", | 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 | (TableTries, En) => "Tries", | 408 | (TableTries, En) => "Tries", |
| 606 | (TableTries, Tr) => "Deneme", | 409 | (TableTries, Tr) => "Deneme", |
| 607 | - (TableTrigger, En) => "Trigger", | ||
| 608 | - (TableTrigger, Tr) => "Tetikleyen", | ||
| 609 | - (TableWhen, En) => "When", | ||
| 610 | - (TableWhen, Tr) => "Ne zaman", | ||
| 611 | (TestQueued, En) => "Test message queued. It appears in the list when it is sent.", | 410 | (TestQueued, En) => "Test message queued. It appears in the list when it is sent.", |
| 612 | (TestQueued, Tr) => "Test iletisi kuyruğa alındı. Gönderildiğinde listede görünür.", | 411 | (TestQueued, Tr) => "Test iletisi kuyruğa alındı. Gönderildiğinde listede görünür.", |
| 613 | (Token, En) => "Token", | 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 | /// "every 6 hours". | 455 | /// "every 6 hours". |
| 709 | pub fn every_hours(lang: Lang, hours: u64) -> String { | 456 | pub fn every_hours(lang: Lang, hours: u64) -> String { |
| 710 | match lang { | 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 | /// The run kind as a table cell: "backup" or "fsck". | 464 | /// The run kind as a table cell: "backup" or "fsck". |
| 735 | pub fn kind_name(lang: Lang, kind: RunKind) -> &'static str { | 465 | pub fn kind_name(lang: Lang, kind: RunKind) -> &'static str { |
| 736 | match (kind, lang) { | 466 | match (kind, lang) { |
| @@ -828,24 +558,17 @@ mod tests { | |||
| 828 | 558 | ||
| 829 | const ALL: &[K] = &[ | 559 | const ALL: &[K] = &[ |
| 830 | K::ActionLabel, | 560 | K::ActionLabel, |
| 831 | - K::ActorUsername, | ||
| 832 | K::AddARunner, | 561 | K::AddARunner, |
| 833 | K::AdminArea, | 562 | K::AdminArea, |
| 834 | K::Administrator, | 563 | K::Administrator, |
| 835 | K::AllActions, | 564 | K::AllActions, |
| 836 | - K::RowActions, | ||
| 837 | K::Anonymous, | 565 | K::Anonymous, |
| 838 | - K::AtLeast12Chars, | ||
| 839 | - K::AuditIntro, | ||
| 840 | K::AuditLog, | 566 | K::AuditLog, |
| 841 | K::BackToRunners, | 567 | K::BackToRunners, |
| 842 | K::BackToUsers, | 568 | K::BackToUsers, |
| 843 | - K::BackupInterval, | ||
| 844 | K::Backups, | 569 | K::Backups, |
| 845 | - K::BackupsIntro, | ||
| 846 | K::CiRunners, | 570 | K::CiRunners, |
| 847 | K::CopyTokenNow, | 571 | K::CopyTokenNow, |
| 848 | - K::CreateAUser, | ||
| 849 | K::CreateRegistrationToken, | 572 | K::CreateRegistrationToken, |
| 850 | K::CreateUser, | 573 | K::CreateUser, |
| 851 | K::Database, | 574 | K::Database, |
| @@ -876,27 +599,16 @@ mod tests { | |||
| 876 | K::FromName, | 599 | K::FromName, |
| 877 | K::Fsck, | 600 | K::Fsck, |
| 878 | K::Healthcheck, | 601 | K::Healthcheck, |
| 879 | - K::HealthcheckNotSet, | ||
| 880 | - K::HealthcheckSet, | ||
| 881 | - K::HealthcheckUrlInvalid, | ||
| 882 | K::HealthError, | 602 | K::HealthError, |
| 883 | K::HealthLagging, | 603 | K::HealthLagging, |
| 884 | K::HealthNever, | 604 | K::HealthNever, |
| 885 | K::HealthOk, | 605 | K::HealthOk, |
| 886 | - K::Interval, | ||
| 887 | K::Invites, | 606 | K::Invites, |
| 888 | K::LastDbAttempt, | 607 | K::LastDbAttempt, |
| 889 | K::LastDbSnapshotShipped, | 608 | K::LastDbSnapshotShipped, |
| 890 | K::LastSeen, | 609 | K::LastSeen, |
| 891 | K::LastSuccess, | 610 | K::LastSuccess, |
| 892 | K::ServerSettings, | 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 | K::SrvSaved, | 612 | K::SrvSaved, |
| 901 | K::SrvNothingChanged, | 613 | K::SrvNothingChanged, |
| 902 | K::SrvResetDone, | 614 | K::SrvResetDone, |
| @@ -905,17 +617,12 @@ mod tests { | |||
| 905 | K::SrvKindLive, | 617 | K::SrvKindLive, |
| 906 | K::SrvKindRestart, | 618 | K::SrvKindRestart, |
| 907 | K::SrvKindReadOnly, | 619 | K::SrvKindReadOnly, |
| 908 | - K::SrvSourceDefault, | ||
| 909 | - K::SrvSourceFile, | ||
| 910 | - K::SrvSourceUi, | ||
| 911 | K::SrvSecretSet, | 620 | K::SrvSecretSet, |
| 912 | K::SrvSecretNotSet, | 621 | K::SrvSecretNotSet, |
| 913 | - K::SrvSecretHint, | ||
| 914 | K::SrvFileValue, | 622 | K::SrvFileValue, |
| 915 | K::SrvEmpty, | 623 | K::SrvEmpty, |
| 916 | K::Mail, | 624 | K::Mail, |
| 917 | K::MailHost, | 625 | K::MailHost, |
| 918 | - K::MailIntro, | ||
| 919 | K::MailTabSettings, | 626 | K::MailTabSettings, |
| 920 | K::MailTabQueue, | 627 | K::MailTabQueue, |
| 921 | K::MailFilterAll, | 628 | K::MailFilterAll, |
| @@ -925,9 +632,6 @@ mod tests { | |||
| 925 | K::MailNotFailed, | 632 | K::MailNotFailed, |
| 926 | K::MailDiscarded, | 633 | K::MailDiscarded, |
| 927 | K::MailSentAt, | 634 | K::MailSentAt, |
| 928 | - K::MailTransportNote, | ||
| 929 | - K::MailTransportInUse, | ||
| 930 | - K::MailQueueIntro, | ||
| 931 | K::MailNothingMatches, | 635 | K::MailNothingMatches, |
| 932 | K::MailPort, | 636 | K::MailPort, |
| 933 | K::MailSettingsSaved, | 637 | K::MailSettingsSaved, |
| @@ -938,26 +642,16 @@ mod tests { | |||
| 938 | K::NoRunnersYet, | 642 | K::NoRunnersYet, |
| 939 | K::NoRunnerWithId, | 643 | K::NoRunnerWithId, |
| 940 | K::NoRunsYet, | 644 | K::NoRunsYet, |
| 941 | - K::BackupsEmptyHint, | ||
| 942 | - K::ReplicationConfigHint, | ||
| 943 | - K::ReposEmptyHint, | ||
| 944 | - K::RunnersEmptyHint, | ||
| 945 | K::MailQueueEmpty, | 645 | K::MailQueueEmpty, |
| 946 | K::Older, | 646 | K::Older, |
| 947 | - K::OwnLogIntro, | ||
| 948 | - K::PasswordStoredHint, | ||
| 949 | K::RecentRuns, | 647 | K::RecentRuns, |
| 950 | K::ReconcileNow, | 648 | K::ReconcileNow, |
| 951 | K::ReconcileStarted, | 649 | K::ReconcileStarted, |
| 952 | K::RegisterARunner, | 650 | K::RegisterARunner, |
| 953 | K::RegistrationToken, | 651 | K::RegistrationToken, |
| 954 | K::RemovedWithAccount, | 652 | K::RemovedWithAccount, |
| 955 | - K::ReplacePrefix, | ||
| 956 | - K::ReplaceSuffix, | ||
| 957 | K::Replication, | 653 | K::Replication, |
| 958 | - K::ReplicationIntro, | ||
| 959 | K::ReplicationOff, | 654 | K::ReplicationOff, |
| 960 | - K::ReplicationTarget, | ||
| 961 | K::Repos, | 655 | K::Repos, |
| 962 | K::Retention, | 656 | K::Retention, |
| 963 | K::Role, | 657 | K::Role, |
| @@ -981,22 +675,9 @@ mod tests { | |||
| 981 | K::StatusFailed, | 675 | K::StatusFailed, |
| 982 | K::StatusInProgress, | 676 | K::StatusInProgress, |
| 983 | K::StatusOk, | 677 | K::StatusOk, |
| 984 | - K::TableActor, | ||
| 985 | - K::TableDetails, | ||
| 986 | - K::TableDuration, | ||
| 987 | - K::TableKind, | ||
| 988 | K::TableLastError, | 678 | K::TableLastError, |
| 989 | K::TableQueued, | 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 | K::TableTries, | 680 | K::TableTries, |
| 998 | - K::TableTrigger, | ||
| 999 | - K::TableWhen, | ||
| 1000 | K::TestQueued, | 681 | K::TestQueued, |
| 1001 | K::Token, | 682 | K::Token, |
| 1002 | K::TokenCreateFailed, | 683 | K::TokenCreateFailed, |
crates/forge-web-base/src/i18n/authoring.rsmodified+0 -3
| @@ -5,7 +5,6 @@ use super::Lang; | |||
| 5 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] | 5 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] |
| 6 | pub enum K { | 6 | pub enum K { |
| 7 | Reviewers, | 7 | Reviewers, |
| 8 | - NoReviewers, | ||
| 9 | RequestReview, | 8 | RequestReview, |
| 10 | ReviewerName, | 9 | ReviewerName, |
| 11 | WithdrawRequest, | 10 | WithdrawRequest, |
| @@ -24,8 +23,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 24 | match (key, lang) { | 23 | match (key, lang) { |
| 25 | (Reviewers, En) => "Reviewers", | 24 | (Reviewers, En) => "Reviewers", |
| 26 | (Reviewers, Tr) => "İnceleyenler", | 25 | (Reviewers, Tr) => "İnceleyenler", |
| 27 | - (NoReviewers, En) => "No review requested", | ||
| 28 | - (NoReviewers, Tr) => "İnceleme istenmedi", | ||
| 29 | (RequestReview, En) => "Request review", | 26 | (RequestReview, En) => "Request review", |
| 30 | (RequestReview, Tr) => "İnceleme iste", | 27 | (RequestReview, Tr) => "İnceleme iste", |
| 31 | (ReviewerName, En) => "Username", | 28 | (ReviewerName, En) => "Username", |
crates/forge-web-base/src/i18n/browse.rsmodified+1 -9
| @@ -34,7 +34,6 @@ strings! { | |||
| 34 | 34 | ||
| 35 | BlameLink => "Blame", "Satır geçmişi"; | 35 | BlameLink => "Blame", "Satır geçmişi"; |
| 36 | BlameTitle => "Blame", "Satır geçmişi"; | 36 | BlameTitle => "Blame", "Satır geçmişi"; |
| 37 | - BlameBackToFile => "Back to file", "Dosyaya dön"; | ||
| 38 | BlamePrior => "Blame prior to this commit", "Bu işlemeden önceki satır geçmişi"; | 37 | BlamePrior => "Blame prior to this commit", "Bu işlemeden önceki satır geçmişi"; |
| 39 | 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."; | 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 | BlameFailed => "Blame could not be computed for this file.", "Bu dosya için satır geçmişi hesaplanamadı."; | 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 | CopyPermalink => "Copy permalink", "Kalıcı bağlantıyı kopyala"; | 42 | CopyPermalink => "Copy permalink", "Kalıcı bağlantıyı kopyala"; |
| 44 | PermalinkCopied => "Permalink copied", "Kalıcı bağlantı kopyalandı"; | 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 | GoToFile => "Go to file", "Dosyaya git"; | 45 | GoToFile => "Go to file", "Dosyaya git"; |
| 48 | FinderTitle => "Go to file", "Dosyaya git"; | 46 | FinderTitle => "Go to file", "Dosyaya git"; |
| @@ -66,19 +64,13 @@ strings! { | |||
| 66 | PaletteDone => "Done", "Tamamlandı"; | 64 | PaletteDone => "Done", "Tamamlandı"; |
| 67 | PaletteActionFailed => "The action did not go through.", "İşlem gerçekleşmedi."; | 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 | UpToDate => "Even with the default branch", "Varsayılan dalla aynı"; | 67 | UpToDate => "Even with the default branch", "Varsayılan dalla aynı"; |
| 73 | NewPr => "New PR", "Yeni PR"; | 68 | NewPr => "New PR", "Yeni PR"; |
| 74 | DeleteBranch => "Delete", "Sil"; | 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."; | 70 | + DeleteConfirm => "Delete this branch?", "Bu dal silinsin mi?"; |
| 76 | - DeleteConfirmYes => "Yes, delete branch", "Evet, dalı sil"; | ||
| 77 | - DeleteCancel => "Cancel", "Vazgeç"; | ||
| 78 | NewBranchTitle => "New branch", "Yeni dal"; | 71 | NewBranchTitle => "New branch", "Yeni dal"; |
| 79 | BranchNameLabel => "Branch name", "Dal adı"; | 72 | BranchNameLabel => "Branch name", "Dal adı"; |
| 80 | BranchFromLabel => "From", "Kaynak"; | 73 | BranchFromLabel => "From", "Kaynak"; |
| 81 | - BranchFromPlaceholder => "branch, tag or commit", "dal, etiket veya işleme"; | ||
| 82 | CreateBranch => "Create branch", "Dal oluştur"; | 74 | CreateBranch => "Create branch", "Dal oluştur"; |
| 83 | BranchCreated => "Branch created.", "Dal oluşturuldu."; | 75 | BranchCreated => "Branch created.", "Dal oluşturuldu."; |
| 84 | BranchDeleted => "Branch deleted.", "Dal silindi."; | 76 | BranchDeleted => "Branch deleted.", "Dal silindi."; |
crates/forge-web-base/src/i18n/code.rsmodified+8 -28
| @@ -24,7 +24,6 @@ pub enum K { | |||
| 24 | CopyCloneUrl, | 24 | CopyCloneUrl, |
| 25 | CloneCopied, | 25 | CloneCopied, |
| 26 | CloneCopyFailed, | 26 | CloneCopyFailed, |
| 27 | - SshRequiresKey, | ||
| 28 | BranchesTitle, | 27 | BranchesTitle, |
| 29 | FilterRefs, | 28 | FilterRefs, |
| 30 | ViewAllBranches, | 29 | ViewAllBranches, |
| @@ -39,8 +38,6 @@ pub enum K { | |||
| 39 | HadRecentPushes, | 38 | HadRecentPushes, |
| 40 | CompareAndPr, | 39 | CompareAndPr, |
| 41 | BranchLabel, | 40 | BranchLabel, |
| 42 | - LastCommitHeader, | ||
| 43 | - AgeHeader, | ||
| 44 | KindDir, | 41 | KindDir, |
| 45 | KindFile, | 42 | KindFile, |
| 46 | KindExec, | 43 | KindExec, |
| @@ -51,7 +48,6 @@ pub enum K { | |||
| 51 | HistoryLink, | 48 | HistoryLink, |
| 52 | RawLink, | 49 | RawLink, |
| 53 | DownloadLink, | 50 | DownloadLink, |
| 54 | - FileNav, | ||
| 55 | SymlinkPrefix, | 51 | SymlinkPrefix, |
| 56 | SubmodulePrefix, | 52 | SubmodulePrefix, |
| 57 | SubmoduleSuffix, | 53 | SubmoduleSuffix, |
| @@ -108,7 +104,6 @@ pub enum K { | |||
| 108 | NothingHere, | 104 | NothingHere, |
| 109 | DefaultBadge, | 105 | DefaultBadge, |
| 110 | TagsTitle, | 106 | TagsTitle, |
| 111 | - TagKindLabel, | ||
| 112 | ForkedFrom, | 107 | ForkedFrom, |
| 113 | MirrorOf, | 108 | MirrorOf, |
| 114 | NotSyncedYet, | 109 | NotSyncedYet, |
| @@ -166,8 +161,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 166 | (CloneCopied, Tr) => "Kopyalandı", | 161 | (CloneCopied, Tr) => "Kopyalandı", |
| 167 | (CloneCopyFailed, En) => "Copy failed", | 162 | (CloneCopyFailed, En) => "Copy failed", |
| 168 | (CloneCopyFailed, Tr) => "Kopyalanamadı", | 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 | (BranchesTitle, En) => "Branches", | 164 | (BranchesTitle, En) => "Branches", |
| 172 | (BranchesTitle, Tr) => "Dallar", | 165 | (BranchesTitle, Tr) => "Dallar", |
| 173 | (FilterRefs, En) => "Filter branches and tags", | 166 | (FilterRefs, En) => "Filter branches and tags", |
| @@ -176,8 +169,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 176 | (ViewAllBranches, Tr) => "Tüm dalları gör", | 169 | (ViewAllBranches, Tr) => "Tüm dalları gör", |
| 177 | (ViewAllTags, En) => "View all tags", | 170 | (ViewAllTags, En) => "View all tags", |
| 178 | (ViewAllTags, Tr) => "Tüm etiketleri gör", | 171 | (ViewAllTags, Tr) => "Tüm etiketleri gör", |
| 179 | - (EmptyRepoPush, En) => "This repository is empty. Push a branch to get started:", | 172 | + (EmptyRepoPush, En) => "This repository is empty.", |
| 180 | - (EmptyRepoPush, Tr) => "Bu depo boş. Başlamak için bir dal gönderin:", | 173 | + (EmptyRepoPush, Tr) => "Bu depo boş.", |
| 181 | (OverHttps, En) => "Over HTTPS", | 174 | (OverHttps, En) => "Over HTTPS", |
| 182 | (OverHttps, Tr) => "HTTPS üzerinden", | 175 | (OverHttps, Tr) => "HTTPS üzerinden", |
| 183 | (OverSsh, En) => "Over SSH", | 176 | (OverSsh, En) => "Over SSH", |
| @@ -196,10 +189,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 196 | (CompareAndPr, Tr) => "Karşılaştır ve çekme isteği aç", | 189 | (CompareAndPr, Tr) => "Karşılaştır ve çekme isteği aç", |
| 197 | (BranchLabel, En) => "Branch", | 190 | (BranchLabel, En) => "Branch", |
| 198 | (BranchLabel, Tr) => "Dal", | 191 | (BranchLabel, Tr) => "Dal", |
| 199 | - (LastCommitHeader, En) => "Last commit", | ||
| 200 | - (LastCommitHeader, Tr) => "Son commit", | ||
| 201 | - (AgeHeader, En) => "Age", | ||
| 202 | - (AgeHeader, Tr) => "Zaman", | ||
| 203 | (KindDir, En) => "dir", | 192 | (KindDir, En) => "dir", |
| 204 | (KindDir, Tr) => "dizin", | 193 | (KindDir, Tr) => "dizin", |
| 205 | (KindFile, En) => "file", | 194 | (KindFile, En) => "file", |
| @@ -220,8 +209,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 220 | (RawLink, Tr) => "Ham", | 209 | (RawLink, Tr) => "Ham", |
| 221 | (DownloadLink, En) => "Download", | 210 | (DownloadLink, En) => "Download", |
| 222 | (DownloadLink, Tr) => "İndir", | 211 | (DownloadLink, Tr) => "İndir", |
| 223 | - (FileNav, En) => "File", | ||
| 224 | - (FileNav, Tr) => "Dosya", | ||
| 225 | (SymlinkPrefix, En) => "Symbolic link → ", | 212 | (SymlinkPrefix, En) => "Symbolic link → ", |
| 226 | (SymlinkPrefix, Tr) => "Sembolik bağlantı → ", | 213 | (SymlinkPrefix, Tr) => "Sembolik bağlantı → ", |
| 227 | (SubmodulePrefix, En) => "Submodule at commit ", | 214 | (SubmodulePrefix, En) => "Submodule at commit ", |
| @@ -230,8 +217,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 230 | (SubmoduleSuffix, Tr) => ". İçeriği bu depoda yok.", | 217 | (SubmoduleSuffix, Tr) => ". İçeriği bu depoda yok.", |
| 231 | (TruncatedPrefix, En) => "Showing the first 1 MiB of this file. ", | 218 | (TruncatedPrefix, En) => "Showing the first 1 MiB of this file. ", |
| 232 | (TruncatedPrefix, Tr) => "Bu dosyanın ilk 1 MiB'ı gösteriliyor. ", | 219 | (TruncatedPrefix, Tr) => "Bu dosyanın ilk 1 MiB'ı gösteriliyor. ", |
| 233 | - (ViewFullRaw, En) => "View the full file raw", | 220 | + (ViewFullRaw, En) => "View raw", |
| 234 | - (ViewFullRaw, Tr) => "Dosyanın tamamını ham olarak görüntüle", | 221 | + (ViewFullRaw, Tr) => "Ham görüntüle", |
| 235 | (LivePathGone, En) => "This path no longer exists in this ref.", | 222 | (LivePathGone, En) => "This path no longer exists in this ref.", |
| 236 | (LivePathGone, Tr) => "Bu yol bu referansta artık yok.", | 223 | (LivePathGone, Tr) => "Bu yol bu referansta artık yok.", |
| 237 | (StatusAdded, En) => "added", | 224 | (StatusAdded, En) => "added", |
| @@ -320,22 +307,20 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 320 | (FilteredTo, Tr) => "Şuna göre filtrelendi: ", | 307 | (FilteredTo, Tr) => "Şuna göre filtrelendi: ", |
| 321 | (ClearFilter, En) => "Clear filter", | 308 | (ClearFilter, En) => "Clear filter", |
| 322 | (ClearFilter, Tr) => "Filtreyi temizle", | 309 | (ClearFilter, Tr) => "Filtreyi temizle", |
| 323 | - (NoCommits, En) => "No commits yet. Push a branch and its history shows up here.", | 310 | + (NoCommits, En) => "No commits yet.", |
| 324 | - (NoCommits, Tr) => "Henüz commit yok. Bir dal gönderin, geçmişi burada görünsün.", | 311 | + (NoCommits, Tr) => "Henüz commit yok.", |
| 325 | (BrowseFilesShort, En) => "Browse files", | 312 | (BrowseFilesShort, En) => "Browse files", |
| 326 | (BrowseFilesShort, Tr) => "Dosyalara göz at", | 313 | (BrowseFilesShort, Tr) => "Dosyalara göz at", |
| 327 | (NewerLink, En) => "Newer", | 314 | (NewerLink, En) => "Newer", |
| 328 | (NewerLink, Tr) => "Daha yeni", | 315 | (NewerLink, Tr) => "Daha yeni", |
| 329 | (OlderLink, En) => "Older", | 316 | (OlderLink, En) => "Older", |
| 330 | (OlderLink, Tr) => "Daha eski", | 317 | (OlderLink, Tr) => "Daha eski", |
| 331 | - (NothingHere, En) => "Nothing here yet. Push a commit and it shows up.", | 318 | + (NothingHere, En) => "Nothing here yet.", |
| 332 | - (NothingHere, Tr) => "Henüz burada bir şey yok. Bir commit gönderin, burada görünsün.", | 319 | + (NothingHere, Tr) => "Henüz burada bir şey yok.", |
| 333 | (DefaultBadge, En) => "default", | 320 | (DefaultBadge, En) => "default", |
| 334 | (DefaultBadge, Tr) => "varsayılan", | 321 | (DefaultBadge, Tr) => "varsayılan", |
| 335 | (TagsTitle, En) => "Tags", | 322 | (TagsTitle, En) => "Tags", |
| 336 | (TagsTitle, Tr) => "Etiketler", | 323 | (TagsTitle, Tr) => "Etiketler", |
| 337 | - (TagKindLabel, En) => "Tag", | ||
| 338 | - (TagKindLabel, Tr) => "Etiket", | ||
| 339 | (ForkedFrom, En) => "forked from ", | 324 | (ForkedFrom, En) => "forked from ", |
| 340 | (ForkedFrom, Tr) => "Şu depodan çatallandı: ", | 325 | (ForkedFrom, Tr) => "Şu depodan çatallandı: ", |
| 341 | (MirrorOf, En) => "Mirror of ", | 326 | (MirrorOf, En) => "Mirror of ", |
| @@ -552,7 +537,6 @@ mod tests { | |||
| 552 | K::CopyCloneUrl, | 537 | K::CopyCloneUrl, |
| 553 | K::CloneCopied, | 538 | K::CloneCopied, |
| 554 | K::CloneCopyFailed, | 539 | K::CloneCopyFailed, |
| 555 | - K::SshRequiresKey, | ||
| 556 | K::BranchesTitle, | 540 | K::BranchesTitle, |
| 557 | K::FilterRefs, | 541 | K::FilterRefs, |
| 558 | K::ViewAllBranches, | 542 | K::ViewAllBranches, |
| @@ -567,8 +551,6 @@ mod tests { | |||
| 567 | K::HadRecentPushes, | 551 | K::HadRecentPushes, |
| 568 | K::CompareAndPr, | 552 | K::CompareAndPr, |
| 569 | K::BranchLabel, | 553 | K::BranchLabel, |
| 570 | - K::LastCommitHeader, | ||
| 571 | - K::AgeHeader, | ||
| 572 | K::KindDir, | 554 | K::KindDir, |
| 573 | K::KindFile, | 555 | K::KindFile, |
| 574 | K::KindExec, | 556 | K::KindExec, |
| @@ -579,7 +561,6 @@ mod tests { | |||
| 579 | K::HistoryLink, | 561 | K::HistoryLink, |
| 580 | K::RawLink, | 562 | K::RawLink, |
| 581 | K::DownloadLink, | 563 | K::DownloadLink, |
| 582 | - K::FileNav, | ||
| 583 | K::SymlinkPrefix, | 564 | K::SymlinkPrefix, |
| 584 | K::SubmodulePrefix, | 565 | K::SubmodulePrefix, |
| 585 | K::SubmoduleSuffix, | 566 | K::SubmoduleSuffix, |
| @@ -636,7 +617,6 @@ mod tests { | |||
| 636 | K::NothingHere, | 617 | K::NothingHere, |
| 637 | K::DefaultBadge, | 618 | K::DefaultBadge, |
| 638 | K::TagsTitle, | 619 | K::TagsTitle, |
| 639 | - K::TagKindLabel, | ||
| 640 | K::ForkedFrom, | 620 | K::ForkedFrom, |
| 641 | K::MirrorOf, | 621 | K::MirrorOf, |
| 642 | K::NotSyncedYet, | 622 | K::NotSyncedYet, |
crates/forge-web-base/src/i18n/community.rsmodified+0 -66
| @@ -19,7 +19,6 @@ pub enum K { | |||
| 19 | Category, | 19 | Category, |
| 20 | Title, | 20 | Title, |
| 21 | Description, | 21 | Description, |
| 22 | - MarkdownSupported, | ||
| 23 | StartDiscussion, | 22 | StartDiscussion, |
| 24 | Cancel, | 23 | Cancel, |
| 25 | Save, | 24 | Save, |
| @@ -38,8 +37,6 @@ pub enum K { | |||
| 38 | UnlockConversation, | 37 | UnlockConversation, |
| 39 | Answered, | 38 | Answered, |
| 40 | Locked, | 39 | Locked, |
| 41 | - OpenedThis, | ||
| 42 | - OpenedSeparator, | ||
| 43 | NoDescription, | 40 | NoDescription, |
| 44 | LockedNotice, | 41 | LockedNotice, |
| 45 | AddComment, | 42 | AddComment, |
| @@ -47,9 +44,6 @@ pub enum K { | |||
| 47 | LogInLink, | 44 | LogInLink, |
| 48 | ToCommentSuffix, | 45 | ToCommentSuffix, |
| 49 | ArchivedDiscussions, | 46 | ArchivedDiscussions, |
| 50 | - DiscussionsDescription, | ||
| 51 | - TurnOffDiscussions, | ||
| 52 | - TurnOnDiscussions, | ||
| 53 | CategoryGeneral, | 47 | CategoryGeneral, |
| 54 | CategoryIdeas, | 48 | CategoryIdeas, |
| 55 | CategoryQa, | 49 | CategoryQa, |
| @@ -68,17 +62,12 @@ pub enum K { | |||
| 68 | BackToPage, | 62 | BackToPage, |
| 69 | NoChangesYet, | 63 | NoChangesYet, |
| 70 | PageName, | 64 | PageName, |
| 71 | - PageNameHint, | ||
| 72 | ContentMarkdown, | 65 | ContentMarkdown, |
| 73 | - WikiLinkHint, | ||
| 74 | Summary, | 66 | Summary, |
| 75 | SavePage, | 67 | SavePage, |
| 76 | PageNameRules, | 68 | PageNameRules, |
| 77 | PageExists, | 69 | PageExists, |
| 78 | WikiConflict, | 70 | WikiConflict, |
| 79 | - WikiSettings, | ||
| 80 | - EnableWiki, | ||
| 81 | - WikiDisabledHint, | ||
| 82 | WikiPages, | 71 | WikiPages, |
| 83 | 72 | ||
| 84 | // Snippets. | 73 | // Snippets. |
| @@ -105,9 +94,6 @@ pub enum K { | |||
| 105 | SaveSnippet, | 94 | SaveSnippet, |
| 106 | EditSnippet, | 95 | EditSnippet, |
| 107 | Raw, | 96 | Raw, |
| 108 | - SnippetNav, | ||
| 109 | - FileNav, | ||
| 110 | - OnlyOwnerEdits, | ||
| 111 | Revisions, | 97 | Revisions, |
| 112 | BackToSnippet, | 98 | BackToSnippet, |
| 113 | NoRevisions, | 99 | NoRevisions, |
| @@ -139,8 +125,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 139 | (Title, Tr) => "Başlık", | 125 | (Title, Tr) => "Başlık", |
| 140 | (Description, En) => "Description", | 126 | (Description, En) => "Description", |
| 141 | (Description, Tr) => "Açıklama", | 127 | (Description, Tr) => "Açıklama", |
| 142 | - (MarkdownSupported, En) => "Markdown supported.", | ||
| 143 | - (MarkdownSupported, Tr) => "Markdown desteklenir.", | ||
| 144 | (StartDiscussion, En) => "Start discussion", | 128 | (StartDiscussion, En) => "Start discussion", |
| 145 | (StartDiscussion, Tr) => "Tartışma başlat", | 129 | (StartDiscussion, Tr) => "Tartışma başlat", |
| 146 | (Cancel, En) => "Cancel", | 130 | (Cancel, En) => "Cancel", |
| @@ -177,10 +161,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 177 | (Answered, Tr) => "Cevaplandı", | 161 | (Answered, Tr) => "Cevaplandı", |
| 178 | (Locked, En) => "Locked", | 162 | (Locked, En) => "Locked", |
| 179 | (Locked, Tr) => "Kilitli", | 163 | (Locked, Tr) => "Kilitli", |
| 180 | - (OpenedThis, En) => " opened this ", | ||
| 181 | - (OpenedThis, Tr) => " tarafından ", | ||
| 182 | - (OpenedSeparator, En) => " · ", | ||
| 183 | - (OpenedSeparator, Tr) => " açıldı · ", | ||
| 184 | (NoDescription, En) => "_No description provided._", | 164 | (NoDescription, En) => "_No description provided._", |
| 185 | (NoDescription, Tr) => "_Açıklama eklenmedi._", | 165 | (NoDescription, Tr) => "_Açıklama eklenmedi._", |
| 186 | (LockedNotice, En) => { | 166 | (LockedNotice, En) => { |
| @@ -201,16 +181,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 201 | "This repository is archived, so its discussions are read-only." | 181 | "This repository is archived, so its discussions are read-only." |
| 202 | } | 182 | } |
| 203 | (ArchivedDiscussions, Tr) => "Bu depo arşivlendiği için tartışmalar salt okunur.", | 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 | (CategoryGeneral, En) => "General", | 184 | (CategoryGeneral, En) => "General", |
| 215 | (CategoryGeneral, Tr) => "Genel", | 185 | (CategoryGeneral, Tr) => "Genel", |
| 216 | (CategoryIdeas, En) => "Ideas", | 186 | (CategoryIdeas, En) => "Ideas", |
| @@ -244,14 +214,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 244 | (NoChangesYet, Tr) => "Henüz değişiklik yok.", | 214 | (NoChangesYet, Tr) => "Henüz değişiklik yok.", |
| 245 | (PageName, En) => "Page name", | 215 | (PageName, En) => "Page name", |
| 246 | (PageName, Tr) => "Sayfa adı", | 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 | (ContentMarkdown, En) => "Content (Markdown)", | 217 | (ContentMarkdown, En) => "Content (Markdown)", |
| 250 | (ContentMarkdown, Tr) => "İçerik (Markdown)", | 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 | (Summary, En) => "Summary", | 219 | (Summary, En) => "Summary", |
| 256 | (Summary, Tr) => "Özet", | 220 | (Summary, Tr) => "Özet", |
| 257 | (SavePage, En) => "Save page", | 221 | (SavePage, En) => "Save page", |
| @@ -268,16 +232,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 268 | (WikiConflict, Tr) => { | 232 | (WikiConflict, Tr) => { |
| 269 | "Siz düzenlerken başka biri bu wiki'yi kaydetti. Metniniz aşağıda duruyor; kopyalayın, sayfayı yenileyin ve yeniden kaydedin." | 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 | (WikiPages, En) => "Wiki pages", | 235 | (WikiPages, En) => "Wiki pages", |
| 282 | (WikiPages, Tr) => "Wiki sayfaları", | 236 | (WikiPages, Tr) => "Wiki sayfaları", |
| 283 | 237 | ||
| @@ -327,12 +281,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 327 | (EditSnippet, Tr) => "Parçacığı düzenle", | 281 | (EditSnippet, Tr) => "Parçacığı düzenle", |
| 328 | (Raw, En) => "Raw", | 282 | (Raw, En) => "Raw", |
| 329 | (Raw, Tr) => "Ham", | 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 | (Revisions, En) => "Revisions", | 284 | (Revisions, En) => "Revisions", |
| 337 | (Revisions, Tr) => "Revizyonlar", | 285 | (Revisions, Tr) => "Revizyonlar", |
| 338 | (BackToSnippet, En) => "Back to the snippet", | 286 | (BackToSnippet, En) => "Back to the snippet", |
| @@ -461,7 +409,6 @@ mod tests { | |||
| 461 | K::Category, | 409 | K::Category, |
| 462 | K::Title, | 410 | K::Title, |
| 463 | K::Description, | 411 | K::Description, |
| 464 | - K::MarkdownSupported, | ||
| 465 | K::StartDiscussion, | 412 | K::StartDiscussion, |
| 466 | K::Cancel, | 413 | K::Cancel, |
| 467 | K::Save, | 414 | K::Save, |
| @@ -480,8 +427,6 @@ mod tests { | |||
| 480 | K::UnlockConversation, | 427 | K::UnlockConversation, |
| 481 | K::Answered, | 428 | K::Answered, |
| 482 | K::Locked, | 429 | K::Locked, |
| 483 | - K::OpenedThis, | ||
| 484 | - K::OpenedSeparator, | ||
| 485 | K::NoDescription, | 430 | K::NoDescription, |
| 486 | K::LockedNotice, | 431 | K::LockedNotice, |
| 487 | K::AddComment, | 432 | K::AddComment, |
| @@ -489,9 +434,6 @@ mod tests { | |||
| 489 | K::LogInLink, | 434 | K::LogInLink, |
| 490 | K::ToCommentSuffix, | 435 | K::ToCommentSuffix, |
| 491 | K::ArchivedDiscussions, | 436 | K::ArchivedDiscussions, |
| 492 | - K::DiscussionsDescription, | ||
| 493 | - K::TurnOffDiscussions, | ||
| 494 | - K::TurnOnDiscussions, | ||
| 495 | K::CategoryGeneral, | 437 | K::CategoryGeneral, |
| 496 | K::CategoryIdeas, | 438 | K::CategoryIdeas, |
| 497 | K::CategoryQa, | 439 | K::CategoryQa, |
| @@ -508,17 +450,12 @@ mod tests { | |||
| 508 | K::BackToPage, | 450 | K::BackToPage, |
| 509 | K::NoChangesYet, | 451 | K::NoChangesYet, |
| 510 | K::PageName, | 452 | K::PageName, |
| 511 | - K::PageNameHint, | ||
| 512 | K::ContentMarkdown, | 453 | K::ContentMarkdown, |
| 513 | - K::WikiLinkHint, | ||
| 514 | K::Summary, | 454 | K::Summary, |
| 515 | K::SavePage, | 455 | K::SavePage, |
| 516 | K::PageNameRules, | 456 | K::PageNameRules, |
| 517 | K::PageExists, | 457 | K::PageExists, |
| 518 | K::WikiConflict, | 458 | K::WikiConflict, |
| 519 | - K::WikiSettings, | ||
| 520 | - K::EnableWiki, | ||
| 521 | - K::WikiDisabledHint, | ||
| 522 | K::WikiPages, | 459 | K::WikiPages, |
| 523 | K::Snippets, | 460 | K::Snippets, |
| 524 | K::NewSnippet, | 461 | K::NewSnippet, |
| @@ -543,9 +480,6 @@ mod tests { | |||
| 543 | K::SaveSnippet, | 480 | K::SaveSnippet, |
| 544 | K::EditSnippet, | 481 | K::EditSnippet, |
| 545 | K::Raw, | 482 | K::Raw, |
| 546 | - K::SnippetNav, | ||
| 547 | - K::FileNav, | ||
| 548 | - K::OnlyOwnerEdits, | ||
| 549 | K::Revisions, | 483 | K::Revisions, |
| 550 | K::BackToSnippet, | 484 | K::BackToSnippet, |
| 551 | K::NoRevisions, | 485 | K::NoRevisions, |
crates/forge-web-base/src/i18n/integrations.rsmodified+0 -120
| @@ -5,13 +5,9 @@ use super::Lang; | |||
| 5 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] | 5 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] |
| 6 | pub enum K { | 6 | pub enum K { |
| 7 | ActiveField, | 7 | ActiveField, |
| 8 | - ArchivedHookNote, | ||
| 9 | - AddPullIntro, | ||
| 10 | AddPullMirror, | 8 | AddPullMirror, |
| 11 | - AddPushIntro, | ||
| 12 | AddPushMirror, | 9 | AddPushMirror, |
| 13 | AddWebhook, | 10 | AddWebhook, |
| 14 | - AddWebhookIntro, | ||
| 15 | ArchivedNotice, | 11 | ArchivedNotice, |
| 16 | BackToWebhooks, | 12 | BackToWebhooks, |
| 17 | ClearSecret, | 13 | ClearSecret, |
| @@ -19,14 +15,10 @@ pub enum K { | |||
| 19 | CurrentUrl, | 15 | CurrentUrl, |
| 20 | Cancel, | 16 | Cancel, |
| 21 | DeleteConfirm, | 17 | DeleteConfirm, |
| 22 | - DeleteIntro, | ||
| 23 | DeleteMirror, | 18 | DeleteMirror, |
| 24 | - DeleteTextPull, | ||
| 25 | - DeleteTextPush, | ||
| 26 | DeleteWebhook, | 19 | DeleteWebhook, |
| 27 | DirectionPull, | 20 | DirectionPull, |
| 28 | DirectionPush, | 21 | DirectionPush, |
| 29 | - EditWebhook, | ||
| 30 | EnabledField, | 22 | EnabledField, |
| 31 | ErrIntervalMax, | 23 | ErrIntervalMax, |
| 32 | ErrIntervalNotWhole, | 24 | ErrIntervalNotWhole, |
| @@ -54,7 +46,6 @@ pub enum K { | |||
| 54 | LastSync, | 46 | LastSync, |
| 55 | ManualOnly, | 47 | ManualOnly, |
| 56 | Mirrors, | 48 | Mirrors, |
| 57 | - MirrorsIntro, | ||
| 58 | NoDeliveries, | 49 | NoDeliveries, |
| 59 | NoMirrors, | 50 | NoMirrors, |
| 60 | NoWebhooks, | 51 | NoWebhooks, |
| @@ -82,14 +73,10 @@ pub enum K { | |||
| 82 | SaveMirror, | 73 | SaveMirror, |
| 83 | SaveWebhook, | 74 | SaveWebhook, |
| 84 | Secret, | 75 | Secret, |
| 85 | - SecretHintNew, | ||
| 86 | SecretHintSet, | 76 | SecretHintSet, |
| 87 | SecretHintUnset, | 77 | SecretHintUnset, |
| 88 | SecretOptional, | 78 | SecretOptional, |
| 89 | - SecretSet, | ||
| 90 | - SecretUnset, | ||
| 91 | SendTestPing, | 79 | SendTestPing, |
| 92 | - SignedWith, | ||
| 93 | StateFailed, | 80 | StateFailed, |
| 94 | StateGaveUp, | 81 | StateGaveUp, |
| 95 | StateOk, | 82 | StateOk, |
| @@ -100,42 +87,29 @@ pub enum K { | |||
| 100 | StatusNotRun, | 87 | StatusNotRun, |
| 101 | StatusOk, | 88 | StatusOk, |
| 102 | SyncHeading, | 89 | SyncHeading, |
| 103 | - SyncIntro, | ||
| 104 | SyncNow, | 90 | SyncNow, |
| 105 | Test, | 91 | Test, |
| 106 | - TestIntro, | ||
| 107 | - UrlHintKeep, | ||
| 108 | - UrlHintNew, | ||
| 109 | UsernameOptional, | 92 | UsernameOptional, |
| 110 | Webhooks, | 93 | Webhooks, |
| 111 | - WebhooksIntro, | ||
| 112 | } | 94 | } |
| 113 | 95 | ||
| 114 | /// Every key, so the tests can walk them. | 96 | /// Every key, so the tests can walk them. |
| 115 | #[cfg(test)] | 97 | #[cfg(test)] |
| 116 | pub const ALL: &[K] = &[ | 98 | pub const ALL: &[K] = &[ |
| 117 | K::ActiveField, | 99 | K::ActiveField, |
| 118 | - K::ArchivedHookNote, | ||
| 119 | - K::AddPullIntro, | ||
| 120 | K::AddPullMirror, | 100 | K::AddPullMirror, |
| 121 | - K::AddPushIntro, | ||
| 122 | K::AddPushMirror, | 101 | K::AddPushMirror, |
| 123 | K::AddWebhook, | 102 | K::AddWebhook, |
| 124 | - K::AddWebhookIntro, | ||
| 125 | K::ArchivedNotice, | 103 | K::ArchivedNotice, |
| 126 | K::BackToWebhooks, | 104 | K::BackToWebhooks, |
| 127 | K::ClearSecret, | 105 | K::ClearSecret, |
| 128 | K::CreateWebhook, | 106 | K::CreateWebhook, |
| 129 | K::CurrentUrl, | 107 | K::CurrentUrl, |
| 130 | K::DeleteConfirm, | 108 | K::DeleteConfirm, |
| 131 | - K::DeleteIntro, | ||
| 132 | K::DeleteMirror, | 109 | K::DeleteMirror, |
| 133 | - K::DeleteTextPull, | ||
| 134 | - K::DeleteTextPush, | ||
| 135 | K::DeleteWebhook, | 110 | K::DeleteWebhook, |
| 136 | K::DirectionPull, | 111 | K::DirectionPull, |
| 137 | K::DirectionPush, | 112 | K::DirectionPush, |
| 138 | - K::EditWebhook, | ||
| 139 | K::EnabledField, | 113 | K::EnabledField, |
| 140 | K::ErrIntervalMax, | 114 | K::ErrIntervalMax, |
| 141 | K::ErrIntervalNotWhole, | 115 | K::ErrIntervalNotWhole, |
| @@ -163,7 +137,6 @@ pub const ALL: &[K] = &[ | |||
| 163 | K::LastSync, | 137 | K::LastSync, |
| 164 | K::ManualOnly, | 138 | K::ManualOnly, |
| 165 | K::Mirrors, | 139 | K::Mirrors, |
| 166 | - K::MirrorsIntro, | ||
| 167 | K::NoDeliveries, | 140 | K::NoDeliveries, |
| 168 | K::NoMirrors, | 141 | K::NoMirrors, |
| 169 | K::NoWebhooks, | 142 | K::NoWebhooks, |
| @@ -191,14 +164,10 @@ pub const ALL: &[K] = &[ | |||
| 191 | K::SaveMirror, | 164 | K::SaveMirror, |
| 192 | K::SaveWebhook, | 165 | K::SaveWebhook, |
| 193 | K::Secret, | 166 | K::Secret, |
| 194 | - K::SecretHintNew, | ||
| 195 | K::SecretHintSet, | 167 | K::SecretHintSet, |
| 196 | K::SecretHintUnset, | 168 | K::SecretHintUnset, |
| 197 | K::SecretOptional, | 169 | K::SecretOptional, |
| 198 | - K::SecretSet, | ||
| 199 | - K::SecretUnset, | ||
| 200 | K::SendTestPing, | 170 | K::SendTestPing, |
| 201 | - K::SignedWith, | ||
| 202 | K::StateFailed, | 171 | K::StateFailed, |
| 203 | K::StateGaveUp, | 172 | K::StateGaveUp, |
| 204 | K::StateOk, | 173 | K::StateOk, |
| @@ -209,15 +178,10 @@ pub const ALL: &[K] = &[ | |||
| 209 | K::StatusNotRun, | 178 | K::StatusNotRun, |
| 210 | K::StatusOk, | 179 | K::StatusOk, |
| 211 | K::SyncHeading, | 180 | K::SyncHeading, |
| 212 | - K::SyncIntro, | ||
| 213 | K::SyncNow, | 181 | K::SyncNow, |
| 214 | K::Test, | 182 | K::Test, |
| 215 | - K::TestIntro, | ||
| 216 | - K::UrlHintKeep, | ||
| 217 | - K::UrlHintNew, | ||
| 218 | K::UsernameOptional, | 183 | K::UsernameOptional, |
| 219 | K::Webhooks, | 184 | K::Webhooks, |
| 220 | - K::WebhooksIntro, | ||
| 221 | ]; | 185 | ]; |
| 222 | 186 | ||
| 223 | /// The phrase a key names, in a user's language. | 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 | match (key, lang) { | 191 | match (key, lang) { |
| 228 | (ActiveField, En) => "Active: deliver events to this URL", | 192 | (ActiveField, En) => "Active: deliver events to this URL", |
| 229 | (ActiveField, Tr) => "Etkin: olaylar bu URL'ye teslim edilir", | 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 | (AddPullMirror, En) => "Add pull mirror", | 194 | (AddPullMirror, En) => "Add pull mirror", |
| 239 | (AddPullMirror, Tr) => "Çekme yansısı ekle", | 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 | (AddPushMirror, En) => "Add push mirror", | 196 | (AddPushMirror, En) => "Add push mirror", |
| 247 | (AddPushMirror, Tr) => "Gönderme yansısı ekle", | 197 | (AddPushMirror, Tr) => "Gönderme yansısı ekle", |
| 248 | (AddWebhook, En) => "Add webhook", | 198 | (AddWebhook, En) => "Add webhook", |
| 249 | (AddWebhook, Tr) => "Web kancası ekle", | 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 | (ArchivedNotice, En) => { | 200 | (ArchivedNotice, En) => { |
| 257 | "This repository is archived. Mirrors are read-only: they cannot be changed, synced or deleted." | 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 | (Cancel, Tr) => "Vazgeç", | 215 | (Cancel, Tr) => "Vazgeç", |
| 272 | (DeleteConfirm, En) => "Delete it? This cannot be undone.", | 216 | (DeleteConfirm, En) => "Delete it? This cannot be undone.", |
| 273 | (DeleteConfirm, Tr) => "Silinsin mi? Bu işlem geri alınamaz.", | 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 | (DeleteMirror, En) => "Delete mirror", | 218 | (DeleteMirror, En) => "Delete mirror", |
| 281 | (DeleteMirror, Tr) => "Yansıyı sil", | 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 | (DeleteWebhook, En) => "Delete webhook", | 220 | (DeleteWebhook, En) => "Delete webhook", |
| 293 | (DeleteWebhook, Tr) => "Web kancasını sil", | 221 | (DeleteWebhook, Tr) => "Web kancasını sil", |
| 294 | (DirectionPull, En) => "Pull", | 222 | (DirectionPull, En) => "Pull", |
| 295 | (DirectionPull, Tr) => "Çekme", | 223 | (DirectionPull, Tr) => "Çekme", |
| 296 | (DirectionPush, En) => "Push", | 224 | (DirectionPush, En) => "Push", |
| 297 | (DirectionPush, Tr) => "Gönderme", | 225 | (DirectionPush, Tr) => "Gönderme", |
| 298 | - (EditWebhook, En) => "Edit webhook", | ||
| 299 | - (EditWebhook, Tr) => "Web kancasını düzenle", | ||
| 300 | (EnabledField, En) => "Enabled: sync on the interval and after pushes", | 226 | (EnabledField, En) => "Enabled: sync on the interval and after pushes", |
| 301 | (EnabledField, Tr) => "Etkin: aralıkla ve göndermelerden sonra eşitlenir", | 227 | (EnabledField, Tr) => "Etkin: aralıkla ve göndermelerden sonra eşitlenir", |
| 302 | (ErrIntervalMax, En) => "The sync interval can be at most one year.", | 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 | (ManualOnly, Tr) => "yalnızca elle", | 285 | (ManualOnly, Tr) => "yalnızca elle", |
| 360 | (Mirrors, En) => "Mirrors", | 286 | (Mirrors, En) => "Mirrors", |
| 361 | (Mirrors, Tr) => "Yansılar", | 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 | (NoDeliveries, En) => "No deliveries yet.", | 288 | (NoDeliveries, En) => "No deliveries yet.", |
| 369 | (NoDeliveries, Tr) => "Henüz teslimat yok.", | 289 | (NoDeliveries, Tr) => "Henüz teslimat yok.", |
| 370 | (NoMirrors, En) => "No mirrors yet.", | 290 | (NoMirrors, En) => "No mirrors yet.", |
| @@ -429,12 +349,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 429 | (SaveWebhook, Tr) => "Web kancasını kaydet", | 349 | (SaveWebhook, Tr) => "Web kancasını kaydet", |
| 430 | (Secret, En) => "Secret", | 350 | (Secret, En) => "Secret", |
| 431 | (Secret, Tr) => "Gizli anahtar", | 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 | (SecretHintSet, En) => { | 352 | (SecretHintSet, En) => { |
| 439 | "A secret is set. Leave the field blank to keep it, or type a new one to replace it." | 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 | (SecretHintUnset, Tr) => "Gizli anahtar ayarlı değil. Eklemek için bir tane yazın.", | 359 | (SecretHintUnset, Tr) => "Gizli anahtar ayarlı değil. Eklemek için bir tane yazın.", |
| 446 | (SecretOptional, En) => "Password or token (optional)", | 360 | (SecretOptional, En) => "Password or token (optional)", |
| 447 | (SecretOptional, Tr) => "Parola veya belirteç (isteğe bağlı)", | 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 | (SendTestPing, En) => "Send test ping", | 362 | (SendTestPing, En) => "Send test ping", |
| 459 | (SendTestPing, Tr) => "Test pingi gönder", | 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 | (StateFailed, En) => "failed, will retry", | 364 | (StateFailed, En) => "failed, will retry", |
| 463 | (StateFailed, Tr) => "başarısız, yeniden denenecek", | 365 | (StateFailed, Tr) => "başarısız, yeniden denenecek", |
| 464 | (StateGaveUp, En) => "gave up", | 366 | (StateGaveUp, En) => "gave up", |
| @@ -479,36 +381,14 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 479 | (StatusOk, Tr) => "tamam", | 381 | (StatusOk, Tr) => "tamam", |
| 480 | (SyncHeading, En) => "Sync", | 382 | (SyncHeading, En) => "Sync", |
| 481 | (SyncHeading, Tr) => "Eşitleme", | 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 | (SyncNow, En) => "Sync now", | 384 | (SyncNow, En) => "Sync now", |
| 485 | (SyncNow, Tr) => "Şimdi eşitle", | 385 | (SyncNow, Tr) => "Şimdi eşitle", |
| 486 | (Test, En) => "Test", | 386 | (Test, En) => "Test", |
| 487 | (Test, Tr) => "Test", | 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 | (UsernameOptional, En) => "Username (optional)", | 388 | (UsernameOptional, En) => "Username (optional)", |
| 503 | (UsernameOptional, Tr) => "Kullanıcı adı (isteğe bağlı)", | 389 | (UsernameOptional, Tr) => "Kullanıcı adı (isteğe bağlı)", |
| 504 | (Webhooks, En) => "Webhooks", | 390 | (Webhooks, En) => "Webhooks", |
| 505 | (Webhooks, Tr) => "Web kancaları", | 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 | PinIssue, | 38 | PinIssue, |
| 39 | UnpinIssue, | 39 | UnpinIssue, |
| 40 | PinnedTopNote, | 40 | PinnedTopNote, |
| 41 | - NotPinned, | ||
| 42 | PinnedIssues, | 41 | PinnedIssues, |
| 43 | 42 | ||
| 44 | // Lock reasons: the lowercase reader text, then the select options. | 43 | // Lock reasons: the lowercase reader text, then the select options. |
| @@ -73,7 +72,6 @@ pub enum K { | |||
| 73 | ReviewDismissedPrefix, | 72 | ReviewDismissedPrefix, |
| 74 | 73 | ||
| 75 | // Item byline and edit forms. | 74 | // Item byline and edit forms. |
| 76 | - OpenedThis, | ||
| 77 | StateClosedNotPlanned, | 75 | StateClosedNotPlanned, |
| 78 | SaveChanges, | 76 | SaveChanges, |
| 79 | EditComment, | 77 | EditComment, |
| @@ -95,29 +93,26 @@ pub enum K { | |||
| 95 | SaveLabels, | 93 | SaveLabels, |
| 96 | NoneYet, | 94 | NoneYet, |
| 97 | Assignees, | 95 | Assignees, |
| 98 | - CommaUsernames, | ||
| 99 | SaveAssignees, | 96 | SaveAssignees, |
| 100 | - NoOneAssigned, | ||
| 101 | AssignToMe, | 97 | AssignToMe, |
| 102 | MilestoneBox, | 98 | MilestoneBox, |
| 103 | NoneOption, | 99 | NoneOption, |
| 104 | SaveMilestone, | 100 | SaveMilestone, |
| 105 | - NoMilestone, | ||
| 106 | ConversationBox, | 101 | ConversationBox, |
| 107 | Locked, | 102 | Locked, |
| 108 | UnlockConversation, | 103 | UnlockConversation, |
| 109 | NoReason, | 104 | NoReason, |
| 110 | - LockReasonAria, | ||
| 111 | LockConversation, | 105 | LockConversation, |
| 112 | LockedToCollaborators, | 106 | LockedToCollaborators, |
| 113 | - OpenToEveryone, | ||
| 114 | 107 | ||
| 115 | // Comment form. | 108 | // Comment form. |
| 116 | AddComment, | 109 | AddComment, |
| 117 | CloseCompleted, | 110 | CloseCompleted, |
| 118 | CloseNotPlanned, | 111 | CloseNotPlanned, |
| 119 | - ReopenWithComment, | ||
| 120 | CommentEmpty, | 112 | CommentEmpty, |
| 113 | + Add, | ||
| 114 | + Close, | ||
| 115 | + Reopen, | ||
| 121 | 116 | ||
| 122 | // Label page. | 117 | // Label page. |
| 123 | LabelsArchived, | 118 | LabelsArchived, |
| @@ -130,7 +125,6 @@ pub enum K { | |||
| 130 | 125 | ||
| 131 | // Milestone page. | 126 | // Milestone page. |
| 132 | MilestonesArchived, | 127 | MilestonesArchived, |
| 133 | - NoDueDate, | ||
| 134 | Overdue, | 128 | Overdue, |
| 135 | MilestoneState, | 129 | MilestoneState, |
| 136 | NoClosedMilestones, | 130 | NoClosedMilestones, |
| @@ -154,15 +148,12 @@ pub enum K { | |||
| 154 | NoIssuesMatch, | 148 | NoIssuesMatch, |
| 155 | NoIssuesYet, | 149 | NoIssuesYet, |
| 156 | SearchTitles, | 150 | SearchTitles, |
| 157 | - IssuesByState, | ||
| 158 | - LabelsAndMilestones, | ||
| 159 | FiltersApplied, | 151 | FiltersApplied, |
| 160 | ClearFilters, | 152 | ClearFilters, |
| 161 | Opened, | 153 | Opened, |
| 162 | By, | 154 | By, |
| 163 | ChooseTemplate, | 155 | ChooseTemplate, |
| 164 | BlankIssue, | 156 | BlankIssue, |
| 165 | - MarkdownSupported, | ||
| 166 | SubmitNewIssue, | 157 | SubmitNewIssue, |
| 167 | Newer, | 158 | Newer, |
| 168 | Older, | 159 | Older, |
| @@ -172,7 +163,6 @@ pub enum K { | |||
| 172 | HistPullDescription, | 163 | HistPullDescription, |
| 173 | HistComment, | 164 | HistComment, |
| 174 | HistReviewComment, | 165 | HistReviewComment, |
| 175 | - NoTextChange, | ||
| 176 | NoEarlierVersions, | 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 | pub fn t(lang: Lang, key: K) -> &'static str { | 177 | pub fn t(lang: Lang, key: K) -> &'static str { |
| 196 | match (key, lang) { | 178 | match (key, lang) { |
| 197 | (K::CouldNotSave, Lang::En) => "Could not save", | 179 | (K::CouldNotSave, Lang::En) => "Could not save", |
| @@ -253,8 +235,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 253 | (K::UnpinIssue, Lang::Tr) => "Sabitlemeyi kaldır", | 235 | (K::UnpinIssue, Lang::Tr) => "Sabitlemeyi kaldır", |
| 254 | (K::PinnedTopNote, Lang::En) => "Pinned to the top of the issue list.", | 236 | (K::PinnedTopNote, Lang::En) => "Pinned to the top of the issue list.", |
| 255 | (K::PinnedTopNote, Lang::Tr) => "Sorun listesinin en üstünde sabitlendi.", | 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 | (K::PinnedIssues, Lang::En) => "Pinned issues", | 238 | (K::PinnedIssues, Lang::En) => "Pinned issues", |
| 259 | (K::PinnedIssues, Lang::Tr) => "Sabitlenmiş sorunlar", | 239 | (K::PinnedIssues, Lang::Tr) => "Sabitlenmiş sorunlar", |
| 260 | 240 | ||
| @@ -322,8 +302,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 322 | (K::ReviewDismissedPrefix, Lang::En) => "dismissed a review: ", | 302 | (K::ReviewDismissedPrefix, Lang::En) => "dismissed a review: ", |
| 323 | (K::ReviewDismissedPrefix, Lang::Tr) => "bir incelemeyi iptal etti: ", | 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 | (K::StateClosedNotPlanned, Lang::En) => "Closed as not planned", | 305 | (K::StateClosedNotPlanned, Lang::En) => "Closed as not planned", |
| 328 | (K::StateClosedNotPlanned, Lang::Tr) => "Planlanmadı olarak kapalı", | 306 | (K::StateClosedNotPlanned, Lang::Tr) => "Planlanmadı olarak kapalı", |
| 329 | (K::SaveChanges, Lang::En) => "Save changes", | 307 | (K::SaveChanges, Lang::En) => "Save changes", |
| @@ -347,8 +325,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 347 | (K::ReviewedDismissed, Lang::Tr) => "inceledi (iptal edildi)", | 325 | (K::ReviewedDismissed, Lang::Tr) => "inceledi (iptal edildi)", |
| 348 | (K::DismissedPrefix, Lang::En) => "dismissed: ", | 326 | (K::DismissedPrefix, Lang::En) => "dismissed: ", |
| 349 | (K::DismissedPrefix, Lang::Tr) => "iptal edildi: ", | 327 | (K::DismissedPrefix, Lang::Tr) => "iptal edildi: ", |
| 350 | - (K::AddReaction, Lang::En) => "Add reaction", | 328 | + (K::AddReaction, Lang::En) => "React", |
| 351 | - (K::AddReaction, Lang::Tr) => "Tepki ekle", | 329 | + (K::AddReaction, Lang::Tr) => "Tepki ver", |
| 352 | (K::NoDescription, Lang::En) => "_No description provided._", | 330 | (K::NoDescription, Lang::En) => "_No description provided._", |
| 353 | (K::NoDescription, Lang::Tr) => "_Açıklama girilmedi._", | 331 | (K::NoDescription, Lang::Tr) => "_Açıklama girilmedi._", |
| 354 | 332 | ||
| @@ -360,12 +338,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 360 | (K::NoneYet, Lang::Tr) => "Henüz yok.", | 338 | (K::NoneYet, Lang::Tr) => "Henüz yok.", |
| 361 | (K::Assignees, Lang::En) => "Assignees", | 339 | (K::Assignees, Lang::En) => "Assignees", |
| 362 | (K::Assignees, Lang::Tr) => "Atananlar", | 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 | (K::SaveAssignees, Lang::En) => "Save assignees", | 341 | (K::SaveAssignees, Lang::En) => "Save assignees", |
| 366 | (K::SaveAssignees, Lang::Tr) => "Atananları kaydet", | 342 | (K::SaveAssignees, Lang::Tr) => "Atananları kaydet", |
| 367 | - (K::NoOneAssigned, Lang::En) => "No one assigned.", | ||
| 368 | - (K::NoOneAssigned, Lang::Tr) => "Kimse atanmadı.", | ||
| 369 | (K::AssignToMe, Lang::En) => "Assign to me", | 343 | (K::AssignToMe, Lang::En) => "Assign to me", |
| 370 | (K::AssignToMe, Lang::Tr) => "Bana ata", | 344 | (K::AssignToMe, Lang::Tr) => "Bana ata", |
| 371 | (K::MilestoneBox, Lang::En) => "Milestone", | 345 | (K::MilestoneBox, Lang::En) => "Milestone", |
| @@ -374,8 +348,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 374 | (K::NoneOption, Lang::Tr) => "Yok", | 348 | (K::NoneOption, Lang::Tr) => "Yok", |
| 375 | (K::SaveMilestone, Lang::En) => "Save milestone", | 349 | (K::SaveMilestone, Lang::En) => "Save milestone", |
| 376 | (K::SaveMilestone, Lang::Tr) => "Kilometre taşını kaydet", | 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 | (K::ConversationBox, Lang::En) => "Conversation", | 351 | (K::ConversationBox, Lang::En) => "Conversation", |
| 380 | (K::ConversationBox, Lang::Tr) => "Tartışma", | 352 | (K::ConversationBox, Lang::Tr) => "Tartışma", |
| 381 | (K::Locked, Lang::En) => "Locked", | 353 | (K::Locked, Lang::En) => "Locked", |
| @@ -384,14 +356,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 384 | (K::UnlockConversation, Lang::Tr) => "Tartışmanın kilidini aç", | 356 | (K::UnlockConversation, Lang::Tr) => "Tartışmanın kilidini aç", |
| 385 | (K::NoReason, Lang::En) => "No reason", | 357 | (K::NoReason, Lang::En) => "No reason", |
| 386 | (K::NoReason, Lang::Tr) => "Neden yok", | 358 | (K::NoReason, Lang::Tr) => "Neden yok", |
| 387 | - (K::LockReasonAria, Lang::En) => "Lock reason", | ||
| 388 | - (K::LockReasonAria, Lang::Tr) => "Kilit nedeni", | ||
| 389 | (K::LockConversation, Lang::En) => "Lock conversation", | 359 | (K::LockConversation, Lang::En) => "Lock conversation", |
| 390 | (K::LockConversation, Lang::Tr) => "Tartışmayı kilitle", | 360 | (K::LockConversation, Lang::Tr) => "Tartışmayı kilitle", |
| 391 | (K::LockedToCollaborators, Lang::En) => "Locked to collaborators", | 361 | (K::LockedToCollaborators, Lang::En) => "Locked to collaborators", |
| 392 | (K::LockedToCollaborators, Lang::Tr) => "Katkıda bulunanlarla sınırlı", | 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 | (K::AddComment, Lang::En) => "Add a comment", | 364 | (K::AddComment, Lang::En) => "Add a comment", |
| 397 | (K::AddComment, Lang::Tr) => "Yorum ekle", | 365 | (K::AddComment, Lang::Tr) => "Yorum ekle", |
| @@ -399,10 +367,14 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 399 | (K::CloseCompleted, Lang::Tr) => "Tamamlandı olarak kapat", | 367 | (K::CloseCompleted, Lang::Tr) => "Tamamlandı olarak kapat", |
| 400 | (K::CloseNotPlanned, Lang::En) => "Close as not planned", | 368 | (K::CloseNotPlanned, Lang::En) => "Close as not planned", |
| 401 | (K::CloseNotPlanned, Lang::Tr) => "Planlanmadı olarak kapat", | 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 | (K::CommentEmpty, Lang::En) => "Comment cannot be empty.", | 370 | (K::CommentEmpty, Lang::En) => "Comment cannot be empty.", |
| 405 | (K::CommentEmpty, Lang::Tr) => "Yorum boş olamaz.", | 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 | (K::LabelsArchived, Lang::En) => "This repository is archived. Labels are read-only.", | 379 | (K::LabelsArchived, Lang::En) => "This repository is archived. Labels are read-only.", |
| 408 | (K::LabelsArchived, Lang::Tr) => "Bu depo arşivlenmiş. Etiketler salt okunur.", | 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 | "This repository is archived. Milestones are read-only." | 395 | "This repository is archived. Milestones are read-only." |
| 424 | } | 396 | } |
| 425 | (K::MilestonesArchived, Lang::Tr) => "Bu depo arşivlenmiş. Kilometre taşları salt okunur.", | 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 | (K::Overdue, Lang::En) => "overdue", | 398 | (K::Overdue, Lang::En) => "overdue", |
| 429 | (K::Overdue, Lang::Tr) => "gecikmiş", | 399 | (K::Overdue, Lang::Tr) => "gecikmiş", |
| 430 | (K::MilestoneState, Lang::En) => "Milestone state", | 400 | (K::MilestoneState, Lang::En) => "Milestone state", |
| @@ -468,10 +438,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 468 | (K::NoIssuesYet, Lang::Tr) => "Henüz sorun yok. Konuşmayı başlatmak için bir sorun açın.", | 438 | (K::NoIssuesYet, Lang::Tr) => "Henüz sorun yok. Konuşmayı başlatmak için bir sorun açın.", |
| 469 | (K::SearchTitles, Lang::En) => "Search titles", | 439 | (K::SearchTitles, Lang::En) => "Search titles", |
| 470 | (K::SearchTitles, Lang::Tr) => "Başlıklarda ara", | 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 | (K::FiltersApplied, Lang::En) => "Filters applied · ", | 441 | (K::FiltersApplied, Lang::En) => "Filters applied · ", |
| 476 | (K::FiltersApplied, Lang::Tr) => "Filtreler uygulandı · ", | 442 | (K::FiltersApplied, Lang::Tr) => "Filtreler uygulandı · ", |
| 477 | (K::ClearFilters, Lang::En) => "Clear filters", | 443 | (K::ClearFilters, Lang::En) => "Clear filters", |
| @@ -484,8 +450,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 484 | (K::ChooseTemplate, Lang::Tr) => "Başlamak için bir şablon seçin.", | 450 | (K::ChooseTemplate, Lang::Tr) => "Başlamak için bir şablon seçin.", |
| 485 | (K::BlankIssue, Lang::En) => "Open a blank issue", | 451 | (K::BlankIssue, Lang::En) => "Open a blank issue", |
| 486 | (K::BlankIssue, Lang::Tr) => "Boş bir sorun aç", | 452 | (K::BlankIssue, Lang::Tr) => "Boş bir sorun aç", |
| 487 | - (K::MarkdownSupported, Lang::En) => "Markdown supported.", | ||
| 488 | - (K::MarkdownSupported, Lang::Tr) => "Markdown desteklenir.", | ||
| 489 | (K::SubmitNewIssue, Lang::En) => "Submit new issue", | 453 | (K::SubmitNewIssue, Lang::En) => "Submit new issue", |
| 490 | (K::SubmitNewIssue, Lang::Tr) => "Yeni sorunu gönder", | 454 | (K::SubmitNewIssue, Lang::Tr) => "Yeni sorunu gönder", |
| 491 | (K::Newer, Lang::En) => "Newer", | 455 | (K::Newer, Lang::En) => "Newer", |
| @@ -501,8 +465,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 501 | (K::HistComment, Lang::Tr) => "yorum", | 465 | (K::HistComment, Lang::Tr) => "yorum", |
| 502 | (K::HistReviewComment, Lang::En) => "review comment", | 466 | (K::HistReviewComment, Lang::En) => "review comment", |
| 503 | (K::HistReviewComment, Lang::Tr) => "inceleme yorumu", | 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 | (K::NoEarlierVersions, Lang::En) => "No earlier versions.", | 468 | (K::NoEarlierVersions, Lang::En) => "No earlier versions.", |
| 507 | (K::NoEarlierVersions, Lang::Tr) => "Önceki sürüm yok.", | 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 | // Timeline event sentences. | 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 | pub fn event_label_added(lang: Lang, label: &str) -> String { | 693 | pub fn event_label_added(lang: Lang, label: &str) -> String { |
| 713 | match lang { | 694 | match lang { |
| 714 | Lang::En => format!("added the {label} label"), | 695 | Lang::En => format!("added the {label} label"), |
| @@ -943,7 +924,6 @@ mod tests { | |||
| 943 | K::PinIssue, | 924 | K::PinIssue, |
| 944 | K::UnpinIssue, | 925 | K::UnpinIssue, |
| 945 | K::PinnedTopNote, | 926 | K::PinnedTopNote, |
| 946 | - K::NotPinned, | ||
| 947 | K::PinnedIssues, | 927 | K::PinnedIssues, |
| 948 | K::LockOffTopic, | 928 | K::LockOffTopic, |
| 949 | K::LockTooHeated, | 929 | K::LockTooHeated, |
| @@ -972,7 +952,6 @@ mod tests { | |||
| 972 | K::DeletedHeadBranch, | 952 | K::DeletedHeadBranch, |
| 973 | K::InCommit, | 953 | K::InCommit, |
| 974 | K::ReviewDismissedPrefix, | 954 | K::ReviewDismissedPrefix, |
| 975 | - K::OpenedThis, | ||
| 976 | K::StateClosedNotPlanned, | 955 | K::StateClosedNotPlanned, |
| 977 | K::SaveChanges, | 956 | K::SaveChanges, |
| 978 | K::EditComment, | 957 | K::EditComment, |
| @@ -990,26 +969,23 @@ mod tests { | |||
| 990 | K::SaveLabels, | 969 | K::SaveLabels, |
| 991 | K::NoneYet, | 970 | K::NoneYet, |
| 992 | K::Assignees, | 971 | K::Assignees, |
| 993 | - K::CommaUsernames, | ||
| 994 | K::SaveAssignees, | 972 | K::SaveAssignees, |
| 995 | - K::NoOneAssigned, | ||
| 996 | K::AssignToMe, | 973 | K::AssignToMe, |
| 997 | K::MilestoneBox, | 974 | K::MilestoneBox, |
| 998 | K::NoneOption, | 975 | K::NoneOption, |
| 999 | K::SaveMilestone, | 976 | K::SaveMilestone, |
| 1000 | - K::NoMilestone, | ||
| 1001 | K::ConversationBox, | 977 | K::ConversationBox, |
| 1002 | K::Locked, | 978 | K::Locked, |
| 1003 | K::UnlockConversation, | 979 | K::UnlockConversation, |
| 1004 | K::NoReason, | 980 | K::NoReason, |
| 1005 | - K::LockReasonAria, | ||
| 1006 | K::LockConversation, | 981 | K::LockConversation, |
| 1007 | K::LockedToCollaborators, | 982 | K::LockedToCollaborators, |
| 1008 | - K::OpenToEveryone, | ||
| 1009 | K::AddComment, | 983 | K::AddComment, |
| 1010 | K::CloseCompleted, | 984 | K::CloseCompleted, |
| 1011 | K::CloseNotPlanned, | 985 | K::CloseNotPlanned, |
| 1012 | - K::ReopenWithComment, | 986 | + K::Add, |
| 987 | + K::Close, | ||
| 988 | + K::Reopen, | ||
| 1013 | K::CommentEmpty, | 989 | K::CommentEmpty, |
| 1014 | K::LabelsArchived, | 990 | K::LabelsArchived, |
| 1015 | K::NoLabelsYet, | 991 | K::NoLabelsYet, |
| @@ -1019,7 +995,6 @@ mod tests { | |||
| 1019 | K::CreateLabel, | 995 | K::CreateLabel, |
| 1020 | K::OpenLabelCount, | 996 | K::OpenLabelCount, |
| 1021 | K::MilestonesArchived, | 997 | K::MilestonesArchived, |
| 1022 | - K::NoDueDate, | ||
| 1023 | K::Overdue, | 998 | K::Overdue, |
| 1024 | K::MilestoneState, | 999 | K::MilestoneState, |
| 1025 | K::NoClosedMilestones, | 1000 | K::NoClosedMilestones, |
| @@ -1041,15 +1016,12 @@ mod tests { | |||
| 1041 | K::NoIssuesMatch, | 1016 | K::NoIssuesMatch, |
| 1042 | K::NoIssuesYet, | 1017 | K::NoIssuesYet, |
| 1043 | K::SearchTitles, | 1018 | K::SearchTitles, |
| 1044 | - K::IssuesByState, | ||
| 1045 | - K::LabelsAndMilestones, | ||
| 1046 | K::FiltersApplied, | 1019 | K::FiltersApplied, |
| 1047 | K::ClearFilters, | 1020 | K::ClearFilters, |
| 1048 | K::Opened, | 1021 | K::Opened, |
| 1049 | K::By, | 1022 | K::By, |
| 1050 | K::ChooseTemplate, | 1023 | K::ChooseTemplate, |
| 1051 | K::BlankIssue, | 1024 | K::BlankIssue, |
| 1052 | - K::MarkdownSupported, | ||
| 1053 | K::SubmitNewIssue, | 1025 | K::SubmitNewIssue, |
| 1054 | K::Newer, | 1026 | K::Newer, |
| 1055 | K::Older, | 1027 | K::Older, |
| @@ -1057,7 +1029,6 @@ mod tests { | |||
| 1057 | K::HistPullDescription, | 1029 | K::HistPullDescription, |
| 1058 | K::HistComment, | 1030 | K::HistComment, |
| 1059 | K::HistReviewComment, | 1031 | K::HistReviewComment, |
| 1060 | - K::NoTextChange, | ||
| 1061 | K::NoEarlierVersions, | 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 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] | 6 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] |
| 7 | pub enum K { | 7 | pub enum K { |
| 8 | RequireMergeQueue, | 8 | RequireMergeQueue, |
| 9 | - RequireMergeQueueHint, | ||
| 10 | RuleMergeQueue, | 9 | RuleMergeQueue, |
| 11 | AddToMergeQueue, | 10 | AddToMergeQueue, |
| 12 | - MergeQueueHint, | ||
| 13 | RemoveFromQueue, | 11 | RemoveFromQueue, |
| 14 | MergeQueueTitle, | 12 | MergeQueueTitle, |
| 15 | MergeQueueNav, | 13 | MergeQueueNav, |
| @@ -18,13 +16,6 @@ pub enum K { | |||
| 18 | QueueEmpty, | 16 | QueueEmpty, |
| 19 | QueueNoBranch, | 17 | QueueNoBranch, |
| 20 | QueueColPosition, | 18 | QueueColPosition, |
| 21 | - QueueColPull, | ||
| 22 | - QueueColBranch, | ||
| 23 | - QueueColState, | ||
| 24 | - QueueColBy, | ||
| 25 | - QueueColQueued, | ||
| 26 | - QueueColRun, | ||
| 27 | - QueueColReason, | ||
| 28 | QueueNoRun, | 19 | QueueNoRun, |
| 29 | StateQueued, | 20 | StateQueued, |
| 30 | StateTesting, | 21 | StateTesting, |
| @@ -49,10 +40,8 @@ pub enum K { | |||
| 49 | #[cfg(test)] | 40 | #[cfg(test)] |
| 50 | pub const ALL: &[K] = &[ | 41 | pub const ALL: &[K] = &[ |
| 51 | K::RequireMergeQueue, | 42 | K::RequireMergeQueue, |
| 52 | - K::RequireMergeQueueHint, | ||
| 53 | K::RuleMergeQueue, | 43 | K::RuleMergeQueue, |
| 54 | K::AddToMergeQueue, | 44 | K::AddToMergeQueue, |
| 55 | - K::MergeQueueHint, | ||
| 56 | K::RemoveFromQueue, | 45 | K::RemoveFromQueue, |
| 57 | K::MergeQueueTitle, | 46 | K::MergeQueueTitle, |
| 58 | K::MergeQueueNav, | 47 | K::MergeQueueNav, |
| @@ -61,13 +50,6 @@ pub const ALL: &[K] = &[ | |||
| 61 | K::QueueEmpty, | 50 | K::QueueEmpty, |
| 62 | K::QueueNoBranch, | 51 | K::QueueNoBranch, |
| 63 | K::QueueColPosition, | 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 | K::QueueNoRun, | 53 | K::QueueNoRun, |
| 72 | K::StateQueued, | 54 | K::StateQueued, |
| 73 | K::StateTesting, | 55 | K::StateTesting, |
| @@ -94,22 +76,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 94 | match (key, lang) { | 76 | match (key, lang) { |
| 95 | (RequireMergeQueue, En) => "Merge queue", | 77 | (RequireMergeQueue, En) => "Merge queue", |
| 96 | (RequireMergeQueue, Tr) => "Birleştirme sırası", | 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 | (RuleMergeQueue, En) => "merge queue required", | 79 | (RuleMergeQueue, En) => "merge queue required", |
| 104 | (RuleMergeQueue, Tr) => "birleştirme sırası zorunlu", | 80 | (RuleMergeQueue, Tr) => "birleştirme sırası zorunlu", |
| 105 | (AddToMergeQueue, En) => "Add to merge queue", | 81 | (AddToMergeQueue, En) => "Add to merge queue", |
| 106 | (AddToMergeQueue, Tr) => "Birleştirme sırasına ekle", | 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 | (RemoveFromQueue, En) => "Remove from queue", | 83 | (RemoveFromQueue, En) => "Remove from queue", |
| 114 | (RemoveFromQueue, Tr) => "Sıradan çıkar", | 84 | (RemoveFromQueue, Tr) => "Sıradan çıkar", |
| 115 | (MergeQueueTitle, En) => "Merge queue", | 85 | (MergeQueueTitle, En) => "Merge queue", |
| @@ -120,30 +90,12 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 120 | (QueueWaiting, Tr) => "Bekleyen", | 90 | (QueueWaiting, Tr) => "Bekleyen", |
| 121 | (QueueHistory, En) => "History", | 91 | (QueueHistory, En) => "History", |
| 122 | (QueueHistory, Tr) => "Geçmiş", | 92 | (QueueHistory, Tr) => "Geçmiş", |
| 123 | - (QueueEmpty, En) => "Nothing is waiting in the merge queue.", | 93 | + (QueueEmpty, En) => "Nothing waiting.", |
| 124 | - (QueueEmpty, Tr) => "Birleştirme sırasında bekleyen yok.", | 94 | + (QueueEmpty, Tr) => "Bekleyen yok.", |
| 125 | - (QueueNoBranch, En) => { | 95 | + (QueueNoBranch, En) => "No branch requires the merge queue.", |
| 126 | - "No protected branch requires the merge queue. Turn it on in the branch protection settings." | 96 | + (QueueNoBranch, Tr) => "Birleştirme sırası isteyen dal yok.", |
| 127 | - } | ||
| 128 | - (QueueNoBranch, Tr) => { | ||
| 129 | - "Birleştirme sırası isteyen korumalı bir dal yok. Dal koruma ayarlarından açabilirsiniz." | ||
| 130 | - } | ||
| 131 | (QueueColPosition, En) => "Position", | 97 | (QueueColPosition, En) => "Position", |
| 132 | (QueueColPosition, Tr) => "Sıra", | 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 | (QueueNoRun, En) => "No run", | 99 | (QueueNoRun, En) => "No run", |
| 148 | (QueueNoRun, Tr) => "Çalıştırma yok", | 100 | (QueueNoRun, Tr) => "Çalıştırma yok", |
| 149 | (StateQueued, En) => "Queued", | 101 | (StateQueued, En) => "Queued", |
crates/forge-web-base/src/i18n/migrate.rsmodified+0 -80
| @@ -10,7 +10,6 @@ pub enum K { | |||
| 10 | TabImport, | 10 | TabImport, |
| 11 | // Import form. | 11 | // Import form. |
| 12 | ImportTitle, | 12 | ImportTitle, |
| 13 | - ImportIntro, | ||
| 14 | SrcGit, | 13 | SrcGit, |
| 15 | SrcGitHub, | 14 | SrcGitHub, |
| 16 | SrcGitLab, | 15 | SrcGitLab, |
| @@ -23,24 +22,19 @@ pub enum K { | |||
| 23 | GitLabProject, | 22 | GitLabProject, |
| 24 | ForgejoInstance, | 23 | ForgejoInstance, |
| 25 | TokenOptional, | 24 | TokenOptional, |
| 26 | - TokenHelp, | ||
| 27 | TargetOwner, | 25 | TargetOwner, |
| 28 | TargetName, | 26 | TargetName, |
| 29 | - TargetNameHelp, | ||
| 30 | Description, | 27 | Description, |
| 31 | WhatToImport, | 28 | WhatToImport, |
| 32 | OptLabels, | 29 | OptLabels, |
| 33 | OptIssues, | 30 | OptIssues, |
| 34 | OptPulls, | 31 | OptPulls, |
| 35 | OptReleases, | 32 | OptReleases, |
| 36 | - OptionsNote, | ||
| 37 | StartImport, | 33 | StartImport, |
| 38 | BulkLink, | 34 | BulkLink, |
| 39 | BulkLinkButton, | 35 | BulkLinkButton, |
| 40 | - BulkOwnerHelp, | ||
| 41 | // Bulk import. | 36 | // Bulk import. |
| 42 | BulkTitle, | 37 | BulkTitle, |
| 43 | - BulkIntro, | ||
| 44 | BulkOwnerGitHub, | 38 | BulkOwnerGitHub, |
| 45 | BulkOwnerGitLab, | 39 | BulkOwnerGitLab, |
| 46 | BulkOwnerForgejo, | 40 | BulkOwnerForgejo, |
| @@ -55,14 +49,11 @@ pub enum K { | |||
| 55 | // Jobs. | 49 | // Jobs. |
| 56 | JobsTitle, | 50 | JobsTitle, |
| 57 | NoJobs, | 51 | NoJobs, |
| 58 | - RecentImports, | ||
| 59 | - ViewAll, | ||
| 60 | JobQueued, | 52 | JobQueued, |
| 61 | JobRunning, | 53 | JobRunning, |
| 62 | JobDone, | 54 | JobDone, |
| 63 | JobFailed, | 55 | JobFailed, |
| 64 | JobRetry, | 56 | JobRetry, |
| 65 | - JobRetryHelp, | ||
| 66 | JobOpenRepo, | 57 | JobOpenRepo, |
| 67 | JobProgress, | 58 | JobProgress, |
| 68 | JobNoLog, | 59 | JobNoLog, |
| @@ -70,7 +61,6 @@ pub enum K { | |||
| 70 | RetryFailedTitle, | 61 | RetryFailedTitle, |
| 71 | RetrySelected, | 62 | RetrySelected, |
| 72 | RetryNone, | 63 | RetryNone, |
| 73 | - RetryTokenHelp, | ||
| 74 | StageGit, | 64 | StageGit, |
| 75 | StageLabels, | 65 | StageLabels, |
| 76 | StageMilestones, | 66 | StageMilestones, |
| @@ -86,8 +76,6 @@ pub enum K { | |||
| 86 | // Data export. | 76 | // Data export. |
| 87 | SettingsExport, | 77 | SettingsExport, |
| 88 | ExportTitle, | 78 | ExportTitle, |
| 89 | - ExportIntro, | ||
| 90 | - ExportContents, | ||
| 91 | ExportRequest, | 79 | ExportRequest, |
| 92 | ExportBuilding, | 80 | ExportBuilding, |
| 93 | ExportReady, | 81 | ExportReady, |
| @@ -96,7 +84,6 @@ pub enum K { | |||
| 96 | ExportNone, | 84 | ExportNone, |
| 97 | ExportRequested, | 85 | ExportRequested, |
| 98 | ExportSize, | 86 | ExportSize, |
| 99 | - ExportEmailNote, | ||
| 100 | } | 87 | } |
| 101 | 88 | ||
| 102 | #[cfg(test)] | 89 | #[cfg(test)] |
| @@ -104,7 +91,6 @@ const ALL: &[K] = &[ | |||
| 104 | K::TabCreate, | 91 | K::TabCreate, |
| 105 | K::TabImport, | 92 | K::TabImport, |
| 106 | K::ImportTitle, | 93 | K::ImportTitle, |
| 107 | - K::ImportIntro, | ||
| 108 | K::SrcGit, | 94 | K::SrcGit, |
| 109 | K::SrcGitHub, | 95 | K::SrcGitHub, |
| 110 | K::SrcGitLab, | 96 | K::SrcGitLab, |
| @@ -117,23 +103,18 @@ const ALL: &[K] = &[ | |||
| 117 | K::GitLabProject, | 103 | K::GitLabProject, |
| 118 | K::ForgejoInstance, | 104 | K::ForgejoInstance, |
| 119 | K::TokenOptional, | 105 | K::TokenOptional, |
| 120 | - K::TokenHelp, | ||
| 121 | K::TargetOwner, | 106 | K::TargetOwner, |
| 122 | K::TargetName, | 107 | K::TargetName, |
| 123 | - K::TargetNameHelp, | ||
| 124 | K::Description, | 108 | K::Description, |
| 125 | K::WhatToImport, | 109 | K::WhatToImport, |
| 126 | K::OptLabels, | 110 | K::OptLabels, |
| 127 | K::OptIssues, | 111 | K::OptIssues, |
| 128 | K::OptPulls, | 112 | K::OptPulls, |
| 129 | K::OptReleases, | 113 | K::OptReleases, |
| 130 | - K::OptionsNote, | ||
| 131 | K::StartImport, | 114 | K::StartImport, |
| 132 | K::BulkLink, | 115 | K::BulkLink, |
| 133 | K::BulkLinkButton, | 116 | K::BulkLinkButton, |
| 134 | - K::BulkOwnerHelp, | ||
| 135 | K::BulkTitle, | 117 | K::BulkTitle, |
| 136 | - K::BulkIntro, | ||
| 137 | K::BulkOwnerGitHub, | 118 | K::BulkOwnerGitHub, |
| 138 | K::BulkOwnerGitLab, | 119 | K::BulkOwnerGitLab, |
| 139 | K::BulkOwnerForgejo, | 120 | K::BulkOwnerForgejo, |
| @@ -147,14 +128,11 @@ const ALL: &[K] = &[ | |||
| 147 | K::BulkArchived, | 128 | K::BulkArchived, |
| 148 | K::JobsTitle, | 129 | K::JobsTitle, |
| 149 | K::NoJobs, | 130 | K::NoJobs, |
| 150 | - K::RecentImports, | ||
| 151 | - K::ViewAll, | ||
| 152 | K::JobQueued, | 131 | K::JobQueued, |
| 153 | K::JobRunning, | 132 | K::JobRunning, |
| 154 | K::JobDone, | 133 | K::JobDone, |
| 155 | K::JobFailed, | 134 | K::JobFailed, |
| 156 | K::JobRetry, | 135 | K::JobRetry, |
| 157 | - K::JobRetryHelp, | ||
| 158 | K::JobOpenRepo, | 136 | K::JobOpenRepo, |
| 159 | K::JobProgress, | 137 | K::JobProgress, |
| 160 | K::JobNoLog, | 138 | K::JobNoLog, |
| @@ -162,7 +140,6 @@ const ALL: &[K] = &[ | |||
| 162 | K::RetryFailedTitle, | 140 | K::RetryFailedTitle, |
| 163 | K::RetrySelected, | 141 | K::RetrySelected, |
| 164 | K::RetryNone, | 142 | K::RetryNone, |
| 165 | - K::RetryTokenHelp, | ||
| 166 | K::StageGit, | 143 | K::StageGit, |
| 167 | K::StageLabels, | 144 | K::StageLabels, |
| 168 | K::StageMilestones, | 145 | K::StageMilestones, |
| @@ -176,8 +153,6 @@ const ALL: &[K] = &[ | |||
| 176 | K::ErrTooMany, | 153 | K::ErrTooMany, |
| 177 | K::SettingsExport, | 154 | K::SettingsExport, |
| 178 | K::ExportTitle, | 155 | K::ExportTitle, |
| 179 | - K::ExportIntro, | ||
| 180 | - K::ExportContents, | ||
| 181 | K::ExportRequest, | 156 | K::ExportRequest, |
| 182 | K::ExportBuilding, | 157 | K::ExportBuilding, |
| 183 | K::ExportReady, | 158 | K::ExportReady, |
| @@ -186,7 +161,6 @@ const ALL: &[K] = &[ | |||
| 186 | K::ExportNone, | 161 | K::ExportNone, |
| 187 | K::ExportRequested, | 162 | K::ExportRequested, |
| 188 | K::ExportSize, | 163 | K::ExportSize, |
| 189 | - K::ExportEmailNote, | ||
| 190 | ]; | 164 | ]; |
| 191 | 165 | ||
| 192 | /// `(English, Turkish)` for each phrase. | 166 | /// `(English, Turkish)` for each phrase. |
| @@ -195,10 +169,6 @@ fn pair(key: K) -> (&'static str, &'static str) { | |||
| 195 | K::TabCreate => ("Create", "Oluştur"), | 169 | K::TabCreate => ("Create", "Oluştur"), |
| 196 | K::TabImport => ("Import", "İçe aktar"), | 170 | K::TabImport => ("Import", "İçe aktar"), |
| 197 | K::ImportTitle => ("Import a repository", "Depo içe aktar"), | 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 | K::SrcGit => ("Git URL", "Git URL'si"), | 172 | K::SrcGit => ("Git URL", "Git URL'si"), |
| 203 | K::SrcGitHub => ("GitHub", "GitHub"), | 173 | K::SrcGitHub => ("GitHub", "GitHub"), |
| 204 | K::SrcGitLab => ("GitLab", "GitLab"), | 174 | K::SrcGitLab => ("GitLab", "GitLab"), |
| @@ -217,38 +187,18 @@ fn pair(key: K) -> (&'static str, &'static str) { | |||
| 217 | "Forgejo veya Gitea adresi (Codeberg da olur)", | 187 | "Forgejo veya Gitea adresi (Codeberg da olur)", |
| 218 | ), | 188 | ), |
| 219 | K::TokenOptional => ("Access token (optional)", "Erişim belirteci (isteğe bağlı)"), | 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 | K::TargetOwner => ("Owner", "Sahip"), | 190 | K::TargetOwner => ("Owner", "Sahip"), |
| 225 | K::TargetName => ("New repository name", "Yeni depo adı"), | 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 | K::Description => ("Description (optional)", "Açıklama (isteğe bağlı)"), | 192 | K::Description => ("Description (optional)", "Açıklama (isteğe bağlı)"), |
| 231 | K::WhatToImport => ("Also import", "Şunları da içe aktar"), | 193 | K::WhatToImport => ("Also import", "Şunları da içe aktar"), |
| 232 | K::OptLabels => ("Labels and milestones", "Etiketler ve kilometre taşları"), | 194 | K::OptLabels => ("Labels and milestones", "Etiketler ve kilometre taşları"), |
| 233 | K::OptIssues => ("Issues and comments", "Konular ve yorumlar"), | 195 | K::OptIssues => ("Issues and comments", "Konular ve yorumlar"), |
| 234 | K::OptPulls => ("Pull requests (as issues)", "Çekme istekleri (konu olarak)"), | 196 | K::OptPulls => ("Pull requests (as issues)", "Çekme istekleri (konu olarak)"), |
| 235 | K::OptReleases => ("Releases and their files", "Sürümler ve dosyaları"), | 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 | K::StartImport => ("Start import", "İçe aktarmayı başlat"), | 198 | K::StartImport => ("Start import", "İçe aktarmayı başlat"), |
| 241 | K::BulkLink => ("Import several repositories", "Birden çok depoyu içe aktar"), | 199 | K::BulkLink => ("Import several repositories", "Birden çok depoyu içe aktar"), |
| 242 | K::BulkLinkButton => ("Choose repositories", "Depoları seç"), | 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 | K::BulkTitle => ("Import several repositories", "Birden çok depoyu içe aktar"), | 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 | K::BulkOwnerGitHub => ( | 202 | K::BulkOwnerGitHub => ( |
| 253 | "GitHub user or organization", | 203 | "GitHub user or organization", |
| 254 | "GitHub kullanıcısı veya kuruluşu", | 204 | "GitHub kullanıcısı veya kuruluşu", |
| @@ -271,17 +221,11 @@ fn pair(key: K) -> (&'static str, &'static str) { | |||
| 271 | K::BulkArchived => ("archived", "arşivlenmiş"), | 221 | K::BulkArchived => ("archived", "arşivlenmiş"), |
| 272 | K::JobsTitle => ("Import history", "İçe aktarma geçmişi"), | 222 | K::JobsTitle => ("Import history", "İçe aktarma geçmişi"), |
| 273 | K::NoJobs => ("No imports yet.", "Henüz içe aktarma yok."), | 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 | K::JobQueued => ("Queued", "Sırada"), | 224 | K::JobQueued => ("Queued", "Sırada"), |
| 277 | K::JobRunning => ("Running", "Çalışıyor"), | 225 | K::JobRunning => ("Running", "Çalışıyor"), |
| 278 | K::JobDone => ("Done", "Bitti"), | 226 | K::JobDone => ("Done", "Bitti"), |
| 279 | K::JobFailed => ("Failed", "Başarısız"), | 227 | K::JobFailed => ("Failed", "Başarısız"), |
| 280 | K::JobRetry => ("Retry", "Yeniden dene"), | 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 | K::JobOpenRepo => ("Open repository", "Depoyu aç"), | 229 | K::JobOpenRepo => ("Open repository", "Depoyu aç"), |
| 286 | K::JobProgress => ("Progress", "İlerleme"), | 230 | K::JobProgress => ("Progress", "İlerleme"), |
| 287 | K::JobNoLog => ("Nothing yet.", "Henüz bir şey yok."), | 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 | K::RetrySelected => ("Retry selected", "Seçilenleri yeniden dene"), | 237 | K::RetrySelected => ("Retry selected", "Seçilenleri yeniden dene"), |
| 294 | K::RetryNone => ("No failed imports", "Başarısız içe aktarma yok"), | 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 | K::StageGit => ("Git data", "Git verisi"), | 239 | K::StageGit => ("Git data", "Git verisi"), |
| 300 | K::StageLabels => ("Labels", "Etiketler"), | 240 | K::StageLabels => ("Labels", "Etiketler"), |
| 301 | K::StageMilestones => ("Milestones", "Kilometre taşları"), | 241 | K::StageMilestones => ("Milestones", "Kilometre taşları"), |
| @@ -321,14 +261,6 @@ fn pair(key: K) -> (&'static str, &'static str) { | |||
| 321 | ), | 261 | ), |
| 322 | K::SettingsExport => ("Data export", "Veri dışa aktarımı"), | 262 | K::SettingsExport => ("Data export", "Veri dışa aktarımı"), |
| 323 | K::ExportTitle => ("Export your data", "Verilerinizi dışa aktarın"), | 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 | K::ExportRequest => ("Request an export", "Dışa aktarım iste"), | 264 | K::ExportRequest => ("Request an export", "Dışa aktarım iste"), |
| 333 | K::ExportBuilding => ("Building", "Hazırlanıyor"), | 265 | K::ExportBuilding => ("Building", "Hazırlanıyor"), |
| 334 | K::ExportReady => ("Ready", "Hazır"), | 266 | K::ExportReady => ("Ready", "Hazır"), |
| @@ -337,10 +269,6 @@ fn pair(key: K) -> (&'static str, &'static str) { | |||
| 337 | K::ExportNone => ("No exports yet.", "Henüz dışa aktarım yok."), | 269 | K::ExportNone => ("No exports yet.", "Henüz dışa aktarım yok."), |
| 338 | K::ExportRequested => ("Requested", "İstendi"), | 270 | K::ExportRequested => ("Requested", "İstendi"), |
| 339 | K::ExportSize => ("Size", "Boyut"), | 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 | /// The import list's note after a bulk import left some repositories out. `list` says which and why. | 291 | /// The import list's note after a bulk import left some repositories out. `list` says which and why. |
| 372 | pub fn bulk_skipped(lang: Lang, list: &str) -> String { | 292 | pub fn bulk_skipped(lang: Lang, list: &str) -> String { |
| 373 | match lang { | 293 | match lang { |
crates/forge-web-base/src/i18n/misc.rsmodified+1 -246
| @@ -16,7 +16,6 @@ pub enum K { | |||
| 16 | Appearance, | 16 | Appearance, |
| 17 | ThemeLabel, | 17 | ThemeLabel, |
| 18 | LanguageLabel, | 18 | LanguageLabel, |
| 19 | - MatchSystemHelp, | ||
| 20 | MatchSystem, | 19 | MatchSystem, |
| 21 | Light, | 20 | Light, |
| 22 | Dark, | 21 | Dark, |
| @@ -34,24 +33,14 @@ pub enum K { | |||
| 34 | HueLabel, | 33 | HueLabel, |
| 35 | VividnessLabel, | 34 | VividnessLabel, |
| 36 | HexLabel, | 35 | HexLabel, |
| 37 | - LightnessNote, | ||
| 38 | BackgroundLabel, | 36 | BackgroundLabel, |
| 39 | ChooseBase, | 37 | ChooseBase, |
| 40 | // Appearance: which side the shell sidebar sits on. | 38 | // Appearance: which side the shell sidebar sits on. |
| 41 | - SidebarLabel, | ||
| 42 | - SidebarLeft, | ||
| 43 | - SidebarRight, | ||
| 44 | ChooseSidebar, | 39 | ChooseSidebar, |
| 45 | // Appearance: the run-finished tone. | 40 | // Appearance: the run-finished tone. |
| 46 | SoundLabel, | 41 | SoundLabel, |
| 47 | - SoundSwitch, | ||
| 48 | - SoundOwnRuns, | ||
| 49 | SoundPassed, | 42 | SoundPassed, |
| 50 | - SoundPassedNote, | ||
| 51 | SoundFailed, | 43 | SoundFailed, |
| 52 | - SoundFailedNote, | ||
| 53 | - SoundPlay, | ||
| 54 | - SoundFootOwn, | ||
| 55 | ChooseSound, | 44 | ChooseSound, |
| 56 | // Notifications: row kinds. | 45 | // Notifications: row kinds. |
| 57 | KindOpenIssue, | 46 | KindOpenIssue, |
| @@ -86,20 +75,9 @@ pub enum K { | |||
| 86 | VerbPushedTo, | 75 | VerbPushedTo, |
| 87 | VerbUpdated, | 76 | VerbUpdated, |
| 88 | VerbDiscussionReply, | 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 | // Notifications: inbox page. | 78 | // Notifications: inbox page. |
| 100 | MarkAllAsRead, | 79 | MarkAllAsRead, |
| 101 | MarkAllRead, | 80 | MarkAllRead, |
| 102 | - ClearNotifications, | ||
| 103 | MarkRead, | 81 | MarkRead, |
| 104 | NoNotificationsYet, | 82 | NoNotificationsYet, |
| 105 | NoUnreadNotifications, | 83 | NoUnreadNotifications, |
| @@ -113,20 +91,9 @@ pub enum K { | |||
| 113 | OptParticipating, | 91 | OptParticipating, |
| 114 | OptWatching, | 92 | OptWatching, |
| 115 | OptIgnoring, | 93 | OptIgnoring, |
| 116 | - WatchDescParticipating, | ||
| 117 | - WatchDescWatching, | ||
| 118 | - WatchDescIgnoring, | ||
| 119 | // Repo security page. | 94 | // Repo security page. |
| 120 | SecurityOff, | 95 | SecurityOff, |
| 121 | - LockfilesRead, | ||
| 122 | NoAlerts, | 96 | NoAlerts, |
| 123 | - ColAdvisory, | ||
| 124 | - ColPackage, | ||
| 125 | - ColVersion, | ||
| 126 | - ColSeverity, | ||
| 127 | - ColSummary, | ||
| 128 | - ColState, | ||
| 129 | - ColOpened, | ||
| 130 | StateOpen, | 97 | StateOpen, |
| 131 | StateDismissed, | 98 | StateDismissed, |
| 132 | StateFixed, | 99 | StateFixed, |
| @@ -137,12 +104,9 @@ pub enum K { | |||
| 137 | RepoName, | 104 | RepoName, |
| 138 | DescriptionOptional, | 105 | DescriptionOptional, |
| 139 | VisibilityLegend, | 106 | VisibilityLegend, |
| 140 | - PrivateHelp, | ||
| 141 | - PublicHelp, | ||
| 142 | DefaultBranch, | 107 | DefaultBranch, |
| 143 | AddDefaultLabels, | 108 | AddDefaultLabels, |
| 144 | MirrorLegend, | 109 | MirrorLegend, |
| 145 | - MirrorIntro, | ||
| 146 | SourceUrl, | 110 | SourceUrl, |
| 147 | UsernameOptional, | 111 | UsernameOptional, |
| 148 | PasswordOrToken, | 112 | PasswordOrToken, |
| @@ -151,10 +115,8 @@ pub enum K { | |||
| 151 | OwnerRefused, | 115 | OwnerRefused, |
| 152 | InvalidRepoName, | 116 | InvalidRepoName, |
| 153 | ReadmeLabel, | 117 | ReadmeLabel, |
| 154 | - ReadmeHelp, | ||
| 155 | LicenseLabel, | 118 | LicenseLabel, |
| 156 | LicenseNone, | 119 | LicenseNone, |
| 157 | - LicenseHelp, | ||
| 158 | UnknownLicense, | 120 | UnknownLicense, |
| 159 | MirrorWithFiles, | 121 | MirrorWithFiles, |
| 160 | // Dashboard contribution calendar (`views::heatmap`). | 122 | // Dashboard contribution calendar (`views::heatmap`). |
| @@ -172,23 +134,18 @@ pub enum K { | |||
| 172 | ViewAllNotifications, | 134 | ViewAllNotifications, |
| 173 | // Shell chrome (`views::mod`): breadcrumb landmark, theme picker, ref selector. | 135 | // Shell chrome (`views::mod`): breadcrumb landmark, theme picker, ref selector. |
| 174 | BreadcrumbNav, | 136 | BreadcrumbNav, |
| 175 | - ApplyTheme, | ||
| 176 | RefLabel, | 137 | RefLabel, |
| 177 | // Top-bar user menu: the viewer's public profile and the settings editor. | 138 | // Top-bar user menu: the viewer's public profile and the settings editor. |
| 178 | YourProfile, | 139 | YourProfile, |
| 179 | EditProfile, | 140 | EditProfile, |
| 180 | EditOrganization, | 141 | EditOrganization, |
| 181 | // Profile corner, live strip and path bar search. | 142 | // Profile corner, live strip and path bar search. |
| 182 | - AllNotifications, | ||
| 183 | Passed, | 143 | Passed, |
| 184 | Failed, | 144 | Failed, |
| 185 | Cancelled, | 145 | Cancelled, |
| 186 | YourCiRuns, | 146 | YourCiRuns, |
| 187 | SearchPublicReposFor, | 147 | SearchPublicReposFor, |
| 188 | // The bell's popover: the newest notifications, opened from the profile corner. | 148 | // The bell's popover: the newest notifications, opened from the profile corner. |
| 189 | - OpenNotifications, | ||
| 190 | - PeekLoading, | ||
| 191 | - PeekError, | ||
| 192 | AllCaughtUp, | 149 | AllCaughtUp, |
| 193 | } | 150 | } |
| 194 | 151 | ||
| @@ -198,7 +155,6 @@ const ALL: &[K] = &[ | |||
| 198 | K::Appearance, | 155 | K::Appearance, |
| 199 | K::ThemeLabel, | 156 | K::ThemeLabel, |
| 200 | K::LanguageLabel, | 157 | K::LanguageLabel, |
| 201 | - K::MatchSystemHelp, | ||
| 202 | K::MatchSystem, | 158 | K::MatchSystem, |
| 203 | K::Light, | 159 | K::Light, |
| 204 | K::Dark, | 160 | K::Dark, |
| @@ -215,22 +171,12 @@ const ALL: &[K] = &[ | |||
| 215 | K::HueLabel, | 171 | K::HueLabel, |
| 216 | K::VividnessLabel, | 172 | K::VividnessLabel, |
| 217 | K::HexLabel, | 173 | K::HexLabel, |
| 218 | - K::LightnessNote, | ||
| 219 | K::BackgroundLabel, | 174 | K::BackgroundLabel, |
| 220 | K::ChooseBase, | 175 | K::ChooseBase, |
| 221 | - K::SidebarLabel, | ||
| 222 | - K::SidebarLeft, | ||
| 223 | - K::SidebarRight, | ||
| 224 | K::ChooseSidebar, | 176 | K::ChooseSidebar, |
| 225 | K::SoundLabel, | 177 | K::SoundLabel, |
| 226 | - K::SoundSwitch, | ||
| 227 | - K::SoundOwnRuns, | ||
| 228 | K::SoundPassed, | 178 | K::SoundPassed, |
| 229 | - K::SoundPassedNote, | ||
| 230 | K::SoundFailed, | 179 | K::SoundFailed, |
| 231 | - K::SoundFailedNote, | ||
| 232 | - K::SoundPlay, | ||
| 233 | - K::SoundFootOwn, | ||
| 234 | K::ChooseSound, | 180 | K::ChooseSound, |
| 235 | K::KindOpenIssue, | 181 | K::KindOpenIssue, |
| 236 | K::KindClosedIssue, | 182 | K::KindClosedIssue, |
| @@ -262,18 +208,8 @@ const ALL: &[K] = &[ | |||
| 262 | K::VerbPushedTo, | 208 | K::VerbPushedTo, |
| 263 | K::VerbUpdated, | 209 | K::VerbUpdated, |
| 264 | K::VerbDiscussionReply, | 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 | K::MarkAllAsRead, | 211 | K::MarkAllAsRead, |
| 275 | K::MarkAllRead, | 212 | K::MarkAllRead, |
| 276 | - K::ClearNotifications, | ||
| 277 | K::MarkRead, | 213 | K::MarkRead, |
| 278 | K::NoNotificationsYet, | 214 | K::NoNotificationsYet, |
| 279 | K::NoUnreadNotifications, | 215 | K::NoUnreadNotifications, |
| @@ -286,19 +222,8 @@ const ALL: &[K] = &[ | |||
| 286 | K::OptParticipating, | 222 | K::OptParticipating, |
| 287 | K::OptWatching, | 223 | K::OptWatching, |
| 288 | K::OptIgnoring, | 224 | K::OptIgnoring, |
| 289 | - K::WatchDescParticipating, | ||
| 290 | - K::WatchDescWatching, | ||
| 291 | - K::WatchDescIgnoring, | ||
| 292 | K::SecurityOff, | 225 | K::SecurityOff, |
| 293 | - K::LockfilesRead, | ||
| 294 | K::NoAlerts, | 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 | K::StateOpen, | 227 | K::StateOpen, |
| 303 | K::StateDismissed, | 228 | K::StateDismissed, |
| 304 | K::StateFixed, | 229 | K::StateFixed, |
| @@ -308,12 +233,9 @@ const ALL: &[K] = &[ | |||
| 308 | K::RepoName, | 233 | K::RepoName, |
| 309 | K::DescriptionOptional, | 234 | K::DescriptionOptional, |
| 310 | K::VisibilityLegend, | 235 | K::VisibilityLegend, |
| 311 | - K::PrivateHelp, | ||
| 312 | - K::PublicHelp, | ||
| 313 | K::DefaultBranch, | 236 | K::DefaultBranch, |
| 314 | K::AddDefaultLabels, | 237 | K::AddDefaultLabels, |
| 315 | K::MirrorLegend, | 238 | K::MirrorLegend, |
| 316 | - K::MirrorIntro, | ||
| 317 | K::SourceUrl, | 239 | K::SourceUrl, |
| 318 | K::UsernameOptional, | 240 | K::UsernameOptional, |
| 319 | K::PasswordOrToken, | 241 | K::PasswordOrToken, |
| @@ -322,10 +244,8 @@ const ALL: &[K] = &[ | |||
| 322 | K::OwnerRefused, | 244 | K::OwnerRefused, |
| 323 | K::InvalidRepoName, | 245 | K::InvalidRepoName, |
| 324 | K::ReadmeLabel, | 246 | K::ReadmeLabel, |
| 325 | - K::ReadmeHelp, | ||
| 326 | K::LicenseLabel, | 247 | K::LicenseLabel, |
| 327 | K::LicenseNone, | 248 | K::LicenseNone, |
| 328 | - K::LicenseHelp, | ||
| 329 | K::UnknownLicense, | 249 | K::UnknownLicense, |
| 330 | K::MirrorWithFiles, | 250 | K::MirrorWithFiles, |
| 331 | K::ContributionsTitle, | 251 | K::ContributionsTitle, |
| @@ -341,20 +261,15 @@ const ALL: &[K] = &[ | |||
| 341 | K::NoContributionsDay, | 261 | K::NoContributionsDay, |
| 342 | K::ViewAllNotifications, | 262 | K::ViewAllNotifications, |
| 343 | K::BreadcrumbNav, | 263 | K::BreadcrumbNav, |
| 344 | - K::ApplyTheme, | ||
| 345 | K::RefLabel, | 264 | K::RefLabel, |
| 346 | K::YourProfile, | 265 | K::YourProfile, |
| 347 | K::EditProfile, | 266 | K::EditProfile, |
| 348 | K::EditOrganization, | 267 | K::EditOrganization, |
| 349 | - K::AllNotifications, | ||
| 350 | K::Passed, | 268 | K::Passed, |
| 351 | K::Failed, | 269 | K::Failed, |
| 352 | K::Cancelled, | 270 | K::Cancelled, |
| 353 | K::YourCiRuns, | 271 | K::YourCiRuns, |
| 354 | K::SearchPublicReposFor, | 272 | K::SearchPublicReposFor, |
| 355 | - K::OpenNotifications, | ||
| 356 | - K::PeekLoading, | ||
| 357 | - K::PeekError, | ||
| 358 | K::AllCaughtUp, | 273 | K::AllCaughtUp, |
| 359 | ]; | 274 | ]; |
| 360 | 275 | ||
| @@ -368,12 +283,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 368 | (ThemeLabel, Tr) => "Tema", | 283 | (ThemeLabel, Tr) => "Tema", |
| 369 | (LanguageLabel, En) => "Language", | 284 | (LanguageLabel, En) => "Language", |
| 370 | (LanguageLabel, Tr) => "Dil", | 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 | (MatchSystem, En) => "Match the system", | 286 | (MatchSystem, En) => "Match the system", |
| 378 | (MatchSystem, Tr) => "Sistem ile eşleştir", | 287 | (MatchSystem, Tr) => "Sistem ile eşleştir", |
| 379 | (Light, En) => "Light", | 288 | (Light, En) => "Light", |
| @@ -406,38 +315,18 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 406 | (VividnessLabel, Tr) => "Canlılık", | 315 | (VividnessLabel, Tr) => "Canlılık", |
| 407 | (HexLabel, En) => "Hex", | 316 | (HexLabel, En) => "Hex", |
| 408 | (HexLabel, Tr) => "Hex", | 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 | (BackgroundLabel, En) => "Background", | 318 | (BackgroundLabel, En) => "Background", |
| 412 | (BackgroundLabel, Tr) => "Arka plan", | 319 | (BackgroundLabel, Tr) => "Arka plan", |
| 413 | (ChooseBase, En) => "Choose a background from the list.", | 320 | (ChooseBase, En) => "Choose a background from the list.", |
| 414 | (ChooseBase, Tr) => "Listeden bir arka plan seçin.", | 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 | (ChooseSidebar, En) => "Choose a sidebar position from the list.", | 322 | (ChooseSidebar, En) => "Choose a sidebar position from the list.", |
| 422 | (ChooseSidebar, Tr) => "Listeden bir kenar çubuğu konumu seçin.", | 323 | (ChooseSidebar, Tr) => "Listeden bir kenar çubuğu konumu seçin.", |
| 423 | (SoundLabel, En) => "Sound", | 324 | (SoundLabel, En) => "Sound", |
| 424 | (SoundLabel, Tr) => "Ses", | 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 | (SoundPassed, En) => "Run passed", | 326 | (SoundPassed, En) => "Run passed", |
| 430 | (SoundPassed, Tr) => "Çalıştırma başarılı", | 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 | (SoundFailed, En) => "Run failed", | 328 | (SoundFailed, En) => "Run failed", |
| 434 | (SoundFailed, Tr) => "Çalıştırma başarısız", | 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 | (ChooseSound, En) => "Choose on or off.", | 330 | (ChooseSound, En) => "Choose on or off.", |
| 442 | (ChooseSound, Tr) => "Açık ya da kapalı seçin.", | 331 | (ChooseSound, Tr) => "Açık ya da kapalı seçin.", |
| 443 | (KindOpenIssue, En) => "Open issue", | 332 | (KindOpenIssue, En) => "Open issue", |
| @@ -500,39 +389,15 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 500 | (VerbUpdated, Tr) => "güncellendi", | 389 | (VerbUpdated, Tr) => "güncellendi", |
| 501 | (VerbDiscussionReply, En) => "commented on your discussion", | 390 | (VerbDiscussionReply, En) => "commented on your discussion", |
| 502 | (VerbDiscussionReply, Tr) => "tartışmanıza yorum yapıldı", | 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 | (MarkAllAsRead, En) => "Mark all as read", | 392 | (MarkAllAsRead, En) => "Mark all as read", |
| 526 | (MarkAllAsRead, Tr) => "Tümünü okundu olarak işaretle", | 393 | (MarkAllAsRead, Tr) => "Tümünü okundu olarak işaretle", |
| 527 | (MarkAllRead, En) => "Mark all read", | 394 | (MarkAllRead, En) => "Mark all read", |
| 528 | (MarkAllRead, Tr) => "Tümünü okundu işaretle", | 395 | (MarkAllRead, Tr) => "Tümünü okundu işaretle", |
| 529 | - (ClearNotifications, En) => "Mark as read", | ||
| 530 | - (ClearNotifications, Tr) => "Okundu işaretle", | ||
| 531 | (MarkRead, En) => "Mark read", | 396 | (MarkRead, En) => "Mark read", |
| 532 | (MarkRead, Tr) => "Okundu işaretle", | 397 | (MarkRead, Tr) => "Okundu işaretle", |
| 533 | (NoNotificationsYet, En) => "No notifications yet.", | 398 | (NoNotificationsYet, En) => "No notifications yet.", |
| 534 | (NoNotificationsYet, Tr) => "Henüz bildirim yok.", | 399 | (NoNotificationsYet, Tr) => "Henüz bildirim yok.", |
| 535 | - (NoUnreadNotifications, En) => "You have no unread notifications.", | 400 | + (NoUnreadNotifications, En) => "No unread notifications.", |
| 536 | (NoUnreadNotifications, Tr) => "Okunmamış bildiriminiz yok.", | 401 | (NoUnreadNotifications, Tr) => "Okunmamış bildiriminiz yok.", |
| 537 | (NotificationFilter, En) => "Notification filter", | 402 | (NotificationFilter, En) => "Notification filter", |
| 538 | (NotificationFilter, Tr) => "Bildirim filtresi", | 403 | (NotificationFilter, Tr) => "Bildirim filtresi", |
| @@ -552,42 +417,14 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 552 | (OptWatching, Tr) => "İzleniyor", | 417 | (OptWatching, Tr) => "İzleniyor", |
| 553 | (OptIgnoring, En) => "Ignoring", | 418 | (OptIgnoring, En) => "Ignoring", |
| 554 | (OptIgnoring, Tr) => "Yok sayılıyor", | 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 | (SecurityOff, En) => { | 420 | (SecurityOff, En) => { |
| 564 | "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." | 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 | (SecurityOff, Tr) => { | 423 | (SecurityOff, Tr) => { |
| 567 | "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." | 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 | (NoAlerts, En) => "No alerts.", | 426 | (NoAlerts, En) => "No alerts.", |
| 576 | (NoAlerts, Tr) => "Uyarı yok.", | 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 | (StateOpen, En) => "Open", | 428 | (StateOpen, En) => "Open", |
| 592 | (StateOpen, Tr) => "Açık", | 429 | (StateOpen, Tr) => "Açık", |
| 593 | (StateDismissed, En) => "Dismissed", | 430 | (StateDismissed, En) => "Dismissed", |
| @@ -606,10 +443,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 606 | (DescriptionOptional, Tr) => "Açıklama (isteğe bağlı)", | 443 | (DescriptionOptional, Tr) => "Açıklama (isteğe bağlı)", |
| 607 | (VisibilityLegend, En) => "Visibility", | 444 | (VisibilityLegend, En) => "Visibility", |
| 608 | (VisibilityLegend, Tr) => "Görünürlük", | 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 | (DefaultBranch, En) => "Default branch", | 446 | (DefaultBranch, En) => "Default branch", |
| 614 | (DefaultBranch, Tr) => "Varsayılan dal", | 447 | (DefaultBranch, Tr) => "Varsayılan dal", |
| 615 | (AddDefaultLabels, En) => { | 448 | (AddDefaultLabels, En) => { |
| @@ -620,12 +453,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 620 | } | 453 | } |
| 621 | (MirrorLegend, En) => "Mirror an existing repository (optional)", | 454 | (MirrorLegend, En) => "Mirror an existing repository (optional)", |
| 622 | (MirrorLegend, Tr) => "Mevcut bir depoyu yansıt (isteğe bağlı)", | 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 | (SourceUrl, En) => "Source URL", | 456 | (SourceUrl, En) => "Source URL", |
| 630 | (SourceUrl, Tr) => "Kaynak URL", | 457 | (SourceUrl, Tr) => "Kaynak URL", |
| 631 | (UsernameOptional, En) => "Username (optional)", | 458 | (UsernameOptional, En) => "Username (optional)", |
| @@ -642,16 +469,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 642 | (InvalidRepoName, Tr) => "geçersiz depo adı", | 469 | (InvalidRepoName, Tr) => "geçersiz depo adı", |
| 643 | (ReadmeLabel, En) => "Add a README", | 470 | (ReadmeLabel, En) => "Add a README", |
| 644 | (ReadmeLabel, Tr) => "README ekle", | 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 | (LicenseLabel, En) => "License", | 472 | (LicenseLabel, En) => "License", |
| 650 | (LicenseLabel, Tr) => "Lisans", | 473 | (LicenseLabel, Tr) => "Lisans", |
| 651 | (LicenseNone, En) => "None", | 474 | (LicenseNone, En) => "None", |
| 652 | (LicenseNone, Tr) => "Yok", | 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 | (UnknownLicense, En) => "unknown license", | 476 | (UnknownLicense, En) => "unknown license", |
| 656 | (UnknownLicense, Tr) => "Bilinmeyen lisans.", | 477 | (UnknownLicense, Tr) => "Bilinmeyen lisans.", |
| 657 | (MirrorWithFiles, En) => { | 478 | (MirrorWithFiles, En) => { |
| @@ -686,8 +507,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 686 | (ViewAllNotifications, Tr) => "Tüm bildirimleri gör", | 507 | (ViewAllNotifications, Tr) => "Tüm bildirimleri gör", |
| 687 | (BreadcrumbNav, En) => "Path", | 508 | (BreadcrumbNav, En) => "Path", |
| 688 | (BreadcrumbNav, Tr) => "Yol", | 509 | (BreadcrumbNav, Tr) => "Yol", |
| 689 | - (ApplyTheme, En) => "Apply", | ||
| 690 | - (ApplyTheme, Tr) => "Uygula", | ||
| 691 | (RefLabel, En) => "Ref", | 510 | (RefLabel, En) => "Ref", |
| 692 | (RefLabel, Tr) => "Referans", | 511 | (RefLabel, Tr) => "Referans", |
| 693 | (YourProfile, En) => "Your profile", | 512 | (YourProfile, En) => "Your profile", |
| @@ -696,8 +515,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 696 | (EditProfile, Tr) => "Profili düzenle", | 515 | (EditProfile, Tr) => "Profili düzenle", |
| 697 | (EditOrganization, En) => "Edit organization", | 516 | (EditOrganization, En) => "Edit organization", |
| 698 | (EditOrganization, Tr) => "Kuruluşu düzenle", | 517 | (EditOrganization, Tr) => "Kuruluşu düzenle", |
| 699 | - (AllNotifications, En) => "All notifications", | ||
| 700 | - (AllNotifications, Tr) => "Tüm bildirimler", | ||
| 701 | (Passed, En) => "passed", | 518 | (Passed, En) => "passed", |
| 702 | (Passed, Tr) => "geçti", | 519 | (Passed, Tr) => "geçti", |
| 703 | (Failed, En) => "failed", | 520 | (Failed, En) => "failed", |
| @@ -706,12 +523,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 706 | (Cancelled, Tr) => "iptal edildi", | 523 | (Cancelled, Tr) => "iptal edildi", |
| 707 | (YourCiRuns, En) => "Your CI runs", | 524 | (YourCiRuns, En) => "Your CI runs", |
| 708 | (YourCiRuns, Tr) => "CI çalıştırmaların", | 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 | (AllCaughtUp, En) => "You're all caught up", | 526 | (AllCaughtUp, En) => "You're all caught up", |
| 716 | (AllCaughtUp, Tr) => "Hepsini gördünüz", | 527 | (AllCaughtUp, Tr) => "Hepsini gördünüz", |
| 717 | (SearchPublicReposFor, En) => "Search public repositories for", | 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 | /// `28 running` / `3 çalışıyor`: the live strip's counts. Each takes its number as `{n}` in the | 558 | /// `28 running` / `3 çalışıyor`: the live strip's counts. Each takes its number as `{n}` in the |
| 772 | /// strip's templates, so these phrases have no plural. | 559 | /// strip's templates, so these phrases have no plural. |
| 773 | pub fn running_count(lang: Lang, n: u64) -> String { | 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 | /// The calendar's accessible summary, for the grid's `aria-label`. | 627 | /// The calendar's accessible summary, for the grid's `aria-label`. |
| 860 | pub fn heatmap_summary(lang: Lang, total: u64, current: u64, longest: u64) -> String { | 628 | pub fn heatmap_summary(lang: Lang, total: u64, current: u64, longest: u64) -> String { |
| 861 | let total = thousands(lang, total); | 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 | /// "3 watching" / "3 izleyici", the watch control's count. | 739 | /// "3 watching" / "3 izleyici", the watch control's count. |
| 981 | pub fn watchers_count(lang: Lang, watchers: u64) -> String { | 740 | pub fn watchers_count(lang: Lang, watchers: u64) -> String { |
| 982 | match lang { | 741 | match lang { |
| @@ -1081,9 +840,5 @@ mod tests { | |||
| 1081 | assert_eq!(new_alerts(Lang::En, 1), "1 new alert"); | 840 | assert_eq!(new_alerts(Lang::En, 1), "1 new alert"); |
| 1082 | assert_eq!(new_alerts(Lang::En, 2), "2 new alerts"); | 841 | assert_eq!(new_alerts(Lang::En, 2), "2 new alerts"); |
| 1083 | assert_eq!(new_alerts(Lang::Tr, 3), "3 yeni uyarı"); | 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 | AccessTokens, | 137 | AccessTokens, |
| 138 | Sessions, | 138 | Sessions, |
| 139 | Security, | 139 | Security, |
| 140 | - BackToSite, | ||
| 141 | LogOut, | 140 | LogOut, |
| 142 | LogIn, | 141 | LogIn, |
| 143 | - SiteMenu, | ||
| 144 | 142 | ||
| 145 | // Shared form words. | 143 | // Shared form words. |
| 146 | Username, | 144 | Username, |
| @@ -161,7 +159,6 @@ pub enum Key { | |||
| 161 | 159 | ||
| 162 | // Log in and two-factor. | 160 | // Log in and two-factor. |
| 163 | TwoFactorCheck, | 161 | TwoFactorCheck, |
| 164 | - TwoFactorCheckSub, | ||
| 165 | ErrInvalidLogin, | 162 | ErrInvalidLogin, |
| 166 | ErrThrottled, | 163 | ErrThrottled, |
| 167 | ErrInvalidCode, | 164 | ErrInvalidCode, |
| @@ -169,7 +166,6 @@ pub enum Key { | |||
| 169 | // First-run setup. | 166 | // First-run setup. |
| 170 | Setup, | 167 | Setup, |
| 171 | WelcomeToForge, | 168 | WelcomeToForge, |
| 172 | - SetupSub, | ||
| 173 | AtLeast12Chars, | 169 | AtLeast12Chars, |
| 174 | ConfirmPassword, | 170 | ConfirmPassword, |
| 175 | CreateAdmin, | 171 | CreateAdmin, |
| @@ -184,20 +180,16 @@ pub enum Key { | |||
| 184 | OkAvatarUpdated, | 180 | OkAvatarUpdated, |
| 185 | OkAvatarRemoved, | 181 | OkAvatarRemoved, |
| 186 | OkProfileSaved, | 182 | OkProfileSaved, |
| 187 | - UsernameHint, | ||
| 188 | Avatar, | 183 | Avatar, |
| 189 | AvatarAlt, | 184 | AvatarAlt, |
| 190 | Image, | 185 | Image, |
| 191 | - AvatarHint, | ||
| 192 | Edit, | 186 | Edit, |
| 193 | UploadPhoto, | 187 | UploadPhoto, |
| 194 | RemovePhoto, | 188 | RemovePhoto, |
| 195 | About, | 189 | About, |
| 196 | - AboutHint, | ||
| 197 | Timezone, | 190 | Timezone, |
| 198 | ErrChooseImage, | 191 | ErrChooseImage, |
| 199 | DisplayName, | 192 | DisplayName, |
| 200 | - DisplayNameHint, | ||
| 201 | ErrDisplayNameControl, | 193 | ErrDisplayNameControl, |
| 202 | 194 | ||
| 203 | // Account security. | 195 | // Account security. |
| @@ -207,29 +199,21 @@ pub enum Key { | |||
| 207 | OkTwoFactorOff, | 199 | OkTwoFactorOff, |
| 208 | OkRecoveryCodesNew, | 200 | OkRecoveryCodesNew, |
| 209 | SecurityLog, | 201 | SecurityLog, |
| 210 | - SecurityLogRest, | ||
| 211 | RecoveryCodes, | 202 | RecoveryCodes, |
| 212 | RecoveryCodesSave, | 203 | RecoveryCodesSave, |
| 213 | CurrentPassword, | 204 | CurrentPassword, |
| 214 | NewPassword, | 205 | NewPassword, |
| 215 | - NewPasswordHint, | ||
| 216 | ConfirmNewPassword, | 206 | ConfirmNewPassword, |
| 217 | ChangePassword, | 207 | ChangePassword, |
| 218 | SaveEmail, | 208 | SaveEmail, |
| 219 | TwoFactorAuth, | 209 | TwoFactorAuth, |
| 220 | RegenerateCodes, | 210 | RegenerateCodes, |
| 221 | - RegenerateCodesHint, | ||
| 222 | - TurnOffTwoFactor, | ||
| 223 | TurnOffTwoFactorButton, | 211 | TurnOffTwoFactorButton, |
| 224 | - TwoFactorPendingIntro, | ||
| 225 | SecretPrefix, | 212 | SecretPrefix, |
| 226 | LinkPrefix, | 213 | LinkPrefix, |
| 227 | CodeFromApp, | 214 | CodeFromApp, |
| 228 | ConfirmAndTurnOn, | 215 | ConfirmAndTurnOn, |
| 229 | - TwoFactorOffIntro, | ||
| 230 | - Enable2fa, | ||
| 231 | DeleteAccount, | 216 | DeleteAccount, |
| 232 | - DeleteAccountIntro, | ||
| 233 | TypeUsernameToConfirm, | 217 | TypeUsernameToConfirm, |
| 234 | TransferOrDeleteRepos, | 218 | TransferOrDeleteRepos, |
| 235 | ErrConfirmUsername, | 219 | ErrConfirmUsername, |
| @@ -237,40 +221,27 @@ pub enum Key { | |||
| 237 | // SSH and GPG keys. | 221 | // SSH and GPG keys. |
| 238 | NoSshKeys, | 222 | NoSshKeys, |
| 239 | NoGpgKeys, | 223 | NoGpgKeys, |
| 240 | - AddSshKeyTitle, | ||
| 241 | - AddGpgKeyTitle, | ||
| 242 | TitleOptional, | 224 | TitleOptional, |
| 243 | PublicKeyLabel, | 225 | PublicKeyLabel, |
| 244 | - PublicKeyHint, | ||
| 245 | AddKeyButton, | 226 | AddKeyButton, |
| 246 | ArmoredPublicKeyLabel, | 227 | ArmoredPublicKeyLabel, |
| 247 | - ArmoredHint, | ||
| 248 | GpgUnavailable, | 228 | GpgUnavailable, |
| 249 | 229 | ||
| 250 | // Access tokens. | 230 | // Access tokens. |
| 251 | YourNewToken, | 231 | YourNewToken, |
| 252 | CopyNow, | 232 | CopyNow, |
| 253 | - UseAsPassword, | ||
| 254 | NoAccessTokens, | 233 | NoAccessTokens, |
| 255 | NewToken, | 234 | NewToken, |
| 256 | ExpiresIn30, | 235 | ExpiresIn30, |
| 257 | ExpiresIn90, | 236 | ExpiresIn90, |
| 258 | ExpiresIn365, | 237 | ExpiresIn365, |
| 259 | ExpiresNever, | 238 | ExpiresNever, |
| 260 | - ScopeNote, | ||
| 261 | CreateToken, | 239 | CreateToken, |
| 262 | 240 | ||
| 263 | // Web sessions. | 241 | // Web sessions. |
| 264 | UnknownBrowser, | 242 | UnknownBrowser, |
| 265 | ThisSession, | 243 | ThisSession, |
| 266 | RevokeAllOthers, | 244 | RevokeAllOthers, |
| 267 | - UserAgent, | ||
| 268 | - SignInIp, | ||
| 269 | - LastIp, | ||
| 270 | - LastSeenAt, | ||
| 271 | - ExpiresAt, | ||
| 272 | - BackToSessions, | ||
| 273 | - NotRecorded, | ||
| 274 | Close, | 245 | Close, |
| 275 | 246 | ||
| 276 | // Metadata lines (see the helpers below for the words in between). | 247 | // Metadata lines (see the helpers below for the words in between). |
| @@ -292,31 +263,23 @@ pub enum Key { | |||
| 292 | ErrKeyMismatch, | 263 | ErrKeyMismatch, |
| 293 | // Account mail pages: reset, register, verify, invites. | 264 | // Account mail pages: reset, register, verify, invites. |
| 294 | ForgotTitle, | 265 | ForgotTitle, |
| 295 | - ForgotSub, | ||
| 296 | ForgotSubmit, | 266 | ForgotSubmit, |
| 297 | ForgotSent, | 267 | ForgotSent, |
| 298 | ResetTitle, | 268 | ResetTitle, |
| 299 | - ResetSub, | ||
| 300 | ResetSubmit, | 269 | ResetSubmit, |
| 301 | ResetInvalid, | 270 | ResetInvalid, |
| 302 | ResetDone, | 271 | ResetDone, |
| 303 | RegisterTitle, | 272 | RegisterTitle, |
| 304 | - RegisterSub, | ||
| 305 | - RegisterInviteSub, | ||
| 306 | RegisterNeedsInvite, | 273 | RegisterNeedsInvite, |
| 307 | RegisterInvalidInvite, | 274 | RegisterInvalidInvite, |
| 308 | RegisterSubmit, | 275 | RegisterSubmit, |
| 309 | VerifyTitle, | 276 | VerifyTitle, |
| 310 | - VerifyConfirmSub, | ||
| 311 | VerifyConfirm, | 277 | VerifyConfirm, |
| 312 | VerifyDone, | 278 | VerifyDone, |
| 313 | VerifyInvalid, | 279 | VerifyInvalid, |
| 314 | - VerifyVerified, | ||
| 315 | - VerifyUnverified, | ||
| 316 | VerifyResend, | 280 | VerifyResend, |
| 317 | OkVerifySent, | 281 | OkVerifySent, |
| 318 | InvitesTitle, | 282 | InvitesTitle, |
| 319 | - InvitesSub, | ||
| 320 | InvitesSubmit, | 283 | InvitesSubmit, |
| 321 | InvitesSent, | 284 | InvitesSent, |
| 322 | InvitesOff, | 285 | InvitesOff, |
| @@ -338,9 +301,7 @@ pub enum Key { | |||
| 338 | MailReasonComment, | 301 | MailReasonComment, |
| 339 | MailReasonSubscribed, | 302 | MailReasonSubscribed, |
| 340 | MailReasonWatching, | 303 | MailReasonWatching, |
| 341 | - MenuNotificationEmails, | ||
| 342 | EmailNotifyLabel, | 304 | EmailNotifyLabel, |
| 343 | - EmailNotifyHelp, | ||
| 344 | EmailNotifyUnverified, | 305 | EmailNotifyUnverified, |
| 345 | EmailNotifyServerOff, | 306 | EmailNotifyServerOff, |
| 346 | EmailNotifySaved, | 307 | EmailNotifySaved, |
| @@ -348,16 +309,13 @@ pub enum Key { | |||
| 348 | PillOn, | 309 | PillOn, |
| 349 | PillOff, | 310 | PillOff, |
| 350 | PillVerified, | 311 | PillVerified, |
| 351 | - PillUnverified, | ||
| 352 | EmailNotVerified, | 312 | EmailNotVerified, |
| 353 | EmailNoAddress, | 313 | EmailNoAddress, |
| 354 | EmailMailQueued, | 314 | EmailMailQueued, |
| 355 | EmailMailFailed, | 315 | EmailMailFailed, |
| 356 | - ChangeAction, | ||
| 357 | SetUpAction, | 316 | SetUpAction, |
| 358 | SetupInProgress, | 317 | SetupInProgress, |
| 359 | DeviceName, | 318 | DeviceName, |
| 360 | - DeviceNameHint, | ||
| 361 | ErrDeviceName, | 319 | ErrDeviceName, |
| 362 | CodesRunningLow, | 320 | CodesRunningLow, |
| 363 | DangerZone, | 321 | DangerZone, |
| @@ -375,10 +333,8 @@ pub const ALL: &[Key] = &[ | |||
| 375 | Key::AccessTokens, | 333 | Key::AccessTokens, |
| 376 | Key::Sessions, | 334 | Key::Sessions, |
| 377 | Key::Security, | 335 | Key::Security, |
| 378 | - Key::BackToSite, | ||
| 379 | Key::LogOut, | 336 | Key::LogOut, |
| 380 | Key::LogIn, | 337 | Key::LogIn, |
| 381 | - Key::SiteMenu, | ||
| 382 | Key::Username, | 338 | Key::Username, |
| 383 | Key::Password, | 339 | Key::Password, |
| 384 | Key::Email, | 340 | Key::Email, |
| @@ -395,13 +351,11 @@ pub const ALL: &[Key] = &[ | |||
| 395 | Key::Remove, | 351 | Key::Remove, |
| 396 | Key::Create, | 352 | Key::Create, |
| 397 | Key::TwoFactorCheck, | 353 | Key::TwoFactorCheck, |
| 398 | - Key::TwoFactorCheckSub, | ||
| 399 | Key::ErrInvalidLogin, | 354 | Key::ErrInvalidLogin, |
| 400 | Key::ErrThrottled, | 355 | Key::ErrThrottled, |
| 401 | Key::ErrInvalidCode, | 356 | Key::ErrInvalidCode, |
| 402 | Key::Setup, | 357 | Key::Setup, |
| 403 | Key::WelcomeToForge, | 358 | Key::WelcomeToForge, |
| 404 | - Key::SetupSub, | ||
| 405 | Key::AtLeast12Chars, | 359 | Key::AtLeast12Chars, |
| 406 | Key::ConfirmPassword, | 360 | Key::ConfirmPassword, |
| 407 | Key::CreateAdmin, | 361 | Key::CreateAdmin, |
| @@ -412,20 +366,16 @@ pub const ALL: &[Key] = &[ | |||
| 412 | Key::OkAvatarUpdated, | 366 | Key::OkAvatarUpdated, |
| 413 | Key::OkAvatarRemoved, | 367 | Key::OkAvatarRemoved, |
| 414 | Key::OkProfileSaved, | 368 | Key::OkProfileSaved, |
| 415 | - Key::UsernameHint, | ||
| 416 | Key::Avatar, | 369 | Key::Avatar, |
| 417 | Key::AvatarAlt, | 370 | Key::AvatarAlt, |
| 418 | Key::Image, | 371 | Key::Image, |
| 419 | - Key::AvatarHint, | ||
| 420 | Key::Edit, | 372 | Key::Edit, |
| 421 | Key::UploadPhoto, | 373 | Key::UploadPhoto, |
| 422 | Key::RemovePhoto, | 374 | Key::RemovePhoto, |
| 423 | Key::About, | 375 | Key::About, |
| 424 | - Key::AboutHint, | ||
| 425 | Key::Timezone, | 376 | Key::Timezone, |
| 426 | Key::ErrChooseImage, | 377 | Key::ErrChooseImage, |
| 427 | Key::DisplayName, | 378 | Key::DisplayName, |
| 428 | - Key::DisplayNameHint, | ||
| 429 | Key::ErrDisplayNameControl, | 379 | Key::ErrDisplayNameControl, |
| 430 | Key::OkPasswordChanged, | 380 | Key::OkPasswordChanged, |
| 431 | Key::OkEmailSaved, | 381 | Key::OkEmailSaved, |
| @@ -433,64 +383,43 @@ pub const ALL: &[Key] = &[ | |||
| 433 | Key::OkTwoFactorOff, | 383 | Key::OkTwoFactorOff, |
| 434 | Key::OkRecoveryCodesNew, | 384 | Key::OkRecoveryCodesNew, |
| 435 | Key::SecurityLog, | 385 | Key::SecurityLog, |
| 436 | - Key::SecurityLogRest, | ||
| 437 | Key::RecoveryCodes, | 386 | Key::RecoveryCodes, |
| 438 | Key::RecoveryCodesSave, | 387 | Key::RecoveryCodesSave, |
| 439 | Key::CurrentPassword, | 388 | Key::CurrentPassword, |
| 440 | Key::NewPassword, | 389 | Key::NewPassword, |
| 441 | - Key::NewPasswordHint, | ||
| 442 | Key::ConfirmNewPassword, | 390 | Key::ConfirmNewPassword, |
| 443 | Key::ChangePassword, | 391 | Key::ChangePassword, |
| 444 | Key::SaveEmail, | 392 | Key::SaveEmail, |
| 445 | Key::TwoFactorAuth, | 393 | Key::TwoFactorAuth, |
| 446 | Key::RegenerateCodes, | 394 | Key::RegenerateCodes, |
| 447 | - Key::RegenerateCodesHint, | ||
| 448 | - Key::TurnOffTwoFactor, | ||
| 449 | Key::TurnOffTwoFactorButton, | 395 | Key::TurnOffTwoFactorButton, |
| 450 | - Key::TwoFactorPendingIntro, | ||
| 451 | Key::SecretPrefix, | 396 | Key::SecretPrefix, |
| 452 | Key::LinkPrefix, | 397 | Key::LinkPrefix, |
| 453 | Key::CodeFromApp, | 398 | Key::CodeFromApp, |
| 454 | Key::ConfirmAndTurnOn, | 399 | Key::ConfirmAndTurnOn, |
| 455 | - Key::TwoFactorOffIntro, | ||
| 456 | - Key::Enable2fa, | ||
| 457 | Key::DeleteAccount, | 400 | Key::DeleteAccount, |
| 458 | - Key::DeleteAccountIntro, | ||
| 459 | Key::TypeUsernameToConfirm, | 401 | Key::TypeUsernameToConfirm, |
| 460 | Key::TransferOrDeleteRepos, | 402 | Key::TransferOrDeleteRepos, |
| 461 | Key::ErrConfirmUsername, | 403 | Key::ErrConfirmUsername, |
| 462 | Key::NoSshKeys, | 404 | Key::NoSshKeys, |
| 463 | Key::NoGpgKeys, | 405 | Key::NoGpgKeys, |
| 464 | - Key::AddSshKeyTitle, | ||
| 465 | - Key::AddGpgKeyTitle, | ||
| 466 | Key::TitleOptional, | 406 | Key::TitleOptional, |
| 467 | Key::PublicKeyLabel, | 407 | Key::PublicKeyLabel, |
| 468 | - Key::PublicKeyHint, | ||
| 469 | Key::AddKeyButton, | 408 | Key::AddKeyButton, |
| 470 | Key::ArmoredPublicKeyLabel, | 409 | Key::ArmoredPublicKeyLabel, |
| 471 | - Key::ArmoredHint, | ||
| 472 | Key::GpgUnavailable, | 410 | Key::GpgUnavailable, |
| 473 | Key::YourNewToken, | 411 | Key::YourNewToken, |
| 474 | Key::CopyNow, | 412 | Key::CopyNow, |
| 475 | - Key::UseAsPassword, | ||
| 476 | Key::NoAccessTokens, | 413 | Key::NoAccessTokens, |
| 477 | Key::NewToken, | 414 | Key::NewToken, |
| 478 | Key::ExpiresIn30, | 415 | Key::ExpiresIn30, |
| 479 | Key::ExpiresIn90, | 416 | Key::ExpiresIn90, |
| 480 | Key::ExpiresIn365, | 417 | Key::ExpiresIn365, |
| 481 | Key::ExpiresNever, | 418 | Key::ExpiresNever, |
| 482 | - Key::ScopeNote, | ||
| 483 | Key::CreateToken, | 419 | Key::CreateToken, |
| 484 | Key::UnknownBrowser, | 420 | Key::UnknownBrowser, |
| 485 | Key::ThisSession, | 421 | Key::ThisSession, |
| 486 | Key::RevokeAllOthers, | 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 | Key::Close, | 423 | Key::Close, |
| 495 | Key::Added, | 424 | Key::Added, |
| 496 | Key::LastUsed, | 425 | Key::LastUsed, |
| @@ -507,31 +436,23 @@ pub const ALL: &[Key] = &[ | |||
| 507 | Key::ErrKeyTruncated, | 436 | Key::ErrKeyTruncated, |
| 508 | Key::ErrKeyMismatch, | 437 | Key::ErrKeyMismatch, |
| 509 | Key::ForgotTitle, | 438 | Key::ForgotTitle, |
| 510 | - Key::ForgotSub, | ||
| 511 | Key::ForgotSubmit, | 439 | Key::ForgotSubmit, |
| 512 | Key::ForgotSent, | 440 | Key::ForgotSent, |
| 513 | Key::ResetTitle, | 441 | Key::ResetTitle, |
| 514 | - Key::ResetSub, | ||
| 515 | Key::ResetSubmit, | 442 | Key::ResetSubmit, |
| 516 | Key::ResetInvalid, | 443 | Key::ResetInvalid, |
| 517 | Key::ResetDone, | 444 | Key::ResetDone, |
| 518 | Key::RegisterTitle, | 445 | Key::RegisterTitle, |
| 519 | - Key::RegisterSub, | ||
| 520 | - Key::RegisterInviteSub, | ||
| 521 | Key::RegisterNeedsInvite, | 446 | Key::RegisterNeedsInvite, |
| 522 | Key::RegisterInvalidInvite, | 447 | Key::RegisterInvalidInvite, |
| 523 | Key::RegisterSubmit, | 448 | Key::RegisterSubmit, |
| 524 | Key::VerifyTitle, | 449 | Key::VerifyTitle, |
| 525 | - Key::VerifyConfirmSub, | ||
| 526 | Key::VerifyConfirm, | 450 | Key::VerifyConfirm, |
| 527 | Key::VerifyDone, | 451 | Key::VerifyDone, |
| 528 | Key::VerifyInvalid, | 452 | Key::VerifyInvalid, |
| 529 | - Key::VerifyVerified, | ||
| 530 | - Key::VerifyUnverified, | ||
| 531 | Key::VerifyResend, | 453 | Key::VerifyResend, |
| 532 | Key::OkVerifySent, | 454 | Key::OkVerifySent, |
| 533 | Key::InvitesTitle, | 455 | Key::InvitesTitle, |
| 534 | - Key::InvitesSub, | ||
| 535 | Key::InvitesSubmit, | 456 | Key::InvitesSubmit, |
| 536 | Key::InvitesSent, | 457 | Key::InvitesSent, |
| 537 | Key::InvitesOff, | 458 | Key::InvitesOff, |
| @@ -553,9 +474,7 @@ pub const ALL: &[Key] = &[ | |||
| 553 | Key::MailReasonComment, | 474 | Key::MailReasonComment, |
| 554 | Key::MailReasonSubscribed, | 475 | Key::MailReasonSubscribed, |
| 555 | Key::MailReasonWatching, | 476 | Key::MailReasonWatching, |
| 556 | - Key::MenuNotificationEmails, | ||
| 557 | Key::EmailNotifyLabel, | 477 | Key::EmailNotifyLabel, |
| 558 | - Key::EmailNotifyHelp, | ||
| 559 | Key::EmailNotifyUnverified, | 478 | Key::EmailNotifyUnverified, |
| 560 | Key::EmailNotifyServerOff, | 479 | Key::EmailNotifyServerOff, |
| 561 | Key::EmailNotifySaved, | 480 | Key::EmailNotifySaved, |
| @@ -563,16 +482,13 @@ pub const ALL: &[Key] = &[ | |||
| 563 | Key::PillOn, | 482 | Key::PillOn, |
| 564 | Key::PillOff, | 483 | Key::PillOff, |
| 565 | Key::PillVerified, | 484 | Key::PillVerified, |
| 566 | - Key::PillUnverified, | ||
| 567 | Key::EmailNotVerified, | 485 | Key::EmailNotVerified, |
| 568 | Key::EmailNoAddress, | 486 | Key::EmailNoAddress, |
| 569 | Key::EmailMailQueued, | 487 | Key::EmailMailQueued, |
| 570 | Key::EmailMailFailed, | 488 | Key::EmailMailFailed, |
| 571 | - Key::ChangeAction, | ||
| 572 | Key::SetUpAction, | 489 | Key::SetUpAction, |
| 573 | Key::SetupInProgress, | 490 | Key::SetupInProgress, |
| 574 | Key::DeviceName, | 491 | Key::DeviceName, |
| 575 | - Key::DeviceNameHint, | ||
| 576 | Key::ErrDeviceName, | 492 | Key::ErrDeviceName, |
| 577 | Key::CodesRunningLow, | 493 | Key::CodesRunningLow, |
| 578 | Key::DangerZone, | 494 | Key::DangerZone, |
| @@ -601,12 +517,8 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 601 | (Sessions, Tr) => "Oturumlar", | 517 | (Sessions, Tr) => "Oturumlar", |
| 602 | (Security, En) => "Security", | 518 | (Security, En) => "Security", |
| 603 | (Security, Tr) => "Güvenlik", | 519 | (Security, Tr) => "Güvenlik", |
| 604 | - (BackToSite, En) => "Back to forge", | ||
| 605 | - (BackToSite, Tr) => "Forge'a dön", | ||
| 606 | (LogOut, En) => "Log out", | 520 | (LogOut, En) => "Log out", |
| 607 | (LogOut, Tr) => "Çıkış yap", | 521 | (LogOut, Tr) => "Çıkış yap", |
| 608 | - (SiteMenu, En) => "Menu", | ||
| 609 | - (SiteMenu, Tr) => "Menü", | ||
| 610 | (LogIn, En) => "Log in", | 522 | (LogIn, En) => "Log in", |
| 611 | (LogIn, Tr) => "Giriş yap", | 523 | (LogIn, Tr) => "Giriş yap", |
| 612 | 524 | ||
| @@ -643,12 +555,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 643 | 555 | ||
| 644 | (TwoFactorCheck, En) => "Two-factor check", | 556 | (TwoFactorCheck, En) => "Two-factor check", |
| 645 | (TwoFactorCheck, Tr) => "İki faktörlü doğrulama", | 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 | (ErrInvalidLogin, En) => "invalid username or password", | 558 | (ErrInvalidLogin, En) => "invalid username or password", |
| 653 | (ErrInvalidLogin, Tr) => "Kullanıcı adı ya da parola yanlış.", | 559 | (ErrInvalidLogin, Tr) => "Kullanıcı adı ya da parola yanlış.", |
| 654 | (ErrThrottled, En) => "Too many attempts. Try again later.", | 560 | (ErrThrottled, En) => "Too many attempts. Try again later.", |
| @@ -664,10 +570,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 664 | (Setup, Tr) => "Kurulum", | 570 | (Setup, Tr) => "Kurulum", |
| 665 | (WelcomeToForge, En) => "Welcome to forge", | 571 | (WelcomeToForge, En) => "Welcome to forge", |
| 666 | (WelcomeToForge, Tr) => "forge'a hoş geldiniz", | 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 | (AtLeast12Chars, En) => "At least 12 characters.", | 573 | (AtLeast12Chars, En) => "At least 12 characters.", |
| 672 | (AtLeast12Chars, Tr) => "En az 12 karakter.", | 574 | (AtLeast12Chars, Tr) => "En az 12 karakter.", |
| 673 | (ConfirmPassword, En) => "Confirm password", | 575 | (ConfirmPassword, En) => "Confirm password", |
| @@ -698,24 +600,12 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 698 | (OkAvatarRemoved, Tr) => "Avatar kaldırıldı.", | 600 | (OkAvatarRemoved, Tr) => "Avatar kaldırıldı.", |
| 699 | (OkProfileSaved, En) => "Profile saved.", | 601 | (OkProfileSaved, En) => "Profile saved.", |
| 700 | (OkProfileSaved, Tr) => "Profil kaydedildi.", | 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 | (Avatar, En) => "Avatar", | 603 | (Avatar, En) => "Avatar", |
| 708 | (Avatar, Tr) => "Avatar", | 604 | (Avatar, Tr) => "Avatar", |
| 709 | (AvatarAlt, En) => "Your avatar", | 605 | (AvatarAlt, En) => "Your avatar", |
| 710 | (AvatarAlt, Tr) => "Avatarınız", | 606 | (AvatarAlt, Tr) => "Avatarınız", |
| 711 | (Image, En) => "Image", | 607 | (Image, En) => "Image", |
| 712 | (Image, Tr) => "Görsel", | 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 | (Edit, En) => "Edit", | 609 | (Edit, En) => "Edit", |
| 720 | (Edit, Tr) => "Düzenle", | 610 | (Edit, Tr) => "Düzenle", |
| 721 | (UploadPhoto, En) => "Upload a photo…", | 611 | (UploadPhoto, En) => "Upload a photo…", |
| @@ -724,16 +614,12 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 724 | (RemovePhoto, Tr) => "Fotoğrafı kaldır", | 614 | (RemovePhoto, Tr) => "Fotoğrafı kaldır", |
| 725 | (About, En) => "About", | 615 | (About, En) => "About", |
| 726 | (About, Tr) => "Hakkında", | 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 | (Timezone, En) => "Timezone", | 617 | (Timezone, En) => "Timezone", |
| 730 | (Timezone, Tr) => "Saat dilimi", | 618 | (Timezone, Tr) => "Saat dilimi", |
| 731 | (ErrChooseImage, En) => "Choose an image to upload.", | 619 | (ErrChooseImage, En) => "Choose an image to upload.", |
| 732 | (ErrChooseImage, Tr) => "Yüklemek için bir görsel seçin.", | 620 | (ErrChooseImage, Tr) => "Yüklemek için bir görsel seçin.", |
| 733 | (DisplayName, En) => "Name", | 621 | (DisplayName, En) => "Name", |
| 734 | (DisplayName, Tr) => "Ad", | 622 | (DisplayName, Tr) => "Ad", |
| 735 | - (DisplayNameHint, En) => "Optional. Shown on your profile.", | ||
| 736 | - (DisplayNameHint, Tr) => "İsteğe bağlı. Profilinizde gösterilir.", | ||
| 737 | (ErrDisplayNameControl, En) => { | 623 | (ErrDisplayNameControl, En) => { |
| 738 | "The name must not contain line breaks or control characters." | 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 | (OkRecoveryCodesNew, Tr) => "Yeni kurtarma kodları oluşturuldu. Eskileri artık çalışmaz.", | 637 | (OkRecoveryCodesNew, Tr) => "Yeni kurtarma kodları oluşturuldu. Eskileri artık çalışmaz.", |
| 752 | (SecurityLog, En) => "Security log", | 638 | (SecurityLog, En) => "Security log", |
| 753 | (SecurityLog, Tr) => "Güvenlik günlüğü", | 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 | (RecoveryCodes, En) => "Recovery codes", | 640 | (RecoveryCodes, En) => "Recovery codes", |
| 757 | (RecoveryCodes, Tr) => "Kurtarma kodları", | 641 | (RecoveryCodes, Tr) => "Kurtarma kodları", |
| 758 | - (RecoveryCodesSave, En) => { | 642 | + (RecoveryCodesSave, En) => "Shown once.", |
| 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." | 643 | + (RecoveryCodesSave, Tr) => "Yalnızca bir kez gösterilir.", |
| 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 | - } | ||
| 764 | (CurrentPassword, En) => "Current password", | 644 | (CurrentPassword, En) => "Current password", |
| 765 | (CurrentPassword, Tr) => "Mevcut parola", | 645 | (CurrentPassword, Tr) => "Mevcut parola", |
| 766 | (NewPassword, En) => "New password", | 646 | (NewPassword, En) => "New password", |
| 767 | (NewPassword, Tr) => "Yeni parola", | 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 | (ConfirmNewPassword, En) => "Confirm new password", | 648 | (ConfirmNewPassword, En) => "Confirm new password", |
| 771 | (ConfirmNewPassword, Tr) => "Yeni parolayı doğrula", | 649 | (ConfirmNewPassword, Tr) => "Yeni parolayı doğrula", |
| 772 | (ChangePassword, En) => "Change password", | 650 | (ChangePassword, En) => "Change password", |
| @@ -777,22 +655,8 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 777 | (TwoFactorAuth, Tr) => "İki faktörlü kimlik doğrulama", | 655 | (TwoFactorAuth, Tr) => "İki faktörlü kimlik doğrulama", |
| 778 | (RegenerateCodes, En) => "Regenerate recovery codes", | 656 | (RegenerateCodes, En) => "Regenerate recovery codes", |
| 779 | (RegenerateCodes, Tr) => "Kurtarma kodlarını yenile", | 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 | (TurnOffTwoFactorButton, En) => "Turn off two-factor", | 658 | (TurnOffTwoFactorButton, En) => "Turn off two-factor", |
| 789 | (TurnOffTwoFactorButton, Tr) => "İki faktörlüyü kapat", | 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 | (SecretPrefix, En) => "Secret: ", | 660 | (SecretPrefix, En) => "Secret: ", |
| 797 | (SecretPrefix, Tr) => "Anahtar: ", | 661 | (SecretPrefix, Tr) => "Anahtar: ", |
| 798 | (LinkPrefix, En) => "Link: ", | 662 | (LinkPrefix, En) => "Link: ", |
| @@ -801,22 +665,8 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 801 | (CodeFromApp, Tr) => "Uygulamadaki kod", | 665 | (CodeFromApp, Tr) => "Uygulamadaki kod", |
| 802 | (ConfirmAndTurnOn, En) => "Confirm and turn on", | 666 | (ConfirmAndTurnOn, En) => "Confirm and turn on", |
| 803 | (ConfirmAndTurnOn, Tr) => "Doğrula ve aç", | 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 | (DeleteAccount, En) => "Delete account", | 668 | (DeleteAccount, En) => "Delete account", |
| 813 | (DeleteAccount, Tr) => "Hesabı sil", | 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 | (TypeUsernameToConfirm, En) => "Type your username to confirm", | 670 | (TypeUsernameToConfirm, En) => "Type your username to confirm", |
| 821 | (TypeUsernameToConfirm, Tr) => "Onaylamak için kullanıcı adınızı yazın", | 671 | (TypeUsernameToConfirm, Tr) => "Onaylamak için kullanıcı adınızı yazın", |
| 822 | (TransferOrDeleteRepos, En) => { | 672 | (TransferOrDeleteRepos, En) => { |
| @@ -830,39 +680,21 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 830 | (NoSshKeys, Tr) => "Henüz SSH anahtarı yok. SSH ile göndermek için bir tane ekleyin.", | 680 | (NoSshKeys, Tr) => "Henüz SSH anahtarı yok. SSH ile göndermek için bir tane ekleyin.", |
| 831 | (NoGpgKeys, En) => "No GPG keys yet.", | 681 | (NoGpgKeys, En) => "No GPG keys yet.", |
| 832 | (NoGpgKeys, Tr) => "Henüz GPG anahtarı yok.", | 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 | (TitleOptional, En) => "Title (optional)", | 683 | (TitleOptional, En) => "Title (optional)", |
| 838 | (TitleOptional, Tr) => "Başlık (isteğe bağlı)", | 684 | (TitleOptional, Tr) => "Başlık (isteğe bağlı)", |
| 839 | (PublicKeyLabel, En) => "Public key", | 685 | (PublicKeyLabel, En) => "Public key", |
| 840 | (PublicKeyLabel, Tr) => "Ortak anahtar", | 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 | (AddKeyButton, En) => "Add key", | 687 | (AddKeyButton, En) => "Add key", |
| 846 | (AddKeyButton, Tr) => "Anahtar ekle", | 688 | (AddKeyButton, Tr) => "Anahtar ekle", |
| 847 | (ArmoredPublicKeyLabel, En) => "Public key (ASCII armored)", | 689 | (ArmoredPublicKeyLabel, En) => "Public key (ASCII armored)", |
| 848 | (ArmoredPublicKeyLabel, Tr) => "Ortak anahtar (ASCII zırhlı)", | 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 | (GpgUnavailable, En) => "GPG verification is unavailable on this server", | 691 | (GpgUnavailable, En) => "GPG verification is unavailable on this server", |
| 854 | (GpgUnavailable, Tr) => "GPG doğrulaması bu sunucuda kullanılamıyor", | 692 | (GpgUnavailable, Tr) => "GPG doğrulaması bu sunucuda kullanılamıyor", |
| 855 | 693 | ||
| 856 | (YourNewToken, En) => "Your new token", | 694 | (YourNewToken, En) => "Your new token", |
| 857 | (YourNewToken, Tr) => "Yeni belirteciniz", | 695 | (YourNewToken, Tr) => "Yeni belirteciniz", |
| 858 | - (CopyNow, En) => "Copy it now. It is shown only once and cannot be recovered later.", | 696 | + (CopyNow, En) => "Shown once.", |
| 859 | - (CopyNow, Tr) => "Şimdi kopyalayın. Yalnızca bir kez gösterilir ve sonradan geri alınamaz.", | 697 | + (CopyNow, Tr) => "Yalnızca bir kez gösterilir.", |
| 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 | - } | ||
| 866 | (NoAccessTokens, En) => "No access tokens yet.", | 698 | (NoAccessTokens, En) => "No access tokens yet.", |
| 867 | (NoAccessTokens, Tr) => "Henüz erişim belirteci yok.", | 699 | (NoAccessTokens, Tr) => "Henüz erişim belirteci yok.", |
| 868 | (NewToken, En) => "New token", | 700 | (NewToken, En) => "New token", |
| @@ -875,8 +707,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 875 | (ExpiresIn365, Tr) => "365 gün sonra", | 707 | (ExpiresIn365, Tr) => "365 gün sonra", |
| 876 | (ExpiresNever, En) => "Never", | 708 | (ExpiresNever, En) => "Never", |
| 877 | (ExpiresNever, Tr) => "Hiçbir zaman", | 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 | (CreateToken, En) => "Create token", | 710 | (CreateToken, En) => "Create token", |
| 881 | (CreateToken, Tr) => "Belirteç oluştur", | 711 | (CreateToken, Tr) => "Belirteç oluştur", |
| 882 | 712 | ||
| @@ -884,20 +714,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 884 | (UnknownBrowser, Tr) => "Bilinmeyen tarayıcı", | 714 | (UnknownBrowser, Tr) => "Bilinmeyen tarayıcı", |
| 885 | (ThisSession, En) => "This session", | 715 | (ThisSession, En) => "This session", |
| 886 | (ThisSession, Tr) => "Bu oturum", | 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 | (Close, En) => "Close", | 717 | (Close, En) => "Close", |
| 902 | (Close, Tr) => "Kapat", | 718 | (Close, Tr) => "Kapat", |
| 903 | (RevokeAllOthers, En) => "Revoke all other sessions", | 719 | (RevokeAllOthers, En) => "Revoke all other sessions", |
| @@ -938,12 +754,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 938 | (ErrKeyMismatch, Tr) => "Anahtar gövdesi anahtar türüyle eşleşmiyor.", | 754 | (ErrKeyMismatch, Tr) => "Anahtar gövdesi anahtar türüyle eşleşmiyor.", |
| 939 | (ForgotTitle, En) => "Forgot password", | 755 | (ForgotTitle, En) => "Forgot password", |
| 940 | (ForgotTitle, Tr) => "Parolamı unuttum", | 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 | (ForgotSubmit, En) => "Send reset link", | 757 | (ForgotSubmit, En) => "Send reset link", |
| 948 | (ForgotSubmit, Tr) => "Sıfırlama bağlantısı gönder", | 758 | (ForgotSubmit, Tr) => "Sıfırlama bağlantısı gönder", |
| 949 | (ForgotSent, En) => { | 759 | (ForgotSent, En) => { |
| @@ -954,10 +764,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 954 | } | 764 | } |
| 955 | (ResetTitle, En) => "Set a new password", | 765 | (ResetTitle, En) => "Set a new password", |
| 956 | (ResetTitle, Tr) => "Yeni parola belirle", | 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 | (ResetSubmit, En) => "Save new password", | 767 | (ResetSubmit, En) => "Save new password", |
| 962 | (ResetSubmit, Tr) => "Yeni parolayı kaydet", | 768 | (ResetSubmit, Tr) => "Yeni parolayı kaydet", |
| 963 | (ResetInvalid, En) => "This reset link is invalid, used or expired. Request a new one.", | 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 | (RegisterTitle, En) => "Create an account", | 779 | (RegisterTitle, En) => "Create an account", |
| 974 | (RegisterTitle, Tr) => "Hesap oluştur", | 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 | (RegisterNeedsInvite, En) => { | 781 | (RegisterNeedsInvite, En) => { |
| 988 | "Registration is by invitation only. Ask an admin for an invite link." | 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 | (RegisterSubmit, Tr) => "Hesap oluştur", | 792 | (RegisterSubmit, Tr) => "Hesap oluştur", |
| 999 | (VerifyTitle, En) => "Confirm your email", | 793 | (VerifyTitle, En) => "Confirm your email", |
| 1000 | (VerifyTitle, Tr) => "E-posta adresini doğrula", | 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 | (VerifyConfirm, En) => "Confirm address", | 795 | (VerifyConfirm, En) => "Confirm address", |
| 1004 | (VerifyConfirm, Tr) => "Adresi doğrula", | 796 | (VerifyConfirm, Tr) => "Adresi doğrula", |
| 1005 | (VerifyDone, En) => "Your email address is verified.", | 797 | (VerifyDone, En) => "Your email address is verified.", |
| 1006 | (VerifyDone, Tr) => "E-posta adresin doğrulandı.", | 798 | (VerifyDone, Tr) => "E-posta adresin doğrulandı.", |
| 1007 | (VerifyInvalid, En) => "This verification link is invalid, used or expired.", | 799 | (VerifyInvalid, En) => "This verification link is invalid, used or expired.", |
| 1008 | (VerifyInvalid, Tr) => "Bu doğrulama bağlantısı geçersiz, kullanılmış ya da süresi dolmuş.", | 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 | (VerifyResend, En) => "Send the verification link again", | 801 | (VerifyResend, En) => "Send the verification link again", |
| 1018 | (VerifyResend, Tr) => "Doğrulama bağlantısını yeniden gönder", | 802 | (VerifyResend, Tr) => "Doğrulama bağlantısını yeniden gönder", |
| 1019 | (OkVerifySent, En) => "We sent a verification link to your address.", | 803 | (OkVerifySent, En) => "We sent a verification link to your address.", |
| 1020 | (OkVerifySent, Tr) => "Adresinize bir doğrulama bağlantısı gönderildi.", | 804 | (OkVerifySent, Tr) => "Adresinize bir doğrulama bağlantısı gönderildi.", |
| 1021 | (InvitesTitle, En) => "Invite someone", | 805 | (InvitesTitle, En) => "Invite someone", |
| 1022 | (InvitesTitle, Tr) => "Birini davet et", | 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 | (InvitesSubmit, En) => "Send invite", | 807 | (InvitesSubmit, En) => "Send invite", |
| 1030 | (InvitesSubmit, Tr) => "Davet gönder", | 808 | (InvitesSubmit, Tr) => "Davet gönder", |
| 1031 | (InvitesSent, En) => "The invite was sent.", | 809 | (InvitesSent, En) => "The invite was sent.", |
| @@ -1055,11 +833,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 1055 | (MailReasonComment, En) => "you commented on it", | 833 | (MailReasonComment, En) => "you commented on it", |
| 1056 | (MailReasonSubscribed, En) => "you are subscribed to it", | 834 | (MailReasonSubscribed, En) => "you are subscribed to it", |
| 1057 | (MailReasonWatching, En) => "you watch this repository", | 835 | (MailReasonWatching, En) => "you watch this repository", |
| 1058 | - (MenuNotificationEmails, En) => "Notifications", | ||
| 1059 | (EmailNotifyLabel, En) => "Email me about notifications", | 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 | (EmailNotifyUnverified, En) => { | 837 | (EmailNotifyUnverified, En) => { |
| 1064 | "Verify your email address first. Only verified addresses get notification emails." | 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 | (MailReasonComment, Tr) => "bunda yorum yaptınız", | 858 | (MailReasonComment, Tr) => "bunda yorum yaptınız", |
| 1085 | (MailReasonSubscribed, Tr) => "bunu takip ediyorsunuz", | 859 | (MailReasonSubscribed, Tr) => "bunu takip ediyorsunuz", |
| 1086 | (MailReasonWatching, Tr) => "bu depoyu izliyorsunuz", | 860 | (MailReasonWatching, Tr) => "bu depoyu izliyorsunuz", |
| 1087 | - (MenuNotificationEmails, Tr) => "Bildirimler", | ||
| 1088 | (EmailNotifyLabel, Tr) => "Bildirimler hakkında bana e-posta gönder", | 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 | (EmailNotifyUnverified, Tr) => { | 862 | (EmailNotifyUnverified, Tr) => { |
| 1093 | "Önce e-posta adresinizi doğrulayın. Bildirim e-postaları yalnızca doğrulanmış adreslere gönderilir." | 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 | (PillOff, Tr) => "Kapalı", | 874 | (PillOff, Tr) => "Kapalı", |
| 1105 | (PillVerified, En) => "Verified", | 875 | (PillVerified, En) => "Verified", |
| 1106 | (PillVerified, Tr) => "Doğrulandı", | 876 | (PillVerified, Tr) => "Doğrulandı", |
| 1107 | - (PillUnverified, En) => "Unverified", | ||
| 1108 | - (PillUnverified, Tr) => "Doğrulanmadı", | ||
| 1109 | (EmailNotVerified, En) => "Not verified", | 877 | (EmailNotVerified, En) => "Not verified", |
| 1110 | (EmailNotVerified, Tr) => "Doğrulanmadı", | 878 | (EmailNotVerified, Tr) => "Doğrulanmadı", |
| 1111 | (EmailNoAddress, En) => "No email address", | 879 | (EmailNoAddress, En) => "No email address", |
| @@ -1114,18 +882,12 @@ pub fn t(lang: Lang, key: Key) -> &'static str { | |||
| 1114 | (EmailMailQueued, Tr) => "doğrulama iletisi kuyrukta", | 882 | (EmailMailQueued, Tr) => "doğrulama iletisi kuyrukta", |
| 1115 | (EmailMailFailed, En) => "verification mail failed", | 883 | (EmailMailFailed, En) => "verification mail failed", |
| 1116 | (EmailMailFailed, Tr) => "doğrulama iletisi başarısız", | 884 | (EmailMailFailed, Tr) => "doğrulama iletisi başarısız", |
| 1117 | - (ChangeAction, En) => "Change", | ||
| 1118 | - (ChangeAction, Tr) => "Değiştir", | ||
| 1119 | (SetUpAction, En) => "Set up", | 885 | (SetUpAction, En) => "Set up", |
| 1120 | (SetUpAction, Tr) => "Kur", | 886 | (SetUpAction, Tr) => "Kur", |
| 1121 | (SetupInProgress, En) => "Setup in progress", | 887 | (SetupInProgress, En) => "Setup in progress", |
| 1122 | (SetupInProgress, Tr) => "Kurulum sürüyor", | 888 | (SetupInProgress, Tr) => "Kurulum sürüyor", |
| 1123 | (DeviceName, En) => "Device name (optional)", | 889 | (DeviceName, En) => "Device name (optional)", |
| 1124 | (DeviceName, Tr) => "Cihaz adı (isteğe bağlı)", | 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 | (ErrDeviceName, En) => { | 891 | (ErrDeviceName, En) => { |
| 1130 | "Use at most 40 characters for the device name, without line breaks." | 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 | (AllMentions, Tr) => "Tüm bahsetmeler", | 73 | (AllMentions, Tr) => "Tüm bahsetmeler", |
| 74 | (BackToNeedsYou, En) => "Back to Needs you", | 74 | (BackToNeedsYou, En) => "Back to Needs you", |
| 75 | (BackToNeedsYou, Tr) => "Sizi bekleyenlere dön", | 75 | (BackToNeedsYou, Tr) => "Sizi bekleyenlere dön", |
| 76 | - (AllClear, En) => "Nothing is waiting on you.", | 76 | + (AllClear, En) => "Nothing waiting.", |
| 77 | (AllClear, Tr) => "Sizi bekleyen bir şey yok.", | 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 | NewRepository, | 44 | NewRepository, |
| 45 | // Organization creation. | 45 | // Organization creation. |
| 46 | NewOrganization, | 46 | NewOrganization, |
| 47 | - NewOrgIntro, | ||
| 48 | OrgName, | 47 | OrgName, |
| 49 | DescriptionOptional, | 48 | DescriptionOptional, |
| 50 | CreateOrg, | 49 | CreateOrg, |
| 51 | // Organization settings. | 50 | // Organization settings. |
| 52 | Settings, | 51 | Settings, |
| 53 | General, | 52 | General, |
| 54 | - BackToOrganization, | ||
| 55 | Description, | 53 | Description, |
| 56 | DisplayNameLabel, | 54 | DisplayNameLabel, |
| 57 | DefaultRoleLabel, | 55 | DefaultRoleLabel, |
| 58 | - DefaultRoleHelp, | ||
| 59 | MembersCanCreate, | 56 | MembersCanCreate, |
| 60 | SaveSettings, | 57 | SaveSettings, |
| 61 | DeleteOrg, | 58 | DeleteOrg, |
| 62 | - DeleteOrgIntro, | ||
| 63 | // Members. | 59 | // Members. |
| 64 | Members, | 60 | Members, |
| 65 | Teams, | 61 | Teams, |
| 66 | Organization, | 62 | Organization, |
| 67 | ViewAllMembers, | 63 | ViewAllMembers, |
| 68 | - MemberHeader, | ||
| 69 | Role, | 64 | Role, |
| 70 | RoleOwner, | 65 | RoleOwner, |
| 71 | RoleMember, | 66 | RoleMember, |
| 72 | Leave, | 67 | Leave, |
| 73 | - AddMember, | ||
| 74 | AddMemberButton, | 68 | AddMemberButton, |
| 75 | - OwnersHelp, | ||
| 76 | // Teams. | 69 | // Teams. |
| 77 | - TeamsIntro, | ||
| 78 | NoTeamsYet, | 70 | NoTeamsYet, |
| 79 | - NewTeam, | ||
| 80 | CoversAllRepos, | 71 | CoversAllRepos, |
| 81 | CreateTeam, | 72 | CreateTeam, |
| 82 | SaveTeam, | 73 | SaveTeam, |
| @@ -101,7 +92,6 @@ pub enum K { | |||
| 101 | Pages, | 92 | Pages, |
| 102 | Previous, | 93 | Previous, |
| 103 | Next, | 94 | Next, |
| 104 | - PublicReposIntro, | ||
| 105 | Organizations, | 95 | Organizations, |
| 106 | SearchPublicRepos, | 96 | SearchPublicRepos, |
| 107 | Search, | 97 | Search, |
| @@ -119,10 +109,8 @@ pub enum K { | |||
| 119 | Pinned, | 109 | Pinned, |
| 120 | PopularRepos, | 110 | PopularRepos, |
| 121 | CustomizePins, | 111 | CustomizePins, |
| 122 | - PinsIntro, | ||
| 123 | SavePins, | 112 | SavePins, |
| 124 | PinsTooMany, | 113 | PinsTooMany, |
| 125 | - NoPinnableRepos, | ||
| 126 | TabOverview, | 114 | TabOverview, |
| 127 | TabStars, | 115 | TabStars, |
| 128 | FilterRepos, | 116 | FilterRepos, |
| @@ -130,7 +118,6 @@ pub enum K { | |||
| 130 | ClearSearch, | 118 | ClearSearch, |
| 131 | // Landing. | 119 | // Landing. |
| 132 | Home, | 120 | Home, |
| 133 | - LandingTagline, | ||
| 134 | LogIn, | 121 | LogIn, |
| 135 | SetUpForge, | 122 | SetUpForge, |
| 136 | } | 123 | } |
| @@ -217,16 +204,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 217 | (NewOrganization, Tr) => "Yeni kuruluş", | 204 | (NewOrganization, Tr) => "Yeni kuruluş", |
| 218 | (General, En) => "General", | 205 | (General, En) => "General", |
| 219 | (General, Tr) => "Genel", | 206 | (General, Tr) => "Genel", |
| 220 | - (BackToOrganization, En) => "Back to organization", | ||
| 221 | - (BackToOrganization, Tr) => "Kuruluşa dön", | ||
| 222 | (ViewAllMembers, En) => "View all", | 207 | (ViewAllMembers, En) => "View all", |
| 223 | (ViewAllMembers, Tr) => "Tümünü gör", | 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 | (OrgName, En) => "Organization name", | 209 | (OrgName, En) => "Organization name", |
| 231 | (OrgName, Tr) => "Kuruluş adı", | 210 | (OrgName, Tr) => "Kuruluş adı", |
| 232 | (DescriptionOptional, En) => "Description (optional)", | 211 | (DescriptionOptional, En) => "Description (optional)", |
| @@ -241,32 +220,18 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 241 | (DisplayNameLabel, Tr) => "Görünen ad", | 220 | (DisplayNameLabel, Tr) => "Görünen ad", |
| 242 | (DefaultRoleLabel, En) => "Default role on the organization's repositories", | 221 | (DefaultRoleLabel, En) => "Default role on the organization's repositories", |
| 243 | (DefaultRoleLabel, Tr) => "Kuruluş depolarında varsayılan rol", | 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 | (MembersCanCreate, En) => "Members can create repositories for this organization", | 223 | (MembersCanCreate, En) => "Members can create repositories for this organization", |
| 251 | (MembersCanCreate, Tr) => "Üyeler bu kuruluş için depo oluşturabilir", | 224 | (MembersCanCreate, Tr) => "Üyeler bu kuruluş için depo oluşturabilir", |
| 252 | (SaveSettings, En) => "Save settings", | 225 | (SaveSettings, En) => "Save settings", |
| 253 | (SaveSettings, Tr) => "Ayarları kaydet", | 226 | (SaveSettings, Tr) => "Ayarları kaydet", |
| 254 | (DeleteOrg, En) => "Delete organization", | 227 | (DeleteOrg, En) => "Delete organization", |
| 255 | (DeleteOrg, Tr) => "Kuruluşu sil", | 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 | (Members, En) => "Members", | 229 | (Members, En) => "Members", |
| 263 | (Members, Tr) => "Üyeler", | 230 | (Members, Tr) => "Üyeler", |
| 264 | (Teams, En) => "Teams", | 231 | (Teams, En) => "Teams", |
| 265 | (Teams, Tr) => "Takımlar", | 232 | (Teams, Tr) => "Takımlar", |
| 266 | (Organization, En) => "Organization", | 233 | (Organization, En) => "Organization", |
| 267 | (Organization, Tr) => "Kuruluş", | 234 | (Organization, Tr) => "Kuruluş", |
| 268 | - (MemberHeader, En) => "Member", | ||
| 269 | - (MemberHeader, Tr) => "Üye", | ||
| 270 | (Role, En) => "Role", | 235 | (Role, En) => "Role", |
| 271 | (Role, Tr) => "Rol", | 236 | (Role, Tr) => "Rol", |
| 272 | (RoleOwner, En) => "owner", | 237 | (RoleOwner, En) => "owner", |
| @@ -275,26 +240,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 275 | (RoleMember, Tr) => "üye", | 240 | (RoleMember, Tr) => "üye", |
| 276 | (Leave, En) => "Leave", | 241 | (Leave, En) => "Leave", |
| 277 | (Leave, Tr) => "Ayrıl", | 242 | (Leave, Tr) => "Ayrıl", |
| 278 | - (AddMember, En) => "Add a member", | ||
| 279 | - (AddMember, Tr) => "Bir üye ekle", | ||
| 280 | (AddMemberButton, En) => "Add member", | 243 | (AddMemberButton, En) => "Add member", |
| 281 | (AddMemberButton, Tr) => "Üye ekle", | 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 | (NoTeamsYet, En) => "No teams yet.", | 245 | (NoTeamsYet, En) => "No teams yet.", |
| 295 | (NoTeamsYet, Tr) => "Henüz takım yok.", | 246 | (NoTeamsYet, Tr) => "Henüz takım yok.", |
| 296 | - (NewTeam, En) => "New team", | ||
| 297 | - (NewTeam, Tr) => "Yeni takım", | ||
| 298 | (CoversAllRepos, En) => "Covers all of the organization's repositories", | 247 | (CoversAllRepos, En) => "Covers all of the organization's repositories", |
| 299 | (CoversAllRepos, Tr) => "Kuruluşun tüm depolarını kapsar", | 248 | (CoversAllRepos, Tr) => "Kuruluşun tüm depolarını kapsar", |
| 300 | (CreateTeam, En) => "Create team", | 249 | (CreateTeam, En) => "Create team", |
| @@ -339,8 +288,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 339 | (Previous, Tr) => "Önceki", | 288 | (Previous, Tr) => "Önceki", |
| 340 | (Next, En) => "Next", | 289 | (Next, En) => "Next", |
| 341 | (Next, Tr) => "Sonraki", | 290 | (Next, Tr) => "Sonraki", |
| 342 | - (PublicReposIntro, En) => "Public repositories on this forge.", | ||
| 343 | - (PublicReposIntro, Tr) => "Bu forge üzerindeki herkese açık depolar.", | ||
| 344 | (Organizations, En) => "Organizations", | 291 | (Organizations, En) => "Organizations", |
| 345 | (Organizations, Tr) => "Kuruluşlar", | 292 | (Organizations, Tr) => "Kuruluşlar", |
| 346 | (SearchPublicRepos, En) => "Search public repositories", | 293 | (SearchPublicRepos, En) => "Search public repositories", |
| @@ -373,14 +320,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 373 | (PopularRepos, Tr) => "Popüler depolar", | 320 | (PopularRepos, Tr) => "Popüler depolar", |
| 374 | (CustomizePins, En) => "Customize pins", | 321 | (CustomizePins, En) => "Customize pins", |
| 375 | (CustomizePins, Tr) => "Sabitlemeleri düzenle", | 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 | (SavePins, En) => "Save pins", | 323 | (SavePins, En) => "Save pins", |
| 379 | (SavePins, Tr) => "Sabitlemeleri kaydet", | 324 | (SavePins, Tr) => "Sabitlemeleri kaydet", |
| 380 | (PinsTooMany, En) => "You can pin at most six repositories.", | 325 | (PinsTooMany, En) => "You can pin at most six repositories.", |
| 381 | (PinsTooMany, Tr) => "En fazla altı depo sabitleyebilirsin.", | 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 | (TabOverview, En) => "Overview", | 327 | (TabOverview, En) => "Overview", |
| 385 | (TabOverview, Tr) => "Genel bakış", | 328 | (TabOverview, Tr) => "Genel bakış", |
| 386 | (TabStars, En) => "Stars", | 329 | (TabStars, En) => "Stars", |
| @@ -393,10 +336,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 393 | (ClearSearch, Tr) => "Aramayı temizle", | 336 | (ClearSearch, Tr) => "Aramayı temizle", |
| 394 | (Home, En) => "Home", | 337 | (Home, En) => "Home", |
| 395 | (Home, Tr) => "Ana sayfa", | 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 | (LogIn, En) => "Log in", | 339 | (LogIn, En) => "Log in", |
| 401 | (LogIn, Tr) => "Giriş yap", | 340 | (LogIn, Tr) => "Giriş yap", |
| 402 | (SetUpForge, En) => "Set up forge", | 341 | (SetUpForge, En) => "Set up forge", |
| @@ -553,7 +492,6 @@ mod tests { | |||
| 553 | K::Explore, | 492 | K::Explore, |
| 554 | K::NewRepository, | 493 | K::NewRepository, |
| 555 | K::NewOrganization, | 494 | K::NewOrganization, |
| 556 | - K::NewOrgIntro, | ||
| 557 | K::OrgName, | 495 | K::OrgName, |
| 558 | K::DescriptionOptional, | 496 | K::DescriptionOptional, |
| 559 | K::CreateOrg, | 497 | K::CreateOrg, |
| @@ -561,25 +499,18 @@ mod tests { | |||
| 561 | K::Description, | 499 | K::Description, |
| 562 | K::DisplayNameLabel, | 500 | K::DisplayNameLabel, |
| 563 | K::DefaultRoleLabel, | 501 | K::DefaultRoleLabel, |
| 564 | - K::DefaultRoleHelp, | ||
| 565 | K::MembersCanCreate, | 502 | K::MembersCanCreate, |
| 566 | K::SaveSettings, | 503 | K::SaveSettings, |
| 567 | K::DeleteOrg, | 504 | K::DeleteOrg, |
| 568 | - K::DeleteOrgIntro, | ||
| 569 | K::Members, | 505 | K::Members, |
| 570 | K::Teams, | 506 | K::Teams, |
| 571 | K::Organization, | 507 | K::Organization, |
| 572 | - K::MemberHeader, | ||
| 573 | K::Role, | 508 | K::Role, |
| 574 | K::RoleOwner, | 509 | K::RoleOwner, |
| 575 | K::RoleMember, | 510 | K::RoleMember, |
| 576 | K::Leave, | 511 | K::Leave, |
| 577 | - K::AddMember, | ||
| 578 | K::AddMemberButton, | 512 | K::AddMemberButton, |
| 579 | - K::OwnersHelp, | ||
| 580 | - K::TeamsIntro, | ||
| 581 | K::NoTeamsYet, | 513 | K::NoTeamsYet, |
| 582 | - K::NewTeam, | ||
| 583 | K::CoversAllRepos, | 514 | K::CoversAllRepos, |
| 584 | K::CreateTeam, | 515 | K::CreateTeam, |
| 585 | K::SaveTeam, | 516 | K::SaveTeam, |
| @@ -602,7 +533,6 @@ mod tests { | |||
| 602 | K::Pages, | 533 | K::Pages, |
| 603 | K::Previous, | 534 | K::Previous, |
| 604 | K::Next, | 535 | K::Next, |
| 605 | - K::PublicReposIntro, | ||
| 606 | K::Organizations, | 536 | K::Organizations, |
| 607 | K::SearchPublicRepos, | 537 | K::SearchPublicRepos, |
| 608 | K::Search, | 538 | K::Search, |
| @@ -619,19 +549,15 @@ mod tests { | |||
| 619 | K::Pinned, | 549 | K::Pinned, |
| 620 | K::PopularRepos, | 550 | K::PopularRepos, |
| 621 | K::CustomizePins, | 551 | K::CustomizePins, |
| 622 | - K::PinsIntro, | ||
| 623 | K::SavePins, | 552 | K::SavePins, |
| 624 | K::PinsTooMany, | 553 | K::PinsTooMany, |
| 625 | - K::NoPinnableRepos, | ||
| 626 | K::TabOverview, | 554 | K::TabOverview, |
| 627 | K::General, | 555 | K::General, |
| 628 | - K::BackToOrganization, | ||
| 629 | K::TabStars, | 556 | K::TabStars, |
| 630 | K::FilterRepos, | 557 | K::FilterRepos, |
| 631 | K::NoReposMatch, | 558 | K::NoReposMatch, |
| 632 | K::ClearSearch, | 559 | K::ClearSearch, |
| 633 | K::Home, | 560 | K::Home, |
| 634 | - K::LandingTagline, | ||
| 635 | K::LogIn, | 561 | K::LogIn, |
| 636 | K::SetUpForge, | 562 | K::SetUpForge, |
| 637 | ]; | 563 | ]; |
crates/forge-web-base/src/i18n/packages.rsmodified+0 -42
| @@ -7,7 +7,6 @@ use super::Lang; | |||
| 7 | pub enum K { | 7 | pub enum K { |
| 8 | TabPackages, | 8 | TabPackages, |
| 9 | PackagesHeading, | 9 | PackagesHeading, |
| 10 | - PackagesHelp, | ||
| 11 | NoPackages, | 10 | NoPackages, |
| 12 | PackageVersions, | 11 | PackageVersions, |
| 13 | PackageVersionCount, | 12 | PackageVersionCount, |
| @@ -16,7 +15,6 @@ pub enum K { | |||
| 16 | PackageRepoLink, | 15 | PackageRepoLink, |
| 17 | VersionYanked, | 16 | VersionYanked, |
| 18 | Install, | 17 | Install, |
| 19 | - InstallHelp, | ||
| 20 | InstallRegistryConfig, | 18 | InstallRegistryConfig, |
| 21 | InstallAdd, | 19 | InstallAdd, |
| 22 | InstallPublish, | 20 | InstallPublish, |
| @@ -25,21 +23,13 @@ pub enum K { | |||
| 25 | Readme, | 23 | Readme, |
| 26 | NoReadme, | 24 | NoReadme, |
| 27 | ScopePackages, | 25 | ScopePackages, |
| 28 | - ScopePackagesHelp, | ||
| 29 | Cancel, | 26 | Cancel, |
| 30 | ContainerKind, | 27 | ContainerKind, |
| 31 | - ContainerInstallHelp, | ||
| 32 | ContainerLogin, | 28 | ContainerLogin, |
| 33 | ContainerPull, | 29 | ContainerPull, |
| 34 | ContainerPush, | 30 | ContainerPush, |
| 35 | ContainerTags, | 31 | ContainerTags, |
| 36 | - ContainerTag, | ||
| 37 | - ContainerDigest, | ||
| 38 | - ContainerSize, | ||
| 39 | - ContainerCreated, | ||
| 40 | DeleteTag, | 32 | DeleteTag, |
| 41 | - DeleteTagMessage, | ||
| 42 | - DeleteTagConfirm, | ||
| 43 | NoTags, | 33 | NoTags, |
| 44 | NoVersions, | 34 | NoVersions, |
| 45 | PackageTagCount, | 35 | PackageTagCount, |
| @@ -54,12 +44,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 54 | (Cancel, Tr) => "Vazgeç", | 44 | (Cancel, Tr) => "Vazgeç", |
| 55 | (ContainerKind, En) => "Container", | 45 | (ContainerKind, En) => "Container", |
| 56 | (ContainerKind, Tr) => "Konteyner", | 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 | (ContainerLogin, En) => "Log in", | 47 | (ContainerLogin, En) => "Log in", |
| 64 | (ContainerLogin, Tr) => "Giriş yap", | 48 | (ContainerLogin, Tr) => "Giriş yap", |
| 65 | (ContainerPull, En) => "Pull the image", | 49 | (ContainerPull, En) => "Pull the image", |
| @@ -68,20 +52,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 68 | (ContainerPush, Tr) => "Bir etiket gönder", | 52 | (ContainerPush, Tr) => "Bir etiket gönder", |
| 69 | (ContainerTags, En) => "Tags", | 53 | (ContainerTags, En) => "Tags", |
| 70 | (ContainerTags, Tr) => "Etiketler", | 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 | (DeleteTag, En) => "Delete", | 55 | (DeleteTag, En) => "Delete", |
| 80 | (DeleteTag, Tr) => "Sil", | 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 | (NoTags, En) => "No tags yet. Push an image to see it here.", | 57 | (NoTags, En) => "No tags yet. Push an image to see it here.", |
| 86 | (NoTags, Tr) => "Henüz etiket yok. Burada görmek için bir imaj gönderin.", | 58 | (NoTags, Tr) => "Henüz etiket yok. Burada görmek için bir imaj gönderin.", |
| 87 | (NoVersions, En) => "No versions published yet.", | 59 | (NoVersions, En) => "No versions published yet.", |
| @@ -94,10 +66,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 94 | (TabPackages, Tr) => "Paketler", | 66 | (TabPackages, Tr) => "Paketler", |
| 95 | (PackagesHeading, En) => "Packages", | 67 | (PackagesHeading, En) => "Packages", |
| 96 | (PackagesHeading, Tr) => "Paketler", | 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 | (NoPackages, En) => "No packages yet.", | 69 | (NoPackages, En) => "No packages yet.", |
| 102 | (NoPackages, Tr) => "Henüz paket yok.", | 70 | (NoPackages, Tr) => "Henüz paket yok.", |
| 103 | (PackageVersions, En) => "Versions", | 71 | (PackageVersions, En) => "Versions", |
| @@ -114,10 +82,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 114 | (VersionYanked, Tr) => "geri çekildi", | 82 | (VersionYanked, Tr) => "geri çekildi", |
| 115 | (Install, En) => "Install", | 83 | (Install, En) => "Install", |
| 116 | (Install, Tr) => "Kurulum", | 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 | (InstallRegistryConfig, En) => "Registry config", | 85 | (InstallRegistryConfig, En) => "Registry config", |
| 122 | (InstallRegistryConfig, Tr) => "Kayıt defteri yapılandırması", | 86 | (InstallRegistryConfig, Tr) => "Kayıt defteri yapılandırması", |
| 123 | (InstallAdd, En) => "Add the crate", | 87 | (InstallAdd, En) => "Add the crate", |
| @@ -134,11 +98,5 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 134 | (NoReadme, Tr) => "Bu crate'in README'si yok.", | 98 | (NoReadme, Tr) => "Bu crate'in README'si yok.", |
| 135 | (ScopePackages, En) => "Packages", | 99 | (ScopePackages, En) => "Packages", |
| 136 | (ScopePackages, Tr) => "Paketler", | 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 | StateOpen, | 12 | StateOpen, |
| 13 | StateMerged, | 13 | StateMerged, |
| 14 | StateClosed, | 14 | StateClosed, |
| 15 | - ListStateNavLabel, | ||
| 16 | NewPullRequest, | 15 | NewPullRequest, |
| 17 | SearchTitles, | 16 | SearchTitles, |
| 18 | SortLabel, | 17 | SortLabel, |
| @@ -24,22 +23,18 @@ pub enum K { | |||
| 24 | SortNewest, | 23 | SortNewest, |
| 25 | SortOldest, | 24 | SortOldest, |
| 26 | SortUpdated, | 25 | SortUpdated, |
| 27 | - MetaBeforeTime, | ||
| 28 | - MetaAfterTime, | ||
| 29 | Newer, | 26 | Newer, |
| 30 | Older, | 27 | Older, |
| 31 | 28 | ||
| 32 | // pull_files.rs | 29 | // pull_files.rs |
| 33 | FinishReview, | 30 | FinishReview, |
| 34 | ReviewSummary, | 31 | ReviewSummary, |
| 35 | - ReviewType, | ||
| 36 | CommentChoice, | 32 | CommentChoice, |
| 37 | ApproveChoice, | 33 | ApproveChoice, |
| 38 | RequestChangesChoice, | 34 | RequestChangesChoice, |
| 39 | SubmitReview, | 35 | SubmitReview, |
| 40 | DiscardPending, | 36 | DiscardPending, |
| 41 | ViewedFiles, | 37 | ViewedFiles, |
| 42 | - ViewedHint, | ||
| 43 | ViewedMark, | 38 | ViewedMark, |
| 44 | ChangedSinceViewed, | 39 | ChangedSinceViewed, |
| 45 | 40 | ||
| @@ -102,8 +97,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 102 | (StateMerged, Tr) => "Birleştirildi", | 97 | (StateMerged, Tr) => "Birleştirildi", |
| 103 | (StateClosed, En) => "Closed", | 98 | (StateClosed, En) => "Closed", |
| 104 | (StateClosed, Tr) => "Kapatıldı", | 99 | (StateClosed, Tr) => "Kapatıldı", |
| 105 | - (ListStateNavLabel, En) => "Pull requests by state", | ||
| 106 | - (ListStateNavLabel, Tr) => "Duruma göre çekme istekleri", | ||
| 107 | (NewPullRequest, En) => "New pull request", | 100 | (NewPullRequest, En) => "New pull request", |
| 108 | (NewPullRequest, Tr) => "Yeni çekme isteği", | 101 | (NewPullRequest, Tr) => "Yeni çekme isteği", |
| 109 | (SearchTitles, En) => "Search titles", | 102 | (SearchTitles, En) => "Search titles", |
| @@ -122,7 +115,7 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 122 | (NoPullRequestsYet, Tr) => { | 115 | (NoPullRequestsYet, Tr) => { |
| 123 | "Henüz çekme isteği yok. Bir dal gönderin, ardından değişikliklerini önermek için bir çekme isteği açın." | 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 | (NoPullRequestsMatch, Tr) => "Bu filtrelere uyan çekme isteği yok.", | 119 | (NoPullRequestsMatch, Tr) => "Bu filtrelere uyan çekme isteği yok.", |
| 127 | (SortNewest, En) => "Newest", | 120 | (SortNewest, En) => "Newest", |
| 128 | (SortNewest, Tr) => "En yeni", | 121 | (SortNewest, Tr) => "En yeni", |
| @@ -130,10 +123,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 130 | (SortOldest, Tr) => "En eski", | 123 | (SortOldest, Tr) => "En eski", |
| 131 | (SortUpdated, En) => "Recently updated", | 124 | (SortUpdated, En) => "Recently updated", |
| 132 | (SortUpdated, Tr) => "Son güncellenen", | 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 | (Newer, En) => "Newer", | 126 | (Newer, En) => "Newer", |
| 138 | (Newer, Tr) => "Daha yeni", | 127 | (Newer, Tr) => "Daha yeni", |
| 139 | (Older, En) => "Older", | 128 | (Older, En) => "Older", |
| @@ -143,8 +132,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 143 | (FinishReview, Tr) => "İncelemeyi tamamla", | 132 | (FinishReview, Tr) => "İncelemeyi tamamla", |
| 144 | (ReviewSummary, En) => "Review summary", | 133 | (ReviewSummary, En) => "Review summary", |
| 145 | (ReviewSummary, Tr) => "İnceleme özeti", | 134 | (ReviewSummary, Tr) => "İnceleme özeti", |
| 146 | - (ReviewType, En) => "Review type", | ||
| 147 | - (ReviewType, Tr) => "İnceleme türü", | ||
| 148 | (CommentChoice, En) => " Comment", | 135 | (CommentChoice, En) => " Comment", |
| 149 | (CommentChoice, Tr) => " Yorum", | 136 | (CommentChoice, Tr) => " Yorum", |
| 150 | (ApproveChoice, En) => " Approve", | 137 | (ApproveChoice, En) => " Approve", |
| @@ -157,8 +144,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 157 | (DiscardPending, Tr) => "Bekleyen yorumları sil", | 144 | (DiscardPending, Tr) => "Bekleyen yorumları sil", |
| 158 | (ViewedFiles, En) => "Viewed files", | 145 | (ViewedFiles, En) => "Viewed files", |
| 159 | (ViewedFiles, Tr) => "Görüntülenen dosyalar", | 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 | (ViewedMark, En) => "Mark as viewed", | 147 | (ViewedMark, En) => "Mark as viewed", |
| 163 | (ViewedMark, Tr) => "Görüntülendi olarak işaretle", | 148 | (ViewedMark, Tr) => "Görüntülendi olarak işaretle", |
| 164 | (ChangedSinceViewed, En) => "Changed since you viewed", | 149 | (ChangedSinceViewed, En) => "Changed since you viewed", |
| @@ -335,7 +320,6 @@ mod tests { | |||
| 335 | K::StateOpen, | 320 | K::StateOpen, |
| 336 | K::StateMerged, | 321 | K::StateMerged, |
| 337 | K::StateClosed, | 322 | K::StateClosed, |
| 338 | - K::ListStateNavLabel, | ||
| 339 | K::NewPullRequest, | 323 | K::NewPullRequest, |
| 340 | K::SearchTitles, | 324 | K::SearchTitles, |
| 341 | K::SortLabel, | 325 | K::SortLabel, |
| @@ -347,20 +331,16 @@ mod tests { | |||
| 347 | K::SortNewest, | 331 | K::SortNewest, |
| 348 | K::SortOldest, | 332 | K::SortOldest, |
| 349 | K::SortUpdated, | 333 | K::SortUpdated, |
| 350 | - K::MetaBeforeTime, | ||
| 351 | - K::MetaAfterTime, | ||
| 352 | K::Newer, | 334 | K::Newer, |
| 353 | K::Older, | 335 | K::Older, |
| 354 | K::FinishReview, | 336 | K::FinishReview, |
| 355 | K::ReviewSummary, | 337 | K::ReviewSummary, |
| 356 | - K::ReviewType, | ||
| 357 | K::CommentChoice, | 338 | K::CommentChoice, |
| 358 | K::ApproveChoice, | 339 | K::ApproveChoice, |
| 359 | K::RequestChangesChoice, | 340 | K::RequestChangesChoice, |
| 360 | K::SubmitReview, | 341 | K::SubmitReview, |
| 361 | K::DiscardPending, | 342 | K::DiscardPending, |
| 362 | K::ViewedFiles, | 343 | K::ViewedFiles, |
| 363 | - K::ViewedHint, | ||
| 364 | K::ViewedMark, | 344 | K::ViewedMark, |
| 365 | K::ChangedSinceViewed, | 345 | K::ChangedSinceViewed, |
| 366 | K::BranchErrProtected, | 346 | K::BranchErrProtected, |
crates/forge-web-base/src/i18n/pulls_review.rsmodified+2 -14
| @@ -21,7 +21,6 @@ pub enum K { | |||
| 21 | MergeConflict, | 21 | MergeConflict, |
| 22 | MergeUpToDate, | 22 | MergeUpToDate, |
| 23 | MergeChecking, | 23 | MergeChecking, |
| 24 | - ReloadToCheck, | ||
| 25 | MergeStyleLegend, | 24 | MergeStyleLegend, |
| 26 | StyleMergeCommit, | 25 | StyleMergeCommit, |
| 27 | StyleSquash, | 26 | StyleSquash, |
| @@ -41,7 +40,6 @@ pub enum K { | |||
| 41 | CheckErrored, | 40 | CheckErrored, |
| 42 | CheckMissing, | 41 | CheckMissing, |
| 43 | EnableAutoMerge, | 42 | EnableAutoMerge, |
| 44 | - AutoMergeHint, | ||
| 45 | DisableAutoMerge, | 43 | DisableAutoMerge, |
| 46 | MergeMessageLabel, | 44 | MergeMessageLabel, |
| 47 | MergeButton, | 45 | MergeButton, |
| @@ -121,16 +119,14 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 121 | (TabConversation, Tr) => "Tartışma", | 119 | (TabConversation, Tr) => "Tartışma", |
| 122 | (PullPages, En) => "Pull request pages", | 120 | (PullPages, En) => "Pull request pages", |
| 123 | (PullPages, Tr) => "Çekme isteği sayfaları", | 121 | (PullPages, Tr) => "Çekme isteği sayfaları", |
| 124 | - (MergeClean, En) => "This branch has no conflicts with the base branch", | 122 | + (MergeClean, En) => "Ready to merge", |
| 125 | - (MergeClean, Tr) => "Bu dalın taban dalla çakışması yok", | 123 | + (MergeClean, Tr) => "Birleştirmeye hazır", |
| 126 | (MergeConflict, En) => "This branch has conflicts that must be resolved", | 124 | (MergeConflict, En) => "This branch has conflicts that must be resolved", |
| 127 | (MergeConflict, Tr) => "Bu dalda çözülmesi gereken çakışmalar var", | 125 | (MergeConflict, Tr) => "Bu dalda çözülmesi gereken çakışmalar var", |
| 128 | (MergeUpToDate, En) => "This branch is already up to date with base", | 126 | (MergeUpToDate, En) => "This branch is already up to date with base", |
| 129 | (MergeUpToDate, Tr) => "Bu dal zaten taban dalla güncel", | 127 | (MergeUpToDate, Tr) => "Bu dal zaten taban dalla güncel", |
| 130 | (MergeChecking, En) => "Checking mergeability\u{2026}", | 128 | (MergeChecking, En) => "Checking mergeability\u{2026}", |
| 131 | (MergeChecking, Tr) => "Birleştirilebilirlik kontrol ediliyor\u{2026}", | 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 | (MergeStyleLegend, En) => "Merge style", | 130 | (MergeStyleLegend, En) => "Merge style", |
| 135 | (MergeStyleLegend, Tr) => "Birleştirme yöntemi", | 131 | (MergeStyleLegend, Tr) => "Birleştirme yöntemi", |
| 136 | (StyleMergeCommit, En) => " Create a merge commit", | 132 | (StyleMergeCommit, En) => " Create a merge commit", |
| @@ -181,12 +177,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 181 | (CheckMissing, Tr) => "Durum bekleniyor", | 177 | (CheckMissing, Tr) => "Durum bekleniyor", |
| 182 | (EnableAutoMerge, En) => "Enable auto-merge", | 178 | (EnableAutoMerge, En) => "Enable auto-merge", |
| 183 | (EnableAutoMerge, Tr) => "Otomatik birleştirmeyi aç", | 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 | (DisableAutoMerge, En) => "Disable auto-merge", | 180 | (DisableAutoMerge, En) => "Disable auto-merge", |
| 191 | (DisableAutoMerge, Tr) => "Otomatik birleştirmeyi kapat", | 181 | (DisableAutoMerge, Tr) => "Otomatik birleştirmeyi kapat", |
| 192 | (MergeMessageLabel, En) => "Merge commit message (optional)", | 182 | (MergeMessageLabel, En) => "Merge commit message (optional)", |
| @@ -464,7 +454,6 @@ pub const ALL: &[K] = &[ | |||
| 464 | K::MergeConflict, | 454 | K::MergeConflict, |
| 465 | K::MergeUpToDate, | 455 | K::MergeUpToDate, |
| 466 | K::MergeChecking, | 456 | K::MergeChecking, |
| 467 | - K::ReloadToCheck, | ||
| 468 | K::MergeStyleLegend, | 457 | K::MergeStyleLegend, |
| 469 | K::StyleMergeCommit, | 458 | K::StyleMergeCommit, |
| 470 | K::StyleSquash, | 459 | K::StyleSquash, |
| @@ -484,7 +473,6 @@ pub const ALL: &[K] = &[ | |||
| 484 | K::CheckErrored, | 473 | K::CheckErrored, |
| 485 | K::CheckMissing, | 474 | K::CheckMissing, |
| 486 | K::EnableAutoMerge, | 475 | K::EnableAutoMerge, |
| 487 | - K::AutoMergeHint, | ||
| 488 | K::DisableAutoMerge, | 476 | K::DisableAutoMerge, |
| 489 | K::MergeMessageLabel, | 477 | K::MergeMessageLabel, |
| 490 | K::MergeButton, | 478 | K::MergeButton, |
crates/forge-web-base/src/i18n/push.rsmodified+0 -7
| @@ -7,7 +7,6 @@ use super::Lang; | |||
| 7 | pub enum K { | 7 | pub enum K { |
| 8 | // Settings card: this device. | 8 | // Settings card: this device. |
| 9 | DeviceHeading, | 9 | DeviceHeading, |
| 10 | - DeviceHelp, | ||
| 11 | DeviceUnsupported, | 10 | DeviceUnsupported, |
| 12 | DeviceNeedsHttps, | 11 | DeviceNeedsHttps, |
| 13 | DeviceIosHint, | 12 | DeviceIosHint, |
| @@ -36,12 +35,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 36 | match (key, lang) { | 35 | match (key, lang) { |
| 37 | (DeviceHeading, Lang::En) => "Push notifications on this device", | 36 | (DeviceHeading, Lang::En) => "Push notifications on this device", |
| 38 | (DeviceHeading, Lang::Tr) => "Bu cihazda anlık bildirimler", | 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 | (DeviceUnsupported, Lang::En) => "This browser does not support push notifications.", | 38 | (DeviceUnsupported, Lang::En) => "This browser does not support push notifications.", |
| 46 | (DeviceUnsupported, Lang::Tr) => "Bu tarayıcı anlık bildirimleri desteklemiyor.", | 39 | (DeviceUnsupported, Lang::Tr) => "Bu tarayıcı anlık bildirimleri desteklemiyor.", |
| 47 | (DeviceNeedsHttps, Lang::En) => "Push notifications need an HTTPS connection.", | 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 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] | 8 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] |
| 9 | pub enum K { | 9 | pub enum K { |
| 10 | // Repo home page: the latest release card. | 10 | // Repo home page: the latest release card. |
| 11 | - LatestReleaseHeading, | ||
| 12 | 11 | ||
| 13 | // CI notices, shown after a run action. | 12 | // CI notices, shown after a run action. |
| 14 | CiNoticeStarted, | 13 | CiNoticeStarted, |
| @@ -22,7 +21,6 @@ pub enum K { | |||
| 22 | 21 | ||
| 23 | // CI run list and run page. | 22 | // CI run list and run page. |
| 24 | RunWorkflow, | 23 | RunWorkflow, |
| 25 | - RunWorkflowHelp, | ||
| 26 | Branch, | 24 | Branch, |
| 27 | ApproveAndRun, | 25 | ApproveAndRun, |
| 28 | Cancel, | 26 | Cancel, |
| @@ -34,12 +32,10 @@ pub enum K { | |||
| 34 | DownloadAll, | 32 | DownloadAll, |
| 35 | Download, | 33 | Download, |
| 36 | ConfigWarnings, | 34 | ConfigWarnings, |
| 37 | - ConfigWarningsHint, | ||
| 38 | CiNoticeNoFailed, | 35 | CiNoticeNoFailed, |
| 39 | CiNoticeNotDone, | 36 | CiNoticeNotDone, |
| 40 | CiNoticeTooBig, | 37 | CiNoticeTooBig, |
| 41 | CiNoticeOverwritten, | 38 | CiNoticeOverwritten, |
| 42 | - CiCommitOverwritten, | ||
| 43 | LogSearch, | 39 | LogSearch, |
| 44 | LogPrev, | 40 | LogPrev, |
| 45 | LogNext, | 41 | LogNext, |
| @@ -48,7 +44,6 @@ pub enum K { | |||
| 48 | LogExpandAll, | 44 | LogExpandAll, |
| 49 | Runs, | 45 | Runs, |
| 50 | NoRunsYet, | 46 | NoRunsYet, |
| 51 | - NoRunsHint, | ||
| 52 | TriggerScheduled, | 47 | TriggerScheduled, |
| 53 | NextScheduledRun, | 48 | NextScheduledRun, |
| 54 | NoJobs, | 49 | NoJobs, |
| @@ -76,7 +71,6 @@ pub enum K { | |||
| 76 | 71 | ||
| 77 | // CI status badge, on the run list. | 72 | // CI status badge, on the run list. |
| 78 | BadgeHeading, | 73 | BadgeHeading, |
| 79 | - BadgeHelp, | ||
| 80 | BadgeSnippet, | 74 | BadgeSnippet, |
| 81 | 75 | ||
| 82 | // CI state words. | 76 | // CI state words. |
| @@ -94,8 +88,6 @@ pub enum K { | |||
| 94 | StoppingButton, | 88 | StoppingButton, |
| 95 | 89 | ||
| 96 | // The failure block at the top of a failed run. | 90 | // The failure block at the top of a failed run. |
| 97 | - FailHeading, | ||
| 98 | - FailLine, | ||
| 99 | FailOpenLog, | 91 | FailOpenLog, |
| 100 | FailNoLog, | 92 | FailNoLog, |
| 101 | FailNoError, | 93 | FailNoError, |
| @@ -123,7 +115,6 @@ pub enum K { | |||
| 123 | NewRelease, | 115 | NewRelease, |
| 124 | EditRelease, | 116 | EditRelease, |
| 125 | SaveRelease, | 117 | SaveRelease, |
| 126 | - TagHint, | ||
| 127 | Tag, | 118 | Tag, |
| 128 | TargetBranch, | 119 | TargetBranch, |
| 129 | Title, | 120 | Title, |
| @@ -146,13 +137,8 @@ pub enum K { | |||
| 146 | DeleteRelease, | 137 | DeleteRelease, |
| 147 | BackToRelease, | 138 | BackToRelease, |
| 148 | UploadAsset, | 139 | UploadAsset, |
| 149 | - DeleteReleaseHelp, | ||
| 150 | - YesDeleteRelease, | ||
| 151 | - EditTagHelp, | ||
| 152 | EditTargetLabel, | 140 | EditTargetLabel, |
| 153 | CurrentCommit, | 141 | CurrentCommit, |
| 154 | - TargetMoveHelp, | ||
| 155 | - TargetLockedHelp, | ||
| 156 | ReplaceAsset, | 142 | ReplaceAsset, |
| 157 | 143 | ||
| 158 | // CI time estimate: a running run past its expected total. | 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 | use K::*; | 149 | use K::*; |
| 164 | use Lang::*; | 150 | use Lang::*; |
| 165 | match (key, lang) { | 151 | match (key, lang) { |
| 166 | - (LatestReleaseHeading, En) => "Latest release", | ||
| 167 | - (LatestReleaseHeading, Tr) => "Son sürüm", | ||
| 168 | (CiNoticeStarted, En) => "Workflow run queued.", | 152 | (CiNoticeStarted, En) => "Workflow run queued.", |
| 169 | (CiNoticeStarted, Tr) => "İş akışı çalıştırması sıraya alındı.", | 153 | (CiNoticeStarted, Tr) => "İş akışı çalıştırması sıraya alındı.", |
| 170 | (CiNoticeCancelled, En) => { | 154 | (CiNoticeCancelled, En) => { |
| @@ -192,12 +176,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 192 | 176 | ||
| 193 | (RunWorkflow, En) => "Run workflow", | 177 | (RunWorkflow, En) => "Run workflow", |
| 194 | (RunWorkflow, Tr) => "İş akışını çalıştır", | 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 | (Branch, En) => "Branch", | 179 | (Branch, En) => "Branch", |
| 202 | (Branch, Tr) => "Dal", | 180 | (Branch, Tr) => "Dal", |
| 203 | (ApproveAndRun, En) => "Approve and run", | 181 | (ApproveAndRun, En) => "Approve and run", |
| @@ -216,12 +194,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 216 | (Download, Tr) => "İndir", | 194 | (Download, Tr) => "İndir", |
| 217 | (ConfigWarnings, En) => "Config warnings", | 195 | (ConfigWarnings, En) => "Config warnings", |
| 218 | (ConfigWarnings, Tr) => "Yapılandırma uyarıları", | 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 | (CiNoticeNoFailed, En) => "This run has no failed or cancelled jobs to run again.", | 197 | (CiNoticeNoFailed, En) => "This run has no failed or cancelled jobs to run again.", |
| 226 | (CiNoticeNoFailed, Tr) => { | 198 | (CiNoticeNoFailed, Tr) => { |
| 227 | "Bu çalıştırmada yeniden çalıştırılacak başarısız ya da iptal edilmiş iş yok." | 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 | (CiNoticeOverwritten, Tr) => { | 210 | (CiNoticeOverwritten, Tr) => { |
| 239 | "Bu commit'in üzerine yazıldı, bu yüzden yeniden çalıştırılamaz." | 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 | (LogSearch, En) => "Search the log", | 213 | (LogSearch, En) => "Search the log", |
| 244 | (LogSearch, Tr) => "Günlükte ara", | 214 | (LogSearch, Tr) => "Günlükte ara", |
| 245 | (LogPrev, En) => "Previous match", | 215 | (LogPrev, En) => "Previous match", |
| @@ -258,10 +228,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 258 | (Runs, Tr) => "Çalıştırmalar", | 228 | (Runs, Tr) => "Çalıştırmalar", |
| 259 | (NoRunsYet, En) => "No runs yet.", | 229 | (NoRunsYet, En) => "No runs yet.", |
| 260 | (NoRunsYet, Tr) => "Henüz çalıştırma yok.", | 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 | (TriggerScheduled, En) => "scheduled", | 231 | (TriggerScheduled, En) => "scheduled", |
| 266 | (TriggerScheduled, Tr) => "zamanlanmış", | 232 | (TriggerScheduled, Tr) => "zamanlanmış", |
| 267 | (NextScheduledRun, En) => "Next scheduled run", | 233 | (NextScheduledRun, En) => "Next scheduled run", |
| @@ -296,22 +262,16 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 296 | (CopyDone, Tr) => "Kopyalandı", | 262 | (CopyDone, Tr) => "Kopyalandı", |
| 297 | (CopyFailed, En) => "Copy failed", | 263 | (CopyFailed, En) => "Copy failed", |
| 298 | (CopyFailed, Tr) => "Kopyalanamadı", | 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 | (FailOpenLog, En) => "Open in full log", | 265 | (FailOpenLog, En) => "Open in full log", |
| 304 | (FailOpenLog, Tr) => "Tam günlükte aç", | 266 | (FailOpenLog, Tr) => "Tam günlükte aç", |
| 305 | - (FailNoLog, En) => "This job wrote no log.", | 267 | + (FailNoLog, En) => "No log.", |
| 306 | - (FailNoLog, Tr) => "Bu iş günlük yazmadı.", | 268 | + (FailNoLog, Tr) => "Günlük yok.", |
| 307 | - (FailNoError, En) => "No error line found. The last lines of the log are shown.", | 269 | + (FailNoError, En) => "No error line.", |
| 308 | - (FailNoError, Tr) => "Hata satırı bulunamadı. Günlüğün son satırları gösteriliyor.", | 270 | + (FailNoError, Tr) => "Hata satırı yok.", |
| 309 | (Duration, En) => "Duration", | 271 | (Duration, En) => "Duration", |
| 310 | (Duration, Tr) => "Süre", | 272 | (Duration, Tr) => "Süre", |
| 311 | - (LogTruncated, En) => "Showing the last 512 KiB of the log. The full log is linked above.", | 273 | + (LogTruncated, En) => "Showing the last 512 KiB.", |
| 312 | - (LogTruncated, Tr) => { | 274 | + (LogTruncated, Tr) => "Günlüğün son 512 KiB'ı gösteriliyor.", |
| 313 | - "Günlüğün son 512 KiB'ı gösteriliyor. Tam günlük yukarıda bağlantılı." | ||
| 314 | - } | ||
| 315 | (Artifacts, En) => "Artifacts", | 275 | (Artifacts, En) => "Artifacts", |
| 316 | (Artifacts, Tr) => "Yapıtlar", | 276 | (Artifacts, Tr) => "Yapıtlar", |
| 317 | (Timeline, En) => "Timeline", | 277 | (Timeline, En) => "Timeline", |
| @@ -322,14 +282,8 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 322 | (ExpandAll, Tr) => "Tümünü aç", | 282 | (ExpandAll, Tr) => "Tümünü aç", |
| 323 | (CollapseAll, En) => "Collapse all", | 283 | (CollapseAll, En) => "Collapse all", |
| 324 | (CollapseAll, Tr) => "Tümünü kapat", | 284 | (CollapseAll, Tr) => "Tümünü kapat", |
| 325 | - (BadgeHeading, En) => "Status badge", | 285 | + (BadgeHeading, En) => "Badge", |
| 326 | - (BadgeHeading, Tr) => "Durum rozeti", | 286 | + (BadgeHeading, Tr) => "Rozet", |
| 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 | - } | ||
| 333 | (BadgeSnippet, En) => "Markdown", | 287 | (BadgeSnippet, En) => "Markdown", |
| 334 | (BadgeSnippet, Tr) => "Markdown", | 288 | (BadgeSnippet, Tr) => "Markdown", |
| 335 | 289 | ||
| @@ -420,12 +374,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 420 | (EditRelease, Tr) => "Sürümü düzenle", | 374 | (EditRelease, Tr) => "Sürümü düzenle", |
| 421 | (SaveRelease, En) => "Save release", | 375 | (SaveRelease, En) => "Save release", |
| 422 | (SaveRelease, Tr) => "Sürümü kaydet", | 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 | (Tag, En) => "Tag", | 377 | (Tag, En) => "Tag", |
| 430 | (Tag, Tr) => "Etiket", | 378 | (Tag, Tr) => "Etiket", |
| 431 | (TargetBranch, En) => "Target branch", | 379 | (TargetBranch, En) => "Target branch", |
| @@ -470,30 +418,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 470 | (BackToRelease, Tr) => "Sürüme dön", | 418 | (BackToRelease, Tr) => "Sürüme dön", |
| 471 | (UploadAsset, En) => "Upload asset", | 419 | (UploadAsset, En) => "Upload asset", |
| 472 | (UploadAsset, Tr) => "Dosya yükle", | 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 | (EditTargetLabel, En) => "Move tag to branch (optional)", | 421 | (EditTargetLabel, En) => "Move tag to branch (optional)", |
| 486 | (EditTargetLabel, Tr) => "Etiketi dala taşı (isteğe bağlı)", | 422 | (EditTargetLabel, Tr) => "Etiketi dala taşı (isteğe bağlı)", |
| 487 | (CurrentCommit, En) => "Keep the current commit", | 423 | (CurrentCommit, En) => "Keep the current commit", |
| 488 | (CurrentCommit, Tr) => "Mevcut commit'i koru", | 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 | (ReplaceAsset, En) => "Replace", | 425 | (ReplaceAsset, En) => "Replace", |
| 498 | (ReplaceAsset, Tr) => "Değiştir", | 426 | (ReplaceAsset, Tr) => "Değiştir", |
| 499 | (TakingLonger, En) => "taking longer than usual", | 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 | /// "needs test", for the names of the jobs a job needs. | 456 | /// "needs test", for the names of the jobs a job needs. |
| 537 | pub fn needs_label(lang: Lang, names: &str) -> String { | 457 | pub fn needs_label(lang: Lang, names: &str) -> String { |
| 538 | match lang { | 458 | match lang { |
| @@ -607,7 +527,6 @@ mod tests { | |||
| 607 | use super::*; | 527 | use super::*; |
| 608 | 528 | ||
| 609 | const ALL: &[K] = &[ | 529 | const ALL: &[K] = &[ |
| 610 | - K::LatestReleaseHeading, | ||
| 611 | K::CiNoticeStarted, | 530 | K::CiNoticeStarted, |
| 612 | K::CiNoticeCancelled, | 531 | K::CiNoticeCancelled, |
| 613 | K::CiNoticeApproved, | 532 | K::CiNoticeApproved, |
| @@ -617,7 +536,6 @@ mod tests { | |||
| 617 | K::CiNoticeNoBranch, | 536 | K::CiNoticeNoBranch, |
| 618 | K::CiNoticeNoManual, | 537 | K::CiNoticeNoManual, |
| 619 | K::RunWorkflow, | 538 | K::RunWorkflow, |
| 620 | - K::RunWorkflowHelp, | ||
| 621 | K::Branch, | 539 | K::Branch, |
| 622 | K::ApproveAndRun, | 540 | K::ApproveAndRun, |
| 623 | K::Cancel, | 541 | K::Cancel, |
| @@ -628,12 +546,10 @@ mod tests { | |||
| 628 | K::DownloadAll, | 546 | K::DownloadAll, |
| 629 | K::Download, | 547 | K::Download, |
| 630 | K::ConfigWarnings, | 548 | K::ConfigWarnings, |
| 631 | - K::ConfigWarningsHint, | ||
| 632 | K::CiNoticeNoFailed, | 549 | K::CiNoticeNoFailed, |
| 633 | K::CiNoticeNotDone, | 550 | K::CiNoticeNotDone, |
| 634 | K::CiNoticeTooBig, | 551 | K::CiNoticeTooBig, |
| 635 | K::CiNoticeOverwritten, | 552 | K::CiNoticeOverwritten, |
| 636 | - K::CiCommitOverwritten, | ||
| 637 | K::LogSearch, | 553 | K::LogSearch, |
| 638 | K::LogPrev, | 554 | K::LogPrev, |
| 639 | K::LogNext, | 555 | K::LogNext, |
| @@ -642,7 +558,6 @@ mod tests { | |||
| 642 | K::LogExpandAll, | 558 | K::LogExpandAll, |
| 643 | K::Runs, | 559 | K::Runs, |
| 644 | K::NoRunsYet, | 560 | K::NoRunsYet, |
| 645 | - K::NoRunsHint, | ||
| 646 | K::TriggerScheduled, | 561 | K::TriggerScheduled, |
| 647 | K::NextScheduledRun, | 562 | K::NextScheduledRun, |
| 648 | K::Jobs, | 563 | K::Jobs, |
| @@ -668,7 +583,6 @@ mod tests { | |||
| 668 | K::ExpandAll, | 583 | K::ExpandAll, |
| 669 | K::CollapseAll, | 584 | K::CollapseAll, |
| 670 | K::BadgeHeading, | 585 | K::BadgeHeading, |
| 671 | - K::BadgeHelp, | ||
| 672 | K::BadgeSnippet, | 586 | K::BadgeSnippet, |
| 673 | K::StateWaitingApproval, | 587 | K::StateWaitingApproval, |
| 674 | K::StateQueued, | 588 | K::StateQueued, |
| @@ -681,8 +595,6 @@ mod tests { | |||
| 681 | K::StateSkipped, | 595 | K::StateSkipped, |
| 682 | K::StateStopping, | 596 | K::StateStopping, |
| 683 | K::StoppingButton, | 597 | K::StoppingButton, |
| 684 | - K::FailHeading, | ||
| 685 | - K::FailLine, | ||
| 686 | K::FailOpenLog, | 598 | K::FailOpenLog, |
| 687 | K::FailNoLog, | 599 | K::FailNoLog, |
| 688 | K::FailNoError, | 600 | K::FailNoError, |
| @@ -704,7 +616,6 @@ mod tests { | |||
| 704 | K::NewRelease, | 616 | K::NewRelease, |
| 705 | K::EditRelease, | 617 | K::EditRelease, |
| 706 | K::SaveRelease, | 618 | K::SaveRelease, |
| 707 | - K::TagHint, | ||
| 708 | K::Tag, | 619 | K::Tag, |
| 709 | K::TargetBranch, | 620 | K::TargetBranch, |
| 710 | K::Title, | 621 | K::Title, |
| @@ -727,13 +638,8 @@ mod tests { | |||
| 727 | K::DeleteRelease, | 638 | K::DeleteRelease, |
| 728 | K::BackToRelease, | 639 | K::BackToRelease, |
| 729 | K::UploadAsset, | 640 | K::UploadAsset, |
| 730 | - K::DeleteReleaseHelp, | ||
| 731 | - K::YesDeleteRelease, | ||
| 732 | - K::EditTagHelp, | ||
| 733 | K::EditTargetLabel, | 641 | K::EditTargetLabel, |
| 734 | K::CurrentCommit, | 642 | K::CurrentCommit, |
| 735 | - K::TargetMoveHelp, | ||
| 736 | - K::TargetLockedHelp, | ||
| 737 | K::ReplaceAsset, | 643 | K::ReplaceAsset, |
| 738 | K::TakingLonger, | 644 | K::TakingLonger, |
| 739 | ]; | 645 | ]; |
crates/forge-web-base/src/i18n/repo_admin.rsmodified+14 -182
| @@ -7,18 +7,14 @@ pub enum K { | |||
| 7 | Accept, | 7 | Accept, |
| 8 | AcceptTransfer, | 8 | AcceptTransfer, |
| 9 | AddCollaboratorButton, | 9 | AddCollaboratorButton, |
| 10 | - AddCollaboratorHeading, | ||
| 11 | - AddCollaboratorHelp, | ||
| 12 | AddOrUpdate, | 10 | AddOrUpdate, |
| 13 | AllowDeletion, | 11 | AllowDeletion, |
| 14 | AllowForcePush, | 12 | AllowForcePush, |
| 15 | AlreadyOwner, | 13 | AlreadyOwner, |
| 16 | ApprovalsRange, | 14 | ApprovalsRange, |
| 17 | ArchiveHeading, | 15 | ArchiveHeading, |
| 18 | - ArchiveHelp, | ||
| 19 | ArchiveConfirm, | 16 | ArchiveConfirm, |
| 20 | ArchiveRepo, | 17 | ArchiveRepo, |
| 21 | - ArchivedHelp, | ||
| 22 | ArchivedSecrets, | 18 | ArchivedSecrets, |
| 23 | Cancel, | 19 | Cancel, |
| 24 | BadForm, | 20 | BadForm, |
| @@ -26,7 +22,6 @@ pub enum K { | |||
| 26 | BranchMissing, | 22 | BranchMissing, |
| 27 | BranchPattern, | 23 | BranchPattern, |
| 28 | BranchProtection, | 24 | BranchProtection, |
| 29 | - BranchProtectionHelp, | ||
| 30 | BranchRuleRemoved, | 25 | BranchRuleRemoved, |
| 31 | BranchRuleSaved, | 26 | BranchRuleSaved, |
| 32 | BuiltinRowText, | 27 | BuiltinRowText, |
| @@ -36,8 +31,6 @@ pub enum K { | |||
| 36 | CollabAdded, | 31 | CollabAdded, |
| 37 | CollabRemoved, | 32 | CollabRemoved, |
| 38 | Collaborators, | 33 | Collaborators, |
| 39 | - CollaboratorsHelp, | ||
| 40 | - ColUser, | ||
| 41 | DangerZone, | 34 | DangerZone, |
| 42 | Decline, | 35 | Decline, |
| 43 | DeclineTransfer, | 36 | DeclineTransfer, |
| @@ -45,11 +38,8 @@ pub enum K { | |||
| 45 | DefaultBranchFailed, | 38 | DefaultBranchFailed, |
| 46 | Delete, | 39 | Delete, |
| 47 | DeleteRepo, | 40 | DeleteRepo, |
| 48 | - DeleteRepoHelp, | ||
| 49 | - DeleteTrashHelp, | ||
| 50 | DeletionAllowed, | 41 | DeletionAllowed, |
| 51 | Description, | 42 | Description, |
| 52 | - DescriptionHelp, | ||
| 53 | DescriptionLong, | 43 | DescriptionLong, |
| 54 | EditRule, | 44 | EditRule, |
| 55 | EnterUsername, | 45 | EnterUsername, |
| @@ -60,7 +50,6 @@ pub enum K { | |||
| 60 | MakePublic, | 50 | MakePublic, |
| 61 | MakePublicConfirm, | 51 | MakePublicConfirm, |
| 62 | InvalidRole, | 52 | InvalidRole, |
| 63 | - LastUpdated, | ||
| 64 | Mirrors, | 53 | Mirrors, |
| 65 | Name, | 54 | Name, |
| 66 | NameRule, | 55 | NameRule, |
| @@ -69,19 +58,14 @@ pub enum K { | |||
| 69 | AddRule, | 58 | AddRule, |
| 70 | NoBranchesYet, | 59 | NoBranchesYet, |
| 71 | NoCollaborators, | 60 | NoCollaborators, |
| 72 | - NoPendingTransfer, | ||
| 73 | NoSecrets, | 61 | NoSecrets, |
| 74 | NotCollaborator, | 62 | NotCollaborator, |
| 75 | OwnerIsMember, | 63 | OwnerIsMember, |
| 76 | - PatternHelp, | ||
| 77 | - PendingTransfers, | ||
| 78 | PrivateOption, | 64 | PrivateOption, |
| 79 | PublicOption, | 65 | PublicOption, |
| 80 | Remove, | 66 | Remove, |
| 81 | RemoveRule, | 67 | RemoveRule, |
| 82 | - RenameHelp, | ||
| 83 | RenameRepo, | 68 | RenameRepo, |
| 84 | - RenameTransferNav, | ||
| 85 | RenamedNotice, | 69 | RenamedNotice, |
| 86 | RepoArchived, | 70 | RepoArchived, |
| 87 | RepoDeletedAfter, | 71 | RepoDeletedAfter, |
| @@ -92,13 +76,8 @@ pub enum K { | |||
| 92 | RequiredApprovals, | 76 | RequiredApprovals, |
| 93 | RestrictPushTitle, | 77 | RestrictPushTitle, |
| 94 | Role, | 78 | Role, |
| 95 | - RoleAdminDesc, | ||
| 96 | - RoleMaintainDesc, | ||
| 97 | - RoleReadDesc, | ||
| 98 | Roles, | 79 | Roles, |
| 99 | - RoleTriageDesc, | ||
| 100 | RoleUpdated, | 80 | RoleUpdated, |
| 101 | - RoleWriteDesc, | ||
| 102 | RequiredChecks, | 81 | RequiredChecks, |
| 103 | RecentContexts, | 82 | RecentContexts, |
| 104 | RuleChangesShort, | 83 | RuleChangesShort, |
| @@ -107,21 +86,15 @@ pub enum K { | |||
| 107 | RuleUpToDateShort, | 86 | RuleUpToDateShort, |
| 108 | SaveGeneral, | 87 | SaveGeneral, |
| 109 | SaveRole, | 88 | SaveRole, |
| 110 | - SaveRule, | ||
| 111 | SaveSecret, | 89 | SaveSecret, |
| 112 | SecretDeleted, | 90 | SecretDeleted, |
| 113 | - SecretLimits, | ||
| 114 | SecretMissing, | 91 | SecretMissing, |
| 115 | SecretSaved, | 92 | SecretSaved, |
| 116 | Secrets, | 93 | Secrets, |
| 117 | - SecretsHelp, | ||
| 118 | SectionChecks, | 94 | SectionChecks, |
| 119 | SectionPullRequests, | 95 | SectionPullRequests, |
| 120 | - SectionPattern, | ||
| 121 | SectionPushes, | 96 | SectionPushes, |
| 122 | SettingsNavLabel, | 97 | SettingsNavLabel, |
| 123 | - StartTransferLink, | ||
| 124 | - TransferHelp, | ||
| 125 | TransferRepo, | 98 | TransferRepo, |
| 126 | TransferTitle, | 99 | TransferTitle, |
| 127 | TransferredNotice, | 100 | TransferredNotice, |
| @@ -137,6 +110,8 @@ pub enum K { | |||
| 137 | VisibilityHeading, | 110 | VisibilityHeading, |
| 138 | MakePrivateConfirm, | 111 | MakePrivateConfirm, |
| 139 | Webhooks, | 112 | Webhooks, |
| 113 | + Features, | ||
| 114 | + RenameHeading, | ||
| 140 | } | 115 | } |
| 141 | 116 | ||
| 142 | pub fn t(lang: Lang, key: K) -> &'static str { | 117 | pub fn t(lang: Lang, key: K) -> &'static str { |
| @@ -149,14 +124,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 149 | (AcceptTransfer, Tr) => "Devri kabul et", | 124 | (AcceptTransfer, Tr) => "Devri kabul et", |
| 150 | (AddCollaboratorButton, En) => "Add collaborator", | 125 | (AddCollaboratorButton, En) => "Add collaborator", |
| 151 | (AddCollaboratorButton, Tr) => "Ortak çalışan ekle", | 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 | (AddOrUpdate, En) => "Add or update a secret", | 127 | (AddOrUpdate, En) => "Add or update a secret", |
| 161 | (AddOrUpdate, Tr) => "Gizli anahtar ekle veya güncelle", | 128 | (AddOrUpdate, Tr) => "Gizli anahtar ekle veya güncelle", |
| 162 | (AllowDeletion, En) => "Deleting the branch", | 129 | (AllowDeletion, En) => "Deleting the branch", |
| @@ -169,24 +136,12 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 169 | (ApprovalsRange, Tr) => "Gerekli onay sayısı 0 ile 20 arasında bir tam sayı olmalıdır.", | 136 | (ApprovalsRange, Tr) => "Gerekli onay sayısı 0 ile 20 arasında bir tam sayı olmalıdır.", |
| 170 | (ArchiveHeading, En) => "Archive", | 137 | (ArchiveHeading, En) => "Archive", |
| 171 | (ArchiveHeading, Tr) => "Arşiv", | 138 | (ArchiveHeading, Tr) => "Arşiv", |
| 172 | - (ArchiveHelp, En) => { | 139 | + (ArchiveConfirm, En) => "Archive this repository?", |
| 173 | - "Archiving makes the repository read-only: pushes are refused, and issues, labels and milestones cannot change. You can unarchive it at any time." | 140 | + (ArchiveConfirm, Tr) => "Depo arşivlensin mi?", |
| 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.", | ||
| 180 | (Cancel, En) => "Cancel", | 141 | (Cancel, En) => "Cancel", |
| 181 | (Cancel, Tr) => "Vazgeç", | 142 | (Cancel, Tr) => "Vazgeç", |
| 182 | (ArchiveRepo, En) => "Archive repository", | 143 | (ArchiveRepo, En) => "Archive repository", |
| 183 | (ArchiveRepo, Tr) => "Depoyu arşivle", | 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 | (ArchivedSecrets, En) => "This repository is archived. Secrets are read-only.", | 145 | (ArchivedSecrets, En) => "This repository is archived. Secrets are read-only.", |
| 191 | (ArchivedSecrets, Tr) => "Bu depo arşivlenmiş. Gizli anahtarlar salt okunurdur.", | 146 | (ArchivedSecrets, Tr) => "Bu depo arşivlenmiş. Gizli anahtarlar salt okunurdur.", |
| 192 | (BadForm, En) => "The form was not understood. Nothing was changed.", | 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 | (BranchPattern, Tr) => "Dal", | 154 | (BranchPattern, Tr) => "Dal", |
| 200 | (BranchProtection, En) => "Branch protection", | 155 | (BranchProtection, En) => "Branch protection", |
| 201 | (BranchProtection, Tr) => "Dal koruması", | 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 | (BranchRuleRemoved, En) => "Branch rule removed.", | 157 | (BranchRuleRemoved, En) => "Branch rule removed.", |
| 209 | (BranchRuleRemoved, Tr) => "Dal kuralı kaldırıldı.", | 158 | (BranchRuleRemoved, Tr) => "Dal kuralı kaldırıldı.", |
| 210 | (BranchRuleSaved, En) => "Branch rule saved.", | 159 | (BranchRuleSaved, En) => "Branch rule saved.", |
| @@ -223,14 +172,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 223 | (CollabRemoved, Tr) => "Ortak çalışan kaldırıldı.", | 172 | (CollabRemoved, Tr) => "Ortak çalışan kaldırıldı.", |
| 224 | (Collaborators, En) => "Collaborators", | 173 | (Collaborators, En) => "Collaborators", |
| 225 | (Collaborators, Tr) => "Ortak çalışanlar", | 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 | (DangerZone, En) => "Danger zone", | 175 | (DangerZone, En) => "Danger zone", |
| 235 | (DangerZone, Tr) => "Tehlikeli bölge", | 176 | (DangerZone, Tr) => "Tehlikeli bölge", |
| 236 | (Decline, En) => "Decline", | 177 | (Decline, En) => "Decline", |
| @@ -245,28 +186,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 245 | (Delete, Tr) => "Sil", | 186 | (Delete, Tr) => "Sil", |
| 246 | (DeleteRepo, En) => "Delete repository", | 187 | (DeleteRepo, En) => "Delete repository", |
| 247 | (DeleteRepo, Tr) => "Depoyu sil", | 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 | (DeletionAllowed, En) => "Deletion allowed", | 189 | (DeletionAllowed, En) => "Deletion allowed", |
| 261 | (DeletionAllowed, Tr) => "Silmeye izin var", | 190 | (DeletionAllowed, Tr) => "Silmeye izin var", |
| 262 | (Description, En) => "Description", | 191 | (Description, En) => "Description", |
| 263 | (Description, Tr) => "Açıklama", | 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 | (DescriptionLong, En) => { | 193 | (DescriptionLong, En) => { |
| 271 | "The description can be at most 350 characters. Nothing was saved." | 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 | (GeneralSaved, Tr) => "Genel ayarlar kaydedildi.", | 210 | (GeneralSaved, Tr) => "Genel ayarlar kaydedildi.", |
| 288 | (MakePublic, En) => "Make public", | 211 | (MakePublic, En) => "Make public", |
| 289 | (MakePublic, Tr) => "Herkese açık yap", | 212 | (MakePublic, Tr) => "Herkese açık yap", |
| 290 | - (MakePublicConfirm, En) => { | 213 | + (MakePublicConfirm, En) => "Make it public?", |
| 291 | - "Make it public? Anyone will be able to read its code, issues and pull requests. It takes effect at once." | 214 | + (MakePublicConfirm, Tr) => "Herkese açık yapılsın mı?", |
| 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 | - } | ||
| 296 | (InvalidRole, En) => "Choose a valid role.", | 215 | (InvalidRole, En) => "Choose a valid role.", |
| 297 | (InvalidRole, Tr) => "Geçerli bir rol seçin.", | 216 | (InvalidRole, Tr) => "Geçerli bir rol seçin.", |
| 298 | - (LastUpdated, En) => "Last updated", | ||
| 299 | - (LastUpdated, Tr) => "Son güncelleme", | ||
| 300 | (Mirrors, En) => "Mirrors", | 217 | (Mirrors, En) => "Mirrors", |
| 301 | (Mirrors, Tr) => "Yansılar", | 218 | (Mirrors, Tr) => "Yansılar", |
| 302 | (Name, En) => "Name", | 219 | (Name, En) => "Name", |
| @@ -319,8 +236,6 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 319 | (NoBranchesYet, Tr) => "Henüz dal yok. Varsayılan dal, ilk gönderimden sonra seçilebilir.", | 236 | (NoBranchesYet, Tr) => "Henüz dal yok. Varsayılan dal, ilk gönderimden sonra seçilebilir.", |
| 320 | (NoCollaborators, En) => "No collaborators yet.", | 237 | (NoCollaborators, En) => "No collaborators yet.", |
| 321 | (NoCollaborators, Tr) => "Henüz ortak çalışan yok.", | 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 | (NoSecrets, En) => "No secrets yet.", | 239 | (NoSecrets, En) => "No secrets yet.", |
| 325 | (NoSecrets, Tr) => "Henüz gizli anahtar yok.", | 240 | (NoSecrets, Tr) => "Henüz gizli anahtar yok.", |
| 326 | (NotCollaborator, En) => "That user is not a collaborator on this repo.", | 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 | (OwnerIsMember, Tr) => { | 246 | (OwnerIsMember, Tr) => { |
| 332 | "Depo sahibi zaten tam erişimli bir üyedir ve ortak çalışan olarak eklenemez." | 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 | (PrivateOption, En) => { | 249 | (PrivateOption, En) => { |
| 339 | "Private: only its owner, collaborators and instance admins can see it. Others get a 404." | 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 | (Remove, Tr) => "Kaldır", | 258 | (Remove, Tr) => "Kaldır", |
| 348 | (RemoveRule, En) => "Remove rule", | 259 | (RemoveRule, En) => "Remove rule", |
| 349 | (RemoveRule, Tr) => "Kuralı kaldır", | 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 | (RenameRepo, En) => "Rename repository", | 261 | (RenameRepo, En) => "Rename repository", |
| 357 | (RenameRepo, Tr) => "Depoyu yeniden adlandır", | 262 | (RenameRepo, Tr) => "Depoyu yeniden adlandır", |
| 358 | - (RenameTransferNav, En) => "Rename & transfer", | ||
| 359 | - (RenameTransferNav, Tr) => "Yeniden adlandır ve devret", | ||
| 360 | (RenamedNotice, En) => "Repository renamed. The old name redirects to the new one.", | 263 | (RenamedNotice, En) => "Repository renamed. The old name redirects to the new one.", |
| 361 | (RenamedNotice, Tr) => "Depo yeniden adlandırıldı. Eski ad yeni ada yönlendirir.", | 264 | (RenamedNotice, Tr) => "Depo yeniden adlandırıldı. Eski ad yeni ada yönlendirir.", |
| 362 | (RepoArchived, En) => "Repository archived.", | 265 | (RepoArchived, En) => "Repository archived.", |
| @@ -377,20 +280,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 377 | (Role, En) => "Role", | 280 | (Role, En) => "Role", |
| 378 | (RestrictPushTitle, Tr) => "Yalnızca çekme istekleri üzerinden", | 281 | (RestrictPushTitle, Tr) => "Yalnızca çekme istekleri üzerinden", |
| 379 | (Role, Tr) => "Rol", | 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 | (Roles, En) => "Roles", | 283 | (Roles, En) => "Roles", |
| 387 | (Roles, Tr) => "Roller", | 284 | (Roles, Tr) => "Roller", |
| 388 | - (RoleTriageDesc, En) => "manage issues", | ||
| 389 | - (RoleTriageDesc, Tr) => "sorunları yönetme", | ||
| 390 | (RoleUpdated, En) => "Role updated.", | 285 | (RoleUpdated, En) => "Role updated.", |
| 391 | (RoleUpdated, Tr) => "Rol güncellendi.", | 286 | (RoleUpdated, Tr) => "Rol güncellendi.", |
| 392 | - (RoleWriteDesc, En) => "push", | ||
| 393 | - (RoleWriteDesc, Tr) => "gönderme (push)", | ||
| 394 | (RequiredChecks, En) => "Required status checks", | 287 | (RequiredChecks, En) => "Required status checks", |
| 395 | (RequiredChecks, Tr) => "Gerekli durum denetimleri", | 288 | (RequiredChecks, Tr) => "Gerekli durum denetimleri", |
| 396 | (RecentContexts, En) => "Recently seen:", | 289 | (RecentContexts, En) => "Recently seen:", |
| @@ -407,44 +300,24 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 407 | (SaveGeneral, Tr) => "Genel ayarları kaydet", | 300 | (SaveGeneral, Tr) => "Genel ayarları kaydet", |
| 408 | (SaveRole, En) => "Save", | 301 | (SaveRole, En) => "Save", |
| 409 | (SaveRole, Tr) => "Kaydet", | 302 | (SaveRole, Tr) => "Kaydet", |
| 410 | - (SaveRule, En) => "Save rule", | ||
| 411 | - (SaveRule, Tr) => "Kuralı kaydet", | ||
| 412 | (SaveSecret, En) => "Save secret", | 303 | (SaveSecret, En) => "Save secret", |
| 413 | (SaveSecret, Tr) => "Gizli anahtarı kaydet", | 304 | (SaveSecret, Tr) => "Gizli anahtarı kaydet", |
| 414 | (SecretDeleted, En) => "Secret deleted.", | 305 | (SecretDeleted, En) => "Secret deleted.", |
| 415 | (SecretDeleted, Tr) => "Gizli anahtar silindi.", | 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 | (SecretMissing, En) => "No secret has that name. Nothing was deleted.", | 307 | (SecretMissing, En) => "No secret has that name. Nothing was deleted.", |
| 419 | (SecretMissing, Tr) => "Bu adda bir gizli anahtar yok. Hiçbir şey silinmedi.", | 308 | (SecretMissing, Tr) => "Bu adda bir gizli anahtar yok. Hiçbir şey silinmedi.", |
| 420 | (SecretSaved, En) => "Secret saved. Its value is not shown again.", | 309 | (SecretSaved, En) => "Secret saved. Its value is not shown again.", |
| 421 | (SecretSaved, Tr) => "Gizli anahtar kaydedildi. Değeri bir daha gösterilmez.", | 310 | (SecretSaved, Tr) => "Gizli anahtar kaydedildi. Değeri bir daha gösterilmez.", |
| 422 | (Secrets, En) => "Secrets", | 311 | (Secrets, En) => "Secrets", |
| 423 | (Secrets, Tr) => "Gizli anahtarlar", | 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 | (SectionChecks, En) => "Checks", | 313 | (SectionChecks, En) => "Checks", |
| 431 | (SectionPullRequests, En) => "Pull requests", | 314 | (SectionPullRequests, En) => "Pull requests", |
| 432 | - (SectionPattern, En) => "Pattern", | ||
| 433 | (SectionPushes, En) => "Pushes", | 315 | (SectionPushes, En) => "Pushes", |
| 434 | (SettingsNavLabel, En) => "Settings", | 316 | (SettingsNavLabel, En) => "Settings", |
| 435 | (SectionChecks, Tr) => "Denetimler", | 317 | (SectionChecks, Tr) => "Denetimler", |
| 436 | (SectionPullRequests, Tr) => "Çekme istekleri", | 318 | (SectionPullRequests, Tr) => "Çekme istekleri", |
| 437 | - (SectionPattern, Tr) => "Desen", | ||
| 438 | (SectionPushes, Tr) => "Gönderimler", | 319 | (SectionPushes, Tr) => "Gönderimler", |
| 439 | (SettingsNavLabel, Tr) => "Ayarlar", | 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 | (TransferRepo, En) => "Transfer repository", | 321 | (TransferRepo, En) => "Transfer repository", |
| 449 | (TransferRepo, Tr) => "Depoyu devret", | 322 | (TransferRepo, Tr) => "Depoyu devret", |
| 450 | (TransferTitle, En) => "Transfer", | 323 | (TransferTitle, En) => "Transfer", |
| @@ -473,30 +346,14 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 473 | (VisibilityChanged, Tr) => "Görünürlük değiştirildi.", | 346 | (VisibilityChanged, Tr) => "Görünürlük değiştirildi.", |
| 474 | (VisibilityHeading, En) => "Visibility", | 347 | (VisibilityHeading, En) => "Visibility", |
| 475 | (VisibilityHeading, Tr) => "Görünürlük", | 348 | (VisibilityHeading, Tr) => "Görünürlük", |
| 476 | - (MakePrivateConfirm, En) => { | 349 | + (MakePrivateConfirm, En) => "Make it private?", |
| 477 | - "Make it private? Only its owner, collaborators and instance admins will see it; others get a 404. It takes effect at once." | 350 | + (MakePrivateConfirm, Tr) => "Özel yapılsın mı?", |
| 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 | - } | ||
| 482 | (Webhooks, En) => "Webhooks", | 351 | (Webhooks, En) => "Webhooks", |
| 483 | (Webhooks, Tr) => "Web kancaları", | 352 | (Webhooks, Tr) => "Web kancaları", |
| 484 | - } | 353 | + (Features, En) => "Features", |
| 485 | -} | 354 | + (Features, Tr) => "Özellikler", |
| 486 | - | 355 | + (RenameHeading, En) => "Rename", |
| 487 | -/// The page title of the rename and transfer page. | 356 | + (RenameHeading, Tr) => "Yeniden adlandır", |
| 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"), | ||
| 500 | } | 357 | } |
| 501 | } | 358 | } |
| 502 | 359 | ||
| @@ -633,18 +490,14 @@ mod tests { | |||
| 633 | K::Accept, | 490 | K::Accept, |
| 634 | K::AcceptTransfer, | 491 | K::AcceptTransfer, |
| 635 | K::AddCollaboratorButton, | 492 | K::AddCollaboratorButton, |
| 636 | - K::AddCollaboratorHeading, | ||
| 637 | - K::AddCollaboratorHelp, | ||
| 638 | K::AddOrUpdate, | 493 | K::AddOrUpdate, |
| 639 | K::AllowDeletion, | 494 | K::AllowDeletion, |
| 640 | K::AllowForcePush, | 495 | K::AllowForcePush, |
| 641 | K::AlreadyOwner, | 496 | K::AlreadyOwner, |
| 642 | K::ApprovalsRange, | 497 | K::ApprovalsRange, |
| 643 | K::ArchiveHeading, | 498 | K::ArchiveHeading, |
| 644 | - K::ArchiveHelp, | ||
| 645 | K::ArchiveConfirm, | 499 | K::ArchiveConfirm, |
| 646 | K::ArchiveRepo, | 500 | K::ArchiveRepo, |
| 647 | - K::ArchivedHelp, | ||
| 648 | K::ArchivedSecrets, | 501 | K::ArchivedSecrets, |
| 649 | K::Cancel, | 502 | K::Cancel, |
| 650 | K::BadForm, | 503 | K::BadForm, |
| @@ -652,7 +505,6 @@ mod tests { | |||
| 652 | K::BranchMissing, | 505 | K::BranchMissing, |
| 653 | K::BranchPattern, | 506 | K::BranchPattern, |
| 654 | K::BranchProtection, | 507 | K::BranchProtection, |
| 655 | - K::BranchProtectionHelp, | ||
| 656 | K::BranchRuleRemoved, | 508 | K::BranchRuleRemoved, |
| 657 | K::BranchRuleSaved, | 509 | K::BranchRuleSaved, |
| 658 | K::BuiltinRowText, | 510 | K::BuiltinRowText, |
| @@ -662,8 +514,6 @@ mod tests { | |||
| 662 | K::CollabAdded, | 514 | K::CollabAdded, |
| 663 | K::CollabRemoved, | 515 | K::CollabRemoved, |
| 664 | K::Collaborators, | 516 | K::Collaborators, |
| 665 | - K::CollaboratorsHelp, | ||
| 666 | - K::ColUser, | ||
| 667 | K::DangerZone, | 517 | K::DangerZone, |
| 668 | K::Decline, | 518 | K::Decline, |
| 669 | K::DeclineTransfer, | 519 | K::DeclineTransfer, |
| @@ -671,11 +521,8 @@ mod tests { | |||
| 671 | K::DefaultBranchFailed, | 521 | K::DefaultBranchFailed, |
| 672 | K::Delete, | 522 | K::Delete, |
| 673 | K::DeleteRepo, | 523 | K::DeleteRepo, |
| 674 | - K::DeleteRepoHelp, | ||
| 675 | - K::DeleteTrashHelp, | ||
| 676 | K::DeletionAllowed, | 524 | K::DeletionAllowed, |
| 677 | K::Description, | 525 | K::Description, |
| 678 | - K::DescriptionHelp, | ||
| 679 | K::DescriptionLong, | 526 | K::DescriptionLong, |
| 680 | K::EditRule, | 527 | K::EditRule, |
| 681 | K::EnterUsername, | 528 | K::EnterUsername, |
| @@ -686,7 +533,6 @@ mod tests { | |||
| 686 | K::MakePublic, | 533 | K::MakePublic, |
| 687 | K::MakePublicConfirm, | 534 | K::MakePublicConfirm, |
| 688 | K::InvalidRole, | 535 | K::InvalidRole, |
| 689 | - K::LastUpdated, | ||
| 690 | K::Mirrors, | 536 | K::Mirrors, |
| 691 | K::Name, | 537 | K::Name, |
| 692 | K::NameRule, | 538 | K::NameRule, |
| @@ -695,19 +541,14 @@ mod tests { | |||
| 695 | K::AddRule, | 541 | K::AddRule, |
| 696 | K::NoBranchesYet, | 542 | K::NoBranchesYet, |
| 697 | K::NoCollaborators, | 543 | K::NoCollaborators, |
| 698 | - K::NoPendingTransfer, | ||
| 699 | K::NoSecrets, | 544 | K::NoSecrets, |
| 700 | K::NotCollaborator, | 545 | K::NotCollaborator, |
| 701 | K::OwnerIsMember, | 546 | K::OwnerIsMember, |
| 702 | - K::PatternHelp, | ||
| 703 | - K::PendingTransfers, | ||
| 704 | K::PrivateOption, | 547 | K::PrivateOption, |
| 705 | K::PublicOption, | 548 | K::PublicOption, |
| 706 | K::Remove, | 549 | K::Remove, |
| 707 | K::RemoveRule, | 550 | K::RemoveRule, |
| 708 | - K::RenameHelp, | ||
| 709 | K::RenameRepo, | 551 | K::RenameRepo, |
| 710 | - K::RenameTransferNav, | ||
| 711 | K::RenamedNotice, | 552 | K::RenamedNotice, |
| 712 | K::RepoArchived, | 553 | K::RepoArchived, |
| 713 | K::RepoDeletedAfter, | 554 | K::RepoDeletedAfter, |
| @@ -718,13 +559,8 @@ mod tests { | |||
| 718 | K::RequiredApprovals, | 559 | K::RequiredApprovals, |
| 719 | K::RestrictPushTitle, | 560 | K::RestrictPushTitle, |
| 720 | K::Role, | 561 | K::Role, |
| 721 | - K::RoleAdminDesc, | ||
| 722 | - K::RoleMaintainDesc, | ||
| 723 | - K::RoleReadDesc, | ||
| 724 | K::Roles, | 562 | K::Roles, |
| 725 | - K::RoleTriageDesc, | ||
| 726 | K::RoleUpdated, | 563 | K::RoleUpdated, |
| 727 | - K::RoleWriteDesc, | ||
| 728 | K::RequiredChecks, | 564 | K::RequiredChecks, |
| 729 | K::RecentContexts, | 565 | K::RecentContexts, |
| 730 | K::RuleChangesShort, | 566 | K::RuleChangesShort, |
| @@ -733,21 +569,15 @@ mod tests { | |||
| 733 | K::RuleUpToDateShort, | 569 | K::RuleUpToDateShort, |
| 734 | K::SaveGeneral, | 570 | K::SaveGeneral, |
| 735 | K::SaveRole, | 571 | K::SaveRole, |
| 736 | - K::SaveRule, | ||
| 737 | K::SaveSecret, | 572 | K::SaveSecret, |
| 738 | K::SecretDeleted, | 573 | K::SecretDeleted, |
| 739 | - K::SecretLimits, | ||
| 740 | K::SecretMissing, | 574 | K::SecretMissing, |
| 741 | K::SecretSaved, | 575 | K::SecretSaved, |
| 742 | K::Secrets, | 576 | K::Secrets, |
| 743 | - K::SecretsHelp, | ||
| 744 | K::SectionChecks, | 577 | K::SectionChecks, |
| 745 | K::SectionPullRequests, | 578 | K::SectionPullRequests, |
| 746 | - K::SectionPattern, | ||
| 747 | K::SectionPushes, | 579 | K::SectionPushes, |
| 748 | K::SettingsNavLabel, | 580 | K::SettingsNavLabel, |
| 749 | - K::StartTransferLink, | ||
| 750 | - K::TransferHelp, | ||
| 751 | K::TransferRepo, | 581 | K::TransferRepo, |
| 752 | K::TransferTitle, | 582 | K::TransferTitle, |
| 753 | K::TransferredNotice, | 583 | K::TransferredNotice, |
| @@ -763,6 +593,8 @@ mod tests { | |||
| 763 | K::VisibilityHeading, | 593 | K::VisibilityHeading, |
| 764 | K::MakePrivateConfirm, | 594 | K::MakePrivateConfirm, |
| 765 | K::Webhooks, | 595 | K::Webhooks, |
| 596 | + K::Features, | ||
| 597 | + K::RenameHeading, | ||
| 766 | ]; | 598 | ]; |
| 767 | 599 | ||
| 768 | #[test] | 600 | #[test] |
crates/forge-web/assets/nav.jsmodified+42 -222
| @@ -765,7 +765,7 @@ | |||
| 765 | settings: function () { refreshLive(true); }, | 765 | settings: function () { refreshLive(true); }, |
| 766 | // The inbox count changed (see `unreadChanged` above). | 766 | // The inbox count changed (see `unreadChanged` above). |
| 767 | unread: unreadChanged, | 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 | activity: function () { refreshActivity(); } | 769 | activity: function () { refreshActivity(); } |
| 770 | }); | 770 | }); |
| 771 | document.addEventListener('visibilitychange', function () { | 771 | document.addEventListener('visibilitychange', function () { |
| @@ -871,60 +871,39 @@ | |||
| 871 | closeDropdowns(e.target && e.target.nodeType === 1 ? e.target : null); | 871 | closeDropdowns(e.target && e.target.nodeType === 1 ? e.target : null); |
| 872 | }, false); | 872 | }, false); |
| 873 | 873 | ||
| 874 | - // A mouse that rests on the profile corner opens its account menu, or the bell popover on the bell, | 874 | + // A mouse that rests on the profile corner opens its account menu after a short rest; when it |
| 875 | - // after a short rest; when it leaves, the menu or popover it opened closes. Touch and keyboard | 875 | + // leaves, the menu it opened closes. Touch and keyboard keep the click. hoverOn says the mouse |
| 876 | - // keep the click. hoverOn names what the mouse opened; hoverWait says whether the pending timer | 876 | + // opened the menu; hoverTimer is the pending show or hide, and hoverWait says which. |
| 877 | - // shows it or hides it. | 877 | + var HOVER_OPEN = 120; // a mouse rests this long before the menu opens |
| 878 | - var HOVER_OPEN = 120; // a mouse rests this long before a menu opens | ||
| 879 | var HOVER_CLOSE = 250; // and may leave this long, enough to cross the gap to the menu | 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 | var hoverTimer = 0; | 880 | var hoverTimer = 0; |
| 882 | var hoverWait = ''; // 'show' or 'hide': what the pending timer does | 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 | 882 | + |
| 884 | - | 883 | + function inCorner(node) { |
| 885 | - // The part of the profile a node belongs to: 'bell' for the notifications row and its popover | 884 | + return !!(node && node.closest && node.closest('.corner-float')); |
| 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; | ||
| 892 | } | 885 | } |
| 893 | 886 | ||
| 894 | - // Whether the account menu or the bell popover is open right now. | 887 | + function menuOpen() { |
| 895 | - function hoverIsOpen(kind) { | ||
| 896 | - if (kind === 'menu') { | ||
| 897 | var details = document.querySelector('details.corner'); | 888 | var details = document.querySelector('details.corner'); |
| 898 | return !!(details && details.open); | 889 | return !!(details && details.open); |
| 899 | } | 890 | } |
| 900 | - var pop = document.querySelector('.bell-pop'); | ||
| 901 | - return !!(pop && isPeekOpen(pop)); | ||
| 902 | - } | ||
| 903 | 891 | ||
| 904 | - // Opens the menu, or the bell popover beside it, for a resting mouse. A menu the reader opened by | 892 | + // Opens the menu for a resting mouse. A menu the reader opened by click or keyboard is left alone. |
| 905 | - // click or keyboard is left alone. The popover sits inside the menu, so the menu stays open under it. | 893 | + function hoverShow() { |
| 906 | - function hoverShow(kind) { | 894 | + if (!hoverOn && menuOpen()) { return; } |
| 907 | - if (!hoverOn && hoverIsOpen(kind)) { return; } | ||
| 908 | var details = document.querySelector('details.corner'); | 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; } | 896 | if (details) { details.open = true; } |
| 913 | - } else { | 897 | + hoverOn = true; |
| 914 | - try { if (pop) { pop.showPopover(); } } catch (err) { } | ||
| 915 | - } | ||
| 916 | - hoverOn = kind; | ||
| 917 | } | 898 | } |
| 918 | 899 | ||
| 919 | - // Closes what the mouse opened, and forgets it. | 900 | + // Closes the menu the mouse opened, and forgets it. |
| 920 | function hoverHide() { | 901 | function hoverHide() { |
| 921 | if (hoverOn) { | 902 | if (hoverOn) { |
| 922 | - var pop = document.querySelector('.bell-pop'); | ||
| 923 | var details = document.querySelector('details.corner'); | 903 | var details = document.querySelector('details.corner'); |
| 924 | - try { if (pop) { pop.hidePopover(); } } catch (err) { } | ||
| 925 | if (details) { details.open = false; } | 904 | if (details) { details.open = false; } |
| 926 | } | 905 | } |
| 927 | - hoverOn = null; | 906 | + hoverOn = false; |
| 928 | } | 907 | } |
| 929 | 908 | ||
| 930 | // A mouse entering the corner starts a show (a fresh rest each time it moves within it). Leaving the | 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 | // page does not keep pushing the hide back. | 911 | // page does not keep pushing the hide back. |
| 933 | document.addEventListener('pointerover', function (e) { | 912 | document.addEventListener('pointerover', function (e) { |
| 934 | if (e.pointerType !== 'mouse') { return; } | 913 | if (e.pointerType !== 'mouse') { return; } |
| 935 | - var kind = hoverKind(e.target); | 914 | + if (inCorner(e.target)) { |
| 936 | - if (hoverMute) { | ||
| 937 | - if (kind === 'bell') { return; } | ||
| 938 | - hoverMute = false; | ||
| 939 | - } | ||
| 940 | - if (kind) { | ||
| 941 | clearTimeout(hoverTimer); | 915 | clearTimeout(hoverTimer); |
| 942 | hoverTimer = 0; | 916 | hoverTimer = 0; |
| 943 | - if (kind === hoverOn && hoverIsOpen(kind)) { return; } | 917 | + if (hoverOn && menuOpen()) { return; } |
| 944 | hoverWait = 'show'; | 918 | hoverWait = 'show'; |
| 945 | hoverTimer = setTimeout(function () { | 919 | hoverTimer = setTimeout(function () { |
| 946 | hoverTimer = 0; | 920 | hoverTimer = 0; |
| 947 | - hoverShow(kind); | 921 | + hoverShow(); |
| 948 | }, HOVER_OPEN); | 922 | }, HOVER_OPEN); |
| 949 | return; | 923 | return; |
| 950 | } | 924 | } |
| @@ -963,153 +937,14 @@ | |||
| 963 | 937 | ||
| 964 | // A click on the menu's summary, while the mouse holds it open, does nothing: the menu stays open. | 938 | // A click on the menu's summary, while the mouse holds it open, does nothing: the menu stays open. |
| 965 | window.addEventListener('click', function (e) { | 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 | if (!e.target.closest('summary.corner-btn')) { return; } | 941 | if (!e.target.closest('summary.corner-btn')) { return; } |
| 968 | e.preventDefault(); | 942 | e.preventDefault(); |
| 969 | }, true); | 943 | }, true); |
| 970 | 944 | ||
| 971 | - // The bell beside the profile corner opens a popover of the newest notifications instead of going | 945 | + // A swap that took the mouse's menu away leaves nothing for hover to close. |
| 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 () { | 946 | document.addEventListener('forge:swapped', function () { |
| 1106 | - document.querySelectorAll('.bell-pop').forEach(function (pop) { | 947 | + if (hoverOn && !menuOpen()) { hoverOn = false; } |
| 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. | ||
| 1111 | - document.addEventListener('forge:swapped', function () { | ||
| 1112 | - if (hoverOn && !hoverIsOpen(hoverOn)) { hoverOn = null; } | ||
| 1113 | }); | 948 | }); |
| 1114 | 949 | ||
| 1115 | // Escape closes the open dropdowns and returns focus to the summary of the one that held it. | 950 | // Escape closes the open dropdowns and returns focus to the summary of the one that held it. |
| @@ -1979,7 +1814,7 @@ | |||
| 1979 | // looked up on each update. The count arrives as an `unread` event of the shell stream (see | 1814 | // looked up on each update. The count arrives as an `unread` event of the shell stream (see |
| 1980 | // `/-/shell/events`, opened with the alive handlers above), which the server pushes on each change; | 1815 | // `/-/shell/events`, opened with the alive handlers above), which the server pushes on each change; |
| 1981 | // nothing polls. Each `unread` event also refreshes the activity (below). The count shows on the | 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 | // Shows the count in one link the way the server renders it: a span with the number, or no span at zero. | 1819 | // Shows the count in one link the way the server renders it: a span with the number, or no span at zero. |
| 1985 | function setCount(el, cls, n) { | 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 | function setUnread(n) { | 1845 | function setUnread(n) { |
| 2000 | - // The bell of the profile corner, `.bell-count` as the server renders it. | 1846 | + // The notifications row of the profile corner, `.bell-count` as the server renders it. |
| 2001 | - var bells = document.querySelectorAll('.corner-bell'); | 1847 | + var rows = document.querySelectorAll('.corner-bell'); |
| 2002 | - for (var i = 0; i < bells.length; i++) { setCount(bells[i], 'bell-count', n); } | 1848 | + for (var i = 0; i < rows.length; i++) { setCount(rows[i], 'bell-count', n); } |
| 1849 | + paintCorner(); | ||
| 2003 | } | 1850 | } |
| 2004 | 1851 | ||
| 2005 | // An `unread` event: the count, then the activity is fetched again. | 1852 | // An `unread` event: the count, then the activity is fetched again. |
| @@ -2008,8 +1855,7 @@ | |||
| 2008 | refreshActivity(); | 1855 | refreshActivity(); |
| 2009 | } | 1856 | } |
| 2010 | 1857 | ||
| 2011 | - // The live activity: the profile corner (heat ring, chips) and the live strip after | 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 |
| 2012 | - // the path bar. The server's activity JSON (GET /-/activity) is the source. An `activity` event of | ||
| 2013 | // the shell stream, and every `unread` event, fetches it again and redraws whatever is on the page. | 1859 | // the shell stream, and every `unread` event, fetches it again and redraws whatever is on the page. |
| 2014 | // Nothing changes before the JSON says so. A finished run leaves the strip when the server's window | 1860 | // Nothing changes before the JSON says so. A finished run leaves the strip when the server's window |
| 2015 | // ends, so while any is listed the JSON is fetched again every 30 s. | 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}` | 1968 | + // Redraws every strip from one activity JSON, and the avatar's dot from its waiting counts. The |
| 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 | ||
| 2149 | // elements are looked up here each time, since a swap may have replaced them. | 1969 | // elements are looked up here each time, since a swap may have replaced them. |
| 2150 | function drawActivity(json) { | 1970 | function drawActivity(json) { |
| 2151 | var strips = document.querySelectorAll('.live-strip[data-activity]'); | 1971 | var strips = document.querySelectorAll('.live-strip[data-activity]'); |
| 2152 | for (var i = 0; i < strips.length; i++) { drawStrip(strips[i], json); } | 1972 | for (var i = 0; i < strips.length; i++) { drawStrip(strips[i], json); } |
| 2153 | - var boxes = document.querySelectorAll('.corner-chips'); | 1973 | + waitingNow = (Number(json.reviews) || 0) + (Number(json.mentions) || 0) + (Number(json.failing) || 0) > 0; |
| 2154 | - for (var b = 0; b < boxes.length; b++) { drawChips(boxes[b], json); } | 1974 | + paintCorner(); |
| 2155 | // Finished runs leave the strip when the server's window ends, so the JSON is asked for again. | 1975 | // Finished runs leave the strip when the server's window ends, so the JSON is asked for again. |
| 2156 | clearTimeout(activityTimer); | 1976 | clearTimeout(activityTimer); |
| 2157 | activityTimer = null; | 1977 | activityTimer = null; |
crates/forge-web/src/pages/admin_backups.rsmodified+84 -71
| @@ -1,9 +1,13 @@ | |||
| 1 | //! Page: backups (`/admin/backups`). Instance admins only; anyone else gets 404. | 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), | 3 | +//! Shows the backup settings as a settings topic, saved here (`POST /admin/backups`, the same rows |
| 4 | -//! the last 20 backup and fsck runs, and two POST buttons that start a run in the background. | 4 | +//! and save as the server settings), then the last 20 backup and fsck runs, and two POST buttons |
| 5 | -//! A button press is audited and redirects back here with a notice. | 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 | use forge_core::store::backup_runs::{BackupRun, RunKind}; | 11 | use forge_core::store::backup_runs::{BackupRun, RunKind}; |
| 8 | use forge_core::{AuditAction, Error, Store, User}; | 12 | use forge_core::{AuditAction, Error, Store, User}; |
| 9 | use serde::Deserialize; | 13 | use serde::Deserialize; |
| @@ -19,13 +23,16 @@ use crate::audit::{self, Actor, Target}; | |||
| 19 | use crate::auth::check_csrf; | 23 | use crate::auth::check_csrf; |
| 20 | use crate::backup::scheduler::{configured_dir, start_manual}; | 24 | use crate::backup::scheduler::{configured_dir, start_manual}; |
| 21 | use crate::i18n::admin::{self as g, K}; | 25 | use crate::i18n::admin::{self as g, K}; |
| 22 | -use crate::i18n::{self, Lang}; | 26 | +use crate::i18n::{self, Key, Lang}; |
| 23 | use crate::live::{Topic, stream_changes}; | 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 | use crate::pages::admin_users::admin_only; | 31 | use crate::pages::admin_users::admin_only; |
| 25 | use crate::pages::issues_list::stamp_unix; | 32 | use crate::pages::issues_list::stamp_unix; |
| 26 | use crate::state::AppState; | 33 | use crate::state::AppState; |
| 27 | -use crate::views::parts::{SubPart, head, post_act}; | 34 | +use crate::views::parts::{RailItem, head, post_act, rail}; |
| 28 | -use crate::views::{enc, rel_time, shell}; | 35 | +use crate::views::{alert, enc, rel_time, shell}; |
| 29 | 36 | ||
| 30 | /// Runs shown on the page. | 37 | /// Runs shown on the page. |
| 31 | const RUN_LIMIT: u32 = 20; | 38 | const RUN_LIMIT: u32 = 20; |
| @@ -52,35 +59,6 @@ struct RunRow { | |||
| 52 | detail: String, | 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 | /// `"512 B"`, `"12.3 KiB"`, `"4.0 MiB"` and so on. | 62 | /// `"512 B"`, `"12.3 KiB"`, `"4.0 MiB"` and so on. |
| 85 | fn human_bytes(bytes: u64) -> String { | 63 | fn human_bytes(bytes: u64) -> String { |
| 86 | const UNITS: [&str; 4] = ["KiB", "MiB", "GiB", "TiB"]; | 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 | #[component] | 132 | #[component] |
| 133 | async fn backups_view( | 133 | async fn backups_view( |
| 134 | lang: Lang, | 134 | lang: Lang, |
| 135 | csrf: String, | 135 | csrf: String, |
| 136 | - settings: Settings, | 136 | + enabled: bool, |
| 137 | + settings: Vec<Row>, | ||
| 137 | rows: Vec<RunRow>, | 138 | rows: Vec<RunRow>, |
| 138 | running: Option<RunKind>, | 139 | running: Option<RunKind>, |
| 139 | notice: Option<String>, | 140 | notice: Option<String>, |
| @@ -142,9 +143,8 @@ async fn backups_view( | |||
| 142 | matches!(running, Some(RunKind::Backup)).then(|| g::running_line(lang, RunKind::Backup)); | 143 | matches!(running, Some(RunKind::Backup)).then(|| g::running_line(lang, RunKind::Backup)); |
| 143 | let fsck_running = | 144 | let fsck_running = |
| 144 | matches!(running, Some(RunKind::Fsck)).then(|| g::running_line(lang, RunKind::Fsck)); | 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 | Ok(view! { | 146 | Ok(view! { |
| 147 | - head(title: g::t(lang, K::Backups), sub: sub, | 147 | + head(title: g::t(lang, K::Backups), |
| 148 | <form id="run-backup" method="post" action="/admin/backups/run" class="act-form"> | 148 | <form id="run-backup" method="post" action="/admin/backups/run" class="act-form"> |
| 149 | <input type="hidden" name="csrf" value=(csrf.as_str())> | 149 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 150 | <button type="submit" class="button">(g::t(lang, K::RunBackupNow))</button> | 150 | <button type="submit" class="button">(g::t(lang, K::RunBackupNow))</button> |
| @@ -154,6 +154,8 @@ async fn backups_view( | |||
| 154 | if let Some(message) = notice { | 154 | if let Some(message) = notice { |
| 155 | <p class="state" role="status">(message.as_str())</p> | 155 | <p class="state" role="status">(message.as_str())</p> |
| 156 | } | 156 | } |
| 157 | + <div class="work"> | ||
| 158 | + backups_rail(lang: lang, current: "backups") | ||
| 157 | <div class="sheet" data-live="/admin/backups/events"> | 159 | <div class="sheet" data-live="/admin/backups/events"> |
| 158 | if let Some(line) = backup_running { | 160 | if let Some(line) = backup_running { |
| 159 | <p class="state">(line)</p> | 161 | <p class="state">(line)</p> |
| @@ -162,57 +164,42 @@ async fn backups_view( | |||
| 162 | <p class="state">(line)</p> | 164 | <p class="state">(line)</p> |
| 163 | } | 165 | } |
| 164 | <section class="sec"> | 166 | <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> | 167 | <h2>(g::t(lang, K::Settings))</h2> |
| 168 | + if !enabled { | ||
| 189 | <p class="state">(g::t(lang, K::ScheduledBackupsOff))</p> | 169 | <p class="state">(g::t(lang, K::ScheduledBackupsOff))</p> |
| 190 | } | 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> | ||
| 177 | + </div> | ||
| 178 | + </form> | ||
| 179 | + reset_form(csrf: csrf.clone(), back: "/admin/backups".to_owned()) | ||
| 191 | </section> | 180 | </section> |
| 192 | <section class="sec"> | 181 | <section class="sec"> |
| 193 | <h2>(g::t(lang, K::RecentRuns))</h2> | 182 | <h2>(g::t(lang, K::RecentRuns))</h2> |
| 194 | if rows.is_empty() { | 183 | if rows.is_empty() { |
| 195 | <p class="state">(g::t(lang, K::NoRunsYet))</p> | 184 | <p class="state">(g::t(lang, K::NoRunsYet))</p> |
| 196 | - <p class="hint">(g::t(lang, K::BackupsEmptyHint))</p> | ||
| 197 | } else { | 185 | } else { |
| 198 | for row in rows.into_iter() { | 186 | for row in rows.into_iter() { |
| 199 | <div class="line" data-kb-row=""> | 187 | <div class="line" data-kb-row=""> |
| 200 | <span class="name">(row.kind.as_str()) " · " (row.trigger.as_str())</span> | 188 | <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> | 189 | + <span class="val">(row.status.as_str()) " · " rel_time(lang: lang, stamp: row.started.as_str()) " · " (row.duration.as_str()) |
| 202 | - </div> | ||
| 203 | - <p class="hint"> | ||
| 204 | - (row.duration.as_str()) | ||
| 205 | if !row.size.is_empty() { | 190 | if !row.size.is_empty() { |
| 206 | " · " (row.size.as_str()) | 191 | " · " (row.size.as_str()) |
| 207 | } | 192 | } |
| 208 | - </p> | 193 | + </span> |
| 194 | + </div> | ||
| 209 | if !row.detail.is_empty() { | 195 | if !row.detail.is_empty() { |
| 210 | - <p class="hint bad">(row.detail.as_str())</p> | 196 | + alert(message: row.detail.as_str()) |
| 211 | } | 197 | } |
| 212 | } | 198 | } |
| 213 | } | 199 | } |
| 214 | </section> | 200 | </section> |
| 215 | </div> | 201 | </div> |
| 202 | + </div> | ||
| 216 | }) | 203 | }) |
| 217 | } | 204 | } |
| 218 | 205 | ||
| @@ -251,14 +238,40 @@ async fn backups_page(cx: &Cx) -> Result<impl View> { | |||
| 251 | let runs = state.store.recent_runs(RUN_LIMIT).await?; | 238 | let runs = state.store.recent_runs(RUN_LIMIT).await?; |
| 252 | let rows: Vec<RunRow> = runs.iter().map(|run| run_row(run, lang)).collect(); | 239 | let rows: Vec<RunRow> = runs.iter().map(|run| run_row(run, lang)).collect(); |
| 253 | let running = state.jobs.running(); | 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 | let csrf = viewer.1.csrf_token.clone(); | 243 | let csrf = viewer.1.csrf_token.clone(); |
| 256 | let title = g::t(lang, K::Backups); | 244 | let title = g::t(lang, K::Backups); |
| 257 | Ok(view! { | 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 | #[route(POST "/admin/backups/run")] | 275 | #[route(POST "/admin/backups/run")] |
| 263 | async fn backups_run(cx: &Cx, Form(form): Form<RunForm>) -> Result<Response> { | 276 | async fn backups_run(cx: &Cx, Form(form): Form<RunForm>) -> Result<Response> { |
| 264 | start_run(cx, form.csrf, RunKind::Backup).await | 277 | start_run(cx, form.csrf, RunKind::Backup).await |
| @@ -535,7 +548,7 @@ mod tests { | |||
| 535 | assert_eq!(status, 200); | 548 | assert_eq!(status, 200); |
| 536 | assert!(body.contains("schedule")); | 549 | assert!(body.contains("schedule")); |
| 537 | assert!(body.contains("disk full")); | 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 | assert!( | 552 | assert!( |
| 540 | !body.contains("SECRET-TOKEN"), | 553 | !body.contains("SECRET-TOKEN"), |
| 541 | "the healthcheck token must not be shown" | 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 | class: "b health-sum ok", | 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 | Ok(view! { | 514 | Ok(view! { |
| 515 | head(title: at(lang, A::Health), sub: sub, live: Some("/admin/health/events")) | 515 | head(title: at(lang, A::Health), sub: sub, live: Some("/admin/health/events")) |
| 516 | <div class="sheet health-sheet"> | 516 | <div class="sheet health-sheet"> |
crates/forge-web/src/pages/admin_mail.rsmodified+43 -28
| @@ -7,10 +7,12 @@ | |||
| 7 | //! saved setting re-renders the tab through `/admin/mail/events` with no reload and no polling. | 7 | //! saved setting re-renders the tab through `/admin/mail/events` with no reload and no polling. |
| 8 | //! Saving the settings and queuing a test are audited. | 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 | use forge_core::mail::{ | 12 | use forge_core::mail::{ |
| 12 | MailKind, MailSettings, MailSettingsUpdate, MailState, OutboxEntry, Security, | 13 | MailKind, MailSettings, MailSettingsUpdate, MailState, OutboxEntry, Security, |
| 13 | }; | 14 | }; |
| 15 | +use forge_core::server_settings::Group; | ||
| 14 | use forge_core::time::now_stamp; | 16 | use forge_core::time::now_stamp; |
| 15 | use forge_core::{AuditAction, Error}; | 17 | use forge_core::{AuditAction, Error}; |
| 16 | use futures_util::{Stream, stream}; | 18 | use futures_util::{Stream, stream}; |
| @@ -30,10 +32,13 @@ use crate::auth::check_csrf; | |||
| 30 | use crate::i18n::admin::{self as g, K}; | 32 | use crate::i18n::admin::{self as g, K}; |
| 31 | use crate::i18n::{self, Key, Lang}; | 33 | use crate::i18n::{self, Key, Lang}; |
| 32 | use crate::mail::{enqueue, live, templates}; | 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 | use crate::pages::admin_users::admin_only; | 38 | use crate::pages::admin_users::admin_only; |
| 34 | use crate::pages::ci_runs::{changed_event, events_response}; | 39 | use crate::pages::ci_runs::{changed_event, events_response}; |
| 35 | use crate::state::AppState; | 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 | use crate::views::{enc, rel_time, shell}; | 42 | use crate::views::{enc, rel_time, shell}; |
| 38 | 43 | ||
| 39 | /// Rows shown in the queue at most. | 44 | /// Rows shown in the queue at most. |
| @@ -93,7 +98,8 @@ struct PageData { | |||
| 93 | from_name: String, | 98 | from_name: String, |
| 94 | enabled: bool, | 99 | enabled: bool, |
| 95 | has_password: bool, | 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 | tab: Tab, | 103 | tab: Tab, |
| 98 | queue: Option<QueueData>, | 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 | fn row_view(entry: &OutboxEntry, now: &str, lang: Lang) -> QueueRow { | 119 | fn row_view(entry: &OutboxEntry, now: &str, lang: Lang) -> QueueRow { |
| 121 | let state = entry.state_at(now); | 120 | let state = entry.state_at(now); |
| 122 | QueueRow { | 121 | QueueRow { |
| @@ -182,6 +181,7 @@ async fn page_data( | |||
| 182 | Tab::Queue => Some(queue_data(state, lang, filter).await?), | 181 | Tab::Queue => Some(queue_data(state, lang, filter).await?), |
| 183 | Tab::Settings => None, | 182 | Tab::Settings => None, |
| 184 | }; | 183 | }; |
| 184 | + let transport = setting_rows(state, lang, MAIL_KEYS).await?; | ||
| 185 | Ok(PageData { | 185 | Ok(PageData { |
| 186 | host: settings.host, | 186 | host: settings.host, |
| 187 | port: settings.port.to_string(), | 187 | port: settings.port.to_string(), |
| @@ -191,7 +191,7 @@ async fn page_data( | |||
| 191 | from_name: settings.from_name, | 191 | from_name: settings.from_name, |
| 192 | enabled: settings.enabled, | 192 | enabled: settings.enabled, |
| 193 | has_password: settings.has_password, | 193 | has_password: settings.has_password, |
| 194 | - transport: transport_name(state.config.mail.transport), | 194 | + transport, |
| 195 | tab, | 195 | tab, |
| 196 | queue, | 196 | queue, |
| 197 | }) | 197 | }) |
| @@ -207,20 +207,14 @@ async fn mail_view( | |||
| 207 | let starttls = data.security == Security::StartTls; | 207 | let starttls = data.security == Security::StartTls; |
| 208 | let tls = data.security == Security::Tls; | 208 | let tls = data.security == Security::Tls; |
| 209 | let plain = data.security == Security::Plain; | 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 | let settings_on = data.tab == Tab::Settings; | 210 | let settings_on = data.tab == Tab::Settings; |
| 216 | let filter_param = data | 211 | let filter_param = data |
| 217 | .queue | 212 | .queue |
| 218 | .as_ref() | 213 | .as_ref() |
| 219 | .map(|q| q.filter_param.clone()) | 214 | .map(|q| q.filter_param.clone()) |
| 220 | .unwrap_or_default(); | 215 | .unwrap_or_default(); |
| 221 | - let sub = vec![SubPart::text(g::t(lang, K::MailIntro))]; | ||
| 222 | Ok(view! { | 216 | Ok(view! { |
| 223 | - head(title: g::t(lang, K::Mail), sub: sub) | 217 | + head(title: g::t(lang, K::Mail)) |
| 224 | if let Some(message) = notice { | 218 | if let Some(message) = notice { |
| 225 | <p class="state" role="status">(message.as_str())</p> | 219 | <p class="state" role="status">(message.as_str())</p> |
| 226 | } | 220 | } |
| @@ -232,12 +226,14 @@ async fn mail_view( | |||
| 232 | // Saved by any admin session: the stream re-renders the settings with the same signal | 226 | // Saved by any admin session: the stream re-renders the settings with the same signal |
| 233 | // as the queue (the save bumps it too), and the form keeps what was typed. | 227 | // as the queue (the save bumps it too), and the form keeps what was typed. |
| 234 | <div class="sheet" data-live="/admin/mail/events"> | 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 | <input type="hidden" name="csrf" value=(csrf.as_str())> | 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 | <section class="sec" id="smtp"> | 235 | <section class="sec" id="smtp"> |
| 238 | <h2>(g::t(lang, K::SmtpServer))</h2> | 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 | <div class="fields"> | 237 | <div class="fields"> |
| 242 | <div class="field"> | 238 | <div class="field"> |
| 243 | <label for="mail-host">(g::t(lang, K::MailHost))</label> | 239 | <label for="mail-host">(g::t(lang, K::MailHost))</label> |
| @@ -262,8 +258,10 @@ async fn mail_view( | |||
| 262 | <div class="field"> | 258 | <div class="field"> |
| 263 | <label for="mail-password">(i18n::t(lang, Key::Password))</label> | 259 | <label for="mail-password">(i18n::t(lang, Key::Password))</label> |
| 264 | <input id="mail-password" type="password" name="password" autocomplete="new-password" maxlength="1024"> | 260 | <input id="mail-password" type="password" name="password" autocomplete="new-password" maxlength="1024"> |
| 265 | - <p class="hint">(password_hint)</p> | ||
| 266 | </div> | 261 | </div> |
| 262 | + if !data.has_password { | ||
| 263 | + <p class="state">(g::t(lang, K::NoPasswordStored))</p> | ||
| 264 | + } | ||
| 267 | </div> | 265 | </div> |
| 268 | </section> | 266 | </section> |
| 269 | <section class="sec"> | 267 | <section class="sec"> |
| @@ -299,7 +297,6 @@ async fn mail_view( | |||
| 299 | <a class="act" href=(chip.href.as_str()) aria-current=(chip.current.then_some("page"))>(chip.label) " (" (chip.count) ")"</a> | 297 | <a class="act" href=(chip.href.as_str()) aria-current=(chip.current.then_some("page"))>(chip.label) " (" (chip.count) ")"</a> |
| 300 | } | 298 | } |
| 301 | </div> | 299 | </div> |
| 302 | - <p class="hint">(g::t(lang, K::MailQueueIntro))</p> | ||
| 303 | if queue.rows.is_empty() { | 300 | if queue.rows.is_empty() { |
| 304 | if queue.filter_param.is_empty() { | 301 | if queue.filter_param.is_empty() { |
| 305 | <p class="state">(g::t(lang, K::MailQueueEmpty))</p> | 302 | <p class="state">(g::t(lang, K::MailQueueEmpty))</p> |
| @@ -323,7 +320,7 @@ async fn mail_view( | |||
| 323 | </span> | 320 | </span> |
| 324 | if row.failed { | 321 | if row.failed { |
| 325 | 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())]) | 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 | </div> | 325 | </div> |
| 329 | } | 326 | } |
| @@ -376,6 +373,9 @@ async fn mail_events(cx: &Cx) -> Result<Response> { | |||
| 376 | struct SettingsForm { | 373 | struct SettingsForm { |
| 377 | #[serde(default)] | 374 | #[serde(default)] |
| 378 | csrf: String, | 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 | #[serde(default)] | 379 | #[serde(default)] |
| 380 | host: String, | 380 | host: String, |
| 381 | #[serde(default)] | 381 | #[serde(default)] |
| @@ -402,10 +402,25 @@ async fn mail_save(cx: &Cx, Form(form): Form<SettingsForm>) -> Result<Response> | |||
| 402 | } | 402 | } |
| 403 | let lang = i18n::lang(cx, Some(&viewer.0)); | 403 | let lang = i18n::lang(cx, Some(&viewer.0)); |
| 404 | let state = app_context::<AppState>(cx); | 404 | let state = app_context::<AppState>(cx); |
| 405 | - let notice = match save_settings(cx, state, &viewer.0, &form, lang).await { | 405 | + let saved = save_settings(cx, state, &viewer.0, &form, lang).await; |
| 406 | - Ok(()) => g::t(lang, K::MailSettingsSaved).to_owned(), | 406 | + let transport = if form.transport.is_empty() { |
| 407 | - Err(Error::Invalid(message)) => message, | 407 | + Ok(None) |
| 408 | - Err(other) => other.to_string(), | 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 | let location = format!("/admin/mail?notice={}", enc(¬ice)); | 425 | let location = format!("/admin/mail?notice={}", enc(¬ice)); |
| 411 | Err(see_other(&location).into()) | 426 | Err(see_other(&location).into()) |
crates/forge-web/src/pages/admin_replication.rsmodified+65 -49
| @@ -1,13 +1,16 @@ | |||
| 1 | //! Page: standby replication (`/admin/replication`). Instance admins only; anyone else gets 404. | 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 | 3 | +//! Shows the replication settings as a settings topic, saved here (`POST /admin/replication`, the |
| 4 | -//! with its health: ok, lagging (no success within twice the interval), error, or never replicated. | 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 | //! "Reconcile now" queues a full pass for the worker. It is a POST with a CSRF token, and it is | 7 | //! "Reconcile now" queues a full pass for the worker. It is a POST with a CSRF token, and it is |
| 6 | //! audited as `replication_reconcile_started`. | 8 | //! audited as `replication_reconcile_started`. |
| 7 | 9 | ||
| 8 | use std::collections::HashMap; | 10 | use std::collections::HashMap; |
| 9 | use std::time::Duration; | 11 | use std::time::Duration; |
| 10 | 12 | ||
| 13 | +use forge_core::server_settings::Group; | ||
| 11 | use forge_core::store::replication::{DB_SUBJECT, ReplicationStatus}; | 14 | use forge_core::store::replication::{DB_SUBJECT, ReplicationStatus}; |
| 12 | use forge_core::time::stamp_ago; | 15 | use forge_core::time::stamp_ago; |
| 13 | use forge_core::{AuditAction, Error}; | 16 | use forge_core::{AuditAction, Error}; |
| @@ -23,16 +26,21 @@ use topcoat::view::{View, component, view}; | |||
| 23 | use crate::audit::{self, Actor, Target}; | 26 | use crate::audit::{self, Actor, Target}; |
| 24 | use crate::auth::check_csrf; | 27 | use crate::auth::check_csrf; |
| 25 | use crate::i18n::admin::{self as g, K}; | 28 | use crate::i18n::admin::{self as g, K}; |
| 26 | -use crate::i18n::{self, Lang}; | 29 | +use crate::i18n::{self, Key, Lang}; |
| 27 | use crate::live::{Topic, stream_changes}; | 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 | use crate::pages::admin_users::admin_only; | 36 | use crate::pages::admin_users::admin_only; |
| 29 | -use crate::state::AppState; | ||
| 30 | use crate::pages::issues_list::list_href; | 37 | use crate::pages::issues_list::list_href; |
| 31 | use crate::pages::passkeys::s; | 38 | use crate::pages::passkeys::s; |
| 39 | +use crate::state::AppState; | ||
| 32 | use crate::views::find::{Finder, finder_field}; | 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 | use crate::views::repo_list::{PageLink, pager, pager_links}; | 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 | #[query_params(error = bad_request)] | 45 | #[query_params(error = bad_request)] |
| 38 | pub(crate) struct NoticeQuery { | 46 | pub(crate) struct NoticeQuery { |
| @@ -148,14 +156,11 @@ impl RepoRow { | |||
| 148 | /// Everything the page shows, already formatted. | 156 | /// Everything the page shows, already formatted. |
| 149 | struct PageData { | 157 | struct PageData { |
| 150 | enabled: bool, | 158 | enabled: bool, |
| 151 | - target: String, | ||
| 152 | db_dot: &'static str, | 159 | db_dot: &'static str, |
| 153 | db_health: &'static str, | 160 | db_health: &'static str, |
| 154 | db_last_ok: Option<String>, | 161 | db_last_ok: Option<String>, |
| 155 | db_last_attempt: Option<String>, | 162 | db_last_attempt: Option<String>, |
| 156 | db_error: String, | 163 | db_error: String, |
| 157 | - interval: String, | ||
| 158 | - healthcheck: &'static str, | ||
| 159 | repos: Vec<RepoRow>, | 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 | Ok(PageData { | 219 | Ok(PageData { |
| 215 | enabled: config.enabled(), | 220 | enabled: config.enabled(), |
| 216 | - target: config.target.clone(), | ||
| 217 | db_dot: health(db, &db_cutoff).dot(), | 221 | db_dot: health(db, &db_cutoff).dot(), |
| 218 | db_health: health(db, &db_cutoff).label(lang), | 222 | db_health: health(db, &db_cutoff).label(lang), |
| 219 | db_last_ok: db.and_then(|s| s.last_ok_at.clone()), | 223 | db_last_ok: db.and_then(|s| s.last_ok_at.clone()), |
| 220 | db_last_attempt: db.and_then(|s| s.last_attempt_at.clone()), | 224 | db_last_attempt: db.and_then(|s| s.last_attempt_at.clone()), |
| 221 | db_error: db.and_then(|s| s.last_error.clone()).unwrap_or_default(), | 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 | repos, | 226 | repos, |
| 229 | }) | 227 | }) |
| 230 | } | 228 | } |
| @@ -234,6 +232,7 @@ async fn replication_view( | |||
| 234 | lang: Lang, | 232 | lang: Lang, |
| 235 | csrf: String, | 233 | csrf: String, |
| 236 | data: PageData, | 234 | data: PageData, |
| 235 | + settings: Vec<Row>, | ||
| 237 | notice: Option<String>, | 236 | notice: Option<String>, |
| 238 | list: RepoList, | 237 | list: RepoList, |
| 239 | ) -> Result<impl View> { | 238 | ) -> Result<impl View> { |
| @@ -249,31 +248,33 @@ async fn replication_view( | |||
| 249 | let all_label = s(lang, "All", "Tümü"); | 248 | let all_label = s(lang, "All", "Tümü"); |
| 250 | let health_label = s(lang, "Health", "Durum"); | 249 | let health_label = s(lang, "Health", "Durum"); |
| 251 | let placeholder = s(lang, "Search repositories", "Depolarda ara"); | 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 | Ok(view! { | 252 | Ok(view! { |
| 254 | - head(title: g::t(lang, K::Replication), sub: sub, | 253 | + head(title: g::t(lang, K::Replication), |
| 255 | post_act(label: g::t(lang, K::ReconcileNow), action: "/admin/replication/reconcile", csrf: csrf.as_str()) | 254 | post_act(label: g::t(lang, K::ReconcileNow), action: "/admin/replication/reconcile", csrf: csrf.as_str()) |
| 256 | ) | 255 | ) |
| 257 | if let Some(message) = notice { | 256 | if let Some(message) = notice { |
| 258 | <p class="state" role="status">(message.as_str())</p> | 257 | <p class="state" role="status">(message.as_str())</p> |
| 259 | } | 258 | } |
| 259 | + <div class="work"> | ||
| 260 | + backups_rail(lang: lang, current: "replication") | ||
| 260 | <div class="sheet" data-live="/admin/replication/events"> | 261 | <div class="sheet" data-live="/admin/replication/events"> |
| 261 | - if data.enabled { | ||
| 262 | <section class="sec"> | 262 | <section class="sec"> |
| 263 | - <h2>(crate::pages::passkeys::s(lang, "Target and schedule", "Hedef ve zamanlama"))</h2> | 263 | + <h2>(g::t(lang, K::Settings))</h2> |
| 264 | - <div class="line" data-kb-row=""> | 264 | + if !data.enabled { |
| 265 | - <span class="name">(g::t(lang, K::ReplicationTarget))</span> | 265 | + <p class="state">(g::t(lang, K::ReplicationOff))</p> |
| 266 | - <span class="val"><code>(data.target.as_str())</code></span> | 266 | + } |
| 267 | - </div> | 267 | + <form method="post" action="/admin/replication" class="srv-form"> |
| 268 | - <div class="line" data-kb-row=""> | 268 | + <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 269 | - <span class="name">(g::t(lang, K::Interval))</span> | 269 | + <input type="hidden" name="back" value="/admin/replication"> |
| 270 | - <span class="val">(data.interval.as_str())</span> | 270 | + setting_lines(lang: lang, rows: settings) |
| 271 | - </div> | 271 | + <div class="acts srv-save"> |
| 272 | - <div class="line" data-kb-row=""> | 272 | + <button type="submit" class="primary">(i18n::t(lang, Key::Save))</button> |
| 273 | - <span class="name">(g::t(lang, K::Healthcheck))</span> | ||
| 274 | - <span class="val">(data.healthcheck)</span> | ||
| 275 | </div> | 273 | </div> |
| 274 | + </form> | ||
| 275 | + reset_form(csrf: csrf.clone(), back: "/admin/replication".to_owned()) | ||
| 276 | </section> | 276 | </section> |
| 277 | + if data.enabled { | ||
| 277 | <section class="sec"> | 278 | <section class="sec"> |
| 278 | <h2>(crate::pages::passkeys::s(lang, "Status", "Durum"))</h2> | 279 | <h2>(crate::pages::passkeys::s(lang, "Status", "Durum"))</h2> |
| 279 | <div class="line" data-kb-row=""> | 280 | <div class="line" data-kb-row=""> |
| @@ -281,7 +282,7 @@ async fn replication_view( | |||
| 281 | <span class="val"><span class=(data.db_dot) aria-hidden="true"></span> (data.db_health)</span> | 282 | <span class="val"><span class=(data.db_dot) aria-hidden="true"></span> (data.db_health)</span> |
| 282 | </div> | 283 | </div> |
| 283 | if !data.db_error.is_empty() { | 284 | if !data.db_error.is_empty() { |
| 284 | - <p class="hint bad">(g::t(lang, K::DatabaseErrorPrefix))(data.db_error.as_str())</p> | 285 | + alert(message: db_error.as_str()) |
| 285 | } | 286 | } |
| 286 | <div class="line" data-kb-row=""> | 287 | <div class="line" data-kb-row=""> |
| 287 | <span class="name">(g::t(lang, K::LastDbSnapshotShipped))</span> | 288 | <span class="name">(g::t(lang, K::LastDbSnapshotShipped))</span> |
| @@ -292,18 +293,11 @@ async fn replication_view( | |||
| 292 | <span class="val">rel_time_or_never(lang: lang, stamp: data.db_last_attempt.as_deref())</span> | 293 | <span class="val">rel_time_or_never(lang: lang, stamp: data.db_last_attempt.as_deref())</span> |
| 293 | </div> | 294 | </div> |
| 294 | </section> | 295 | </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> | ||
| 299 | - </section> | ||
| 300 | } | 296 | } |
| 301 | <section class="sec"> | 297 | <section class="sec"> |
| 302 | <h2>(g::t(lang, K::Repos))</h2> | 298 | <h2>(g::t(lang, K::Repos))</h2> |
| 303 | if !has_repos { | 299 | if !has_repos { |
| 304 | <p class="state">(g::t(lang, K::NoReposYet))</p> | 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 | } else { | 301 | } else { |
| 308 | <form class="sec-tools" method="get" action="/admin/replication" role="search"> | 302 | <form class="sec-tools" method="get" action="/admin/replication" role="search"> |
| 309 | finder_field(lang: lang, finder: finder, placeholder: placeholder, id: Some("replication-q")) | 303 | finder_field(lang: lang, finder: finder, placeholder: placeholder, id: Some("replication-q")) |
| @@ -328,13 +322,14 @@ async fn replication_view( | |||
| 328 | <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> | 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 | </div> | 323 | </div> |
| 330 | if !row.error.is_empty() { | 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 | </section> | 329 | </section> |
| 336 | pager(page: page, pages: pages, links: links, prev: prev, next: next, lang: lang) | 330 | pager(page: page, pages: pages, links: links, prev: prev, next: next, lang: lang) |
| 337 | </div> | 331 | </div> |
| 332 | + </div> | ||
| 338 | }) | 333 | }) |
| 339 | } | 334 | } |
| 340 | 335 | ||
| @@ -348,14 +343,8 @@ async fn page_fingerprint(state: &AppState) -> Result<String> { | |||
| 348 | .map(|row| (&row.name, row.health, &row.last_ok, &row.error)) | 343 | .map(|row| (&row.name, row.health, &row.last_ok, &row.error)) |
| 349 | .collect(); | 344 | .collect(); |
| 350 | Ok(format!( | 345 | Ok(format!( |
| 351 | - "{}|{}|{:?}|{:?}|{}|{}|{:?}", | 346 | + "{}|{}|{:?}|{:?}|{}|{:?}", |
| 352 | - data.enabled, | 347 | + data.enabled, data.db_health, data.db_last_ok, data.db_last_attempt, data.db_error, rows |
| 353 | - data.db_health, | ||
| 354 | - data.db_last_ok, | ||
| 355 | - data.db_last_attempt, | ||
| 356 | - data.db_error, | ||
| 357 | - data.target, | ||
| 358 | - rows | ||
| 359 | )) | 348 | )) |
| 360 | } | 349 | } |
| 361 | 350 | ||
| @@ -439,13 +428,39 @@ async fn replication_page(cx: &Cx) -> Result<impl View> { | |||
| 439 | let state = app_context::<AppState>(cx); | 428 | let state = app_context::<AppState>(cx); |
| 440 | let mut data = page_data(state, lang).await?; | 429 | let mut data = page_data(state, lang).await?; |
| 441 | let list = repo_list(&mut data, query); | 430 | let list = repo_list(&mut data, query); |
| 431 | + let settings = setting_rows(state, lang, REPLICATION_KEYS).await?; | ||
| 442 | let csrf = viewer.1.csrf_token.clone(); | 432 | let csrf = viewer.1.csrf_token.clone(); |
| 443 | let title = g::t(lang, K::Replication); | 433 | let title = g::t(lang, K::Replication); |
| 444 | Ok(view! { | 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 | #[derive(Deserialize)] | 464 | #[derive(Deserialize)] |
| 450 | struct ReconcileForm { | 465 | struct ReconcileForm { |
| 451 | #[serde(default)] | 466 | #[serde(default)] |
| @@ -531,6 +546,7 @@ mod tests { | |||
| 531 | config.replication.target = TARGET.into(); | 546 | config.replication.target = TARGET.into(); |
| 532 | } | 547 | } |
| 533 | state.config = std::sync::Arc::new(config); | 548 | state.config = std::sync::Arc::new(config); |
| 549 | + state.settings = crate::state::settings_for(&state.config); | ||
| 534 | let admin = state | 550 | let admin = state |
| 535 | .store | 551 | .store |
| 536 | .create_user("root", None, "h", true) | 552 | .create_user("root", None, "h", true) |
crates/forge-web/src/pages/admin_runners.rsmodified+53 -183
| @@ -64,20 +64,20 @@ fn s(lang: Lang, en: &'static str, tr: &'static str) -> &'static str { | |||
| 64 | const EXTRA_NOTICES: [(&str, &str, &str, bool); 8] = [ | 64 | const EXTRA_NOTICES: [(&str, &str, &str, bool); 8] = [ |
| 65 | ( | 65 | ( |
| 66 | "saved", | 66 | "saved", |
| 67 | - "Saved. The runner picks it up on its next check-in.", | 67 | + "Saved.", |
| 68 | - "Kaydedildi. Çalıştırıcı bir sonraki yoklamasında uygular.", | 68 | + "Kaydedildi.", |
| 69 | false, | 69 | false, |
| 70 | ), | 70 | ), |
| 71 | ( | 71 | ( |
| 72 | "saved-restart", | 72 | "saved-restart", |
| 73 | - "Saved. It applies when the runner next starts.", | 73 | + "Saved.", |
| 74 | - "Kaydedildi. Çalıştırıcı yeniden başlayınca uygulanır.", | 74 | + "Kaydedildi.", |
| 75 | false, | 75 | false, |
| 76 | ), | 76 | ), |
| 77 | ( | 77 | ( |
| 78 | "reset", | 78 | "reset", |
| 79 | - "Override removed. The runner.toml value is used again.", | 79 | + "Override removed.", |
| 80 | - "Üzerine yazma kaldırıldı. runner.toml değeri yeniden kullanılıyor.", | 80 | + "Üzerine yazma kaldırıldı.", |
| 81 | false, | 81 | false, |
| 82 | ), | 82 | ), |
| 83 | ( | 83 | ( |
| @@ -88,8 +88,8 @@ const EXTRA_NOTICES: [(&str, &str, &str, bool); 8] = [ | |||
| 88 | ), | 88 | ), |
| 89 | ( | 89 | ( |
| 90 | "restart-requested", | 90 | "restart-requested", |
| 91 | - "Restart requested. The runner restarts as soon as it sees the request.", | 91 | + "Restart requested.", |
| 92 | - "Yeniden başlatma istendi. Çalıştırıcı isteği görür görmez yeniden başlar.", | 92 | + "Yeniden başlatma istendi.", |
| 93 | false, | 93 | false, |
| 94 | ), | 94 | ), |
| 95 | ( | 95 | ( |
| @@ -329,7 +329,6 @@ async fn runners_view( | |||
| 329 | pages: u64, | 329 | pages: u64, |
| 330 | nav: (Vec<PageLink>, Option<String>, Option<String>), | 330 | nav: (Vec<PageLink>, Option<String>, Option<String>), |
| 331 | notice: Option<(&'static str, bool)>, | 331 | notice: Option<(&'static str, bool)>, |
| 332 | - note: String, | ||
| 333 | ) -> Result<impl View> { | 332 | ) -> Result<impl View> { |
| 334 | let (links, prev, next) = nav; | 333 | let (links, prev, next) = nav; |
| 335 | Ok(view! { | 334 | Ok(view! { |
| @@ -365,14 +364,12 @@ async fn runners_view( | |||
| 365 | pager(page: page, pages: pages, links: links, prev: prev, next: next, lang: lang) | 364 | pager(page: page, pages: pages, links: links, prev: prev, next: next, lang: lang) |
| 366 | } | 365 | } |
| 367 | </section> | 366 | </section> |
| 367 | + if rows.is_empty() { | ||
| 368 | <section class="sec"> | 368 | <section class="sec"> |
| 369 | <h2>(g::t(lang, K::AddARunner))</h2> | 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> | ||
| 373 | <pre><code>"forge runner register --url <forge-url> --token <token> --name <name> --labels linux,x86_64"</code></pre> | 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 | </div> | 373 | </div> |
| 377 | }) | 374 | }) |
| 378 | } | 375 | } |
| @@ -407,7 +404,7 @@ pub(crate) async fn confirm_post( | |||
| 407 | for (name, value) in fields.iter() { | 404 | for (name, value) in fields.iter() { |
| 408 | <input type="hidden" name=(*name) value=(value.as_str())> | 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 | <div class="acts"> | 408 | <div class="acts"> |
| 412 | <button type="submit" class="small">(confirm)</button> | 409 | <button type="submit" class="small">(confirm)</button> |
| 413 | <button type="button" class="act" data-close-details="">(s(lang, "Keep it", "Vazgeç"))</button> | 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 | fn delete_message(lang: Lang, name: &str) -> String { | 417 | fn delete_message(lang: Lang, name: &str) -> String { |
| 421 | match lang { | 418 | match lang { |
| 422 | - Lang::Tr => format!("{name} silinsin mi? Makinenin sonrasında yeniden kaydolması gerekir."), | 419 | + Lang::Tr => format!("{name} silinsin mi?"), |
| 423 | - _ => format!("Delete runner {name}? The machine has to register again afterwards."), | 420 | + _ => format!("Delete runner {name}?"), |
| 424 | } | 421 | } |
| 425 | } | 422 | } |
| 426 | 423 | ||
| 427 | fn disable_message(lang: Lang, name: &str) -> String { | 424 | fn disable_message(lang: Lang, name: &str) -> String { |
| 428 | match lang { | 425 | match lang { |
| 429 | - Lang::Tr => format!("{name} devre dışı bırakılsın mı? Yeni iş almayı bırakır."), | 426 | + Lang::Tr => format!("{name} devre dışı bırakılsın mı?"), |
| 430 | - _ => format!("Disable runner {name}? It stops taking new jobs."), | 427 | + _ => format!("Disable runner {name}?"), |
| 431 | } | 428 | } |
| 432 | } | 429 | } |
| 433 | 430 | ||
| 434 | /// The restart control of a runner: a confirm popover with the two ways to restart. A runner that | 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 | /// pending the control shows that instead, and the runner clears it by coming back with a new id. | 433 | /// pending the control shows that instead, and the runner clears it by coming back with a new id. |
| 437 | #[component] | 434 | #[component] |
| 438 | async fn restart_control( | 435 | async fn restart_control( |
| @@ -445,18 +442,16 @@ async fn restart_control( | |||
| 445 | ) -> Result<impl View> { | 442 | ) -> Result<impl View> { |
| 446 | Ok(view! { | 443 | Ok(view! { |
| 447 | if pending.is_some() { | 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 | } else if can_restart { | 446 | } else if can_restart { |
| 450 | reveal(label: s(lang, "Restart", "Yeniden başlat"), | 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 | <div class="acts"> | 448 | <div class="acts"> |
| 454 | 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())]) | 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 | </div> | 451 | </div> |
| 457 | ) | 452 | ) |
| 458 | } else { | 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 | lang: Lang, | 496 | lang: Lang, |
| 502 | token: String, | 497 | token: String, |
| 503 | command: String, | 498 | command: String, |
| 504 | - expiry: String, | ||
| 505 | ) -> Result<impl View> { | 499 | ) -> Result<impl View> { |
| 506 | Ok(view! { | 500 | Ok(view! { |
| 507 | head(title: g::t(lang, K::RegistrationToken)) | 501 | head(title: g::t(lang, K::RegistrationToken)) |
| 508 | <p class="state" role="status"><strong>(g::t(lang, K::CopyTokenNow))</strong></p> | 502 | <p class="state" role="status"><strong>(g::t(lang, K::CopyTokenNow))</strong></p> |
| 509 | - <p class="hint">(expiry.as_str())</p> | ||
| 510 | <div class="sheet"> | 503 | <div class="sheet"> |
| 511 | <div class="sheet-tools"><strong>(g::t(lang, K::Token))</strong> <a class="act" href="/admin/runners">(g::t(lang, K::BackToRunners))</a></div> | 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 | <section class="sec" data-once=""> | 505 | <section class="sec" data-once=""> |
| @@ -515,7 +508,6 @@ async fn token_view( | |||
| 515 | <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> | 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 | </div> | 509 | </div> |
| 517 | <h2>(g::t(lang, K::RegisterARunner))</h2> | 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 | <div class="copy-box"> | 511 | <div class="copy-box"> |
| 520 | <code id="reg-command">(command.as_str())</code> | 512 | <code id="reg-command">(command.as_str())</code> |
| 521 | <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> | 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 | String::new() | 552 | String::new() |
| 561 | }; | 553 | }; |
| 562 | let nav = pager_links(page as u64, pages as u64, |n| list_href(n, &kept)); | 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 | let title = g::t(lang, K::CiRunners); | 555 | let title = g::t(lang, K::CiRunners); |
| 568 | Ok(view! { | 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 | .await; | 595 | .await; |
| 608 | let command = register_command(&state.config.base_url, &token); | 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 | let title = g::t(lang, K::RegistrationToken); | 597 | let title = g::t(lang, K::RegistrationToken); |
| 611 | Ok(view! { | 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 | tab_slug(wanted.as_deref()) | 803 | tab_slug(wanted.as_deref()) |
| 817 | } | 804 | } |
| 818 | 805 | ||
| 819 | -/// The human label and the one-line hint of a config field. | 806 | +/// The human label of a config field. |
| 820 | -fn field_text(lang: Lang, key: &str) -> (&'static str, &'static str) { | 807 | +fn field_text(lang: Lang, key: &str) -> &'static str { |
| 821 | match key { | 808 | match key { |
| 822 | - "concurrency" => ( | 809 | + "concurrency" => s(lang, "Concurrency", "Eşzamanlılık"), |
| 823 | - s(lang, "Concurrency", "Eşzamanlılık"), | 810 | + "labels" => s(lang, "Labels", "Etiketler"), |
| 824 | - s( | 811 | + "executor" => s(lang, "Executor", "Yürütücü"), |
| 825 | - lang, | 812 | + "auto_update" => s(lang, "Auto update", "Otomatik güncelleme"), |
| 826 | - "Jobs this runner runs at once, 1 to 64.", | 813 | + "limits.memory" => s(lang, "Memory limit", "Bellek sınırı"), |
| 827 | - "Bu çalıştırıcının aynı anda yürüttüğü iş sayısı, 1 ile 64 arası.", | 814 | + "limits.reserve_memory" => s(lang, "Default reservation", "Varsayılan ayırma"), |
| 828 | - ), | 815 | + "limits.memory_budget" => s(lang, "Memory budget", "Bellek bütçesi"), |
| 829 | - ), | 816 | + "limits.cpus" => s(lang, "CPU limit", "CPU sınırı"), |
| 830 | - "labels" => ( | 817 | + "limits.pids" => s(lang, "Process limit", "İşlem sınırı"), |
| 831 | - s(lang, "Labels", "Etiketler"), | 818 | + "work_dir" => s(lang, "Work directory", "Çalışma dizini"), |
| 832 | - s( | 819 | + "limits.image_max_gb" => s(lang, "Image cache max (GB)", "Kalıp önbelleği üst sınırı (GB)"), |
| 833 | - lang, | 820 | + "limits.job_disk_gb" => s(lang, "Disk per job (GB)", "İş başına disk (GB)"), |
| 834 | - "Comma separated. A job runs where its labels are all present.", | 821 | + "images.keep_days" => s(lang, "Keep images (days)", "Kalıpları sakla (gün)"), |
| 835 | - "Virgülle ayrılır. İş, etiketlerinin hepsinin bulunduğu yerde çalışır.", | 822 | + "cache_max_gib" => s(lang, "Build cache max (GiB)", "Derleme önbelleği üst sınırı (GiB)"), |
| 836 | - ), | 823 | + "sandbox.userns" => s(lang, "User namespaces", "Kullanıcı ad alanları"), |
| 837 | - ), | 824 | + "name" => s(lang, "Name", "Ad"), |
| 838 | - "executor" => ( | 825 | + "url" => s(lang, "Forge URL", "Forge adresi"), |
| 839 | - s(lang, "Executor", "Yürütücü"), | 826 | + "runner_id" => s(lang, "Runner id", "Çalıştırıcı kimliği"), |
| 840 | - s( | 827 | + "runner_secret" => s(lang, "Runner secret", "Çalıştırıcı sırrı"), |
| 841 | - lang, | 828 | + "registry" => s(lang, "Registry", "Kayıt sunucusu"), |
| 842 | - "How jobs run: builtin on the host, or podman in containers.", | 829 | + _ => "", |
| 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 | - _ => ("", ""), | ||
| 956 | } | 830 | } |
| 957 | } | 831 | } |
| 958 | 832 | ||
| @@ -972,7 +846,6 @@ type Choice = (&'static str, &'static str, bool); | |||
| 972 | struct DetailField { | 846 | struct DetailField { |
| 973 | key: &'static str, | 847 | key: &'static str, |
| 974 | label: &'static str, | 848 | label: &'static str, |
| 975 | - hint: &'static str, | ||
| 976 | value: String, | 849 | value: String, |
| 977 | kind_label: &'static str, | 850 | kind_label: &'static str, |
| 978 | source_label: &'static str, | 851 | source_label: &'static str, |
| @@ -990,7 +863,7 @@ fn detail_fields(lang: Lang, tab: &str, fields: &[FieldRow]) -> Vec<DetailField> | |||
| 990 | .into_iter() | 863 | .into_iter() |
| 991 | .filter_map(|key| fields.iter().find(|f| f.key == key)) | 864 | .filter_map(|key| fields.iter().find(|f| f.key == key)) |
| 992 | .map(|f| { | 865 | .map(|f| { |
| 993 | - let (label, hint) = field_text(lang, f.key); | 866 | + let label = field_text(lang, f.key); |
| 994 | let kind_label = if f.kind == FieldKind::Live { | 867 | let kind_label = if f.kind == FieldKind::Live { |
| 995 | g::t(lang, K::SrvKindLive) | 868 | g::t(lang, K::SrvKindLive) |
| 996 | } else { | 869 | } else { |
| @@ -1019,7 +892,6 @@ fn detail_fields(lang: Lang, tab: &str, fields: &[FieldRow]) -> Vec<DetailField> | |||
| 1019 | DetailField { | 892 | DetailField { |
| 1020 | key: f.key, | 893 | key: f.key, |
| 1021 | label, | 894 | label, |
| 1022 | - hint, | ||
| 1023 | value: f.value.clone(), | 895 | value: f.value.clone(), |
| 1024 | kind_label, | 896 | kind_label, |
| 1025 | source_label: source_text(lang, f.source), | 897 | source_label: source_text(lang, f.source), |
| @@ -1109,7 +981,7 @@ fn identity_rows(lang: Lang, fields: &[FieldRow]) -> Vec<(&'static str, String)> | |||
| 1109 | } else { | 981 | } else { |
| 1110 | f.value.clone() | 982 | f.value.clone() |
| 1111 | }; | 983 | }; |
| 1112 | - (field_text(lang, f.key).0, value) | 984 | + (field_text(lang, f.key), value) |
| 1113 | }) | 985 | }) |
| 1114 | .collect() | 986 | .collect() |
| 1115 | } | 987 | } |
| @@ -1606,7 +1478,7 @@ async fn runner_detail_view( | |||
| 1606 | <div class="mx-head"> | 1478 | <div class="mx-head"> |
| 1607 | <h2 class="mx-caption">(c.caption.as_str())</h2> | 1479 | <h2 class="mx-caption">(c.caption.as_str())</h2> |
| 1608 | if !fact.is_empty() { | 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 | if !c.legend.is_empty() { | 1483 | if !c.legend.is_empty() { |
| 1612 | <ul class="mx-legend"> | 1484 | <ul class="mx-legend"> |
| @@ -1654,7 +1526,7 @@ async fn runner_detail_view( | |||
| 1654 | } | 1526 | } |
| 1655 | if metrics.empty { | 1527 | if metrics.empty { |
| 1656 | <section class="sec"> | 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 | </section> | 1530 | </section> |
| 1659 | } else { | 1531 | } else { |
| 1660 | <section class="sec"> | 1532 | <section class="sec"> |
| @@ -1684,8 +1556,7 @@ async fn runner_detail_view( | |||
| 1684 | for (label, value) in identity.iter() { | 1556 | for (label, value) in identity.iter() { |
| 1685 | <div class="line"><span class="name">(*label)</span><span class="val"><code class="srv-fixed">(value.as_str())</code></span></div> | 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> | 1559 | + <p class="state">(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> | ||
| 1689 | </section> | 1560 | </section> |
| 1690 | } else if editing { | 1561 | } else if editing { |
| 1691 | <section class="sec"> | 1562 | <section class="sec"> |
| @@ -1706,8 +1577,7 @@ async fn runner_detail_view( | |||
| 1706 | } else { | 1577 | } else { |
| 1707 | <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"> | 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> | 1580 | + <p class="state">(f.kind_label) " · " (f.source_label) |
| 1710 | - <p class="hint">(f.kind_label) " · " (f.source_label) | ||
| 1711 | if !f.pending_label.is_empty() { | 1581 | if !f.pending_label.is_empty() { |
| 1712 | " · " (f.pending_label) | 1582 | " · " (f.pending_label) |
| 1713 | } | 1583 | } |
| @@ -1734,7 +1604,7 @@ async fn runner_detail_view( | |||
| 1734 | } | 1604 | } |
| 1735 | <section class="sec"> | 1605 | <section class="sec"> |
| 1736 | if log.is_empty() { | 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 | } else { | 1608 | } else { |
| 1739 | <pre id="runner-log" class="ci-log runner-log" role="log" aria-label=(s(lang, "Runner log", "Çalıştırıcı günlüğü"))> | 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 | for row in log.iter() { | 1610 | for row in log.iter() { |
| @@ -1747,7 +1617,7 @@ async fn runner_detail_view( | |||
| 1747 | <section class="sec"> | 1617 | <section class="sec"> |
| 1748 | <h2>(s(lang, "Running now", "Şu an çalışan"))</h2> | 1618 | <h2>(s(lang, "Running now", "Şu an çalışan"))</h2> |
| 1749 | if running_jobs.is_empty() { | 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 | for job in running_jobs.iter() { | 1622 | for job in running_jobs.iter() { |
| 1753 | <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> | 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 | <section class="sec"> | 1626 | <section class="sec"> |
| 1757 | <h2>(s(lang, "Recent", "Son"))</h2> | 1627 | <h2>(s(lang, "Recent", "Son"))</h2> |
| 1758 | if recent_jobs.is_empty() { | 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 | <div class="runner-recent"> | 1631 | <div class="runner-recent"> |
| 1762 | for job in recent_jobs.iter() { | 1632 | for job in recent_jobs.iter() { |
crates/forge-web/src/pages/admin_server.rsmodified+330 -120
| @@ -89,10 +89,9 @@ struct OptionRow { | |||
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | /// One field, already formatted for the template. A secret's value is never in here. | 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 | key: &'static str, | 93 | key: &'static str, |
| 94 | label: &'static str, | 94 | label: &'static str, |
| 95 | - help: &'static str, | ||
| 96 | kind_label: &'static str, | 95 | kind_label: &'static str, |
| 97 | /// What a line shows for the value: the text, the chosen option, On or Off, or the secret state. | 96 | /// What a line shows for the value: the text, the chosen option, On or Off, or the secret state. |
| 98 | value_text: String, | 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 | pub(crate) const PAGES: &[SrvPage] = &[ | 135 | pub(crate) const PAGES: &[SrvPage] = &[ |
| 135 | SrvPage { | 136 | SrvPage { |
| 136 | slug: "general", | 137 | slug: "general", |
| 137 | group: Group::General, | 138 | group: Group::General, |
| 138 | en: "General", | 139 | en: "General", |
| 139 | tr: "Genel", | 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 | SrvPage { | 150 | SrvPage { |
| 143 | slug: "addresses", | 151 | slug: "addresses", |
| 144 | group: Group::General, | 152 | group: Group::General, |
| 145 | en: "Addresses", | 153 | en: "Addresses", |
| 146 | tr: "Adresler", | 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 | SrvPage { | 167 | SrvPage { |
| 150 | slug: "limits", | 168 | slug: "limits", |
| 151 | group: Group::Limits, | 169 | group: Group::Limits, |
| 152 | en: "CI", | 170 | en: "CI", |
| 153 | tr: "CI", | 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"], | 172 | + keys: &[ |
| 155 | - }, | 173 | + "ci.enabled", |
| 156 | - SrvPage { | 174 | + "ci.registration_token_hours", |
| 157 | - slug: "retention", | 175 | + "ci.max_log_mb", |
| 158 | - group: Group::Limits, | 176 | + "ci.max_artifact_mb", |
| 159 | - en: "Retention and uploads", | 177 | + "ci.max_artifacts_per_job", |
| 160 | - tr: "Saklama ve yüklemeler", | 178 | + "ci.max_job_artifacts_mb", |
| 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"], | 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 | SrvPage { | 187 | SrvPage { |
| 164 | slug: "storage", | 188 | slug: "storage", |
| 165 | group: Group::Storage, | 189 | group: Group::Storage, |
| 166 | en: "Storage", | 190 | en: "Storage", |
| 167 | tr: "Depolama", | 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"], | 192 | + keys: &[ |
| 169 | - }, | 193 | + "storage.backend", |
| 170 | - SrvPage { | 194 | + "storage.r2.account_id", |
| 171 | - slug: "s3", | 195 | + "storage.r2.bucket", |
| 172 | - group: Group::Storage, | 196 | + "storage.r2.jurisdiction", |
| 173 | - en: "S3 storage", | 197 | + "storage.r2.prefix", |
| 174 | - tr: "S3 depolama", | 198 | + "storage.r2.access_key_id", |
| 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"], | 199 | + "storage.r2.secret_access_key_file", |
| 176 | - }, | 200 | + "storage.s3.bucket", |
| 177 | - SrvPage { | 201 | + "storage.s3.region", |
| 178 | - slug: "backups", | 202 | + "storage.s3.endpoint", |
| 179 | - group: Group::Backups, | 203 | + "storage.s3.prefix", |
| 180 | - en: "Backups", | 204 | + "storage.s3.access_key_id", |
| 181 | - tr: "Yedekler", | 205 | + "storage.s3.secret_access_key_file", |
| 182 | - keys: &["backup.dir", "backup.interval_hours", "backup.keep", "backup.fsck_interval_days", "backup.healthcheck_url"], | 206 | + "storage.s3.allow_http", |
| 183 | - }, | 207 | + "storage.s3.virtual_hosted_style", |
| 184 | - SrvPage { | 208 | + ], |
| 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"], | ||
| 190 | }, | 209 | }, |
| 191 | SrvPage { | 210 | SrvPage { |
| 192 | slug: "integrations", | 211 | slug: "integrations", |
| 193 | group: Group::Integrations, | 212 | group: Group::Integrations, |
| 194 | en: "Integrations", | 213 | en: "Integrations", |
| 195 | tr: "Entegrasyonlar", | 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 | SrvPage { | 223 | SrvPage { |
| 199 | slug: "self-update", | 224 | slug: "self-update", |
| 200 | group: Group::Integrations, | 225 | group: Group::Integrations, |
| 201 | en: "Self-update", | 226 | en: "Self-update", |
| 202 | tr: "Kendini güncelleme", | 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 | SrvPage { | 236 | SrvPage { |
| 206 | slug: "alerts", | 237 | slug: "alerts", |
| @@ -208,21 +239,125 @@ pub(crate) const PAGES: &[SrvPage] = &[ | |||
| 208 | en: "Alerts", | 239 | en: "Alerts", |
| 209 | tr: "Uyarılar", | 240 | tr: "Uyarılar", |
| 210 | // Each threshold sits under the alert it tunes. | 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 | pub(crate) fn page_by_slug(slug: &str) -> Option<&'static SrvPage> { | 282 | pub(crate) fn page_by_slug(slug: &str) -> Option<&'static SrvPage> { |
| 217 | PAGES.iter().find(|page| page.slug == slug) | 283 | PAGES.iter().find(|page| page.slug == slug) |
| 218 | } | 284 | } |
| 219 | 285 | ||
| 220 | -/// The page that holds the setting `key`. | 286 | +/// Where the old slugs of moved pages went: `retention`, `s3`, `backups` and `replication`. `None` |
| 221 | -pub(crate) fn page_of(key: &str) -> &'static SrvPage { | 287 | +/// for every slug that still names a page. |
| 222 | - PAGES | 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 | .iter() | 331 | .iter() |
| 224 | .find(|page| page.keys.contains(&key)) | 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 | /// The words for a choice's stored value. Values that are names (smtp, s3, eu) read as they are. | 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 | } else { | 425 | } else { |
| 291 | view.value.clone() | 426 | view.value.clone() |
| 292 | }; | 427 | }; |
| 293 | - let (label, help) = match (lang, i18n::server_settings::field_tr(field.key)) { | 428 | + let label = match (lang, i18n::server_settings::field_tr(field.key)) { |
| 294 | - (Lang::Tr, Some(tr)) => tr, | 429 | + (Lang::Tr, Some((tr, _))) => tr, |
| 295 | - _ => (field.label, field.help), | 430 | + _ => field.label, |
| 296 | }; | 431 | }; |
| 297 | Row { | 432 | Row { |
| 298 | key: field.key, | 433 | key: field.key, |
| 299 | label, | 434 | label, |
| 300 | - help, | ||
| 301 | kind_label, | 435 | kind_label, |
| 302 | value_text, | 436 | value_text, |
| 303 | value: view.value.clone(), | 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 | async fn rows_for(state: &AppState, lang: Lang, page: &SrvPage) -> forge_core::Result<Vec<Row>> { | 468 | async fn rows_for(state: &AppState, lang: Lang, page: &SrvPage) -> forge_core::Result<Vec<Row>> { |
| 327 | let overrides = state.store.server_overrides().await?; | 469 | let overrides = state.store.server_overrides().await?; |
| 328 | let views = state.settings.views(&overrides); | 470 | let views = state.settings.views(&overrides); |
| 329 | - Ok(page | 471 | + Ok(rows_of(lang, &views, page.keys)) |
| 330 | - .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 | .iter() | 500 | .iter() |
| 332 | - .filter_map(|key| views.iter().find(|view| view.field.key == *key)) | 501 | + .filter(|f| shown.contains(&f.key) && f.ty == Ty::Bool && f.kind != Kind::ReadOnly) |
| 333 | - .map(|view| row(lang, view)) | 502 | + { |
| 334 | - .collect()) | 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 | ||
| 511 | +} | ||
| 512 | + | ||
| 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 | + } | ||
| 335 | } | 520 | } |
| 336 | 521 | ||
| 337 | -/// The settings from every category whose key, label or help matches the search. | 522 | +/// The words for an error a page shows: the message itself for a refusal the user can fix. |
| 338 | -async fn search_hits(state: &AppState, lang: Lang, finder: &Finder) -> forge_core::Result<Vec<Row>> { | 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 | let overrides = state.store.server_overrides().await?; | 574 | let overrides = state.store.server_overrides().await?; |
| 340 | Ok(state | 575 | Ok(state |
| 341 | .settings | 576 | .settings |
| 342 | .views(&overrides) | 577 | .views(&overrides) |
| 343 | .iter() | 578 | .iter() |
| 344 | .map(|view| row(lang, view)) | 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 | .collect()) | 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 | 620 | +/// The facts after a setting's control: its kind, whether a restart is needed, and its override. |
| 386 | -/// secret's rule and its override. | ||
| 387 | #[component] | 621 | #[component] |
| 388 | async fn srv_hints(lang: Lang, row: &Row) -> Result<impl View> { | 622 | async fn srv_hints(lang: Lang, row: &Row) -> Result<impl View> { |
| 389 | Ok(view! { | 623 | Ok(view! { |
| 390 | <span class="srv-hints"> | 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 | if !row.kind_label.is_empty() { | 625 | if !row.kind_label.is_empty() { |
| 398 | <span class="hint">(row.kind_label)</span> | 626 | <span class="hint">(row.kind_label)</span> |
| 399 | } | 627 | } |
| @@ -446,27 +674,23 @@ async fn server_view( | |||
| 446 | current: search.is_none() && item.slug == page.slug, | 674 | current: search.is_none() && item.slug == page.slug, |
| 447 | }) | 675 | }) |
| 448 | .collect(); | 676 | .collect(); |
| 449 | - let sub = vec![ | 677 | + let sub = vec![SubPart::mono(format!( |
| 450 | - SubPart::text(g::t(lang, K::ServerSettingsIntro)), | ||
| 451 | - SubPart::mono(format!( | ||
| 452 | "{} {}", | 678 | "{} {}", |
| 453 | s(lang, "Version", "Sürüm"), | 679 | s(lang, "Version", "Sürüm"), |
| 454 | forge_ci::build::display() | 680 | forge_ci::build::display() |
| 455 | - )), | 681 | + ))]; |
| 456 | - ]; | ||
| 457 | let restart_label = s(lang, "Restart server", "Sunucuyu yeniden başlat"); | 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 | Ok(view! { | 683 | Ok(view! { |
| 460 | head(title: g::t(lang, K::ServerSettings), sub: sub, | 684 | head(title: g::t(lang, K::ServerSettings), sub: sub, |
| 461 | if restart != Restart::Pending { | 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 | <div data-live=(live.as_str())> | 689 | <div data-live=(live.as_str())> |
| 466 | if restart == Restart::Pending { | 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 | } else if restart == Restart::Done { | 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 | if let Some(message) = notice { | 695 | if let Some(message) = notice { |
| 472 | <p class="state" role="status">(message.as_str())</p> | 696 | <p class="state" role="status">(message.as_str())</p> |
| @@ -485,9 +709,9 @@ async fn server_view( | |||
| 485 | <p class="state">(s(lang, "No setting matches.", "Eşleşen ayar yok."))</p> | 709 | <p class="state">(s(lang, "No setting matches.", "Eşleşen ayar yok."))</p> |
| 486 | } | 710 | } |
| 487 | for hit in hits.iter() { | 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 | <span class="name">(hit.label)</span> | 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 | </a> | 715 | </a> |
| 492 | } | 716 | } |
| 493 | </section> | 717 | </section> |
| @@ -495,9 +719,7 @@ async fn server_view( | |||
| 495 | <form method="post" action="/admin/server" class="srv-form"> | 719 | <form method="post" action="/admin/server" class="srv-form"> |
| 496 | <input type="hidden" name="csrf" value=(csrf.as_str())> | 720 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 497 | <input type="hidden" name="tab" value=(tab)> | 721 | <input type="hidden" name="tab" value=(tab)> |
| 498 | - for r in rows.iter() { | 722 | + setting_lines(lang: lang, rows: rows) |
| 499 | - srv_row(lang: lang, row: r) | ||
| 500 | - } | ||
| 501 | if any_editable { | 723 | if any_editable { |
| 502 | <div class="acts srv-save"> | 724 | <div class="acts srv-save"> |
| 503 | <button type="submit" class="primary">(i18n::t(lang, Key::Save))</button> | 725 | <button type="submit" class="primary">(i18n::t(lang, Key::Save))</button> |
| @@ -505,10 +727,7 @@ async fn server_view( | |||
| 505 | } | 727 | } |
| 506 | </form> | 728 | </form> |
| 507 | } | 729 | } |
| 508 | - <form id="srv-reset" method="post" action="/admin/server/reset"> | 730 | + reset_form(csrf: csrf.clone(), back: format!("/admin/server?cat={tab}")) |
| 509 | - <input type="hidden" name="csrf" value=(csrf.as_str())> | ||
| 510 | - <input type="hidden" name="tab" value=(tab)> | ||
| 511 | - </form> | ||
| 512 | </div> | 731 | </div> |
| 513 | </div> | 732 | </div> |
| 514 | </div> | 733 | </div> |
| @@ -521,12 +740,11 @@ async fn server_page(cx: &Cx) -> Result<impl View> { | |||
| 521 | let query = query_params::<ServerQuery>(cx)?; | 740 | let query = query_params::<ServerQuery>(cx)?; |
| 522 | let state = app_context::<AppState>(cx); | 741 | let state = app_context::<AppState>(cx); |
| 523 | let lang = i18n::lang(cx, Some(&viewer.0)); | 742 | let lang = i18n::lang(cx, Some(&viewer.0)); |
| 524 | - let page = query | 743 | + let slug = query.cat.as_deref().or(query.tab.as_deref()).unwrap_or(""); |
| 525 | - .cat | 744 | + if let Some(to) = moved_slug(slug) { |
| 526 | - .as_deref() | 745 | + return Err(see_other(to).into()); |
| 527 | - .or(query.tab.as_deref()) | 746 | + } |
| 528 | - .and_then(page_by_slug) | 747 | + let page = page_by_slug(slug).unwrap_or(&PAGES[0]); |
| 529 | - .unwrap_or(&PAGES[0]); | ||
| 530 | let finder = Finder::new( | 748 | let finder = Finder::new( |
| 531 | query.q.as_deref(), | 749 | query.q.as_deref(), |
| 532 | query.exact.as_deref(), | 750 | query.exact.as_deref(), |
| @@ -545,7 +763,7 @@ async fn server_page(cx: &Cx) -> Result<impl View> { | |||
| 545 | } | 763 | } |
| 546 | 764 | ||
| 547 | #[route(POST "/admin/server")] | 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 | let viewer = admin_only(cx).await?; | 767 | let viewer = admin_only(cx).await?; |
| 550 | if !check_csrf(&viewer.1, form.get("csrf").map_or("", String::as_str)) { | 768 | if !check_csrf(&viewer.1, form.get("csrf").map_or("", String::as_str)) { |
| 551 | return Err(forbidden().into()); | 769 | return Err(forbidden().into()); |
| @@ -556,22 +774,10 @@ async fn server_save(cx: &Cx, Form(mut form): Form<HashMap<String, String>>) -> | |||
| 556 | .get("tab") | 774 | .get("tab") |
| 557 | .and_then(|t| page_by_slug(t)) | 775 | .and_then(|t| page_by_slug(t)) |
| 558 | .unwrap_or(&PAGES[0]); | 776 | .unwrap_or(&PAGES[0]); |
| 559 | - let group = page.group; | 777 | + let notice = notice_of( |
| 560 | - // An unchecked box is absent from the post. Only the page's own switches were on the form. | 778 | + lang, |
| 561 | - for field in ss::FIELDS.iter().filter(|f| { | 779 | + save_topic(cx, state, &viewer.0, page.group, page.keys, form, lang).await, |
| 562 | - page.keys.contains(&f.key) && f.ty == Ty::Bool && f.kind != Kind::ReadOnly | 780 | + ); |
| 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 | - }; | ||
| 575 | Err(see_other(format!( | 781 | Err(see_other(format!( |
| 576 | "/admin/server?cat={}¬ice={}", | 782 | "/admin/server?cat={}¬ice={}", |
| 577 | page.slug, | 783 | page.slug, |
| @@ -690,9 +896,10 @@ struct ResetForm { | |||
| 690 | #[serde(default)] | 896 | #[serde(default)] |
| 691 | csrf: String, | 897 | csrf: String, |
| 692 | #[serde(default)] | 898 | #[serde(default)] |
| 693 | - tab: String, | ||
| 694 | - #[serde(default)] | ||
| 695 | key: String, | 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 | #[route(POST "/admin/server/reset")] | 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 | let lang = i18n::lang(cx, Some(&viewer.0)); | 911 | let lang = i18n::lang(cx, Some(&viewer.0)); |
| 705 | let state = app_context::<AppState>(cx); | 912 | let state = app_context::<AppState>(cx); |
| 706 | - let group = Group::parse(&form.tab).unwrap_or(Group::General); | ||
| 707 | let notice = match reset(cx, state, &viewer.0, &form.key).await { | 913 | let notice = match reset(cx, state, &viewer.0, &form.key).await { |
| 708 | Ok(()) => g::t(lang, K::SrvResetDone).to_owned(), | 914 | Ok(()) => g::t(lang, K::SrvResetDone).to_owned(), |
| 709 | Err(Error::Invalid(message)) => message, | 915 | Err(Error::Invalid(message)) => message, |
| 710 | Err(Error::Config(message)) => message, | 916 | Err(Error::Config(message)) => message, |
| 711 | Err(other) => other.to_string(), | 917 | Err(other) => other.to_string(), |
| 712 | }; | 918 | }; |
| 713 | - Err(see_other(format!( | 919 | + Err(see_other(with_notice(back_to(&form.back), ¬ice)).into()) |
| 714 | - "/admin/server?cat={}¬ice={}", | ||
| 715 | - group.slug(), | ||
| 716 | - enc(¬ice) | ||
| 717 | - )) | ||
| 718 | - .into()) | ||
| 719 | } | 920 | } |
| 720 | 921 | ||
| 721 | async fn reset( | 922 | async fn reset( |
| @@ -845,6 +1046,15 @@ mod tests { | |||
| 845 | admin_get(fx, &location).await | 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 | // Scenario: non-admins get 404 on every route, bad CSRF is refused and refused values are | 1058 | // Scenario: non-admins get 404 on every route, bad CSRF is refused and refused values are |
| 849 | // never stored. Nothing here saves, so the store stays pristine for the next scenarios. | 1059 | // never stored. Nothing here saves, so the store stays pristine for the next scenarios. |
| 850 | #[tokio::test] | 1060 | #[tokio::test] |
| @@ -911,7 +1121,6 @@ mod tests { | |||
| 911 | ("limits", "ci.max_log_mb=0"), | 1121 | ("limits", "ci.max_log_mb=0"), |
| 912 | ("limits", "ci.max_log_mb=lots"), | 1122 | ("limits", "ci.max_log_mb=lots"), |
| 913 | ("storage", "storage.backend=r2"), | 1123 | ("storage", "storage.backend=r2"), |
| 914 | - ("backups", "backup.keep=0&backup.dir=%2Fvar%2Fbackups"), | ||
| 915 | ] { | 1124 | ] { |
| 916 | let body = save(&fx, tab, fields).await; | 1125 | let body = save(&fx, tab, fields).await; |
| 917 | assert!(!body.contains("Server settings saved."), "{fields}: {body}"); | 1126 | assert!(!body.contains("Server settings saved."), "{fields}: {body}"); |
| @@ -987,18 +1196,19 @@ mod tests { | |||
| 987 | 1196 | ||
| 988 | // A secret is saved, never shown on any tab, and a blank post keeps it. | 1197 | // A secret is saved, never shown on any tab, and a blank post keeps it. |
| 989 | let secret = "https://hc.example/ping/TOPSECRET-TOKEN"; | 1198 | let secret = "https://hc.example/ping/TOPSECRET-TOKEN"; |
| 990 | - let body = save( | 1199 | + let body = save_topic_at( |
| 991 | &fx, | 1200 | &fx, |
| 992 | - "backups", | 1201 | + "/admin/backups", |
| 993 | &format!("backup.healthcheck_url={}", enc(secret)), | 1202 | &format!("backup.healthcheck_url={}", enc(secret)), |
| 994 | ) | 1203 | ) |
| 995 | .await; | 1204 | .await; |
| 996 | assert!(body.contains("Server settings saved."), "{body}"); | 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 | let page = admin_get(&fx, &format!("/admin/server?tab={tab}")).await; | 1207 | let page = admin_get(&fx, &format!("/admin/server?tab={tab}")).await; |
| 999 | assert!(!page.contains("TOPSECRET"), "tab {tab}"); | 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 | assert!(page.contains("set")); | 1212 | assert!(page.contains("set")); |
| 1003 | assert_eq!( | 1213 | assert_eq!( |
| 1004 | fx.state | 1214 | fx.state |
| @@ -1010,7 +1220,7 @@ mod tests { | |||
| 1010 | .map(String::as_str), | 1220 | .map(String::as_str), |
| 1011 | Some(secret) | 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 | assert!( | 1224 | assert!( |
| 1015 | fx.state | 1225 | fx.state |
| 1016 | .store | 1226 | .store |
crates/forge-web/src/pages/admin_user_detail.rsmodified+4 -16
| @@ -247,11 +247,6 @@ async fn detail_body( | |||
| 247 | let profile = format!("/{}", enc(&target.username)); | 247 | let profile = format!("/{}", enc(&target.username)); |
| 248 | let repos_href = format!("/{}?tab=repositories", enc(&target.username)); | 248 | let repos_href = format!("/{}?tab=repositories", enc(&target.username)); |
| 249 | let snippets_href = format!("/{}?tab=snippets", enc(&target.username)); | 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 | let passkeys_question = s( | 250 | let passkeys_question = s( |
| 256 | lang, | 251 | lang, |
| 257 | "Remove every passkey of this user?", | 252 | "Remove every passkey of this user?", |
| @@ -383,11 +378,11 @@ async fn detail_body( | |||
| 383 | post_act(label: at(lang, A::Unsuspend), action: unsuspend_action.as_str(), csrf: csrf) | 378 | post_act(label: at(lang, A::Unsuspend), action: unsuspend_action.as_str(), csrf: csrf) |
| 384 | } | 379 | } |
| 385 | if !suspended && !own { | 380 | if !suspended && !own { |
| 386 | - <details class="reveal" id="suspend" title=(at(lang, A::SuspendHelp))> | 381 | + <details class="reveal" id="suspend"> |
| 387 | <summary class="act danger">(suspend_open.as_str())</summary> | 382 | <summary class="act danger">(suspend_open.as_str())</summary> |
| 388 | <form class="opened" method="post" action=(suspend_action.as_str())> | 383 | <form class="opened" method="post" action=(suspend_action.as_str())> |
| 389 | <input type="hidden" name="csrf" value=(csrf)> | 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 | <button type="submit" class="danger small">(suspend_title)</button> | 386 | <button type="submit" class="danger small">(suspend_title)</button> |
| 392 | </form> | 387 | </form> |
| 393 | </details> | 388 | </details> |
| @@ -416,16 +411,11 @@ async fn detail_body( | |||
| 416 | <h2>(s(lang, "Recovery", "Kurtarma"))</h2> | 411 | <h2>(s(lang, "Recovery", "Kurtarma"))</h2> |
| 417 | <div class="line"> | 412 | <div class="line"> |
| 418 | <span class="key">(s(lang, "Password", "Parola"))</span> | 413 | <span class="key">(s(lang, "Password", "Parola"))</span> |
| 419 | - <span class="val">(at(lang, A::ResetHelp))</span> | 414 | + confirm_act(lang: lang, label: at(lang, A::GenerateLink), action: reset_action.as_str(), csrf: csrf, note: None) |
| 420 | - confirm_act(lang: lang, label: at(lang, A::GenerateLink), action: reset_action.as_str(), csrf: csrf, note: Some(reset_note.to_owned())) | ||
| 421 | </div> | 415 | </div> |
| 422 | <div class="line"> | 416 | <div class="line"> |
| 423 | <span class="key">(at(lang, A::TwoFactor))</span> | 417 | <span class="key">(at(lang, A::TwoFactor))</span> |
| 424 | - <span class="val">(tfa) | 418 | + <span class="val">(tfa)</span> |
| 425 | - if tfa_on { | ||
| 426 | - " · " (at(lang, A::Disable2faHelp)) | ||
| 427 | - } | ||
| 428 | - </span> | ||
| 429 | if tfa_on { | 419 | if tfa_on { |
| 430 | confirm_act(lang: lang, label: g::t(lang, K::Disable), action: tfa_action.as_str(), csrf: csrf) | 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 | <h2>(i18n::t(lang, Key::DangerZone))</h2> | 433 | <h2>(i18n::t(lang, Key::DangerZone))</h2> |
| 444 | <div class="line"> | 434 | <div class="line"> |
| 445 | <span class="key">(i18n::t(lang, Key::Delete))</span> | 435 | <span class="key">(i18n::t(lang, Key::Delete))</span> |
| 446 | - <span class="val">(at(lang, A::DeleteHelp))</span> | ||
| 447 | <a class="act danger" href=(delete_href.as_str())>(i18n::t(lang, Key::Delete))</a> | 436 | <a class="act danger" href=(delete_href.as_str())>(i18n::t(lang, Key::Delete))</a> |
| 448 | </div> | 437 | </div> |
| 449 | </section> | 438 | </section> |
| @@ -537,7 +526,6 @@ async fn org_body( | |||
| 537 | <h2>(i18n::t(lang, Key::DangerZone))</h2> | 526 | <h2>(i18n::t(lang, Key::DangerZone))</h2> |
| 538 | <div class="line"> | 527 | <div class="line"> |
| 539 | <span class="key">(i18n::t(lang, Key::Delete))</span> | 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 | <a class="act danger" href=(delete_action.as_str())>(g::t(lang, K::DeleteOrgTitle))</a> | 529 | <a class="act danger" href=(delete_action.as_str())>(g::t(lang, K::DeleteOrgTitle))</a> |
| 542 | </div> | 530 | </div> |
| 543 | </section> | 531 | </section> |
crates/forge-web/src/pages/admin_users.rsmodified+37 -13
| @@ -20,11 +20,11 @@ use crate::i18n::admin::{self as g, K}; | |||
| 20 | use crate::i18n::orgs::{self as og, K as OG}; | 20 | use crate::i18n::orgs::{self as og, K as OG}; |
| 21 | use crate::i18n::{self, Key, Lang}; | 21 | use crate::i18n::{self, Key, Lang}; |
| 22 | use crate::live::{Topic, stream_changes}; | 22 | use crate::live::{Topic, stream_changes}; |
| 23 | +use crate::pages::issues_list::list_href; | ||
| 23 | use crate::pages::passkeys::s; | 24 | use crate::pages::passkeys::s; |
| 24 | use crate::state::AppState; | 25 | use crate::state::AppState; |
| 25 | -use crate::views::parts::{head, reveal}; | ||
| 26 | -use crate::pages::issues_list::list_href; | ||
| 27 | use crate::views::find::{Finder, finder_field}; | 26 | use crate::views::find::{Finder, finder_field}; |
| 27 | +use crate::views::parts::{RailItem, head, rail, reveal}; | ||
| 28 | use crate::views::repo_list::{pager, pager_links}; | 28 | use crate::views::repo_list::{pager, pager_links}; |
| 29 | use crate::views::{alert, enc, rel_time, shell, user_facing_message}; | 29 | use crate::views::{alert, enc, rel_time, shell, user_facing_message}; |
| 30 | 30 | ||
| @@ -198,17 +198,17 @@ async fn users_view( | |||
| 198 | let open = error.is_some(); | 198 | let open = error.is_some(); |
| 199 | // The field says what the current tab lists. | 199 | // The field says what the current tab lists. |
| 200 | let search_label = match kind { | 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 | Kind::People => s(lang, "Search users", "Kullanıcılarda ara"), | 206 | Kind::People => s(lang, "Search users", "Kullanıcılarda ara"), |
| 203 | Kind::Organizations => s(lang, "Search organizations", "Kuruluşlarda ara"), | 207 | Kind::Organizations => s(lang, "Search organizations", "Kuruluşlarda ara"), |
| 204 | }; | 208 | }; |
| 205 | let filter_label = s(lang, "Filter", "Filtre"); | 209 | let filter_label = s(lang, "Filter", "Filtre"); |
| 206 | let all_label = format!("{} {}", s(lang, "All", "Tümü"), all_count); | 210 | let all_label = format!("{} {}", s(lang, "All", "Tümü"), all_count); |
| 207 | - let people_label = format!( | 211 | + let people_label = format!("{} {}", s(lang, "People", "Kişiler"), all_count - org_count); |
| 208 | - "{} {}", | ||
| 209 | - s(lang, "People", "Kişiler"), | ||
| 210 | - all_count - org_count | ||
| 211 | - ); | ||
| 212 | let orgs_label = format!("{} {}", og::t(lang, OG::Organizations), org_count); | 212 | let orgs_label = format!("{} {}", og::t(lang, OG::Organizations), org_count); |
| 213 | let all_href = users_href(&finder, Kind::All, 1); | 213 | let all_href = users_href(&finder, Kind::All, 1); |
| 214 | let people_href = users_href(&finder, Kind::People, 1); | 214 | let people_href = users_href(&finder, Kind::People, 1); |
| @@ -232,7 +232,6 @@ async fn users_view( | |||
| 232 | <div class="field"> | 232 | <div class="field"> |
| 233 | <label for="new-password">(i18n::t(lang, Key::Password))</label> | 233 | <label for="new-password">(i18n::t(lang, Key::Password))</label> |
| 234 | <input id="new-password" type="password" name="password" required=(true) autocomplete="new-password"> | 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 | </div> | 235 | </div> |
| 237 | <label class="switch"> | 236 | <label class="switch"> |
| 238 | <input type="checkbox" name="is_admin" value="yes"> | 237 | <input type="checkbox" name="is_admin" value="yes"> |
| @@ -247,6 +246,8 @@ async fn users_view( | |||
| 247 | <a href=(people_href.as_str()) aria-current=((kind == Kind::People).then_some("page"))>(people_label.as_str())</a> | 246 | <a href=(people_href.as_str()) aria-current=((kind == Kind::People).then_some("page"))>(people_label.as_str())</a> |
| 248 | <a href=(orgs_href.as_str()) aria-current=((kind == Kind::Organizations).then_some("page"))>(orgs_label.as_str())</a> | 247 | <a href=(orgs_href.as_str()) aria-current=((kind == Kind::Organizations).then_some("page"))>(orgs_label.as_str())</a> |
| 249 | </nav> | 248 | </nav> |
| 249 | + <div class="work"> | ||
| 250 | + users_rail(lang: lang, current: "users") | ||
| 250 | <div class="sheet" data-live="/admin/users/events"> | 251 | <div class="sheet" data-live="/admin/users/events"> |
| 251 | <div class="sheet-tools"> | 252 | <div class="sheet-tools"> |
| 252 | <form method="get" action="/admin/users" role="search"> | 253 | <form method="get" action="/admin/users" role="search"> |
| @@ -282,6 +283,29 @@ async fn users_view( | |||
| 282 | } | 283 | } |
| 283 | pager(page: page, pages: pages, links: links, prev: prev, next: next, lang: lang) | 284 | pager(page: page, pages: pages, links: links, prev: prev, next: next, lang: lang) |
| 284 | </div> | 285 | </div> |
| 286 | + </div> | ||
| 287 | + }) | ||
| 288 | +} | ||
| 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) | ||
| 285 | }) | 309 | }) |
| 286 | } | 310 | } |
| 287 | 311 | ||
| @@ -489,7 +513,7 @@ async fn delete_body( | |||
| 489 | <p class="state">(g::t(lang, K::DeletesAccount))<strong>(target.username.as_str())</strong>(g::t(lang, K::DeleteAccountRest))</p> | 513 | <p class="state">(g::t(lang, K::DeletesAccount))<strong>(target.username.as_str())</strong>(g::t(lang, K::DeleteAccountRest))</p> |
| 490 | if has_repos { | 514 | if has_repos { |
| 491 | <section class="sec"> | 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 | <ul class="item-list"> | 517 | <ul class="item-list"> |
| 494 | for name in repos.into_iter() { | 518 | for name in repos.into_iter() { |
| 495 | <li>(name)</li> | 519 | <li>(name)</li> |
| @@ -500,13 +524,13 @@ async fn delete_body( | |||
| 500 | if let Some(impact) = impact { | 524 | if let Some(impact) = impact { |
| 501 | <section class="sec"> | 525 | <section class="sec"> |
| 502 | <h2>(g::t(lang, K::WhatHappens))</h2> | 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 | <ul class="item-list"> | 528 | <ul class="item-list"> |
| 505 | for line in impact.moved.into_iter() { | 529 | for line in impact.moved.into_iter() { |
| 506 | <li>(line)</li> | 530 | <li>(line)</li> |
| 507 | } | 531 | } |
| 508 | </ul> | 532 | </ul> |
| 509 | - <p class="hint">(g::t(lang, K::RemovedWithAccount))</p> | 533 | + <p class="state">(g::t(lang, K::RemovedWithAccount))</p> |
| 510 | <ul class="item-list"> | 534 | <ul class="item-list"> |
| 511 | for line in impact.removed.into_iter() { | 535 | for line in impact.removed.into_iter() { |
| 512 | <li>(line)</li> | 536 | <li>(line)</li> |
| @@ -553,7 +577,7 @@ async fn org_delete_note( | |||
| 553 | <p class="state"><strong>(target.username.as_str())</strong>(g::t(lang, K::OrgNotAUser))</p> | 577 | <p class="state"><strong>(target.username.as_str())</strong>(g::t(lang, K::OrgNotAUser))</p> |
| 554 | if has_repos { | 578 | if has_repos { |
| 555 | <section class="sec"> | 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 | <ul class="item-list"> | 581 | <ul class="item-list"> |
| 558 | for name in repos.into_iter() { | 582 | for name in repos.into_iter() { |
| 559 | <li>(name)</li> | 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 | use crate::pages::admin_users::admin_only; | 19 | use crate::pages::admin_users::admin_only; |
| 20 | use crate::pages::issues_list::list_href; | 20 | use crate::pages::issues_list::list_href; |
| 21 | use crate::pages::passkeys::s; | 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 | use crate::state::AppState; | 23 | use crate::state::AppState; |
| 24 | use crate::views::find::{Finder, finder_field}; | 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 | use crate::views::repo_list::{PageLink, pager, pager_links}; | 26 | use crate::views::repo_list::{PageLink, pager, pager_links}; |
| 27 | use crate::views::{rel_time, shell}; | 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 | #[component] | 497 | #[component] |
| 498 | async fn single_row(lang: Lang, mut group: Group, show_actor: bool) -> Result<impl View> { | 498 | async fn single_row(lang: Lang, mut group: Group, show_actor: bool) -> Result<impl View> { |
| 499 | let row = group.rows.remove(0); | 499 | let row = group.rows.remove(0); |
| 500 | - let title = row.details.clone(); | ||
| 501 | let name = row.name.clone(); | 500 | let name = row.name.clone(); |
| 502 | let action = row.action.clone(); | 501 | let action = row.action.clone(); |
| 503 | Ok(view! { | 502 | Ok(view! { |
| 504 | - <div class="line" data-kb-row="" title=(title.as_str())> | 503 | + <div class="line" data-kb-row="" data-action=(action.as_str())> |
| 505 | - <span class="name" title=(action.as_str())>(name.as_str())</span> | 504 | + <span class="name">(name.as_str())</span> |
| 506 | <span class="val">entry_facts(lang: lang, row: row, show_actor: show_actor, show_target: true, show_ip: true, show_details: true)</span> | 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 | </div> | 506 | </div> |
| 508 | }) | 507 | }) |
| @@ -538,8 +537,8 @@ async fn group_row(lang: Lang, mut group: Group, show_actor: bool) -> Result<imp | |||
| 538 | let rows = std::mem::take(&mut group.rows); | 537 | let rows = std::mem::take(&mut group.rows); |
| 539 | Ok(view! { | 538 | Ok(view! { |
| 540 | <details class="log-group"> | 539 | <details class="log-group"> |
| 541 | - <summary class="line" data-kb-row=""> | 540 | + <summary class="line" data-kb-row="" data-action=(action.as_str())> |
| 542 | - <span class="name" title=(action.as_str())>(name.as_str())</span> | 541 | + <span class="name">(name.as_str())</span> |
| 543 | <span class="count">"×" (count.as_str())</span> | 542 | <span class="count">"×" (count.as_str())</span> |
| 544 | <span class="val"> | 543 | <span class="val"> |
| 545 | rel_time(lang: lang, stamp: when.as_str()) | 544 | rel_time(lang: lang, stamp: when.as_str()) |
| @@ -575,9 +574,8 @@ async fn item_line( | |||
| 575 | show_ip: bool, | 574 | show_ip: bool, |
| 576 | show_details: bool, | 575 | show_details: bool, |
| 577 | ) -> Result<impl View> { | 576 | ) -> Result<impl View> { |
| 578 | - let title = row.details.clone(); | ||
| 579 | Ok(view! { | 577 | Ok(view! { |
| 580 | - <div class="line" title=(title.as_str())> | 578 | + <div class="line"> |
| 581 | <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> | 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 | </div> | 580 | </div> |
| 583 | }) | 581 | }) |
| @@ -599,9 +597,8 @@ async fn admin_audit_view( | |||
| 599 | nav: (Vec<PageLink>, Option<String>, Option<String>), | 597 | nav: (Vec<PageLink>, Option<String>, Option<String>), |
| 600 | ) -> Result<impl View> { | 598 | ) -> Result<impl View> { |
| 601 | let (links, prev, next) = nav; | 599 | let (links, prev, next) = nav; |
| 602 | - let sub = vec![SubPart::text(g::t(lang, K::AuditIntro))]; | ||
| 603 | Ok(view! { | 600 | Ok(view! { |
| 604 | - head(title: g::t(lang, K::AuditLog), sub: sub) | 601 | + head(title: g::t(lang, K::AuditLog)) |
| 605 | <div class="sheet" data-live=(live.as_str())> | 602 | <div class="sheet" data-live=(live.as_str())> |
| 606 | log_tools(lang: lang, form_action: "/admin/audit", finder: finder, action: action, actor: actor, span: span, total: total) | 603 | log_tools(lang: lang, form_action: "/admin/audit", finder: finder, action: action, actor: actor, span: span, total: total) |
| 607 | if let Some(message) = notice { | 604 | if let Some(message) = notice { |
| @@ -627,9 +624,8 @@ async fn own_log_view( | |||
| 627 | nav: (Vec<PageLink>, Option<String>, Option<String>), | 624 | nav: (Vec<PageLink>, Option<String>, Option<String>), |
| 628 | ) -> Result<impl View> { | 625 | ) -> Result<impl View> { |
| 629 | let (links, prev, next) = nav; | 626 | let (links, prev, next) = nav; |
| 630 | - let sub = vec![SubPart::text(security_sub(lang))]; | ||
| 631 | Ok(view! { | 627 | Ok(view! { |
| 632 | - head(title: i18n::t(lang, i18n::Key::Security), sub: sub) | 628 | + head(title: i18n::t(lang, i18n::Key::Security)) |
| 633 | <div class="work"> | 629 | <div class="work"> |
| 634 | rail(label: i18n::t(lang, i18n::Key::Security), items: items) | 630 | rail(label: i18n::t(lang, i18n::Key::Security), items: items) |
| 635 | <div class="sheet"> | 631 | <div class="sheet"> |
| @@ -923,8 +919,6 @@ mod tests { | |||
| 923 | ) | 919 | ) |
| 924 | .await; | 920 | .await; |
| 925 | assert_eq!(status, 200); | 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 | assert!(body.contains("password_reset_by_admin")); | 922 | assert!(body.contains("password_reset_by_admin")); |
| 929 | 923 | ||
| 930 | // The own log needs a session. | 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 | <span class="blame-author">(meta.author.as_str())</span> | 117 | <span class="blame-author">(meta.author.as_str())</span> |
| 118 | <time class="hint" data-rel="true" datetime=(meta.iso.as_str())>(meta.age.as_str())</time> | 118 | <time class="hint" data-rel="true" datetime=(meta.iso.as_str())>(meta.age.as_str())</time> |
| 119 | if let Some(prior) = meta.prior_href { | 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 | </div> | 122 | </div> |
| 123 | <a class="blame-summary" href=(meta.commit_href.as_str()) title=(meta.summary.as_str())>commit_line(subject: meta.summary.clone())</a> | 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 | <a class="act" href=(raw.clone())>(g::t(lang, K::RawLink))</a> | 354 | <a class="act" href=(raw.clone())>(g::t(lang, K::RawLink))</a> |
| 355 | <a class="act" href=(download_href) download=(download_name)>(g::t(lang, K::DownloadLink))</a> | 355 | <a class="act" href=(download_href) download=(download_name)>(g::t(lang, K::DownloadLink))</a> |
| 356 | if can_blame { | 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 | data-copied=(b::t(lang, b::K::PermalinkCopied))>(b::t(lang, b::K::CopyPermalink))</button> | 358 | data-copied=(b::t(lang, b::K::PermalinkCopied))>(b::t(lang, b::K::CopyPermalink))</button> |
| 359 | } | 359 | } |
| 360 | </div> | 360 | </div> |
crates/forge-web/src/pages/branches.rsmodified+1 -1
| @@ -119,7 +119,7 @@ async fn new_branch_form( | |||
| 119 | <div class="field"> | 119 | <div class="field"> |
| 120 | <label for="branch-from">(b::t(lang, b::K::BranchFromLabel))</label> | 120 | <label for="branch-from">(b::t(lang, b::K::BranchFromLabel))</label> |
| 121 | <input id="branch-from" type="text" name="from" list="branch-sources" value=(default_branch.as_str()) | 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 | </div> | 123 | </div> |
| 124 | <datalist id="branch-sources"> | 124 | <datalist id="branch-sources"> |
| 125 | for option in options.iter() { | 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 | <strong>(g::t(lang, K::Log))</strong> | 479 | <strong>(g::t(lang, K::Log))</strong> |
| 480 | <div class="ci-tl-tools"> | 480 | <div class="ci-tl-tools"> |
| 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"> | 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> | 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" 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> | 483 | + <label class="find-opt"><input type="checkbox" data-log-case="true"><span>"Aa"</span></label> |
| 484 | <span class="ci-logcount" data-log-count="true" data-none=(g::t(lang, K::LogNoMatches)) aria-live="polite"></span> | 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> | 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)) title=(g::t(lang, K::LogNext))>"\u{2193}"</button> | 486 | + <button type="button" class="act" data-log-next="true" aria-label=(g::t(lang, K::LogNext))>"\u{2193}"</button> |
| 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> | 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 | <a class="act" href=(job.log_href.as_str())>(g::t(lang, K::FullLog))</a> | 488 | <a class="act" href=(job.log_href.as_str())>(g::t(lang, K::FullLog))</a> |
| 489 | <span class="ci-logfold" data-log-fold-box="true" hidden="hidden"> | 489 | <span class="ci-logfold" data-log-fold-box="true" hidden="hidden"> |
| @@ -511,7 +511,6 @@ async fn job_body( | |||
| 511 | </div> | 511 | </div> |
| 512 | } | 512 | } |
| 513 | <div class="sec ci-dock"> | 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 | <div class="dock-history"> | 514 | <div class="dock-history"> |
| 516 | history_strip(lang: lang, owner: owner, repo: repo, bars: bars) | 515 | history_strip(lang: lang, owner: owner, repo: repo, bars: bars) |
| 517 | </div> | 516 | </div> |
crates/forge-web/src/pages/ci_runs.rsmodified+38 -40
| @@ -422,12 +422,11 @@ struct BadgeInfo { | |||
| 422 | snippet: String, | 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 | struct ListView { | 426 | struct ListView { |
| 427 | manual: Option<ManualRun>, | 427 | manual: Option<ManualRun>, |
| 428 | badge: BadgeInfo, | 428 | badge: BadgeInfo, |
| 429 | total: u64, | 429 | total: u64, |
| 430 | - scale: String, | ||
| 431 | rows: Vec<RunRow>, | 430 | rows: Vec<RunRow>, |
| 432 | newer_href: Option<String>, | 431 | newer_href: Option<String>, |
| 433 | older_href: Option<String>, | 432 | older_href: Option<String>, |
| @@ -1848,7 +1847,6 @@ async fn runs_split( | |||
| 1848 | manual, | 1847 | manual, |
| 1849 | badge: badge_info(state, &title, &ctx.repo.default_branch), | 1848 | badge: badge_info(state, &title, &ctx.repo.default_branch), |
| 1850 | total, | 1849 | total, |
| 1851 | - scale: g::scale_label(lang, &span_text(scale)), | ||
| 1852 | rows, | 1850 | rows, |
| 1853 | newer_href, | 1851 | newer_href, |
| 1854 | older_href, | 1852 | older_href, |
| @@ -2184,16 +2182,14 @@ fn query_value(cx: &Cx, key: &str) -> Option<String> { | |||
| 2184 | .map(|(_, value)| value.into_owned()) | 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 | #[component] | 2186 | #[component] |
| 2189 | async fn ci_menus(lang: Lang, list: &ListView) -> Result<impl View> { | 2187 | async fn ci_menus(lang: Lang, list: &ListView) -> Result<impl View> { |
| 2190 | - let badge = &list.badge; | ||
| 2191 | Ok(view! { | 2188 | Ok(view! { |
| 2192 | if let Some(form) = list.manual.as_ref() { | 2189 | if let Some(form) = list.manual.as_ref() { |
| 2193 | <details class="menu ci-tool"> | 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 | <div class="menu-list ci-pop"> | 2192 | <div class="menu-list ci-pop"> |
| 2196 | - <p class="muted small">(g::t(lang, K::RunWorkflowHelp))</p> | ||
| 2197 | <form method="post" action=(form.action.as_str()) class="ci-manual-form"> | 2193 | <form method="post" action=(form.action.as_str()) class="ci-manual-form"> |
| 2198 | <input type="hidden" name="csrf" value=(form.csrf.as_str())> | 2194 | <input type="hidden" name="csrf" value=(form.csrf.as_str())> |
| 2199 | <label> | 2195 | <label> |
| @@ -2209,17 +2205,6 @@ async fn ci_menus(lang: Lang, list: &ListView) -> Result<impl View> { | |||
| 2209 | </div> | 2205 | </div> |
| 2210 | </details> | 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 | #[component] | 2213 | #[component] |
| 2229 | async fn runs_sheet(lang: Lang, list: &ListView) -> Result<impl View> { | 2214 | async fn runs_sheet(lang: Lang, list: &ListView) -> Result<impl View> { |
| 2230 | let ListView { | 2215 | let ListView { |
| 2216 | + badge, | ||
| 2231 | total, | 2217 | total, |
| 2232 | - scale, | ||
| 2233 | rows, | 2218 | rows, |
| 2234 | newer_href, | 2219 | newer_href, |
| 2235 | older_href, | 2220 | older_href, |
| @@ -2242,13 +2227,22 @@ async fn runs_sheet(lang: Lang, list: &ListView) -> Result<impl View> { | |||
| 2242 | <div class="sheet-tools"> | 2227 | <div class="sheet-tools"> |
| 2243 | <strong>(g::t(lang, K::Runs))</strong> | 2228 | <strong>(g::t(lang, K::Runs))</strong> |
| 2244 | <span class="hint ci-count">(total)</span> | 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 | </div> | 2240 | </div> |
| 2247 | if let Some(next) = next_scheduled.as_ref() { | 2241 | if let Some(next) = next_scheduled.as_ref() { |
| 2248 | <p class="ci-next hint">(g::t(lang, K::NextScheduledRun)) ": " rel_time(lang: lang, stamp: next.as_str())</p> | 2242 | <p class="ci-next hint">(g::t(lang, K::NextScheduledRun)) ": " rel_time(lang: lang, stamp: next.as_str())</p> |
| 2249 | } | 2243 | } |
| 2250 | if rows.is_empty() { | 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 | } else { | 2246 | } else { |
| 2253 | <div class="ci-run-list"> | 2247 | <div class="ci-run-list"> |
| 2254 | for row in rows.iter() { | 2248 | for row in rows.iter() { |
| @@ -2263,9 +2257,17 @@ async fn runs_sheet(lang: Lang, list: &ListView) -> Result<impl View> { | |||
| 2263 | </svg> | 2257 | </svg> |
| 2264 | if let Some(est) = row.est.as_ref() { | 2258 | if let Some(est) = row.est.as_ref() { |
| 2265 | <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> | 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 | } else { | 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 | </a> | 2272 | </a> |
| 2271 | if let Some((action, token)) = row.rerun.as_ref() { | 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 | 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. |
| 2297 | -/// runs sheet. The live region is the list's stream, so the list re-renders when a run changes. | ||
| 2298 | #[component] | 2299 | #[component] |
| 2299 | async fn runs_body( | 2300 | async fn runs_body( |
| 2300 | head: RepoHead, | 2301 | head: RepoHead, |
| @@ -2447,12 +2448,13 @@ async fn run_head(lang: Lang, run: &RunDetail, all_href: Option<String>) -> Resu | |||
| 2447 | if run.can_cancel && run.stopping { | 2448 | if run.can_cancel && run.stopping { |
| 2448 | <button type="button" class="ci-stopping" disabled="disabled">(g::t(lang, K::StoppingButton))</button> | 2449 | <button type="button" class="ci-stopping" disabled="disabled">(g::t(lang, K::StoppingButton))</button> |
| 2449 | } else if run.can_cancel { | 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 | if rerun_failed_shown { | 2453 | if rerun_failed_shown { |
| 2453 | action_button(action: format!("{}/rerun-failed", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::RerunFailed), primary: true) | 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 | action_button(action: format!("{}/rerun", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::Rerun), primary: !rerun_failed_shown) | 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 | <p class="head-sub"> | 2462 | <p class="head-sub"> |
| 2461 | <span class="b" data-run=(run.number) title=(run.title.as_str())>(run.title.as_str())</span> | 2463 | <span class="b" data-run=(run.number) title=(run.title.as_str())>(run.title.as_str())</span> |
| 2462 | <span class="sep" aria-hidden="true">"·"</span> | 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 | <span class="sep" aria-hidden="true">"·"</span> | 2466 | <span class="sep" aria-hidden="true">"·"</span> |
| 2465 | if let Some(href) = run.commit_href.as_ref() { | 2467 | if let Some(href) = run.commit_href.as_ref() { |
| 2466 | <a class="mono" href=(href.as_str())>(run.commit.as_str())</a> | 2468 | <a class="mono" href=(href.as_str())>(run.commit.as_str())</a> |
| 2467 | } else { | 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 | if !run.actor.is_empty() { | 2472 | if !run.actor.is_empty() { |
| 2471 | <span class="sep" aria-hidden="true">"·"</span> | 2473 | <span class="sep" aria-hidden="true">"·"</span> |
| @@ -2574,12 +2576,7 @@ async fn run_artifacts(lang: Lang, run: &RunDetail) -> Result<impl View> { | |||
| 2574 | Ok(view! { | 2576 | Ok(view! { |
| 2575 | if !run.artifacts.is_empty() { | 2577 | if !run.artifacts.is_empty() { |
| 2576 | <div class="sec"> | 2578 | <div class="sec"> |
| 2577 | - <div class="acts"> | ||
| 2578 | <h2>(g::t(lang, K::Artifacts))</h2> | 2579 | <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> | ||
| 2583 | for artifact in run.artifacts.iter() { | 2580 | for artifact in run.artifacts.iter() { |
| 2584 | <div class="line"> | 2581 | <div class="line"> |
| 2585 | <span class="name">(artifact.name.as_str())</span> | 2582 | <span class="name">(artifact.name.as_str())</span> |
| @@ -2623,13 +2620,16 @@ async fn run_log( | |||
| 2623 | if let Some(log) = run.log.as_ref() { | 2620 | if let Some(log) = run.log.as_ref() { |
| 2624 | <div class="ci-tl-tools"> | 2621 | <div class="ci-tl-tools"> |
| 2625 | <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"> | 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> | 2623 | + <label class="find-opt"><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> | 2624 | + <label class="find-opt"><input type="checkbox" data-log-case="true"><span>"Aa"</span></label> |
| 2628 | <span class="ci-logcount" data-log-count="true" data-none=(g::t(lang, K::LogNoMatches)) aria-live="polite"></span> | 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> | 2626 | + <button type="button" class="act" data-log-prev="true" aria-label=(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> | 2627 | + <button type="button" class="act" data-log-next="true" aria-label=(g::t(lang, K::LogNext))>"\u{2193}"</button> |
| 2631 | <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> | 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 | <a class="act" href=(log.href.as_str())>(g::t(lang, K::FullLog))</a> | 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 | if let (Some(action), Some(csrf)) = (log.rerun.as_ref(), run.writer_csrf.as_ref()) { | 2633 | if let (Some(action), Some(csrf)) = (log.rerun.as_ref(), run.writer_csrf.as_ref()) { |
| 2634 | <form method="post" action=(action.as_str()) class="act-form ci-job-rerun"> | 2634 | <form method="post" action=(action.as_str()) class="act-form ci-job-rerun"> |
| 2635 | <input type="hidden" name="csrf" value=(csrf.as_str())> | 2635 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| @@ -2650,7 +2650,6 @@ async fn run_log( | |||
| 2650 | if !run.warnings.is_empty() { | 2650 | if !run.warnings.is_empty() { |
| 2651 | <section class="ci-warnings" role="status"> | 2651 | <section class="ci-warnings" role="status"> |
| 2652 | <p class="ci-warnings-title">(g::t(lang, K::ConfigWarnings))</p> | 2652 | <p class="ci-warnings-title">(g::t(lang, K::ConfigWarnings))</p> |
| 2653 | - <p class="hint">(g::t(lang, K::ConfigWarningsHint))</p> | ||
| 2654 | <ul> | 2653 | <ul> |
| 2655 | for warning in run.warnings.iter() { | 2654 | for warning in run.warnings.iter() { |
| 2656 | <li><code>(warning.as_str())</code></li> | 2655 | <li><code>(warning.as_str())</code></li> |
| @@ -2680,7 +2679,6 @@ async fn run_log( | |||
| 2680 | run_timeline(lang: lang, run: run) | 2679 | run_timeline(lang: lang, run: run) |
| 2681 | run_artifacts(lang: lang, run: run) | 2680 | run_artifacts(lang: lang, run: run) |
| 2682 | <div class="sec ci-dock"> | 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 | <div class="dock-history"> | 2682 | <div class="dock-history"> |
| 2685 | history_strip(lang: lang, owner: owner, repo: repo, bars: bars) | 2683 | history_strip(lang: lang, owner: owner, repo: repo, bars: bars) |
| 2686 | </div> | 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 | let run = run_with(&fx, &["build"], false).await; | 261 | let run = run_with(&fx, &["build"], false).await; |
| 262 | let run_url = format!("{RUN_BASE}/runs/{}", run.number); | 262 | let run_url = format!("{RUN_BASE}/runs/{}", run.number); |
| 263 | let writer = get(&fx.app, &run_url, Some(&cookie_for("bob-token"))).await; | 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 | assert!(writer.text().contains(">Cancel<"), "writer sees cancel"); | 265 | assert!(writer.text().contains(">Cancel<"), "writer sees cancel"); |
| 266 | let reader = get(&fx.app, &run_url, Some(&cookie_for("dave-token"))).await; | 266 | let reader = get(&fx.app, &run_url, Some(&cookie_for("dave-token"))).await; |
| 267 | assert_eq!(reader.status, 200); | 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 | </div> | 224 | </div> |
| 225 | <div class="field"> | 225 | <div class="field"> |
| 226 | <label for="search-path">(g::t(lang, K::PathField))</label> | 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 | </div> | 228 | </div> |
| 229 | <label class="switch"> | 229 | <label class="switch"> |
| 230 | <input type="checkbox" name="case" value="1" checked=(match_case) data-autosubmit=(true)> | 230 | <input type="checkbox" name="case" value="1" checked=(match_case) data-autosubmit=(true)> |
crates/forge-web/src/pages/discussion_settings.rsmodified+8 -18
| @@ -1,6 +1,6 @@ | |||
| 1 | -//! The Discussions switch on the repo settings page. `POST /{owner}/{repo}/settings/discussions` | 1 | +//! The Discussions switch in the Features topic of the General settings page. `POST |
| 2 | -//! with `enabled=1` or `enabled=0`. Admins only. Turning discussions off hides the tab and makes | 2 | +//! /{owner}/{repo}/settings/discussions` with `enabled=1` or `enabled=0`. Admins only. Turning |
| 3 | -//! the discussion pages 404; the discussions themselves are kept. | 3 | +//! discussions off hides the tab and makes the discussion pages 404; the discussions themselves are kept. |
| 4 | 4 | ||
| 5 | use forge_core::AuditAction; | 5 | use forge_core::AuditAction; |
| 6 | use serde::Deserialize; | 6 | use serde::Deserialize; |
| @@ -14,7 +14,6 @@ use topcoat::view::{View, component, view}; | |||
| 14 | use crate::audit::{self, Actor, Target}; | 14 | use crate::audit::{self, Actor, Target}; |
| 15 | use crate::auth::require_csrf; | 15 | use crate::auth::require_csrf; |
| 16 | use crate::i18n::Lang; | 16 | use crate::i18n::Lang; |
| 17 | -use crate::i18n::community::{self as g, K}; | ||
| 18 | use crate::live::Topic; | 17 | use crate::live::Topic; |
| 19 | use crate::pages::repo_ctx::load_repo; | 18 | use crate::pages::repo_ctx::load_repo; |
| 20 | use crate::state::AppState; | 19 | use crate::state::AppState; |
| @@ -23,32 +22,24 @@ use crate::views::repo_href; | |||
| 23 | path_param!(owner); | 22 | path_param!(owner); |
| 24 | path_param!(repo); | 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 | /// the form on change (`data-autosubmit`); an unchecked box sends no `enabled`, which the handler reads as off. | 26 | /// the form on change (`data-autosubmit`); an unchecked box sends no `enabled`, which the handler reads as off. |
| 28 | #[component] | 27 | #[component] |
| 29 | -pub(crate) async fn discussions_card( | 28 | +pub(crate) async fn discussions_switch( |
| 30 | lang: Lang, | 29 | lang: Lang, |
| 31 | action: String, | 30 | action: String, |
| 32 | csrf: String, | 31 | csrf: String, |
| 33 | enabled: bool, | 32 | enabled: bool, |
| 34 | ) -> Result<impl View> { | 33 | ) -> Result<impl View> { |
| 35 | - let switch_label = if enabled { | 34 | + let switch_label = crate::pages::passkeys::s(lang, "Discussions", "Tartışmalar"); |
| 36 | - g::t(lang, K::TurnOffDiscussions) | ||
| 37 | - } else { | ||
| 38 | - g::t(lang, K::TurnOnDiscussions) | ||
| 39 | - }; | ||
| 40 | Ok(view! { | 35 | Ok(view! { |
| 41 | - <section class="sec" id="discussions"> | 36 | + <form method="post" action=(action.as_str()) 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())> | 37 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 45 | <label class="switch"> | 38 | <label class="switch"> |
| 46 | <input type="checkbox" name="enabled" value="1" checked=(enabled) data-autosubmit="true"> | 39 | <input type="checkbox" name="enabled" value="1" checked=(enabled) data-autosubmit="true"> |
| 47 | <span>(switch_label)</span> | 40 | <span>(switch_label)</span> |
| 48 | </label> | 41 | </label> |
| 49 | - <p class="hint">(g::t(lang, K::DiscussionsDescription))</p> | ||
| 50 | </form> | 42 | </form> |
| 51 | - </section> | ||
| 52 | }) | 43 | }) |
| 53 | } | 44 | } |
| 54 | 45 | ||
| @@ -94,6 +85,5 @@ async fn settings_discussions_save(cx: &Cx, Form(form): Form<ToggleForm>) -> Res | |||
| 94 | serde_json::Value::Null, | 85 | serde_json::Value::Null, |
| 95 | ) | 86 | ) |
| 96 | .await; | 87 | .await; |
| 97 | - let back = repo_href(&ctx.repo.owner_name, &ctx.repo.name, "settings", ""); | 88 | + Ok(see_other(repo_href(&ctx.repo.owner_name, &ctx.repo.name, "settings", ""))) |
| 98 | - Ok(see_other(format!("{back}?section=discussions"))) | ||
| 99 | } | 89 | } |
crates/forge-web/src/pages/discussion_view.rsmodified+1 -11
| @@ -32,15 +32,6 @@ path_param!(owner); | |||
| 32 | path_param!(repo); | 32 | path_param!(repo); |
| 33 | path_param!(number); | 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 | /// One comment, with every string the template shows already built. | 35 | /// One comment, with every string the template shows already built. |
| 45 | pub(crate) struct CommentView { | 36 | pub(crate) struct CommentView { |
| 46 | lang: Lang, | 37 | lang: Lang, |
| @@ -457,7 +448,7 @@ async fn discussion_page( | |||
| 457 | <button type="submit" class="primary">(g::t(lang, K::Save))</button> | 448 | <button type="submit" class="primary">(g::t(lang, K::Save))</button> |
| 458 | </form> | 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 | </div> | 452 | </div> |
| 462 | } | 453 | } |
| 463 | </article> | 454 | </article> |
| @@ -471,7 +462,6 @@ async fn discussion_page( | |||
| 471 | <div class="field"> | 462 | <div class="field"> |
| 472 | <label for="new-comment">(g::t(lang, K::AddComment))</label> | 463 | <label for="new-comment">(g::t(lang, K::AddComment))</label> |
| 473 | <textarea id="new-comment" name="body" rows="6"></textarea> | 464 | <textarea id="new-comment" name="body" rows="6"></textarea> |
| 474 | - <p class="hint">(g::t(lang, K::MarkdownSupported))</p> | ||
| 475 | </div> | 465 | </div> |
| 476 | <button type="submit" class="primary">(g::t(lang, K::CommentButton))</button> | 466 | <button type="submit" class="primary">(g::t(lang, K::CommentButton))</button> |
| 477 | </form> | 467 | </form> |
crates/forge-web/src/pages/discussions.rsmodified+0 -1
| @@ -404,7 +404,6 @@ async fn new_discussion_body( | |||
| 404 | <div class="field"> | 404 | <div class="field"> |
| 405 | <label for="discussion-body">(g::t(lang, K::Description))</label> | 405 | <label for="discussion-body">(g::t(lang, K::Description))</label> |
| 406 | <textarea id="discussion-body" name="body" rows="12">(draft.body.as_str())</textarea> | 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 | </div> | 407 | </div> |
| 409 | <div class="acts"> | 408 | <div class="acts"> |
| 410 | <button type="submit" class="primary">(g::t(lang, K::StartDiscussion))</button> | 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 | if let Some(text) = title_text { | 281 | if let Some(text) = title_text { |
| 282 | <p class="mono">(text.as_str())</p> | 282 | <p class="mono">(text.as_str())</p> |
| 283 | } | 283 | } |
| 284 | - if body_unchanged { | 284 | + if !body_unchanged { |
| 285 | - <p class="hint">(g::t(lang, K::NoTextChange))</p> | ||
| 286 | - } else { | ||
| 287 | <div class="diff-file"> | 285 | <div class="diff-file"> |
| 288 | <div class="diff-file-body"> | 286 | <div class="diff-file-body"> |
| 289 | <table class="diff-table"> | 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 | use crate::i18n::{self, Lang}; | 17 | use crate::i18n::{self, Lang}; |
| 18 | use crate::live::{Topic, stream_changes}; | 18 | use crate::live::{Topic, stream_changes}; |
| 19 | use crate::state::AppState; | 19 | use crate::state::AppState; |
| 20 | -use crate::views::parts::{SubPart, head}; | 20 | +use crate::views::parts::head; |
| 21 | use crate::views::repo_list::{ | 21 | use crate::views::repo_list::{ |
| 22 | PageLink, RepoRow, SortLink, pager, pager_links, repo_rows, sort_chips, | 22 | PageLink, RepoRow, SortLink, pager, pager_links, repo_rows, sort_chips, |
| 23 | }; | 23 | }; |
| @@ -301,7 +301,7 @@ async fn explore_body( | |||
| 301 | g::t(lang, K::NoPublicReposMatch) | 301 | g::t(lang, K::NoPublicReposMatch) |
| 302 | }; | 302 | }; |
| 303 | Ok(view! { | 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 | <nav class="tabs" aria-label=(g::t(lang, K::Explore))> | 305 | <nav class="tabs" aria-label=(g::t(lang, K::Explore))> |
| 306 | for (label, href, count, on) in tabs.into_iter() { | 306 | for (label, href, count, on) in tabs.into_iter() { |
| 307 | <a href=(href) aria-current=(on.then_some("page"))>(label) " " <span class="tab-count">(count.to_string())</span></a> | 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 | let body = get_with_language(&router, "/explore", "tr").await; | 375 | let body = get_with_language(&router, "/explore", "tr").await; |
| 376 | assert!(body.contains("Keşfet"), "heading in Turkish: {body}"); | 376 | assert!(body.contains("Keşfet"), "heading in Turkish: {body}"); |
| 377 | - assert!(body.contains("Bu forge üzerindeki herkese açık depolar.")); | ||
| 378 | assert!(body.contains("Herkese açık depolarda ara")); | 377 | assert!(body.contains("Herkese açık depolarda ara")); |
| 379 | assert!(!body.contains("Public repositories on this forge.")); | 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 | use crate::pages::register::check_new_password; | 22 | use crate::pages::register::check_new_password; |
| 23 | use crate::state::AppState; | 23 | use crate::state::AppState; |
| 24 | use crate::throttle; | 24 | use crate::throttle; |
| 25 | -use crate::views::parts::{SubPart, head}; | 25 | +use crate::views::parts::head; |
| 26 | use crate::views::{alert, shell}; | 26 | use crate::views::{alert, shell}; |
| 27 | 27 | ||
| 28 | /// Reset requests allowed per client IP inside the throttle window. | 28 | /// Reset requests allowed per client IP inside the throttle window. |
| @@ -59,7 +59,7 @@ enum ResetMode { | |||
| 59 | #[component] | 59 | #[component] |
| 60 | async fn forgot_form(lang: Lang, precsrf: &str) -> Result<impl View> { | 60 | async fn forgot_form(lang: Lang, precsrf: &str) -> Result<impl View> { |
| 61 | Ok(view! { | 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 | <div class="sheet fit"> | 63 | <div class="sheet fit"> |
| 64 | <form data-hard="true" method="post" action="/forgot" class="fields"> | 64 | <form data-hard="true" method="post" action="/forgot" class="fields"> |
| 65 | <input type="hidden" name="precsrf" value=(precsrf)> | 65 | <input type="hidden" name="precsrf" value=(precsrf)> |
| @@ -149,13 +149,8 @@ async fn reset_body( | |||
| 149 | mode: ResetMode, | 149 | mode: ResetMode, |
| 150 | error: Option<String>, | 150 | error: Option<String>, |
| 151 | ) -> Result<impl View> { | 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 | Ok(view! { | 152 | Ok(view! { |
| 158 | - head(title: t(lang, Key::ResetTitle), sub: sub) | 153 | + head(title: t(lang, Key::ResetTitle)) |
| 159 | <div class="sheet fit"> | 154 | <div class="sheet fit"> |
| 160 | if mode == ResetMode::Form { | 155 | if mode == ResetMode::Form { |
| 161 | <form data-hard="true" method="post" action=(format!("/reset/{token}")) class="fields"> | 156 | <form data-hard="true" method="post" action=(format!("/reset/{token}")) class="fields"> |
crates/forge-web/src/pages/home.rsmodified+236 -11
| @@ -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 | use topcoat::Result; | 9 | use topcoat::Result; |
| 4 | use topcoat::context::{Cx, app_context}; | 10 | use topcoat::context::{Cx, app_context}; |
| 5 | -use topcoat::router::error::see_other; | ||
| 6 | use topcoat::router::page; | 11 | use topcoat::router::page; |
| 7 | use topcoat::view::{View, component, view}; | 12 | use topcoat::view::{View, component, view}; |
| 8 | 13 | ||
| 9 | use crate::auth::current_user; | 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 | use crate::i18n::orgs::{self as g, K}; | 18 | use crate::i18n::orgs::{self as g, K}; |
| 11 | use crate::i18n::{self, Lang}; | 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 | use crate::pages::repo_settings::{notice_banner_for, take_notice}; | 23 | use crate::pages::repo_settings::{notice_banner_for, take_notice}; |
| 13 | use crate::state::AppState; | 24 | use crate::state::AppState; |
| 14 | -use crate::views::parts::{SubPart, head}; | 25 | +use crate::views::parts::head; |
| 15 | -use crate::views::{enc, shell}; | 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 | #[page("/")] | 55 | #[page("/")] |
| 18 | async fn home(cx: &Cx) -> Result<impl View> { | 56 | async fn home(cx: &Cx) -> Result<impl View> { |
| 19 | let state = app_context::<AppState>(cx); | 57 | let state = app_context::<AppState>(cx); |
| 20 | - if let Some((user, _)) = current_user(cx).await? { | 58 | + let viewer = current_user(cx).await?; |
| 21 | - return Err(see_other(format!("/{}", enc(&user.username))).into()); | 59 | + let lang = i18n::lang(cx, viewer.as_ref().map(|(user, _)| user)); |
| 22 | - } | ||
| 23 | - let lang = i18n::lang(cx, None); | ||
| 24 | - let has_users = state.store.user_count().await? > 0; | ||
| 25 | let notice = take_notice(cx); | 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 | Ok(view! { | 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 | notice_banner_for(lang: lang, title: notice) | 71 | notice_banner_for(lang: lang, title: notice) |
| 72 | + if let Some(signed) = signed { | ||
| 73 | + signed_home(lang: lang, data: signed, may_org: may_org) | ||
| 74 | + } else { | ||
| 29 | landing(has_users: has_users, lang: lang) | 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 | #[component] | 259 | #[component] |
| 35 | async fn landing(has_users: bool, lang: Lang) -> Result<impl View> { | 260 | async fn landing(has_users: bool, lang: Lang) -> Result<impl View> { |
| 36 | Ok(view! { | 261 | Ok(view! { |
| 37 | - head(title: "forge", sub: vec![SubPart::text(g::t(lang, K::LandingTagline))], | 262 | + head(title: "forge", |
| 38 | <a class="button primary" href="/login">(g::t(lang, K::LogIn))</a> | 263 | <a class="button primary" href="/login">(g::t(lang, K::LogIn))</a> |
| 39 | if !has_users { | 264 | if !has_users { |
| 40 | <a class="button" href="/setup">(g::t(lang, K::SetUpForge))</a> | 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 | <label><input type="radio" name="visibility" value="private" checked=(private)><span>(crate::i18n::community::t(lang, crate::i18n::community::K::VisibilityPrivate))</span></label> | 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 | <label><input type="radio" name="visibility" value="public" checked=(!private)><span>(crate::i18n::community::t(lang, crate::i18n::community::K::VisibilityPublic))</span></label> | 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 | </div> | 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 | </div> | 210 | </div> |
| 212 | }) | 211 | }) |
| 213 | } | 212 | } |
| @@ -223,7 +222,6 @@ async fn option_boxes(lang: Lang, opts: ImportOptions) -> Result<impl View> { | |||
| 223 | <label class="switch"><input type="checkbox" name="opt_pulls" value="on" checked=(opts.pulls)><span>(g::t(lang, K::OptPulls))</span></label> | 222 | <label class="switch"><input type="checkbox" name="opt_pulls" value="on" checked=(opts.pulls)><span>(g::t(lang, K::OptPulls))</span></label> |
| 224 | <label class="switch"><input type="checkbox" name="opt_releases" value="on" checked=(opts.releases)><span>(g::t(lang, K::OptReleases))</span></label> | 223 | <label class="switch"><input type="checkbox" name="opt_releases" value="on" checked=(opts.releases)><span>(g::t(lang, K::OptReleases))</span></label> |
| 225 | </div> | 224 | </div> |
| 226 | - <p class="hint">(g::t(lang, K::OptionsNote))</p> | ||
| 227 | </div> | 225 | </div> |
| 228 | }) | 226 | }) |
| 229 | } | 227 | } |
| @@ -325,7 +323,7 @@ async fn import_form( | |||
| 325 | let private = draft.private; | 323 | let private = draft.private; |
| 326 | let opts = draft.opts; | 324 | let opts = draft.opts; |
| 327 | Ok(view! { | 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 | crate::pages::profile::own_profile_tabs(lang: lang, username: username, current: "repositories".to_owned()) | 327 | crate::pages::profile::own_profile_tabs(lang: lang, username: username, current: "repositories".to_owned()) |
| 330 | newrepo_tabs(lang: lang, active: "import") | 328 | newrepo_tabs(lang: lang, active: "import") |
| 331 | <div class="sheet fit"> | 329 | <div class="sheet fit"> |
| @@ -355,7 +353,6 @@ async fn import_form( | |||
| 355 | <div class="field"> | 353 | <div class="field"> |
| 356 | <label for="import-token">(token_label)</label> | 354 | <label for="import-token">(token_label)</label> |
| 357 | <input id="import-token" type="password" name="token" autocomplete="new-password" maxlength="1024"> | 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 | </div> | 356 | </div> |
| 360 | if !is_git { | 357 | if !is_git { |
| 361 | option_boxes(lang: lang, opts: opts) | 358 | option_boxes(lang: lang, opts: opts) |
| @@ -371,7 +368,6 @@ async fn import_form( | |||
| 371 | <div class="field"> | 368 | <div class="field"> |
| 372 | <label for="import-name">(g::t(lang, K::TargetName))</label> | 369 | <label for="import-name">(g::t(lang, K::TargetName))</label> |
| 373 | <input id="import-name" type="text" name="name" value=(draft.name.as_str()) maxlength="64" autocomplete="off"> | 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 | </div> | 371 | </div> |
| 376 | <div class="field"> | 372 | <div class="field"> |
| 377 | <label for="import-description">(g::t(lang, K::Description))</label> | 373 | <label for="import-description">(g::t(lang, K::Description))</label> |
| @@ -383,7 +379,6 @@ async fn import_form( | |||
| 383 | if !is_git { | 379 | if !is_git { |
| 384 | <section class="sec"> | 380 | <section class="sec"> |
| 385 | <h2>(g::t(lang, K::BulkLink))</h2> | 381 | <h2>(g::t(lang, K::BulkLink))</h2> |
| 386 | - <p class="hint">(g::t(lang, K::BulkIntro))</p> | ||
| 387 | <div class="acts"> | 382 | <div class="acts"> |
| 388 | <a class="act" href=(bulk_href.as_str())>(g::t(lang, K::BulkLinkButton))</a> | 383 | <a class="act" href=(bulk_href.as_str())>(g::t(lang, K::BulkLinkButton))</a> |
| 389 | </div> | 384 | </div> |
| @@ -613,7 +608,7 @@ async fn bulk_form( | |||
| 613 | // A Forgejo token can list its own repositories, so the owner may stay empty. | 608 | // A Forgejo token can list its own repositories, so the owner may stay empty. |
| 614 | let owner_required = source != Source::Forgejo; | 609 | let owner_required = source != Source::Forgejo; |
| 615 | Ok(view! { | 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 | crate::pages::profile::own_profile_tabs(lang: lang, username: username, current: "repositories".to_owned()) | 612 | crate::pages::profile::own_profile_tabs(lang: lang, username: username, current: "repositories".to_owned()) |
| 618 | newrepo_tabs(lang: lang, active: "import") | 613 | newrepo_tabs(lang: lang, active: "import") |
| 619 | <div class="sheet fit"> | 614 | <div class="sheet fit"> |
| @@ -638,7 +633,6 @@ async fn bulk_form( | |||
| 638 | <div class="field"> | 633 | <div class="field"> |
| 639 | <label for="bulk-token">(g::t(lang, K::TokenOptional))</label> | 634 | <label for="bulk-token">(g::t(lang, K::TokenOptional))</label> |
| 640 | <input id="bulk-token" type="password" name="token" autocomplete="new-password" maxlength="1024"> | 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 | </div> | 636 | </div> |
| 643 | <input type="hidden" name="owner" value=(owners.first().map(String::as_str).unwrap_or(""))> | 637 | <input type="hidden" name="owner" value=(owners.first().map(String::as_str).unwrap_or(""))> |
| 644 | <button type="submit" class="primary">(g::t(lang, K::BulkListButton))</button> | 638 | <button type="submit" class="primary">(g::t(lang, K::BulkListButton))</button> |
| @@ -696,7 +690,6 @@ async fn bulk_select( | |||
| 696 | <option value=(name.as_str()) selected=(*name == selected_owner)>(name.as_str())</option> | 690 | <option value=(name.as_str()) selected=(*name == selected_owner)>(name.as_str())</option> |
| 697 | } | 691 | } |
| 698 | </select> | 692 | </select> |
| 699 | - <p class="hint">(g::t(lang, K::BulkOwnerHelp))</p> | ||
| 700 | </div> | 693 | </div> |
| 701 | visibility_pick(lang: lang, private: private) | 694 | visibility_pick(lang: lang, private: private) |
| 702 | if form.source != "git" { | 695 | if form.source != "git" { |
| @@ -1240,7 +1233,6 @@ async fn job_view( | |||
| 1240 | <div class="field"> | 1233 | <div class="field"> |
| 1241 | <label for="retry-token">(g::t(lang, K::TokenOptional))</label> | 1234 | <label for="retry-token">(g::t(lang, K::TokenOptional))</label> |
| 1242 | <input id="retry-token" type="password" name="token" autocomplete="new-password" maxlength="1024"> | 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 | </div> | 1236 | </div> |
| 1245 | <button type="submit" class="primary">(g::t(lang, K::JobRetry))</button> | 1237 | <button type="submit" class="primary">(g::t(lang, K::JobRetry))</button> |
| 1246 | </form> | 1238 | </form> |
| @@ -1438,7 +1430,6 @@ async fn retry_list(lang: Lang, username: String, csrf: &str, rows: Vec<(ImportJ | |||
| 1438 | <div class="field"> | 1430 | <div class="field"> |
| 1439 | <label for="retry-token">(g::t(lang, K::TokenOptional))</label> | 1431 | <label for="retry-token">(g::t(lang, K::TokenOptional))</label> |
| 1440 | <input id="retry-token" type="password" name="token" autocomplete="new-password" maxlength="1024"> | 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 | </div> | 1433 | </div> |
| 1443 | <label class="line" data-kb-row=""> | 1434 | <label class="line" data-kb-row=""> |
| 1444 | <input type="checkbox" data-select-all=".import-pick-list"> | 1435 | <input type="checkbox" data-select-all=".import-pick-list"> |
crates/forge-web/src/pages/invites.rsmodified+8 -4
| @@ -1,5 +1,6 @@ | |||
| 1 | //! Page: admin invites (`/admin/invites`). An admin mails an invite link to one address. The link | 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 | use forge_core::store::validate_email; | 5 | use forge_core::store::validate_email; |
| 5 | use forge_core::{AuditAction, Registration}; | 6 | use forge_core::{AuditAction, Registration}; |
| @@ -15,9 +16,9 @@ use crate::audit::{self, Actor, Target}; | |||
| 15 | use crate::auth::check_csrf; | 16 | use crate::auth::check_csrf; |
| 16 | use crate::i18n::{self, Key, Lang, t}; | 17 | use crate::i18n::{self, Key, Lang, t}; |
| 17 | use crate::mail::account; | 18 | use crate::mail::account; |
| 18 | -use crate::pages::admin_users::admin_only; | 19 | +use crate::pages::admin_users::{admin_only, users_rail}; |
| 19 | use crate::state::AppState; | 20 | use crate::state::AppState; |
| 20 | -use crate::views::parts::{SubPart, head}; | 21 | +use crate::views::parts::head; |
| 21 | use crate::views::{alert, shell, user_facing_message}; | 22 | use crate::views::{alert, shell, user_facing_message}; |
| 22 | 23 | ||
| 23 | #[derive(Deserialize)] | 24 | #[derive(Deserialize)] |
| @@ -36,7 +37,9 @@ async fn invite_body( | |||
| 36 | error: Option<String>, | 37 | error: Option<String>, |
| 37 | ) -> Result<impl View> { | 38 | ) -> Result<impl View> { |
| 38 | Ok(view! { | 39 | Ok(view! { |
| 39 | - head(title: t(lang, Key::InvitesTitle), sub: vec![SubPart::text(t(lang, Key::InvitesSub))]) | 40 | + head(title: t(lang, Key::InvitesTitle)) |
| 41 | + <div class="work"> | ||
| 42 | + users_rail(lang: lang, current: "invites") | ||
| 40 | <div class="sheet"> | 43 | <div class="sheet"> |
| 41 | <section class="sec"> | 44 | <section class="sec"> |
| 42 | if let Some(message) = error { | 45 | if let Some(message) = error { |
| @@ -52,6 +55,7 @@ async fn invite_body( | |||
| 52 | </form> | 55 | </form> |
| 53 | </section> | 56 | </section> |
| 54 | </div> | 57 | </div> |
| 58 | + </div> | ||
| 55 | if let Some(message) = notice { | 59 | if let Some(message) = notice { |
| 56 | <p class="state" role="status">(message)</p> | 60 | <p class="state" role="status">(message)</p> |
| 57 | } | 61 | } |
crates/forge-web/src/pages/issue_parts.rsmodified+269 -79
| @@ -19,7 +19,7 @@ use crate::i18n::Lang; | |||
| 19 | use crate::i18n::issues::{self as g, K}; | 19 | use crate::i18n::issues::{self as g, K}; |
| 20 | use crate::notify::{self, Activity}; | 20 | use crate::notify::{self, Activity}; |
| 21 | use crate::pages::edit_history::{edit_counts, history_href, thread_edit_counts}; | 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 | use crate::pages::pull_reviews::suggest_states; | 23 | use crate::pages::pull_reviews::suggest_states; |
| 24 | use crate::pages::repo_ctx::RepoCtx; | 24 | use crate::pages::repo_ctx::RepoCtx; |
| 25 | use crate::pages::tree::link_context; | 25 | use crate::pages::tree::link_context; |
| @@ -31,7 +31,7 @@ use crate::views::{ | |||
| 31 | alert, avatar_url, avatar_url_unknown, display_name, iso_time, now_unix, relative_time, repo_href, short_oid, | 31 | alert, avatar_url, avatar_url_unknown, display_name, iso_time, now_unix, relative_time, repo_href, short_oid, |
| 32 | user_href, user_link, | 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 | use crate::webhooks::emit::{Sender, emit_comment, emit_item_action}; | 35 | use crate::webhooks::emit::{Sender, emit_comment, emit_item_action}; |
| 36 | 36 | ||
| 37 | /// Which kind of item a page shows. It decides the URL segment of the item's own links and which | 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 | /// One timeline event as a line: the actor, `before`, an optional commit link, then `after`. | 291 | /// One timeline event as a line: the actor, `before`, an optional commit link, then `after`. |
| 292 | pub(crate) struct EventLine { | 292 | pub(crate) struct EventLine { |
| 293 | actor: String, | 293 | actor: String, |
| 294 | + actor_id: String, | ||
| 294 | when: When, | 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 | before: String, | 300 | before: String, |
| 296 | link_href: Option<String>, | 301 | link_href: Option<String>, |
| 297 | link_label: String, | 302 | link_label: String, |
| 298 | after: String, | 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 | /// A submitted review of a pull request: its verb, its body (when it has one) and the threads it | 309 | /// A submitted review of a pull request: its verb, its body (when it has one) and the threads it |
| 302 | /// opened, which render under it with their diff hunks. | 310 | /// opened, which render under it with their diff hunks. |
| 303 | pub(crate) struct ReviewView { | 311 | pub(crate) struct ReviewView { |
| @@ -317,6 +325,8 @@ pub(crate) struct ReviewView { | |||
| 317 | pub(crate) enum Entry { | 325 | pub(crate) enum Entry { |
| 318 | Comment(CommentView), | 326 | Comment(CommentView), |
| 319 | Event(EventLine), | 327 | Event(EventLine), |
| 328 | + /// Consecutive events by one actor within a few minutes, one line. | ||
| 329 | + Run(Vec<EventLine>), | ||
| 320 | Review(ReviewView), | 330 | Review(ReviewView), |
| 321 | } | 331 | } |
| 322 | 332 | ||
| @@ -410,7 +420,11 @@ fn event_line( | |||
| 410 | }; | 420 | }; |
| 411 | EventLine { | 421 | EventLine { |
| 412 | actor, | 422 | actor, |
| 423 | + actor_id: event.actor_id.clone().unwrap_or_default(), | ||
| 413 | when, | 424 | when, |
| 425 | + at: stamp_unix(&event.created_at), | ||
| 426 | + kind: event.kind.clone(), | ||
| 427 | + label: text("label"), | ||
| 414 | before, | 428 | before, |
| 415 | link_href, | 429 | link_href, |
| 416 | link_label, | 430 | link_label, |
| @@ -435,7 +449,13 @@ pub(crate) async fn comment_item(lang: Lang, item: CommentView) -> Result<impl V | |||
| 435 | reactions, | 449 | reactions, |
| 436 | } = item; | 450 | } = item; |
| 437 | let profile = user_href(&login); | 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 | Ok(view! { | 459 | Ok(view! { |
| 440 | <article class="sec thread-entry" id=(anchor.as_str())> | 460 | <article class="sec thread-entry" id=(anchor.as_str())> |
| 441 | <header class="thread-head"> | 461 | <header class="thread-head"> |
| @@ -451,11 +471,19 @@ pub(crate) async fn comment_item(lang: Lang, item: CommentView) -> Result<impl V | |||
| 451 | } else { | 471 | } else { |
| 452 | <div class="issue-item-body markdown-body">(Unescaped::new_unchecked(html))</div> | 472 | <div class="issue-item-body markdown-body">(Unescaped::new_unchecked(html))</div> |
| 453 | } | 473 | } |
| 454 | - if let Some(bar) = reactions { | 474 | + if !chips.is_empty() { |
| 455 | - reaction_row(lang: lang, bar: bar) | 475 | + <div class="reactions"> |
| 476 | + for chip in chips.into_iter() { | ||
| 477 | + reaction_button(button: chip) | ||
| 456 | } | 478 | } |
| 457 | - if has_acts { | 479 | + </div> |
| 480 | + } | ||
| 481 | + if has_tools { | ||
| 482 | + <div> | ||
| 458 | <div class="acts"> | 483 | <div class="acts"> |
| 484 | + if has_react { | ||
| 485 | + reaction_picker(lang: lang, picker: picker) | ||
| 486 | + } | ||
| 459 | if let Some(href) = edit_href { | 487 | if let Some(href) = edit_href { |
| 460 | <a class="act" href=(href.as_str())>(g::t(lang, K::Edit))</a> | 488 | <a class="act" href=(href.as_str())>(g::t(lang, K::Edit))</a> |
| 461 | } | 489 | } |
| @@ -463,6 +491,7 @@ pub(crate) async fn comment_item(lang: Lang, item: CommentView) -> Result<impl V | |||
| 463 | confirm_act(lang: lang, label: g::t(lang, K::Delete), action: action.as_str(), csrf: csrf.as_str()) | 491 | confirm_act(lang: lang, label: g::t(lang, K::Delete), action: action.as_str(), csrf: csrf.as_str()) |
| 464 | } | 492 | } |
| 465 | </div> | 493 | </div> |
| 494 | + </div> | ||
| 466 | } | 495 | } |
| 467 | </article> | 496 | </article> |
| 468 | }) | 497 | }) |
| @@ -482,16 +511,24 @@ pub(crate) async fn reaction_row(lang: Lang, bar: ReactionBar) -> Result<impl Vi | |||
| 482 | reaction_button(button: chip) | 511 | reaction_button(button: chip) |
| 483 | } | 512 | } |
| 484 | if enabled { | 513 | if enabled { |
| 514 | + reaction_picker(lang: lang, picker: picker) | ||
| 515 | + } | ||
| 516 | + </div> | ||
| 517 | + }) | ||
| 518 | +} | ||
| 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! { | ||
| 485 | <details class="reaction-picker"> | 524 | <details class="reaction-picker"> |
| 486 | - <summary>(g::t(lang, K::AddReaction))</summary> | 525 | + <summary class="act">(g::t(lang, K::AddReaction))</summary> |
| 487 | <div class="reaction-options"> | 526 | <div class="reaction-options"> |
| 488 | for option in picker.into_iter() { | 527 | for option in picker.into_iter() { |
| 489 | reaction_button(button: option) | 528 | reaction_button(button: option) |
| 490 | } | 529 | } |
| 491 | </div> | 530 | </div> |
| 492 | </details> | 531 | </details> |
| 493 | - } | ||
| 494 | - </div> | ||
| 495 | }) | 532 | }) |
| 496 | } | 533 | } |
| 497 | 534 | ||
| @@ -552,6 +589,7 @@ pub(crate) async fn event_item(line: EventLine) -> Result<impl View> { | |||
| 552 | link_href, | 589 | link_href, |
| 553 | link_label, | 590 | link_label, |
| 554 | after, | 591 | after, |
| 592 | + .. | ||
| 555 | } = line; | 593 | } = line; |
| 556 | Ok(view! { | 594 | Ok(view! { |
| 557 | <div class="thread-event"> | 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 | /// The verb of a dismissed review: the verb it had before dismissal, marked as dismissed. Reviews | 654 | /// The verb of a dismissed review: the verb it had before dismissal, marked as dismissed. Reviews |
| 580 | /// dismissed before the previous state was recorded keep the generic verb. | 655 | /// dismissed before the previous state was recorded keep the generic verb. |
| 581 | fn dismissed_verb(lang: Lang, from: Option<ReviewState>) -> &'static str { | 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 | match entry { | 710 | match entry { |
| 636 | Entry::Comment(item) => comment_item(lang: lang, item: item), | 711 | Entry::Comment(item) => comment_item(lang: lang, item: item), |
| 637 | Entry::Event(line) => event_item(line: line), | 712 | Entry::Event(line) => event_item(line: line), |
| 713 | + Entry::Run(lines) => event_run(lines: lines), | ||
| 638 | Entry::Review(review) => review_item(lang: lang, review: review), | 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 | keyed.extend(review_entries(lang, state, ctx, item, &link, &tz, now).await?); | 900 | keyed.extend(review_entries(lang, state, ctx, item, &link, &tz, now).await?); |
| 825 | } | 901 | } |
| 826 | keyed.sort_by(|a, b| a.0.cmp(&b.0)); | 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 | Ok(Discussion { | 905 | Ok(Discussion { |
| 830 | author: display_name(lang, &author), | 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 | /// The reaction bar of one target, or `None` when there is nothing to show (no reactions and no | 982 | /// The reaction bar of one target, or `None` when there is nothing to show (no reactions and no |
| 839 | /// way to react). Every reaction in the set gets a picker button. | 983 | /// way to react). Every reaction in the set gets a picker button. |
| 840 | pub(crate) fn reaction_bar_for( | 984 | pub(crate) fn reaction_bar_for( |
| @@ -1082,26 +1226,28 @@ pub(crate) async fn labels_box( | |||
| 1082 | labels: Vec<LabelRow>, | 1226 | labels: Vec<LabelRow>, |
| 1083 | ) -> Result<impl View> { | 1227 | ) -> Result<impl View> { |
| 1084 | let any_attached = labels.iter().any(|row| row.attached); | 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 | Ok(view! { | 1234 | Ok(view! { |
| 1086 | <section class="sec meta"> | 1235 | <section class="sec meta"> |
| 1087 | <h2>(g::t(lang, K::Labels))</h2> | 1236 | <h2>(g::t(lang, K::Labels))</h2> |
| 1088 | - <p class="hint"> | 1237 | + <div class="line"> |
| 1089 | - if !any_attached { | 1238 | + <span class="val"> |
| 1090 | - (g::t(lang, K::NoneYet)) | ||
| 1091 | - } | ||
| 1092 | for row in labels.iter() { | 1239 | for row in labels.iter() { |
| 1093 | if row.attached { | 1240 | if row.attached { |
| 1094 | <span class=(row.chip.as_str())>(row.name.as_str())</span> | 1241 | <span class=(row.chip.as_str())>(row.name.as_str())</span> |
| 1095 | } | 1242 | } |
| 1096 | } | 1243 | } |
| 1097 | - </p> | 1244 | + </span> |
| 1098 | if write { | 1245 | if write { |
| 1099 | - <div class="acts"> | 1246 | + reveal(label: tool, |
| 1100 | - reveal(label: g::t(lang, K::Edit), | ||
| 1101 | <form method="post" action=(action.as_str()) class="fields" data-apply="true"> | 1247 | <form method="post" action=(action.as_str()) class="fields" data-apply="true"> |
| 1102 | <input type="hidden" name="csrf" value=(csrf.as_str())> | 1248 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 1103 | if labels.is_empty() { | 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 | for row in labels.iter() { | 1252 | for row in labels.iter() { |
| 1107 | <label class="switch"> | 1253 | <label class="switch"> |
| @@ -1112,8 +1258,8 @@ pub(crate) async fn labels_box( | |||
| 1112 | <noscript><div><button type="submit" class="primary">(g::t(lang, K::SaveLabels))</button></div></noscript> | 1258 | <noscript><div><button type="submit" class="primary">(g::t(lang, K::SaveLabels))</button></div></noscript> |
| 1113 | </form> | 1259 | </form> |
| 1114 | ) | 1260 | ) |
| 1115 | - </div> | ||
| 1116 | } | 1261 | } |
| 1262 | + </div> | ||
| 1117 | </section> | 1263 | </section> |
| 1118 | }) | 1264 | }) |
| 1119 | } | 1265 | } |
| @@ -1128,19 +1274,20 @@ pub(crate) async fn assignees_box( | |||
| 1128 | assign_next: Option<String>, | 1274 | assign_next: Option<String>, |
| 1129 | ) -> Result<impl View> { | 1275 | ) -> Result<impl View> { |
| 1130 | let text = names.join(", "); | 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 | Ok(view! { | 1282 | Ok(view! { |
| 1132 | <section class="sec meta"> | 1283 | <section class="sec meta"> |
| 1133 | <h2>(g::t(lang, K::Assignees))</h2> | 1284 | <h2>(g::t(lang, K::Assignees))</h2> |
| 1134 | - <p class="hint"> | 1285 | + <div class="line"> |
| 1135 | - if names.is_empty() { | 1286 | + if !names.is_empty() { |
| 1136 | - (g::t(lang, K::NoOneAssigned)) | 1287 | + <span class="val">(text.as_str())</span> |
| 1137 | - } else { | ||
| 1138 | - (text.as_str()) | ||
| 1139 | } | 1288 | } |
| 1140 | - </p> | ||
| 1141 | if write { | 1289 | if write { |
| 1142 | - <div class="acts"> | 1290 | + reveal(label: tool, |
| 1143 | - reveal(label: g::t(lang, K::Edit), | ||
| 1144 | if let Some(next) = assign_next { | 1291 | if let Some(next) = assign_next { |
| 1145 | <form method="post" action=(action.as_str()) class="act-form"> | 1292 | <form method="post" action=(action.as_str()) class="act-form"> |
| 1146 | <input type="hidden" name="csrf" value=(csrf.as_str())> | 1293 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| @@ -1152,14 +1299,13 @@ pub(crate) async fn assignees_box( | |||
| 1152 | <input type="hidden" name="csrf" value=(csrf.as_str())> | 1299 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 1153 | <div class="field"> | 1300 | <div class="field"> |
| 1154 | <label for="issue-assignees">(g::t(lang, K::Assignees))</label> | 1301 | <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"))> | 1302 | + <input id="issue-assignees" type="text" name="assignees" value=(text.as_str()) autocomplete="off" spellcheck="false"> |
| 1156 | - <p class="hint">(g::t(lang, K::CommaUsernames))</p> | ||
| 1157 | </div> | 1303 | </div> |
| 1158 | <noscript><div><button type="submit" class="primary">(g::t(lang, K::SaveAssignees))</button></div></noscript> | 1304 | <noscript><div><button type="submit" class="primary">(g::t(lang, K::SaveAssignees))</button></div></noscript> |
| 1159 | </form> | 1305 | </form> |
| 1160 | ) | 1306 | ) |
| 1161 | - </div> | ||
| 1162 | } | 1307 | } |
| 1308 | + </div> | ||
| 1163 | </section> | 1309 | </section> |
| 1164 | }) | 1310 | }) |
| 1165 | } | 1311 | } |
| @@ -1174,19 +1320,20 @@ pub(crate) async fn milestone_box( | |||
| 1174 | current: String, | 1320 | current: String, |
| 1175 | none_selected: bool, | 1321 | none_selected: bool, |
| 1176 | ) -> Result<impl View> { | 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 | Ok(view! { | 1328 | Ok(view! { |
| 1178 | <section class="sec meta"> | 1329 | <section class="sec meta"> |
| 1179 | <h2>(g::t(lang, K::MilestoneBox))</h2> | 1330 | <h2>(g::t(lang, K::MilestoneBox))</h2> |
| 1180 | - <p class="hint"> | 1331 | + <div class="line"> |
| 1181 | - if current.is_empty() { | 1332 | + if !current.is_empty() { |
| 1182 | - (g::t(lang, K::NoMilestone)) | 1333 | + <span class="val">(current.as_str())</span> |
| 1183 | - } else { | ||
| 1184 | - (current.as_str()) | ||
| 1185 | } | 1334 | } |
| 1186 | - </p> | ||
| 1187 | if write { | 1335 | if write { |
| 1188 | - <div class="acts"> | 1336 | + reveal(label: tool, |
| 1189 | - reveal(label: g::t(lang, K::Edit), | ||
| 1190 | <form method="post" action=(action.as_str()) class="fields" data-apply="true"> | 1337 | <form method="post" action=(action.as_str()) class="fields" data-apply="true"> |
| 1191 | <input type="hidden" name="csrf" value=(csrf.as_str())> | 1338 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 1192 | <div class="field"> | 1339 | <div class="field"> |
| @@ -1201,14 +1348,14 @@ pub(crate) async fn milestone_box( | |||
| 1201 | <noscript><div><button type="submit" class="primary">(g::t(lang, K::SaveMilestone))</button></div></noscript> | 1348 | <noscript><div><button type="submit" class="primary">(g::t(lang, K::SaveMilestone))</button></div></noscript> |
| 1202 | </form> | 1349 | </form> |
| 1203 | ) | 1350 | ) |
| 1204 | - </div> | ||
| 1205 | } | 1351 | } |
| 1352 | + </div> | ||
| 1206 | </section> | 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. | 1357 | +/// The conversation row, shown only when the conversation is locked, with its unlock word for |
| 1211 | -/// Everyone else sees the lock state only when there is one. | 1358 | +/// triage holders. Locking is one of the tools at the foot of the sidebar (`item_tools`). |
| 1212 | #[component] | 1359 | #[component] |
| 1213 | pub(crate) async fn lock_box( | 1360 | pub(crate) async fn lock_box( |
| 1214 | lang: Lang, | 1361 | lang: Lang, |
| @@ -1225,27 +1372,47 @@ pub(crate) async fn lock_box( | |||
| 1225 | .to_owned(); | 1372 | .to_owned(); |
| 1226 | let none = reason.is_none(); | 1373 | let none = reason.is_none(); |
| 1227 | Ok(view! { | 1374 | Ok(view! { |
| 1375 | + if locked { | ||
| 1228 | <section class="sec meta"> | 1376 | <section class="sec meta"> |
| 1229 | <h2>(g::t(lang, K::ConversationBox))</h2> | 1377 | <h2>(g::t(lang, K::ConversationBox))</h2> |
| 1230 | - <p class="hint"> | 1378 | + <div class="line"> |
| 1231 | - if locked { | 1379 | + <span class="val"> |
| 1232 | (g::t(lang, K::LockedToCollaborators)) | 1380 | (g::t(lang, K::LockedToCollaborators)) |
| 1233 | if !none { | 1381 | if !none { |
| 1234 | " (" (reason_text.as_str()) ")" | 1382 | " (" (reason_text.as_str()) ")" |
| 1235 | } | 1383 | } |
| 1236 | - } else { | 1384 | + </span> |
| 1237 | - (g::t(lang, K::OpenToEveryone)) | ||
| 1238 | - } | ||
| 1239 | - </p> | ||
| 1240 | if write { | 1385 | if write { |
| 1241 | - <div class="acts"> | 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())]) |
| 1242 | - reveal(label: g::t(lang, K::Edit), | 1387 | + } |
| 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, | ||
| 1243 | <form method="post" action=(action.as_str()) class="fields"> | 1414 | <form method="post" action=(action.as_str()) class="fields"> |
| 1244 | <input type="hidden" name="csrf" value=(csrf.as_str())> | 1415 | <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 { | ||
| 1249 | <div class="field"> | 1416 | <div class="field"> |
| 1250 | <label for="issue-lock-reason">(g::t(lang, K::Reason))</label> | 1417 | <label for="issue-lock-reason">(g::t(lang, K::Reason))</label> |
| 1251 | <select id="issue-lock-reason" name="reason"> | 1418 | <select id="issue-lock-reason" name="reason"> |
| @@ -1258,17 +1425,18 @@ pub(crate) async fn lock_box( | |||
| 1258 | </div> | 1425 | </div> |
| 1259 | <input type="hidden" name="locked" value="1"> | 1426 | <input type="hidden" name="locked" value="1"> |
| 1260 | <button type="submit" class="primary">(g::t(lang, K::LockConversation))</button> | 1427 | <button type="submit" class="primary">(g::t(lang, K::LockConversation))</button> |
| 1261 | - } | ||
| 1262 | </form> | 1428 | </form> |
| 1263 | ) | 1429 | ) |
| 1264 | - </div> | ||
| 1265 | } | 1430 | } |
| 1431 | + </div> | ||
| 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` | 1437 | +/// The sidebar facts. `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. | 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 | #[component] | 1440 | #[component] |
| 1273 | pub(crate) async fn item_sidebar( | 1441 | pub(crate) async fn item_sidebar( |
| 1274 | lang: Lang, | 1442 | lang: Lang, |
| @@ -1277,7 +1445,7 @@ pub(crate) async fn item_sidebar( | |||
| 1277 | csrf: String, | 1445 | csrf: String, |
| 1278 | viewer: Option<String>, | 1446 | viewer: Option<String>, |
| 1279 | sidebar: Sidebar, | 1447 | sidebar: Sidebar, |
| 1280 | - notify: Option<NotifyBox>, | 1448 | + pin: Option<(bool, String)>, |
| 1281 | ) -> Result<impl View> { | 1449 | ) -> Result<impl View> { |
| 1282 | let Sidebar { | 1450 | let Sidebar { |
| 1283 | labels, | 1451 | labels, |
| @@ -1301,56 +1469,78 @@ pub(crate) async fn item_sidebar( | |||
| 1301 | let assignees_action = format!("{base}/assignees"); | 1469 | let assignees_action = format!("{base}/assignees"); |
| 1302 | let milestone_action = format!("{base}/milestone"); | 1470 | let milestone_action = format!("{base}/milestone"); |
| 1303 | let lock_action = format!("{base}/lock"); | 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 | Ok(view! { | 1474 | Ok(view! { |
| 1305 | labels_box(lang: lang, write: write, action: labels_action, csrf: csrf.clone(), labels: labels) | 1475 | labels_box(lang: lang, write: write, action: labels_action, csrf: csrf.clone(), labels: labels) |
| 1306 | assignees_box(lang: lang, write: write, action: assignees_action, csrf: csrf.clone(), names: assignees, assign_next: assign_next) | 1476 | assignees_box(lang: lang, write: write, action: assignees_action, csrf: csrf.clone(), names: assignees, assign_next: assign_next) |
| 1307 | milestone_box(lang: lang, write: write, action: milestone_action, csrf: csrf.clone(), | 1477 | milestone_box(lang: lang, write: write, action: milestone_action, csrf: csrf.clone(), |
| 1308 | options: milestones, current: current_milestone, none_selected: none_selected) | 1478 | options: milestones, current: current_milestone, none_selected: none_selected) |
| 1309 | lock_box(lang: lang, write: write, action: lock_action, csrf: csrf.clone(), locked: locked, reason: lock_reason) | 1479 | lock_box(lang: lang, write: write, action: lock_action, csrf: csrf.clone(), locked: locked, reason: lock_reason) |
| 1310 | - if let Some(notify) = notify { | 1480 | + item_tools(lang: lang, pin: pin_tool, lock: lock_tool, csrf: csrf.clone()) |
| 1311 | - notify_box(lang: lang, action: notify.action, csrf: notify.csrf, subscribed: notify.subscribed, reason: notify.reason) | ||
| 1312 | - } | ||
| 1313 | }) | 1481 | }) |
| 1314 | } | 1482 | } |
| 1315 | 1483 | ||
| 1316 | // Comment form | 1484 | // Comment form |
| 1317 | 1485 | ||
| 1318 | -/// The comment box with its close, reopen and comment buttons. The comment is posted to | 1486 | +/// The id of the comment form. The head's Close and Reopen buttons post it with `form=`, so a |
| 1319 | -/// `action`; the close and reopen buttons post to `state_action` (the same URL for issues). | 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 | #[component] | 1524 | #[component] |
| 1321 | pub(crate) async fn comment_form( | 1525 | pub(crate) async fn comment_form( |
| 1322 | lang: Lang, | 1526 | lang: Lang, |
| 1323 | action: String, | 1527 | action: String, |
| 1324 | - state_action: String, | ||
| 1325 | csrf: String, | 1528 | csrf: String, |
| 1326 | draft: String, | 1529 | draft: String, |
| 1327 | error: Option<String>, | 1530 | error: Option<String>, |
| 1328 | - can_close: bool, | ||
| 1329 | - open: bool, | ||
| 1330 | ) -> Result<impl View> { | 1531 | ) -> Result<impl View> { |
| 1331 | Ok(view! { | 1532 | Ok(view! { |
| 1332 | <section class="sec issue-comment"> | 1533 | <section class="sec issue-comment"> |
| 1333 | - <h2>(g::t(lang, K::AddComment))</h2> | ||
| 1334 | if let Some(message) = error { | 1534 | if let Some(message) = error { |
| 1335 | alert(message: message.as_str()) | 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 | <input type="hidden" name="csrf" value=(csrf.as_str())> | 1538 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 1339 | <div class="field"> | 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 | <textarea id="issue-comment-body" name="body" rows="3">(draft.as_str())</textarea> | 1541 | <textarea id="issue-comment-body" name="body" rows="3">(draft.as_str())</textarea> |
| 1342 | </div> | 1542 | </div> |
| 1343 | <button type="submit" class="primary" name="action" value="comment">(g::t(lang, K::Comment))</button> | 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 | </form> | 1544 | </form> |
| 1355 | </section> | 1545 | </section> |
| 1356 | }) | 1546 | }) |
crates/forge-web/src/pages/issue_pin.rsmodified+8 -18
| @@ -75,8 +75,8 @@ async fn issue_pin_save(cx: &Cx, Form(form): Form<PinForm>) -> Result<impl View> | |||
| 75 | Err(see_other(back).into()) | 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 | 78 | +/// The pinned row, shown only while the issue is pinned, with its unpin word for triage holders. |
| 79 | -/// current state; others see whether the issue is pinned. | 79 | +/// Pinning is a tool at the foot of the sidebar (`item_tools`). |
| 80 | #[component] | 80 | #[component] |
| 81 | pub(crate) async fn pin_box( | 81 | pub(crate) async fn pin_box( |
| 82 | lang: Lang, | 82 | lang: Lang, |
| @@ -85,27 +85,17 @@ pub(crate) async fn pin_box( | |||
| 85 | action: String, | 85 | action: String, |
| 86 | csrf: String, | 86 | csrf: String, |
| 87 | ) -> Result<impl View> { | 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 | Ok(view! { | 88 | Ok(view! { |
| 89 | + if pinned { | ||
| 95 | <section class="sec meta"> | 90 | <section class="sec meta"> |
| 96 | <h2>(g::t(lang, K::Pinned))</h2> | 91 | <h2>(g::t(lang, K::Pinned))</h2> |
| 97 | - <p class="hint"> | 92 | + <div class="line"> |
| 98 | - if pinned { | 93 | + <span class="val">(g::t(lang, K::PinnedTopNote))</span> |
| 99 | - (g::t(lang, K::PinnedTopNote)) | ||
| 100 | - } else { | ||
| 101 | - (g::t(lang, K::NotPinned)) | ||
| 102 | - } | ||
| 103 | - </p> | ||
| 104 | if write { | 94 | if write { |
| 105 | - <div class="acts"> | 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())]) |
| 106 | - post_act(label: label, action: action.as_str(), csrf: csrf.as_str(), fields: vec![("pinned".to_owned(), next.to_owned())]) | ||
| 107 | - </div> | ||
| 108 | } | 96 | } |
| 97 | + </div> | ||
| 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 | use crate::notify; | 21 | use crate::notify; |
| 22 | use crate::pages::issue_parts::{ | 22 | use crate::pages::issue_parts::{ |
| 23 | CommentForm, ItemKind, Posted, bump_live, check_write, comment_for, comment_form, csrf_of, | 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, | 24 | + discussion_timeline, issue_for, item_for, item_head_tools, item_sidebar, load_discussion, |
| 25 | - lock_message, may_change, may_converse, parse_number, post_comment, triage, | 25 | + load_sidebar, lock_message, may_change, may_converse, parse_number, post_comment, triage, |
| 26 | }; | 26 | }; |
| 27 | use crate::pages::issue_pin::pin_box; | 27 | use crate::pages::issue_pin::pin_box; |
| 28 | use crate::pages::issues_live::item_live_url; | 28 | use crate::pages::issues_live::item_live_url; |
| @@ -60,7 +60,7 @@ async fn issue_page( | |||
| 60 | let viewer_login = ctx.viewer.as_ref().map(|(u, _)| u.username.clone()); | 60 | let viewer_login = ctx.viewer.as_ref().map(|(u, _)| u.username.clone()); |
| 61 | let pinned = state.store.is_pinned(&ctx.repo.id, &issue.id).await?; | 61 | let pinned = state.store.is_pinned(&ctx.repo.id, &issue.id).await?; |
| 62 | let pin_action = format!("{issue_href}/pin"); | 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 | let author = discussion.author.clone(); | 64 | let author = discussion.author.clone(); |
| 65 | let author_login = discussion.author_login.clone(); | 65 | let author_login = discussion.author_login.clone(); |
| 66 | let opened = discussion.opened.clone(); | 66 | let opened = discussion.opened.clone(); |
| @@ -74,6 +74,8 @@ async fn issue_page( | |||
| 74 | let locked_for_viewer = !may_converse(&ctx, &issue); | 74 | let locked_for_viewer = !may_converse(&ctx, &issue); |
| 75 | let lock_notice = lock_message(lang, &issue); | 75 | let lock_notice = lock_message(lang, &issue); |
| 76 | let open = matches!(issue.state, IssueState::Open); | 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 | let (state_class, state_text) = match (&issue.state, &issue.state_reason) { | 80 | let (state_class, state_text) = match (&issue.state, &issue.state_reason) { |
| 79 | (IssueState::Open, _) => ("issue-badge issue-badge-open", g::t(lang, K::Open)), | 81 | (IssueState::Open, _) => ("issue-badge issue-badge-open", g::t(lang, K::Open)), |
| @@ -106,13 +108,13 @@ async fn issue_page( | |||
| 106 | shell(title: page_title.as_str(), viewer: ctx.viewer.as_ref(), extra_stylesheet: Some(labels_href.as_str()), | 108 | shell(title: page_title.as_str(), viewer: ctx.viewer.as_ref(), extra_stylesheet: Some(labels_href.as_str()), |
| 107 | repo_head(head: header, title: Some(issue.title.clone()), sub: sub, | 109 | repo_head(head: header, title: Some(issue.title.clone()), sub: sub, |
| 108 | <span class="num">(number_label.as_str())</span> | 110 | <span class="num">(number_label.as_str())</span> |
| 111 | + item_head_tools(lang: lang, close: close, notify: notify) | ||
| 109 | ) | 112 | ) |
| 110 | <div class="work" data-live=(live_href.as_str()) data-live-now=""> | 113 | <div class="work" data-live=(live_href.as_str()) data-live-now=""> |
| 111 | <div class="sheet"> | 114 | <div class="sheet"> |
| 112 | discussion_timeline(lang: lang, discussion: discussion) | 115 | discussion_timeline(lang: lang, discussion: discussion) |
| 113 | if can_comment { | 116 | if can_comment { |
| 114 | - comment_form(lang: lang, action: comment_action.clone(), state_action: comment_action.clone(), | 117 | + comment_form(lang: lang, action: comment_action.clone(), csrf: csrf.clone(), draft: draft, error: error) |
| 115 | - csrf: csrf.clone(), draft: draft, error: error, can_close: editable_issue, open: open) | ||
| 116 | } | 118 | } |
| 117 | if archived { | 119 | if archived { |
| 118 | <p class="state">(g::t(lang, K::ArchivedIssuesReadOnly))</p> | 120 | <p class="state">(g::t(lang, K::ArchivedIssuesReadOnly))</p> |
| @@ -123,7 +125,7 @@ async fn issue_page( | |||
| 123 | <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> | 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 | pin_box(lang: lang, write: write_meta, pinned: pinned, action: pin_action.clone(), csrf: csrf.clone()) | 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 | </div> | 129 | </div> |
| 128 | </div> | 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 | <a class="act" href=(milestones_href.as_str())>(g::t(lang, K::Milestones))</a> | 604 | <a class="act" href=(milestones_href.as_str())>(g::t(lang, K::Milestones))</a> |
| 605 | </form> | 605 | </form> |
| 606 | if has_filters { | 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 | if !pinned.is_empty() { | 609 | if !pinned.is_empty() { |
| 610 | <section class="sec" aria-label=(g::t(lang, K::PinnedIssues))> | 610 | <section class="sec" aria-label=(g::t(lang, K::PinnedIssues))> |
| @@ -788,7 +788,6 @@ async fn new_issue_body( | |||
| 788 | <div class="field"> | 788 | <div class="field"> |
| 789 | <label for="issue-body">(g::t(lang, K::Description))</label> | 789 | <label for="issue-body">(g::t(lang, K::Description))</label> |
| 790 | <textarea id="issue-body" name="body" rows="12">(draft.body.as_str())</textarea> | 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 | </div> | 791 | </div> |
| 793 | if has_labels { | 792 | if has_labels { |
| 794 | <div class="field"> | 793 | <div class="field"> |
crates/forge-web/src/pages/labels_page.rsmodified+2 -3
| @@ -148,7 +148,7 @@ async fn labels_body( | |||
| 148 | </span> | 148 | </span> |
| 149 | </summary> | 149 | </summary> |
| 150 | <div class="opened"> | 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 | if can_triage { | 152 | if can_triage { |
| 153 | <div class="acts"> | 153 | <div class="acts"> |
| 154 | reveal(label: g::t(lang, K::Edit), | 154 | reveal(label: g::t(lang, K::Edit), |
| @@ -169,8 +169,7 @@ async fn labels_body( | |||
| 169 | <button type="submit">(g::t(lang, K::SaveLabel))</button> | 169 | <button type="submit">(g::t(lang, K::SaveLabel))</button> |
| 170 | </form> | 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(), | 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())) | ||
| 174 | </div> | 173 | </div> |
| 175 | } | 174 | } |
| 176 | </div> | 175 | </div> |
crates/forge-web/src/pages/login.rsmodified+2 -2
| @@ -25,7 +25,7 @@ use crate::i18n::{self, Key, Lang, t}; | |||
| 25 | use crate::pages::passkeys::{available as passkeys_available, login_passkey, s}; | 25 | use crate::pages::passkeys::{available as passkeys_available, login_passkey, s}; |
| 26 | use crate::state::AppState; | 26 | use crate::state::AppState; |
| 27 | use crate::throttle::{self, LOGIN_IP_LIMIT, LOGIN_USER_LIMIT, TWO_FACTOR_USER_LIMIT}; | 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 | use crate::views::{alert, shell}; | 29 | use crate::views::{alert, shell}; |
| 30 | 30 | ||
| 31 | /// Hash checked when the username is unknown, so both paths spend one argon2 verify. | 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 | #[component] | 279 | #[component] |
| 280 | async fn two_factor_form(lang: Lang, precsrf: &str, error: Option<String>) -> Result<impl View> { | 280 | async fn two_factor_form(lang: Lang, precsrf: &str, error: Option<String>) -> Result<impl View> { |
| 281 | Ok(view! { | 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 | <div class="sheet fit"> | 283 | <div class="sheet fit"> |
| 284 | <form data-hard="true" method="post" action="/login/2fa" class="fields"> | 284 | <form data-hard="true" method="post" action="/login/2fa" class="fields"> |
| 285 | if let Some(message) = error { | 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 | csrf: String, | 359 | csrf: String, |
| 360 | ) -> Result<impl View> { | 360 | ) -> Result<impl View> { |
| 361 | let remove_label = g::t(lang, K::RemoveFromQueue); | 361 | let remove_label = g::t(lang, K::RemoveFromQueue); |
| 362 | - let hint = g::t(lang, K::RequireMergeQueueHint); | ||
| 363 | let remove_note = crate::pages::passkeys::s( | 362 | let remove_note = crate::pages::passkeys::s( |
| 364 | lang, | 363 | lang, |
| 365 | - "The pull request leaves the queue. It can join again later.", | 364 | + "Remove it from the queue?", |
| 366 | - "Çekme isteği sıradan çıkar. Daha sonra yeniden ekleyebilirsin.", | 365 | + "Sıradan çıkarılsın mı?", |
| 367 | ) | 366 | ) |
| 368 | .to_owned(); | 367 | .to_owned(); |
| 369 | Ok(view! { | 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 | </div> | 432 | </div> |
| 439 | }) | 433 | }) |
| 440 | } | 434 | } |
crates/forge-web/src/pages/milestones_page.rsmodified+3 -6
| @@ -136,16 +136,14 @@ async fn milestone_row( | |||
| 136 | <span class="val">(open_text.as_str()) " \u{b7} " (closed_text.as_str())</span> | 136 | <span class="val">(open_text.as_str()) " \u{b7} " (closed_text.as_str())</span> |
| 137 | </summary> | 137 | </summary> |
| 138 | <div class="opened"> | 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 | (g::due_text(lang, due)) | 141 | (g::due_text(lang, due)) |
| 142 | if row.overdue { | 142 | if row.overdue { |
| 143 | " " <span class="badge overdue">(g::t(lang, K::Overdue))</span> | 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 | <progress value=(row.closed) max=(max)></progress> | 147 | <progress value=(row.closed) max=(max)></progress> |
| 150 | <div class="acts"> | 148 | <div class="acts"> |
| 151 | <a class="act" href=(row.open_href.as_str())>(open_text.as_str())</a> | 149 | <a class="act" href=(row.open_href.as_str())>(open_text.as_str())</a> |
| @@ -157,8 +155,7 @@ async fn milestone_row( | |||
| 157 | if can_triage { | 155 | if can_triage { |
| 158 | <div class="acts"> | 156 | <div class="acts"> |
| 159 | <a class="act" href=(row.edit_href.as_str())>(g::t(lang, K::Edit))</a> | 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(), | 158 | + 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())) | ||
| 162 | </div> | 159 | </div> |
| 163 | } | 160 | } |
| 164 | </div> | 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 | use crate::i18n::{self, Lang}; | 20 | use crate::i18n::{self, Lang}; |
| 21 | use crate::live::{Topic, stream_wakes}; | 21 | use crate::live::{Topic, stream_wakes}; |
| 22 | use crate::pages::ci_runs::run_href; | 22 | use crate::pages::ci_runs::run_href; |
| 23 | -use crate::pages::passkeys::s; | ||
| 24 | use crate::state::AppState; | 23 | use crate::state::AppState; |
| 25 | -use crate::views::parts::{SubPart, head}; | 24 | +use crate::views::parts::head; |
| 26 | use crate::views::repo_list::{PageLink, pager, pager_links}; | 25 | use crate::views::repo_list::{PageLink, pager, pager_links}; |
| 27 | use crate::views::{rel_time, repo_href, shell}; | 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 | let back = full.as_ref().map(|_| ni::t(lang, K::BackToNeedsYou)); | 410 | let back = full.as_ref().map(|_| ni::t(lang, K::BackToNeedsYou)); |
| 412 | let heading = ni::t(lang, K::NeedsYou); | 411 | let heading = ni::t(lang, K::NeedsYou); |
| 413 | let unread = state.store.unread_count(&user.id).await?; | 412 | let unread = state.store.unread_count(&user.id).await?; |
| 414 | - let sub = vec![SubPart::text(s(lang, "Waiting on you", "Senden beklenenler"))]; | ||
| 415 | Ok(view! { | 413 | Ok(view! { |
| 416 | shell(title: heading, viewer: Some(&viewer), | 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 | if let Some(back) = back { | 416 | if let Some(back) = back { |
| 419 | <a class="act" href="/needs-you">(back)</a> | 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 | <input type="checkbox" name="add_readme" value="on" checked=(add_readme)> | 273 | <input type="checkbox" name="add_readme" value="on" checked=(add_readme)> |
| 274 | <span>(g::t(lang, K::ReadmeLabel))</span> | 274 | <span>(g::t(lang, K::ReadmeLabel))</span> |
| 275 | </label> | 275 | </label> |
| 276 | - <p class="hint">(g::t(lang, K::ReadmeHelp))</p> | ||
| 277 | <div class="field"> | 276 | <div class="field"> |
| 278 | <label for="new-license">(g::t(lang, K::LicenseLabel))</label> | 277 | <label for="new-license">(g::t(lang, K::LicenseLabel))</label> |
| 279 | <select id="new-license" name="license"> | 278 | <select id="new-license" name="license"> |
| @@ -282,10 +281,8 @@ async fn new_repo_form( | |||
| 282 | <option value=(*id) selected=(*id == draft_license.as_str())>(*label)</option> | 281 | <option value=(*id) selected=(*id == draft_license.as_str())>(*label)</option> |
| 283 | } | 282 | } |
| 284 | </select> | 283 | </select> |
| 285 | - <p class="hint">(g::t(lang, K::LicenseHelp))</p> | ||
| 286 | </div> | 284 | </div> |
| 287 | reveal(label: g::t(lang, K::MirrorLegend), id: Some("new-mirror"), open: mirror_open, | 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 | <div class="field"> | 286 | <div class="field"> |
| 290 | <label for="new-mirror-url">(g::t(lang, K::SourceUrl))</label> | 287 | <label for="new-mirror-url">(g::t(lang, K::SourceUrl))</label> |
| 291 | <input id="new-mirror-url" type="url" name="mirror_url" value=(draft_mirror_url.as_str()) autocomplete="off" spellcheck="false" maxlength="2048"> | 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 | pub(crate) async fn notify_box_for( | 1009 | pub(crate) async fn notify_box_for( |
| 1010 | state: &AppState, | 1010 | state: &AppState, |
| 1011 | ctx: &RepoCtx, | 1011 | ctx: &RepoCtx, |
| 1012 | - lang: Lang, | ||
| 1013 | issue_id: &str, | 1012 | issue_id: &str, |
| 1014 | base: &str, | 1013 | base: &str, |
| 1015 | ) -> Result<Option<NotifyBox>> { | 1014 | ) -> Result<Option<NotifyBox>> { |
| @@ -1020,47 +1019,28 @@ pub(crate) async fn notify_box_for( | |||
| 1020 | publish_unread(state, &user.id).await; | 1019 | publish_unread(state, &user.id).await; |
| 1021 | let level = state.store.watch_level(&user.id, &ctx.repo.id).await?; | 1020 | let level = state.store.watch_level(&user.id, &ctx.repo.id).await?; |
| 1022 | let subscription = state.store.subscription(&user.id, issue_id).await?; | 1021 | let subscription = state.store.subscription(&user.id, issue_id).await?; |
| 1023 | - let (subscribed, reason) = if level == WatchLevel::Ignoring { | 1022 | + let subscribed = if level == WatchLevel::Ignoring { |
| 1024 | - (false, g::t(lang, K::NotReceivingRepo).to_owned()) | 1023 | + false |
| 1025 | } else { | 1024 | } else { |
| 1026 | match subscription { | 1025 | match subscription { |
| 1027 | - Some((SubState::Ignored, _)) => (false, g::t(lang, K::NotReceivingThread).to_owned()), | 1026 | + Some((SubState::Ignored, _)) => false, |
| 1028 | - Some((SubState::Subscribed, reason)) => (true, because(lang, reason)), | 1027 | + Some((SubState::Subscribed, _)) => true, |
| 1029 | - None if level == WatchLevel::Watching => { | 1028 | + None => level == WatchLevel::Watching, |
| 1030 | - (true, g::receiving_because(lang, K::WhyWatching)) | ||
| 1031 | - } | ||
| 1032 | - None => (false, g::t(lang, K::NotReceivingThread).to_owned()), | ||
| 1033 | } | 1029 | } |
| 1034 | }; | 1030 | }; |
| 1035 | Ok(Some(NotifyBox { | 1031 | Ok(Some(NotifyBox { |
| 1036 | action: format!("{base}/subscription"), | 1032 | action: format!("{base}/subscription"), |
| 1037 | csrf: session.csrf_token.clone(), | 1033 | csrf: session.csrf_token.clone(), |
| 1038 | subscribed, | 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 | 1038 | +/// The notification sidebar box data: where the form posts, the session CSRF token, and whether the |
| 1044 | -/// viewer is receiving notifications, and the sentence explaining why. | 1039 | +/// viewer is receiving notifications. |
| 1045 | pub(crate) struct NotifyBox { | 1040 | pub(crate) struct NotifyBox { |
| 1046 | pub(crate) action: String, | 1041 | pub(crate) action: String, |
| 1047 | pub(crate) csrf: String, | 1042 | pub(crate) csrf: String, |
| 1048 | pub(crate) subscribed: bool, | 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 | /// The human label of a notification reason. | 1046 | /// The human label of a notification reason. |
| @@ -1158,7 +1138,6 @@ async fn inbox_list( | |||
| 1158 | let filters = inbox_items(lang, if all { "all" } else { "unread" }, unread_count); | 1138 | let filters = inbox_items(lang, if all { "all" } else { "unread" }, unread_count); |
| 1159 | Ok(view! { | 1139 | Ok(view! { |
| 1160 | head(title: i18n::t(lang, Key::Notifications), | 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 | if !empty { | 1141 | if !empty { |
| 1163 | <form method="post" action="/notifications/mark_all_read" class="act-form"> | 1142 | <form method="post" action="/notifications/mark_all_read" class="act-form"> |
| 1164 | <input type="hidden" name="csrf" value=(csrf.as_str())> | 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 | 1193 | +/// The Subscribe or Unsubscribe pill of an issue or pull request, in its head. |
| 1215 | -/// Unsubscribe button. | ||
| 1216 | #[component] | 1194 | #[component] |
| 1217 | -pub(crate) async fn notify_box( | 1195 | +pub(crate) async fn notify_pill( |
| 1218 | lang: Lang, | 1196 | lang: Lang, |
| 1219 | action: String, | 1197 | action: String, |
| 1220 | csrf: String, | 1198 | csrf: String, |
| 1221 | subscribed: bool, | 1199 | subscribed: bool, |
| 1222 | - reason: String, | ||
| 1223 | ) -> Result<impl View> { | 1200 | ) -> Result<impl View> { |
| 1224 | let (label, value_text) = if subscribed { | 1201 | let (label, value_text) = if subscribed { |
| 1225 | (g::t(lang, K::Unsubscribe), "unsubscribe") | 1202 | (g::t(lang, K::Unsubscribe), "unsubscribe") |
| @@ -1227,13 +1204,11 @@ pub(crate) async fn notify_box( | |||
| 1227 | (g::t(lang, K::Subscribe), "subscribe") | 1204 | (g::t(lang, K::Subscribe), "subscribe") |
| 1228 | }; | 1205 | }; |
| 1229 | Ok(view! { | 1206 | Ok(view! { |
| 1230 | - <section class="sec meta"> | 1207 | + <form class="act-form" method="post" action=(action.as_str())> |
| 1231 | - <h2>(i18n::t(lang, Key::Notifications))</h2> | 1208 | + <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 1232 | - <p class="hint">(reason.as_str())</p> | 1209 | + <input type="hidden" name="action" value=(value_text)> |
| 1233 | - <div class="acts"> | 1210 | + <button type="submit" class="act">(label)</button> |
| 1234 | - post_act(label: label, action: action.as_str(), csrf: csrf.as_str(), fields: vec![("action".to_owned(), value_text.to_owned())]) | 1211 | + </form> |
| 1235 | - </div> | ||
| 1236 | - </section> | ||
| 1237 | }) | 1212 | }) |
| 1238 | } | 1213 | } |
| 1239 | 1214 | ||
| @@ -1277,7 +1252,6 @@ pub(crate) async fn watch_form( | |||
| 1277 | <input type="hidden" name="level" value="participating"> | 1252 | <input type="hidden" name="level" value="participating"> |
| 1278 | <button type="submit" class=(cls_participating)> | 1253 | <button type="submit" class=(cls_participating)> |
| 1279 | <span class="watch-option-title">(g::t(lang, K::OptParticipating))</span> | 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 | </button> | 1255 | </button> |
| 1282 | </form> | 1256 | </form> |
| 1283 | </li> | 1257 | </li> |
| @@ -1287,7 +1261,6 @@ pub(crate) async fn watch_form( | |||
| 1287 | <input type="hidden" name="level" value="watching"> | 1261 | <input type="hidden" name="level" value="watching"> |
| 1288 | <button type="submit" class=(cls_watching) data-palette-action="post" data-palette-label=(g::t(lang, K::OptWatching))> | 1262 | <button type="submit" class=(cls_watching) data-palette-action="post" data-palette-label=(g::t(lang, K::OptWatching))> |
| 1289 | <span class="watch-option-title">(g::t(lang, K::OptWatching))</span> | 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 | </button> | 1264 | </button> |
| 1292 | </form> | 1265 | </form> |
| 1293 | </li> | 1266 | </li> |
| @@ -1297,7 +1270,6 @@ pub(crate) async fn watch_form( | |||
| 1297 | <input type="hidden" name="level" value="ignoring"> | 1270 | <input type="hidden" name="level" value="ignoring"> |
| 1298 | <button type="submit" class=(cls_ignoring)> | 1271 | <button type="submit" class=(cls_ignoring)> |
| 1299 | <span class="watch-option-title">(g::t(lang, K::OptIgnoring))</span> | 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 | </button> | 1273 | </button> |
| 1302 | </form> | 1274 | </form> |
| 1303 | </li> | 1275 | </li> |
| @@ -1474,7 +1446,7 @@ mod tests { | |||
| 1474 | let unread = get(&site, "/notifications", Some(&cookie)).await; | 1446 | let unread = get(&site, "/notifications", Some(&cookie)).await; |
| 1475 | assert_eq!(unread.status, 200); | 1447 | assert_eq!(unread.status, 200); |
| 1476 | assert!(!unread.body.contains("tahinli/demo #1 First")); | 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 | let all = get(&site, "/notifications?all=1", Some(&cookie)).await; | 1451 | let all = get(&site, "/notifications?all=1", Some(&cookie)).await; |
| 1480 | assert_eq!(all.status, 200); | 1452 | assert_eq!(all.status, 200); |
| @@ -1624,7 +1596,6 @@ mod tests { | |||
| 1624 | assert_eq!(sub, Some((SubState::Subscribed, Reason::Subscribed))); | 1596 | assert_eq!(sub, Some((SubState::Subscribed, Reason::Subscribed))); |
| 1625 | 1597 | ||
| 1626 | let page = get(&site, "/tahinli/demo/issues/1", Some(&cookie)).await; | 1598 | let page = get(&site, "/tahinli/demo/issues/1", Some(&cookie)).await; |
| 1627 | - assert!(page.body.contains("because you subscribed to this.")); | ||
| 1628 | assert!(page.body.contains("value=\"unsubscribe\"")); | 1599 | assert!(page.body.contains("value=\"unsubscribe\"")); |
| 1629 | 1600 | ||
| 1630 | post( | 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 | .map(|(_, key, is_error)| (g::t(lang, *key), *is_error)) | 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 | /// The counts on an organization's tab labels: the repos the viewer may read and the packages the | 187 | /// The counts on an organization's tab labels: the repos the viewer may read and the packages the |
| 199 | /// viewer may see, as the profile counts them. | 188 | /// viewer may see, as the profile counts them. |
| 200 | pub async fn org_tab_counts(state: &AppState, org: &User, viewer: &User) -> Result<(u64, usize)> { | 189 | pub async fn org_tab_counts(state: &AppState, org: &User, viewer: &User) -> Result<(u64, usize)> { |
crates/forge-web/src/pages/org_members.rsmodified+39 -87
| @@ -24,7 +24,7 @@ use crate::pages::org_ctx::{ | |||
| 24 | }; | 24 | }; |
| 25 | use crate::pages::passkeys; | 25 | use crate::pages::passkeys; |
| 26 | use crate::state::AppState; | 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 | use crate::views::{avatar_url, display_name, shell}; | 28 | use crate::views::{avatar_url, display_name, shell}; |
| 29 | 29 | ||
| 30 | path_param!(org); | 30 | path_param!(org); |
| @@ -57,25 +57,15 @@ struct RemoveForm { | |||
| 57 | user_id: String, | 57 | user_id: String, |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | -/// One table row: a member, their org role, and whether it is the viewer. | 60 | +/// The members list and its add form. Owners get the role, remove and add controls; everyone |
| 61 | -struct MemberRow { | 61 | +/// else sees the plain list. |
| 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. | ||
| 72 | #[component] | 62 | #[component] |
| 73 | async fn members_body( | 63 | async fn members_body( |
| 74 | name: String, | 64 | name: String, |
| 75 | description: String, | 65 | description: String, |
| 76 | base: String, | 66 | base: String, |
| 77 | owner: bool, | 67 | owner: bool, |
| 78 | - rows: Vec<MemberRow>, | 68 | + rows: Vec<PersonRow>, |
| 79 | csrf: String, | 69 | csrf: String, |
| 80 | notice: Option<(&'static str, bool)>, | 70 | notice: Option<(&'static str, bool)>, |
| 81 | lang: Lang, | 71 | lang: Lang, |
| @@ -83,85 +73,41 @@ async fn members_body( | |||
| 83 | repo_count: u64, | 73 | repo_count: u64, |
| 84 | package_count: usize, | 74 | package_count: usize, |
| 85 | ) -> Result<impl View> { | 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 | let sub = if description.is_empty() { | 76 | let sub = if description.is_empty() { |
| 90 | Vec::new() | 77 | Vec::new() |
| 91 | } else { | 78 | } else { |
| 92 | vec![SubPart::text(description)] | 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 | Ok(view! { | 105 | Ok(view! { |
| 95 | head(title: name.as_str(), sub: sub, live: Some(live.as_str())) | 106 | head(title: name.as_str(), sub: sub, live: Some(live.as_str())) |
| 96 | org_tabs(lang: lang, name: name.clone(), current: "members".to_owned(), owner: owner, repo_count: repo_count, package_count: package_count) | 107 | org_tabs(lang: lang, name: name.clone(), current: "members".to_owned(), owner: owner, repo_count: repo_count, package_count: package_count) |
| 97 | org_notice(notice: notice) | 108 | org_notice(notice: notice) |
| 98 | <div class="sheet"> | 109 | <div class="sheet"> |
| 99 | - <div class="sheet-tools"> | 110 | + people_list(list: list) |
| 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 | - } | ||
| 165 | </div> | 111 | </div> |
| 166 | }) | 112 | }) |
| 167 | } | 113 | } |
| @@ -174,15 +120,21 @@ async fn org_members_page(cx: &Cx) -> Result<impl View> { | |||
| 174 | let lang = i18n::lang(cx, Some(&ctx.viewer.0)); | 120 | let lang = i18n::lang(cx, Some(&ctx.viewer.0)); |
| 175 | let state = app_context::<AppState>(cx); | 121 | let state = app_context::<AppState>(cx); |
| 176 | let members = state.store.org_members(&ctx.org.id).await?; | 122 | let members = state.store.org_members(&ctx.org.id).await?; |
| 177 | - let rows: Vec<MemberRow> = members | 123 | + let rows: Vec<PersonRow> = members |
| 178 | .into_iter() | 124 | .into_iter() |
| 179 | - .map(|(user, role)| MemberRow { | 125 | + .map(|(user, role)| { |
| 180 | - is_self: user.id == ctx.viewer.0.id, | 126 | + let is_owner = role == OrgMemberRole::Owner; |
| 127 | + let is_self = user.id == ctx.viewer.0.id; | ||
| 128 | + PersonRow { | ||
| 129 | + is_self, | ||
| 181 | user_id: user.id.clone(), | 130 | user_id: user.id.clone(), |
| 182 | avatar: avatar_url(&user.username, user.avatar_hash.as_deref()), | 131 | avatar: avatar_url(&user.username, user.avatar_hash.as_deref()), |
| 183 | label: display_name(lang, &user.username), | 132 | label: display_name(lang, &user.username), |
| 184 | username: user.username, | 133 | username: user.username, |
| 185 | - is_owner: role == OrgMemberRole::Owner, | 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 | .collect(); | 139 | .collect(); |
| 188 | let owner = ctx.is_owner(); | 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 | use crate::i18n::{self, Lang}; | 18 | use crate::i18n::{self, Lang}; |
| 19 | use crate::live::Topic; | 19 | use crate::live::Topic; |
| 20 | use crate::state::AppState; | 20 | use crate::state::AppState; |
| 21 | -use crate::views::parts::{SubPart, head}; | 21 | +use crate::views::parts::head; |
| 22 | use crate::views::{alert, csrf_field, shell, user_facing_message}; | 22 | use crate::views::{alert, csrf_field, shell, user_facing_message}; |
| 23 | 23 | ||
| 24 | const MAX_DESCRIPTION_CHARS: usize = 2000; | 24 | const MAX_DESCRIPTION_CHARS: usize = 2000; |
| @@ -51,7 +51,7 @@ async fn new_org_form( | |||
| 51 | username: String, | 51 | username: String, |
| 52 | ) -> Result<impl View> { | 52 | ) -> Result<impl View> { |
| 53 | Ok(view! { | 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 | crate::pages::profile::own_profile_tabs(lang: lang, username: username, current: "organizations".to_owned()) | 55 | crate::pages::profile::own_profile_tabs(lang: lang, username: username, current: "organizations".to_owned()) |
| 56 | <div class="sheet fit"> | 56 | <div class="sheet fit"> |
| 57 | if let Some(message) = error { | 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 | <option value=(*choice) selected=(*choice == default_role.as_str())>(g::role_name(lang, choice))</option> | 114 | <option value=(*choice) selected=(*choice == default_role.as_str())>(g::role_name(lang, choice))</option> |
| 115 | } | 115 | } |
| 116 | </select> | 116 | </select> |
| 117 | - <p class="hint">(g::t(lang, K::DefaultRoleHelp))</p> | ||
| 118 | </div> | 117 | </div> |
| 119 | <label class="switch"> | 118 | <label class="switch"> |
| 120 | <input type="checkbox" name="members_can_create" value="on" checked=(members_can_create)> | 119 | <input type="checkbox" name="members_can_create" value="on" checked=(members_can_create)> |
| @@ -128,7 +127,6 @@ async fn settings_body( | |||
| 128 | <section class="sec"> | 127 | <section class="sec"> |
| 129 | <h2>(t(lang, Key::Avatar))</h2> | 128 | <h2>(t(lang, Key::Avatar))</h2> |
| 130 | <img class="avatar profile-settings-avatar-img" src=(avatar_src.as_str()) alt=(t(lang, Key::AvatarAlt)) width="40" height="40"> | 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 | <div class="acts"> | 130 | <div class="acts"> |
| 133 | reveal(label: t(lang, Key::UploadPhoto), id: Some("org-avatar"), | 131 | reveal(label: t(lang, Key::UploadPhoto), id: Some("org-avatar"), |
| 134 | <form method="post" action=(avatar_action.as_str()) enctype="multipart/form-data" class="fields"> | 132 | <form method="post" action=(avatar_action.as_str()) enctype="multipart/form-data" class="fields"> |
| @@ -147,7 +145,6 @@ async fn settings_body( | |||
| 147 | </section> | 145 | </section> |
| 148 | <section class="sec"> | 146 | <section class="sec"> |
| 149 | <h2>(g::t(lang, K::DeleteOrg))</h2> | 147 | <h2>(g::t(lang, K::DeleteOrg))</h2> |
| 150 | - <p class="hint">(g::t(lang, K::DeleteOrgIntro))</p> | ||
| 151 | <div class="acts"> | 148 | <div class="acts"> |
| 152 | <details class="reveal"> | 149 | <details class="reveal"> |
| 153 | <summary class="act danger">(g::t(lang, K::DeleteOrg))</summary> | 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 | </div> | 239 | </div> |
| 240 | - <p class="hint">(g::t(lang, K::TeamsIntro))</p> | ||
| 241 | if rows.is_empty() { | 240 | if rows.is_empty() { |
| 242 | <p class="state">(g::t(lang, K::NoTeamsYet))</p> | 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 | <p>(description.as_str())</p> | 334 | <p>(description.as_str())</p> |
| 335 | } | 335 | } |
| 336 | <h2>(install)</h2> | 336 | <h2>(install)</h2> |
| 337 | - <p class="hint">(pk::t(lang, K::InstallHelp))</p> | ||
| 338 | <p class="hint">(pk::t(lang, K::InstallRegistryConfig))</p> | 337 | <p class="hint">(pk::t(lang, K::InstallRegistryConfig))</p> |
| 339 | <div class="copy-box"> | 338 | <div class="copy-box"> |
| 340 | <code id="pkg-config">(config_block.as_str())</code> | 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 | <div class="sheet"> | 127 | <div class="sheet"> |
| 128 | <section class="sec"> | 128 | <section class="sec"> |
| 129 | <h2>(pk::t(lang, K::Install))</h2> | 129 | <h2>(pk::t(lang, K::Install))</h2> |
| 130 | - <p class="hint">(pk::t(lang, K::ContainerInstallHelp))</p> | ||
| 131 | <p class="state">(pk::t(lang, K::ContainerLogin))</p> | 130 | <p class="state">(pk::t(lang, K::ContainerLogin))</p> |
| 132 | <div class="copy-box"> | 131 | <div class="copy-box"> |
| 133 | <code id="oci-login">(login.as_str())</code> | 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 | <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> | 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 | if can_delete { | 156 | if can_delete { |
| 158 | confirm_act(lang: lang, label: pk::t(lang, K::DeleteTag), action: delete_action.as_str(), csrf: csrf.as_str(), | 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())], | 158 | + fields: vec![("package".to_owned(), package.name.clone()), ("tag".to_owned(), tag.clone())]) |
| 160 | - note: Some(pk::t(lang, K::DeleteTagMessage).to_owned())) | ||
| 161 | } | 159 | } |
| 162 | </div> | 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 | "settings", | 318 | "settings", |
| 319 | true, | 319 | true, |
| 320 | &[ | 320 | &[ |
| 321 | - "Visibility", | ||
| 322 | - "Görünürlük", | ||
| 323 | - "Archive", | ||
| 324 | - "Arşiv", | ||
| 325 | "Description", | 321 | "Description", |
| 326 | "Açıklama", | 322 | "Açıklama", |
| 323 | + "Features", | ||
| 324 | + "Özellikler", | ||
| 325 | + "Wiki", | ||
| 326 | + "Discussions", | ||
| 327 | + "Tartışmalar", | ||
| 327 | ], | 328 | ], |
| 328 | ), | 329 | ), |
| 329 | repo_page( | 330 | repo_page( |
| @@ -338,12 +339,6 @@ fn repo_pages(lang: Lang) -> Vec<Value> { | |||
| 338 | true, | 339 | true, |
| 339 | &["Access", "Erişim", "Members"], | 340 | &["Access", "Erişim", "Members"], |
| 340 | ), | 341 | ), |
| 341 | - repo_page( | ||
| 342 | - admin(RK::RenameTransferNav), | ||
| 343 | - "settings/rename", | ||
| 344 | - true, | ||
| 345 | - &["Rename", "Transfer"], | ||
| 346 | - ), | ||
| 347 | repo_page(admin(RK::Webhooks), "settings/hooks", true, &["Hooks"]), | 342 | repo_page(admin(RK::Webhooks), "settings/hooks", true, &["Hooks"]), |
| 348 | repo_page( | 343 | repo_page( |
| 349 | admin(RK::Mirrors), | 344 | admin(RK::Mirrors), |
| @@ -357,12 +352,20 @@ fn repo_pages(lang: Lang) -> Vec<Value> { | |||
| 357 | true, | 352 | true, |
| 358 | &["Variables", "Env"], | 353 | &["Variables", "Env"], |
| 359 | ), | 354 | ), |
| 360 | - repo_page(code(CK::TabWiki), "settings/wiki", true, &[]), | ||
| 361 | repo_page( | 355 | repo_page( |
| 362 | admin(RK::DangerZone), | 356 | admin(RK::DangerZone), |
| 363 | "settings?section=danger", | 357 | "settings?section=danger", |
| 364 | true, | 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 | let terms = terms_for(ADMIN_TERMS, &item.href); | 448 | let terms = terms_for(ADMIN_TERMS, &item.href); |
| 446 | push_terms(&mut items, &mut seen, &label, &item.href, "page", terms); | 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 | let queue = format!( | 470 | let queue = format!( |
| 449 | "{admin_area} \u{b7} {}", | 471 | "{admin_area} \u{b7} {}", |
| 450 | s(lang, "Mail queue", "E-posta kuyruğu") | 472 | s(lang, "Mail queue", "E-posta kuyruğu") |
| @@ -467,9 +489,13 @@ async fn palette(cx: &Cx) -> Result<Response> { | |||
| 467 | (Lang::Tr, Some((tr, _))) => tr, | 489 | (Lang::Tr, Some((tr, _))) => tr, |
| 468 | _ => field.label, | 490 | _ => field.label, |
| 469 | }; | 491 | }; |
| 470 | - let page = page_of(field.key); | 492 | + let home = page_of(lang, field.key); |
| 471 | - let label = format!("{server} \u{b7} {} \u{b7} {name}", page.label(lang)); | 493 | + let label = if home.server { |
| 472 | - let href = format!("/admin/server?cat={}#srv-{}", page.slug, field.key); | 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 | let terms = [field.key, field.label]; | 499 | let terms = [field.key, field.label]; |
| 474 | push_terms(&mut items, &mut seen, &label, &href, "page", &terms); | 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 | if let Some(text) = problem_text { | 676 | if let Some(text) = problem_text { |
| 677 | <p class="hint topic-warn">(text)</p> | 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 | for (item, rename_action, delete_action, field) in rows.into_iter() { | 679 | for (item, rename_action, delete_action, field) in rows.into_iter() { |
| 682 | <details class="row-open"> | 680 | <details class="row-open"> |
| @@ -696,7 +694,7 @@ pub async fn passkeys_panel(lang: Lang, csrf: &str, panel: PasskeyPanel) -> Resu | |||
| 696 | <button type="submit" class="primary">(t(lang, Key::Save))</button> | 694 | <button type="submit" class="primary">(t(lang, Key::Save))</button> |
| 697 | </form> | 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 | </div> | 698 | </div> |
| 701 | </div> | 699 | </div> |
| 702 | </details> | 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 | passkeys[0].id | 589 | passkeys[0].id |
| 590 | ); | 590 | ); |
| 591 | assert!(page.body.contains(&delete_action)); | 591 | assert!(page.body.contains(&delete_action)); |
| 592 | - assert!(page.body.contains("Delete this passkey?")); | ||
| 593 | let login = send(&fx.router, "GET", "/login", None, &[]).await; | 592 | let login = send(&fx.router, "GET", "/login", None, &[]).await; |
| 594 | assert!(login.body.contains("data-passkey-signin")); | 593 | assert!(login.body.contains("data-passkey-signin")); |
| 595 | assert!(login.body.contains("autocomplete=\"username webauthn\"")); | 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 | if let Some(summary) = org { | 771 | if let Some(summary) = org { |
| 772 | <section class="sec profile-org"> | 772 | <section class="sec profile-org"> |
| 773 | <h2>(g::t(lang, K::Members))</h2> | 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 | if summary.members.is_empty() { | 775 | if summary.members.is_empty() { |
| 776 | <p class="state">(g::t(lang, K::NoMembers))</p> | 776 | <p class="state">(g::t(lang, K::NoMembers))</p> |
| 777 | } else { | 777 | } else { |
| @@ -816,7 +816,6 @@ async fn profile_card( | |||
| 816 | if packages_on { | 816 | if packages_on { |
| 817 | <section class="sec package-listing" data-live=(packages_events.as_str())> | 817 | <section class="sec package-listing" data-live=(packages_events.as_str())> |
| 818 | <h2>(pk::t(lang, PK::PackagesHeading))</h2> | 818 | <h2>(pk::t(lang, PK::PackagesHeading))</h2> |
| 819 | - <p class="hint">(pk::t(lang, PK::PackagesHelp))</p> | ||
| 820 | if has_packages { | 819 | if has_packages { |
| 821 | for row in package_rows.into_iter() { | 820 | for row in package_rows.into_iter() { |
| 822 | <div class="line" data-kb-row=""> | 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 | <summary class="act">(g::t(lang, K::CustomizePins))</summary> | 70 | <summary class="act">(g::t(lang, K::CustomizePins))</summary> |
| 71 | <form method="post" action=(action.as_str()) class="menu-list"> | 71 | <form method="post" action=(action.as_str()) class="menu-list"> |
| 72 | <input type="hidden" name="csrf" value=(csrf.as_str())> | 72 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 73 | - <p class="hint">(g::t(lang, K::PinsIntro))</p> | ||
| 74 | <ul class="pin-options"> | 73 | <ul class="pin-options"> |
| 75 | for option in options.into_iter() { | 74 | for option in options.into_iter() { |
| 76 | <li> | 75 | <li> |
crates/forge-web/src/pages/pull_files.rsmodified+5 -14
| @@ -214,12 +214,11 @@ async fn files_rail( | |||
| 214 | ) -> Result<impl View> { | 214 | ) -> Result<impl View> { |
| 215 | let mark = g::t(lang, K::ViewedMark); | 215 | let mark = g::t(lang, K::ViewedMark); |
| 216 | let changed = g::t(lang, K::ChangedSinceViewed); | 216 | let changed = g::t(lang, K::ChangedSinceViewed); |
| 217 | - let hint = g::t(lang, K::ViewedHint); | ||
| 218 | let viewed_files = g::t(lang, K::ViewedFiles); | 217 | let viewed_files = g::t(lang, K::ViewedFiles); |
| 219 | let heading = passkeys::s(lang, "Files", "Dosyalar"); | 218 | let heading = passkeys::s(lang, "Files", "Dosyalar"); |
| 220 | Ok(view! { | 219 | Ok(view! { |
| 221 | <nav class="rail" aria-label=(viewed_files)> | 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 | <div class="rail-list"> | 222 | <div class="rail-list"> |
| 224 | for file in rows.into_iter() { | 223 | for file in rows.into_iter() { |
| 225 | <div class=(file.class.as_str()) data-viewed-row="" data-state=(file.state.name()) data-label=(file.label.as_str())> | 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 | let comment = g::t(lang, K::CommentChoice).trim(); | 358 | let comment = g::t(lang, K::CommentChoice).trim(); |
| 360 | let approve = review_strings::t(lang, review_strings::K::ApproveChoice).trim(); | 359 | let approve = review_strings::t(lang, review_strings::K::ApproveChoice).trim(); |
| 361 | let changes = review_strings::t(lang, review_strings::K::RequestChangesChoice).trim(); | 360 | let changes = review_strings::t(lang, review_strings::K::RequestChangesChoice).trim(); |
| 362 | - let placeholder = passkeys::s(lang, "Optional", "İsteğe bağlı"); | ||
| 363 | let next_text = passkeys::s(lang, "Next file", "Sonraki dosya"); | 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 | let threads_text = match lang { | 362 | let threads_text = match lang { |
| 372 | Lang::Tr => format!("{open_threads} açık konu"), | 363 | Lang::Tr => format!("{open_threads} açık konu"), |
| 373 | Lang::En if open_threads == 1 => "1 open thread".to_owned(), | 364 | Lang::En if open_threads == 1 => "1 open thread".to_owned(), |
| @@ -388,14 +379,14 @@ async fn review_bar( | |||
| 388 | <input type="hidden" name="csrf" value=(csrf.as_str())> | 379 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 389 | <div class="field"> | 380 | <div class="field"> |
| 390 | <label for="review-body">(summary)</label> | 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 | </div> | 383 | </div> |
| 393 | // An author cannot approve or block their own pull, so they only comment. | 384 | // An author cannot approve or block their own pull, so they only comment. |
| 394 | if !is_author { | 385 | if !is_author { |
| 395 | - <label class="opt"><input type="radio" name="state" value="approve"><span>(approve)<small>(approve_hint)</small></span></label> | 386 | + <label class="opt"><input type="radio" name="state" value="approve"><span>(approve)</span></label> |
| 396 | - <label class="opt"><input type="radio" name="state" value="request_changes"><span>(changes)<small>(changes_hint)</small></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 | <div class="acts decide-send"> | 390 | <div class="acts decide-send"> |
| 400 | <button type="submit" class="primary">(submit)</button> | 391 | <button type="submit" class="primary">(submit)</button> |
| 401 | <span class="hint">(pending_text.as_str())</span> | 392 | <span class="hint">(pending_text.as_str())</span> |
crates/forge-web/src/pages/pull_view.rsmodified+43 -53
| @@ -17,7 +17,7 @@ use topcoat::router::content::Form; | |||
| 17 | use topcoat::router::error::{not_found, see_other}; | 17 | use topcoat::router::error::{not_found, see_other}; |
| 18 | use topcoat::router::request::uri; | 18 | use topcoat::router::request::uri; |
| 19 | use topcoat::router::{page, path_param}; | 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 | use crate::auth::require_user; | 22 | use crate::auth::require_user; |
| 23 | use crate::i18n::pulls_review::{self as g, K}; | 23 | use crate::i18n::pulls_review::{self as g, K}; |
| @@ -26,8 +26,8 @@ use crate::pages::commits::{CommitRow, now_secs}; | |||
| 26 | use crate::pages::issue_meta::item_href; | 26 | use crate::pages::issue_meta::item_href; |
| 27 | use crate::pages::issue_parts::{ | 27 | use crate::pages::issue_parts::{ |
| 28 | CommentForm, ItemKind, Posted, When, check_write, comment_form, csrf_of, discussion_timeline, | 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, | 29 | + item_head_tools, item_sidebar, load_discussion, load_sidebar, lock_message, may_change, |
| 30 | - parse_number, post_comment, reachable_among, triage, viewer, | 30 | + may_converse, parse_number, post_comment, reachable_among, triage, viewer, |
| 31 | }; | 31 | }; |
| 32 | use crate::pages::notifications::notify_box_for; | 32 | use crate::pages::notifications::notify_box_for; |
| 33 | use crate::pages::pull_branch::{self, branch_box, branch_error_from}; | 33 | use crate::pages::pull_branch::{self, branch_box, branch_error_from}; |
| @@ -191,7 +191,11 @@ pub(crate) async fn frame_in( | |||
| 191 | /// The head of every pull request tab: the title with the review buttons beside it, the byline, | 191 | /// The head of every pull request tab: the title with the review buttons beside it, the byline, |
| 192 | /// then the pull request's tabs. `active` names the tab that is open. | 192 | /// then the pull request's tabs. `active` names the tab that is open. |
| 193 | #[component] | 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 | let Frame { | 199 | let Frame { |
| 196 | title, | 200 | title, |
| 197 | number, | 201 | number, |
| @@ -235,6 +239,7 @@ pub(crate) async fn pull_header(frame: Frame, active: String) -> Result<impl Vie | |||
| 235 | <section class="head" data-live=(live_url.as_str())> | 239 | <section class="head" data-live=(live_url.as_str())> |
| 236 | <div class="head-title"> | 240 | <div class="head-title"> |
| 237 | <h1>(title.as_str()) " " <span class="num">(number_label.as_str())</span></h1> | 241 | <h1>(title.as_str()) " " <span class="num">(number_label.as_str())</span></h1> |
| 242 | + (child) | ||
| 238 | </div> | 243 | </div> |
| 239 | <p class="head-sub"> | 244 | <p class="head-sub"> |
| 240 | <span class=(state_class)>(state_text)</span> | 245 | <span class=(state_class)>(state_text)</span> |
| @@ -315,7 +320,6 @@ async fn merge_box( | |||
| 315 | headline: String, | 320 | headline: String, |
| 316 | tone: String, | 321 | tone: String, |
| 317 | conflicts: Vec<String>, | 322 | conflicts: Vec<String>, |
| 318 | - reload: Option<String>, | ||
| 319 | form: Option<MergeForm>, | 323 | form: Option<MergeForm>, |
| 320 | merge_error: Option<String>, | 324 | merge_error: Option<String>, |
| 321 | approvals: Option<String>, | 325 | approvals: Option<String>, |
| @@ -326,13 +330,11 @@ async fn merge_box( | |||
| 326 | lang: Lang, | 330 | lang: Lang, |
| 327 | ) -> Result<impl View> { | 331 | ) -> Result<impl View> { |
| 328 | let class = format!("sec merge-{tone}"); | 332 | let class = format!("sec merge-{tone}"); |
| 329 | - let heading = crate::pages::passkeys::s(lang, "Merge", "Birleştirme"); | ||
| 330 | let required_heading = g::t(lang, K::RequiredChecksHeading); | 333 | let required_heading = g::t(lang, K::RequiredChecksHeading); |
| 331 | let style_rebase = g::t(lang, K::StyleRebase); | 334 | let style_rebase = g::t(lang, K::StyleRebase); |
| 332 | let style_merge_option = g::t(lang, K::StyleMergeCommit); | 335 | let style_merge_option = g::t(lang, K::StyleMergeCommit); |
| 333 | let style_squash_option = g::t(lang, K::StyleSquash); | 336 | let style_squash_option = g::t(lang, K::StyleSquash); |
| 334 | let enable_auto = g::t(lang, K::EnableAutoMerge); | 337 | let enable_auto = g::t(lang, K::EnableAutoMerge); |
| 335 | - let auto_hint = g::t(lang, K::AutoMergeHint); | ||
| 336 | let disable_auto = g::t(lang, K::DisableAutoMerge); | 338 | let disable_auto = g::t(lang, K::DisableAutoMerge); |
| 337 | let FlowView { | 339 | let FlowView { |
| 338 | csrf: flow_csrf, | 340 | csrf: flow_csrf, |
| @@ -346,8 +348,6 @@ async fn merge_box( | |||
| 346 | crate::i18n::merge_queue::t(lang, crate::i18n::merge_queue::K::AddToMergeQueue); | 348 | crate::i18n::merge_queue::t(lang, crate::i18n::merge_queue::K::AddToMergeQueue); |
| 347 | let queue_remove_label = | 349 | let queue_remove_label = |
| 348 | crate::i18n::merge_queue::t(lang, crate::i18n::merge_queue::K::RemoveFromQueue); | 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 | let style_legend = g::t(lang, K::MergeStyleLegend); | 351 | let style_legend = g::t(lang, K::MergeStyleLegend); |
| 352 | let style_merge = g::t(lang, K::StyleMergeCommit); | 352 | let style_merge = g::t(lang, K::StyleMergeCommit); |
| 353 | let style_squash = g::t(lang, K::StyleSquash); | 353 | let style_squash = g::t(lang, K::StyleSquash); |
| @@ -356,27 +356,28 @@ async fn merge_box( | |||
| 356 | let merge_button = g::t(lang, K::MergeButton); | 356 | let merge_button = g::t(lang, K::MergeButton); |
| 357 | Ok(view! { | 357 | Ok(view! { |
| 358 | <section class=(class.as_str())> | 358 | <section class=(class.as_str())> |
| 359 | - <h2>(heading)</h2> | ||
| 360 | if let Some(text) = merge_error { | 359 | if let Some(text) = merge_error { |
| 361 | <p class="alert merge-error" role="alert">(text.as_str())</p> | 360 | <p class="alert merge-error" role="alert">(text.as_str())</p> |
| 362 | } | 361 | } |
| 363 | - <p class="state merge-headline">(headline.as_str())</p> | 362 | + <div class="line merge-state"> |
| 363 | + <span class="val merge-headline">(headline.as_str())</span> | ||
| 364 | if let Some(summary) = checks { | 364 | if let Some(summary) = checks { |
| 365 | checks_summary(summary: summary, lang: StatusLang(lang)) | 365 | checks_summary(summary: summary, lang: StatusLang(lang)) |
| 366 | } | 366 | } |
| 367 | + </div> | ||
| 367 | if !required.is_empty() { | 368 | if !required.is_empty() { |
| 368 | <div> | 369 | <div> |
| 369 | - <p class="hint">(required_heading)</p> | 370 | + <p class="state">(required_heading)</p> |
| 370 | for row in required.iter() { | 371 | for row in required.iter() { |
| 371 | <div class=(format!("line {}", row.class))><span class="name"><code>(row.context.as_str())</code></span><span class="val">(row.label)</span></div> | 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 | </div> | 374 | </div> |
| 374 | } | 375 | } |
| 375 | if let Some(text) = approvals { | 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 | if let Some(text) = blocked { | 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 | if !conflicts.is_empty() { | 382 | if !conflicts.is_empty() { |
| 382 | <div> | 383 | <div> |
| @@ -385,11 +386,6 @@ async fn merge_box( | |||
| 385 | } | 386 | } |
| 386 | </div> | 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 | if let Some(f) = form { | 389 | if let Some(f) = form { |
| 394 | <form method="post" action=(f.action.as_str()) class="fields merge-form"> | 390 | <form method="post" action=(f.action.as_str()) class="fields merge-form"> |
| 395 | <input type="hidden" name="csrf" value=(f.csrf.as_str())> | 391 | <input type="hidden" name="csrf" value=(f.csrf.as_str())> |
| @@ -413,15 +409,14 @@ async fn merge_box( | |||
| 413 | </form> | 409 | </form> |
| 414 | } | 410 | } |
| 415 | if let Some((text, action)) = queue_position { | 411 | if let Some((text, action)) = queue_position { |
| 416 | - <p class="state">(text.as_str())</p> | 412 | + <div class="line"> |
| 417 | - <div class="acts"> | 413 | + <span class="val">(text.as_str())</span> |
| 418 | confirm_act(lang: lang, label: queue_remove_label, action: action.as_str(), csrf: flow_csrf.as_str()) | 414 | confirm_act(lang: lang, label: queue_remove_label, action: action.as_str(), csrf: flow_csrf.as_str()) |
| 419 | </div> | 415 | </div> |
| 420 | } | 416 | } |
| 421 | if let Some(action) = queue_add { | 417 | if let Some(action) = queue_add { |
| 422 | <form method="post" action=(action.as_str()) class="fields"> | 418 | <form method="post" action=(action.as_str()) class="fields"> |
| 423 | <input type="hidden" name="csrf" value=(flow_csrf.as_str())> | 419 | <input type="hidden" name="csrf" value=(flow_csrf.as_str())> |
| 424 | - <p class="hint">(queue_hint)</p> | ||
| 425 | <div class="field"> | 420 | <div class="field"> |
| 426 | <label for="queue-style">(queue_add_label)</label> | 421 | <label for="queue-style">(queue_add_label)</label> |
| 427 | <select id="queue-style" name="style"> | 422 | <select id="queue-style" name="style"> |
| @@ -434,15 +429,14 @@ async fn merge_box( | |||
| 434 | </form> | 429 | </form> |
| 435 | } | 430 | } |
| 436 | if let Some((text, action)) = auto_on { | 431 | if let Some((text, action)) = auto_on { |
| 437 | - <p class="state">(text.as_str())</p> | 432 | + <div class="line"> |
| 438 | - <div class="acts"> | 433 | + <span class="val">(text.as_str())</span> |
| 439 | post_act(label: disable_auto, action: action.as_str(), csrf: flow_csrf.as_str()) | 434 | post_act(label: disable_auto, action: action.as_str(), csrf: flow_csrf.as_str()) |
| 440 | </div> | 435 | </div> |
| 441 | } | 436 | } |
| 442 | if let Some(action) = auto_enable { | 437 | if let Some(action) = auto_enable { |
| 443 | <form method="post" action=(action.as_str()) class="fields"> | 438 | <form method="post" action=(action.as_str()) class="fields"> |
| 444 | <input type="hidden" name="csrf" value=(flow_csrf.as_str())> | 439 | <input type="hidden" name="csrf" value=(flow_csrf.as_str())> |
| 445 | - <p class="hint">(auto_hint)</p> | ||
| 446 | <div class="field"> | 440 | <div class="field"> |
| 447 | <label for="auto-style">(enable_auto)</label> | 441 | <label for="auto-style">(enable_auto)</label> |
| 448 | <select id="auto-style" name="style"> | 442 | <select id="auto-style" name="style"> |
| @@ -455,7 +449,7 @@ async fn merge_box( | |||
| 455 | </form> | 449 | </form> |
| 456 | } | 450 | } |
| 457 | if let Some((action, label)) = draft_toggle { | 451 | if let Some((action, label)) = draft_toggle { |
| 458 | - <div class="acts"> | 452 | + <div class="line"> |
| 459 | post_act(label: label, action: action.as_str(), csrf: flow_csrf.as_str()) | 453 | post_act(label: label, action: action.as_str(), csrf: flow_csrf.as_str()) |
| 460 | </div> | 454 | </div> |
| 461 | } | 455 | } |
| @@ -524,7 +518,7 @@ async fn review_box( | |||
| 524 | <p class="state">(text.as_str())</p> | 518 | <p class="state">(text.as_str())</p> |
| 525 | } | 519 | } |
| 526 | if let Some(text) = approved_before { | 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 | if let Some(text) = changes { | 523 | if let Some(text) = changes { |
| 530 | <p class="state">(text.as_str())</p> | 524 | <p class="state">(text.as_str())</p> |
| @@ -640,7 +634,7 @@ async fn pull_conversation( | |||
| 640 | .await?; | 634 | .await?; |
| 641 | let sidebar = load_sidebar(state, &ctx.repo.id, &pr.issue).await?; | 635 | let sidebar = load_sidebar(state, &ctx.repo.id, &pr.issue).await?; |
| 642 | let viewer_login = ctx.viewer.as_ref().map(|(u, _)| u.username.clone()); | 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 | let reviewers = load_reviewers(cx, state, &ctx, &pr.issue, &href).await?; | 638 | let reviewers = load_reviewers(cx, state, &ctx, &pr.issue, &href).await?; |
| 645 | let csrf = csrf_of(&ctx); | 639 | let csrf = csrf_of(&ctx); |
| 646 | let checks = head_checks(state, &ctx, &pr).await?; | 640 | let checks = head_checks(state, &ctx, &pr).await?; |
| @@ -655,32 +649,27 @@ async fn pull_conversation( | |||
| 655 | let write_meta = !archived && triage(&ctx); | 649 | let write_meta = !archived && triage(&ctx); |
| 656 | let comment_action = format!("{href}/comments"); | 650 | let comment_action = format!("{href}/comments"); |
| 657 | let state_action = format!("{href}/state"); | 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 | let login_href = "/login".to_owned(); | 654 | let login_href = "/login".to_owned(); |
| 659 | let archived_text = g::t(lang, K::ArchivedReadOnly); | 655 | let archived_text = g::t(lang, K::ArchivedReadOnly); |
| 660 | let login_before = g::t(lang, K::LoginBefore); | 656 | let login_before = g::t(lang, K::LoginBefore); |
| 661 | let login_link = g::t(lang, K::LoginLink); | 657 | let login_link = g::t(lang, K::LoginLink); |
| 662 | let login_after = g::t(lang, K::LoginAfter); | 658 | let login_after = g::t(lang, K::LoginAfter); |
| 663 | 659 | ||
| 664 | - let (headline, tone, conflicts, reload) = match pr.mergeable { | 660 | + // A result still being computed arrives on the page's live stream (`refresh_mergeability` |
| 665 | - Mergeable::Clean => (g::t(lang, K::MergeClean).to_owned(), "ok", Vec::new(), None), | 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 | Mergeable::Conflict => ( | 664 | Mergeable::Conflict => ( |
| 667 | g::t(lang, K::MergeConflict).to_owned(), | 665 | g::t(lang, K::MergeConflict).to_owned(), |
| 668 | "bad", | 666 | "bad", |
| 669 | pr.conflict_files.clone(), | 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 | let can_write = !archived | 674 | let can_write = !archived |
| 686 | && authorize( | 675 | && authorize( |
| @@ -914,7 +903,9 @@ async fn pull_conversation( | |||
| 914 | let live = format!("{href}/events"); | 903 | let live = format!("{href}/events"); |
| 915 | Ok(view! { cx => | 904 | Ok(view! { cx => |
| 916 | shell(title: page_title.as_str(), viewer: ctx.viewer.as_ref(), extra_stylesheet: Some(labels_href.as_str()), | 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 | if let Some(message) = review_error { | 909 | if let Some(message) = review_error { |
| 919 | alert(message: message) | 910 | alert(message: message) |
| 920 | } | 911 | } |
| @@ -926,7 +917,7 @@ async fn pull_conversation( | |||
| 926 | } | 917 | } |
| 927 | if open { | 918 | if open { |
| 928 | merge_box(headline: headline, tone: tone.to_owned(), conflicts: conflicts, | 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 | approvals: approvals, blocked: blocked, checks: checks, | 921 | approvals: approvals, blocked: blocked, checks: checks, |
| 931 | required: required, flow: flow, lang: lang) | 922 | required: required, flow: flow, lang: lang) |
| 932 | } | 923 | } |
| @@ -938,19 +929,18 @@ async fn pull_conversation( | |||
| 938 | branch_box(lang: lang, action: branch, error: branch_error) | 929 | branch_box(lang: lang, action: branch, error: branch_error) |
| 939 | } | 930 | } |
| 940 | if can_comment { | 931 | if can_comment { |
| 941 | - comment_form(lang: lang, action: comment_action, state_action: state_action, | 932 | + comment_form(lang: lang, action: comment_action, csrf: csrf.clone(), draft: draft, error: error) |
| 942 | - csrf: csrf.clone(), draft: draft, error: error, can_close: can_close, open: open) | ||
| 943 | } | 933 | } |
| 944 | // What the pull request is filed under comes after the conversation, as on an issue. | 934 | // What the pull request is filed under comes after the conversation, as on an issue. |
| 945 | reviewers_box(lang: lang, reviewers: reviewers) | 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 | if archived { | 937 | if archived { |
| 948 | - <p class="hint">(archived_text)</p> | 938 | + <p class="state">(archived_text)</p> |
| 949 | } | 939 | } |
| 950 | if locked_for_viewer { | 940 | if locked_for_viewer { |
| 951 | - <p class="hint">(lock_notice.as_str())</p> | 941 | + <p class="state">(lock_notice.as_str())</p> |
| 952 | } else if !signed_in { | 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 | </div> | 945 | </div> |
| 956 | ) | 946 | ) |
| @@ -1314,7 +1304,7 @@ mod tests { | |||
| 1314 | assert!(body.contains("Add feature"), "clean: {body}"); | 1304 | assert!(body.contains("Add feature"), "clean: {body}"); |
| 1315 | assert!(body.contains("issue-badge-open\">Open<"), "clean: {body}"); | 1305 | assert!(body.contains("issue-badge-open\">Open<"), "clean: {body}"); |
| 1316 | assert!( | 1306 | assert!( |
| 1317 | - body.contains("This branch has no conflicts with the base branch"), | 1307 | + body.contains("Ready to merge"), |
| 1318 | "clean: {body}" | 1308 | "clean: {body}" |
| 1319 | ); | 1309 | ); |
| 1320 | assert!( | 1310 | assert!( |
| @@ -1333,7 +1323,7 @@ mod tests { | |||
| 1333 | let (status, _, body) = send(&fx.router, "GET", &uri, Some("bob-token"), None).await; | 1323 | let (status, _, body) = send(&fx.router, "GET", &uri, Some("bob-token"), None).await; |
| 1334 | assert_eq!(status, 200, "reader"); | 1324 | assert_eq!(status, 200, "reader"); |
| 1335 | assert!( | 1325 | assert!( |
| 1336 | - body.contains("This branch has no conflicts with the base branch"), | 1326 | + body.contains("Ready to merge"), |
| 1337 | "reader: {body}" | 1327 | "reader: {body}" |
| 1338 | ); | 1328 | ); |
| 1339 | assert!(!body.contains("name=\"style\""), "reader: {body}"); | 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 | </div> | 333 | </div> |
| 334 | </form> | 334 | </form> |
| 335 | if has_filters { | 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 | if rows.is_empty() { | 338 | if rows.is_empty() { |
| 339 | <p class="state">(empty_text)</p> | 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 | use crate::pages::settings_security::mail_can_send; | 26 | use crate::pages::settings_security::mail_can_send; |
| 27 | use crate::state::AppState; | 27 | use crate::state::AppState; |
| 28 | use crate::throttle; | 28 | use crate::throttle; |
| 29 | -use crate::views::parts::{SubPart, head}; | 29 | +use crate::views::parts::head; |
| 30 | use crate::views::{alert, shell, user_facing_message}; | 30 | use crate::views::{alert, shell, user_facing_message}; |
| 31 | 31 | ||
| 32 | const MIN_PASSWORD_CHARS: usize = 12; | 32 | const MIN_PASSWORD_CHARS: usize = 12; |
| @@ -129,13 +129,8 @@ async fn register_form( | |||
| 129 | precsrf: &str, | 129 | precsrf: &str, |
| 130 | error: Option<String>, | 130 | error: Option<String>, |
| 131 | ) -> Result<impl View> { | 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 | Ok(view! { | 132 | Ok(view! { |
| 138 | - head(title: t(lang, Key::RegisterTitle), sub: sub) | 133 | + head(title: t(lang, Key::RegisterTitle)) |
| 139 | <div class="sheet fit"> | 134 | <div class="sheet fit"> |
| 140 | if gate == Gate::NeedsInvite { | 135 | if gate == Gate::NeedsInvite { |
| 141 | <p class="state">(t(lang, Key::RegisterNeedsInvite))</p> | 136 | <p class="state">(t(lang, Key::RegisterNeedsInvite))</p> |
| @@ -353,13 +348,8 @@ async fn verify_body( | |||
| 353 | precsrf: &str, | 348 | precsrf: &str, |
| 354 | mode: VerifyMode, | 349 | mode: VerifyMode, |
| 355 | ) -> Result<impl View> { | 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 | Ok(view! { | 351 | Ok(view! { |
| 362 | - head(title: t(lang, Key::VerifyTitle), sub: sub) | 352 | + head(title: t(lang, Key::VerifyTitle)) |
| 363 | <div class="sheet fit"> | 353 | <div class="sheet fit"> |
| 364 | if mode == VerifyMode::Confirm { | 354 | if mode == VerifyMode::Confirm { |
| 365 | <form data-hard="true" method="post" action=(format!("/verify/{token}")) class="sec"> | 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 | branches: Vec<String>, | 353 | branches: Vec<String>, |
| 354 | submit: &'static str, | 354 | submit: &'static str, |
| 355 | ) -> Result<impl View> { | 355 | ) -> Result<impl View> { |
| 356 | - let tag_hint = g::t(lang, K::TagHint); | ||
| 357 | - let edit_tag_help = g::t(lang, K::EditTagHelp); | ||
| 358 | Ok(view! { | 356 | Ok(view! { |
| 359 | <form method="post" action=(action.as_str()) class="fields release-form"> | 357 | <form method="post" action=(action.as_str()) class="fields release-form"> |
| 360 | if let Some(message) = draft.error { | 358 | if let Some(message) = draft.error { |
| @@ -365,7 +363,6 @@ async fn release_form( | |||
| 365 | <div class="field"> | 363 | <div class="field"> |
| 366 | <label for="release-tag">(g::t(lang, K::Tag))</label> | 364 | <label for="release-tag">(g::t(lang, K::Tag))</label> |
| 367 | <input id="release-tag" type="text" name="tag" value=(draft.tag.as_str()) required="required" maxlength="100" autocomplete="off" spellcheck="false"> | 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 | </div> | 366 | </div> |
| 370 | <div class="field"> | 367 | <div class="field"> |
| 371 | <label for="release-target">(g::t(lang, K::TargetBranch))</label> | 368 | <label for="release-target">(g::t(lang, K::TargetBranch))</label> |
| @@ -374,13 +371,11 @@ async fn release_form( | |||
| 374 | <option value=(branch.as_str()) selected=(branch.as_str() == draft.target.as_str())>(branch.as_str())</option> | 371 | <option value=(branch.as_str()) selected=(branch.as_str() == draft.target.as_str())>(branch.as_str())</option> |
| 375 | } | 372 | } |
| 376 | </select> | 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 | </div> | 374 | </div> |
| 379 | } else { | 375 | } else { |
| 380 | <div class="field"> | 376 | <div class="field"> |
| 381 | <label for="release-tag">(g::t(lang, K::Tag))</label> | 377 | <label for="release-tag">(g::t(lang, K::Tag))</label> |
| 382 | <input id="release-tag" type="text" name="tag" value=(draft.tag.as_str()) required="required" maxlength="100" autocomplete="off" spellcheck="false"> | 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 | </div> | 379 | </div> |
| 385 | if move_target { | 380 | if move_target { |
| 386 | <div class="field"> | 381 | <div class="field"> |
| @@ -391,10 +386,7 @@ async fn release_form( | |||
| 391 | <option value=(branch.as_str()) selected=(branch.as_str() == draft.target.as_str())>(branch.as_str())</option> | 386 | <option value=(branch.as_str()) selected=(branch.as_str() == draft.target.as_str())>(branch.as_str())</option> |
| 392 | } | 387 | } |
| 393 | </select> | 388 | </select> |
| 394 | - <p class="hint">(g::t(lang, K::TargetMoveHelp))</p> | ||
| 395 | </div> | 389 | </div> |
| 396 | - } else { | ||
| 397 | - <p class="hint">(g::t(lang, K::TargetLockedHelp))</p> | ||
| 398 | } | 390 | } |
| 399 | } | 391 | } |
| 400 | <div class="field"> | 392 | <div class="field"> |
| @@ -859,7 +851,7 @@ async fn release_tag_page(cx: &Cx) -> Result<impl View> { | |||
| 859 | if writer { | 851 | if writer { |
| 860 | <section class="sec"> | 852 | <section class="sec"> |
| 861 | confirm_act(lang: lang, label: g::t(lang, K::DeleteRelease), action: delete_href.as_str(), csrf: csrf.as_str(), | 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 | </section> | 855 | </section> |
| 864 | } | 856 | } |
| 865 | </div> | 857 | </div> |
| @@ -918,7 +910,6 @@ async fn edit_body( | |||
| 918 | </section> | 910 | </section> |
| 919 | <section class="sec"> | 911 | <section class="sec"> |
| 920 | <h2>(g::t(lang, K::DeleteRelease))</h2> | 912 | <h2>(g::t(lang, K::DeleteRelease))</h2> |
| 921 | - <p class="hint">(g::t(lang, K::DeleteReleaseHelp))</p> | ||
| 922 | <div class="acts"> | 913 | <div class="acts"> |
| 923 | confirm_act(lang: lang, label: g::t(lang, K::DeleteRelease), action: delete_href.as_str(), csrf: csrf.as_str(), | 914 | confirm_act(lang: lang, label: g::t(lang, K::DeleteRelease), action: delete_href.as_str(), csrf: csrf.as_str(), |
| 924 | fields: vec![("confirm".to_owned(), "on".to_owned())]) | 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 | !html.contains("name=\"target\""), | 668 | !html.contains("name=\"target\""), |
| 669 | "published hides the target" | 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 | // A published release can be retagged through the form and keeps its commit. | 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 | <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> | 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 | <label for="clone-ssh">"SSH"</label> | 244 | <label for="clone-ssh">"SSH"</label> |
| 245 | <input id="clone-ssh" class="mono" type="text" readonly=(true) value=(ssh.as_str())> | 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 | if let Some((zip, tar)) = downloads { | 246 | if let Some((zip, tar)) = downloads { |
| 248 | <nav class="sub" aria-label=(g::t(lang, K::DownloadNav))> | 247 | <nav class="sub" aria-label=(g::t(lang, K::DownloadNav))> |
| 249 | <a href=(zip)>(g::t(lang, K::DownloadZip))</a> | 248 | <a href=(zip)>(g::t(lang, K::DownloadZip))</a> |
| @@ -711,7 +710,7 @@ mod tests { | |||
| 711 | assert!(body.contains("default"), "default branch marked"); | 710 | assert!(body.contains("default"), "default branch marked"); |
| 712 | let (status, body) = get(&router, "/tahinli/demo/tags").await; | 711 | let (status, body) = get(&router, "/tahinli/demo/tags").await; |
| 713 | assert_eq!(status, 200); | 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 | let (status, body) = get(&router, "/tahinli/demo/tree/main").await; | 714 | let (status, body) = get(&router, "/tahinli/demo/tree/main").await; |
| 716 | assert_eq!(status, 200); | 715 | assert_eq!(status, 200); |
| 717 | assert!(body.contains("README.md")); | 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 | use crate::pages::repo_settings::settings_frame; | 31 | use crate::pages::repo_settings::settings_frame; |
| 32 | use crate::pages::repo_settings_live::settings_head; | 32 | use crate::pages::repo_settings_live::settings_head; |
| 33 | use crate::state::AppState; | 33 | use crate::state::AppState; |
| 34 | -use crate::views::parts::{confirm_act, reveal}; | 34 | +use crate::views::parts::{PeopleList, PersonRow, people_list}; |
| 35 | use crate::views::{alert, avatar_url, display_name, shell}; | 35 | use crate::views::{alert, avatar_url, display_name, shell}; |
| 36 | 36 | ||
| 37 | path_param!(owner); | 37 | path_param!(owner); |
| @@ -62,15 +62,6 @@ const ROLES: [Role; 5] = [ | |||
| 62 | Role::Admin, | 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 | #[derive(Deserialize)] | 65 | #[derive(Deserialize)] |
| 75 | struct AddForm { | 66 | struct AddForm { |
| 76 | #[serde(default)] | 67 | #[serde(default)] |
| @@ -99,16 +90,6 @@ struct RemoveForm { | |||
| 99 | user_id: String, | 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 | /// Sets the notice shown on the next collaborators page view. | 93 | /// Sets the notice shown on the next collaborators page view. |
| 113 | fn set_notice(cx: &Cx, word: &'static str) { | 94 | fn set_notice(cx: &Cx, word: &'static str) { |
| 114 | cookies(cx).add( | 95 | cookies(cx).add( |
| @@ -157,94 +138,6 @@ fn collaborators_redirect(title: &str) -> SeeOther { | |||
| 157 | see_other(format!("/{title}/settings/collaborators")) | 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 | /// Everything the collaborators page shows besides the repo header. | 141 | /// Everything the collaborators page shows besides the repo header. |
| 249 | struct FrameData { | 142 | struct FrameData { |
| 250 | page_title: String, | 143 | page_title: String, |
| @@ -268,7 +161,7 @@ impl FrameData { | |||
| 268 | async fn collaborators_body( | 161 | async fn collaborators_body( |
| 269 | lang: Lang, | 162 | lang: Lang, |
| 270 | frame: FrameData, | 163 | frame: FrameData, |
| 271 | - rows: Vec<CollabRow>, | 164 | + rows: Vec<PersonRow>, |
| 272 | csrf: String, | 165 | csrf: String, |
| 273 | notice: Option<(K, bool)>, | 166 | notice: Option<(K, bool)>, |
| 274 | ) -> Result<impl View> { | 167 | ) -> Result<impl View> { |
| @@ -280,11 +173,47 @@ async fn collaborators_body( | |||
| 280 | // A refused add (or role change) reopens the add panel; a missing collaborator does not. | 173 | // A refused add (or role change) reopens the add panel; a missing collaborator does not. |
| 281 | let add_open = matches!(notice, Some((key, true)) if !matches!(key, K::NotCollaborator)); | 174 | let add_open = matches!(notice, Some((key, true)) if !matches!(key, K::NotCollaborator)); |
| 282 | let notice = notice.map(|(key, is_error)| (g::t(lang, key), is_error)); | 175 | let notice = notice.map(|(key, is_error)| (g::t(lang, key), is_error)); |
| 283 | - let can_delete = header.can_delete; | ||
| 284 | let section_name = g::t(lang, K::Collaborators).to_owned(); | 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 | Ok(view! { | 214 | Ok(view! { |
| 286 | repo_head(head: header, title: Some(section_name)) | 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 | if let Some((text, is_error)) = notice { | 217 | if let Some((text, is_error)) = notice { |
| 289 | if is_error { | 218 | if is_error { |
| 290 | alert(message: text) | 219 | alert(message: text) |
| @@ -292,8 +221,7 @@ async fn collaborators_body( | |||
| 292 | <p class="state" role="status">(text)</p> | 221 | <p class="state" role="status">(text)</p> |
| 293 | } | 222 | } |
| 294 | } | 223 | } |
| 295 | - collaborators_pane(lang: lang, rows: rows, role_action: role_action, | 224 | + people_list(list: list) |
| 296 | - remove_action: remove_action, add_action: add_action, csrf: csrf, add_open: add_open) | ||
| 297 | ) | 225 | ) |
| 298 | }) | 226 | }) |
| 299 | } | 227 | } |
| @@ -312,14 +240,26 @@ async fn collaborators_page(cx: &Cx) -> Result<impl View> { | |||
| 312 | let lang = i18n::lang(cx, Some(&user)); | 240 | let lang = i18n::lang(cx, Some(&user)); |
| 313 | let state = app_context::<AppState>(cx); | 241 | let state = app_context::<AppState>(cx); |
| 314 | let collaborators = state.store.list_collaborators(&ctx.repo.id).await?; | 242 | let collaborators = state.store.list_collaborators(&ctx.repo.id).await?; |
| 243 | + let viewer_id = user.id.clone(); | ||
| 315 | let rows = collaborators | 244 | let rows = collaborators |
| 316 | .into_iter() | 245 | .into_iter() |
| 317 | - .map(|(user, role)| CollabRow { | 246 | + .map(|(member, role)| { |
| 318 | - user_id: user.id.clone(), | 247 | + let is_self = member.id == viewer_id; |
| 319 | - avatar: avatar_url(&user.username, user.avatar_hash.as_deref()), | 248 | + PersonRow { |
| 320 | - label: display_name(lang, &user.username), | 249 | + user_id: member.id.clone(), |
| 321 | - username: user.username, | 250 | + avatar: avatar_url(&member.username, member.avatar_hash.as_deref()), |
| 322 | - role, | 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 | .collect(); | 264 | .collect(); |
| 325 | let notice = take_notice(cx); | 265 | let notice = take_notice(cx); |
crates/forge-web/src/pages/repo_ctx.rsmodified+0 -3
| @@ -62,8 +62,6 @@ pub struct RepoHead { | |||
| 62 | pub active: &'static str, | 62 | pub active: &'static str, |
| 63 | /// Whether the viewer may open the Settings tab. | 63 | /// Whether the viewer may open the Settings tab. |
| 64 | pub can_admin: bool, | 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 | /// Open issues, for the Issues tab count. | 65 | /// Open issues, for the Issues tab count. |
| 68 | pub open_issues: u64, | 66 | pub open_issues: u64, |
| 69 | /// Open pull requests, for the Pull requests tab count. | 67 | /// Open pull requests, for the Pull requests tab count. |
| @@ -258,7 +256,6 @@ impl RepoCtx { | |||
| 258 | archived: self.repo.archived, | 256 | archived: self.repo.archived, |
| 259 | active, | 257 | active, |
| 260 | can_admin: self.can_admin(), | 258 | can_admin: self.can_admin(), |
| 261 | - can_delete: self.can_delete(), | ||
| 262 | open_issues: self.open_issues(state).await?, | 259 | open_issues: self.open_issues(state).await?, |
| 263 | open_pulls, | 260 | open_pulls, |
| 264 | forked_from, | 261 | forked_from, |
crates/forge-web/src/pages/repo_mirrors.rsmodified+3 -31
| @@ -399,10 +399,9 @@ async fn frame_top( | |||
| 399 | lang: Lang, | 399 | lang: Lang, |
| 400 | #[default] child: Child<'_>, | 400 | #[default] child: Child<'_>, |
| 401 | ) -> Result<impl View> { | 401 | ) -> Result<impl View> { |
| 402 | - let can_delete = head.can_delete; | ||
| 403 | Ok(view! { | 402 | Ok(view! { |
| 404 | repo_head(head: head, title: Some(heading)) | 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 | if let Some((text, is_error)) = notice { | 405 | if let Some((text, is_error)) = notice { |
| 407 | if is_error { | 406 | if is_error { |
| 408 | alert(message: text) | 407 | alert(message: text) |
| @@ -442,16 +441,6 @@ async fn mirror_form( | |||
| 442 | } else { | 441 | } else { |
| 443 | g::t(lang, K::RemoteUrl) | 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 | let url_id = format!("{prefix}-url"); | 444 | let url_id = format!("{prefix}-url"); |
| 456 | let username_id = format!("{prefix}-username"); | 445 | let username_id = format!("{prefix}-username"); |
| 457 | let secret_id = format!("{prefix}-secret"); | 446 | let secret_id = format!("{prefix}-secret"); |
| @@ -471,7 +460,6 @@ async fn mirror_form( | |||
| 471 | <div class="field"> | 460 | <div class="field"> |
| 472 | <label for=(url_id.as_str())>(url_label)</label> | 461 | <label for=(url_id.as_str())>(url_label)</label> |
| 473 | <input id=(url_id.as_str()) type="url" name="url" value=(url.as_str()) autocomplete="off" spellcheck="false" required=(current_url.is_empty())> | 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 | </div> | 463 | </div> |
| 476 | <div class="field"> | 464 | <div class="field"> |
| 477 | <label for=(username_id.as_str())>(g::t(lang, K::UsernameOptional))</label> | 465 | <label for=(username_id.as_str())>(g::t(lang, K::UsernameOptional))</label> |
| @@ -480,7 +468,6 @@ async fn mirror_form( | |||
| 480 | <div class="field"> | 468 | <div class="field"> |
| 481 | <label for=(secret_id.as_str())>(g::t(lang, K::SecretOptional))</label> | 469 | <label for=(secret_id.as_str())>(g::t(lang, K::SecretOptional))</label> |
| 482 | <input id=(secret_id.as_str()) type="password" name="secret" autocomplete="new-password" maxlength="1024"> | 470 | <input id=(secret_id.as_str()) type="password" name="secret" autocomplete="new-password" maxlength="1024"> |
| 483 | - <p class="hint">(secret_hint)</p> | ||
| 484 | </div> | 471 | </div> |
| 485 | if has_secret { | 472 | if has_secret { |
| 486 | <label class="switch"> | 473 | <label class="switch"> |
| @@ -519,7 +506,6 @@ async fn mirrors_list_body( | |||
| 519 | ) -> Result<impl View> { | 506 | ) -> Result<impl View> { |
| 520 | let add_action = mirrors_href(&title); | 507 | let add_action = mirrors_href(&title); |
| 521 | let empty = rows.is_empty(); | 508 | let empty = rows.is_empty(); |
| 522 | - let can_pull = pull_form.is_some(); | ||
| 523 | let pull_open = pull_form.as_ref().is_some_and(|pull| pull.error.is_some()); | 509 | let pull_open = pull_form.as_ref().is_some_and(|pull| pull.error.is_some()); |
| 524 | let push_open = draft.error.is_some(); | 510 | let push_open = draft.error.is_some(); |
| 525 | Ok(view! { | 511 | Ok(view! { |
| @@ -562,10 +548,6 @@ async fn mirrors_list_body( | |||
| 562 | if let Some(pull) = pull_form { | 548 | if let Some(pull) = pull_form { |
| 563 | <section class="sec" id="add-pull-mirror"> | 549 | <section class="sec" id="add-pull-mirror"> |
| 564 | <h2>(g::t(lang, K::AddPullMirror))</h2> | 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 | <div class="acts"> | 551 | <div class="acts"> |
| 570 | reveal(label: g::t(lang, K::AddPullMirror), open: pull_open, | 552 | reveal(label: g::t(lang, K::AddPullMirror), open: pull_open, |
| 571 | mirror_form(action: add_action.clone(), csrf: csrf.clone(), prefix: "pull-mirror", pull: true, current_url: String::new(), | 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 | <section class="sec" id="add-push-mirror"> | 560 | <section class="sec" id="add-push-mirror"> |
| 579 | <h2>(g::t(lang, K::AddPushMirror))</h2> | 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 | <div class="acts"> | 562 | <div class="acts"> |
| 584 | reveal(label: g::t(lang, K::AddPushMirror), open: push_open, | 563 | reveal(label: g::t(lang, K::AddPushMirror), open: push_open, |
| 585 | mirror_form(action: add_action.clone(), csrf: csrf.clone(), prefix: "push-mirror", pull: false, current_url: String::new(), | 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 | let sync_action = format!("{edit_action}/sync"); | 782 | let sync_action = format!("{edit_action}/sync"); |
| 804 | let delete_action = format!("{edit_action}/delete"); | 783 | let delete_action = format!("{edit_action}/delete"); |
| 805 | let pull = mirror.direction == MirrorDirection::Pull; | 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 | let current_url = redacted_url(&mirror.url); | 785 | let current_url = redacted_url(&mirror.url); |
| 812 | let heading = current_url.clone(); | 786 | let heading = current_url.clone(); |
| 813 | Ok(view! { | 787 | Ok(view! { |
| @@ -816,7 +790,7 @@ async fn mirror_body( | |||
| 816 | <section class="sec"> | 790 | <section class="sec"> |
| 817 | <h2>(mirror_kind(lang, mirror.direction))</h2> | 791 | <h2>(mirror_kind(lang, mirror.direction))</h2> |
| 818 | <p class="state"><code>(current_url.as_str())</code></p> | 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 | if let Some(error) = mirror.last_error.clone() { | 794 | if let Some(error) = mirror.last_error.clone() { |
| 821 | <pre class="mirror-error">(error.as_str())</pre> | 795 | <pre class="mirror-error">(error.as_str())</pre> |
| 822 | } | 796 | } |
| @@ -833,16 +807,14 @@ async fn mirror_body( | |||
| 833 | if !archived { | 807 | if !archived { |
| 834 | <section class="sec"> | 808 | <section class="sec"> |
| 835 | <h2>(g::t(lang, K::SyncHeading))</h2> | 809 | <h2>(g::t(lang, K::SyncHeading))</h2> |
| 836 | - <p class="hint">(g::t(lang, K::SyncIntro))</p> | ||
| 837 | <div class="acts"> | 810 | <div class="acts"> |
| 838 | post_act(label: g::t(lang, K::SyncNow), action: sync_action.as_str(), csrf: csrf.as_str()) | 811 | post_act(label: g::t(lang, K::SyncNow), action: sync_action.as_str(), csrf: csrf.as_str()) |
| 839 | </div> | 812 | </div> |
| 840 | </section> | 813 | </section> |
| 841 | <section class="sec"> | 814 | <section class="sec"> |
| 842 | <h2>(g::t(lang, K::DeleteMirror))</h2> | 815 | <h2>(g::t(lang, K::DeleteMirror))</h2> |
| 843 | - <p class="hint">(delete_text)</p> | ||
| 844 | <div class="acts"> | 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 | </div> | 818 | </div> |
| 847 | </section> | 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` | 1 | +//! Rename and transfer, the first two topics of the danger zone (`/{owner}/{repo}/settings?section=danger`, |
| 2 | -//! (owner, instance admin, or an Admin collaborator). Transferring needs `Action::Delete` (owner or | 2 | +//! see `pages::repo_settings`). `POST /{owner}/{repo}/settings/rename` renames the repo and needs |
| 3 | -//! instance admin) and a typed `owner/name` confirmation. A non-admin transfer is only offered: the | 3 | +//! `Action::Admin` (owner, instance admin, or an Admin collaborator). `POST /{owner}/{repo}/settings/transfer` |
| 4 | -//! target accepts it on `pages::repo_transfer`, and an instance admin's moves at once. The old | 4 | +//! needs `Action::Delete` (owner or instance admin) and a typed `owner/name` confirmation. A non-admin |
| 5 | -//! owner/name keeps working through a redirect (see `store::move_repo` and `pages::repo_ctx`). The | 5 | +//! transfer is only offered: the target accepts it on `pages::repo_transfer`, and an instance admin's |
| 6 | -//! bare repo on disk never moves. | 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 | use forge_core::store::orgs::OrgMemberRole; | 9 | use forge_core::store::orgs::OrgMemberRole; |
| 9 | use forge_core::{AuditAction, Error as CoreError}; | 10 | use forge_core::{AuditAction, Error as CoreError}; |
| 10 | use serde::Deserialize; | 11 | use serde::Deserialize; |
| 11 | use topcoat::Result; | 12 | use topcoat::Result; |
| 12 | use topcoat::context::{Cx, app_context}; | 13 | use topcoat::context::{Cx, app_context}; |
| 13 | -use topcoat::cookie::{Cookie, Cookies, SameSite, cookies}; | ||
| 14 | use topcoat::router::content::Form; | 14 | use topcoat::router::content::Form; |
| 15 | -use topcoat::router::error::{forbidden, see_other}; | 15 | +use topcoat::router::error::{SeeOther, forbidden, see_other}; |
| 16 | -use topcoat::router::{page, path_param}; | 16 | +use topcoat::router::{page, path_param, route}; |
| 17 | use topcoat::view::{View, component, view}; | 17 | use topcoat::view::{View, component, view}; |
| 18 | 18 | ||
| 19 | use crate::audit::{self, Actor, Target}; | 19 | use crate::audit::{self, Actor, Target}; |
| 20 | -use crate::auth::{require_csrf, require_user}; | 20 | +use crate::auth::require_csrf; |
| 21 | use crate::i18n::repo_admin::{self as g, K}; | 21 | use crate::i18n::repo_admin::{self as g, K}; |
| 22 | use crate::i18n::{self, Lang}; | 22 | use crate::i18n::{self, Lang}; |
| 23 | -use crate::pages::repo::repo_head; | 23 | +use crate::pages::repo_ctx::load_repo; |
| 24 | -use crate::pages::repo_ctx::{RepoCtx, RepoHead, load_repo}; | 24 | +use crate::pages::repo_settings::{DangerForms, Shown, render_settings, set_settings_notice}; |
| 25 | -use crate::pages::repo_settings::settings_frame; | ||
| 26 | -use crate::pages::repo_settings_live::settings_head; | ||
| 27 | use crate::state::AppState; | 25 | use crate::state::AppState; |
| 26 | +use crate::views::alert; | ||
| 28 | use crate::views::parts::reveal; | 27 | use crate::views::parts::reveal; |
| 29 | -use crate::views::{alert, shell}; | ||
| 30 | 28 | ||
| 31 | path_param!(owner); | 29 | path_param!(owner); |
| 32 | path_param!(repo); | 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 | #[derive(Deserialize)] | 32 | #[derive(Deserialize)] |
| 44 | struct RenameForm { | 33 | struct RenameForm { |
| 45 | #[serde(default)] | 34 | #[serde(default)] |
| @@ -58,170 +47,50 @@ struct TransferForm { | |||
| 58 | confirm: String, | 47 | confirm: String, |
| 59 | } | 48 | } |
| 60 | 49 | ||
| 61 | -/// What the two forms show: the drafts the viewer typed and any error for each form. | 50 | +/// The Rename topic of the danger zone: the form opens in place. `error` is a refused name, and the |
| 62 | -struct Forms { | 51 | +/// form opens with it and keeps the typed `name`. |
| 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. | ||
| 102 | #[component] | 52 | #[component] |
| 103 | -async fn rename_body( | 53 | +pub(crate) async fn rename_section( |
| 104 | lang: Lang, | 54 | lang: Lang, |
| 105 | - head: RepoHead, | ||
| 106 | title: String, | 55 | title: String, |
| 107 | csrf: String, | 56 | csrf: String, |
| 108 | - can_delete: bool, | 57 | + name: String, |
| 109 | - notice: Option<K>, | 58 | + error: Option<String>, |
| 110 | - forms: Forms, | ||
| 111 | ) -> Result<impl View> { | 59 | ) -> Result<impl View> { |
| 112 | - let rename_action = format!("/{title}/settings/rename"); | 60 | + let action = format!("/{title}/settings/rename"); |
| 113 | - let transfer_action = format!("/{title}/settings/transfer"); | 61 | + let open = error.is_some(); |
| 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(); | ||
| 125 | Ok(view! { | 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 | <section class="sec"> | 63 | <section class="sec"> |
| 132 | - <h2>(g::t(lang, K::RenameRepo))</h2> | 64 | + <h2>(g::t(lang, K::RenameHeading))</h2> |
| 133 | - <p class="hint">(g::t(lang, K::RenameHelp))</p> | ||
| 134 | <div class="acts"> | 65 | <div class="acts"> |
| 135 | - reveal(label: g::t(lang, K::RenameRepo), open: rename_open, | 66 | + reveal(label: g::t(lang, K::RenameRepo), open: open, |
| 136 | - if let Some(message) = rename_error { | 67 | + if let Some(message) = error { |
| 137 | alert(message: message.as_str()) | 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 | <input type="hidden" name="csrf" value=(csrf.as_str())> | 71 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 141 | <div class="field"> | 72 | <div class="field"> |
| 142 | <label for="rename-name">(g::t(lang, K::NewName))</label> | 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 | </div> | 75 | </div> |
| 145 | <button type="submit" class="primary">(g::t(lang, K::RenameRepo))</button> | 76 | <button type="submit" class="primary">(g::t(lang, K::RenameRepo))</button> |
| 146 | </form> | 77 | </form> |
| 147 | ) | 78 | ) |
| 148 | </div> | 79 | </div> |
| 149 | </section> | 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. | 84 | +/// The rename form moved into the danger zone; the old address goes there. |
| 180 | -struct Frame { | 85 | +#[route(GET "/{owner}/{repo}/settings/rename")] |
| 181 | - page_title: String, | 86 | +async fn rename_get(cx: &Cx) -> Result<SeeOther> { |
| 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> { | ||
| 203 | let owner = path_param::<Owner>(cx); | 87 | let owner = path_param::<Owner>(cx); |
| 204 | let name = path_param::<Repo>(cx); | 88 | let name = path_param::<Repo>(cx); |
| 205 | - let ctx = load_repo(cx, owner, name).await?; | 89 | + Ok(see_other(format!("/{owner}/{name}/settings?section=danger"))) |
| 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 | - }) | ||
| 221 | } | 90 | } |
| 222 | 91 | ||
| 223 | /// Renames the repo. The store validates the name with `validate_name`; an invalid name or a name | 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 | #[page(POST "/{owner}/{repo}/settings/rename")] | 94 | #[page(POST "/{owner}/{repo}/settings/rename")] |
| 226 | async fn rename_post(cx: &Cx, Form(form): Form<RenameForm>) -> Result<impl View> { | 95 | async fn rename_post(cx: &Cx, Form(form): Form<RenameForm>) -> Result<impl View> { |
| 227 | let owner = path_param::<Owner>(cx); | 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 | serde_json::json!({ "from": ctx.repo.name }), | 139 | serde_json::json!({ "from": ctx.repo.name }), |
| 271 | ) | 140 | ) |
| 272 | .await; | 141 | .await; |
| 273 | - set_notice(cx, "renamed"); | 142 | + set_settings_notice(cx, "renamed"); |
| 274 | Err(see_other(format!( | 143 | Err(see_other(format!( |
| 275 | - "/{}/{new_name}/settings/rename", | 144 | + "/{}/{new_name}/settings?section=danger", |
| 276 | ctx.repo.owner_name | 145 | ctx.repo.owner_name |
| 277 | )) | 146 | )) |
| 278 | .into()) | 147 | .into()) |
| 279 | } | 148 | } |
| 280 | Err(CoreError::InvalidName(message) | CoreError::Conflict(message)) => { | 149 | Err(CoreError::InvalidName(message) | CoreError::Conflict(message)) => { |
| 281 | - let forms = Forms { | 150 | + let danger = DangerForms { |
| 282 | rename_name: new_name, | 151 | rename_name: new_name, |
| 283 | rename_error: Some(message), | 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?; | 155 | + render_settings( |
| 287 | - let csrf = session.csrf_token.clone(); | 156 | + cx, |
| 288 | - Ok(view! { | 157 | + ctx, |
| 289 | - shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(), | 158 | + user, |
| 290 | - rename_body(lang: lang, head: frame.head, title: frame.title, csrf: csrf, | 159 | + session.csrf_token.clone(), |
| 291 | - can_delete: frame.can_delete, | 160 | + lang, |
| 292 | - notice: None, forms: forms)) | 161 | + Shown::danger(danger), |
| 293 | - }) | 162 | + ) |
| 163 | + .await | ||
| 294 | } | 164 | } |
| 295 | Err(other) => Err(other.into()), | 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 | .await; | 228 | .await; |
| 359 | return Err(see_other(format!( | 229 | return Err(see_other(format!( |
| 360 | - "/{}/{}/transfer", | 230 | + "/{title}/settings?section=danger" |
| 361 | - ctx.repo.owner_name, ctx.repo.name | ||
| 362 | )) | 231 | )) |
| 363 | .into()); | 232 | .into()); |
| 364 | } | 233 | } |
| @@ -390,9 +259,9 @@ async fn transfer_post(cx: &Cx, Form(form): Form<TransferForm>) -> Result<impl V | |||
| 390 | serde_json::json!({ "to": new_owner.username }), | 259 | serde_json::json!({ "to": new_owner.username }), |
| 391 | ) | 260 | ) |
| 392 | .await; | 261 | .await; |
| 393 | - set_notice(cx, "transferred"); | 262 | + set_settings_notice(cx, "transferred"); |
| 394 | return Err(see_other(format!( | 263 | return Err(see_other(format!( |
| 395 | - "/{}/{}/settings/rename", | 264 | + "/{}/{}/settings?section=danger", |
| 396 | new_owner.username, ctx.repo.name | 265 | new_owner.username, ctx.repo.name |
| 397 | )) | 266 | )) |
| 398 | .into()); | 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 | transfer_owner: target, | 275 | transfer_owner: target, |
| 407 | transfer_error: error, | 276 | transfer_error: error, |
| 408 | - ..Forms::fresh(&ctx) | 277 | + ..DangerForms::fresh(&ctx) |
| 409 | }; | 278 | }; |
| 410 | - let frame = Frame::new(&ctx, state, lang).await?; | 279 | + render_settings( |
| 411 | - let csrf = session.csrf_token.clone(); | 280 | + cx, |
| 412 | - Ok(view! { | 281 | + ctx, |
| 413 | - shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(), | 282 | + user, |
| 414 | - rename_body(lang: lang, head: frame.head, title: frame.title, csrf: csrf, | 283 | + session.csrf_token.clone(), |
| 415 | - can_delete: frame.can_delete, | 284 | + lang, |
| 416 | - notice: None, forms: forms)) | 285 | + Shown::danger(danger), |
| 417 | - }) | 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 | use crate::i18n::Lang; | 20 | use crate::i18n::Lang; |
| 21 | use crate::i18n::code::{self as g}; | 21 | use crate::i18n::code::{self as g}; |
| 22 | -use crate::pages::passkeys::s; | ||
| 23 | use crate::pages::repo_ctx::{RepoCtx, load_repo}; | 22 | use crate::pages::repo_ctx::{RepoCtx, load_repo}; |
| 24 | use crate::pages::tree::{entry_rows, load_readme, read_dir, readme_card}; | 23 | use crate::pages::tree::{entry_rows, load_readme, read_dir, readme_card}; |
| 25 | use crate::state::AppState; | 24 | use crate::state::AppState; |
| @@ -205,10 +204,7 @@ async fn scrub_page(cx: &Cx) -> Result<impl View> { | |||
| 205 | let readme = parts.readme.clone(); | 204 | let readme = parts.readme.clone(); |
| 206 | let lang = ctx.lang; | 205 | let lang = ctx.lang; |
| 207 | let short: String = oid.chars().take(7).collect(); | 206 | let short: String = oid.chars().take(7).collect(); |
| 208 | - let sub = vec![ | 207 | + let sub = vec![SubPart::text(title.clone())]; |
| 209 | - SubPart::text(s(lang, "Files at this commit", "Bu commit'teki dosyalar")), | ||
| 210 | - SubPart::text(title.clone()), | ||
| 211 | - ]; | ||
| 212 | Ok(view! { | 208 | Ok(view! { |
| 213 | shell(title: title.as_str(), viewer: ctx.viewer.as_ref(), | 209 | shell(title: title.as_str(), viewer: ctx.viewer.as_ref(), |
| 214 | head(title: short.as_str(), sub: sub) | 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 | use crate::auth::{require_csrf, require_user}; | 18 | use crate::auth::{require_csrf, require_user}; |
| 19 | use crate::i18n::repo_admin::{self as g, K}; | 19 | use crate::i18n::repo_admin::{self as g, K}; |
| 20 | use crate::i18n::{self, Lang}; | 20 | use crate::i18n::{self, Lang}; |
| 21 | -use crate::pages::passkeys; | ||
| 22 | use crate::pages::repo::repo_head; | 21 | use crate::pages::repo::repo_head; |
| 23 | use crate::pages::repo_ctx::{RepoCtx, RepoHead, load_repo}; | 22 | use crate::pages::repo_ctx::{RepoCtx, RepoHead, load_repo}; |
| 24 | use crate::pages::repo_settings::settings_frame; | 23 | use crate::pages::repo_settings::settings_frame; |
| @@ -160,10 +159,9 @@ async fn frame_top( | |||
| 160 | #[default] child: Child<'_>, | 159 | #[default] child: Child<'_>, |
| 161 | ) -> Result<impl View> { | 160 | ) -> Result<impl View> { |
| 162 | let notice = notice.map(|(key, is_error)| (g::t(lang, key), is_error)); | 161 | let notice = notice.map(|(key, is_error)| (g::t(lang, key), is_error)); |
| 163 | - let can_delete = head.can_delete; | ||
| 164 | Ok(view! { | 162 | Ok(view! { |
| 165 | repo_head(head: head, title: Some(g::t(lang, K::Secrets).to_owned())) | 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 | if let Some((text, is_error)) = notice { | 165 | if let Some((text, is_error)) = notice { |
| 168 | if is_error { | 166 | if is_error { |
| 169 | alert(message: text) | 167 | alert(message: text) |
| @@ -212,13 +210,11 @@ async fn secrets_body( | |||
| 212 | <div class="field"> | 210 | <div class="field"> |
| 213 | <label for="secret-name">(g::t(lang, K::Name))</label> | 211 | <label for="secret-name">(g::t(lang, K::Name))</label> |
| 214 | <input id="secret-name" type="text" name="name" value=(draft_name.as_str()) required=(true) maxlength="64" | 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" | 213 | + pattern="[A-Z_][A-Z0-9_]{0,63}" autocomplete="off" spellcheck="false"> |
| 216 | - placeholder="DEPLOY_TOKEN"> | ||
| 217 | </div> | 214 | </div> |
| 218 | <div class="field"> | 215 | <div class="field"> |
| 219 | <label for="secret-value">(g::t(lang, K::Value))</label> | 216 | <label for="secret-value">(g::t(lang, K::Value))</label> |
| 220 | <textarea id="secret-value" name="value" required=(true) rows="6" autocomplete="off" spellcheck="false"></textarea> | 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 | </div> | 218 | </div> |
| 223 | <button type="submit" class="primary">(g::t(lang, K::SaveSecret))</button> | 219 | <button type="submit" class="primary">(g::t(lang, K::SaveSecret))</button> |
| 224 | </form> | 220 | </form> |
| @@ -230,8 +226,6 @@ async fn secrets_body( | |||
| 230 | <h2>(g::t(lang, K::Secrets))</h2> | 226 | <h2>(g::t(lang, K::Secrets))</h2> |
| 231 | if rows.is_empty() { | 227 | if rows.is_empty() { |
| 232 | <p class="state">(g::t(lang, K::NoSecrets))</p> | 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 | <div> | 230 | <div> |
| 237 | for row in rows.iter() { | 231 | for row in rows.iter() { |
| @@ -245,8 +239,7 @@ async fn secrets_body( | |||
| 245 | <span class="name"><code>(row.name.as_str())</code></span> | 239 | <span class="name"><code>(row.name.as_str())</code></span> |
| 246 | <span class="val">rel_time(lang: lang, stamp: row.updated_at.as_str())</span> | 240 | <span class="val">rel_time(lang: lang, stamp: row.updated_at.as_str())</span> |
| 247 | confirm_act(lang: lang, label: g::t(lang, K::Delete), action: delete_action.as_str(), csrf: csrf.as_str(), | 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())], | 242 | + 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())) | ||
| 250 | </div> | 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 | <p class="state">(g::t(lang, K::SecurityOff))</p> | 129 | <p class="state">(g::t(lang, K::SecurityOff))</p> |
| 130 | } else { | 130 | } else { |
| 131 | <p class="state">(g::dependencies_summary(lang, dependencies, open_count))</p> | 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 | if rows.is_empty() { | 133 | if rows.is_empty() { |
| 135 | <p class="state">(g::t(lang, K::NoAlerts))</p> | 134 | <p class="state">(g::t(lang, K::NoAlerts))</p> |
crates/forge-web/src/pages/repo_settings.rsmodified+261 -165
| @@ -1,9 +1,10 @@ | |||
| 1 | //! Page: repo settings (`/{owner}/{repo}/settings`). The owner, an instance admin and collaborators | 1 | //! Page: repo settings (`/{owner}/{repo}/settings`). The owner, an instance admin and collaborators |
| 2 | //! with the Admin role get the page. It shows one section at a time, chosen by `?section=`: General | 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), | 3 | +//! (description, default branch, and the Features switches: discussions and wiki; the default), branch |
| 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 | 4 | +//! protection rules (Admin), and the danger zone (rename, then transfer, visibility, archive and |
| 5 | -//! rows in one transaction. The repo is never erased from disk, so an admin can recover it from the | 5 | +//! delete). Transfer and delete need Delete: owner or instance admin only. Deleting moves the bare repo |
| 6 | -//! trash. | 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 | use std::path::Path; | 9 | use std::path::Path; |
| 9 | 10 | ||
| @@ -12,7 +13,7 @@ use forge_core::protection::{ | |||
| 12 | validate_required_approvals, | 13 | validate_required_approvals, |
| 13 | }; | 14 | }; |
| 14 | use forge_core::store::MAX_DESCRIPTION_CHARS; | 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 | use forge_git::browse::RefKind; | 17 | use forge_git::browse::RefKind; |
| 17 | use forge_git::command::{GitCommand, GitEnv}; | 18 | use forge_git::command::{GitCommand, GitEnv}; |
| 18 | use forge_git::repo::{ | 19 | use forge_git::repo::{ |
| @@ -33,12 +34,15 @@ use crate::auth::{require_csrf, require_user}; | |||
| 33 | use crate::i18n::merge_queue as mq; | 34 | use crate::i18n::merge_queue as mq; |
| 34 | use crate::i18n::repo_admin::{self as g, K}; | 35 | use crate::i18n::repo_admin::{self as g, K}; |
| 35 | use crate::i18n::{self, Lang}; | 36 | use crate::i18n::{self, Lang}; |
| 36 | -use crate::pages::discussion_settings::discussions_card; | 37 | +use crate::pages::discussion_settings::discussions_switch; |
| 37 | use crate::pages::passkeys; | 38 | use crate::pages::passkeys; |
| 38 | use crate::pages::refs::load_refs; | 39 | use crate::pages::refs::load_refs; |
| 39 | use crate::pages::repo::repo_head; | 40 | use crate::pages::repo::repo_head; |
| 40 | use crate::pages::repo_ctx::{RepoCtx, RepoHead, load_repo}; | 41 | use crate::pages::repo_ctx::{RepoCtx, RepoHead, load_repo}; |
| 42 | +use crate::pages::repo_rename::rename_section; | ||
| 41 | use crate::pages::repo_settings_live::settings_head; | 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 | use crate::state::AppState; | 46 | use crate::state::AppState; |
| 43 | use crate::views::parts::{RailItem, confirm_act, post_act, rail}; | 47 | use crate::views::parts::{RailItem, confirm_act, post_act, rail}; |
| 44 | use crate::views::{alert, enc, shell}; | 48 | use crate::views::{alert, enc, shell}; |
| @@ -52,13 +56,12 @@ pub(crate) struct SectionQuery { | |||
| 52 | section: Option<String>, | 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 | 59 | +/// The section to show: `branches`, or `danger` (the danger zone, for a viewer who may admin the |
| 56 | -/// repo). Anything else is `general`. | 60 | +/// repo, which the page requires). Anything else, including the old `discussions`, is `general`. |
| 57 | -fn pick_section(raw: Option<&str>, can_delete: bool) -> &'static str { | 61 | +fn pick_section(raw: Option<&str>) -> &'static str { |
| 58 | match raw { | 62 | match raw { |
| 59 | Some("branches") => "branches", | 63 | Some("branches") => "branches", |
| 60 | - Some("discussions") => "discussions", | 64 | + Some("danger") => "danger", |
| 61 | - Some("danger") if can_delete => "danger", | ||
| 62 | _ => "general", | 65 | _ => "general", |
| 63 | } | 66 | } |
| 64 | } | 67 | } |
| @@ -71,13 +74,15 @@ pub const NOTICE_COOKIE: &str = "forge_notice"; | |||
| 71 | const SETTINGS_NOTICE_COOKIE: &str = "forge_settings_notice"; | 74 | const SETTINGS_NOTICE_COOKIE: &str = "forge_settings_notice"; |
| 72 | 75 | ||
| 73 | /// Notice words, the text each one shows, and whether it is an error (shown as an alert). | 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 | ("saved", K::BranchRuleSaved, false), | 78 | ("saved", K::BranchRuleSaved, false), |
| 76 | ("removed", K::BranchRuleRemoved, false), | 79 | ("removed", K::BranchRuleRemoved, false), |
| 77 | ("general", K::GeneralSaved, false), | 80 | ("general", K::GeneralSaved, false), |
| 78 | ("visibility", K::VisibilityChanged, false), | 81 | ("visibility", K::VisibilityChanged, false), |
| 79 | ("archived", K::RepoArchived, false), | 82 | ("archived", K::RepoArchived, false), |
| 80 | ("unarchived", K::RepoUnarchived, false), | 83 | ("unarchived", K::RepoUnarchived, false), |
| 84 | + ("renamed", K::RenamedNotice, false), | ||
| 85 | + ("transferred", K::TransferredNotice, false), | ||
| 81 | ("description_long", K::DescriptionLong, true), | 86 | ("description_long", K::DescriptionLong, true), |
| 82 | ("branch_missing", K::BranchMissing, true), | 87 | ("branch_missing", K::BranchMissing, true), |
| 83 | ("git_failed", K::DefaultBranchFailed, true), | 88 | ("git_failed", K::DefaultBranchFailed, true), |
| @@ -192,7 +197,7 @@ pub fn take_notice(cx: &Cx) -> Option<String> { | |||
| 192 | } | 197 | } |
| 193 | 198 | ||
| 194 | /// Sets the one-line notice shown on the next settings page view. | 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 | cookies(cx).add( | 201 | cookies(cx).add( |
| 197 | Cookie::build((SETTINGS_NOTICE_COOKIE, word)) | 202 | Cookie::build((SETTINGS_NOTICE_COOKIE, word)) |
| 198 | .path("/") | 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 | #[component] | 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 | lang: Lang, | 399 | lang: Lang, |
| 273 | csrf: String, | 400 | csrf: String, |
| 274 | title: String, | 401 | title: String, |
| @@ -278,9 +405,7 @@ async fn danger_zone( | |||
| 278 | let open = error.is_some(); | 405 | let open = error.is_some(); |
| 279 | Ok(view! { | 406 | Ok(view! { |
| 280 | <section class="sec"> | 407 | <section class="sec"> |
| 281 | - <h2>(g::t(lang, K::DangerZone))</h2> | 408 | + <h2>(g::t(lang, K::Delete))</h2> |
| 282 | - <p class="hint">(g::t(lang, K::DeleteRepoHelp))</p> | ||
| 283 | - <p class="hint">(g::t(lang, K::DeleteTrashHelp))</p> | ||
| 284 | <div class="acts"> | 409 | <div class="acts"> |
| 285 | <details class="reveal" open=(open)> | 410 | <details class="reveal" open=(open)> |
| 286 | <summary class="act danger">(g::t(lang, K::DeleteRepo))</summary> | 411 | <summary class="act danger">(g::t(lang, K::DeleteRepo))</summary> |
| @@ -308,37 +433,30 @@ async fn danger_zone( | |||
| 308 | 433 | ||
| 309 | /// The settings frame: the rail of settings pages beside the sheet holding the page's own content | 434 | /// The settings frame: the rail of settings pages beside the sheet holding the page's own content |
| 310 | /// (its children). Every settings page shows the same rail, one list of every page. `current` names | 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 | 436 | +/// the page shown (`general`, `branches`, `webhooks`, ...) and marks its rail item. Every settings |
| 312 | -/// listed only for a viewer who may delete the repo (`can_delete`). | 437 | +/// page is for a repo admin, so the Danger zone is always listed. |
| 313 | #[component] | 438 | #[component] |
| 314 | pub async fn settings_frame( | 439 | pub async fn settings_frame( |
| 315 | lang: Lang, | 440 | lang: Lang, |
| 316 | title: String, | 441 | title: String, |
| 317 | current: &'static str, | 442 | current: &'static str, |
| 318 | - can_delete: bool, | ||
| 319 | #[default] child: Child<'_>, | 443 | #[default] child: Child<'_>, |
| 320 | ) -> Result<impl View> { | 444 | ) -> Result<impl View> { |
| 321 | - let discussions_label = crate::i18n::community::t(lang, crate::i18n::community::K::Discussions); | ||
| 322 | let item = |name: &str, href: String, on: bool| RailItem { | 445 | let item = |name: &str, href: String, on: bool| RailItem { |
| 323 | name: name.to_owned(), | 446 | name: name.to_owned(), |
| 324 | val: String::new(), | 447 | val: String::new(), |
| 325 | href, | 448 | href, |
| 326 | current: on, | 449 | current: on, |
| 327 | }; | 450 | }; |
| 328 | - let mut items = vec![ | 451 | + let items = vec![ |
| 329 | item(g::t(lang, K::General), format!("/{title}/settings"), current == "general"), | 452 | item(g::t(lang, K::General), format!("/{title}/settings"), current == "general"), |
| 330 | item(g::t(lang, K::Collaborators), format!("/{title}/settings/collaborators"), current == "collaborators"), | 453 | item(g::t(lang, K::Collaborators), format!("/{title}/settings/collaborators"), current == "collaborators"), |
| 331 | item(g::t(lang, K::BranchProtection), format!("/{title}/settings?section=branches"), current == "branches"), | 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 | item(g::t(lang, K::Webhooks), format!("/{title}/settings/hooks"), current == "webhooks"), | 455 | item(g::t(lang, K::Webhooks), format!("/{title}/settings/hooks"), current == "webhooks"), |
| 334 | item(g::t(lang, K::Mirrors), format!("/{title}/settings/mirrors"), current == "mirrors"), | 456 | item(g::t(lang, K::Mirrors), format!("/{title}/settings/mirrors"), current == "mirrors"), |
| 335 | item(g::t(lang, K::Secrets), format!("/{title}/settings/secrets"), current == "secrets"), | 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"), | 458 | + item(g::t(lang, K::DangerZone), format!("/{title}/settings?section=danger"), current == "danger"), |
| 337 | - item(g::t(lang, K::RenameTransferNav), format!("/{title}/settings/rename"), current == "rename"), | ||
| 338 | ]; | 459 | ]; |
| 339 | - if can_delete { | ||
| 340 | - items.push(item(g::t(lang, K::DangerZone), format!("/{title}/settings?section=danger"), current == "danger")); | ||
| 341 | - } | ||
| 342 | Ok(view! { | 460 | Ok(view! { |
| 343 | <div class="work"> | 461 | <div class="work"> |
| 344 | rail(label: g::t(lang, K::SettingsNavLabel), items: items) | 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. | 470 | + |
| 353 | -/// Each form carries its own CSRF token. An empty repo shows "No branches yet" and no selector. | 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 | #[component] | 474 | #[component] |
| 355 | async fn general_section( | 475 | async fn general_section( |
| 356 | lang: Lang, | 476 | lang: Lang, |
| @@ -359,29 +479,10 @@ async fn general_section( | |||
| 359 | description: String, | 479 | description: String, |
| 360 | default_branch: String, | 480 | default_branch: String, |
| 361 | branches: Vec<String>, | 481 | branches: Vec<String>, |
| 362 | - visibility: Visibility, | 482 | + discussions_on: bool, |
| 363 | - archived: bool, | 483 | + wiki_on: bool, |
| 364 | ) -> Result<impl View> { | 484 | ) -> Result<impl View> { |
| 365 | let general_action = format!("/{title}/settings/general"); | 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 | let options: Vec<(String, bool)> = branches | 486 | let options: Vec<(String, bool)> = branches |
| 386 | .into_iter() | 487 | .into_iter() |
| 387 | .map(|b| { | 488 | .map(|b| { |
| @@ -391,12 +492,10 @@ async fn general_section( | |||
| 391 | .collect(); | 492 | .collect(); |
| 392 | Ok(view! { | 493 | Ok(view! { |
| 393 | <section class="sec"> | 494 | <section class="sec"> |
| 394 | - <h2>(g::t(lang, K::General))</h2> | ||
| 395 | <form method="post" action=(general_action) class="fields"> | 495 | <form method="post" action=(general_action) class="fields"> |
| 396 | <div class="field"> | 496 | <div class="field"> |
| 397 | <label for="repo-description">(g::t(lang, K::Description))</label> | 497 | <label for="repo-description">(g::t(lang, K::Description))</label> |
| 398 | <input id="repo-description" type="text" name="description" value=(description) maxlength="350" autocomplete="off"> | 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 | </div> | 499 | </div> |
| 401 | if options.is_empty() { | 500 | if options.is_empty() { |
| 402 | <p class="state">(g::t(lang, K::DefaultBranch)) ": " (g::t(lang, K::NoBranchesYet))</p> | 501 | <p class="state">(g::t(lang, K::DefaultBranch)) ": " (g::t(lang, K::NoBranchesYet))</p> |
| @@ -416,30 +515,9 @@ async fn general_section( | |||
| 416 | </section> | 515 | </section> |
| 417 | 516 | ||
| 418 | <section class="sec"> | 517 | <section class="sec"> |
| 419 | - <h2>(g::t(lang, K::VisibilityHeading))</h2> | 518 | + <h2>(g::t(lang, K::Features))</h2> |
| 420 | - <p class="state">(current_visibility)</p> | 519 | + discussions_switch(lang: lang, action: format!("/{title}/settings/discussions"), csrf: csrf.clone(), enabled: discussions_on) |
| 421 | - <div class="acts"> | 520 | + wiki_switch(action: format!("/{title}/settings/wiki"), csrf: csrf.clone(), enabled: wiki_on) |
| 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 | - } | ||
| 443 | </section> | 521 | </section> |
| 444 | }) | 522 | }) |
| 445 | } | 523 | } |
| @@ -648,7 +726,6 @@ async fn branch_rule_form( | |||
| 648 | <div class="field"> | 726 | <div class="field"> |
| 649 | <label for=(pattern_id.as_str())>(g::t(lang, K::BranchPattern))</label> | 727 | <label for=(pattern_id.as_str())>(g::t(lang, K::BranchPattern))</label> |
| 650 | <input id=(pattern_id.as_str()) type="text" name="pattern" value=(pattern.as_str()) autocomplete="off" spellcheck="false" required=(true)> | 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 | </div> | 729 | </div> |
| 653 | } | 730 | } |
| 654 | <div class="rule-section"> | 731 | <div class="rule-section"> |
| @@ -694,7 +771,7 @@ async fn branch_rule_form( | |||
| 694 | </div> | 771 | </div> |
| 695 | <div class="field"> | 772 | <div class="field"> |
| 696 | <label for=(checks_id.as_str())>(g::t(lang, K::SectionChecks))</label> | 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 | if !contexts.is_empty() { | 775 | if !contexts.is_empty() { |
| 699 | <div class="acts recent-checks"> | 776 | <div class="acts recent-checks"> |
| 700 | <span class="hint">(g::t(lang, K::RecentContexts))</span> | 777 | <span class="hint">(g::t(lang, K::RecentContexts))</span> |
| @@ -781,13 +858,80 @@ struct SettingsView { | |||
| 781 | /// A settings notice: its text and whether it is an error. | 858 | /// A settings notice: its text and whether it is an error. |
| 782 | notice: Option<(K, bool)>, | 859 | notice: Option<(K, bool)>, |
| 783 | draft: RuleDraft, | 860 | draft: RuleDraft, |
| 784 | - delete_error: Option<String>, | 861 | + danger: DangerForms, |
| 862 | + transfer: TransferStatus, | ||
| 863 | + wiki_on: bool, | ||
| 785 | /// Recently reported status contexts, offered as required-check suggestions. | 864 | /// Recently reported status contexts, offered as required-check suggestions. |
| 786 | contexts: Vec<String>, | 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 | /// The settings body: the repo header with Settings active, then the rail and one section (`section`: | 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 | #[component] | 935 | #[component] |
| 792 | async fn settings_body( | 936 | async fn settings_body( |
| 793 | lang: Lang, | 937 | lang: Lang, |
| @@ -811,7 +955,9 @@ async fn settings_body( | |||
| 811 | rules, | 955 | rules, |
| 812 | notice, | 956 | notice, |
| 813 | draft, | 957 | draft, |
| 814 | - delete_error, | 958 | + danger, |
| 959 | + transfer, | ||
| 960 | + wiki_on, | ||
| 815 | contexts, | 961 | contexts, |
| 816 | } = page; | 962 | } = page; |
| 817 | // A card takes the draft when the draft has an error and the pattern is its rule's pattern. | 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 | let notice = notice.map(|(key, is_error)| (g::t(lang, key), is_error)); | 994 | let notice = notice.map(|(key, is_error)| (g::t(lang, key), is_error)); |
| 849 | let section_name = match section { | 995 | let section_name = match section { |
| 850 | "branches" => g::t(lang, K::BranchProtection), | 996 | "branches" => g::t(lang, K::BranchProtection), |
| 851 | - "discussions" => crate::i18n::community::t(lang, crate::i18n::community::K::Discussions), | ||
| 852 | "danger" => g::t(lang, K::DangerZone), | 997 | "danger" => g::t(lang, K::DangerZone), |
| 853 | _ => g::t(lang, K::General), | 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 | 1000 | + // Only one section is rendered. |
| 856 | - // (see `pick_section`), and it is last so that its moves come after every clone. | ||
| 857 | Ok(view! { | 1001 | Ok(view! { |
| 858 | repo_head(head: head, title: Some(section_name.to_owned())) | 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 | if let Some((text, is_error)) = notice { | 1004 | if let Some((text, is_error)) = notice { |
| 861 | if is_error { | 1005 | if is_error { |
| 862 | alert(message: text) | 1006 | alert(message: text) |
| @@ -867,22 +1011,19 @@ async fn settings_body( | |||
| 867 | if section == "general" { | 1011 | if section == "general" { |
| 868 | general_section(lang: lang, title: title.clone(), csrf: csrf.clone(), description: description, | 1012 | general_section(lang: lang, title: title.clone(), csrf: csrf.clone(), description: description, |
| 869 | default_branch: default_branch.clone(), branches: branches, | 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 | if section == "branches" { | 1016 | if section == "branches" { |
| 873 | <section class="sec"> | 1017 | <section class="sec"> |
| 874 | <h2>(g::t(lang, K::BranchProtection))</h2> | 1018 | <h2>(g::t(lang, K::BranchProtection))</h2> |
| 875 | - <p class="hint">(g::t(lang, K::BranchProtectionHelp))</p> | ||
| 876 | branch_rule_cards(lang: lang, cards: cards, builtin_row: builtin_row, default_branch: default_branch.clone(), | 1019 | branch_rule_cards(lang: lang, cards: cards, builtin_row: builtin_row, default_branch: default_branch.clone(), |
| 877 | new_draft: new_draft, new_open: new_open, csrf: csrf.clone(), save_action: rules_action, | 1020 | new_draft: new_draft, new_open: new_open, csrf: csrf.clone(), save_action: rules_action, |
| 878 | delete_action: delete_action, contexts: contexts) | 1021 | delete_action: delete_action, contexts: contexts) |
| 879 | </section> | 1022 | </section> |
| 880 | } | 1023 | } |
| 881 | - if section == "discussions" { | 1024 | + if section == "danger" { |
| 882 | - discussions_card(lang: lang, action: format!("/{title}/settings/discussions"), csrf: csrf.clone(), enabled: discussions_on) | 1025 | + danger_section(lang: lang, title: title, csrf: csrf, can_delete: can_delete, |
| 883 | - } | 1026 | + visibility: visibility, archived: archived, forms: danger, transfer: transfer) |
| 884 | - if section == "danger" && can_delete { | ||
| 885 | - danger_zone(lang: lang, csrf: csrf, title: title, error: delete_error) | ||
| 886 | } | 1027 | } |
| 887 | ) | 1028 | ) |
| 888 | }) | 1029 | }) |
| @@ -925,30 +1066,13 @@ async fn settings_page(cx: &Cx) -> Result<impl View> { | |||
| 925 | } | 1066 | } |
| 926 | let lang = i18n::lang(cx, Some(&user)); | 1067 | let lang = i18n::lang(cx, Some(&user)); |
| 927 | let query = query_params::<SectionQuery>(cx)?; | 1068 | let query = query_params::<SectionQuery>(cx)?; |
| 928 | - let section = pick_section(query.section.as_deref(), ctx.can_delete()); | 1069 | + let shown = Shown { |
| 929 | - let rules = app_context::<AppState>(cx) | 1070 | + section: pick_section(query.section.as_deref()), |
| 930 | - .store | ||
| 931 | - .list_branch_rules(&ctx.repo.id) | ||
| 932 | - .await?; | ||
| 933 | - let page = SettingsView { | ||
| 934 | - rules, | ||
| 935 | notice: take_settings_notice(cx), | 1071 | notice: take_settings_notice(cx), |
| 936 | - draft: RuleDraft::for_default_branch(&ctx.repo.default_branch), | 1072 | + draft: None, |
| 937 | - delete_error: None, | 1073 | + danger: DangerForms::fresh(&ctx), |
| 938 | - contexts: app_context::<AppState>(cx) | ||
| 939 | - .store | ||
| 940 | - .recent_status_contexts(&ctx.repo.id, 20) | ||
| 941 | - .await?, | ||
| 942 | }; | 1074 | }; |
| 943 | - let csrf = session.csrf_token.clone(); | 1075 | + render_settings(cx, ctx, user, session.csrf_token.clone(), lang, shown).await |
| 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 | - }) | ||
| 952 | } | 1076 | } |
| 953 | 1077 | ||
| 954 | /// Saves the description and the default branch together. The form is checked for CSRF and | 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 | let title = format!("{}/{}", ctx.repo.owner_name, ctx.repo.name); | 1159 | let title = format!("{}/{}", ctx.repo.owner_name, ctx.repo.name); |
| 1036 | let Ok(target) = form.visibility.parse::<Visibility>() else { | 1160 | let Ok(target) = form.visibility.parse::<Visibility>() else { |
| 1037 | set_settings_notice(cx, "bad_form"); | 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 | if target != ctx.repo.visibility { | 1164 | if target != ctx.repo.visibility { |
| 1041 | if form.understand.is_none() { | 1165 | if form.understand.is_none() { |
| 1042 | set_settings_notice(cx, "understand"); | 1166 | set_settings_notice(cx, "understand"); |
| 1043 | - return Ok(back_to_settings(&title)); | 1167 | + return Ok(back_to_section(&title, "danger")); |
| 1044 | } | 1168 | } |
| 1045 | let state = app_context::<AppState>(cx); | 1169 | let state = app_context::<AppState>(cx); |
| 1046 | state | 1170 | state |
| @@ -1070,7 +1194,7 @@ async fn settings_visibility_save(cx: &Cx, Form(form): Form<VisibilityForm>) -> | |||
| 1070 | .await; | 1194 | .await; |
| 1071 | set_settings_notice(cx, "visibility"); | 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 | /// Archives (`archived=1`) or unarchives (`archived=0`) the repo. Archiving is an Admin action, and | 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 | "0" => false, | 1214 | "0" => false, |
| 1091 | _ => { | 1215 | _ => { |
| 1092 | set_settings_notice(cx, "bad_form"); | 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 | let state = app_context::<AppState>(cx); | 1220 | let state = app_context::<AppState>(cx); |
| @@ -1125,7 +1249,7 @@ async fn settings_archive_save(cx: &Cx, Form(form): Form<ArchiveForm>) -> Result | |||
| 1125 | "repo archive flag changed" | 1249 | "repo archive flag changed" |
| 1126 | ); | 1250 | ); |
| 1127 | set_settings_notice(cx, if archived { "archived" } else { "unarchived" }); | 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 | /// Deletes the repo when the viewer may delete it, the CSRF token is valid and the confirmation | 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 | return Err(see_other(format!("/{}?tab=repositories", enc(&ctx.repo.owner_name))).into()); | 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) | 1364 | + // The delete form lives in the danger zone, so a failed confirmation draws that section again. |
| 1241 | - .store | 1365 | + let shown = Shown { |
| 1242 | - .list_branch_rules(&ctx.repo.id) | 1366 | + section: "danger", |
| 1243 | - .await?; | ||
| 1244 | - let page = SettingsView { | ||
| 1245 | - rules, | ||
| 1246 | notice: None, | 1367 | notice: None, |
| 1247 | - draft: RuleDraft::for_default_branch(&ctx.repo.default_branch), | 1368 | + draft: None, |
| 1369 | + danger: DangerForms { | ||
| 1248 | delete_error: error, | 1370 | delete_error: error, |
| 1249 | - contexts: app_context::<AppState>(cx) | 1371 | + ..DangerForms::fresh(&ctx) |
| 1250 | - .store | 1372 | + }, |
| 1251 | - .recent_status_contexts(&ctx.repo.id, 20) | ||
| 1252 | - .await?, | ||
| 1253 | }; | 1373 | }; |
| 1254 | - let csrf = session.csrf_token.clone(); | 1374 | + render_settings(cx, ctx, user, session.csrf_token.clone(), lang, shown).await |
| 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 | - }) | ||
| 1264 | } | 1375 | } |
| 1265 | 1376 | ||
| 1266 | /// Adds a branch rule or updates the one with the same pattern. The form is checked for CSRF and | 1377 | /// Adds a branch rule or updates the one with the same pattern. The form is checked for CSRF and |
| @@ -1299,14 +1410,7 @@ async fn settings_branch_save(cx: &Cx, Form(form): Form<BranchForm>) -> Result<i | |||
| 1299 | let flags = match checked.and_then(|()| parse_rule_flags(lang, &form)) { | 1410 | let flags = match checked.and_then(|()| parse_rule_flags(lang, &form)) { |
| 1300 | Ok(flags) => flags, | 1411 | Ok(flags) => flags, |
| 1301 | Err(message) => { | 1412 | Err(message) => { |
| 1302 | - let rules = app_context::<AppState>(cx) | 1413 | + let draft = RuleDraft { |
| 1303 | - .store | ||
| 1304 | - .list_branch_rules(&ctx.repo.id) | ||
| 1305 | - .await?; | ||
| 1306 | - let page = SettingsView { | ||
| 1307 | - rules, | ||
| 1308 | - notice: None, | ||
| 1309 | - draft: RuleDraft { | ||
| 1310 | pattern, | 1414 | pattern, |
| 1311 | allow_force_push: form.allow_force_push.is_some(), | 1415 | allow_force_push: form.allow_force_push.is_some(), |
| 1312 | allow_deletion: form.allow_deletion.is_some(), | 1416 | allow_deletion: form.allow_deletion.is_some(), |
| @@ -1318,22 +1422,14 @@ async fn settings_branch_save(cx: &Cx, Form(form): Form<BranchForm>) -> Result<i | |||
| 1318 | required_checks: form.required_checks.clone(), | 1422 | required_checks: form.required_checks.clone(), |
| 1319 | error: Some(message), | 1423 | error: Some(message), |
| 1320 | is_new, | 1424 | 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?, | ||
| 1327 | }; | 1425 | }; |
| 1328 | - let csrf = session.csrf_token.clone(); | 1426 | + let shown = Shown { |
| 1329 | - let frame = SettingsFrame::new(&ctx, app_context::<AppState>(cx), lang).await?; | 1427 | + section: "branches", |
| 1330 | - let branches = load_branch_names(&ctx).await?; | 1428 | + notice: None, |
| 1331 | - return Ok(view! { | 1429 | + draft: Some(draft), |
| 1332 | - shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(), | 1430 | + danger: DangerForms::fresh(&ctx), |
| 1333 | - settings_body(lang: lang, head: frame.head, default_branch: frame.default_branch, archived: frame.archived, | 1431 | + }; |
| 1334 | - branches: branches, title: frame.title, csrf: csrf, | 1432 | + return render_settings(cx, ctx, user, session.csrf_token.clone(), lang, shown).await; |
| 1335 | - can_delete: frame.can_delete, section: "branches", page: page)) | ||
| 1336 | - }); | ||
| 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 | format!("/{owner}/{repo}/security/live") | 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 | /// The header of a settings page. It follows the settings stream, which carries the refs too, since | 42 | /// The header of a settings page. It follows the settings stream, which carries the refs too, since |
| 48 | /// the branch picker of the protection rules lists them. | 43 | /// the branch picker of the protection rules lists them. |
| 49 | pub async fn settings_head(ctx: &RepoCtx, state: &AppState) -> Result<RepoHead> { | 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 | stream_wakes(cx, &state.live, &[Topic::RepoSettings(ctx.repo.id.clone())]) | 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 | // The write layer | 81 | // The write layer |
| 97 | 82 | ||
| 98 | /// Wraps every request. Only a POST under the settings or security paths does anything. Registered | 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 | let anonymous = get(&site, "/owner/proj/settings/live", None).await; | 102 | let anonymous = get(&site, "/owner/proj/settings/live", None).await; |
| 103 | assert_ne!(anonymous.status().as_u16(), 200, "settings: anonymous"); | 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 | let reader = get(&site, path, Some(&reader_cookie)).await; | 106 | let reader = get(&site, path, Some(&reader_cookie)).await; |
| 107 | assert_eq!(reader.status().as_u16(), 200, "{path}: reader"); | 107 | assert_eq!(reader.status().as_u16(), 200, "{path}: reader"); |
| 108 | let anonymous = get(&site, path, None).await; | 108 | let anonymous = get(&site, path, None).await; |
crates/forge-web/src/pages/repo_transfer.rsmodified+82 -75
| @@ -1,10 +1,10 @@ | |||
| 1 | -//! Repo transfer status and actions. `GET /{owner}/{repo}/transfer` shows the open transfer of a | 1 | +//! Repo transfer status and actions. The Transfer topic of the danger zone (`pages::repo_settings`) |
| 2 | -//! repo, if any, to viewers who can read it. The POST actions accept, decline and cancel a transfer | 2 | +//! shows the open transfer of a repo, and `GET /{owner}/{repo}/transfer` goes there. The POST actions |
| 3 | -//! by its repo id under `/-/transfers/{id}/...`: a target who cannot read a private repo can still | 3 | +//! accept, decline and cancel a transfer by its repo id under `/-/transfers/{id}/...`: a target who |
| 4 | -//! act on it from the inbox (`transfer_list_for`), so those routes check the transfer rules in the | 4 | +//! cannot read a private repo can still act on it from the inbox (`transfer_list_for`), so those |
| 5 | -//! store and the repo rules here, not the read rule of `load_repo`. | 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 | //! acceptance entirely. | 8 | //! acceptance entirely. |
| 9 | 9 | ||
| 10 | use forge_core::authz::{Action, authorize}; | 10 | use forge_core::authz::{Action, authorize}; |
| @@ -15,19 +15,17 @@ use topcoat::Result; | |||
| 15 | use topcoat::context::{Cx, app_context}; | 15 | use topcoat::context::{Cx, app_context}; |
| 16 | use topcoat::router::content::Form; | 16 | use topcoat::router::content::Form; |
| 17 | use topcoat::router::error::{SeeOther, forbidden, see_other}; | 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 | use topcoat::view::{View, component, view}; | 19 | use topcoat::view::{View, component, view}; |
| 20 | 20 | ||
| 21 | use crate::audit::{self, Actor, Target}; | 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 | use crate::i18n::repo_admin::{self as g, K}; | 24 | use crate::i18n::repo_admin::{self as g, K}; |
| 24 | -use crate::i18n::{self, Lang}; | 25 | +use crate::pages::repo_settings_live::bump_settings; |
| 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}; | ||
| 28 | use crate::state::AppState; | 26 | use crate::state::AppState; |
| 29 | -use crate::views::parts::{confirm_act, post_act}; | 27 | +use crate::views::parts::{confirm_act, post_act, reveal}; |
| 30 | -use crate::views::{rel_time, shell}; | 28 | +use crate::views::{alert, rel_time}; |
| 31 | 29 | ||
| 32 | path_param!(owner); | 30 | path_param!(owner); |
| 33 | path_param!(repo); | 31 | path_param!(repo); |
| @@ -39,7 +37,7 @@ struct ActionForm { | |||
| 39 | csrf: String, | 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 | fn summary_text(lang: Lang, transfer: &PendingTransfer) -> TransferSummary { | 41 | fn summary_text(lang: Lang, transfer: &PendingTransfer) -> TransferSummary { |
| 44 | let (before, after) = g::transfer_summary( | 42 | let (before, after) = g::transfer_summary( |
| 45 | lang, | 43 | lang, |
| @@ -55,93 +53,102 @@ fn summary_text(lang: Lang, transfer: &PendingTransfer) -> TransferSummary { | |||
| 55 | } | 53 | } |
| 56 | 54 | ||
| 57 | /// The pending-transfer sentence, with its expiry as a live relative time between two parts. | 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 | before: String, | 57 | before: String, |
| 60 | expires_at: String, | 58 | expires_at: String, |
| 61 | after: &'static str, | 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. | 62 | +/// The open transfer of a repo as the danger zone shows it: its sentence, and the action forms the |
| 65 | -#[component] | 63 | +/// viewer may use. An action is `None` when hidden. |
| 66 | -async fn transfer_body( | 64 | +#[derive(Default)] |
| 67 | - lang: Lang, | 65 | +pub(crate) struct TransferStatus { |
| 68 | - head: RepoHead, | ||
| 69 | summary: Option<TransferSummary>, | 66 | summary: Option<TransferSummary>, |
| 70 | accept: Option<String>, | 67 | accept: Option<String>, |
| 71 | decline: Option<String>, | 68 | decline: Option<String>, |
| 72 | cancel: Option<String>, | 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 | csrf: String, | 99 | csrf: String, |
| 74 | - settings: Option<String>, | 100 | + status: TransferStatus, |
| 101 | + new_owner: String, | ||
| 102 | + error: Option<String>, | ||
| 75 | ) -> Result<impl View> { | 103 | ) -> Result<impl View> { |
| 104 | + let action = format!("/{title}/settings/transfer"); | ||
| 105 | + let open = error.is_some(); | ||
| 76 | Ok(view! { | 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"> | 107 | <section class="sec"> |
| 80 | <h2>(g::t(lang, K::TransferTitle))</h2> | 108 | <h2>(g::t(lang, K::TransferTitle))</h2> |
| 81 | - if let Some(summary) = summary.as_ref() { | 109 | + if let Some(summary) = status.summary.as_ref() { |
| 82 | <p class="state">(summary.before.as_str()) rel_time(lang: lang, stamp: summary.expires_at.as_str()) (summary.after)</p> | 110 | <p class="state">(summary.before.as_str()) rel_time(lang: lang, stamp: summary.expires_at.as_str()) (summary.after)</p> |
| 83 | <div class="acts"> | 111 | <div class="acts"> |
| 84 | - if let Some(action) = accept { | 112 | + if let Some(accept) = status.accept.as_ref() { |
| 85 | - post_act(label: g::t(lang, K::AcceptTransfer), action: action.as_str(), csrf: csrf.as_str()) | 113 | + post_act(label: g::t(lang, K::AcceptTransfer), action: accept.as_str(), csrf: csrf.as_str()) |
| 86 | } | 114 | } |
| 87 | - if let Some(action) = decline { | 115 | + if let Some(decline) = status.decline.as_ref() { |
| 88 | - confirm_act(lang: lang, label: g::t(lang, K::DeclineTransfer), action: action.as_str(), csrf: csrf.as_str()) | 116 | + confirm_act(lang: lang, label: g::t(lang, K::DeclineTransfer), action: decline.as_str(), csrf: csrf.as_str()) |
| 89 | } | 117 | } |
| 90 | - if let Some(action) = cancel { | 118 | + if let Some(cancel) = status.cancel.as_ref() { |
| 91 | - confirm_act(lang: lang, label: g::t(lang, K::CancelTransfer), action: action.as_str(), csrf: csrf.as_str()) | 119 | + confirm_act(lang: lang, label: g::t(lang, K::CancelTransfer), action: cancel.as_str(), csrf: csrf.as_str()) |
| 92 | } | 120 | } |
| 93 | </div> | 121 | </div> |
| 94 | } | 122 | } |
| 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"> | 123 | <div class="acts"> |
| 100 | - <a class="act" href=(href.as_str())>(g::t(lang, K::StartTransferLink))</a> | 124 | + reveal(label: g::t(lang, K::TransferRepo), open: open, |
| 101 | - </div> | 125 | + if let Some(message) = error { |
| 126 | + alert(message: message.as_str()) | ||
| 102 | } | 127 | } |
| 103 | - </section> | 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 | + ) | ||
| 104 | </div> | 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 | 146 | +/// The transfer page moved into the danger zone; the old address goes there. |
| 109 | -/// 404 from `load_repo`. | 147 | +#[route(GET "/{owner}/{repo}/transfer")] |
| 110 | -#[page("/{owner}/{repo}/transfer")] | 148 | +async fn transfer_get(cx: &Cx) -> Result<SeeOther> { |
| 111 | -async fn transfer_get(cx: &Cx) -> Result<impl View> { | ||
| 112 | let owner = path_param::<Owner>(cx); | 149 | let owner = path_param::<Owner>(cx); |
| 113 | - let name = path_param::<Repo>(cx); | 150 | + let repo = path_param::<Repo>(cx); |
| 114 | - let ctx = load_repo(cx, owner, name).await?; | 151 | + Ok(see_other(format!("/{owner}/{repo}/settings?section=danger"))) |
| 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 | - }) | ||
| 145 | } | 152 | } |
| 146 | 153 | ||
| 147 | /// The open transfer `repo_id`, or `NotFound`. | 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 | .await; | 260 | .await; |
| 254 | Ok(see_other(format!( | 261 | Ok(see_other(format!( |
| 255 | - "/{}/{}/transfer", | 262 | + "/{}/{}/settings?section=danger", |
| 256 | pending.from_owner_name, pending.repo_name | 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 | #[default] action: Option<(String, &'static str)>, | 499 | #[default] action: Option<(String, &'static str)>, |
| 500 | #[default] child: Child<'_>, | 500 | #[default] child: Child<'_>, |
| 501 | ) -> Result<impl View> { | 501 | ) -> Result<impl View> { |
| 502 | - let can_delete = head.can_delete; | ||
| 503 | Ok(view! { | 502 | Ok(view! { |
| 504 | repo_head(head: head, title: Some(heading), | 503 | repo_head(head: head, title: Some(heading), |
| 505 | if let Some((href, label)) = action { | 504 | if let Some((href, label)) = action { |
| 506 | <a class="button primary" href=(href.as_str())>(label)</a> | 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 | if let Some((text, is_error)) = notice { | 509 | if let Some((text, is_error)) = notice { |
| 511 | if is_error { | 510 | if is_error { |
| 512 | alert(message: text) | 511 | alert(message: text) |
| @@ -546,12 +545,13 @@ async fn hook_form( | |||
| 546 | <div class="field"> | 545 | <div class="field"> |
| 547 | <label for="hook-url">(g::t(lang, K::PayloadUrl))</label> | 546 | <label for="hook-url">(g::t(lang, K::PayloadUrl))</label> |
| 548 | <input id="hook-url" type="url" name="url" value=(url.as_str()) autocomplete="off" spellcheck="false" required=(true)> | 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 | </div> | 548 | </div> |
| 551 | <div class="field"> | 549 | <div class="field"> |
| 552 | <label for="hook-secret">(g::t(lang, K::Secret))</label> | 550 | <label for="hook-secret">(g::t(lang, K::Secret))</label> |
| 553 | <input id="hook-secret" type="password" name="secret" autocomplete="new-password" maxlength="256"> | 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 | </div> | 555 | </div> |
| 556 | </section> | 556 | </section> |
| 557 | <section class="sec"> | 557 | <section class="sec"> |
| @@ -599,8 +599,6 @@ async fn hooks_list_body( | |||
| 599 | <section class="sec"> | 599 | <section class="sec"> |
| 600 | if empty { | 600 | if empty { |
| 601 | <p class="state">(g::t(lang, K::NoWebhooks))</p> | 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 | for row in rows.iter() { | 603 | for row in rows.iter() { |
| 606 | <a class="line" href=(row.href.as_str()) data-kb-row=""> | 604 | <a class="line" href=(row.href.as_str()) data-kb-row=""> |
| @@ -646,7 +644,7 @@ async fn delivery_list( | |||
| 646 | <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> | 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 | </summary> | 645 | </summary> |
| 648 | <div class="opened"> | 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 | <h3 class="part-title">(g::t(lang, K::RequestHeaders))</h3> | 648 | <h3 class="part-title">(g::t(lang, K::RequestHeaders))</h3> |
| 651 | <pre class="code">(row.request_headers.as_str())</pre> | 649 | <pre class="code">(row.request_headers.as_str())</pre> |
| 652 | <h3 class="part-title">(g::t(lang, K::RequestBody))</h3> | 650 | <h3 class="part-title">(g::t(lang, K::RequestBody))</h3> |
| @@ -655,7 +653,7 @@ async fn delivery_list( | |||
| 655 | if !row.error.is_empty() { | 653 | if !row.error.is_empty() { |
| 656 | alert(message: row.error.as_str()) | 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 | <h3 class="part-title">(g::t(lang, K::ResponseHeaders))</h3> | 657 | <h3 class="part-title">(g::t(lang, K::ResponseHeaders))</h3> |
| 660 | <pre class="code">(row.response_headers.as_str())</pre> | 658 | <pre class="code">(row.response_headers.as_str())</pre> |
| 661 | <h3 class="part-title">(g::t(lang, K::ResponseBody))</h3> | 659 | <h3 class="part-title">(g::t(lang, K::ResponseBody))</h3> |
| @@ -700,7 +698,6 @@ async fn hook_body( | |||
| 700 | <section class="sec"> | 698 | <section class="sec"> |
| 701 | <h2>(crate::pages::passkeys::s(lang, "Endpoint", "Uç nokta"))</h2> | 699 | <h2>(crate::pages::passkeys::s(lang, "Endpoint", "Uç nokta"))</h2> |
| 702 | <p class="state">(draft.url.as_str())</p> | 700 | <p class="state">(draft.url.as_str())</p> |
| 703 | - <p class="hint">(g::t(lang, K::ArchivedHookNote))</p> | ||
| 704 | </section> | 701 | </section> |
| 705 | } else { | 702 | } else { |
| 706 | hook_form(action: edit_action.clone(), csrf: csrf.clone(), url: draft.url, | 703 | hook_form(action: edit_action.clone(), csrf: csrf.clone(), url: draft.url, |
| @@ -710,7 +707,6 @@ async fn hook_body( | |||
| 710 | if !archived { | 707 | if !archived { |
| 711 | <section class="sec"> | 708 | <section class="sec"> |
| 712 | <h2>(g::t(lang, K::Test))</h2> | 709 | <h2>(g::t(lang, K::Test))</h2> |
| 713 | - <p class="hint">(g::t(lang, K::TestIntro))</p> | ||
| 714 | <div class="acts"> | 710 | <div class="acts"> |
| 715 | post_act(label: g::t(lang, K::SendTestPing), action: test_action.as_str(), csrf: csrf.as_str()) | 711 | post_act(label: g::t(lang, K::SendTestPing), action: test_action.as_str(), csrf: csrf.as_str()) |
| 716 | </div> | 712 | </div> |
| @@ -718,15 +714,13 @@ async fn hook_body( | |||
| 718 | } | 714 | } |
| 719 | <section class="sec"> | 715 | <section class="sec"> |
| 720 | <h2>(g::t(lang, K::RecentDeliveries))</h2> | 716 | <h2>(g::t(lang, K::RecentDeliveries))</h2> |
| 721 | - <p class="hint">(g::recent_deliveries(lang, DELIVERIES_SHOWN))</p> | ||
| 722 | delivery_list(deliveries: deliveries, csrf: csrf.clone(), archived: archived, lang: lang) | 717 | delivery_list(deliveries: deliveries, csrf: csrf.clone(), archived: archived, lang: lang) |
| 723 | </section> | 718 | </section> |
| 724 | if !archived { | 719 | if !archived { |
| 725 | <section class="sec"> | 720 | <section class="sec"> |
| 726 | <h2>(g::t(lang, K::DeleteWebhook))</h2> | 721 | <h2>(g::t(lang, K::DeleteWebhook))</h2> |
| 727 | - <p class="hint">(g::t(lang, K::DeleteIntro))</p> | ||
| 728 | <div class="acts"> | 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 | </div> | 724 | </div> |
| 731 | </section> | 725 | </section> |
| 732 | } | 726 | } |
| @@ -812,13 +806,12 @@ async fn hook_new_body( | |||
| 812 | Ok(view! { | 806 | Ok(view! { |
| 813 | frame_top(head: head, title: title.clone(), heading: g::t(lang, K::AddWebhook).to_owned(), notice: None, archived: archived, lang: lang, | 807 | frame_top(head: head, title: title.clone(), heading: g::t(lang, K::AddWebhook).to_owned(), notice: None, archived: archived, lang: lang, |
| 814 | <section class="sec"> | 808 | <section class="sec"> |
| 815 | - <p class="hint">(g::t(lang, K::AddWebhookIntro))</p> | ||
| 816 | <div class="acts"> | 809 | <div class="acts"> |
| 817 | <a class="act quiet" href=(back.as_str())>(g::t(lang, K::BackToWebhooks))</a> | 810 | <a class="act quiet" href=(back.as_str())>(g::t(lang, K::BackToWebhooks))</a> |
| 818 | </div> | 811 | </div> |
| 819 | </section> | 812 | </section> |
| 820 | hook_form(action: action, csrf: csrf, url: draft.url, events: events, | 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 | error: draft.error, submit: g::t(lang, K::CreateWebhook), lang: lang) | 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 | use crate::auth::{current_user, require_user}; | 18 | use crate::auth::{current_user, require_user}; |
| 19 | use crate::i18n::authoring::{self as ga, K as AK}; | 19 | use crate::i18n::authoring::{self as ga, K as AK}; |
| 20 | +use crate::i18n::issues::{self as ig, K as IK}; | ||
| 20 | use crate::i18n::{self, Lang}; | 21 | use crate::i18n::{self, Lang}; |
| 21 | use crate::live::{Topic, stream_wakes}; | 22 | use crate::live::{Topic, stream_wakes}; |
| 22 | use crate::notify; | 23 | use crate::notify; |
| 23 | use crate::pages::issue_parts::{ItemKind, check_write, may_change, parse_number}; | 24 | use crate::pages::issue_parts::{ItemKind, check_write, may_change, parse_number}; |
| 24 | -use crate::pages::passkeys::s; | ||
| 25 | use crate::pages::repo_ctx::{RepoCtx, load_repo}; | 25 | use crate::pages::repo_ctx::{RepoCtx, load_repo}; |
| 26 | use crate::state::AppState; | 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 | use crate::views::{alert, rel_time, repo_href, shell}; | 28 | use crate::views::{alert, rel_time, repo_href, shell}; |
| 29 | 29 | ||
| 30 | path_param!(owner); | 30 | path_param!(owner); |
| @@ -210,15 +210,17 @@ pub(crate) async fn reviewers_box(lang: Lang, reviewers: ReviewersView) -> Resul | |||
| 210 | error, | 210 | error, |
| 211 | } = reviewers; | 211 | } = reviewers; |
| 212 | let message = error.map(|code| error_text(lang, code)); | 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 | Ok(view! { | 218 | Ok(view! { |
| 214 | <section class="sec meta" id="reviewers"> | 219 | <section class="sec meta" id="reviewers"> |
| 215 | <h2>(ga::t(lang, AK::Reviewers))</h2> | 220 | <h2>(ga::t(lang, AK::Reviewers))</h2> |
| 216 | if let Some(message) = message { | 221 | if let Some(message) = message { |
| 217 | alert(message: message) | 222 | alert(message: message) |
| 218 | } | 223 | } |
| 219 | - if names.is_empty() { | ||
| 220 | - <p class="hint">(ga::t(lang, AK::NoReviewers))</p> | ||
| 221 | - } | ||
| 222 | for name in names.iter() { | 224 | for name in names.iter() { |
| 223 | <div class="line"> | 225 | <div class="line"> |
| 224 | <span class="name"><a href=(format!("/{name}"))>(name.as_str())</a></span> | 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 | </div> | 230 | </div> |
| 229 | } | 231 | } |
| 230 | if write { | 232 | if write { |
| 231 | - <div class="acts"> | 233 | + <div class="line"> |
| 232 | - reveal(label: ga::t(lang, AK::RequestReview), id: Some("request-review"), | 234 | + reveal(label: tool, id: Some("request-review"), |
| 233 | <form method="post" action=(action.as_str()) class="fields"> | 235 | <form method="post" action=(action.as_str()) class="fields"> |
| 234 | <input type="hidden" name="csrf" value=(csrf.as_str())> | 236 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 235 | <div class="field"> | 237 | <div class="field"> |
| @@ -287,14 +289,9 @@ async fn review_requests(cx: &Cx) -> Result<impl View> { | |||
| 287 | let heading = ga::t(lang, AK::ReviewRequests); | 289 | let heading = ga::t(lang, AK::ReviewRequests); |
| 288 | let empty = rows.is_empty(); | 290 | let empty = rows.is_empty(); |
| 289 | let unread = state.store.unread_count(&user.id).await?; | 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 | Ok(view! { | 292 | Ok(view! { |
| 296 | shell(title: heading, viewer: Some(&viewer), | 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 | <div class="work"> | 295 | <div class="work"> |
| 299 | crate::pages::notifications::inbox_rail(lang: lang, current: "reviews", unread_count: unread) | 296 | crate::pages::notifications::inbox_rail(lang: lang, current: "reviews", unread_count: unread) |
| 300 | <div class="sheet"> | 297 | <div class="sheet"> |
crates/forge-web/src/pages/settings_appearance.rsmodified+4 -17
| @@ -98,7 +98,7 @@ struct Stripe { | |||
| 98 | const ACCENT_VIVID: u8 = 50; | 98 | const ACCENT_VIVID: u8 = 50; |
| 99 | const BASE_VIVID: u8 = 30; | 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 | fn row_lightness(base: bool, dark: bool) -> f64 { | 102 | fn row_lightness(base: bool, dark: bool) -> f64 { |
| 103 | match (base, dark) { | 103 | match (base, dark) { |
| 104 | (false, true) => 0.75, | 104 | (false, true) => 0.75, |
| @@ -133,7 +133,6 @@ struct ColourGroup { | |||
| 133 | hue: &'static str, | 133 | hue: &'static str, |
| 134 | vividness: &'static str, | 134 | vividness: &'static str, |
| 135 | hex: &'static str, | 135 | hex: &'static str, |
| 136 | - note: &'static str, | ||
| 137 | bases: Vec<Choice>, | 136 | bases: Vec<Choice>, |
| 138 | accents: Vec<Choice>, | 137 | accents: Vec<Choice>, |
| 139 | base_stripe: Stripe, | 138 | base_stripe: Stripe, |
| @@ -153,7 +152,6 @@ struct ColourRow { | |||
| 153 | hue_label: &'static str, | 152 | hue_label: &'static str, |
| 154 | vivid_label: &'static str, | 153 | vivid_label: &'static str, |
| 155 | hex_label: &'static str, | 154 | hex_label: &'static str, |
| 156 | - note: &'static str, | ||
| 157 | } | 155 | } |
| 158 | 156 | ||
| 159 | struct AppearancePage { | 157 | struct AppearancePage { |
| @@ -274,7 +272,6 @@ fn colour_group(lang: Lang, dark: bool, base: &str, accent_id: &str) -> ColourGr | |||
| 274 | hue: g::t(lang, K::HueLabel), | 272 | hue: g::t(lang, K::HueLabel), |
| 275 | vividness: g::t(lang, K::VividnessLabel), | 273 | vividness: g::t(lang, K::VividnessLabel), |
| 276 | hex: g::t(lang, K::HexLabel), | 274 | hex: g::t(lang, K::HexLabel), |
| 277 | - note: g::t(lang, K::LightnessNote), | ||
| 278 | bases: with_hues( | 275 | bases: with_hues( |
| 279 | choices(&base_codes, base_shown, |id| base_name(lang, id)), | 276 | choices(&base_codes, base_shown, |id| base_name(lang, id)), |
| 280 | preset_base_hue, | 277 | preset_base_hue, |
| @@ -304,7 +301,6 @@ async fn colour_row(row: ColourRow) -> Result<impl View> { | |||
| 304 | hue_label, | 301 | hue_label, |
| 305 | vivid_label, | 302 | vivid_label, |
| 306 | hex_label, | 303 | hex_label, |
| 307 | - note, | ||
| 308 | } = row; | 304 | } = row; |
| 309 | let value = custom_id(stripe.hue, stripe.vivid); | 305 | let value = custom_id(stripe.hue, stripe.vivid); |
| 310 | let hue_value = stripe.hue.to_string(); | 306 | let hue_value = stripe.hue.to_string(); |
| @@ -353,7 +349,6 @@ async fn colour_row(row: ColourRow) -> Result<impl View> { | |||
| 353 | <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"> | 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 | <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"> | 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 | </div> | 351 | </div> |
| 356 | - <small class="hex-note" data-hex-note="true" data-message=(note)></small> | ||
| 357 | </div> | 352 | </div> |
| 358 | </div> | 353 | </div> |
| 359 | </div> | 354 | </div> |
| @@ -372,7 +367,6 @@ async fn colour_panel(group: ColourGroup) -> Result<impl View> { | |||
| 372 | hue, | 367 | hue, |
| 373 | vividness, | 368 | vividness, |
| 374 | hex, | 369 | hex, |
| 375 | - note, | ||
| 376 | bases, | 370 | bases, |
| 377 | accents, | 371 | accents, |
| 378 | base_stripe, | 372 | base_stripe, |
| @@ -392,7 +386,6 @@ async fn colour_panel(group: ColourGroup) -> Result<impl View> { | |||
| 392 | hue_label: hue, | 386 | hue_label: hue, |
| 393 | vivid_label: vividness, | 387 | vivid_label: vividness, |
| 394 | hex_label: hex, | 388 | hex_label: hex, |
| 395 | - note, | ||
| 396 | }; | 389 | }; |
| 397 | let accent_row = ColourRow { | 390 | let accent_row = ColourRow { |
| 398 | dark, | 391 | dark, |
| @@ -405,7 +398,6 @@ async fn colour_panel(group: ColourGroup) -> Result<impl View> { | |||
| 405 | hue_label: hue, | 398 | hue_label: hue, |
| 406 | vivid_label: vividness, | 399 | vivid_label: vividness, |
| 407 | hex_label: hex, | 400 | hex_label: hex, |
| 408 | - note, | ||
| 409 | }; | 401 | }; |
| 410 | Ok(view! { | 402 | Ok(view! { |
| 411 | <div class="colour-panel" data-colour-panel=(panel)> | 403 | <div class="colour-panel" data-colour-panel=(panel)> |
| @@ -490,9 +482,8 @@ async fn appearance_body(page: AppearancePage) -> Result<impl View> { | |||
| 490 | <span>(s(lang, "Off", "Kapalı"))</span> | 482 | <span>(s(lang, "Off", "Kapalı"))</span> |
| 491 | </label> | 483 | </label> |
| 492 | </div> | 484 | </div> |
| 493 | - <span class="hint">(g::t(lang, K::SoundOwnRuns))</span> | 485 | + <button type="button" class="act play" data-sound-play="passed">(g::t(lang, K::SoundPassed))</button> |
| 494 | - <button type="button" class="act play" data-sound-play="passed" title=(g::t(lang, K::SoundPassedNote))>(g::t(lang, K::SoundPassed))</button> | 486 | + <button type="button" class="act play" data-sound-play="failed">(g::t(lang, K::SoundFailed))</button> |
| 495 | - <button type="button" class="act play" data-sound-play="failed" title=(g::t(lang, K::SoundFailedNote))>(g::t(lang, K::SoundFailed))</button> | ||
| 496 | </div> | 487 | </div> |
| 497 | </div> | 488 | </div> |
| 498 | </section> | 489 | </section> |
| @@ -605,11 +596,7 @@ async fn appearance_page(cx: &Cx) -> Result<impl View> { | |||
| 605 | .user_prefs(&viewer.0.id) | 596 | .user_prefs(&viewer.0.id) |
| 606 | .await?; | 597 | .await?; |
| 607 | let page = page_for(&viewer, lang, &prefs); | 598 | let page = page_for(&viewer, lang, &prefs); |
| 608 | - let sub = vec![SubPart::text(s( | 599 | + let sub = Vec::<SubPart>::new(); |
| 609 | - lang, | ||
| 610 | - "Saved to your account, follows you on every device", | ||
| 611 | - "Hesabına kaydedilir, her cihazda seninle gelir", | ||
| 612 | - ))]; | ||
| 613 | Ok(view! { | 600 | Ok(view! { |
| 614 | shell(title: g::t(lang, K::Appearance), viewer: Some(&viewer), | 601 | shell(title: g::t(lang, K::Appearance), viewer: Some(&viewer), |
| 615 | head(title: g::t(lang, K::Appearance), sub: sub) | 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 | //! profile, watch it build, and download it until it expires. The page follows an event stream | 2 | //! profile, watch it build, and download it until it expires. The page follows an event stream |
| 3 | //! while an export is building, so it turns ready with no reload and no polling. | 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 | use forge_core::store::exports::{DataExport, ExportState}; | 7 | use forge_core::store::exports::{DataExport, ExportState}; |
| 8 | +use forge_core::{Session, User}; | ||
| 6 | use futures_util::{TryStreamExt, stream}; | 9 | use futures_util::{TryStreamExt, stream}; |
| 7 | use http::header::{ | 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 | X_CONTENT_TYPE_OPTIONS, | 12 | X_CONTENT_TYPE_OPTIONS, |
| 10 | }; | 13 | }; |
| 11 | use http_body::Frame; | 14 | use http_body::Frame; |
| @@ -17,16 +20,16 @@ use topcoat::context::{Cx, app_context}; | |||
| 17 | use topcoat::router::content::Form; | 20 | use topcoat::router::content::Form; |
| 18 | use topcoat::router::error::{SeeOther, not_found, see_other}; | 21 | use topcoat::router::error::{SeeOther, not_found, see_other}; |
| 19 | use topcoat::router::response::Response; | 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 | use topcoat::view::{View, component, view}; | 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 | use crate::exporter; | 27 | use crate::exporter; |
| 25 | use crate::i18n::migrate::{self as g, K}; | 28 | use crate::i18n::migrate::{self as g, K}; |
| 26 | -use crate::i18n::{self, Lang}; | 29 | +use crate::i18n::{self, Key, Lang}; |
| 27 | use crate::pages::ci_runs::{changed_event, events_response}; | 30 | use crate::pages::ci_runs::{changed_event, events_response}; |
| 28 | use crate::state::AppState; | 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 | use crate::views::{alert, csrf_field, human_size, rel_time, shell}; | 33 | use crate::views::{alert, csrf_field, human_size, rel_time, shell}; |
| 31 | 34 | ||
| 32 | path_param!(export_id); | 35 | path_param!(export_id); |
| @@ -42,6 +45,11 @@ struct SeenQuery { | |||
| 42 | v: Option<String>, | 45 | v: Option<String>, |
| 43 | } | 46 | } |
| 44 | 47 | ||
| 48 | +#[query_params(error = bad_request)] | ||
| 49 | +struct TopicQuery { | ||
| 50 | + part: Option<String>, | ||
| 51 | +} | ||
| 52 | + | ||
| 45 | /// One word per export and its state, so the stream can tell the page is out of date. | 53 | /// One word per export and its state, so the stream can tell the page is out of date. |
| 46 | fn signature(exports: &[DataExport]) -> String { | 54 | fn signature(exports: &[DataExport]) -> String { |
| 47 | exports | 55 | exports |
| @@ -51,8 +59,27 @@ fn signature(exports: &[DataExport]) -> String { | |||
| 51 | .join(",") | 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 | #[component] | 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 | let building = exports.iter().any(|e| e.state == ExportState::Building); | 83 | let building = exports.iter().any(|e| e.state == ExportState::Building); |
| 57 | let live = building.then(|| { | 84 | let live = building.then(|| { |
| 58 | format!( | 85 | format!( |
| @@ -65,20 +92,8 @@ async fn export_view(lang: Lang, csrf: &str, exports: Vec<DataExport>) -> Result | |||
| 65 | .iter() | 92 | .iter() |
| 66 | .map(|e| format!("/settings/export/{}/delete", e.id)) | 93 | .map(|e| format!("/settings/export/{}/delete", e.id)) |
| 67 | .collect(); | 94 | .collect(); |
| 68 | - let ttl_note = g::export_ttl_note(lang, exporter::EXPORT_TTL_DAYS); | ||
| 69 | Ok(view! { | 95 | Ok(view! { |
| 70 | - head(title: g::t(lang, K::ExportTitle), sub: vec![SubPart::text(g::t(lang, K::ExportIntro))], | 96 | + <div class="sheet export-page" data-live=(live.as_deref()) data-live-state=(if building { "building" } else { "idle" })> |
| 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> | ||
| 82 | <section class="sec"> | 97 | <section class="sec"> |
| 83 | <h2>(crate::pages::passkeys::s(lang, "Your archives", "Arşivleriniz"))</h2> | 98 | <h2>(crate::pages::passkeys::s(lang, "Your archives", "Arşivleriniz"))</h2> |
| 84 | if empty { | 99 | if empty { |
| @@ -104,7 +119,7 @@ async fn export_view(lang: Lang, csrf: &str, exports: Vec<DataExport>) -> Result | |||
| 104 | <a class="act" href=(format!("/settings/export/{}/download", export.id))>(g::t(lang, K::ExportDownload))</a> | 119 | <a class="act" href=(format!("/settings/export/{}/download", export.id))>(g::t(lang, K::ExportDownload))</a> |
| 105 | } | 120 | } |
| 106 | if export.state != ExportState::Building { | 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 | </div> | 124 | </div> |
| 110 | if export.state == ExportState::Building { | 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 | #[page("/settings/export")] | 286 | #[page("/settings/export")] |
| 124 | async fn export_page(cx: &Cx) -> Result<impl View> { | 287 | async fn export_page(cx: &Cx) -> Result<impl View> { |
| 125 | let viewer = require_user(cx).await?; | 288 | let viewer = require_user(cx).await?; |
| 126 | - let lang = i18n::lang(cx, Some(&viewer.0)); | ||
| 127 | let state = app_context::<AppState>(cx); | 289 | let state = app_context::<AppState>(cx); |
| 128 | exporter::sweep_expired(state).await; | 290 | exporter::sweep_expired(state).await; |
| 129 | - let exports = state.store.list_exports(&viewer.0.id).await?; | 291 | + let query = query_params::<TopicQuery>(cx)?; |
| 130 | - let csrf = viewer.1.csrf_token.clone(); | 292 | + page_view(cx, viewer, query.part.as_deref() == Some("delete"), None, None).await |
| 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 | - }) | ||
| 135 | } | 293 | } |
| 136 | 294 | ||
| 137 | #[route(POST "/settings/export")] | 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 | <div class="field"> | 62 | <div class="field"> |
| 63 | <label for="gpg-key">(t(lang, Key::ArmoredPublicKeyLabel))</label> | 63 | <label for="gpg-key">(t(lang, Key::ArmoredPublicKeyLabel))</label> |
| 64 | <textarea id="gpg-key" name="armored" rows="8" spellcheck="false" required=(true)>(armored)</textarea> | 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 | </div> | 65 | </div> |
| 67 | <div class="acts asks"> | 66 | <div class="acts asks"> |
| 68 | <button type="submit" class="primary">(t(lang, Key::AddKeyButton))</button> | 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 | KeyKind::Tokens => t(lang, Key::NewToken), | 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 | #[query_params(error = bad_request)] | 190 | #[query_params(error = bad_request)] |
| @@ -236,10 +220,7 @@ pub(crate) async fn keys_page_view( | |||
| 236 | current: k == kind, | 220 | current: k == kind, |
| 237 | }) | 221 | }) |
| 238 | .collect(); | 222 | .collect(); |
| 239 | - let sub = vec![ | 223 | + let sub = Vec::<SubPart>::new(); |
| 240 | - SubPart::text(kind.about(lang)), | ||
| 241 | - SubPart::text(key_count(lang, count(kind))), | ||
| 242 | - ]; | ||
| 243 | let add_href = format!("{}?add", kind.href()); | 224 | let add_href = format!("{}?add", kind.href()); |
| 244 | let add_open = draft.add | 225 | let add_open = draft.add |
| 245 | || draft.ssh_error.is_some() | 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 | fn pk_title(lang: Lang) -> &'static str { | 252 | fn pk_title(lang: Lang) -> &'static str { |
| 280 | crate::pages::passkeys::s(lang, "Keys", "Anahtarlar") | 253 | crate::pages::passkeys::s(lang, "Keys", "Anahtarlar") |
| 281 | } | 254 | } |
| @@ -305,7 +278,6 @@ async fn ssh_section( | |||
| 305 | <div class="field"> | 278 | <div class="field"> |
| 306 | <label for="ssh-key">(t(lang, Key::PublicKeyLabel))</label> | 279 | <label for="ssh-key">(t(lang, Key::PublicKeyLabel))</label> |
| 307 | <textarea id="ssh-key" name="public_key" rows="4" spellcheck="false" required=(true)>(public_key)</textarea> | 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 | </div> | 281 | </div> |
| 310 | <div class="acts asks"> | 282 | <div class="acts asks"> |
| 311 | <button type="submit" class="primary">(t(lang, Key::AddKeyButton))</button> | 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 | // locked and the notes below say why. | 71 | // locked and the notes below say why. |
| 72 | let blocked = unverified_note.is_some() || server_note.is_some(); | 72 | let blocked = unverified_note.is_some() || server_note.is_some(); |
| 73 | Ok(view! { | 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 | if let Some(message) = notice { | 75 | if let Some(message) = notice { |
| 76 | <p class="state" role="status">(message.as_str())</p> | 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 | <input type="checkbox" form="notify-form" name="email_notifications" value="1" checked=(on) disabled=(blocked) data-autosubmit="true"> | 85 | <input type="checkbox" form="notify-form" name="email_notifications" value="1" checked=(on) disabled=(blocked) data-autosubmit="true"> |
| 86 | <span>(t(lang, Key::EmailNotifyLabel))</span> | 86 | <span>(t(lang, Key::EmailNotifyLabel))</span> |
| 87 | </label> | 87 | </label> |
| 88 | - <p class="hint">(t(lang, Key::EmailNotifyHelp))</p> | ||
| 89 | if let Some(message) = server_note { | 88 | if let Some(message) = server_note { |
| 90 | <p class="hint warn" role="note">(message)</p> | 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 | <h2>(push_text::t(lang, push_text::K::DeviceHeading))</h2> | 101 | <h2>(push_text::t(lang, push_text::K::DeviceHeading))</h2> |
| 103 | <p class="state" data-push-state="on" hidden=(true)>(push_text::t(lang, push_text::K::DeviceOn))</p> | 102 | <p class="state" data-push-state="on" hidden=(true)>(push_text::t(lang, push_text::K::DeviceOn))</p> |
| 104 | <p class="state" data-push-state="off" hidden=(true)>(push_text::t(lang, push_text::K::DeviceOff))</p> | 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 | <p class="hint" role="note" data-push-state="unsupported" hidden=(true)>(push_text::t(lang, push_text::K::DeviceUnsupported))</p> | 104 | <p class="hint" role="note" data-push-state="unsupported" hidden=(true)>(push_text::t(lang, push_text::K::DeviceUnsupported))</p> |
| 107 | <p class="hint" role="note" data-push-state="https" hidden=(true)>(push_text::t(lang, push_text::K::DeviceNeedsHttps))</p> | 105 | <p class="hint" role="note" data-push-state="https" hidden=(true)>(push_text::t(lang, push_text::K::DeviceNeedsHttps))</p> |
| 108 | <p class="hint" role="note" data-push-state="ios" hidden=(true)>(push_text::t(lang, push_text::K::DeviceIosHint))</p> | 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 | use crate::auth::{require_csrf, require_user}; | 23 | use crate::auth::{require_csrf, require_user}; |
| 24 | use crate::i18n::{self, Key, Lang, about_too_long, display_name_too_long, t}; | 24 | use crate::i18n::{self, Key, Lang, about_too_long, display_name_too_long, t}; |
| 25 | use crate::live::Topic; | 25 | use crate::live::Topic; |
| 26 | -use crate::pages::passkeys::s; | ||
| 27 | use crate::state::AppState; | 26 | use crate::state::AppState; |
| 28 | use crate::views::parts::{SubPart, confirm_act, head, reveal}; | 27 | use crate::views::parts::{SubPart, confirm_act, head, reveal}; |
| 29 | use crate::views::{alert, avatar_url, shell, user_facing_message}; | 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 | } = page; | 140 | } = page; |
| 142 | let avatar_open = errors.avatar.is_some(); | 141 | let avatar_open = errors.avatar.is_some(); |
| 143 | Ok(view! { | 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 | if let Some(message) = notice { | 144 | if let Some(message) = notice { |
| 146 | <p class="state" role="status">(message)</p> | 145 | <p class="state" role="status">(message)</p> |
| 147 | } | 146 | } |
| @@ -149,7 +148,6 @@ async fn profile_body(page: ProfilePage) -> Result<impl View> { | |||
| 149 | <section class="sec"> | 148 | <section class="sec"> |
| 150 | <h2>(t(lang, Key::Avatar))</h2> | 149 | <h2>(t(lang, Key::Avatar))</h2> |
| 151 | <img class="avatar" src=(avatar_src.as_str()) alt=(t(lang, Key::AvatarAlt)) width="48" height="48"> | 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 | <div class="acts"> | 151 | <div class="acts"> |
| 154 | reveal(label: t(lang, Key::UploadPhoto), open: avatar_open, | 152 | reveal(label: t(lang, Key::UploadPhoto), open: avatar_open, |
| 155 | if let Some(message) = errors.avatar { | 153 | if let Some(message) = errors.avatar { |
| @@ -174,8 +172,7 @@ async fn profile_body(page: ProfilePage) -> Result<impl View> { | |||
| 174 | <section class="sec"> | 172 | <section class="sec"> |
| 175 | <div class="field"> | 173 | <div class="field"> |
| 176 | <label for="profile-display-name">(t(lang, Key::DisplayName))</label> | 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"> | 175 | + <input id="profile-display-name" type="text" name="display_name" maxlength="80" autocomplete="name" value=(draft.display_name.as_str())> |
| 178 | - <p class="hint" id="profile-display-name-hint">(t(lang, Key::DisplayNameHint))</p> | ||
| 179 | </div> | 176 | </div> |
| 180 | if let Some(message) = errors.display_name { | 177 | if let Some(message) = errors.display_name { |
| 181 | alert(message: message.as_str()) | 178 | alert(message: message.as_str()) |
| @@ -184,8 +181,7 @@ async fn profile_body(page: ProfilePage) -> Result<impl View> { | |||
| 184 | <section class="sec"> | 181 | <section class="sec"> |
| 185 | <div class="field"> | 182 | <div class="field"> |
| 186 | <label for="profile-username">(t(lang, Key::Username))</label> | 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"> | 184 | + <input id="profile-username" type="text" name="username" maxlength="64" required=(true) autocomplete="username" value=(draft.username.as_str())> |
| 188 | - <p class="hint" id="profile-username-hint">(t(lang, Key::UsernameHint))</p> | ||
| 189 | </div> | 185 | </div> |
| 190 | if let Some(message) = errors.username { | 186 | if let Some(message) = errors.username { |
| 191 | alert(message: message.as_str()) | 187 | alert(message: message.as_str()) |
| @@ -194,8 +190,7 @@ async fn profile_body(page: ProfilePage) -> Result<impl View> { | |||
| 194 | <section class="sec"> | 190 | <section class="sec"> |
| 195 | <div class="field"> | 191 | <div class="field"> |
| 196 | <label for="profile-about">(t(lang, Key::About))</label> | 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> | 193 | + <textarea id="profile-about" name="about" rows="6" maxlength="2000">(draft.about.as_str())</textarea> |
| 198 | - <p class="hint" id="profile-about-hint">(t(lang, Key::AboutHint))</p> | ||
| 199 | </div> | 194 | </div> |
| 200 | if let Some(message) = errors.about { | 195 | if let Some(message) = errors.about { |
| 201 | alert(message: message.as_str()) | 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 | use crate::i18n::releases_ci::{self as rc, K as RC}; | 26 | use crate::i18n::releases_ci::{self as rc, K as RC}; |
| 27 | use crate::i18n::{self, Key, Lang, password_too_long, password_too_short, t}; | 27 | use crate::i18n::{self, Key, Lang, password_too_long, password_too_short, t}; |
| 28 | use crate::pages::passkeys::{PasskeyPanel, build_panel, passkeys_panel, s}; | 28 | use crate::pages::passkeys::{PasskeyPanel, build_panel, passkeys_panel, s}; |
| 29 | +use crate::pages::settings_export; | ||
| 29 | use crate::pages::settings_sessions::session_label; | 30 | use crate::pages::settings_sessions::session_label; |
| 30 | use crate::state::AppState; | 31 | use crate::state::AppState; |
| 31 | use crate::throttle::{self, LOGIN_USER_LIMIT, TWO_FACTOR_USER_LIMIT}; | 32 | use crate::throttle::{self, LOGIN_USER_LIMIT, TWO_FACTOR_USER_LIMIT}; |
| @@ -45,7 +46,7 @@ const MAX_DEVICE_NAME_CHARS: usize = 40; | |||
| 45 | #[query_params(error = bad_request)] | 46 | #[query_params(error = bad_request)] |
| 46 | struct SecurityQuery { | 47 | struct SecurityQuery { |
| 47 | saved: Option<String>, | 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 | part: Option<String>, | 50 | part: Option<String>, |
| 50 | } | 51 | } |
| 51 | 52 | ||
| @@ -124,7 +125,6 @@ struct DeleteAccountForm { | |||
| 124 | #[derive(Default)] | 125 | #[derive(Default)] |
| 125 | struct Shown { | 126 | struct Shown { |
| 126 | notice: Option<&'static str>, | 127 | notice: Option<&'static str>, |
| 127 | - delete_error: Option<String>, | ||
| 128 | password_error: Option<String>, | 128 | password_error: Option<String>, |
| 129 | email_error: Option<String>, | 129 | email_error: Option<String>, |
| 130 | email_draft: Option<String>, | 130 | email_draft: Option<String>, |
| @@ -187,10 +187,7 @@ struct SecurityPage { | |||
| 187 | password_changed: Option<String>, | 187 | password_changed: Option<String>, |
| 188 | /// The enabled device. `None` when two-factor is off. | 188 | /// The enabled device. `None` when two-factor is off. |
| 189 | two_factor: Option<DeviceView>, | 189 | two_factor: Option<DeviceView>, |
| 190 | - delete_error: Option<String>, | ||
| 191 | passkeys: PasskeyPanel, | 190 | passkeys: PasskeyPanel, |
| 192 | - /// Repositories still owned by the user. Deletion is refused while there are any. | ||
| 193 | - owned_repos: Vec<String>, | ||
| 194 | /// Web sessions open on the account, listed by the Sessions topic. | 191 | /// Web sessions open on the account, listed by the Sessions topic. |
| 195 | sessions: Vec<Session>, | 192 | sessions: Vec<Session>, |
| 196 | /// The id of the session that is viewing the page. | 193 | /// The id of the session that is viewing the page. |
| @@ -250,24 +247,9 @@ pub(crate) fn security_rail_items( | |||
| 250 | href: "/settings/security/log".to_owned(), | 247 | href: "/settings/security/log".to_owned(), |
| 251 | current: active == "log", | 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 | /// The rail for a page outside the topics (the security log), with live counts. | 253 | /// The rail for a page outside the topics (the security log), with live counts. |
| 272 | pub(crate) async fn security_rail_for( | 254 | pub(crate) async fn security_rail_for( |
| 273 | state: &AppState, | 255 | state: &AppState, |
| @@ -310,9 +292,7 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> { | |||
| 310 | pending, | 292 | pending, |
| 311 | password_changed, | 293 | password_changed, |
| 312 | two_factor, | 294 | two_factor, |
| 313 | - delete_error, | ||
| 314 | passkeys, | 295 | passkeys, |
| 315 | - owned_repos, | ||
| 316 | sessions, | 296 | sessions, |
| 317 | current_session_id, | 297 | current_session_id, |
| 318 | part, | 298 | part, |
| @@ -338,17 +318,8 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> { | |||
| 338 | let setup_error = two_factor_error.filter(|_| two_factor_panel == TwoFactorPanel::Setup); | 318 | let setup_error = two_factor_error.filter(|_| two_factor_panel == TwoFactorPanel::Setup); |
| 339 | let regenerate_open = regenerate_error.is_some(); | 319 | let regenerate_open = regenerate_error.is_some(); |
| 340 | let disable_open = disable_error.is_some(); | 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 | // One topic shows at a time: the one with an error or fresh codes, else the one asked for. | 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] = [ | 322 | + const TOPICS: [&str; 5] = ["password", "email", "two-factor", "passkeys", "sessions"]; |
| 345 | - "password", | ||
| 346 | - "email", | ||
| 347 | - "two-factor", | ||
| 348 | - "passkeys", | ||
| 349 | - "sessions", | ||
| 350 | - "danger", | ||
| 351 | - ]; | ||
| 352 | let active: &'static str = if password_open { | 323 | let active: &'static str = if password_open { |
| 353 | "password" | 324 | "password" |
| 354 | } else if email_open { | 325 | } else if email_open { |
| @@ -360,8 +331,6 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> { | |||
| 360 | || (pending_set && part.is_none()) | 331 | || (pending_set && part.is_none()) |
| 361 | { | 332 | { |
| 362 | "two-factor" | 333 | "two-factor" |
| 363 | - } else if delete_open { | ||
| 364 | - "danger" | ||
| 365 | } else { | 334 | } else { |
| 366 | part.as_deref() | 335 | part.as_deref() |
| 367 | .and_then(|asked| TOPICS.into_iter().find(|topic| *topic == asked)) | 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 | let items = security_rail_items(lang, active, two_factor_on, passkey_count, session_count); | 339 | let items = security_rail_items(lang, active, two_factor_on, passkey_count, session_count); |
| 371 | Ok(view! { | 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 | if let Some(message) = notice { | 342 | if let Some(message) = notice { |
| 374 | <p class="state" role="status">(message)</p> | 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 | <div class="field"> | 362 | <div class="field"> |
| 394 | <label for="new-password">(t(lang, Key::NewPassword))</label> | 363 | <label for="new-password">(t(lang, Key::NewPassword))</label> |
| 395 | <input id="new-password" type="password" name="new_password" autocomplete="new-password" minlength="10" maxlength="1024" required=(true)> | 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 | </div> | 365 | </div> |
| 398 | <div class="field"> | 366 | <div class="field"> |
| 399 | <label for="confirm-password">(t(lang, Key::ConfirmNewPassword))</label> | 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 | if let Some(device) = two_factor { | 417 | if let Some(device) = two_factor { |
| 450 | <p class="state">(t(lang, Key::PillOn)) " · " (device.name.as_str())</p> | 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 | <div class="line"> | 420 | <div class="line"> |
| 453 | <span class="name">(t(lang, Key::RecoveryCodes))</span> | 421 | <span class="name">(t(lang, Key::RecoveryCodes))</span> |
| 454 | <span class="val">(device.codes_line.as_str())</span> | 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 | <form data-hard="true" method="post" action="/settings/security/2fa/recovery" class="fields"> | 433 | <form data-hard="true" method="post" action="/settings/security/2fa/recovery" class="fields"> |
| 466 | <input type="hidden" name="csrf" value=(csrf)> | 434 | <input type="hidden" name="csrf" value=(csrf)> |
| 467 | - <p class="hint">(t(lang, Key::RegenerateCodesHint))</p> | ||
| 468 | <div class="field"> | 435 | <div class="field"> |
| 469 | <label for="regenerate-password">(t(lang, Key::CurrentPassword))</label> | 436 | <label for="regenerate-password">(t(lang, Key::CurrentPassword))</label> |
| 470 | <input id="regenerate-password" type="password" name="current_password" autocomplete="current-password" required=(true)> | 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 | <p class="state">(t(lang, Key::SetupInProgress))</p> | 468 | <p class="state">(t(lang, Key::SetupInProgress))</p> |
| 502 | } else { | 469 | } else { |
| 503 | <p class="state">(t(lang, Key::PillOff))</p> | 470 | <p class="state">(t(lang, Key::PillOff))</p> |
| 504 | - <p class="hint">(t(lang, Key::TwoFactorOffIntro))</p> | ||
| 505 | <div class="acts"> | 471 | <div class="acts"> |
| 506 | <form data-hard="true" method="post" action="/settings/security/2fa/enable" class="act-form"> | 472 | <form data-hard="true" method="post" action="/settings/security/2fa/enable" class="act-form"> |
| 507 | <input type="hidden" name="csrf" value=(csrf)> | 473 | <input type="hidden" name="csrf" value=(csrf)> |
| @@ -510,9 +476,8 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> { | |||
| 510 | </div> | 476 | </div> |
| 511 | } | 477 | } |
| 512 | if let Some((secret, uri)) = pending { | 478 | if let Some((secret, uri)) = pending { |
| 513 | - <p class="hint">(t(lang, Key::TwoFactorPendingIntro))</p> | 479 | + <p class="state">(t(lang, Key::SecretPrefix)) <code>(secret)</code></p> |
| 514 | - <p class="hint">(t(lang, Key::SecretPrefix)) <code>(secret)</code></p> | 480 | + <p class="state">(t(lang, Key::LinkPrefix)) <code>(uri)</code></p> |
| 515 | - <p class="hint">(t(lang, Key::LinkPrefix)) <code>(uri)</code></p> | ||
| 516 | if let Some(message) = setup_error { | 481 | if let Some(message) = setup_error { |
| 517 | alert(message: message.as_str()) | 482 | alert(message: message.as_str()) |
| 518 | } | 483 | } |
| @@ -525,7 +490,6 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> { | |||
| 525 | <div class="field"> | 490 | <div class="field"> |
| 526 | <label for="enrol-name">(t(lang, Key::DeviceName))</label> | 491 | <label for="enrol-name">(t(lang, Key::DeviceName))</label> |
| 527 | <input id="enrol-name" type="text" name="name" autocomplete="off" maxlength="40" placeholder=(t(lang, Key::AuthenticatorApp))> | 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 | </div> | 493 | </div> |
| 530 | <button type="submit" class="primary">(t(lang, Key::ConfirmAndTurnOn))</button> | 494 | <button type="submit" class="primary">(t(lang, Key::ConfirmAndTurnOn))</button> |
| 531 | </form> | 495 | </form> |
| @@ -536,7 +500,7 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> { | |||
| 536 | <h2>(t(lang, Key::Sessions))</h2> | 500 | <h2>(t(lang, Key::Sessions))</h2> |
| 537 | if others > 0 { | 501 | if others > 0 { |
| 538 | <div class="acts"> | 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 | </div> | 504 | </div> |
| 541 | } | 505 | } |
| 542 | for session in sessions.into_iter() { | 506 | for session in sessions.into_iter() { |
| @@ -552,49 +516,8 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> { | |||
| 552 | (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()) | 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 | </span> | 517 | </span> |
| 554 | if session.id != current_session_id { | 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())) | 519 | + confirm_act(lang: lang, label: t(lang, Key::Revoke), action: "/settings/sessions/revoke", csrf: csrf, fields: vec![("id".to_owned(), session.id.clone())]) |
| 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> | ||
| 567 | - } | ||
| 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 | } | 520 | } |
| 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 | </div> | 521 | </div> |
| 599 | } | 522 | } |
| 600 | </section> | 523 | </section> |
| @@ -683,13 +606,6 @@ async fn build_page( | |||
| 683 | None => (None, None), | 606 | None => (None, None), |
| 684 | }; | 607 | }; |
| 685 | let password_changed = state.store.password_changed_at(&viewer.0.id).await?; | 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 | let stored_email = viewer.0.email.clone().unwrap_or_default(); | 609 | let stored_email = viewer.0.email.clone().unwrap_or_default(); |
| 694 | let email_verified = state.store.email_is_verified(&viewer.0.id).await?; | 610 | let email_verified = state.store.email_is_verified(&viewer.0.id).await?; |
| 695 | let mut email_sent = None; | 611 | let mut email_sent = None; |
| @@ -714,9 +630,7 @@ async fn build_page( | |||
| 714 | }; | 630 | }; |
| 715 | Ok(SecurityPage { | 631 | Ok(SecurityPage { |
| 716 | lang, | 632 | lang, |
| 717 | - delete_error: shown.delete_error, | ||
| 718 | passkeys: build_panel(state, &viewer.0.id).await?, | 633 | passkeys: build_panel(state, &viewer.0.id).await?, |
| 719 | - owned_repos, | ||
| 720 | email_verified, | 634 | email_verified, |
| 721 | stored_email, | 635 | stored_email, |
| 722 | email_status, | 636 | email_status, |
| @@ -836,6 +750,10 @@ async fn security_page(cx: &Cx) -> Result<impl View> { | |||
| 836 | let viewer = require_user(cx).await?; | 750 | let viewer = require_user(cx).await?; |
| 837 | let lang = i18n::lang(cx, Some(&viewer.0)); | 751 | let lang = i18n::lang(cx, Some(&viewer.0)); |
| 838 | let query = query_params::<SecurityQuery>(cx)?; | 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 | let saved = query.saved.clone(); | 757 | let saved = query.saved.clone(); |
| 840 | // A notice belongs to a topic: the page opens on it. | 758 | // A notice belongs to a topic: the page opens on it. |
| 841 | let part = query.part.clone().or_else(|| { | 759 | let part = query.part.clone().or_else(|| { |
| @@ -1065,27 +983,24 @@ async fn account_delete(cx: &Cx, Form(form): Form<DeleteAccountForm>) -> Result< | |||
| 1065 | let lang = i18n::lang(cx, Some(&viewer.0)); | 983 | let lang = i18n::lang(cx, Some(&viewer.0)); |
| 1066 | let state = app_context::<AppState>(cx); | 984 | let state = app_context::<AppState>(cx); |
| 1067 | let user_id = viewer.0.id.clone(); | 985 | let user_id = viewer.0.id.clone(); |
| 1068 | - let mut shown = Shown::default(); | ||
| 1069 | if form.confirm_username != viewer.0.username { | 986 | if form.confirm_username != viewer.0.username { |
| 1070 | - shown.delete_error = Some(t(lang, Key::ErrConfirmUsername).into()); | 987 | + let error = Some(t(lang, Key::ErrConfirmUsername).into()); |
| 1071 | - return respond(cx, viewer, shown).await; | 988 | + return settings_export::respond_delete(cx, viewer, error, None).await; |
| 1072 | } | 989 | } |
| 1073 | if let Err(refused) = require_password(lang, state, &viewer.0, &form.current_password).await? { | 990 | if let Err(refused) = require_password(lang, state, &viewer.0, &form.current_password).await? { |
| 1074 | - shown.delete_error = Some(refused.message.into()); | 991 | + let error = Some(refused.message.into()); |
| 1075 | - shown.throttled = refused.retry; | 992 | + return settings_export::respond_delete(cx, viewer, error, refused.retry).await; |
| 1076 | - return respond(cx, viewer, shown).await; | ||
| 1077 | } | 993 | } |
| 1078 | if two_factor_enabled(&state.store, &user_id).await? { | 994 | if two_factor_enabled(&state.store, &user_id).await? { |
| 1079 | if let Some(retry) = second_factor_blocked(state, &user_id) { | 995 | if let Some(retry) = second_factor_blocked(state, &user_id) { |
| 1080 | - shown.delete_error = Some(t(lang, Key::ErrThrottled).into()); | 996 | + let error = Some(t(lang, Key::ErrThrottled).into()); |
| 1081 | - shown.throttled = Some(retry); | 997 | + return settings_export::respond_delete(cx, viewer, error, Some(retry)).await; |
| 1082 | - return respond(cx, viewer, shown).await; | ||
| 1083 | } | 998 | } |
| 1084 | let key = throttle::two_factor_key(&user_id); | 999 | let key = throttle::two_factor_key(&user_id); |
| 1085 | if !verify_second_factor(&state.store, &state.key, &user_id, &form.code).await? { | 1000 | if !verify_second_factor(&state.store, &state.key, &user_id, &form.code).await? { |
| 1086 | state.throttle.record_failure(&key, Instant::now()); | 1001 | state.throttle.record_failure(&key, Instant::now()); |
| 1087 | - shown.delete_error = Some(t(lang, Key::ErrWrongCode).into()); | 1002 | + let error = Some(t(lang, Key::ErrWrongCode).into()); |
| 1088 | - return respond(cx, viewer, shown).await; | 1003 | + return settings_export::respond_delete(cx, viewer, error, None).await; |
| 1089 | } | 1004 | } |
| 1090 | state.throttle.clear(&key); | 1005 | state.throttle.clear(&key); |
| 1091 | } | 1006 | } |
| @@ -1111,10 +1026,7 @@ async fn account_delete(cx: &Cx, Form(form): Form<DeleteAccountForm>) -> Result< | |||
| 1111 | Err(see_other("/").into()) | 1026 | Err(see_other("/").into()) |
| 1112 | } | 1027 | } |
| 1113 | Err(e) => match user_facing_message(&e) { | 1028 | Err(e) => match user_facing_message(&e) { |
| 1114 | - Some(message) => { | 1029 | + Some(message) => settings_export::respond_delete(cx, viewer, Some(message), None).await, |
| 1115 | - shown.delete_error = Some(message); | ||
| 1116 | - respond(cx, viewer, shown).await | ||
| 1117 | - } | ||
| 1118 | None => Err(e.into()), | 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 | id: String, | 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 | /// Maps the form's expiry choice to a lifetime. `None` means the token never expires. | 56 | /// Maps the form's expiry choice to a lifetime. `None` means the token never expires. |
| 65 | /// An unrecognised value falls back to the 90-day default. | 57 | /// An unrecognised value falls back to the 90-day default. |
| 66 | fn expiry_days(choice: &str) -> Option<u64> { | 58 | fn expiry_days(choice: &str) -> Option<u64> { |
| @@ -91,7 +83,6 @@ pub(crate) async fn tokens_section( | |||
| 91 | <pre class="code"><code id="new-token">(token)</code></pre> | 83 | <pre class="code"><code id="new-token">(token)</code></pre> |
| 92 | <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> | 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 | </div> | 85 | </div> |
| 94 | - <p class="hint">(t(lang, Key::UseAsPassword))</p> | ||
| 95 | </div> | 86 | </div> |
| 96 | } | 87 | } |
| 97 | if add { | 88 | if add { |
| @@ -118,7 +109,6 @@ pub(crate) async fn tokens_section( | |||
| 118 | <input type="checkbox" name="packages" value="on"> | 109 | <input type="checkbox" name="packages" value="on"> |
| 119 | <span>(pk::t(lang, PK::ScopePackages))</span> | 110 | <span>(pk::t(lang, PK::ScopePackages))</span> |
| 120 | </label> | 111 | </label> |
| 121 | - <p class="hint">(pk::t(lang, PK::ScopePackagesHelp)) " " (t(lang, Key::ScopeNote))</p> | ||
| 122 | <div class="acts asks"> | 112 | <div class="acts asks"> |
| 123 | <button type="submit" class="primary">(t(lang, Key::CreateToken))</button> | 113 | <button type="submit" class="primary">(t(lang, Key::CreateToken))</button> |
| 124 | <a class="act" href="/settings/tokens">(s(lang, "Keep it", "Vazgeç"))</a> | 114 | <a class="act" href="/settings/tokens">(s(lang, "Keep it", "Vazgeç"))</a> |
| @@ -133,7 +123,7 @@ pub(crate) async fn tokens_section( | |||
| 133 | <div class="line"> | 123 | <div class="line"> |
| 134 | <span class="name">(token.name.clone())</span> | 124 | <span class="name">(token.name.clone())</span> |
| 135 | <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> | 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 | </div> | 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 | use crate::auth::{check_pre_csrf, clear_pre_csrf, hash_password_async, login, pre_csrf_token}; | 14 | use crate::auth::{check_pre_csrf, clear_pre_csrf, hash_password_async, login, pre_csrf_token}; |
| 15 | use crate::i18n::{self, Key, Lang, password_too_long, password_too_short, t}; | 15 | use crate::i18n::{self, Key, Lang, password_too_long, password_too_short, t}; |
| 16 | use crate::state::AppState; | 16 | use crate::state::AppState; |
| 17 | -use crate::views::parts::{SubPart, head}; | 17 | +use crate::views::parts::head; |
| 18 | use crate::views::{alert, shell, user_facing_message}; | 18 | use crate::views::{alert, shell, user_facing_message}; |
| 19 | 19 | ||
| 20 | const MIN_PASSWORD_CHARS: usize = 12; | 20 | const MIN_PASSWORD_CHARS: usize = 12; |
| @@ -43,7 +43,7 @@ async fn setup_form( | |||
| 43 | error: Option<String>, | 43 | error: Option<String>, |
| 44 | ) -> Result<impl View> { | 44 | ) -> Result<impl View> { |
| 45 | Ok(view! { | 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 | <div class="sheet fit"> | 47 | <div class="sheet fit"> |
| 48 | <form data-hard="true" method="post" action="/setup" class="fields"> | 48 | <form data-hard="true" method="post" action="/setup" class="fields"> |
| 49 | if let Some(message) = error { | 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 | <p class="hint">(g::updated_before(lang)) rel_time(lang: lang, stamp: updated_at) (g::updated_after(lang))</p> | 486 | <p class="hint">(g::updated_before(lang)) rel_time(lang: lang, stamp: updated_at) (g::updated_after(lang))</p> |
| 487 | if !is_owner { | 487 | if !is_owner { |
| 488 | - <p class="hint">(g::t(lang, K::OnlyOwnerEdits))</p> | ||
| 489 | } | 488 | } |
| 490 | </section> | 489 | </section> |
| 491 | for file in files.into_iter() { | 490 | for file in files.into_iter() { |
crates/forge-web/src/pages/wiki.rsmodified+11 -42
| @@ -26,7 +26,6 @@ use crate::i18n::{self, Lang}; | |||
| 26 | use crate::live::Topic; | 26 | use crate::live::Topic; |
| 27 | use crate::pages::repo::repo_head; | 27 | use crate::pages::repo::repo_head; |
| 28 | use crate::pages::repo_ctx::{RepoCtx, load_repo}; | 28 | use crate::pages::repo_ctx::{RepoCtx, load_repo}; |
| 29 | -use crate::pages::repo_settings::settings_frame; | ||
| 30 | use crate::pages::wiki_live::{bump_wiki, page_live_url, wiki_live_url}; | 29 | use crate::pages::wiki_live::{bump_wiki, page_live_url, wiki_live_url}; |
| 31 | use crate::render::markdown::render_markdown; | 30 | use crate::render::markdown::render_markdown; |
| 32 | use crate::state::AppState; | 31 | use crate::state::AppState; |
| @@ -343,13 +342,11 @@ async fn wiki_edit_body( | |||
| 343 | <div class="field"> | 342 | <div class="field"> |
| 344 | <label for="wiki-name">(g::t(lang, K::PageName))</label> | 343 | <label for="wiki-name">(g::t(lang, K::PageName))</label> |
| 345 | <input id="wiki-name" type="text" name="name" value=(name.as_str()) maxlength="100" required=(true) pattern="[A-Za-z0-9_-]+"> | 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 | </div> | 345 | </div> |
| 348 | } | 346 | } |
| 349 | <div class="field"> | 347 | <div class="field"> |
| 350 | <label for="wiki-content">(g::t(lang, K::ContentMarkdown))</label> | 348 | <label for="wiki-content">(g::t(lang, K::ContentMarkdown))</label> |
| 351 | <textarea id="wiki-content" name="content" rows="24" spellcheck="false">(content.as_str())</textarea> | 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 | </div> | 350 | </div> |
| 354 | <div class="field"> | 351 | <div class="field"> |
| 355 | <label for="wiki-message">(g::t(lang, K::Summary))</label> | 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 | Ok(SaveOutcome::Saved(page_href(ctx, name))) | 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 | #[component] | 766 | #[component] |
| 768 | -async fn wiki_settings_body( | 767 | +pub(crate) async fn wiki_switch( |
| 769 | - lang: Lang, | ||
| 770 | action: String, | 768 | action: String, |
| 771 | csrf: String, | 769 | csrf: String, |
| 772 | enabled: bool, | 770 | enabled: bool, |
| 773 | ) -> Result<impl View> { | 771 | ) -> Result<impl View> { |
| 774 | Ok(view! { | 772 | Ok(view! { |
| 775 | - <section class="sec"> | 773 | + <form method="post" action=(action.as_str()) id="wiki"> |
| 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())> | 774 | <input type="hidden" name="csrf" value=(csrf.as_str())> |
| 779 | <label class="switch"> | 775 | <label class="switch"> |
| 780 | - <input type="checkbox" name="enabled" value="1" checked=(enabled)> | 776 | + <input type="checkbox" name="enabled" value="1" checked=(enabled) data-autosubmit="true"> |
| 781 | - <span>(g::t(lang, K::EnableWiki))</span> | 777 | + <span>"Wiki"</span> |
| 782 | </label> | 778 | </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> | 779 | </form> |
| 786 | - </section> | ||
| 787 | }) | 780 | }) |
| 788 | } | 781 | } |
| 789 | 782 | ||
| 790 | -#[page("/{owner}/{repo}/settings/wiki")] | 783 | +/// The wiki switch moved to the General settings page; the old address goes there. |
| 791 | -async fn wiki_settings_page(cx: &Cx) -> Result<impl View> { | 784 | +#[route(GET "/{owner}/{repo}/settings/wiki")] |
| 785 | +async fn wiki_settings_page(cx: &Cx) -> Result<SeeOther> { | ||
| 792 | let owner = path_param::<Owner>(cx); | 786 | let owner = path_param::<Owner>(cx); |
| 793 | let repo_param = path_param::<Repo>(cx); | 787 | let repo_param = path_param::<Repo>(cx); |
| 794 | - let ctx = load_repo(cx, owner, repo_param).await?; | 788 | + Ok(see_other(repo_href(owner, repo_param, "settings", ""))) |
| 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 | - }) | ||
| 820 | } | 789 | } |
| 821 | 790 | ||
| 822 | #[derive(Deserialize)] | 791 | #[derive(Deserialize)] |
| @@ -865,7 +834,7 @@ async fn wiki_settings_post(cx: &Cx, Form(form): Form<WikiSettingsForm>) -> Resu | |||
| 865 | Ok(see_other(repo_href( | 834 | Ok(see_other(repo_href( |
| 866 | &ctx.repo.owner_name, | 835 | &ctx.repo.owner_name, |
| 867 | &ctx.repo.name, | 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 | calendar.current_streak, | 368 | calendar.current_streak, |
| 369 | calendar.longest_streak, | 369 | calendar.longest_streak, |
| 370 | ); | 370 | ); |
| 371 | - let motivation = g::heatmap_motivation(lang, calendar.today_count, calendar.current_streak); | ||
| 372 | let total = g::thousands(lang, calendar.total); | 371 | let total = g::thousands(lang, calendar.total); |
| 373 | let current = g::streak_days(lang, calendar.current_streak); | 372 | let current = g::streak_days(lang, calendar.current_streak); |
| 374 | let longest = g::streak_days(lang, calendar.longest_streak); | 373 | let longest = g::streak_days(lang, calendar.longest_streak); |
| @@ -489,7 +488,6 @@ pub async fn contribution_calendar( | |||
| 489 | </div> | 488 | </div> |
| 490 | </div> | 489 | </div> |
| 491 | <div class="heat-foot"> | 490 | <div class="heat-foot"> |
| 492 | - <p class="muted small">(motivation.as_str())</p> | ||
| 493 | <div class="legend" aria-hidden="true"> | 491 | <div class="legend" aria-hidden="true"> |
| 494 | <span>(less)</span> | 492 | <span>(less)</span> |
| 495 | <span class="cell l0"></span> | 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 | 478 | +/// What the profile corner shows: the viewer, their unread notification count, and whether review |
| 479 | -/// with where each leads, and whether any of their runs is going (the ring glows). | 479 | +/// requests, mentions or failed runs wait for them (the avatar's dot says so with the count). |
| 480 | #[derive(Clone)] | 480 | #[derive(Clone)] |
| 481 | struct ProfileCorner { | 481 | struct ProfileCorner { |
| 482 | username: String, | 482 | username: String, |
| @@ -484,125 +484,48 @@ struct ProfileCorner { | |||
| 484 | name: String, | 484 | name: String, |
| 485 | avatar: String, | 485 | avatar: String, |
| 486 | csrf: String, | 486 | csrf: String, |
| 487 | - back: String, | ||
| 488 | is_admin: bool, | 487 | is_admin: bool, |
| 489 | - theme: String, | 488 | + /// Unread notifications, shown as a count on the notifications row. |
| 490 | - /// Unread notifications, shown as a count on the bell. | ||
| 491 | unread: u64, | 489 | unread: u64, |
| 492 | - reviews: u64, | 490 | + /// Whether a review request, a mention or a failed run waits for the viewer. |
| 493 | - mentions: u64, | 491 | + waiting: bool, |
| 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, | ||
| 499 | } | 492 | } |
| 500 | 493 | ||
| 501 | /// The profile at the start of the top bar (signed in only): the avatar, with a dot when something | 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 | 495 | +/// waits. Its menu holds the name, notifications with their count, the settings and admin links and |
| 503 | -/// profile, settings and admin links, the theme choice and log out. | 496 | +/// log out. |
| 504 | #[component] | 497 | #[component] |
| 505 | async fn profile_corner(lang: Lang, corner: ProfileCorner) -> Result<impl View> { | 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 | let profile_href = user_href(&corner.username); | 499 | let profile_href = user_href(&corner.username); |
| 538 | let profile_label = mi::t(lang, MK::YourProfile); | 500 | let profile_label = mi::t(lang, MK::YourProfile); |
| 539 | let settings_label = o::t(lang, OK::Settings); | 501 | let settings_label = o::t(lang, OK::Settings); |
| 540 | let admin_label = ad::t(lang, AK::AdminArea); | 502 | let admin_label = ad::t(lang, AK::AdminArea); |
| 541 | let logout_label = t(lang, Key::LogOut); | 503 | let logout_label = t(lang, Key::LogOut); |
| 542 | - let bell_title = i18n::t(lang, Key::Notifications); | 504 | + let inbox_label = t(lang, Key::Notifications); |
| 543 | - let open_label = mi::t(lang, MK::OpenNotifications); | 505 | + let class = if corner.unread > 0 || corner.waiting { |
| 544 | - let clear_label = mi::t(lang, MK::ClearNotifications); | 506 | + "corner waiting" |
| 545 | - let clear_title = mi::t(lang, MK::MarkAllRead); | 507 | + } else { |
| 546 | - let loading_label = mi::t(lang, MK::PeekLoading); | 508 | + "corner" |
| 547 | - let error_label = mi::t(lang, MK::PeekError); | 509 | + }; |
| 548 | Ok(view! { | 510 | Ok(view! { |
| 549 | - <details class="corner" data-unread-stream=""> | 511 | + <details class=(class) data-unread-stream=""> |
| 550 | <summary class="corner-btn" aria-label=(corner.username.as_str())> | 512 | <summary class="corner-btn" aria-label=(corner.username.as_str())> |
| 551 | <img class="avatar corner-avatar" src=(corner.avatar.as_str()) alt="" width="32" height="32"> | 513 | <img class="avatar corner-avatar" src=(corner.avatar.as_str()) alt="" width="32" height="32"> |
| 552 | </summary> | 514 | </summary> |
| 553 | <div class="corner-menu"> | 515 | <div class="corner-menu"> |
| 554 | <a class="corner-who" href=(profile_href.as_str()) title=(profile_label)>(corner.name.as_str())</a> | 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"> | 517 | + <a class="corner-link corner-bell" href="/notifications"> |
| 556 | - <span>(bell_title)</span> | 518 | + <span>(inbox_label)</span> |
| 557 | if corner.unread > 0 { | 519 | if corner.unread > 0 { |
| 558 | <span class="bell-count">(corner.unread.to_string())</span> | 520 | <span class="bell-count">(corner.unread.to_string())</span> |
| 559 | } | 521 | } |
| 560 | </a> | 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 | <div class="corner-sep"></div> | 523 | <div class="corner-sep"></div> |
| 586 | <a class="corner-link" href="/settings/profile">(settings_label)</a> | 524 | <a class="corner-link" href="/settings/profile">(settings_label)</a> |
| 587 | if corner.is_admin { | 525 | if corner.is_admin { |
| 588 | <a class="corner-link" href="/admin/users">(admin_label)</a> | 526 | <a class="corner-link" href="/admin/users">(admin_label)</a> |
| 589 | } | 527 | } |
| 590 | <div class="corner-sep"></div> | 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 | <form data-hard="true" method="post" action="/logout"> | 529 | <form data-hard="true" method="post" action="/logout"> |
| 607 | <input type="hidden" name="csrf" value=(corner.csrf.as_str())> | 530 | <input type="hidden" name="csrf" value=(corner.csrf.as_str())> |
| 608 | <button type="submit" class="corner-link link-button">(logout_label)</button> | 531 | <button type="submit" class="corner-link link-button">(logout_label)</button> |
| @@ -628,17 +551,16 @@ pub async fn shell( | |||
| 628 | let full_title = format!("{title} \u{b7} forge"); | 551 | let full_title = format!("{title} \u{b7} forge"); |
| 629 | // The unread count, the profile corner's inbox counts, their CI runs and the items waiting on | 552 | // The unread count, the profile corner's inbox counts, their CI runs and the items waiting on |
| 630 | // them. Signed-in only. | 553 | // them. Signed-in only. |
| 631 | - let (unread, inbox, runs, waiting) = match viewer { | 554 | + let (unread, inbox, runs) = match viewer { |
| 632 | Some((user, _)) => match try_app_context::<AppState>(__cx) { | 555 | Some((user, _)) => match try_app_context::<AppState>(__cx) { |
| 633 | Some(state) => ( | 556 | Some(state) => ( |
| 634 | state.store.unread_count(&user.id).await?, | 557 | state.store.unread_count(&user.id).await?, |
| 635 | state.store.inbox_kind_counts(&user.id).await?, | 558 | state.store.inbox_kind_counts(&user.id).await?, |
| 636 | state.store.actor_runs(&user.id, 120).await?, | 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 | let signed_in = viewer.is_some(); | 565 | let signed_in = viewer.is_some(); |
| 644 | // Both kinds of visitor post to `/-/theme`. Signed-in users send their CSRF token and get the | 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 | let palette_label = br::t(lang, br::K::PaletteOpen).to_owned(); | 648 | let palette_label = br::t(lang, br::K::PaletteOpen).to_owned(); |
| 727 | let explore_label = t(lang, Key::Explore); | 649 | let explore_label = t(lang, Key::Explore); |
| 650 | + let home_label = o::t(lang, OK::Home); | ||
| 728 | // The path bar: one segment per part of the request path, the last one unlinked. | 651 | // The path bar: one segment per part of the request path, the last one unlinked. |
| 729 | let mut segments = path_segments(lang, uri(__cx).path(), title); | 652 | let mut segments = path_segments(lang, uri(__cx).path(), title); |
| 730 | // A page with no place of its own in the path, such as settings, names its section and itself. | 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 | let cancelled_tpl = count_template(&mi::cancelled_count(lang, 2), 2); | 701 | let cancelled_tpl = count_template(&mi::cancelled_count(lang, 2), 2); |
| 779 | let runs_label = mi::t(lang, MK::YourCiRuns); | 702 | let runs_label = mi::t(lang, MK::YourCiRuns); |
| 780 | let search_for_label = mi::t(lang, MK::SearchPublicReposFor); | 703 | let search_for_label = mi::t(lang, MK::SearchPublicReposFor); |
| 781 | - // The profile corner, the signed-in account panel. | 704 | + // The profile corner, the signed-in account panel. Its dot says something waits: an unread |
| 782 | - // Each chip leads to the newest thing it counts; a review or mention past the five newest | 705 | + // notification, a review request, a mention or a failed run. |
| 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 | - ); | ||
| 807 | let corner = viewer.map(|(user, session)| ProfileCorner { | 706 | let corner = viewer.map(|(user, session)| ProfileCorner { |
| 808 | username: user.username.clone(), | 707 | username: user.username.clone(), |
| 809 | name: user | 708 | name: user |
| @@ -815,16 +714,9 @@ pub async fn shell( | |||
| 815 | .to_owned(), | 714 | .to_owned(), |
| 816 | avatar: avatar_url(&user.username, user.avatar_hash.as_deref()), | 715 | avatar: avatar_url(&user.username, user.avatar_hash.as_deref()), |
| 817 | csrf: session.csrf_token.clone(), | 716 | csrf: session.csrf_token.clone(), |
| 818 | - back: back.clone().unwrap_or_else(|| "/".to_owned()), | ||
| 819 | is_admin: user.is_admin, | 717 | is_admin: user.is_admin, |
| 820 | - theme: theme_pref.to_owned(), | ||
| 821 | unread, | 718 | unread, |
| 822 | - reviews: inbox.reviews, | 719 | + waiting: inbox.reviews + inbox.mentions + runs.failing > 0, |
| 823 | - mentions: inbox.mentions, | ||
| 824 | - failing: runs.failing, | ||
| 825 | - review_href, | ||
| 826 | - mention_href, | ||
| 827 | - failing_href, | ||
| 828 | }); | 720 | }); |
| 829 | Ok(view! { | 721 | Ok(view! { |
| 830 | <!DOCTYPE html> | 722 | <!DOCTYPE html> |
| @@ -857,7 +749,7 @@ pub async fn shell( | |||
| 857 | profile_corner(lang: lang, corner: corner) | 749 | profile_corner(lang: lang, corner: corner) |
| 858 | </div> | 750 | </div> |
| 859 | } | 751 | } |
| 860 | - <a class="wordmark" href="/">"forge"</a> | 752 | + <a class="wordmark" href="/" title=(home_label)>"forge"</a> |
| 861 | </div> | 753 | </div> |
| 862 | <nav class="pathbar" aria-label=(mi::t(lang, MK::BreadcrumbNav))> | 754 | <nav class="pathbar" aria-label=(mi::t(lang, MK::BreadcrumbNav))> |
| 863 | <ol class="pathbar-segs"> | 755 | <ol class="pathbar-segs"> |
| @@ -1013,16 +905,10 @@ pub fn admin_items(lang: Lang) -> Vec<NavItem> { | |||
| 1013 | }; | 905 | }; |
| 1014 | vec![ | 906 | vec![ |
| 1015 | item("users", "/admin/users", ad::t(lang, AK::Users)), | 907 | item("users", "/admin/users", ad::t(lang, AK::Users)), |
| 1016 | - item("invites", "/admin/invites", ad::t(lang, AK::Invites)), | ||
| 1017 | item("runners", "/admin/runners", ad::t(lang, AK::Runners)), | 908 | item("runners", "/admin/runners", ad::t(lang, AK::Runners)), |
| 1018 | item("server", "/admin/server", ad::t(lang, AK::ServerSettings)), | 909 | item("server", "/admin/server", ad::t(lang, AK::ServerSettings)), |
| 1019 | item("mail", "/admin/mail", ad::t(lang, AK::Mail)), | 910 | item("mail", "/admin/mail", ad::t(lang, AK::Mail)), |
| 1020 | item("backups", "/admin/backups", ad::t(lang, AK::Backups)), | 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 | item( | 912 | item( |
| 1027 | "health", | 913 | "health", |
| 1028 | "/admin/health", | 914 | "/admin/health", |
| @@ -1156,10 +1042,13 @@ pub fn section_for(lang: Lang, path: &str) -> Option<Section> { | |||
| 1156 | ), | 1042 | ), |
| 1157 | _ => return None, | 1043 | _ => return None, |
| 1158 | }; | 1044 | }; |
| 1159 | - let second = match second { | 1045 | + let second = match (first, second) { |
| 1160 | - "sessions" => "security", | 1046 | + (_, "sessions") => "security", |
| 1161 | - "gpg" | "tokens" => "keys", | 1047 | + (_, "gpg" | "tokens") => "keys", |
| 1162 | - other => other, | 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 | let current = items | 1053 | let current = items |
| 1165 | .iter() | 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 | /// One piece of a head's sub line. Pieces are joined with a middle dot. | 245 | /// One piece of a head's sub line. Pieces are joined with a middle dot. |
| 85 | #[derive(Clone, Default)] | 246 | #[derive(Clone, Default)] |
| 86 | pub struct SubPart { | 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 | list itself carries no second "New ..." line under it. | 76 | list itself carries no second "New ..." line under it. |
| 77 | - **Facts**: a page that describes one thing (an account, an organization) lists it as `.sec.facts`: | 77 | - **Facts**: a page that describes one thing (an account, an organization) lists it as `.sec.facts`: |
| 78 | compact 34px lines of a `.key` on the label column, the `.val`, and the action for that fact on the | 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 | 79 | + same line. No hints under a heading or a fact. |
| 80 | - its value. | ||
| 81 | - **Time range**: every log has a When filter (Any time, Last hour, Last 24 hours, Last 7 days, Last | 80 | - **Time range**: every log has a When filter (Any time, Last hour, Last 24 hours, Last 7 days, Last |
| 82 | 30 days, Today, Dates…). Dates… shows From and To day fields in the viewer's timezone, and the tools | 81 | 30 days, Today, Dates…). Dates… shows From and To day fields in the viewer's timezone, and the tools |
| 83 | row starts with the count of entries that match, so "how many sign-ins last week" is one glance. | 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 | ```html | 99 | ```html |
| 101 | <form class="fields"> | 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 | <button type="submit" class="primary">Save</button> | 102 | <button type="submit" class="primary">Save</button> |
| 104 | </form> | 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 | fields. A checkbox is `<label class="switch"><input type="checkbox"><span>..</span></label>`, the box right | 107 | fields. A checkbox is `<label class="switch"><input type="checkbox"><span>..</span></label>`, the box right |
| 109 | before its label. Few fixed options are `.choice`: | 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 | ## Words | 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 | `crate::pages::passkeys::s(lang, "English", "Türkçe")`, in proper Turkish ("çevrim içi" is two words). A | 165 | `crate::pages::passkeys::s(lang, "English", "Türkçe")`, in proper Turkish ("çevrim içi" is two words). A |
| 165 | Turkish page shows no English, an English page no Turkish. | 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 | `fit` sheet takes the whole width there. | 178 | `fit` sheet takes the whole width there. |
| 178 | - Pages fit one screen where they can: use tabs and the rail, not stacked unrelated topics. | 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 | ## Fixed places | 198 | ## Fixed places |
| 181 | 199 | ||
| 182 | - Every head on a page with tabs is one height (a 38px title line and one sub line), so the tabs and the | 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 | .corner-menu, | 56 | .corner-menu, |
| 57 | .ref-menu, | 57 | .ref-menu, |
| 58 | .pop-panel, | 58 | .pop-panel, |
| 59 | -.row-menu-panel, | 59 | +.row-menu-panel { |
| 60 | -.bell-pop { | ||
| 61 | max-width: calc(100vw - 32px); | 60 | max-width: calc(100vw - 32px); |
| 62 | transition: none; | 61 | transition: none; |
| 63 | animation: none; | 62 | animation: none; |
style/_one.scssmodified+18 -55
| @@ -590,6 +590,18 @@ input[type="radio"] { | |||
| 590 | margin-left: 0; | 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 | // A quiet action leading the row keeps its words, not its padding, on the fields' edge. | 605 | // A quiet action leading the row keeps its words, not its padding, on the fields' edge. |
| 594 | .fields > .acts > .act:first-child { | 606 | .fields > .acts > .act:first-child { |
| 595 | margin-left: -10px; | 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 | .bell-count { | 894 | .bell-count { |
| 893 | color: var(--muted); | 895 | color: var(--muted); |
| 894 | font-family: var(--mono); | 896 | font-family: var(--mono); |
| 895 | font-size: 12.5px; | 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. | 900 | +// Something waits for the viewer (an unread notification, a review request, a mention or a failed |
| 899 | -details.corner:has(.bell-count, .corner-chips > a) > .corner-btn::after { | 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 | content: ""; | 903 | content: ""; |
| 901 | position: absolute; | 904 | position: absolute; |
| 902 | top: -1px; | 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 | // The avatar is the whole button: no inset, so it sits on the top bar's middle line. | 961 | // The avatar is the whole button: no inset, so it sits on the top bar's middle line. |
| 996 | .corner-float summary.corner-btn { | 962 | .corner-float summary.corner-btn { |
| 997 | padding: 0; | 963 | padding: 0; |
| @@ -1580,7 +1546,6 @@ a.line:hover .name, | |||
| 1580 | .ci-tl-more > p, | 1546 | .ci-tl-more > p, |
| 1581 | .dock-expand > .dock-message, | 1547 | .dock-expand > .dock-message, |
| 1582 | details > .status-list, | 1548 | details > .status-list, |
| 1583 | -.bell-box, | ||
| 1584 | .palette-box { | 1549 | .palette-box { |
| 1585 | border: 0 !important; | 1550 | border: 0 !important; |
| 1586 | border-radius: 20px !important; | 1551 | border-radius: 20px !important; |
| @@ -2471,8 +2436,7 @@ dialog[data-finder] { | |||
| 2471 | text-transform: none; | 2436 | text-transform: none; |
| 2472 | } | 2437 | } |
| 2473 | 2438 | ||
| 2474 | -.select-search-none, | 2439 | +.select-search-none { |
| 2475 | -.bell-empty { | ||
| 2476 | padding: 8px 12px; | 2440 | padding: 8px 12px; |
| 2477 | color: var(--muted); | 2441 | color: var(--muted); |
| 2478 | font-size: 14px; | 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 | .head-title { | 3127 | .head-title { |
| 3166 | min-height: 38px; | 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 | min-height: 64px; | 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 | #{$repo} .recent-checks { | 396 | #{$repo} .recent-checks { |
| 397 | margin-left: 0; | 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 | right: auto; | 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 | // The run's estimate bar is the step strip's job: the head keeps only the words. | 143 | // The run's estimate bar is the step strip's job: the head keeps only the words. |
| 129 | .ci-run > .head progress.ci-est-run { | 144 | .ci-run > .head progress.ci-est-run { |
| 130 | display: none; | 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 | // Chips count what waits on the user. They never take the accent. | 639 | // Chips count what waits on the user. They never take the accent. |
| 647 | .chip { | 640 | .chip { |
| 648 | display: inline-flex; | 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 | .corner-menu { | 672 | .corner-menu { |
| 866 | position: absolute; | 673 | position: absolute; |
| 867 | bottom: calc(100% + 8px); | 674 | bottom: calc(100% + 8px); |
| @@ -876,8 +683,8 @@ a.chip { | |||
| 876 | box-shadow: var(--shadow); | 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 | 686 | +// The profile corner: a small panel fixed at the bottom left of the window, the avatar, the name and |
| 880 | -// chips and the bell. The name is always shown in full (see `.corner-name` below). | 687 | +// the notifications row. The name is always shown in full (see `.corner-name` below). |
| 881 | .corner-float { | 688 | .corner-float { |
| 882 | position: fixed; | 689 | position: fixed; |
| 883 | left: 16px; | 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 | // Page column and footer. The footer sits under the page in the same column, so a short page and | 787 | // Page column and footer. The footer sits under the page in the same column, so a short page and |
| 1032 | // its footer fit in the viewport the shell fills (no scroll for a footer's height). | 788 | // its footer fit in the viewport the shell fills (no scroll for a footer's height). |
| 1033 | 789 | ||