forge
Explore
Log in

Don't you dare go Hollow

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 commit

a2e388f98aef9cba207ba39e11e35b4a79bb9ff4Ahmet Kaan GümüşParent: c452194
All checks have passed
Show checks
  • 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
Show full message
💄 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
📝 docs: the page language gains Fewer places and the no-microcopy rule

117 changed files +2726 -4544

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() {
469469 .await;
470470 assert_eq!(audit.status, 200, "audit page");
471471 assert!(
472- audit.body.contains("title=\"org_settings_updated\""),
472+ audit.body.contains("data-action=\"org_settings_updated\""),
473473 "settings change is audited"
474474 );
475475 let audit = http
476476 .get("/admin/audit?action=org_deleted", Some(&root_session))
477477 .await;
478478 assert!(
479- audit.body.contains("title=\"org_deleted\""),
479+ audit.body.contains("data-action=\"org_deleted\""),
480480 "org deletion is audited"
481481 );
482482 }
crates/forge-e2e/tests/e2e/repo_collaborators_e2e.rsmodified+0 -2
@@ -157,10 +157,8 @@ async fn repo_collaborators_end_to_end() {
157157 );
158158 assert_eq!(http.get("/olivia/priv", Some(&bob)).await.status, 404);
159159
160- // The owner sees the page with the role legend.
161160 let owner_page = http.get(page, Some(&olivia)).await;
162161 assert_eq!(owner_page.status, 200, "owner page");
163- assert!(owner_page.body.contains("view and clone"), "legend missing");
164162
165163 // The owner adds bob as Write: bob now sees the private repo, and the row shows the role.
166164 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() {
243243 assert_eq!(renamed.status, 303, "rename: {}", renamed.body);
244244 assert_eq!(
245245 renamed.header(LOCATION).as_deref(),
246- Some("/bob/newpub/settings/rename")
246+ Some("/bob/newpub/settings?section=danger")
247247 );
248248 assert_eq!(
249249 http.get("/bob/newpub/tree/main/src", None).await.status,
@@ -381,14 +381,14 @@ async fn repo_rename_end_to_end() {
381381 assert_eq!(transfer.status, 303, "transfer offered: {}", transfer.body);
382382 assert_eq!(
383383 transfer.header(LOCATION).as_deref(),
384- Some("/bob/newpub/transfer")
384+ Some("/bob/newpub/settings?section=danger")
385385 );
386386 assert_eq!(
387387 http.get("/bob/newpub/tree/main/src", None).await.status,
388388 200,
389389 "repo unchanged until accepted"
390390 );
391- let offered = http.get("/bob/newpub/transfer", Some(&bob)).await;
391+ let offered = http.get("/bob/newpub/settings?section=danger", Some(&bob)).await;
392392 assert!(offered.body.contains("Pending transfer to carol"));
393393 let inbox = http.get("/notifications", Some(&carol)).await;
394394 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() {
138138 .await;
139139 assert_eq!(carol_page.status, 200, "admin collaborator settings page");
140140 assert!(
141- !carol_page.body.contains("Danger zone"),
142- "admin collaborator must not see the danger zone"
141+ !carol_page.body.contains("/bob/priv/settings/delete\""),
142+ "admin collaborator must not see the delete form"
143143 );
144144 let carol_csrf = csrf_for(&http, &carol).await;
145145 let carol_delete = http
@@ -246,10 +246,10 @@ async fn repo_settings_end_to_end() {
246246 "trash entry is a bare repo"
247247 );
248248
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.
250250 let home = http.get("/", Some(&bob)).await;
251- assert_eq!(home.status, 303, "home page for a signed-in viewer");
252- assert_eq!(home.header(LOCATION).as_deref(), Some("/bob"));
251+ assert_eq!(home.status, 200, "home page for a signed-in viewer");
252+ assert!(home.body.contains("Your repositories"), "home lists their repositories");
253253
254254 // An admin who does not own the repo can delete it.
255255 let admin_page = http.get("/bob/priv/settings", Some(&tahinli)).await;
@@ -662,8 +662,8 @@ async fn branch_protection_end_to_end() {
662662 .get("/bob/app/settings?section=danger", Some(&carol))
663663 .await;
664664 assert!(
665- !carol_danger.body.contains("Danger zone"),
666- "admin collaborator must not see the danger zone"
665+ !carol_danger.body.contains("/bob/app/settings/delete\""),
666+ "admin collaborator must not see the delete form"
667667 );
668668 assert!(
669669 http.get("/bob/app", Some(&carol))
@@ -864,7 +864,7 @@ async fn general_settings_end_to_end() {
864864 page.body
865865 .contains("href=\"/bob/gen/settings/collaborators\"")
866866 );
867- assert!(page.body.contains("href=\"/bob/gen/settings/rename\""));
867+ assert!(page.body.contains("href=\"/bob/gen/settings?section=danger\""));
868868
869869 // Description: control characters are stripped and it shows on the repo header.
870870 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() {
146146 assert_eq!(offered.status, 303, "offer: {}", offered.body);
147147 assert_eq!(
148148 offered.header(LOCATION).as_deref(),
149- Some("/bob/priv/transfer")
149+ Some("/bob/priv/settings?section=danger")
150150 );
151- let status = http.get("/bob/priv/transfer", Some(&bob)).await;
151+ let status = http.get("/bob/priv/settings?section=danger", Some(&bob)).await;
152152 assert!(status.body.contains("Pending transfer to carol"));
153153 // Carol cannot read the private repo, yet the inbox offers her the actions.
154154 assert_eq!(http.get("/bob/priv", Some(&carol)).await.status, 404);
155155 let declined = act_from(&http, &carol, "/notifications", "/decline").await;
156156 assert_eq!(declined.status, 303, "decline: {}", declined.body);
157157 assert_eq!(declined.header(LOCATION).as_deref(), Some("/notifications"));
158- let after = http.get("/bob/priv/transfer", Some(&bob)).await;
159- assert!(after.body.contains("No transfer is pending"));
158+ let after = http.get("/bob/priv/settings?section=danger", Some(&bob)).await;
159+ assert!(!after.body.contains("Pending transfer"));
160160 assert_eq!(http.get("/bob/priv", Some(&bob)).await.status, 200);
161161
162162 // Offer again, then the initiator cancels it.
163163 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;
165165 assert_eq!(cancelled.status, 303, "cancel: {}", cancelled.body);
166166 assert_eq!(
167167 cancelled.header(LOCATION).as_deref(),
168- Some("/bob/priv/transfer")
168+ Some("/bob/priv/settings?section=danger")
169169 );
170- let after = http.get("/bob/priv/transfer", Some(&bob)).await;
171- assert!(after.body.contains("No transfer is pending"));
170+ let after = http.get("/bob/priv/settings?section=danger", Some(&bob)).await;
171+ assert!(!after.body.contains("Pending transfer"));
172172
173173 // A transfer to an org: plain members get no accept form, owners do.
174174 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() {
170170 let session = login(&env.http, "tahinli", PW).await;
171171 let want = [
172172 "/admin/users",
173- "/admin/invites",
174- "/admin/audit",
175173 "/admin/runners",
176- "/admin/mail",
177174 "/admin/server",
175+ "/admin/mail",
178176 "/admin/backups",
179- "/admin/replication",
177+ "/admin/audit",
180178 ];
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+ ] {
182190 let page = env.http.get(path, Some(&session)).await;
183191 assert_eq!(page.status, 200, "GET {path}");
184- assert_tabs(&page.body, path, &want);
192+ assert_tabs(&page.body, current, &want);
185193 assert!(
186194 !tab_links(&page.body).iter().any(|(h, _)| h == "/explore"),
187195 "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> {
5959 /// The option value that is selected in the `<select name="...">` on a page.
6060 fn selected_option(body: &str, select: &str) -> Option<String> {
6161 let doc = scraper::Html::parse_document(body);
62- // A select's chosen option, or the pressed button of a choice row.
6362 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\"]"
6564 ))
6665 .expect("selector");
6766 doc.select(&selector)
@@ -95,17 +94,6 @@ fn theme_button(body: &str) -> (String, String) {
9594 (value, label)
9695 }
9796
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-
10997 /// Runs an admin subcommand with the password in FORGE_PASSWORD and asserts it succeeded.
11098 fn admin(config: &Path, args: &[&str]) {
11199 let out = Command::new(bin())
@@ -646,7 +634,6 @@ async fn theme_button_cycles_light_dark_auto_light_for_signed_in_users() {
646634 let page = env.http.get(back, Some(&session)).await;
647635 let csrf = input_value(&page.body, "csrf");
648636 assert_eq!(html_theme(&page.body).as_deref(), Some("light"));
649- assert_eq!(pressed_theme(&page.body).as_deref(), Some("light"));
650637
651638 let step = env
652639 .http
@@ -659,7 +646,6 @@ async fn theme_button_cycles_light_dark_auto_light_for_signed_in_users() {
659646 assert_eq!(step.status, 303, "light to dark: {}", step.body);
660647 let page = env.http.get(back, Some(&session)).await;
661648 assert_eq!(html_theme(&page.body).as_deref(), Some("dark"));
662- assert_eq!(pressed_theme(&page.body).as_deref(), Some("dark"));
663649
664650 let step = env
665651 .http
@@ -677,7 +663,6 @@ async fn theme_button_cycles_light_dark_auto_light_for_signed_in_users() {
677663 "signed-in toggle to auto stores 'auto'"
678664 );
679665 assert_eq!(html_theme(&page.body), None, "auto renders no data-theme");
680- assert_eq!(pressed_theme(&page.body).as_deref(), Some("auto"));
681666
682667 let step = env
683668 .http
@@ -690,7 +675,6 @@ async fn theme_button_cycles_light_dark_auto_light_for_signed_in_users() {
690675 assert_eq!(step.status, 303, "auto to light: {}", step.body);
691676 let page = env.http.get(back, Some(&session)).await;
692677 assert_eq!(html_theme(&page.body).as_deref(), Some("light"));
693- assert_eq!(pressed_theme(&page.body).as_deref(), Some("light"));
694678 }
695679
696680 #[tokio::test]
crates/forge-e2e/tests/e2e/wiki_e2e.rsmodified+5 -5
@@ -242,7 +242,7 @@ async fn wiki_end_to_end() {
242242 .await;
243243 assert_eq!(audit.status, 200, "audit page");
244244 assert!(
245- audit.body.contains("title=\"wiki_pushed\""),
245+ audit.body.contains("data-action=\"wiki_pushed\""),
246246 "the wiki push is audited: {}",
247247 audit.body
248248 );
@@ -299,15 +299,15 @@ async fn wiki_end_to_end() {
299299 assert!(!denied.status.success(), "read-only push must fail");
300300
301301 // 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;
303303 assert!(
304- settings.body.contains("Enable the wiki"),
304+ settings.body.contains("action=\"/bob/proj/settings/wiki\""),
305305 "{}",
306306 settings.body
307307 );
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;
309309 assert_eq!(
310- forbidden_toggle.status, 404,
310+ forbidden_toggle.status, 403,
311311 "only admins see wiki settings"
312312 );
313313 let off = http
crates/forge-web-base/src/i18n/accounts.rsmodified+0 -34
@@ -15,16 +15,12 @@ pub enum A {
1515 Suspend,
1616 Unsuspend,
1717 SuspendReason,
18- SuspendHelp,
1918 GrantAdmin,
2019 RevokeAdmin,
2120 AdminHelp,
22- ResetPassword,
2321 GenerateLink,
24- ResetHelp,
2522 ResetLinkReady,
2623 Disable2fa,
27- Disable2faHelp,
2824 Actions,
2925 OkSuspended,
3026 OkUnsuspended,
@@ -53,15 +49,11 @@ pub enum A {
5349 Ok,
5450 Error,
5551 Lagging,
56- HealthIntro,
5752 Storage,
5853 Services,
5954 Fine,
6055 DiskUsed,
6156 Joined,
62- NoPasskeysToRemove,
63- TwoFactorNotOn,
64- DeleteHelp,
6557 }
6658
6759 pub fn t(lang: Lang, key: A) -> &'static str {
@@ -90,36 +82,18 @@ pub fn t(lang: Lang, key: A) -> &'static str {
9082 (Unsuspend, Tr) => "Askıyı kaldır",
9183 (SuspendReason, En) => "Reason shown on the login page",
9284 (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- }
9985 (GrantAdmin, En) => "Make administrator",
10086 (GrantAdmin, Tr) => "Yönetici yap",
10187 (RevokeAdmin, En) => "Remove administrator",
10288 (RevokeAdmin, Tr) => "Yöneticiliği kaldır",
10389 (AdminHelp, En) => "The last administrator cannot be demoted.",
10490 (AdminHelp, Tr) => "Son yönetici yetkisiz bırakılamaz.",
105- (ResetPassword, En) => "Reset password",
106- (ResetPassword, Tr) => "Parolayı sıfırla",
10791 (GenerateLink, En) => "Generate reset link",
10892 (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- }
11593 (ResetLinkReady, En) => "One-time reset link. It is shown only now:",
11694 (ResetLinkReady, Tr) => "Tek kullanımlık sıfırlama bağlantısı. Yalnızca şimdi gösterilir:",
11795 (Disable2fa, En) => "Disable two-factor",
11896 (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- }
12397 (Actions, En) => "Actions",
12498 (Actions, Tr) => "İşlemler",
12599 (OkSuspended, En) => "Account suspended.",
@@ -176,8 +150,6 @@ pub fn t(lang: Lang, key: A) -> &'static str {
176150 (Error, Tr) => "Hata",
177151 (Lagging, En) => "Lagging",
178152 (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.",
181153 (Storage, En) => "Storage",
182154 (Storage, Tr) => "Depolama",
183155 (Services, En) => "Services",
@@ -188,12 +160,6 @@ pub fn t(lang: Lang, key: A) -> &'static str {
188160 (DiskUsed, Tr) => "kullanıldı",
189161 (Joined, En) => "Joined",
190162 (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.",
197163 }
198164 }
199165
crates/forge-web-base/src/i18n/admin.rsmodified+10 -329
@@ -9,24 +9,17 @@ use super::Lang;
99 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
1010 pub enum K {
1111 ActionLabel,
12- ActorUsername,
1312 AddARunner,
1413 AdminArea,
1514 Administrator,
1615 AllActions,
17- RowActions,
1816 Anonymous,
19- AtLeast12Chars,
20- AuditIntro,
2117 AuditLog,
2218 BackToRunners,
2319 BackToUsers,
24- BackupInterval,
2520 Backups,
26- BackupsIntro,
2721 CiRunners,
2822 CopyTokenNow,
29- CreateAUser,
3023 CreateRegistrationToken,
3124 CreateUser,
3225 Database,
@@ -54,27 +47,16 @@ pub enum K {
5447 FromName,
5548 Fsck,
5649 Healthcheck,
57- HealthcheckNotSet,
58- HealthcheckSet,
59- HealthcheckUrlInvalid,
6050 HealthError,
6151 HealthLagging,
6252 HealthNever,
6353 HealthOk,
64- Interval,
6554 Invites,
6655 LastDbAttempt,
6756 LastDbSnapshotShipped,
6857 LastSeen,
6958 LastSuccess,
7059 ServerSettings,
71- ServerSettingsIntro,
72- SrvTabGeneral,
73- SrvTabLimits,
74- SrvTabStorage,
75- SrvTabBackups,
76- SrvTabIntegrations,
77- SrvTabAlerts,
7860 SrvSaved,
7961 SrvNothingChanged,
8062 SrvResetDone,
@@ -83,17 +65,12 @@ pub enum K {
8365 SrvKindLive,
8466 SrvKindRestart,
8567 SrvKindReadOnly,
86- SrvSourceDefault,
87- SrvSourceFile,
88- SrvSourceUi,
8968 SrvSecretSet,
9069 SrvSecretNotSet,
91- SrvSecretHint,
9270 SrvFileValue,
9371 SrvEmpty,
9472 Mail,
9573 MailHost,
96- MailIntro,
9774 MailTabSettings,
9875 MailTabQueue,
9976 MailFilterAll,
@@ -103,9 +80,6 @@ pub enum K {
10380 MailNotFailed,
10481 MailDiscarded,
10582 MailSentAt,
106- MailTransportNote,
107- MailTransportInUse,
108- MailQueueIntro,
10983 MailNothingMatches,
11084 MailQueueEmpty,
11185 MailPort,
@@ -117,25 +91,15 @@ pub enum K {
11791 NoRunnersYet,
11892 NoRunnerWithId,
11993 NoRunsYet,
120- BackupsEmptyHint,
121- ReplicationConfigHint,
122- ReposEmptyHint,
123- RunnersEmptyHint,
12494 Older,
125- OwnLogIntro,
126- PasswordStoredHint,
12795 RecentRuns,
12896 ReconcileNow,
12997 ReconcileStarted,
13098 RegisterARunner,
13199 RegistrationToken,
132100 RemovedWithAccount,
133- ReplacePrefix,
134- ReplaceSuffix,
135101 Replication,
136- ReplicationIntro,
137102 ReplicationOff,
138- ReplicationTarget,
139103 Repos,
140104 Retention,
141105 Role,
@@ -159,22 +123,9 @@ pub enum K {
159123 StatusFailed,
160124 StatusInProgress,
161125 StatusOk,
162- TableActor,
163- TableDetails,
164- TableDuration,
165- TableKind,
166126 TableLastError,
167127 TableQueued,
168- TableResult,
169- TableSize,
170- TableStarted,
171- TableState,
172- TableSubject,
173- TableTarget,
174- TableTo,
175128 TableTries,
176- TableTrigger,
177- TableWhen,
178129 TestQueued,
179130 Token,
180131 TokenCreateFailed,
@@ -194,8 +145,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
194145 match (key, lang) {
195146 (ActionLabel, En) => "Action",
196147 (ActionLabel, Tr) => "İşlem",
197- (ActorUsername, En) => "Actor username",
198- (ActorUsername, Tr) => "Yapan kullanıcı adı",
199148 (AddARunner, En) => "Add a runner",
200149 (AddARunner, Tr) => "Çalıştırıcı ekle",
201150 (AdminArea, En) => "Admin",
@@ -204,44 +153,20 @@ pub fn t(lang: Lang, key: K) -> &'static str {
204153 (Administrator, Tr) => "Yönetici",
205154 (AllActions, En) => "All actions",
206155 (AllActions, Tr) => "Tüm işlemler",
207- (RowActions, En) => "Actions",
208- (RowActions, Tr) => "İşlemler",
209156 (Anonymous, En) => "anonymous",
210157 (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- }
219158 (AuditLog, En) => "Audit log",
220159 (AuditLog, Tr) => "Denetim günlüğü",
221160 (BackToRunners, En) => "Back to runners",
222161 (BackToRunners, Tr) => "Çalıştırıcılara dön",
223162 (BackToUsers, En) => "Back to users",
224163 (BackToUsers, Tr) => "Kullanıcılara dön",
225- (BackupInterval, En) => "Backup interval",
226- (BackupInterval, Tr) => "Yedekleme aralığı",
227164 (Backups, En) => "Backups",
228165 (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- }
235166 (CiRunners, En) => "CI runners",
236167 (CiRunners, Tr) => "CI çalıştırıcıları",
237- (CopyTokenNow, En) => {
238- "Copy this token now. It is shown once and cannot be looked up again."
239- }
240- (CopyTokenNow, Tr) => {
241- "Bu belirteci şimdi kopyalayın. Yalnızca bir kez gösterilir ve sonradan yeniden görüntülenemez."
242- }
243- (CreateAUser, En) => "Create a user",
244- (CreateAUser, Tr) => "Kullanıcı oluştur",
168+ (CopyTokenNow, En) => "Shown once.",
169+ (CopyTokenNow, Tr) => "Bir kez gösterilir.",
245170 (CreateRegistrationToken, En) => "Create registration token",
246171 (CreateRegistrationToken, Tr) => "Kayıt belirteci oluştur",
247172 (CreateUser, En) => "Create user",
@@ -250,12 +175,8 @@ pub fn t(lang: Lang, key: K) -> &'static str {
250175 (Database, Tr) => "Veritabanı",
251176 (DatabaseErrorPrefix, En) => "Database: ",
252177 (DatabaseErrorPrefix, Tr) => "Veritabanı: ",
253- (DeleteAccountRest, En) => {
254- ". Its sessions, SSH keys, access tokens and stars are removed. Its issues, comments and reviews stay and are shown as written by the deleted user. This cannot be undone."
255- }
256- (DeleteAccountRest, Tr) => {
257- " hesabını siler. Oturumları, SSH anahtarları, erişim belirteçleri ve yıldızları kaldırılır. Sorunları, yorumları ve incelemeleri kalır; silinmiş kullanıcının adıyla gösterilir. Bu işlem geri alınamaz."
258- }
178+ (DeleteAccountRest, En) => ". This cannot be undone.",
179+ (DeleteAccountRest, Tr) => " hesabını siler. Bu işlem geri alınamaz.",
259180 (DeletesAccount, En) => "This deletes the account ",
260181 (DeletesAccount, Tr) => "Bu işlem ",
261182 (DeleteOrgTitle, En) => "Delete organization",
@@ -272,14 +193,10 @@ pub fn t(lang: Lang, key: K) -> &'static str {
272193 (Enable, Tr) => "Etkinleştir",
273194 (OpenOrgSettings, En) => "Open organization settings",
274195 (OpenOrgSettings, Tr) => "Kuruluş ayarlarını aç",
275- (OrgNotAUser, En) => {
276- " is an organization, not a user account, so it cannot be deleted from here. One of its owners deletes it from the organization's settings."
277- }
278- (OrgNotAUser, Tr) => {
279- " bir kuruluştur, kullanıcı hesabı değildir, bu yüzden buradan silinemez. Kuruluşu sahiplerinden biri, kuruluşun ayarlarından siler."
280- }
281- (OrgReposFirst, En) => "It can be deleted once it owns no repositories. It still owns:",
282- (OrgReposFirst, Tr) => "Hiç deposu kalmadığında silinebilir. Hâlâ sahip olduğu depolar:",
196+ (OrgNotAUser, En) => " is an organization.",
197+ (OrgNotAUser, Tr) => " bir kuruluştur.",
198+ (OrgReposFirst, En) => "Repositories it still owns:",
199+ (OrgReposFirst, Tr) => "Hâlâ sahip olduğu depolar:",
283200 (ErrAccountCannotBeDeleted, En) => "this account cannot be deleted",
284201 (ErrAccountCannotBeDeleted, Tr) => "bu hesap silinemez",
285202 (ErrBackupsNotConfigured, En) => {
@@ -320,12 +237,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
320237 (Fsck, Tr) => "Fsck",
321238 (Healthcheck, En) => "Healthcheck",
322239 (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)",
329240 (HealthError, En) => "error",
330241 (HealthError, Tr) => "hata",
331242 (HealthLagging, En) => "lagging",
@@ -334,8 +245,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
334245 (HealthNever, Tr) => "hiç çoğaltılmadı",
335246 (HealthOk, En) => "ok",
336247 (HealthOk, Tr) => "tamam",
337- (Interval, En) => "Interval",
338- (Interval, Tr) => "Aralık",
339248 (Invites, En) => "Invites",
340249 (Invites, Tr) => "Davetler",
341250 (LastDbAttempt, En) => "Last database attempt",
@@ -348,24 +257,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
348257 (LastSuccess, Tr) => "Son başarı",
349258 (ServerSettings, En) => "Server",
350259 (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",
369260 (SrvSaved, En) => "Server settings saved.",
370261 (SrvSaved, Tr) => "Sunucu ayarları kaydedildi.",
371262 (SrvNothingChanged, En) => "Nothing changed.",
@@ -382,18 +273,10 @@ pub fn t(lang: Lang, key: K) -> &'static str {
382273 (SrvKindRestart, Tr) => "yeniden başlatma",
383274 (SrvKindReadOnly, En) => "read-only",
384275 (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",
391276 (SrvSecretSet, En) => "set",
392277 (SrvSecretSet, Tr) => "ayarlı",
393278 (SrvSecretNotSet, En) => "not set",
394279 (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.",
397280 (SrvFileValue, En) => "File value",
398281 (SrvFileValue, Tr) => "Dosya değeri",
399282 (SrvEmpty, En) => "(empty)",
@@ -422,32 +305,12 @@ pub fn t(lang: Lang, key: K) -> &'static str {
422305 (MailDiscarded, Tr) => "Mesajdan vazgeçildi.",
423306 (MailSentAt, En) => "Sent",
424307 (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- }
439308 (MailNothingMatches, En) => "No message is in this state.",
440309 (MailNothingMatches, Tr) => "Bu durumda ileti yok.",
441310 (MailQueueEmpty, En) => "Nothing waiting to be sent.",
442311 (MailQueueEmpty, Tr) => "Gönderilmeyi bekleyen ileti yok.",
443312 (MailHost, En) => "Host",
444313 (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- }
451314 (MailPort, En) => "Port",
452315 (MailPort, Tr) => "Bağlantı noktası",
453316 (MailSettingsSaved, En) => "Mail settings saved.",
@@ -466,34 +329,8 @@ pub fn t(lang: Lang, key: K) -> &'static str {
466329 (NoRunnerWithId, Tr) => "Bu kimlikte bir çalıştırıcı yok. Hiçbir şey değiştirilmedi.",
467330 (NoRunsYet, En) => "No runs yet.",
468331 (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- }
485332 (Older, En) => "Older",
486333 (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- }
497334 (RecentRuns, En) => "Recent runs",
498335 (RecentRuns, Tr) => "Son çalıştırmalar",
499336 (ReconcileNow, En) => "Reconcile now",
@@ -506,26 +343,14 @@ pub fn t(lang: Lang, key: K) -> &'static str {
506343 (RegistrationToken, Tr) => "Kayıt belirteci",
507344 (RemovedWithAccount, En) => "Removed with the account:",
508345 (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.",
513346 (Replication, En) => "Replication",
514347 (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- }
521348 (ReplicationOff, En) => {
522349 "Replication is off. Set target, identity_file and known_hosts_file in the [replication] section to turn it on."
523350 }
524351 (ReplicationOff, Tr) => {
525352 "Çoğaltma kapalı. Açmak için [replication] bölümünde target, identity_file ve known_hosts_file ayarlarını yapın."
526353 }
527- (ReplicationTarget, En) => "Target",
528- (ReplicationTarget, Tr) => "Hedef",
529354 (Repos, En) => "Repos",
530355 (Repos, Tr) => "Depolar",
531356 (Retention, En) => "Retention",
@@ -551,10 +376,10 @@ pub fn t(lang: Lang, key: K) -> &'static str {
551376 (Runners, En) => "Runners",
552377 (Runners, Tr) => "Çalıştırıcılar",
553378 (ScheduledBackupsOff, En) => {
554- "Scheduled backups are off. Set dir in the [backup] section to turn them on."
379+ "Scheduled backups are off."
555380 }
556381 (ScheduledBackupsOff, Tr) => {
557- "Zamanlanmış yedeklemeler kapalı. Açmak için [backup] bölümünde dir ayarını yapın."
382+ "Zamanlanmış yedeklemeler kapalı."
558383 }
559384 (SecurityLogTitle, En) => "Security log",
560385 (SecurityLogTitle, Tr) => "Güvenlik günlüğü",
@@ -576,38 +401,12 @@ pub fn t(lang: Lang, key: K) -> &'static str {
576401 (StatusInProgress, Tr) => "sürüyor",
577402 (StatusOk, En) => "ok",
578403 (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",
587404 (TableLastError, En) => "Last error",
588405 (TableLastError, Tr) => "Son hata",
589406 (TableQueued, En) => "Queued",
590407 (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ı",
605408 (TableTries, En) => "Tries",
606409 (TableTries, Tr) => "Deneme",
607- (TableTrigger, En) => "Trigger",
608- (TableTrigger, Tr) => "Tetikleyen",
609- (TableWhen, En) => "When",
610- (TableWhen, Tr) => "Ne zaman",
611410 (TestQueued, En) => "Test message queued. It appears in the list when it is sent.",
612411 (TestQueued, Tr) => "Test iletisi kuyruğa alındı. Gönderildiğinde listede görünür.",
613412 (Token, En) => "Token",
@@ -653,58 +452,6 @@ pub fn deleted_repo_name(lang: Lang, subject: &str) -> String {
653452 }
654453 }
655454
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-
708455 /// "every 6 hours".
709456 pub fn every_hours(lang: Lang, hours: u64) -> String {
710457 match lang {
@@ -714,23 +461,6 @@ pub fn every_hours(lang: Lang, hours: u64) -> String {
714461 }
715462 }
716463
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-
734464 /// The run kind as a table cell: "backup" or "fsck".
735465 pub fn kind_name(lang: Lang, kind: RunKind) -> &'static str {
736466 match (kind, lang) {
@@ -828,24 +558,17 @@ mod tests {
828558
829559 const ALL: &[K] = &[
830560 K::ActionLabel,
831- K::ActorUsername,
832561 K::AddARunner,
833562 K::AdminArea,
834563 K::Administrator,
835564 K::AllActions,
836- K::RowActions,
837565 K::Anonymous,
838- K::AtLeast12Chars,
839- K::AuditIntro,
840566 K::AuditLog,
841567 K::BackToRunners,
842568 K::BackToUsers,
843- K::BackupInterval,
844569 K::Backups,
845- K::BackupsIntro,
846570 K::CiRunners,
847571 K::CopyTokenNow,
848- K::CreateAUser,
849572 K::CreateRegistrationToken,
850573 K::CreateUser,
851574 K::Database,
@@ -876,27 +599,16 @@ mod tests {
876599 K::FromName,
877600 K::Fsck,
878601 K::Healthcheck,
879- K::HealthcheckNotSet,
880- K::HealthcheckSet,
881- K::HealthcheckUrlInvalid,
882602 K::HealthError,
883603 K::HealthLagging,
884604 K::HealthNever,
885605 K::HealthOk,
886- K::Interval,
887606 K::Invites,
888607 K::LastDbAttempt,
889608 K::LastDbSnapshotShipped,
890609 K::LastSeen,
891610 K::LastSuccess,
892611 K::ServerSettings,
893- K::ServerSettingsIntro,
894- K::SrvTabGeneral,
895- K::SrvTabLimits,
896- K::SrvTabStorage,
897- K::SrvTabBackups,
898- K::SrvTabIntegrations,
899- K::SrvTabAlerts,
900612 K::SrvSaved,
901613 K::SrvNothingChanged,
902614 K::SrvResetDone,
@@ -905,17 +617,12 @@ mod tests {
905617 K::SrvKindLive,
906618 K::SrvKindRestart,
907619 K::SrvKindReadOnly,
908- K::SrvSourceDefault,
909- K::SrvSourceFile,
910- K::SrvSourceUi,
911620 K::SrvSecretSet,
912621 K::SrvSecretNotSet,
913- K::SrvSecretHint,
914622 K::SrvFileValue,
915623 K::SrvEmpty,
916624 K::Mail,
917625 K::MailHost,
918- K::MailIntro,
919626 K::MailTabSettings,
920627 K::MailTabQueue,
921628 K::MailFilterAll,
@@ -925,9 +632,6 @@ mod tests {
925632 K::MailNotFailed,
926633 K::MailDiscarded,
927634 K::MailSentAt,
928- K::MailTransportNote,
929- K::MailTransportInUse,
930- K::MailQueueIntro,
931635 K::MailNothingMatches,
932636 K::MailPort,
933637 K::MailSettingsSaved,
@@ -938,26 +642,16 @@ mod tests {
938642 K::NoRunnersYet,
939643 K::NoRunnerWithId,
940644 K::NoRunsYet,
941- K::BackupsEmptyHint,
942- K::ReplicationConfigHint,
943- K::ReposEmptyHint,
944- K::RunnersEmptyHint,
945645 K::MailQueueEmpty,
946646 K::Older,
947- K::OwnLogIntro,
948- K::PasswordStoredHint,
949647 K::RecentRuns,
950648 K::ReconcileNow,
951649 K::ReconcileStarted,
952650 K::RegisterARunner,
953651 K::RegistrationToken,
954652 K::RemovedWithAccount,
955- K::ReplacePrefix,
956- K::ReplaceSuffix,
957653 K::Replication,
958- K::ReplicationIntro,
959654 K::ReplicationOff,
960- K::ReplicationTarget,
961655 K::Repos,
962656 K::Retention,
963657 K::Role,
@@ -981,22 +675,9 @@ mod tests {
981675 K::StatusFailed,
982676 K::StatusInProgress,
983677 K::StatusOk,
984- K::TableActor,
985- K::TableDetails,
986- K::TableDuration,
987- K::TableKind,
988678 K::TableLastError,
989679 K::TableQueued,
990- K::TableResult,
991- K::TableSize,
992- K::TableStarted,
993- K::TableState,
994- K::TableSubject,
995- K::TableTarget,
996- K::TableTo,
997680 K::TableTries,
998- K::TableTrigger,
999- K::TableWhen,
1000681 K::TestQueued,
1001682 K::Token,
1002683 K::TokenCreateFailed,
crates/forge-web-base/src/i18n/authoring.rsmodified+0 -3
@@ -5,7 +5,6 @@ use super::Lang;
55 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
66 pub enum K {
77 Reviewers,
8- NoReviewers,
98 RequestReview,
109 ReviewerName,
1110 WithdrawRequest,
@@ -24,8 +23,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
2423 match (key, lang) {
2524 (Reviewers, En) => "Reviewers",
2625 (Reviewers, Tr) => "İnceleyenler",
27- (NoReviewers, En) => "No review requested",
28- (NoReviewers, Tr) => "İnceleme istenmedi",
2926 (RequestReview, En) => "Request review",
3027 (RequestReview, Tr) => "İnceleme iste",
3128 (ReviewerName, En) => "Username",
crates/forge-web-base/src/i18n/browse.rsmodified+1 -9
@@ -34,7 +34,6 @@ strings! {
3434
3535 BlameLink => "Blame", "Satır geçmişi";
3636 BlameTitle => "Blame", "Satır geçmişi";
37- BlameBackToFile => "Back to file", "Dosyaya dön";
3837 BlamePrior => "Blame prior to this commit", "Bu işlemeden önceki satır geçmişi";
3938 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.";
4039 BlameFailed => "Blame could not be computed for this file.", "Bu dosya için satır geçmişi hesaplanamadı.";
@@ -42,7 +41,6 @@ strings! {
4241
4342 CopyPermalink => "Copy permalink", "Kalıcı bağlantıyı kopyala";
4443 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.";
4644
4745 GoToFile => "Go to file", "Dosyaya git";
4846 FinderTitle => "Go to file", "Dosyaya git";
@@ -66,19 +64,13 @@ strings! {
6664 PaletteDone => "Done", "Tamamlandı";
6765 PaletteActionFailed => "The action did not go through.", "İşlem gerçekleşmedi.";
6866
69- BranchAuthorHeader => "Author", "Yazar";
70- BranchAheadBehindHeader => "Ahead / behind", "Önde / geride";
71- BranchActionsHeader => "Actions", "İşlemler";
7267 UpToDate => "Even with the default branch", "Varsayılan dalla aynı";
7368 NewPr => "New PR", "Yeni PR";
7469 DeleteBranch => "Delete", "Sil";
75- DeleteConfirm => "Delete this branch? Its commits stay in the repository until they are cleaned up.", "Bu dal silinsin mi? İşlemeleri temizlenene kadar depoda kalır.";
76- DeleteConfirmYes => "Yes, delete branch", "Evet, dalı sil";
77- DeleteCancel => "Cancel", "Vazgeç";
70+ DeleteConfirm => "Delete this branch?", "Bu dal silinsin mi?";
7871 NewBranchTitle => "New branch", "Yeni dal";
7972 BranchNameLabel => "Branch name", "Dal adı";
8073 BranchFromLabel => "From", "Kaynak";
81- BranchFromPlaceholder => "branch, tag or commit", "dal, etiket veya işleme";
8274 CreateBranch => "Create branch", "Dal oluştur";
8375 BranchCreated => "Branch created.", "Dal oluşturuldu.";
8476 BranchDeleted => "Branch deleted.", "Dal silindi.";
crates/forge-web-base/src/i18n/code.rsmodified+8 -28
@@ -24,7 +24,6 @@ pub enum K {
2424 CopyCloneUrl,
2525 CloneCopied,
2626 CloneCopyFailed,
27- SshRequiresKey,
2827 BranchesTitle,
2928 FilterRefs,
3029 ViewAllBranches,
@@ -39,8 +38,6 @@ pub enum K {
3938 HadRecentPushes,
4039 CompareAndPr,
4140 BranchLabel,
42- LastCommitHeader,
43- AgeHeader,
4441 KindDir,
4542 KindFile,
4643 KindExec,
@@ -51,7 +48,6 @@ pub enum K {
5148 HistoryLink,
5249 RawLink,
5350 DownloadLink,
54- FileNav,
5551 SymlinkPrefix,
5652 SubmodulePrefix,
5753 SubmoduleSuffix,
@@ -108,7 +104,6 @@ pub enum K {
108104 NothingHere,
109105 DefaultBadge,
110106 TagsTitle,
111- TagKindLabel,
112107 ForkedFrom,
113108 MirrorOf,
114109 NotSyncedYet,
@@ -166,8 +161,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
166161 (CloneCopied, Tr) => "Kopyalandı",
167162 (CloneCopyFailed, En) => "Copy failed",
168163 (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ı)",
171164 (BranchesTitle, En) => "Branches",
172165 (BranchesTitle, Tr) => "Dallar",
173166 (FilterRefs, En) => "Filter branches and tags",
@@ -176,8 +169,8 @@ pub fn t(lang: Lang, key: K) -> &'static str {
176169 (ViewAllBranches, Tr) => "Tüm dalları gör",
177170 (ViewAllTags, En) => "View all tags",
178171 (ViewAllTags, Tr) => "Tüm etiketleri gör",
179- (EmptyRepoPush, En) => "This repository is empty. Push a branch to get started:",
180- (EmptyRepoPush, Tr) => "Bu depo boş. Başlamak için bir dal gönderin:",
172+ (EmptyRepoPush, En) => "This repository is empty.",
173+ (EmptyRepoPush, Tr) => "Bu depo boş.",
181174 (OverHttps, En) => "Over HTTPS",
182175 (OverHttps, Tr) => "HTTPS üzerinden",
183176 (OverSsh, En) => "Over SSH",
@@ -196,10 +189,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
196189 (CompareAndPr, Tr) => "Karşılaştır ve çekme isteği aç",
197190 (BranchLabel, En) => "Branch",
198191 (BranchLabel, Tr) => "Dal",
199- (LastCommitHeader, En) => "Last commit",
200- (LastCommitHeader, Tr) => "Son commit",
201- (AgeHeader, En) => "Age",
202- (AgeHeader, Tr) => "Zaman",
203192 (KindDir, En) => "dir",
204193 (KindDir, Tr) => "dizin",
205194 (KindFile, En) => "file",
@@ -220,8 +209,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
220209 (RawLink, Tr) => "Ham",
221210 (DownloadLink, En) => "Download",
222211 (DownloadLink, Tr) => "İndir",
223- (FileNav, En) => "File",
224- (FileNav, Tr) => "Dosya",
225212 (SymlinkPrefix, En) => "Symbolic link → ",
226213 (SymlinkPrefix, Tr) => "Sembolik bağlantı → ",
227214 (SubmodulePrefix, En) => "Submodule at commit ",
@@ -230,8 +217,8 @@ pub fn t(lang: Lang, key: K) -> &'static str {
230217 (SubmoduleSuffix, Tr) => ". İçeriği bu depoda yok.",
231218 (TruncatedPrefix, En) => "Showing the first 1 MiB of this file. ",
232219 (TruncatedPrefix, Tr) => "Bu dosyanın ilk 1 MiB'ı gösteriliyor. ",
233- (ViewFullRaw, En) => "View the full file raw",
234- (ViewFullRaw, Tr) => "Dosyanın tamamını ham olarak görüntüle",
220+ (ViewFullRaw, En) => "View raw",
221+ (ViewFullRaw, Tr) => "Ham görüntüle",
235222 (LivePathGone, En) => "This path no longer exists in this ref.",
236223 (LivePathGone, Tr) => "Bu yol bu referansta artık yok.",
237224 (StatusAdded, En) => "added",
@@ -320,22 +307,20 @@ pub fn t(lang: Lang, key: K) -> &'static str {
320307 (FilteredTo, Tr) => "Şuna göre filtrelendi: ",
321308 (ClearFilter, En) => "Clear filter",
322309 (ClearFilter, Tr) => "Filtreyi temizle",
323- (NoCommits, En) => "No commits yet. Push a branch and its history shows up here.",
324- (NoCommits, Tr) => "Henüz commit yok. Bir dal gönderin, geçmişi burada görünsün.",
310+ (NoCommits, En) => "No commits yet.",
311+ (NoCommits, Tr) => "Henüz commit yok.",
325312 (BrowseFilesShort, En) => "Browse files",
326313 (BrowseFilesShort, Tr) => "Dosyalara göz at",
327314 (NewerLink, En) => "Newer",
328315 (NewerLink, Tr) => "Daha yeni",
329316 (OlderLink, En) => "Older",
330317 (OlderLink, Tr) => "Daha eski",
331- (NothingHere, En) => "Nothing here yet. Push a commit and it shows up.",
332- (NothingHere, Tr) => "Henüz burada bir şey yok. Bir commit gönderin, burada görünsün.",
318+ (NothingHere, En) => "Nothing here yet.",
319+ (NothingHere, Tr) => "Henüz burada bir şey yok.",
333320 (DefaultBadge, En) => "default",
334321 (DefaultBadge, Tr) => "varsayılan",
335322 (TagsTitle, En) => "Tags",
336323 (TagsTitle, Tr) => "Etiketler",
337- (TagKindLabel, En) => "Tag",
338- (TagKindLabel, Tr) => "Etiket",
339324 (ForkedFrom, En) => "forked from ",
340325 (ForkedFrom, Tr) => "Şu depodan çatallandı: ",
341326 (MirrorOf, En) => "Mirror of ",
@@ -552,7 +537,6 @@ mod tests {
552537 K::CopyCloneUrl,
553538 K::CloneCopied,
554539 K::CloneCopyFailed,
555- K::SshRequiresKey,
556540 K::BranchesTitle,
557541 K::FilterRefs,
558542 K::ViewAllBranches,
@@ -567,8 +551,6 @@ mod tests {
567551 K::HadRecentPushes,
568552 K::CompareAndPr,
569553 K::BranchLabel,
570- K::LastCommitHeader,
571- K::AgeHeader,
572554 K::KindDir,
573555 K::KindFile,
574556 K::KindExec,
@@ -579,7 +561,6 @@ mod tests {
579561 K::HistoryLink,
580562 K::RawLink,
581563 K::DownloadLink,
582- K::FileNav,
583564 K::SymlinkPrefix,
584565 K::SubmodulePrefix,
585566 K::SubmoduleSuffix,
@@ -636,7 +617,6 @@ mod tests {
636617 K::NothingHere,
637618 K::DefaultBadge,
638619 K::TagsTitle,
639- K::TagKindLabel,
640620 K::ForkedFrom,
641621 K::MirrorOf,
642622 K::NotSyncedYet,
crates/forge-web-base/src/i18n/community.rsmodified+0 -66
@@ -19,7 +19,6 @@ pub enum K {
1919 Category,
2020 Title,
2121 Description,
22- MarkdownSupported,
2322 StartDiscussion,
2423 Cancel,
2524 Save,
@@ -38,8 +37,6 @@ pub enum K {
3837 UnlockConversation,
3938 Answered,
4039 Locked,
41- OpenedThis,
42- OpenedSeparator,
4340 NoDescription,
4441 LockedNotice,
4542 AddComment,
@@ -47,9 +44,6 @@ pub enum K {
4744 LogInLink,
4845 ToCommentSuffix,
4946 ArchivedDiscussions,
50- DiscussionsDescription,
51- TurnOffDiscussions,
52- TurnOnDiscussions,
5347 CategoryGeneral,
5448 CategoryIdeas,
5549 CategoryQa,
@@ -68,17 +62,12 @@ pub enum K {
6862 BackToPage,
6963 NoChangesYet,
7064 PageName,
71- PageNameHint,
7265 ContentMarkdown,
73- WikiLinkHint,
7466 Summary,
7567 SavePage,
7668 PageNameRules,
7769 PageExists,
7870 WikiConflict,
79- WikiSettings,
80- EnableWiki,
81- WikiDisabledHint,
8271 WikiPages,
8372
8473 // Snippets.
@@ -105,9 +94,6 @@ pub enum K {
10594 SaveSnippet,
10695 EditSnippet,
10796 Raw,
108- SnippetNav,
109- FileNav,
110- OnlyOwnerEdits,
11197 Revisions,
11298 BackToSnippet,
11399 NoRevisions,
@@ -139,8 +125,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
139125 (Title, Tr) => "Başlık",
140126 (Description, En) => "Description",
141127 (Description, Tr) => "Açıklama",
142- (MarkdownSupported, En) => "Markdown supported.",
143- (MarkdownSupported, Tr) => "Markdown desteklenir.",
144128 (StartDiscussion, En) => "Start discussion",
145129 (StartDiscussion, Tr) => "Tartışma başlat",
146130 (Cancel, En) => "Cancel",
@@ -177,10 +161,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
177161 (Answered, Tr) => "Cevaplandı",
178162 (Locked, En) => "Locked",
179163 (Locked, Tr) => "Kilitli",
180- (OpenedThis, En) => " opened this ",
181- (OpenedThis, Tr) => " tarafından ",
182- (OpenedSeparator, En) => " · ",
183- (OpenedSeparator, Tr) => " açıldı · ",
184164 (NoDescription, En) => "_No description provided._",
185165 (NoDescription, Tr) => "_Açıklama eklenmedi._",
186166 (LockedNotice, En) => {
@@ -201,16 +181,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
201181 "This repository is archived, so its discussions are read-only."
202182 }
203183 (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ç",
214184 (CategoryGeneral, En) => "General",
215185 (CategoryGeneral, Tr) => "Genel",
216186 (CategoryIdeas, En) => "Ideas",
@@ -244,14 +214,8 @@ pub fn t(lang: Lang, key: K) -> &'static str {
244214 (NoChangesYet, Tr) => "Henüz değişiklik yok.",
245215 (PageName, En) => "Page name",
246216 (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.",
249217 (ContentMarkdown, En) => "Content (Markdown)",
250218 (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- }
255219 (Summary, En) => "Summary",
256220 (Summary, Tr) => "Özet",
257221 (SavePage, En) => "Save page",
@@ -268,16 +232,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
268232 (WikiConflict, Tr) => {
269233 "Siz düzenlerken başka biri bu wiki'yi kaydetti. Metniniz aşağıda duruyor; kopyalayın, sayfayı yenileyin ve yeniden kaydedin."
270234 }
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- }
281235 (WikiPages, En) => "Wiki pages",
282236 (WikiPages, Tr) => "Wiki sayfaları",
283237
@@ -327,12 +281,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
327281 (EditSnippet, Tr) => "Parçacığı düzenle",
328282 (Raw, En) => "Raw",
329283 (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.",
336284 (Revisions, En) => "Revisions",
337285 (Revisions, Tr) => "Revizyonlar",
338286 (BackToSnippet, En) => "Back to the snippet",
@@ -461,7 +409,6 @@ mod tests {
461409 K::Category,
462410 K::Title,
463411 K::Description,
464- K::MarkdownSupported,
465412 K::StartDiscussion,
466413 K::Cancel,
467414 K::Save,
@@ -480,8 +427,6 @@ mod tests {
480427 K::UnlockConversation,
481428 K::Answered,
482429 K::Locked,
483- K::OpenedThis,
484- K::OpenedSeparator,
485430 K::NoDescription,
486431 K::LockedNotice,
487432 K::AddComment,
@@ -489,9 +434,6 @@ mod tests {
489434 K::LogInLink,
490435 K::ToCommentSuffix,
491436 K::ArchivedDiscussions,
492- K::DiscussionsDescription,
493- K::TurnOffDiscussions,
494- K::TurnOnDiscussions,
495437 K::CategoryGeneral,
496438 K::CategoryIdeas,
497439 K::CategoryQa,
@@ -508,17 +450,12 @@ mod tests {
508450 K::BackToPage,
509451 K::NoChangesYet,
510452 K::PageName,
511- K::PageNameHint,
512453 K::ContentMarkdown,
513- K::WikiLinkHint,
514454 K::Summary,
515455 K::SavePage,
516456 K::PageNameRules,
517457 K::PageExists,
518458 K::WikiConflict,
519- K::WikiSettings,
520- K::EnableWiki,
521- K::WikiDisabledHint,
522459 K::WikiPages,
523460 K::Snippets,
524461 K::NewSnippet,
@@ -543,9 +480,6 @@ mod tests {
543480 K::SaveSnippet,
544481 K::EditSnippet,
545482 K::Raw,
546- K::SnippetNav,
547- K::FileNav,
548- K::OnlyOwnerEdits,
549483 K::Revisions,
550484 K::BackToSnippet,
551485 K::NoRevisions,
crates/forge-web-base/src/i18n/integrations.rsmodified+0 -120
@@ -5,13 +5,9 @@ use super::Lang;
55 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
66 pub enum K {
77 ActiveField,
8- ArchivedHookNote,
9- AddPullIntro,
108 AddPullMirror,
11- AddPushIntro,
129 AddPushMirror,
1310 AddWebhook,
14- AddWebhookIntro,
1511 ArchivedNotice,
1612 BackToWebhooks,
1713 ClearSecret,
@@ -19,14 +15,10 @@ pub enum K {
1915 CurrentUrl,
2016 Cancel,
2117 DeleteConfirm,
22- DeleteIntro,
2318 DeleteMirror,
24- DeleteTextPull,
25- DeleteTextPush,
2619 DeleteWebhook,
2720 DirectionPull,
2821 DirectionPush,
29- EditWebhook,
3022 EnabledField,
3123 ErrIntervalMax,
3224 ErrIntervalNotWhole,
@@ -54,7 +46,6 @@ pub enum K {
5446 LastSync,
5547 ManualOnly,
5648 Mirrors,
57- MirrorsIntro,
5849 NoDeliveries,
5950 NoMirrors,
6051 NoWebhooks,
@@ -82,14 +73,10 @@ pub enum K {
8273 SaveMirror,
8374 SaveWebhook,
8475 Secret,
85- SecretHintNew,
8676 SecretHintSet,
8777 SecretHintUnset,
8878 SecretOptional,
89- SecretSet,
90- SecretUnset,
9179 SendTestPing,
92- SignedWith,
9380 StateFailed,
9481 StateGaveUp,
9582 StateOk,
@@ -100,42 +87,29 @@ pub enum K {
10087 StatusNotRun,
10188 StatusOk,
10289 SyncHeading,
103- SyncIntro,
10490 SyncNow,
10591 Test,
106- TestIntro,
107- UrlHintKeep,
108- UrlHintNew,
10992 UsernameOptional,
11093 Webhooks,
111- WebhooksIntro,
11294 }
11395
11496 /// Every key, so the tests can walk them.
11597 #[cfg(test)]
11698 pub const ALL: &[K] = &[
11799 K::ActiveField,
118- K::ArchivedHookNote,
119- K::AddPullIntro,
120100 K::AddPullMirror,
121- K::AddPushIntro,
122101 K::AddPushMirror,
123102 K::AddWebhook,
124- K::AddWebhookIntro,
125103 K::ArchivedNotice,
126104 K::BackToWebhooks,
127105 K::ClearSecret,
128106 K::CreateWebhook,
129107 K::CurrentUrl,
130108 K::DeleteConfirm,
131- K::DeleteIntro,
132109 K::DeleteMirror,
133- K::DeleteTextPull,
134- K::DeleteTextPush,
135110 K::DeleteWebhook,
136111 K::DirectionPull,
137112 K::DirectionPush,
138- K::EditWebhook,
139113 K::EnabledField,
140114 K::ErrIntervalMax,
141115 K::ErrIntervalNotWhole,
@@ -163,7 +137,6 @@ pub const ALL: &[K] = &[
163137 K::LastSync,
164138 K::ManualOnly,
165139 K::Mirrors,
166- K::MirrorsIntro,
167140 K::NoDeliveries,
168141 K::NoMirrors,
169142 K::NoWebhooks,
@@ -191,14 +164,10 @@ pub const ALL: &[K] = &[
191164 K::SaveMirror,
192165 K::SaveWebhook,
193166 K::Secret,
194- K::SecretHintNew,
195167 K::SecretHintSet,
196168 K::SecretHintUnset,
197169 K::SecretOptional,
198- K::SecretSet,
199- K::SecretUnset,
200170 K::SendTestPing,
201- K::SignedWith,
202171 K::StateFailed,
203172 K::StateGaveUp,
204173 K::StateOk,
@@ -209,15 +178,10 @@ pub const ALL: &[K] = &[
209178 K::StatusNotRun,
210179 K::StatusOk,
211180 K::SyncHeading,
212- K::SyncIntro,
213181 K::SyncNow,
214182 K::Test,
215- K::TestIntro,
216- K::UrlHintKeep,
217- K::UrlHintNew,
218183 K::UsernameOptional,
219184 K::Webhooks,
220- K::WebhooksIntro,
221185 ];
222186
223187 /// The phrase a key names, in a user's language.
@@ -227,32 +191,12 @@ pub fn t(lang: Lang, key: K) -> &'static str {
227191 match (key, lang) {
228192 (ActiveField, En) => "Active: deliver events to this URL",
229193 (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- }
238194 (AddPullMirror, En) => "Add pull mirror",
239195 (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- }
246196 (AddPushMirror, En) => "Add push mirror",
247197 (AddPushMirror, Tr) => "Gönderme yansısı ekle",
248198 (AddWebhook, En) => "Add webhook",
249199 (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- }
256200 (ArchivedNotice, En) => {
257201 "This repository is archived. Mirrors are read-only: they cannot be changed, synced or deleted."
258202 }
@@ -271,32 +215,14 @@ pub fn t(lang: Lang, key: K) -> &'static str {
271215 (Cancel, Tr) => "Vazgeç",
272216 (DeleteConfirm, En) => "Delete it? This cannot be undone.",
273217 (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- }
280218 (DeleteMirror, En) => "Delete mirror",
281219 (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- }
292220 (DeleteWebhook, En) => "Delete webhook",
293221 (DeleteWebhook, Tr) => "Web kancasını sil",
294222 (DirectionPull, En) => "Pull",
295223 (DirectionPull, Tr) => "Çekme",
296224 (DirectionPush, En) => "Push",
297225 (DirectionPush, Tr) => "Gönderme",
298- (EditWebhook, En) => "Edit webhook",
299- (EditWebhook, Tr) => "Web kancasını düzenle",
300226 (EnabledField, En) => "Enabled: sync on the interval and after pushes",
301227 (EnabledField, Tr) => "Etkin: aralıkla ve göndermelerden sonra eşitlenir",
302228 (ErrIntervalMax, En) => "The sync interval can be at most one year.",
@@ -359,12 +285,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
359285 (ManualOnly, Tr) => "yalnızca elle",
360286 (Mirrors, En) => "Mirrors",
361287 (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- }
368288 (NoDeliveries, En) => "No deliveries yet.",
369289 (NoDeliveries, Tr) => "Henüz teslimat yok.",
370290 (NoMirrors, En) => "No mirrors yet.",
@@ -429,12 +349,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
429349 (SaveWebhook, Tr) => "Web kancasını kaydet",
430350 (Secret, En) => "Secret",
431351 (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- }
438352 (SecretHintSet, En) => {
439353 "A secret is set. Leave the field blank to keep it, or type a new one to replace it."
440354 }
@@ -445,20 +359,8 @@ pub fn t(lang: Lang, key: K) -> &'static str {
445359 (SecretHintUnset, Tr) => "Gizli anahtar ayarlı değil. Eklemek için bir tane yazın.",
446360 (SecretOptional, En) => "Password or token (optional)",
447361 (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- }
458362 (SendTestPing, En) => "Send test ping",
459363 (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.",
462364 (StateFailed, En) => "failed, will retry",
463365 (StateFailed, Tr) => "başarısız, yeniden denenecek",
464366 (StateGaveUp, En) => "gave up",
@@ -479,36 +381,14 @@ pub fn t(lang: Lang, key: K) -> &'static str {
479381 (StatusOk, Tr) => "tamam",
480382 (SyncHeading, En) => "Sync",
481383 (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.",
484384 (SyncNow, En) => "Sync now",
485385 (SyncNow, Tr) => "Şimdi eşitle",
486386 (Test, En) => "Test",
487387 (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- }
502388 (UsernameOptional, En) => "Username (optional)",
503389 (UsernameOptional, Tr) => "Kullanıcı adı (isteğe bağlı)",
504390 (Webhooks, En) => "Webhooks",
505391 (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- }
512392 }
513393 }
514394
crates/forge-web-base/src/i18n/issues.rsmodified+33 -62
@@ -38,7 +38,6 @@ pub enum K {
3838 PinIssue,
3939 UnpinIssue,
4040 PinnedTopNote,
41- NotPinned,
4241 PinnedIssues,
4342
4443 // Lock reasons: the lowercase reader text, then the select options.
@@ -73,7 +72,6 @@ pub enum K {
7372 ReviewDismissedPrefix,
7473
7574 // Item byline and edit forms.
76- OpenedThis,
7775 StateClosedNotPlanned,
7876 SaveChanges,
7977 EditComment,
@@ -95,29 +93,26 @@ pub enum K {
9593 SaveLabels,
9694 NoneYet,
9795 Assignees,
98- CommaUsernames,
9996 SaveAssignees,
100- NoOneAssigned,
10197 AssignToMe,
10298 MilestoneBox,
10399 NoneOption,
104100 SaveMilestone,
105- NoMilestone,
106101 ConversationBox,
107102 Locked,
108103 UnlockConversation,
109104 NoReason,
110- LockReasonAria,
111105 LockConversation,
112106 LockedToCollaborators,
113- OpenToEveryone,
114107
115108 // Comment form.
116109 AddComment,
117110 CloseCompleted,
118111 CloseNotPlanned,
119- ReopenWithComment,
120112 CommentEmpty,
113+ Add,
114+ Close,
115+ Reopen,
121116
122117 // Label page.
123118 LabelsArchived,
@@ -130,7 +125,6 @@ pub enum K {
130125
131126 // Milestone page.
132127 MilestonesArchived,
133- NoDueDate,
134128 Overdue,
135129 MilestoneState,
136130 NoClosedMilestones,
@@ -154,15 +148,12 @@ pub enum K {
154148 NoIssuesMatch,
155149 NoIssuesYet,
156150 SearchTitles,
157- IssuesByState,
158- LabelsAndMilestones,
159151 FiltersApplied,
160152 ClearFilters,
161153 Opened,
162154 By,
163155 ChooseTemplate,
164156 BlankIssue,
165- MarkdownSupported,
166157 SubmitNewIssue,
167158 Newer,
168159 Older,
@@ -172,7 +163,6 @@ pub enum K {
172163 HistPullDescription,
173164 HistComment,
174165 HistReviewComment,
175- NoTextChange,
176166 NoEarlierVersions,
177167 }
178168
@@ -184,14 +174,6 @@ pub fn edited_after(lang: Lang) -> &'static str {
184174 }
185175 }
186176
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-
195177 pub fn t(lang: Lang, key: K) -> &'static str {
196178 match (key, lang) {
197179 (K::CouldNotSave, Lang::En) => "Could not save",
@@ -253,8 +235,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
253235 (K::UnpinIssue, Lang::Tr) => "Sabitlemeyi kaldır",
254236 (K::PinnedTopNote, Lang::En) => "Pinned to the top of the issue list.",
255237 (K::PinnedTopNote, Lang::Tr) => "Sorun listesinin en üstünde sabitlendi.",
256- (K::NotPinned, Lang::En) => "Not pinned.",
257- (K::NotPinned, Lang::Tr) => "Sabitlenmemiş.",
258238 (K::PinnedIssues, Lang::En) => "Pinned issues",
259239 (K::PinnedIssues, Lang::Tr) => "Sabitlenmiş sorunlar",
260240
@@ -322,8 +302,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
322302 (K::ReviewDismissedPrefix, Lang::En) => "dismissed a review: ",
323303 (K::ReviewDismissedPrefix, Lang::Tr) => "bir incelemeyi iptal etti: ",
324304
325- (K::OpenedThis, Lang::En) => " opened this ",
326- (K::OpenedThis, Lang::Tr) => " bunu ",
327305 (K::StateClosedNotPlanned, Lang::En) => "Closed as not planned",
328306 (K::StateClosedNotPlanned, Lang::Tr) => "Planlanmadı olarak kapalı",
329307 (K::SaveChanges, Lang::En) => "Save changes",
@@ -347,8 +325,8 @@ pub fn t(lang: Lang, key: K) -> &'static str {
347325 (K::ReviewedDismissed, Lang::Tr) => "inceledi (iptal edildi)",
348326 (K::DismissedPrefix, Lang::En) => "dismissed: ",
349327 (K::DismissedPrefix, Lang::Tr) => "iptal edildi: ",
350- (K::AddReaction, Lang::En) => "Add reaction",
351- (K::AddReaction, Lang::Tr) => "Tepki ekle",
328+ (K::AddReaction, Lang::En) => "React",
329+ (K::AddReaction, Lang::Tr) => "Tepki ver",
352330 (K::NoDescription, Lang::En) => "_No description provided._",
353331 (K::NoDescription, Lang::Tr) => "_Açıklama girilmedi._",
354332
@@ -360,12 +338,8 @@ pub fn t(lang: Lang, key: K) -> &'static str {
360338 (K::NoneYet, Lang::Tr) => "Henüz yok.",
361339 (K::Assignees, Lang::En) => "Assignees",
362340 (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.",
365341 (K::SaveAssignees, Lang::En) => "Save assignees",
366342 (K::SaveAssignees, Lang::Tr) => "Atananları kaydet",
367- (K::NoOneAssigned, Lang::En) => "No one assigned.",
368- (K::NoOneAssigned, Lang::Tr) => "Kimse atanmadı.",
369343 (K::AssignToMe, Lang::En) => "Assign to me",
370344 (K::AssignToMe, Lang::Tr) => "Bana ata",
371345 (K::MilestoneBox, Lang::En) => "Milestone",
@@ -374,8 +348,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
374348 (K::NoneOption, Lang::Tr) => "Yok",
375349 (K::SaveMilestone, Lang::En) => "Save milestone",
376350 (K::SaveMilestone, Lang::Tr) => "Kilometre taşını kaydet",
377- (K::NoMilestone, Lang::En) => "No milestone.",
378- (K::NoMilestone, Lang::Tr) => "Kilometre taşı yok.",
379351 (K::ConversationBox, Lang::En) => "Conversation",
380352 (K::ConversationBox, Lang::Tr) => "Tartışma",
381353 (K::Locked, Lang::En) => "Locked",
@@ -384,14 +356,10 @@ pub fn t(lang: Lang, key: K) -> &'static str {
384356 (K::UnlockConversation, Lang::Tr) => "Tartışmanın kilidini aç",
385357 (K::NoReason, Lang::En) => "No reason",
386358 (K::NoReason, Lang::Tr) => "Neden yok",
387- (K::LockReasonAria, Lang::En) => "Lock reason",
388- (K::LockReasonAria, Lang::Tr) => "Kilit nedeni",
389359 (K::LockConversation, Lang::En) => "Lock conversation",
390360 (K::LockConversation, Lang::Tr) => "Tartışmayı kilitle",
391361 (K::LockedToCollaborators, Lang::En) => "Locked to collaborators",
392362 (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",
395363
396364 (K::AddComment, Lang::En) => "Add a comment",
397365 (K::AddComment, Lang::Tr) => "Yorum ekle",
@@ -399,10 +367,14 @@ pub fn t(lang: Lang, key: K) -> &'static str {
399367 (K::CloseCompleted, Lang::Tr) => "Tamamlandı olarak kapat",
400368 (K::CloseNotPlanned, Lang::En) => "Close as not planned",
401369 (K::CloseNotPlanned, Lang::Tr) => "Planlanmadı olarak kapat",
402- (K::ReopenWithComment, Lang::En) => "Reopen with comment",
403- (K::ReopenWithComment, Lang::Tr) => "Yorumla yeniden aç",
404370 (K::CommentEmpty, Lang::En) => "Comment cannot be empty.",
405371 (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ç",
406378
407379 (K::LabelsArchived, Lang::En) => "This repository is archived. Labels are read-only.",
408380 (K::LabelsArchived, Lang::Tr) => "Bu depo arşivlenmiş. Etiketler salt okunur.",
@@ -423,8 +395,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
423395 "This repository is archived. Milestones are read-only."
424396 }
425397 (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",
428398 (K::Overdue, Lang::En) => "overdue",
429399 (K::Overdue, Lang::Tr) => "gecikmiş",
430400 (K::MilestoneState, Lang::En) => "Milestone state",
@@ -468,10 +438,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
468438 (K::NoIssuesYet, Lang::Tr) => "Henüz sorun yok. Konuşmayı başlatmak için bir sorun açın.",
469439 (K::SearchTitles, Lang::En) => "Search titles",
470440 (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ı",
475441 (K::FiltersApplied, Lang::En) => "Filters applied · ",
476442 (K::FiltersApplied, Lang::Tr) => "Filtreler uygulandı · ",
477443 (K::ClearFilters, Lang::En) => "Clear filters",
@@ -484,8 +450,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
484450 (K::ChooseTemplate, Lang::Tr) => "Başlamak için bir şablon seçin.",
485451 (K::BlankIssue, Lang::En) => "Open a blank issue",
486452 (K::BlankIssue, Lang::Tr) => "Boş bir sorun aç",
487- (K::MarkdownSupported, Lang::En) => "Markdown supported.",
488- (K::MarkdownSupported, Lang::Tr) => "Markdown desteklenir.",
489453 (K::SubmitNewIssue, Lang::En) => "Submit new issue",
490454 (K::SubmitNewIssue, Lang::Tr) => "Yeni sorunu gönder",
491455 (K::Newer, Lang::En) => "Newer",
@@ -501,8 +465,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
501465 (K::HistComment, Lang::Tr) => "yorum",
502466 (K::HistReviewComment, Lang::En) => "review comment",
503467 (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.",
506468 (K::NoEarlierVersions, Lang::En) => "No earlier versions.",
507469 (K::NoEarlierVersions, Lang::Tr) => "Önceki sürüm yok.",
508470 }
@@ -709,6 +671,25 @@ pub fn reaction_more(lang: Lang, names: &str, more: usize) -> String {
709671
710672 // Timeline event sentences.
711673
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+
712693 pub fn event_label_added(lang: Lang, label: &str) -> String {
713694 match lang {
714695 Lang::En => format!("added the {label} label"),
@@ -943,7 +924,6 @@ mod tests {
943924 K::PinIssue,
944925 K::UnpinIssue,
945926 K::PinnedTopNote,
946- K::NotPinned,
947927 K::PinnedIssues,
948928 K::LockOffTopic,
949929 K::LockTooHeated,
@@ -972,7 +952,6 @@ mod tests {
972952 K::DeletedHeadBranch,
973953 K::InCommit,
974954 K::ReviewDismissedPrefix,
975- K::OpenedThis,
976955 K::StateClosedNotPlanned,
977956 K::SaveChanges,
978957 K::EditComment,
@@ -990,26 +969,23 @@ mod tests {
990969 K::SaveLabels,
991970 K::NoneYet,
992971 K::Assignees,
993- K::CommaUsernames,
994972 K::SaveAssignees,
995- K::NoOneAssigned,
996973 K::AssignToMe,
997974 K::MilestoneBox,
998975 K::NoneOption,
999976 K::SaveMilestone,
1000- K::NoMilestone,
1001977 K::ConversationBox,
1002978 K::Locked,
1003979 K::UnlockConversation,
1004980 K::NoReason,
1005- K::LockReasonAria,
1006981 K::LockConversation,
1007982 K::LockedToCollaborators,
1008- K::OpenToEveryone,
1009983 K::AddComment,
1010984 K::CloseCompleted,
1011985 K::CloseNotPlanned,
1012- K::ReopenWithComment,
986+ K::Add,
987+ K::Close,
988+ K::Reopen,
1013989 K::CommentEmpty,
1014990 K::LabelsArchived,
1015991 K::NoLabelsYet,
@@ -1019,7 +995,6 @@ mod tests {
1019995 K::CreateLabel,
1020996 K::OpenLabelCount,
1021997 K::MilestonesArchived,
1022- K::NoDueDate,
1023998 K::Overdue,
1024999 K::MilestoneState,
10251000 K::NoClosedMilestones,
@@ -1041,15 +1016,12 @@ mod tests {
10411016 K::NoIssuesMatch,
10421017 K::NoIssuesYet,
10431018 K::SearchTitles,
1044- K::IssuesByState,
1045- K::LabelsAndMilestones,
10461019 K::FiltersApplied,
10471020 K::ClearFilters,
10481021 K::Opened,
10491022 K::By,
10501023 K::ChooseTemplate,
10511024 K::BlankIssue,
1052- K::MarkdownSupported,
10531025 K::SubmitNewIssue,
10541026 K::Newer,
10551027 K::Older,
@@ -1057,7 +1029,6 @@ mod tests {
10571029 K::HistPullDescription,
10581030 K::HistComment,
10591031 K::HistReviewComment,
1060- K::NoTextChange,
10611032 K::NoEarlierVersions,
10621033 ];
10631034
crates/forge-web-base/src/i18n/merge_queue.rsmodified+4 -52
@@ -6,10 +6,8 @@ use super::Lang;
66 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
77 pub enum K {
88 RequireMergeQueue,
9- RequireMergeQueueHint,
109 RuleMergeQueue,
1110 AddToMergeQueue,
12- MergeQueueHint,
1311 RemoveFromQueue,
1412 MergeQueueTitle,
1513 MergeQueueNav,
@@ -18,13 +16,6 @@ pub enum K {
1816 QueueEmpty,
1917 QueueNoBranch,
2018 QueueColPosition,
21- QueueColPull,
22- QueueColBranch,
23- QueueColState,
24- QueueColBy,
25- QueueColQueued,
26- QueueColRun,
27- QueueColReason,
2819 QueueNoRun,
2920 StateQueued,
3021 StateTesting,
@@ -49,10 +40,8 @@ pub enum K {
4940 #[cfg(test)]
5041 pub const ALL: &[K] = &[
5142 K::RequireMergeQueue,
52- K::RequireMergeQueueHint,
5343 K::RuleMergeQueue,
5444 K::AddToMergeQueue,
55- K::MergeQueueHint,
5645 K::RemoveFromQueue,
5746 K::MergeQueueTitle,
5847 K::MergeQueueNav,
@@ -61,13 +50,6 @@ pub const ALL: &[K] = &[
6150 K::QueueEmpty,
6251 K::QueueNoBranch,
6352 K::QueueColPosition,
64- K::QueueColPull,
65- K::QueueColBranch,
66- K::QueueColState,
67- K::QueueColBy,
68- K::QueueColQueued,
69- K::QueueColRun,
70- K::QueueColReason,
7153 K::QueueNoRun,
7254 K::StateQueued,
7355 K::StateTesting,
@@ -94,22 +76,10 @@ pub fn t(lang: Lang, key: K) -> &'static str {
9476 match (key, lang) {
9577 (RequireMergeQueue, En) => "Merge queue",
9678 (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- }
10379 (RuleMergeQueue, En) => "merge queue required",
10480 (RuleMergeQueue, Tr) => "birleştirme sırası zorunlu",
10581 (AddToMergeQueue, En) => "Add to merge queue",
10682 (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- }
11383 (RemoveFromQueue, En) => "Remove from queue",
11484 (RemoveFromQueue, Tr) => "Sıradan çıkar",
11585 (MergeQueueTitle, En) => "Merge queue",
@@ -120,30 +90,12 @@ pub fn t(lang: Lang, key: K) -> &'static str {
12090 (QueueWaiting, Tr) => "Bekleyen",
12191 (QueueHistory, En) => "History",
12292 (QueueHistory, Tr) => "Geçmiş",
123- (QueueEmpty, En) => "Nothing is waiting in the merge queue.",
124- (QueueEmpty, Tr) => "Birleştirme sırasında bekleyen yok.",
125- (QueueNoBranch, En) => {
126- "No protected branch requires the merge queue. Turn it on in the branch protection settings."
127- }
128- (QueueNoBranch, Tr) => {
129- "Birleştirme sırası isteyen korumalı bir dal yok. Dal koruma ayarlarından açabilirsiniz."
130- }
93+ (QueueEmpty, En) => "Nothing waiting.",
94+ (QueueEmpty, Tr) => "Bekleyen yok.",
95+ (QueueNoBranch, En) => "No branch requires the merge queue.",
96+ (QueueNoBranch, Tr) => "Birleştirme sırası isteyen dal yok.",
13197 (QueueColPosition, En) => "Position",
13298 (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",
14799 (QueueNoRun, En) => "No run",
148100 (QueueNoRun, Tr) => "Çalıştırma yok",
149101 (StateQueued, En) => "Queued",
crates/forge-web-base/src/i18n/migrate.rsmodified+0 -80
@@ -10,7 +10,6 @@ pub enum K {
1010 TabImport,
1111 // Import form.
1212 ImportTitle,
13- ImportIntro,
1413 SrcGit,
1514 SrcGitHub,
1615 SrcGitLab,
@@ -23,24 +22,19 @@ pub enum K {
2322 GitLabProject,
2423 ForgejoInstance,
2524 TokenOptional,
26- TokenHelp,
2725 TargetOwner,
2826 TargetName,
29- TargetNameHelp,
3027 Description,
3128 WhatToImport,
3229 OptLabels,
3330 OptIssues,
3431 OptPulls,
3532 OptReleases,
36- OptionsNote,
3733 StartImport,
3834 BulkLink,
3935 BulkLinkButton,
40- BulkOwnerHelp,
4136 // Bulk import.
4237 BulkTitle,
43- BulkIntro,
4438 BulkOwnerGitHub,
4539 BulkOwnerGitLab,
4640 BulkOwnerForgejo,
@@ -55,14 +49,11 @@ pub enum K {
5549 // Jobs.
5650 JobsTitle,
5751 NoJobs,
58- RecentImports,
59- ViewAll,
6052 JobQueued,
6153 JobRunning,
6254 JobDone,
6355 JobFailed,
6456 JobRetry,
65- JobRetryHelp,
6657 JobOpenRepo,
6758 JobProgress,
6859 JobNoLog,
@@ -70,7 +61,6 @@ pub enum K {
7061 RetryFailedTitle,
7162 RetrySelected,
7263 RetryNone,
73- RetryTokenHelp,
7464 StageGit,
7565 StageLabels,
7666 StageMilestones,
@@ -86,8 +76,6 @@ pub enum K {
8676 // Data export.
8777 SettingsExport,
8878 ExportTitle,
89- ExportIntro,
90- ExportContents,
9179 ExportRequest,
9280 ExportBuilding,
9381 ExportReady,
@@ -96,7 +84,6 @@ pub enum K {
9684 ExportNone,
9785 ExportRequested,
9886 ExportSize,
99- ExportEmailNote,
10087 }
10188
10289 #[cfg(test)]
@@ -104,7 +91,6 @@ const ALL: &[K] = &[
10491 K::TabCreate,
10592 K::TabImport,
10693 K::ImportTitle,
107- K::ImportIntro,
10894 K::SrcGit,
10995 K::SrcGitHub,
11096 K::SrcGitLab,
@@ -117,23 +103,18 @@ const ALL: &[K] = &[
117103 K::GitLabProject,
118104 K::ForgejoInstance,
119105 K::TokenOptional,
120- K::TokenHelp,
121106 K::TargetOwner,
122107 K::TargetName,
123- K::TargetNameHelp,
124108 K::Description,
125109 K::WhatToImport,
126110 K::OptLabels,
127111 K::OptIssues,
128112 K::OptPulls,
129113 K::OptReleases,
130- K::OptionsNote,
131114 K::StartImport,
132115 K::BulkLink,
133116 K::BulkLinkButton,
134- K::BulkOwnerHelp,
135117 K::BulkTitle,
136- K::BulkIntro,
137118 K::BulkOwnerGitHub,
138119 K::BulkOwnerGitLab,
139120 K::BulkOwnerForgejo,
@@ -147,14 +128,11 @@ const ALL: &[K] = &[
147128 K::BulkArchived,
148129 K::JobsTitle,
149130 K::NoJobs,
150- K::RecentImports,
151- K::ViewAll,
152131 K::JobQueued,
153132 K::JobRunning,
154133 K::JobDone,
155134 K::JobFailed,
156135 K::JobRetry,
157- K::JobRetryHelp,
158136 K::JobOpenRepo,
159137 K::JobProgress,
160138 K::JobNoLog,
@@ -162,7 +140,6 @@ const ALL: &[K] = &[
162140 K::RetryFailedTitle,
163141 K::RetrySelected,
164142 K::RetryNone,
165- K::RetryTokenHelp,
166143 K::StageGit,
167144 K::StageLabels,
168145 K::StageMilestones,
@@ -176,8 +153,6 @@ const ALL: &[K] = &[
176153 K::ErrTooMany,
177154 K::SettingsExport,
178155 K::ExportTitle,
179- K::ExportIntro,
180- K::ExportContents,
181156 K::ExportRequest,
182157 K::ExportBuilding,
183158 K::ExportReady,
@@ -186,7 +161,6 @@ const ALL: &[K] = &[
186161 K::ExportNone,
187162 K::ExportRequested,
188163 K::ExportSize,
189- K::ExportEmailNote,
190164 ];
191165
192166 /// `(English, Turkish)` for each phrase.
@@ -195,10 +169,6 @@ fn pair(key: K) -> (&'static str, &'static str) {
195169 K::TabCreate => ("Create", "Oluştur"),
196170 K::TabImport => ("Import", "İçe aktar"),
197171 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- ),
202172 K::SrcGit => ("Git URL", "Git URL'si"),
203173 K::SrcGitHub => ("GitHub", "GitHub"),
204174 K::SrcGitLab => ("GitLab", "GitLab"),
@@ -217,38 +187,18 @@ fn pair(key: K) -> (&'static str, &'static str) {
217187 "Forgejo veya Gitea adresi (Codeberg da olur)",
218188 ),
219189 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- ),
224190 K::TargetOwner => ("Owner", "Sahip"),
225191 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- ),
230192 K::Description => ("Description (optional)", "Açıklama (isteğe bağlı)"),
231193 K::WhatToImport => ("Also import", "Şunları da içe aktar"),
232194 K::OptLabels => ("Labels and milestones", "Etiketler ve kilometre taşları"),
233195 K::OptIssues => ("Issues and comments", "Konular ve yorumlar"),
234196 K::OptPulls => ("Pull requests (as issues)", "Çekme istekleri (konu olarak)"),
235197 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- ),
240198 K::StartImport => ("Start import", "İçe aktarmayı başlat"),
241199 K::BulkLink => ("Import several repositories", "Birden çok depoyu içe aktar"),
242200 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- ),
247201 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- ),
252202 K::BulkOwnerGitHub => (
253203 "GitHub user or organization",
254204 "GitHub kullanıcısı veya kuruluşu",
@@ -271,17 +221,11 @@ fn pair(key: K) -> (&'static str, &'static str) {
271221 K::BulkArchived => ("archived", "arşivlenmiş"),
272222 K::JobsTitle => ("Import history", "İçe aktarma geçmişi"),
273223 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"),
276224 K::JobQueued => ("Queued", "Sırada"),
277225 K::JobRunning => ("Running", "Çalışıyor"),
278226 K::JobDone => ("Done", "Bitti"),
279227 K::JobFailed => ("Failed", "Başarısız"),
280228 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- ),
285229 K::JobOpenRepo => ("Open repository", "Depoyu aç"),
286230 K::JobProgress => ("Progress", "İlerleme"),
287231 K::JobNoLog => ("Nothing yet.", "Henüz bir şey yok."),
@@ -292,10 +236,6 @@ fn pair(key: K) -> (&'static str, &'static str) {
292236 ),
293237 K::RetrySelected => ("Retry selected", "Seçilenleri yeniden dene"),
294238 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- ),
299239 K::StageGit => ("Git data", "Git verisi"),
300240 K::StageLabels => ("Labels", "Etiketler"),
301241 K::StageMilestones => ("Milestones", "Kilometre taşları"),
@@ -321,14 +261,6 @@ fn pair(key: K) -> (&'static str, &'static str) {
321261 ),
322262 K::SettingsExport => ("Data export", "Veri dışa aktarımı"),
323263 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- ),
332264 K::ExportRequest => ("Request an export", "Dışa aktarım iste"),
333265 K::ExportBuilding => ("Building", "Hazırlanıyor"),
334266 K::ExportReady => ("Ready", "Hazır"),
@@ -337,10 +269,6 @@ fn pair(key: K) -> (&'static str, &'static str) {
337269 K::ExportNone => ("No exports yet.", "Henüz dışa aktarım yok."),
338270 K::ExportRequested => ("Requested", "İstendi"),
339271 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- ),
344272 }
345273 }
346274
@@ -360,14 +288,6 @@ pub fn expires_label(lang: Lang) -> &'static str {
360288 }
361289 }
362290
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-
371291 /// The import list's note after a bulk import left some repositories out. `list` says which and why.
372292 pub fn bulk_skipped(lang: Lang, list: &str) -> String {
373293 match lang {
crates/forge-web-base/src/i18n/misc.rsmodified+1 -246
@@ -16,7 +16,6 @@ pub enum K {
1616 Appearance,
1717 ThemeLabel,
1818 LanguageLabel,
19- MatchSystemHelp,
2019 MatchSystem,
2120 Light,
2221 Dark,
@@ -34,24 +33,14 @@ pub enum K {
3433 HueLabel,
3534 VividnessLabel,
3635 HexLabel,
37- LightnessNote,
3836 BackgroundLabel,
3937 ChooseBase,
4038 // Appearance: which side the shell sidebar sits on.
41- SidebarLabel,
42- SidebarLeft,
43- SidebarRight,
4439 ChooseSidebar,
4540 // Appearance: the run-finished tone.
4641 SoundLabel,
47- SoundSwitch,
48- SoundOwnRuns,
4942 SoundPassed,
50- SoundPassedNote,
5143 SoundFailed,
52- SoundFailedNote,
53- SoundPlay,
54- SoundFootOwn,
5544 ChooseSound,
5645 // Notifications: row kinds.
5746 KindOpenIssue,
@@ -86,20 +75,9 @@ pub enum K {
8675 VerbPushedTo,
8776 VerbUpdated,
8877 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,
9978 // Notifications: inbox page.
10079 MarkAllAsRead,
10180 MarkAllRead,
102- ClearNotifications,
10381 MarkRead,
10482 NoNotificationsYet,
10583 NoUnreadNotifications,
@@ -113,20 +91,9 @@ pub enum K {
11391 OptParticipating,
11492 OptWatching,
11593 OptIgnoring,
116- WatchDescParticipating,
117- WatchDescWatching,
118- WatchDescIgnoring,
11994 // Repo security page.
12095 SecurityOff,
121- LockfilesRead,
12296 NoAlerts,
123- ColAdvisory,
124- ColPackage,
125- ColVersion,
126- ColSeverity,
127- ColSummary,
128- ColState,
129- ColOpened,
13097 StateOpen,
13198 StateDismissed,
13299 StateFixed,
@@ -137,12 +104,9 @@ pub enum K {
137104 RepoName,
138105 DescriptionOptional,
139106 VisibilityLegend,
140- PrivateHelp,
141- PublicHelp,
142107 DefaultBranch,
143108 AddDefaultLabels,
144109 MirrorLegend,
145- MirrorIntro,
146110 SourceUrl,
147111 UsernameOptional,
148112 PasswordOrToken,
@@ -151,10 +115,8 @@ pub enum K {
151115 OwnerRefused,
152116 InvalidRepoName,
153117 ReadmeLabel,
154- ReadmeHelp,
155118 LicenseLabel,
156119 LicenseNone,
157- LicenseHelp,
158120 UnknownLicense,
159121 MirrorWithFiles,
160122 // Dashboard contribution calendar (`views::heatmap`).
@@ -172,23 +134,18 @@ pub enum K {
172134 ViewAllNotifications,
173135 // Shell chrome (`views::mod`): breadcrumb landmark, theme picker, ref selector.
174136 BreadcrumbNav,
175- ApplyTheme,
176137 RefLabel,
177138 // Top-bar user menu: the viewer's public profile and the settings editor.
178139 YourProfile,
179140 EditProfile,
180141 EditOrganization,
181142 // Profile corner, live strip and path bar search.
182- AllNotifications,
183143 Passed,
184144 Failed,
185145 Cancelled,
186146 YourCiRuns,
187147 SearchPublicReposFor,
188148 // The bell's popover: the newest notifications, opened from the profile corner.
189- OpenNotifications,
190- PeekLoading,
191- PeekError,
192149 AllCaughtUp,
193150 }
194151
@@ -198,7 +155,6 @@ const ALL: &[K] = &[
198155 K::Appearance,
199156 K::ThemeLabel,
200157 K::LanguageLabel,
201- K::MatchSystemHelp,
202158 K::MatchSystem,
203159 K::Light,
204160 K::Dark,
@@ -215,22 +171,12 @@ const ALL: &[K] = &[
215171 K::HueLabel,
216172 K::VividnessLabel,
217173 K::HexLabel,
218- K::LightnessNote,
219174 K::BackgroundLabel,
220175 K::ChooseBase,
221- K::SidebarLabel,
222- K::SidebarLeft,
223- K::SidebarRight,
224176 K::ChooseSidebar,
225177 K::SoundLabel,
226- K::SoundSwitch,
227- K::SoundOwnRuns,
228178 K::SoundPassed,
229- K::SoundPassedNote,
230179 K::SoundFailed,
231- K::SoundFailedNote,
232- K::SoundPlay,
233- K::SoundFootOwn,
234180 K::ChooseSound,
235181 K::KindOpenIssue,
236182 K::KindClosedIssue,
@@ -262,18 +208,8 @@ const ALL: &[K] = &[
262208 K::VerbPushedTo,
263209 K::VerbUpdated,
264210 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,
274211 K::MarkAllAsRead,
275212 K::MarkAllRead,
276- K::ClearNotifications,
277213 K::MarkRead,
278214 K::NoNotificationsYet,
279215 K::NoUnreadNotifications,
@@ -286,19 +222,8 @@ const ALL: &[K] = &[
286222 K::OptParticipating,
287223 K::OptWatching,
288224 K::OptIgnoring,
289- K::WatchDescParticipating,
290- K::WatchDescWatching,
291- K::WatchDescIgnoring,
292225 K::SecurityOff,
293- K::LockfilesRead,
294226 K::NoAlerts,
295- K::ColAdvisory,
296- K::ColPackage,
297- K::ColVersion,
298- K::ColSeverity,
299- K::ColSummary,
300- K::ColState,
301- K::ColOpened,
302227 K::StateOpen,
303228 K::StateDismissed,
304229 K::StateFixed,
@@ -308,12 +233,9 @@ const ALL: &[K] = &[
308233 K::RepoName,
309234 K::DescriptionOptional,
310235 K::VisibilityLegend,
311- K::PrivateHelp,
312- K::PublicHelp,
313236 K::DefaultBranch,
314237 K::AddDefaultLabels,
315238 K::MirrorLegend,
316- K::MirrorIntro,
317239 K::SourceUrl,
318240 K::UsernameOptional,
319241 K::PasswordOrToken,
@@ -322,10 +244,8 @@ const ALL: &[K] = &[
322244 K::OwnerRefused,
323245 K::InvalidRepoName,
324246 K::ReadmeLabel,
325- K::ReadmeHelp,
326247 K::LicenseLabel,
327248 K::LicenseNone,
328- K::LicenseHelp,
329249 K::UnknownLicense,
330250 K::MirrorWithFiles,
331251 K::ContributionsTitle,
@@ -341,20 +261,15 @@ const ALL: &[K] = &[
341261 K::NoContributionsDay,
342262 K::ViewAllNotifications,
343263 K::BreadcrumbNav,
344- K::ApplyTheme,
345264 K::RefLabel,
346265 K::YourProfile,
347266 K::EditProfile,
348267 K::EditOrganization,
349- K::AllNotifications,
350268 K::Passed,
351269 K::Failed,
352270 K::Cancelled,
353271 K::YourCiRuns,
354272 K::SearchPublicReposFor,
355- K::OpenNotifications,
356- K::PeekLoading,
357- K::PeekError,
358273 K::AllCaughtUp,
359274 ];
360275
@@ -368,12 +283,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
368283 (ThemeLabel, Tr) => "Tema",
369284 (LanguageLabel, En) => "Language",
370285 (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- }
377286 (MatchSystem, En) => "Match the system",
378287 (MatchSystem, Tr) => "Sistem ile eşleştir",
379288 (Light, En) => "Light",
@@ -406,38 +315,18 @@ pub fn t(lang: Lang, key: K) -> &'static str {
406315 (VividnessLabel, Tr) => "Canlılık",
407316 (HexLabel, En) => "Hex",
408317 (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ı.",
411318 (BackgroundLabel, En) => "Background",
412319 (BackgroundLabel, Tr) => "Arka plan",
413320 (ChooseBase, En) => "Choose a background from the list.",
414321 (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ğ",
421322 (ChooseSidebar, En) => "Choose a sidebar position from the list.",
422323 (ChooseSidebar, Tr) => "Listeden bir kenar çubuğu konumu seçin.",
423324 (SoundLabel, En) => "Sound",
424325 (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",
429326 (SoundPassed, En) => "Run passed",
430327 (SoundPassed, Tr) => "Çalıştırma başarılı",
431- (SoundPassedNote, En) => "a bright rising chime",
432- (SoundPassedNote, Tr) => "parlak, yükselen bir çan",
433328 (SoundFailed, En) => "Run failed",
434329 (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.",
441330 (ChooseSound, En) => "Choose on or off.",
442331 (ChooseSound, Tr) => "Açık ya da kapalı seçin.",
443332 (KindOpenIssue, En) => "Open issue",
@@ -500,39 +389,15 @@ pub fn t(lang: Lang, key: K) -> &'static str {
500389 (VerbUpdated, Tr) => "güncellendi",
501390 (VerbDiscussionReply, En) => "commented on your discussion",
502391 (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.",
525392 (MarkAllAsRead, En) => "Mark all as read",
526393 (MarkAllAsRead, Tr) => "Tümünü okundu olarak işaretle",
527394 (MarkAllRead, En) => "Mark all read",
528395 (MarkAllRead, Tr) => "Tümünü okundu işaretle",
529- (ClearNotifications, En) => "Mark as read",
530- (ClearNotifications, Tr) => "Okundu işaretle",
531396 (MarkRead, En) => "Mark read",
532397 (MarkRead, Tr) => "Okundu işaretle",
533398 (NoNotificationsYet, En) => "No notifications yet.",
534399 (NoNotificationsYet, Tr) => "Henüz bildirim yok.",
535- (NoUnreadNotifications, En) => "You have no unread notifications.",
400+ (NoUnreadNotifications, En) => "No unread notifications.",
536401 (NoUnreadNotifications, Tr) => "Okunmamış bildiriminiz yok.",
537402 (NotificationFilter, En) => "Notification filter",
538403 (NotificationFilter, Tr) => "Bildirim filtresi",
@@ -552,42 +417,14 @@ pub fn t(lang: Lang, key: K) -> &'static str {
552417 (OptWatching, Tr) => "İzleniyor",
553418 (OptIgnoring, En) => "Ignoring",
554419 (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ç.",
563420 (SecurityOff, En) => {
564421 "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."
565422 }
566423 (SecurityOff, Tr) => {
567424 "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."
568425 }
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- }
575426 (NoAlerts, En) => "No alerts.",
576427 (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ış",
591428 (StateOpen, En) => "Open",
592429 (StateOpen, Tr) => "Açık",
593430 (StateDismissed, En) => "Dismissed",
@@ -606,10 +443,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
606443 (DescriptionOptional, Tr) => "Açıklama (isteğe bağlı)",
607444 (VisibilityLegend, En) => "Visibility",
608445 (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",
613446 (DefaultBranch, En) => "Default branch",
614447 (DefaultBranch, Tr) => "Varsayılan dal",
615448 (AddDefaultLabels, En) => {
@@ -620,12 +453,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
620453 }
621454 (MirrorLegend, En) => "Mirror an existing repository (optional)",
622455 (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- }
629456 (SourceUrl, En) => "Source URL",
630457 (SourceUrl, Tr) => "Kaynak URL",
631458 (UsernameOptional, En) => "Username (optional)",
@@ -642,16 +469,10 @@ pub fn t(lang: Lang, key: K) -> &'static str {
642469 (InvalidRepoName, Tr) => "geçersiz depo adı",
643470 (ReadmeLabel, En) => "Add a README",
644471 (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.",
649472 (LicenseLabel, En) => "License",
650473 (LicenseLabel, Tr) => "Lisans",
651474 (LicenseNone, En) => "None",
652475 (LicenseNone, Tr) => "Yok",
653- (LicenseHelp, En) => "Adds a LICENSE file with the full text.",
654- (LicenseHelp, Tr) => "Tam metniyle bir LICENSE dosyası ekler.",
655476 (UnknownLicense, En) => "unknown license",
656477 (UnknownLicense, Tr) => "Bilinmeyen lisans.",
657478 (MirrorWithFiles, En) => {
@@ -686,8 +507,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
686507 (ViewAllNotifications, Tr) => "Tüm bildirimleri gör",
687508 (BreadcrumbNav, En) => "Path",
688509 (BreadcrumbNav, Tr) => "Yol",
689- (ApplyTheme, En) => "Apply",
690- (ApplyTheme, Tr) => "Uygula",
691510 (RefLabel, En) => "Ref",
692511 (RefLabel, Tr) => "Referans",
693512 (YourProfile, En) => "Your profile",
@@ -696,8 +515,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
696515 (EditProfile, Tr) => "Profili düzenle",
697516 (EditOrganization, En) => "Edit organization",
698517 (EditOrganization, Tr) => "Kuruluşu düzenle",
699- (AllNotifications, En) => "All notifications",
700- (AllNotifications, Tr) => "Tüm bildirimler",
701518 (Passed, En) => "passed",
702519 (Passed, Tr) => "geçti",
703520 (Failed, En) => "failed",
@@ -706,12 +523,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
706523 (Cancelled, Tr) => "iptal edildi",
707524 (YourCiRuns, En) => "Your CI runs",
708525 (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.",
715526 (AllCaughtUp, En) => "You're all caught up",
716527 (AllCaughtUp, Tr) => "Hepsini gördünüz",
717528 (SearchPublicReposFor, En) => "Search public repositories for",
@@ -744,30 +555,6 @@ pub fn streak_days(lang: Lang, n: u64) -> String {
744555 }
745556 }
746557
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-
771558 /// `28 running` / `3 çalışıyor`: the live strip's counts. Each takes its number as `{n}` in the
772559 /// strip's templates, so these phrases have no plural.
773560 pub fn running_count(lang: Lang, n: u64) -> String {
@@ -837,25 +624,6 @@ pub fn date_range(lang: Lang, from: &str, to: &str) -> String {
837624 }
838625 }
839626
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-
859627 /// The calendar's accessible summary, for the grid's `aria-label`.
860628 pub fn heatmap_summary(lang: Lang, total: u64, current: u64, longest: u64) -> String {
861629 let total = thousands(lang, total);
@@ -968,15 +736,6 @@ pub fn activity_line(lang: Lang, verb: K, actor: Option<&str>) -> String {
968736 }
969737 }
970738
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-
980739 /// "3 watching" / "3 izleyici", the watch control's count.
981740 pub fn watchers_count(lang: Lang, watchers: u64) -> String {
982741 match lang {
@@ -1081,9 +840,5 @@ mod tests {
1081840 assert_eq!(new_alerts(Lang::En, 1), "1 new alert");
1082841 assert_eq!(new_alerts(Lang::En, 2), "2 new alerts");
1083842 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- );
1088843 }
1089844 }
crates/forge-web-base/src/i18n/mod.rsmodified+4 -242
@@ -137,10 +137,8 @@ pub enum Key {
137137 AccessTokens,
138138 Sessions,
139139 Security,
140- BackToSite,
141140 LogOut,
142141 LogIn,
143- SiteMenu,
144142
145143 // Shared form words.
146144 Username,
@@ -161,7 +159,6 @@ pub enum Key {
161159
162160 // Log in and two-factor.
163161 TwoFactorCheck,
164- TwoFactorCheckSub,
165162 ErrInvalidLogin,
166163 ErrThrottled,
167164 ErrInvalidCode,
@@ -169,7 +166,6 @@ pub enum Key {
169166 // First-run setup.
170167 Setup,
171168 WelcomeToForge,
172- SetupSub,
173169 AtLeast12Chars,
174170 ConfirmPassword,
175171 CreateAdmin,
@@ -184,20 +180,16 @@ pub enum Key {
184180 OkAvatarUpdated,
185181 OkAvatarRemoved,
186182 OkProfileSaved,
187- UsernameHint,
188183 Avatar,
189184 AvatarAlt,
190185 Image,
191- AvatarHint,
192186 Edit,
193187 UploadPhoto,
194188 RemovePhoto,
195189 About,
196- AboutHint,
197190 Timezone,
198191 ErrChooseImage,
199192 DisplayName,
200- DisplayNameHint,
201193 ErrDisplayNameControl,
202194
203195 // Account security.
@@ -207,29 +199,21 @@ pub enum Key {
207199 OkTwoFactorOff,
208200 OkRecoveryCodesNew,
209201 SecurityLog,
210- SecurityLogRest,
211202 RecoveryCodes,
212203 RecoveryCodesSave,
213204 CurrentPassword,
214205 NewPassword,
215- NewPasswordHint,
216206 ConfirmNewPassword,
217207 ChangePassword,
218208 SaveEmail,
219209 TwoFactorAuth,
220210 RegenerateCodes,
221- RegenerateCodesHint,
222- TurnOffTwoFactor,
223211 TurnOffTwoFactorButton,
224- TwoFactorPendingIntro,
225212 SecretPrefix,
226213 LinkPrefix,
227214 CodeFromApp,
228215 ConfirmAndTurnOn,
229- TwoFactorOffIntro,
230- Enable2fa,
231216 DeleteAccount,
232- DeleteAccountIntro,
233217 TypeUsernameToConfirm,
234218 TransferOrDeleteRepos,
235219 ErrConfirmUsername,
@@ -237,40 +221,27 @@ pub enum Key {
237221 // SSH and GPG keys.
238222 NoSshKeys,
239223 NoGpgKeys,
240- AddSshKeyTitle,
241- AddGpgKeyTitle,
242224 TitleOptional,
243225 PublicKeyLabel,
244- PublicKeyHint,
245226 AddKeyButton,
246227 ArmoredPublicKeyLabel,
247- ArmoredHint,
248228 GpgUnavailable,
249229
250230 // Access tokens.
251231 YourNewToken,
252232 CopyNow,
253- UseAsPassword,
254233 NoAccessTokens,
255234 NewToken,
256235 ExpiresIn30,
257236 ExpiresIn90,
258237 ExpiresIn365,
259238 ExpiresNever,
260- ScopeNote,
261239 CreateToken,
262240
263241 // Web sessions.
264242 UnknownBrowser,
265243 ThisSession,
266244 RevokeAllOthers,
267- UserAgent,
268- SignInIp,
269- LastIp,
270- LastSeenAt,
271- ExpiresAt,
272- BackToSessions,
273- NotRecorded,
274245 Close,
275246
276247 // Metadata lines (see the helpers below for the words in between).
@@ -292,31 +263,23 @@ pub enum Key {
292263 ErrKeyMismatch,
293264 // Account mail pages: reset, register, verify, invites.
294265 ForgotTitle,
295- ForgotSub,
296266 ForgotSubmit,
297267 ForgotSent,
298268 ResetTitle,
299- ResetSub,
300269 ResetSubmit,
301270 ResetInvalid,
302271 ResetDone,
303272 RegisterTitle,
304- RegisterSub,
305- RegisterInviteSub,
306273 RegisterNeedsInvite,
307274 RegisterInvalidInvite,
308275 RegisterSubmit,
309276 VerifyTitle,
310- VerifyConfirmSub,
311277 VerifyConfirm,
312278 VerifyDone,
313279 VerifyInvalid,
314- VerifyVerified,
315- VerifyUnverified,
316280 VerifyResend,
317281 OkVerifySent,
318282 InvitesTitle,
319- InvitesSub,
320283 InvitesSubmit,
321284 InvitesSent,
322285 InvitesOff,
@@ -338,9 +301,7 @@ pub enum Key {
338301 MailReasonComment,
339302 MailReasonSubscribed,
340303 MailReasonWatching,
341- MenuNotificationEmails,
342304 EmailNotifyLabel,
343- EmailNotifyHelp,
344305 EmailNotifyUnverified,
345306 EmailNotifyServerOff,
346307 EmailNotifySaved,
@@ -348,16 +309,13 @@ pub enum Key {
348309 PillOn,
349310 PillOff,
350311 PillVerified,
351- PillUnverified,
352312 EmailNotVerified,
353313 EmailNoAddress,
354314 EmailMailQueued,
355315 EmailMailFailed,
356- ChangeAction,
357316 SetUpAction,
358317 SetupInProgress,
359318 DeviceName,
360- DeviceNameHint,
361319 ErrDeviceName,
362320 CodesRunningLow,
363321 DangerZone,
@@ -375,10 +333,8 @@ pub const ALL: &[Key] = &[
375333 Key::AccessTokens,
376334 Key::Sessions,
377335 Key::Security,
378- Key::BackToSite,
379336 Key::LogOut,
380337 Key::LogIn,
381- Key::SiteMenu,
382338 Key::Username,
383339 Key::Password,
384340 Key::Email,
@@ -395,13 +351,11 @@ pub const ALL: &[Key] = &[
395351 Key::Remove,
396352 Key::Create,
397353 Key::TwoFactorCheck,
398- Key::TwoFactorCheckSub,
399354 Key::ErrInvalidLogin,
400355 Key::ErrThrottled,
401356 Key::ErrInvalidCode,
402357 Key::Setup,
403358 Key::WelcomeToForge,
404- Key::SetupSub,
405359 Key::AtLeast12Chars,
406360 Key::ConfirmPassword,
407361 Key::CreateAdmin,
@@ -412,20 +366,16 @@ pub const ALL: &[Key] = &[
412366 Key::OkAvatarUpdated,
413367 Key::OkAvatarRemoved,
414368 Key::OkProfileSaved,
415- Key::UsernameHint,
416369 Key::Avatar,
417370 Key::AvatarAlt,
418371 Key::Image,
419- Key::AvatarHint,
420372 Key::Edit,
421373 Key::UploadPhoto,
422374 Key::RemovePhoto,
423375 Key::About,
424- Key::AboutHint,
425376 Key::Timezone,
426377 Key::ErrChooseImage,
427378 Key::DisplayName,
428- Key::DisplayNameHint,
429379 Key::ErrDisplayNameControl,
430380 Key::OkPasswordChanged,
431381 Key::OkEmailSaved,
@@ -433,64 +383,43 @@ pub const ALL: &[Key] = &[
433383 Key::OkTwoFactorOff,
434384 Key::OkRecoveryCodesNew,
435385 Key::SecurityLog,
436- Key::SecurityLogRest,
437386 Key::RecoveryCodes,
438387 Key::RecoveryCodesSave,
439388 Key::CurrentPassword,
440389 Key::NewPassword,
441- Key::NewPasswordHint,
442390 Key::ConfirmNewPassword,
443391 Key::ChangePassword,
444392 Key::SaveEmail,
445393 Key::TwoFactorAuth,
446394 Key::RegenerateCodes,
447- Key::RegenerateCodesHint,
448- Key::TurnOffTwoFactor,
449395 Key::TurnOffTwoFactorButton,
450- Key::TwoFactorPendingIntro,
451396 Key::SecretPrefix,
452397 Key::LinkPrefix,
453398 Key::CodeFromApp,
454399 Key::ConfirmAndTurnOn,
455- Key::TwoFactorOffIntro,
456- Key::Enable2fa,
457400 Key::DeleteAccount,
458- Key::DeleteAccountIntro,
459401 Key::TypeUsernameToConfirm,
460402 Key::TransferOrDeleteRepos,
461403 Key::ErrConfirmUsername,
462404 Key::NoSshKeys,
463405 Key::NoGpgKeys,
464- Key::AddSshKeyTitle,
465- Key::AddGpgKeyTitle,
466406 Key::TitleOptional,
467407 Key::PublicKeyLabel,
468- Key::PublicKeyHint,
469408 Key::AddKeyButton,
470409 Key::ArmoredPublicKeyLabel,
471- Key::ArmoredHint,
472410 Key::GpgUnavailable,
473411 Key::YourNewToken,
474412 Key::CopyNow,
475- Key::UseAsPassword,
476413 Key::NoAccessTokens,
477414 Key::NewToken,
478415 Key::ExpiresIn30,
479416 Key::ExpiresIn90,
480417 Key::ExpiresIn365,
481418 Key::ExpiresNever,
482- Key::ScopeNote,
483419 Key::CreateToken,
484420 Key::UnknownBrowser,
485421 Key::ThisSession,
486422 Key::RevokeAllOthers,
487- Key::UserAgent,
488- Key::SignInIp,
489- Key::LastIp,
490- Key::LastSeenAt,
491- Key::ExpiresAt,
492- Key::BackToSessions,
493- Key::NotRecorded,
494423 Key::Close,
495424 Key::Added,
496425 Key::LastUsed,
@@ -507,31 +436,23 @@ pub const ALL: &[Key] = &[
507436 Key::ErrKeyTruncated,
508437 Key::ErrKeyMismatch,
509438 Key::ForgotTitle,
510- Key::ForgotSub,
511439 Key::ForgotSubmit,
512440 Key::ForgotSent,
513441 Key::ResetTitle,
514- Key::ResetSub,
515442 Key::ResetSubmit,
516443 Key::ResetInvalid,
517444 Key::ResetDone,
518445 Key::RegisterTitle,
519- Key::RegisterSub,
520- Key::RegisterInviteSub,
521446 Key::RegisterNeedsInvite,
522447 Key::RegisterInvalidInvite,
523448 Key::RegisterSubmit,
524449 Key::VerifyTitle,
525- Key::VerifyConfirmSub,
526450 Key::VerifyConfirm,
527451 Key::VerifyDone,
528452 Key::VerifyInvalid,
529- Key::VerifyVerified,
530- Key::VerifyUnverified,
531453 Key::VerifyResend,
532454 Key::OkVerifySent,
533455 Key::InvitesTitle,
534- Key::InvitesSub,
535456 Key::InvitesSubmit,
536457 Key::InvitesSent,
537458 Key::InvitesOff,
@@ -553,9 +474,7 @@ pub const ALL: &[Key] = &[
553474 Key::MailReasonComment,
554475 Key::MailReasonSubscribed,
555476 Key::MailReasonWatching,
556- Key::MenuNotificationEmails,
557477 Key::EmailNotifyLabel,
558- Key::EmailNotifyHelp,
559478 Key::EmailNotifyUnverified,
560479 Key::EmailNotifyServerOff,
561480 Key::EmailNotifySaved,
@@ -563,16 +482,13 @@ pub const ALL: &[Key] = &[
563482 Key::PillOn,
564483 Key::PillOff,
565484 Key::PillVerified,
566- Key::PillUnverified,
567485 Key::EmailNotVerified,
568486 Key::EmailNoAddress,
569487 Key::EmailMailQueued,
570488 Key::EmailMailFailed,
571- Key::ChangeAction,
572489 Key::SetUpAction,
573490 Key::SetupInProgress,
574491 Key::DeviceName,
575- Key::DeviceNameHint,
576492 Key::ErrDeviceName,
577493 Key::CodesRunningLow,
578494 Key::DangerZone,
@@ -601,12 +517,8 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
601517 (Sessions, Tr) => "Oturumlar",
602518 (Security, En) => "Security",
603519 (Security, Tr) => "Güvenlik",
604- (BackToSite, En) => "Back to forge",
605- (BackToSite, Tr) => "Forge'a dön",
606520 (LogOut, En) => "Log out",
607521 (LogOut, Tr) => "Çıkış yap",
608- (SiteMenu, En) => "Menu",
609- (SiteMenu, Tr) => "Menü",
610522 (LogIn, En) => "Log in",
611523 (LogIn, Tr) => "Giriş yap",
612524
@@ -643,12 +555,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
643555
644556 (TwoFactorCheck, En) => "Two-factor check",
645557 (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- }
652558 (ErrInvalidLogin, En) => "invalid username or password",
653559 (ErrInvalidLogin, Tr) => "Kullanıcı adı ya da parola yanlış.",
654560 (ErrThrottled, En) => "Too many attempts. Try again later.",
@@ -664,10 +570,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
664570 (Setup, Tr) => "Kurulum",
665571 (WelcomeToForge, En) => "Welcome to forge",
666572 (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.",
671573 (AtLeast12Chars, En) => "At least 12 characters.",
672574 (AtLeast12Chars, Tr) => "En az 12 karakter.",
673575 (ConfirmPassword, En) => "Confirm password",
@@ -698,24 +600,12 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
698600 (OkAvatarRemoved, Tr) => "Avatar kaldırıldı.",
699601 (OkProfileSaved, En) => "Profile saved.",
700602 (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- }
707603 (Avatar, En) => "Avatar",
708604 (Avatar, Tr) => "Avatar",
709605 (AvatarAlt, En) => "Your avatar",
710606 (AvatarAlt, Tr) => "Avatarınız",
711607 (Image, En) => "Image",
712608 (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- }
719609 (Edit, En) => "Edit",
720610 (Edit, Tr) => "Düzenle",
721611 (UploadPhoto, En) => "Upload a photo…",
@@ -724,16 +614,12 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
724614 (RemovePhoto, Tr) => "Fotoğrafı kaldır",
725615 (About, En) => "About",
726616 (About, Tr) => "Hakkında",
727- (AboutHint, En) => "At most 2000 characters. Markdown is supported.",
728- (AboutHint, Tr) => "En fazla 2000 karakter. Markdown desteklenir.",
729617 (Timezone, En) => "Timezone",
730618 (Timezone, Tr) => "Saat dilimi",
731619 (ErrChooseImage, En) => "Choose an image to upload.",
732620 (ErrChooseImage, Tr) => "Yüklemek için bir görsel seçin.",
733621 (DisplayName, En) => "Name",
734622 (DisplayName, Tr) => "Ad",
735- (DisplayNameHint, En) => "Optional. Shown on your profile.",
736- (DisplayNameHint, Tr) => "İsteğe bağlı. Profilinizde gösterilir.",
737623 (ErrDisplayNameControl, En) => {
738624 "The name must not contain line breaks or control characters."
739625 }
@@ -751,22 +637,14 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
751637 (OkRecoveryCodesNew, Tr) => "Yeni kurtarma kodları oluşturuldu. Eskileri artık çalışmaz.",
752638 (SecurityLog, En) => "Security log",
753639 (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.",
756640 (RecoveryCodes, En) => "Recovery codes",
757641 (RecoveryCodes, Tr) => "Kurtarma kodları",
758- (RecoveryCodesSave, En) => {
759- "Save these codes now. They are shown only once. Each code works one time, and a code can replace your authenticator app if you lose it."
760- }
761- (RecoveryCodesSave, Tr) => {
762- "Bu kodları şimdi kaydedin. Yalnızca bir kez gösterilir. Her kod bir kez çalışır; doğrulama uygulamanızı kaybederseniz kodlardan biri onun yerini tutabilir."
763- }
642+ (RecoveryCodesSave, En) => "Shown once.",
643+ (RecoveryCodesSave, Tr) => "Yalnızca bir kez gösterilir.",
764644 (CurrentPassword, En) => "Current password",
765645 (CurrentPassword, Tr) => "Mevcut parola",
766646 (NewPassword, En) => "New password",
767647 (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.",
770648 (ConfirmNewPassword, En) => "Confirm new password",
771649 (ConfirmNewPassword, Tr) => "Yeni parolayı doğrula",
772650 (ChangePassword, En) => "Change password",
@@ -777,22 +655,8 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
777655 (TwoFactorAuth, Tr) => "İki faktörlü kimlik doğrulama",
778656 (RegenerateCodes, En) => "Regenerate recovery codes",
779657 (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",
788658 (TurnOffTwoFactorButton, En) => "Turn off two-factor",
789659 (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- }
796660 (SecretPrefix, En) => "Secret: ",
797661 (SecretPrefix, Tr) => "Anahtar: ",
798662 (LinkPrefix, En) => "Link: ",
@@ -801,22 +665,8 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
801665 (CodeFromApp, Tr) => "Uygulamadaki kod",
802666 (ConfirmAndTurnOn, En) => "Confirm and turn on",
803667 (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ç",
812668 (DeleteAccount, En) => "Delete account",
813669 (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- }
820670 (TypeUsernameToConfirm, En) => "Type your username to confirm",
821671 (TypeUsernameToConfirm, Tr) => "Onaylamak için kullanıcı adınızı yazın",
822672 (TransferOrDeleteRepos, En) => {
@@ -830,39 +680,21 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
830680 (NoSshKeys, Tr) => "Henüz SSH anahtarı yok. SSH ile göndermek için bir tane ekleyin.",
831681 (NoGpgKeys, En) => "No GPG keys yet.",
832682 (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",
837683 (TitleOptional, En) => "Title (optional)",
838684 (TitleOptional, Tr) => "Başlık (isteğe bağlı)",
839685 (PublicKeyLabel, En) => "Public key",
840686 (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- }
845687 (AddKeyButton, En) => "Add key",
846688 (AddKeyButton, Tr) => "Anahtar ekle",
847689 (ArmoredPublicKeyLabel, En) => "Public key (ASCII armored)",
848690 (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- }
853691 (GpgUnavailable, En) => "GPG verification is unavailable on this server",
854692 (GpgUnavailable, Tr) => "GPG doğrulaması bu sunucuda kullanılamıyor",
855693
856694 (YourNewToken, En) => "Your new token",
857695 (YourNewToken, Tr) => "Yeni belirteciniz",
858- (CopyNow, En) => "Copy it now. It is shown only once and cannot be recovered later.",
859- (CopyNow, Tr) => "Şimdi kopyalayın. Yalnızca bir kez gösterilir ve sonradan geri alınamaz.",
860- (UseAsPassword, En) => {
861- "Use it as the password when a git client asks for one, with any username."
862- }
863- (UseAsPassword, Tr) => {
864- "Bir Git istemcisi parola istediğinde, herhangi bir kullanıcı adıyla birlikte bunu parola olarak kullanın."
865- }
696+ (CopyNow, En) => "Shown once.",
697+ (CopyNow, Tr) => "Yalnızca bir kez gösterilir.",
866698 (NoAccessTokens, En) => "No access tokens yet.",
867699 (NoAccessTokens, Tr) => "Henüz erişim belirteci yok.",
868700 (NewToken, En) => "New token",
@@ -875,8 +707,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
875707 (ExpiresIn365, Tr) => "365 gün sonra",
876708 (ExpiresNever, En) => "Never",
877709 (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).",
880710 (CreateToken, En) => "Create token",
881711 (CreateToken, Tr) => "Belirteç oluştur",
882712
@@ -884,20 +714,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
884714 (UnknownBrowser, Tr) => "Bilinmeyen tarayıcı",
885715 (ThisSession, En) => "This session",
886716 (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",
901717 (Close, En) => "Close",
902718 (Close, Tr) => "Kapat",
903719 (RevokeAllOthers, En) => "Revoke all other sessions",
@@ -938,12 +754,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
938754 (ErrKeyMismatch, Tr) => "Anahtar gövdesi anahtar türüyle eşleşmiyor.",
939755 (ForgotTitle, En) => "Forgot password",
940756 (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- }
947757 (ForgotSubmit, En) => "Send reset link",
948758 (ForgotSubmit, Tr) => "Sıfırlama bağlantısı gönder",
949759 (ForgotSent, En) => {
@@ -954,10 +764,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
954764 }
955765 (ResetTitle, En) => "Set a new password",
956766 (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- }
961767 (ResetSubmit, En) => "Save new password",
962768 (ResetSubmit, Tr) => "Yeni parolayı kaydet",
963769 (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 {
972778 }
973779 (RegisterTitle, En) => "Create an account",
974780 (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- }
987781 (RegisterNeedsInvite, En) => {
988782 "Registration is by invitation only. Ask an admin for an invite link."
989783 }
@@ -998,34 +792,18 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
998792 (RegisterSubmit, Tr) => "Hesap oluştur",
999793 (VerifyTitle, En) => "Confirm your email",
1000794 (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.",
1003795 (VerifyConfirm, En) => "Confirm address",
1004796 (VerifyConfirm, Tr) => "Adresi doğrula",
1005797 (VerifyDone, En) => "Your email address is verified.",
1006798 (VerifyDone, Tr) => "E-posta adresin doğrulandı.",
1007799 (VerifyInvalid, En) => "This verification link is invalid, used or expired.",
1008800 (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- }
1017801 (VerifyResend, En) => "Send the verification link again",
1018802 (VerifyResend, Tr) => "Doğrulama bağlantısını yeniden gönder",
1019803 (OkVerifySent, En) => "We sent a verification link to your address.",
1020804 (OkVerifySent, Tr) => "Adresinize bir doğrulama bağlantısı gönderildi.",
1021805 (InvitesTitle, En) => "Invite someone",
1022806 (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- }
1029807 (InvitesSubmit, En) => "Send invite",
1030808 (InvitesSubmit, Tr) => "Davet gönder",
1031809 (InvitesSent, En) => "The invite was sent.",
@@ -1055,11 +833,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
1055833 (MailReasonComment, En) => "you commented on it",
1056834 (MailReasonSubscribed, En) => "you are subscribed to it",
1057835 (MailReasonWatching, En) => "you watch this repository",
1058- (MenuNotificationEmails, En) => "Notifications",
1059836 (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- }
1063837 (EmailNotifyUnverified, En) => {
1064838 "Verify your email address first. Only verified addresses get notification emails."
1065839 }
@@ -1084,11 +858,7 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
1084858 (MailReasonComment, Tr) => "bunda yorum yaptınız",
1085859 (MailReasonSubscribed, Tr) => "bunu takip ediyorsunuz",
1086860 (MailReasonWatching, Tr) => "bu depoyu izliyorsunuz",
1087- (MenuNotificationEmails, Tr) => "Bildirimler",
1088861 (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- }
1092862 (EmailNotifyUnverified, Tr) => {
1093863 "Önce e-posta adresinizi doğrulayın. Bildirim e-postaları yalnızca doğrulanmış adreslere gönderilir."
1094864 }
@@ -1104,8 +874,6 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
1104874 (PillOff, Tr) => "Kapalı",
1105875 (PillVerified, En) => "Verified",
1106876 (PillVerified, Tr) => "Doğrulandı",
1107- (PillUnverified, En) => "Unverified",
1108- (PillUnverified, Tr) => "Doğrulanmadı",
1109877 (EmailNotVerified, En) => "Not verified",
1110878 (EmailNotVerified, Tr) => "Doğrulanmadı",
1111879 (EmailNoAddress, En) => "No email address",
@@ -1114,18 +882,12 @@ pub fn t(lang: Lang, key: Key) -> &'static str {
1114882 (EmailMailQueued, Tr) => "doğrulama iletisi kuyrukta",
1115883 (EmailMailFailed, En) => "verification mail failed",
1116884 (EmailMailFailed, Tr) => "doğrulama iletisi başarısız",
1117- (ChangeAction, En) => "Change",
1118- (ChangeAction, Tr) => "Değiştir",
1119885 (SetUpAction, En) => "Set up",
1120886 (SetUpAction, Tr) => "Kur",
1121887 (SetupInProgress, En) => "Setup in progress",
1122888 (SetupInProgress, Tr) => "Kurulum sürüyor",
1123889 (DeviceName, En) => "Device name (optional)",
1124890 (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- }
1129891 (ErrDeviceName, En) => {
1130892 "Use at most 40 characters for the device name, without line breaks."
1131893 }
crates/forge-web-base/src/i18n/needs.rsmodified+1 -1
@@ -73,7 +73,7 @@ pub fn t(lang: Lang, key: K) -> &'static str {
7373 (AllMentions, Tr) => "Tüm bahsetmeler",
7474 (BackToNeedsYou, En) => "Back to Needs you",
7575 (BackToNeedsYou, Tr) => "Sizi bekleyenlere dön",
76- (AllClear, En) => "Nothing is waiting on you.",
76+ (AllClear, En) => "Nothing waiting.",
7777 (AllClear, Tr) => "Sizi bekleyen bir şey yok.",
7878 }
7979 }
crates/forge-web-base/src/i18n/orgs.rsmodified+0 -74
@@ -44,39 +44,30 @@ pub enum K {
4444 NewRepository,
4545 // Organization creation.
4646 NewOrganization,
47- NewOrgIntro,
4847 OrgName,
4948 DescriptionOptional,
5049 CreateOrg,
5150 // Organization settings.
5251 Settings,
5352 General,
54- BackToOrganization,
5553 Description,
5654 DisplayNameLabel,
5755 DefaultRoleLabel,
58- DefaultRoleHelp,
5956 MembersCanCreate,
6057 SaveSettings,
6158 DeleteOrg,
62- DeleteOrgIntro,
6359 // Members.
6460 Members,
6561 Teams,
6662 Organization,
6763 ViewAllMembers,
68- MemberHeader,
6964 Role,
7065 RoleOwner,
7166 RoleMember,
7267 Leave,
73- AddMember,
7468 AddMemberButton,
75- OwnersHelp,
7669 // Teams.
77- TeamsIntro,
7870 NoTeamsYet,
79- NewTeam,
8071 CoversAllRepos,
8172 CreateTeam,
8273 SaveTeam,
@@ -101,7 +92,6 @@ pub enum K {
10192 Pages,
10293 Previous,
10394 Next,
104- PublicReposIntro,
10595 Organizations,
10696 SearchPublicRepos,
10797 Search,
@@ -119,10 +109,8 @@ pub enum K {
119109 Pinned,
120110 PopularRepos,
121111 CustomizePins,
122- PinsIntro,
123112 SavePins,
124113 PinsTooMany,
125- NoPinnableRepos,
126114 TabOverview,
127115 TabStars,
128116 FilterRepos,
@@ -130,7 +118,6 @@ pub enum K {
130118 ClearSearch,
131119 // Landing.
132120 Home,
133- LandingTagline,
134121 LogIn,
135122 SetUpForge,
136123 }
@@ -217,16 +204,8 @@ pub fn t(lang: Lang, key: K) -> &'static str {
217204 (NewOrganization, Tr) => "Yeni kuruluş",
218205 (General, En) => "General",
219206 (General, Tr) => "Genel",
220- (BackToOrganization, En) => "Back to organization",
221- (BackToOrganization, Tr) => "Kuruluşa dön",
222207 (ViewAllMembers, En) => "View all",
223208 (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- }
230209 (OrgName, En) => "Organization name",
231210 (OrgName, Tr) => "Kuruluş adı",
232211 (DescriptionOptional, En) => "Description (optional)",
@@ -241,32 +220,18 @@ pub fn t(lang: Lang, key: K) -> &'static str {
241220 (DisplayNameLabel, Tr) => "Görünen ad",
242221 (DefaultRoleLabel, En) => "Default role on the organization's repositories",
243222 (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- }
250223 (MembersCanCreate, En) => "Members can create repositories for this organization",
251224 (MembersCanCreate, Tr) => "Üyeler bu kuruluş için depo oluşturabilir",
252225 (SaveSettings, En) => "Save settings",
253226 (SaveSettings, Tr) => "Ayarları kaydet",
254227 (DeleteOrg, En) => "Delete organization",
255228 (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- }
262229 (Members, En) => "Members",
263230 (Members, Tr) => "Üyeler",
264231 (Teams, En) => "Teams",
265232 (Teams, Tr) => "Takımlar",
266233 (Organization, En) => "Organization",
267234 (Organization, Tr) => "Kuruluş",
268- (MemberHeader, En) => "Member",
269- (MemberHeader, Tr) => "Üye",
270235 (Role, En) => "Role",
271236 (Role, Tr) => "Rol",
272237 (RoleOwner, En) => "owner",
@@ -275,26 +240,10 @@ pub fn t(lang: Lang, key: K) -> &'static str {
275240 (RoleMember, Tr) => "üye",
276241 (Leave, En) => "Leave",
277242 (Leave, Tr) => "Ayrıl",
278- (AddMember, En) => "Add a member",
279- (AddMember, Tr) => "Bir üye ekle",
280243 (AddMemberButton, En) => "Add member",
281244 (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- }
294245 (NoTeamsYet, En) => "No teams yet.",
295246 (NoTeamsYet, Tr) => "Henüz takım yok.",
296- (NewTeam, En) => "New team",
297- (NewTeam, Tr) => "Yeni takım",
298247 (CoversAllRepos, En) => "Covers all of the organization's repositories",
299248 (CoversAllRepos, Tr) => "Kuruluşun tüm depolarını kapsar",
300249 (CreateTeam, En) => "Create team",
@@ -339,8 +288,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
339288 (Previous, Tr) => "Önceki",
340289 (Next, En) => "Next",
341290 (Next, Tr) => "Sonraki",
342- (PublicReposIntro, En) => "Public repositories on this forge.",
343- (PublicReposIntro, Tr) => "Bu forge üzerindeki herkese açık depolar.",
344291 (Organizations, En) => "Organizations",
345292 (Organizations, Tr) => "Kuruluşlar",
346293 (SearchPublicRepos, En) => "Search public repositories",
@@ -373,14 +320,10 @@ pub fn t(lang: Lang, key: K) -> &'static str {
373320 (PopularRepos, Tr) => "Popüler depolar",
374321 (CustomizePins, En) => "Customize pins",
375322 (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ç.",
378323 (SavePins, En) => "Save pins",
379324 (SavePins, Tr) => "Sabitlemeleri kaydet",
380325 (PinsTooMany, En) => "You can pin at most six repositories.",
381326 (PinsTooMany, Tr) => "En fazla altı depo sabitleyebilirsin.",
382- (NoPinnableRepos, En) => "No repositories to pin yet.",
383- (NoPinnableRepos, Tr) => "Henüz sabitlenecek depo yok.",
384327 (TabOverview, En) => "Overview",
385328 (TabOverview, Tr) => "Genel bakış",
386329 (TabStars, En) => "Stars",
@@ -393,10 +336,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
393336 (ClearSearch, Tr) => "Aramayı temizle",
394337 (Home, En) => "Home",
395338 (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- }
400339 (LogIn, En) => "Log in",
401340 (LogIn, Tr) => "Giriş yap",
402341 (SetUpForge, En) => "Set up forge",
@@ -553,7 +492,6 @@ mod tests {
553492 K::Explore,
554493 K::NewRepository,
555494 K::NewOrganization,
556- K::NewOrgIntro,
557495 K::OrgName,
558496 K::DescriptionOptional,
559497 K::CreateOrg,
@@ -561,25 +499,18 @@ mod tests {
561499 K::Description,
562500 K::DisplayNameLabel,
563501 K::DefaultRoleLabel,
564- K::DefaultRoleHelp,
565502 K::MembersCanCreate,
566503 K::SaveSettings,
567504 K::DeleteOrg,
568- K::DeleteOrgIntro,
569505 K::Members,
570506 K::Teams,
571507 K::Organization,
572- K::MemberHeader,
573508 K::Role,
574509 K::RoleOwner,
575510 K::RoleMember,
576511 K::Leave,
577- K::AddMember,
578512 K::AddMemberButton,
579- K::OwnersHelp,
580- K::TeamsIntro,
581513 K::NoTeamsYet,
582- K::NewTeam,
583514 K::CoversAllRepos,
584515 K::CreateTeam,
585516 K::SaveTeam,
@@ -602,7 +533,6 @@ mod tests {
602533 K::Pages,
603534 K::Previous,
604535 K::Next,
605- K::PublicReposIntro,
606536 K::Organizations,
607537 K::SearchPublicRepos,
608538 K::Search,
@@ -619,19 +549,15 @@ mod tests {
619549 K::Pinned,
620550 K::PopularRepos,
621551 K::CustomizePins,
622- K::PinsIntro,
623552 K::SavePins,
624553 K::PinsTooMany,
625- K::NoPinnableRepos,
626554 K::TabOverview,
627555 K::General,
628- K::BackToOrganization,
629556 K::TabStars,
630557 K::FilterRepos,
631558 K::NoReposMatch,
632559 K::ClearSearch,
633560 K::Home,
634- K::LandingTagline,
635561 K::LogIn,
636562 K::SetUpForge,
637563 ];
crates/forge-web-base/src/i18n/packages.rsmodified+0 -42
@@ -7,7 +7,6 @@ use super::Lang;
77 pub enum K {
88 TabPackages,
99 PackagesHeading,
10- PackagesHelp,
1110 NoPackages,
1211 PackageVersions,
1312 PackageVersionCount,
@@ -16,7 +15,6 @@ pub enum K {
1615 PackageRepoLink,
1716 VersionYanked,
1817 Install,
19- InstallHelp,
2018 InstallRegistryConfig,
2119 InstallAdd,
2220 InstallPublish,
@@ -25,21 +23,13 @@ pub enum K {
2523 Readme,
2624 NoReadme,
2725 ScopePackages,
28- ScopePackagesHelp,
2926 Cancel,
3027 ContainerKind,
31- ContainerInstallHelp,
3228 ContainerLogin,
3329 ContainerPull,
3430 ContainerPush,
3531 ContainerTags,
36- ContainerTag,
37- ContainerDigest,
38- ContainerSize,
39- ContainerCreated,
4032 DeleteTag,
41- DeleteTagMessage,
42- DeleteTagConfirm,
4333 NoTags,
4434 NoVersions,
4535 PackageTagCount,
@@ -54,12 +44,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
5444 (Cancel, Tr) => "Vazgeç",
5545 (ContainerKind, En) => "Container",
5646 (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- }
6347 (ContainerLogin, En) => "Log in",
6448 (ContainerLogin, Tr) => "Giriş yap",
6549 (ContainerPull, En) => "Pull the image",
@@ -68,20 +52,8 @@ pub fn t(lang: Lang, key: K) -> &'static str {
6852 (ContainerPush, Tr) => "Bir etiket gönder",
6953 (ContainerTags, En) => "Tags",
7054 (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",
7955 (DeleteTag, En) => "Delete",
8056 (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",
8557 (NoTags, En) => "No tags yet. Push an image to see it here.",
8658 (NoTags, Tr) => "Henüz etiket yok. Burada görmek için bir imaj gönderin.",
8759 (NoVersions, En) => "No versions published yet.",
@@ -94,10 +66,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
9466 (TabPackages, Tr) => "Paketler",
9567 (PackagesHeading, En) => "Packages",
9668 (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- }
10169 (NoPackages, En) => "No packages yet.",
10270 (NoPackages, Tr) => "Henüz paket yok.",
10371 (PackageVersions, En) => "Versions",
@@ -114,10 +82,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
11482 (VersionYanked, Tr) => "geri çekildi",
11583 (Install, En) => "Install",
11684 (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- }
12185 (InstallRegistryConfig, En) => "Registry config",
12286 (InstallRegistryConfig, Tr) => "Kayıt defteri yapılandırması",
12387 (InstallAdd, En) => "Add the crate",
@@ -134,11 +98,5 @@ pub fn t(lang: Lang, key: K) -> &'static str {
13498 (NoReadme, Tr) => "Bu crate'in README'si yok.",
13599 (ScopePackages, En) => "Packages",
136100 (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- }
143101 }
144102 }
crates/forge-web-base/src/i18n/pulls.rsmodified+1 -21
@@ -12,7 +12,6 @@ pub enum K {
1212 StateOpen,
1313 StateMerged,
1414 StateClosed,
15- ListStateNavLabel,
1615 NewPullRequest,
1716 SearchTitles,
1817 SortLabel,
@@ -24,22 +23,18 @@ pub enum K {
2423 SortNewest,
2524 SortOldest,
2625 SortUpdated,
27- MetaBeforeTime,
28- MetaAfterTime,
2926 Newer,
3027 Older,
3128
3229 // pull_files.rs
3330 FinishReview,
3431 ReviewSummary,
35- ReviewType,
3632 CommentChoice,
3733 ApproveChoice,
3834 RequestChangesChoice,
3935 SubmitReview,
4036 DiscardPending,
4137 ViewedFiles,
42- ViewedHint,
4338 ViewedMark,
4439 ChangedSinceViewed,
4540
@@ -102,8 +97,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
10297 (StateMerged, Tr) => "Birleştirildi",
10398 (StateClosed, En) => "Closed",
10499 (StateClosed, Tr) => "Kapatıldı",
105- (ListStateNavLabel, En) => "Pull requests by state",
106- (ListStateNavLabel, Tr) => "Duruma göre çekme istekleri",
107100 (NewPullRequest, En) => "New pull request",
108101 (NewPullRequest, Tr) => "Yeni çekme isteği",
109102 (SearchTitles, En) => "Search titles",
@@ -122,7 +115,7 @@ pub fn t(lang: Lang, key: K) -> &'static str {
122115 (NoPullRequestsYet, Tr) => {
123116 "Henüz çekme isteği yok. Bir dal gönderin, ardından değişikliklerini önermek için bir çekme isteği açın."
124117 }
125- (NoPullRequestsMatch, En) => "No pull requests match these filters.",
118+ (NoPullRequestsMatch, En) => "No matches.",
126119 (NoPullRequestsMatch, Tr) => "Bu filtrelere uyan çekme isteği yok.",
127120 (SortNewest, En) => "Newest",
128121 (SortNewest, Tr) => "En yeni",
@@ -130,10 +123,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
130123 (SortOldest, Tr) => "En eski",
131124 (SortUpdated, En) => "Recently updated",
132125 (SortUpdated, Tr) => "Son güncellenen",
133- (MetaBeforeTime, En) => " opened ",
134- (MetaBeforeTime, Tr) => " · ",
135- (MetaAfterTime, En) => " by ",
136- (MetaAfterTime, Tr) => " tarafından açıldı · ",
137126 (Newer, En) => "Newer",
138127 (Newer, Tr) => "Daha yeni",
139128 (Older, En) => "Older",
@@ -143,8 +132,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
143132 (FinishReview, Tr) => "İncelemeyi tamamla",
144133 (ReviewSummary, En) => "Review summary",
145134 (ReviewSummary, Tr) => "İnceleme özeti",
146- (ReviewType, En) => "Review type",
147- (ReviewType, Tr) => "İnceleme türü",
148135 (CommentChoice, En) => " Comment",
149136 (CommentChoice, Tr) => " Yorum",
150137 (ApproveChoice, En) => " Approve",
@@ -157,8 +144,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
157144 (DiscardPending, Tr) => "Bekleyen yorumları sil",
158145 (ViewedFiles, En) => "Viewed files",
159146 (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.",
162147 (ViewedMark, En) => "Mark as viewed",
163148 (ViewedMark, Tr) => "Görüntülendi olarak işaretle",
164149 (ChangedSinceViewed, En) => "Changed since you viewed",
@@ -335,7 +320,6 @@ mod tests {
335320 K::StateOpen,
336321 K::StateMerged,
337322 K::StateClosed,
338- K::ListStateNavLabel,
339323 K::NewPullRequest,
340324 K::SearchTitles,
341325 K::SortLabel,
@@ -347,20 +331,16 @@ mod tests {
347331 K::SortNewest,
348332 K::SortOldest,
349333 K::SortUpdated,
350- K::MetaBeforeTime,
351- K::MetaAfterTime,
352334 K::Newer,
353335 K::Older,
354336 K::FinishReview,
355337 K::ReviewSummary,
356- K::ReviewType,
357338 K::CommentChoice,
358339 K::ApproveChoice,
359340 K::RequestChangesChoice,
360341 K::SubmitReview,
361342 K::DiscardPending,
362343 K::ViewedFiles,
363- K::ViewedHint,
364344 K::ViewedMark,
365345 K::ChangedSinceViewed,
366346 K::BranchErrProtected,
crates/forge-web-base/src/i18n/pulls_review.rsmodified+2 -14
@@ -21,7 +21,6 @@ pub enum K {
2121 MergeConflict,
2222 MergeUpToDate,
2323 MergeChecking,
24- ReloadToCheck,
2524 MergeStyleLegend,
2625 StyleMergeCommit,
2726 StyleSquash,
@@ -41,7 +40,6 @@ pub enum K {
4140 CheckErrored,
4241 CheckMissing,
4342 EnableAutoMerge,
44- AutoMergeHint,
4543 DisableAutoMerge,
4644 MergeMessageLabel,
4745 MergeButton,
@@ -121,16 +119,14 @@ pub fn t(lang: Lang, key: K) -> &'static str {
121119 (TabConversation, Tr) => "Tartışma",
122120 (PullPages, En) => "Pull request pages",
123121 (PullPages, Tr) => "Çekme isteği sayfaları",
124- (MergeClean, En) => "This branch has no conflicts with the base branch",
125- (MergeClean, Tr) => "Bu dalın taban dalla çakışması yok",
122+ (MergeClean, En) => "Ready to merge",
123+ (MergeClean, Tr) => "Birleştirmeye hazır",
126124 (MergeConflict, En) => "This branch has conflicts that must be resolved",
127125 (MergeConflict, Tr) => "Bu dalda çözülmesi gereken çakışmalar var",
128126 (MergeUpToDate, En) => "This branch is already up to date with base",
129127 (MergeUpToDate, Tr) => "Bu dal zaten taban dalla güncel",
130128 (MergeChecking, En) => "Checking mergeability\u{2026}",
131129 (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",
134130 (MergeStyleLegend, En) => "Merge style",
135131 (MergeStyleLegend, Tr) => "Birleştirme yöntemi",
136132 (StyleMergeCommit, En) => " Create a merge commit",
@@ -181,12 +177,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
181177 (CheckMissing, Tr) => "Durum bekleniyor",
182178 (EnableAutoMerge, En) => "Enable auto-merge",
183179 (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- }
190180 (DisableAutoMerge, En) => "Disable auto-merge",
191181 (DisableAutoMerge, Tr) => "Otomatik birleştirmeyi kapat",
192182 (MergeMessageLabel, En) => "Merge commit message (optional)",
@@ -464,7 +454,6 @@ pub const ALL: &[K] = &[
464454 K::MergeConflict,
465455 K::MergeUpToDate,
466456 K::MergeChecking,
467- K::ReloadToCheck,
468457 K::MergeStyleLegend,
469458 K::StyleMergeCommit,
470459 K::StyleSquash,
@@ -484,7 +473,6 @@ pub const ALL: &[K] = &[
484473 K::CheckErrored,
485474 K::CheckMissing,
486475 K::EnableAutoMerge,
487- K::AutoMergeHint,
488476 K::DisableAutoMerge,
489477 K::MergeMessageLabel,
490478 K::MergeButton,
crates/forge-web-base/src/i18n/push.rsmodified+0 -7
@@ -7,7 +7,6 @@ use super::Lang;
77 pub enum K {
88 // Settings card: this device.
99 DeviceHeading,
10- DeviceHelp,
1110 DeviceUnsupported,
1211 DeviceNeedsHttps,
1312 DeviceIosHint,
@@ -36,12 +35,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
3635 match (key, lang) {
3736 (DeviceHeading, Lang::En) => "Push notifications on this device",
3837 (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- }
4538 (DeviceUnsupported, Lang::En) => "This browser does not support push notifications.",
4639 (DeviceUnsupported, Lang::Tr) => "Bu tarayıcı anlık bildirimleri desteklemiyor.",
4740 (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;
88 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
99 pub enum K {
1010 // Repo home page: the latest release card.
11- LatestReleaseHeading,
1211
1312 // CI notices, shown after a run action.
1413 CiNoticeStarted,
@@ -22,7 +21,6 @@ pub enum K {
2221
2322 // CI run list and run page.
2423 RunWorkflow,
25- RunWorkflowHelp,
2624 Branch,
2725 ApproveAndRun,
2826 Cancel,
@@ -34,12 +32,10 @@ pub enum K {
3432 DownloadAll,
3533 Download,
3634 ConfigWarnings,
37- ConfigWarningsHint,
3835 CiNoticeNoFailed,
3936 CiNoticeNotDone,
4037 CiNoticeTooBig,
4138 CiNoticeOverwritten,
42- CiCommitOverwritten,
4339 LogSearch,
4440 LogPrev,
4541 LogNext,
@@ -48,7 +44,6 @@ pub enum K {
4844 LogExpandAll,
4945 Runs,
5046 NoRunsYet,
51- NoRunsHint,
5247 TriggerScheduled,
5348 NextScheduledRun,
5449 NoJobs,
@@ -76,7 +71,6 @@ pub enum K {
7671
7772 // CI status badge, on the run list.
7873 BadgeHeading,
79- BadgeHelp,
8074 BadgeSnippet,
8175
8276 // CI state words.
@@ -94,8 +88,6 @@ pub enum K {
9488 StoppingButton,
9589
9690 // The failure block at the top of a failed run.
97- FailHeading,
98- FailLine,
9991 FailOpenLog,
10092 FailNoLog,
10193 FailNoError,
@@ -123,7 +115,6 @@ pub enum K {
123115 NewRelease,
124116 EditRelease,
125117 SaveRelease,
126- TagHint,
127118 Tag,
128119 TargetBranch,
129120 Title,
@@ -146,13 +137,8 @@ pub enum K {
146137 DeleteRelease,
147138 BackToRelease,
148139 UploadAsset,
149- DeleteReleaseHelp,
150- YesDeleteRelease,
151- EditTagHelp,
152140 EditTargetLabel,
153141 CurrentCommit,
154- TargetMoveHelp,
155- TargetLockedHelp,
156142 ReplaceAsset,
157143
158144 // CI time estimate: a running run past its expected total.
@@ -163,8 +149,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
163149 use K::*;
164150 use Lang::*;
165151 match (key, lang) {
166- (LatestReleaseHeading, En) => "Latest release",
167- (LatestReleaseHeading, Tr) => "Son sürüm",
168152 (CiNoticeStarted, En) => "Workflow run queued.",
169153 (CiNoticeStarted, Tr) => "İş akışı çalıştırması sıraya alındı.",
170154 (CiNoticeCancelled, En) => {
@@ -192,12 +176,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
192176
193177 (RunWorkflow, En) => "Run workflow",
194178 (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- }
201179 (Branch, En) => "Branch",
202180 (Branch, Tr) => "Dal",
203181 (ApproveAndRun, En) => "Approve and run",
@@ -216,12 +194,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
216194 (Download, Tr) => "İndir",
217195 (ConfigWarnings, En) => "Config warnings",
218196 (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- }
225197 (CiNoticeNoFailed, En) => "This run has no failed or cancelled jobs to run again.",
226198 (CiNoticeNoFailed, Tr) => {
227199 "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 {
238210 (CiNoticeOverwritten, Tr) => {
239211 "Bu commit'in üzerine yazıldı, bu yüzden yeniden çalıştırılamaz."
240212 }
241- (CiCommitOverwritten, En) => "This commit was overwritten by a force push.",
242- (CiCommitOverwritten, Tr) => "Bu commit'in üzerine yazıldı.",
243213 (LogSearch, En) => "Search the log",
244214 (LogSearch, Tr) => "Günlükte ara",
245215 (LogPrev, En) => "Previous match",
@@ -258,10 +228,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
258228 (Runs, Tr) => "Çalıştırmalar",
259229 (NoRunsYet, En) => "No runs yet.",
260230 (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- }
265231 (TriggerScheduled, En) => "scheduled",
266232 (TriggerScheduled, Tr) => "zamanlanmış",
267233 (NextScheduledRun, En) => "Next scheduled run",
@@ -296,22 +262,16 @@ pub fn t(lang: Lang, key: K) -> &'static str {
296262 (CopyDone, Tr) => "Kopyalandı",
297263 (CopyFailed, En) => "Copy failed",
298264 (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",
303265 (FailOpenLog, En) => "Open in full log",
304266 (FailOpenLog, Tr) => "Tam günlükte aç",
305- (FailNoLog, En) => "This job wrote no log.",
306- (FailNoLog, Tr) => "Bu iş günlük yazmadı.",
307- (FailNoError, En) => "No error line found. The last lines of the log are shown.",
308- (FailNoError, Tr) => "Hata satırı bulunamadı. Günlüğün son satırları gösteriliyor.",
267+ (FailNoLog, En) => "No log.",
268+ (FailNoLog, Tr) => "Günlük yok.",
269+ (FailNoError, En) => "No error line.",
270+ (FailNoError, Tr) => "Hata satırı yok.",
309271 (Duration, En) => "Duration",
310272 (Duration, Tr) => "Süre",
311- (LogTruncated, En) => "Showing the last 512 KiB of the log. The full log is linked above.",
312- (LogTruncated, Tr) => {
313- "Günlüğün son 512 KiB'ı gösteriliyor. Tam günlük yukarıda bağlantılı."
314- }
273+ (LogTruncated, En) => "Showing the last 512 KiB.",
274+ (LogTruncated, Tr) => "Günlüğün son 512 KiB'ı gösteriliyor.",
315275 (Artifacts, En) => "Artifacts",
316276 (Artifacts, Tr) => "Yapıtlar",
317277 (Timeline, En) => "Timeline",
@@ -322,14 +282,8 @@ pub fn t(lang: Lang, key: K) -> &'static str {
322282 (ExpandAll, Tr) => "Tümünü aç",
323283 (CollapseAll, En) => "Collapse all",
324284 (CollapseAll, Tr) => "Tümünü kapat",
325- (BadgeHeading, En) => "Status badge",
326- (BadgeHeading, Tr) => "Durum rozeti",
327- (BadgeHelp, En) => {
328- "Embed this image in a README to show the newest run on the branch. It refreshes on every load."
329- }
330- (BadgeHelp, Tr) => {
331- "Bu resmi bir README'ye ekleyin; dalın en son çalıştırmasını gösterir. Her yüklemede yenilenir."
332- }
285+ (BadgeHeading, En) => "Badge",
286+ (BadgeHeading, Tr) => "Rozet",
333287 (BadgeSnippet, En) => "Markdown",
334288 (BadgeSnippet, Tr) => "Markdown",
335289
@@ -420,12 +374,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
420374 (EditRelease, Tr) => "Sürümü düzenle",
421375 (SaveRelease, En) => "Save release",
422376 (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- }
429377 (Tag, En) => "Tag",
430378 (Tag, Tr) => "Etiket",
431379 (TargetBranch, En) => "Target branch",
@@ -470,30 +418,10 @@ pub fn t(lang: Lang, key: K) -> &'static str {
470418 (BackToRelease, Tr) => "Sürüme dön",
471419 (UploadAsset, En) => "Upload asset",
472420 (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- }
485421 (EditTargetLabel, En) => "Move tag to branch (optional)",
486422 (EditTargetLabel, Tr) => "Etiketi dala taşı (isteğe bağlı)",
487423 (CurrentCommit, En) => "Keep the current commit",
488424 (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- }
497425 (ReplaceAsset, En) => "Replace",
498426 (ReplaceAsset, Tr) => "Değiştir",
499427 (TakingLonger, En) => "taking longer than usual",
@@ -525,14 +453,6 @@ pub fn page_label(lang: Lang, page: u32) -> String {
525453 }
526454 }
527455
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-
536456 /// "needs test", for the names of the jobs a job needs.
537457 pub fn needs_label(lang: Lang, names: &str) -> String {
538458 match lang {
@@ -607,7 +527,6 @@ mod tests {
607527 use super::*;
608528
609529 const ALL: &[K] = &[
610- K::LatestReleaseHeading,
611530 K::CiNoticeStarted,
612531 K::CiNoticeCancelled,
613532 K::CiNoticeApproved,
@@ -617,7 +536,6 @@ mod tests {
617536 K::CiNoticeNoBranch,
618537 K::CiNoticeNoManual,
619538 K::RunWorkflow,
620- K::RunWorkflowHelp,
621539 K::Branch,
622540 K::ApproveAndRun,
623541 K::Cancel,
@@ -628,12 +546,10 @@ mod tests {
628546 K::DownloadAll,
629547 K::Download,
630548 K::ConfigWarnings,
631- K::ConfigWarningsHint,
632549 K::CiNoticeNoFailed,
633550 K::CiNoticeNotDone,
634551 K::CiNoticeTooBig,
635552 K::CiNoticeOverwritten,
636- K::CiCommitOverwritten,
637553 K::LogSearch,
638554 K::LogPrev,
639555 K::LogNext,
@@ -642,7 +558,6 @@ mod tests {
642558 K::LogExpandAll,
643559 K::Runs,
644560 K::NoRunsYet,
645- K::NoRunsHint,
646561 K::TriggerScheduled,
647562 K::NextScheduledRun,
648563 K::Jobs,
@@ -668,7 +583,6 @@ mod tests {
668583 K::ExpandAll,
669584 K::CollapseAll,
670585 K::BadgeHeading,
671- K::BadgeHelp,
672586 K::BadgeSnippet,
673587 K::StateWaitingApproval,
674588 K::StateQueued,
@@ -681,8 +595,6 @@ mod tests {
681595 K::StateSkipped,
682596 K::StateStopping,
683597 K::StoppingButton,
684- K::FailHeading,
685- K::FailLine,
686598 K::FailOpenLog,
687599 K::FailNoLog,
688600 K::FailNoError,
@@ -704,7 +616,6 @@ mod tests {
704616 K::NewRelease,
705617 K::EditRelease,
706618 K::SaveRelease,
707- K::TagHint,
708619 K::Tag,
709620 K::TargetBranch,
710621 K::Title,
@@ -727,13 +638,8 @@ mod tests {
727638 K::DeleteRelease,
728639 K::BackToRelease,
729640 K::UploadAsset,
730- K::DeleteReleaseHelp,
731- K::YesDeleteRelease,
732- K::EditTagHelp,
733641 K::EditTargetLabel,
734642 K::CurrentCommit,
735- K::TargetMoveHelp,
736- K::TargetLockedHelp,
737643 K::ReplaceAsset,
738644 K::TakingLonger,
739645 ];
crates/forge-web-base/src/i18n/repo_admin.rsmodified+14 -182
@@ -7,18 +7,14 @@ pub enum K {
77 Accept,
88 AcceptTransfer,
99 AddCollaboratorButton,
10- AddCollaboratorHeading,
11- AddCollaboratorHelp,
1210 AddOrUpdate,
1311 AllowDeletion,
1412 AllowForcePush,
1513 AlreadyOwner,
1614 ApprovalsRange,
1715 ArchiveHeading,
18- ArchiveHelp,
1916 ArchiveConfirm,
2017 ArchiveRepo,
21- ArchivedHelp,
2218 ArchivedSecrets,
2319 Cancel,
2420 BadForm,
@@ -26,7 +22,6 @@ pub enum K {
2622 BranchMissing,
2723 BranchPattern,
2824 BranchProtection,
29- BranchProtectionHelp,
3025 BranchRuleRemoved,
3126 BranchRuleSaved,
3227 BuiltinRowText,
@@ -36,8 +31,6 @@ pub enum K {
3631 CollabAdded,
3732 CollabRemoved,
3833 Collaborators,
39- CollaboratorsHelp,
40- ColUser,
4134 DangerZone,
4235 Decline,
4336 DeclineTransfer,
@@ -45,11 +38,8 @@ pub enum K {
4538 DefaultBranchFailed,
4639 Delete,
4740 DeleteRepo,
48- DeleteRepoHelp,
49- DeleteTrashHelp,
5041 DeletionAllowed,
5142 Description,
52- DescriptionHelp,
5343 DescriptionLong,
5444 EditRule,
5545 EnterUsername,
@@ -60,7 +50,6 @@ pub enum K {
6050 MakePublic,
6151 MakePublicConfirm,
6252 InvalidRole,
63- LastUpdated,
6453 Mirrors,
6554 Name,
6655 NameRule,
@@ -69,19 +58,14 @@ pub enum K {
6958 AddRule,
7059 NoBranchesYet,
7160 NoCollaborators,
72- NoPendingTransfer,
7361 NoSecrets,
7462 NotCollaborator,
7563 OwnerIsMember,
76- PatternHelp,
77- PendingTransfers,
7864 PrivateOption,
7965 PublicOption,
8066 Remove,
8167 RemoveRule,
82- RenameHelp,
8368 RenameRepo,
84- RenameTransferNav,
8569 RenamedNotice,
8670 RepoArchived,
8771 RepoDeletedAfter,
@@ -92,13 +76,8 @@ pub enum K {
9276 RequiredApprovals,
9377 RestrictPushTitle,
9478 Role,
95- RoleAdminDesc,
96- RoleMaintainDesc,
97- RoleReadDesc,
9879 Roles,
99- RoleTriageDesc,
10080 RoleUpdated,
101- RoleWriteDesc,
10281 RequiredChecks,
10382 RecentContexts,
10483 RuleChangesShort,
@@ -107,21 +86,15 @@ pub enum K {
10786 RuleUpToDateShort,
10887 SaveGeneral,
10988 SaveRole,
110- SaveRule,
11189 SaveSecret,
11290 SecretDeleted,
113- SecretLimits,
11491 SecretMissing,
11592 SecretSaved,
11693 Secrets,
117- SecretsHelp,
11894 SectionChecks,
11995 SectionPullRequests,
120- SectionPattern,
12196 SectionPushes,
12297 SettingsNavLabel,
123- StartTransferLink,
124- TransferHelp,
12598 TransferRepo,
12699 TransferTitle,
127100 TransferredNotice,
@@ -137,6 +110,8 @@ pub enum K {
137110 VisibilityHeading,
138111 MakePrivateConfirm,
139112 Webhooks,
113+ Features,
114+ RenameHeading,
140115 }
141116
142117 pub fn t(lang: Lang, key: K) -> &'static str {
@@ -149,14 +124,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
149124 (AcceptTransfer, Tr) => "Devri kabul et",
150125 (AddCollaboratorButton, En) => "Add collaborator",
151126 (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- }
160127 (AddOrUpdate, En) => "Add or update a secret",
161128 (AddOrUpdate, Tr) => "Gizli anahtar ekle veya güncelle",
162129 (AllowDeletion, En) => "Deleting the branch",
@@ -169,24 +136,12 @@ pub fn t(lang: Lang, key: K) -> &'static str {
169136 (ApprovalsRange, Tr) => "Gerekli onay sayısı 0 ile 20 arasında bir tam sayı olmalıdır.",
170137 (ArchiveHeading, En) => "Archive",
171138 (ArchiveHeading, Tr) => "Arşiv",
172- (ArchiveHelp, En) => {
173- "Archiving makes the repository read-only: pushes are refused, and issues, labels and milestones cannot change. You can unarchive it at any time."
174- }
175- (ArchiveHelp, Tr) => {
176- "Arşivleme depoyu salt okunur yapar: gönderimler reddedilir; sorunlar, etiketler ve kilometre taşları değiştirilemez. Arşivden istediğiniz zaman çıkarabilirsiniz."
177- }
178- (ArchiveConfirm, En) => "Archive this repository? You can unarchive it at any time.",
179- (ArchiveConfirm, Tr) => "Depo arşivlensin mi? İstediğiniz zaman arşivden çıkarabilirsiniz.",
139+ (ArchiveConfirm, En) => "Archive this repository?",
140+ (ArchiveConfirm, Tr) => "Depo arşivlensin mi?",
180141 (Cancel, En) => "Cancel",
181142 (Cancel, Tr) => "Vazgeç",
182143 (ArchiveRepo, En) => "Archive repository",
183144 (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- }
190145 (ArchivedSecrets, En) => "This repository is archived. Secrets are read-only.",
191146 (ArchivedSecrets, Tr) => "Bu depo arşivlenmiş. Gizli anahtarlar salt okunurdur.",
192147 (BadForm, En) => "The form was not understood. Nothing was changed.",
@@ -199,12 +154,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
199154 (BranchPattern, Tr) => "Dal",
200155 (BranchProtection, En) => "Branch protection",
201156 (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- }
208157 (BranchRuleRemoved, En) => "Branch rule removed.",
209158 (BranchRuleRemoved, Tr) => "Dal kuralı kaldırıldı.",
210159 (BranchRuleSaved, En) => "Branch rule saved.",
@@ -223,14 +172,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
223172 (CollabRemoved, Tr) => "Ortak çalışan kaldırıldı.",
224173 (Collaborators, En) => "Collaborators",
225174 (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ı",
234175 (DangerZone, En) => "Danger zone",
235176 (DangerZone, Tr) => "Tehlikeli bölge",
236177 (Decline, En) => "Decline",
@@ -245,28 +186,10 @@ pub fn t(lang: Lang, key: K) -> &'static str {
245186 (Delete, Tr) => "Sil",
246187 (DeleteRepo, En) => "Delete repository",
247188 (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- }
260189 (DeletionAllowed, En) => "Deletion allowed",
261190 (DeletionAllowed, Tr) => "Silmeye izin var",
262191 (Description, En) => "Description",
263192 (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- }
270193 (DescriptionLong, En) => {
271194 "The description can be at most 350 characters. Nothing was saved."
272195 }
@@ -287,16 +210,10 @@ pub fn t(lang: Lang, key: K) -> &'static str {
287210 (GeneralSaved, Tr) => "Genel ayarlar kaydedildi.",
288211 (MakePublic, En) => "Make public",
289212 (MakePublic, Tr) => "Herkese açık yap",
290- (MakePublicConfirm, En) => {
291- "Make it public? Anyone will be able to read its code, issues and pull requests. It takes effect at once."
292- }
293- (MakePublicConfirm, Tr) => {
294- "Herkese açık yapılsın mı? Kodunu, sorunlarını ve çekme isteklerini herkes okuyabilir. Hemen geçerli olur."
295- }
213+ (MakePublicConfirm, En) => "Make it public?",
214+ (MakePublicConfirm, Tr) => "Herkese açık yapılsın mı?",
296215 (InvalidRole, En) => "Choose a valid role.",
297216 (InvalidRole, Tr) => "Geçerli bir rol seçin.",
298- (LastUpdated, En) => "Last updated",
299- (LastUpdated, Tr) => "Son güncelleme",
300217 (Mirrors, En) => "Mirrors",
301218 (Mirrors, Tr) => "Yansılar",
302219 (Name, En) => "Name",
@@ -319,8 +236,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
319236 (NoBranchesYet, Tr) => "Henüz dal yok. Varsayılan dal, ilk gönderimden sonra seçilebilir.",
320237 (NoCollaborators, En) => "No collaborators yet.",
321238 (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.",
324239 (NoSecrets, En) => "No secrets yet.",
325240 (NoSecrets, Tr) => "Henüz gizli anahtar yok.",
326241 (NotCollaborator, En) => "That user is not a collaborator on this repo.",
@@ -331,10 +246,6 @@ pub fn t(lang: Lang, key: K) -> &'static str {
331246 (OwnerIsMember, Tr) => {
332247 "Depo sahibi zaten tam erişimli bir üyedir ve ortak çalışan olarak eklenemez."
333248 }
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",
338249 (PrivateOption, En) => {
339250 "Private: only its owner, collaborators and instance admins can see it. Others get a 404."
340251 }
@@ -347,16 +258,8 @@ pub fn t(lang: Lang, key: K) -> &'static str {
347258 (Remove, Tr) => "Kaldır",
348259 (RemoveRule, En) => "Remove rule",
349260 (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- }
356261 (RenameRepo, En) => "Rename repository",
357262 (RenameRepo, Tr) => "Depoyu yeniden adlandır",
358- (RenameTransferNav, En) => "Rename & transfer",
359- (RenameTransferNav, Tr) => "Yeniden adlandır ve devret",
360263 (RenamedNotice, En) => "Repository renamed. The old name redirects to the new one.",
361264 (RenamedNotice, Tr) => "Depo yeniden adlandırıldı. Eski ad yeni ada yönlendirir.",
362265 (RepoArchived, En) => "Repository archived.",
@@ -377,20 +280,10 @@ pub fn t(lang: Lang, key: K) -> &'static str {
377280 (Role, En) => "Role",
378281 (RestrictPushTitle, Tr) => "Yalnızca çekme istekleri üzerinden",
379282 (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",
386283 (Roles, En) => "Roles",
387284 (Roles, Tr) => "Roller",
388- (RoleTriageDesc, En) => "manage issues",
389- (RoleTriageDesc, Tr) => "sorunları yönetme",
390285 (RoleUpdated, En) => "Role updated.",
391286 (RoleUpdated, Tr) => "Rol güncellendi.",
392- (RoleWriteDesc, En) => "push",
393- (RoleWriteDesc, Tr) => "gönderme (push)",
394287 (RequiredChecks, En) => "Required status checks",
395288 (RequiredChecks, Tr) => "Gerekli durum denetimleri",
396289 (RecentContexts, En) => "Recently seen:",
@@ -407,44 +300,24 @@ pub fn t(lang: Lang, key: K) -> &'static str {
407300 (SaveGeneral, Tr) => "Genel ayarları kaydet",
408301 (SaveRole, En) => "Save",
409302 (SaveRole, Tr) => "Kaydet",
410- (SaveRule, En) => "Save rule",
411- (SaveRule, Tr) => "Kuralı kaydet",
412303 (SaveSecret, En) => "Save secret",
413304 (SaveSecret, Tr) => "Gizli anahtarı kaydet",
414305 (SecretDeleted, En) => "Secret deleted.",
415306 (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.",
418307 (SecretMissing, En) => "No secret has that name. Nothing was deleted.",
419308 (SecretMissing, Tr) => "Bu adda bir gizli anahtar yok. Hiçbir şey silinmedi.",
420309 (SecretSaved, En) => "Secret saved. Its value is not shown again.",
421310 (SecretSaved, Tr) => "Gizli anahtar kaydedildi. Değeri bir daha gösterilmez.",
422311 (Secrets, En) => "Secrets",
423312 (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- }
430313 (SectionChecks, En) => "Checks",
431314 (SectionPullRequests, En) => "Pull requests",
432- (SectionPattern, En) => "Pattern",
433315 (SectionPushes, En) => "Pushes",
434316 (SettingsNavLabel, En) => "Settings",
435317 (SectionChecks, Tr) => "Denetimler",
436318 (SectionPullRequests, Tr) => "Çekme istekleri",
437- (SectionPattern, Tr) => "Desen",
438319 (SectionPushes, Tr) => "Gönderimler",
439320 (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- }
448321 (TransferRepo, En) => "Transfer repository",
449322 (TransferRepo, Tr) => "Depoyu devret",
450323 (TransferTitle, En) => "Transfer",
@@ -473,30 +346,14 @@ pub fn t(lang: Lang, key: K) -> &'static str {
473346 (VisibilityChanged, Tr) => "Görünürlük değiştirildi.",
474347 (VisibilityHeading, En) => "Visibility",
475348 (VisibilityHeading, Tr) => "Görünürlük",
476- (MakePrivateConfirm, En) => {
477- "Make it private? Only its owner, collaborators and instance admins will see it; others get a 404. It takes effect at once."
478- }
479- (MakePrivateConfirm, Tr) => {
480- "Özel yapılsın mı? Yalnızca sahibi, ortak çalışanları ve sunucu yöneticileri görebilir; diğerleri 404 hatası alır. Hemen geçerli olur."
481- }
349+ (MakePrivateConfirm, En) => "Make it private?",
350+ (MakePrivateConfirm, Tr) => "Özel yapılsın mı?",
482351 (Webhooks, En) => "Webhooks",
483352 (Webhooks, Tr) => "Web kancaları",
484- }
485-}
486-
487-/// The page title of the rename and transfer page.
488-pub fn page_title(lang: Lang, title: &str) -> String {
489- match lang {
490- Lang::En => format!("{title} \u{b7} Rename or transfer"),
491- Lang::Tr => format!("{title} \u{b7} Yeniden adlandır veya devret"),
492- }
493-}
494-
495-/// The page title of the transfer status page.
496-pub fn transfer_page_title(lang: Lang, title: &str) -> String {
497- match lang {
498- Lang::En => format!("{title} \u{b7} Transfer"),
499- Lang::Tr => format!("{title} \u{b7} Devir"),
353+ (Features, En) => "Features",
354+ (Features, Tr) => "Özellikler",
355+ (RenameHeading, En) => "Rename",
356+ (RenameHeading, Tr) => "Yeniden adlandır",
500357 }
501358 }
502359
@@ -633,18 +490,14 @@ mod tests {
633490 K::Accept,
634491 K::AcceptTransfer,
635492 K::AddCollaboratorButton,
636- K::AddCollaboratorHeading,
637- K::AddCollaboratorHelp,
638493 K::AddOrUpdate,
639494 K::AllowDeletion,
640495 K::AllowForcePush,
641496 K::AlreadyOwner,
642497 K::ApprovalsRange,
643498 K::ArchiveHeading,
644- K::ArchiveHelp,
645499 K::ArchiveConfirm,
646500 K::ArchiveRepo,
647- K::ArchivedHelp,
648501 K::ArchivedSecrets,
649502 K::Cancel,
650503 K::BadForm,
@@ -652,7 +505,6 @@ mod tests {
652505 K::BranchMissing,
653506 K::BranchPattern,
654507 K::BranchProtection,
655- K::BranchProtectionHelp,
656508 K::BranchRuleRemoved,
657509 K::BranchRuleSaved,
658510 K::BuiltinRowText,
@@ -662,8 +514,6 @@ mod tests {
662514 K::CollabAdded,
663515 K::CollabRemoved,
664516 K::Collaborators,
665- K::CollaboratorsHelp,
666- K::ColUser,
667517 K::DangerZone,
668518 K::Decline,
669519 K::DeclineTransfer,
@@ -671,11 +521,8 @@ mod tests {
671521 K::DefaultBranchFailed,
672522 K::Delete,
673523 K::DeleteRepo,
674- K::DeleteRepoHelp,
675- K::DeleteTrashHelp,
676524 K::DeletionAllowed,
677525 K::Description,
678- K::DescriptionHelp,
679526 K::DescriptionLong,
680527 K::EditRule,
681528 K::EnterUsername,
@@ -686,7 +533,6 @@ mod tests {
686533 K::MakePublic,
687534 K::MakePublicConfirm,
688535 K::InvalidRole,
689- K::LastUpdated,
690536 K::Mirrors,
691537 K::Name,
692538 K::NameRule,
@@ -695,19 +541,14 @@ mod tests {
695541 K::AddRule,
696542 K::NoBranchesYet,
697543 K::NoCollaborators,
698- K::NoPendingTransfer,
699544 K::NoSecrets,
700545 K::NotCollaborator,
701546 K::OwnerIsMember,
702- K::PatternHelp,
703- K::PendingTransfers,
704547 K::PrivateOption,
705548 K::PublicOption,
706549 K::Remove,
707550 K::RemoveRule,
708- K::RenameHelp,
709551 K::RenameRepo,
710- K::RenameTransferNav,
711552 K::RenamedNotice,
712553 K::RepoArchived,
713554 K::RepoDeletedAfter,
@@ -718,13 +559,8 @@ mod tests {
718559 K::RequiredApprovals,
719560 K::RestrictPushTitle,
720561 K::Role,
721- K::RoleAdminDesc,
722- K::RoleMaintainDesc,
723- K::RoleReadDesc,
724562 K::Roles,
725- K::RoleTriageDesc,
726563 K::RoleUpdated,
727- K::RoleWriteDesc,
728564 K::RequiredChecks,
729565 K::RecentContexts,
730566 K::RuleChangesShort,
@@ -733,21 +569,15 @@ mod tests {
733569 K::RuleUpToDateShort,
734570 K::SaveGeneral,
735571 K::SaveRole,
736- K::SaveRule,
737572 K::SaveSecret,
738573 K::SecretDeleted,
739- K::SecretLimits,
740574 K::SecretMissing,
741575 K::SecretSaved,
742576 K::Secrets,
743- K::SecretsHelp,
744577 K::SectionChecks,
745578 K::SectionPullRequests,
746- K::SectionPattern,
747579 K::SectionPushes,
748580 K::SettingsNavLabel,
749- K::StartTransferLink,
750- K::TransferHelp,
751581 K::TransferRepo,
752582 K::TransferTitle,
753583 K::TransferredNotice,
@@ -763,6 +593,8 @@ mod tests {
763593 K::VisibilityHeading,
764594 K::MakePrivateConfirm,
765595 K::Webhooks,
596+ K::Features,
597+ K::RenameHeading,
766598 ];
767599
768600 #[test]
crates/forge-web/assets/nav.jsmodified+45 -225
@@ -765,7 +765,7 @@
765765 settings: function () { refreshLive(true); },
766766 // The inbox count changed (see `unreadChanged` above).
767767 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.
769769 activity: function () { refreshActivity(); }
770770 });
771771 document.addEventListener('visibilitychange', function () {
@@ -871,60 +871,39 @@
871871 closeDropdowns(e.target && e.target.nodeType === 1 ? e.target : null);
872872 }, false);
873873
874- // A mouse that rests on the profile corner opens its account menu, or the bell popover on the bell,
875- // after a short rest; when it leaves, the menu or popover it opened closes. Touch and keyboard
876- // keep the click. hoverOn names what the mouse opened; hoverWait says whether the pending timer
877- // shows it or hides it.
878- var HOVER_OPEN = 120; // a mouse rests this long before a menu opens
874+ // A mouse that rests on the profile corner opens its account menu after a short rest; when it
875+ // leaves, the menu it opened closes. Touch and keyboard keep the click. hoverOn says the mouse
876+ // opened the menu; hoverTimer is the pending show or hide, and hoverWait says which.
877+ var HOVER_OPEN = 120; // a mouse rests this long before the menu opens
879878 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;
881880 var hoverTimer = 0;
882881 var hoverWait = ''; // 'show' or 'hide': what the pending timer does
883- var hoverMute = false; // a click on the bell: it stays shut until the mouse leaves the bell
884-
885- // The part of the profile a node belongs to: 'bell' for the notifications row and its popover
886- // (tested first, as they sit inside the menu), 'menu' for the rest, null elsewhere.
887- function hoverKind(node) {
888- if (!node || !node.closest) { return null; }
889- if (node.closest('.corner-bell, .bell-pop')) { return 'bell'; }
890- if (node.closest('.corner-float')) { return 'menu'; }
891- return null;
882+
883+ function inCorner(node) {
884+ return !!(node && node.closest && node.closest('.corner-float'));
892885 }
893886
894- // Whether the account menu or the bell popover is open right now.
895- function hoverIsOpen(kind) {
896- if (kind === 'menu') {
897- var details = document.querySelector('details.corner');
898- return !!(details && details.open);
899- }
900- var pop = document.querySelector('.bell-pop');
901- return !!(pop && isPeekOpen(pop));
887+ function menuOpen() {
888+ var details = document.querySelector('details.corner');
889+ return !!(details && details.open);
902890 }
903891
904- // Opens the menu, or the bell popover beside it, for a resting mouse. A menu the reader opened by
905- // click or keyboard is left alone. The popover sits inside the menu, so the menu stays open under it.
906- function hoverShow(kind) {
907- if (!hoverOn && hoverIsOpen(kind)) { return; }
892+ // Opens the menu for a resting mouse. A menu the reader opened by click or keyboard is left alone.
893+ function hoverShow() {
894+ if (!hoverOn && menuOpen()) { return; }
908895 var details = document.querySelector('details.corner');
909- var pop = document.querySelector('.bell-pop');
910- if (kind === 'menu') {
911- try { if (pop) { pop.hidePopover(); } } catch (err) { }
912- if (details) { details.open = true; }
913- } else {
914- try { if (pop) { pop.showPopover(); } } catch (err) { }
915- }
916- hoverOn = kind;
896+ if (details) { details.open = true; }
897+ hoverOn = true;
917898 }
918899
919- // Closes what the mouse opened, and forgets it.
900+ // Closes the menu the mouse opened, and forgets it.
920901 function hoverHide() {
921902 if (hoverOn) {
922- var pop = document.querySelector('.bell-pop');
923903 var details = document.querySelector('details.corner');
924- try { if (pop) { pop.hidePopover(); } } catch (err) { }
925904 if (details) { details.open = false; }
926905 }
927- hoverOn = null;
906+ hoverOn = false;
928907 }
929908
930909 // A mouse entering the corner starts a show (a fresh rest each time it moves within it). Leaving the
@@ -932,19 +911,14 @@
932911 // page does not keep pushing the hide back.
933912 document.addEventListener('pointerover', function (e) {
934913 if (e.pointerType !== 'mouse') { return; }
935- var kind = hoverKind(e.target);
936- if (hoverMute) {
937- if (kind === 'bell') { return; }
938- hoverMute = false;
939- }
940- if (kind) {
914+ if (inCorner(e.target)) {
941915 clearTimeout(hoverTimer);
942916 hoverTimer = 0;
943- if (kind === hoverOn && hoverIsOpen(kind)) { return; }
917+ if (hoverOn && menuOpen()) { return; }
944918 hoverWait = 'show';
945919 hoverTimer = setTimeout(function () {
946920 hoverTimer = 0;
947- hoverShow(kind);
921+ hoverShow();
948922 }, HOVER_OPEN);
949923 return;
950924 }
@@ -963,153 +937,14 @@
963937
964938 // A click on the menu's summary, while the mouse holds it open, does nothing: the menu stays open.
965939 window.addEventListener('click', function (e) {
966- if (hoverOn !== 'menu' || !e.target || !e.target.closest) { return; }
940+ if (!hoverOn || !e.target || !e.target.closest) { return; }
967941 if (!e.target.closest('summary.corner-btn')) { return; }
968942 e.preventDefault();
969943 }, true);
970944
971- // The bell beside the profile corner opens a popover of the newest notifications instead of going
972- // to the inbox. A touch or keyboard click toggles it; a mouse has already opened it by hovering, so
973- // its click goes to the inbox. With a modifier or a middle click the link's own behaviour stays.
974- // The Popover API light-dismisses it and Escape closes it. Its list is fetched each time it opens
975- // (see the toggle handler). The bell and the popover are siblings.
976- var peekPress = null; // at a press: whether the popover was open (null before any press)
977- var peekHover = false; // at a press: whether the mouse held the popover open
978-
979- function isPeekOpen(pop) {
980- try { return pop.matches(':popover-open'); } catch (err) { return false; }
981- }
982-
983- // Beside the menu, level with the notifications row. When the window has no room for that, under
984- // the row. Either way it stays inside the window.
985- function placePeek(bell, pop) {
986- if (!bell) { return; }
987- var r = bell.getBoundingClientRect();
988- var menu = bell.closest('.corner-menu');
989- var right = (menu ? menu.getBoundingClientRect().right : r.right) + 8;
990- var beside = right + pop.offsetWidth + 8 <= window.innerWidth;
991- var left = beside ? right : Math.max(8, Math.min(r.left, window.innerWidth - pop.offsetWidth - 8));
992- pop.style.left = left + 'px';
993- pop.style.top = (beside ? r.top - 8 : r.bottom + 6) + 'px';
994- pop.style.bottom = 'auto';
995- }
996-
997- // Fills the popover's list with the server's fragment. The popover stays invisible until then, so it
998- // opens at its final height; a slow answer shows the loading note first. A reader who closed it
999- // meanwhile, or a newer open, leaves the answer unused.
1000- function loadPeek(pop) {
1001- var list = pop.querySelector('.bell-list');
1002- if (!list) { return; }
1003- var seq = ++peekSeq;
1004- var slow = setTimeout(function () {
1005- if (seq !== peekSeq || !isPeekOpen(pop)) { return; }
1006- var note = document.createElement('p');
1007- note.className = 'bell-empty muted';
1008- note.textContent = pop.getAttribute('data-loading') || '';
1009- list.replaceChildren(note);
1010- pop.classList.add('bell-ready');
1011- }, PEEK_SLOW);
1012- fetch('/notifications/peek', { headers: { accept: 'text/html' }, credentials: 'same-origin' }).then(function (r) {
1013- if (!r.ok) { throw new Error('status ' + r.status); }
1014- return r.text();
1015- }).then(function (html) {
1016- if (seq !== peekSeq || !isPeekOpen(pop)) { return; }
1017- var tpl = document.createElement('template');
1018- tpl.innerHTML = html;
1019- list.replaceChildren(tpl.content);
1020- }).catch(function () {
1021- if (seq !== peekSeq || !isPeekOpen(pop)) { return; }
1022- var err = document.createElement('p');
1023- err.className = 'bell-empty muted';
1024- err.textContent = pop.getAttribute('data-error') || '';
1025- list.replaceChildren(err);
1026- }).then(function () {
1027- clearTimeout(slow);
1028- if (seq === peekSeq && isPeekOpen(pop)) { pop.classList.add('bell-ready'); }
1029- });
1030- }
1031- // Mark all read from the bell: the post goes in the background, so the page under the popover is
1032- // not fetched again. The list and the count change once the server has answered; the inbox page
1033- // follows through its own stream.
1034- document.addEventListener('submit', function (e) {
1035- var form = e.target;
1036- if (!form.matches || !form.matches('.bell-clear')) { return; }
1037- e.preventDefault();
1038- if (form.classList.contains('is-busy')) { return; }
1039- form.classList.add('is-busy');
1040- var pop = form.closest('.bell-pop');
1041- fetch(form.action, { method: 'POST', credentials: 'same-origin', redirect: 'manual', body: new URLSearchParams(new FormData(form)) }).then(function (r) {
1042- form.classList.remove('is-busy');
1043- if (r.type !== 'opaqueredirect') { throw new Error('status ' + r.status); }
1044- if (pop && isPeekOpen(pop)) { loadPeek(pop); }
1045- }).catch(function () {
1046- form.classList.remove('is-busy');
1047- form.submit();
1048- });
1049- }, true);
1050- var PEEK_SLOW = 300; // ms before a slow list shows its loading note
1051- var peekSeq = 0; // a fetch's number: only the newest answer is drawn
1052-
1053- // Records whether the popover was open when the press began. Light dismiss closes it on the press,
1054- // so the click that follows must not reopen it.
1055- document.addEventListener('pointerdown', function (e) {
1056- var bell = e.target && e.target.closest ? e.target.closest('.corner-bell') : null;
1057- if (!bell) { return; }
1058- var pop = bell.nextElementSibling;
1059- peekPress = !!(pop && pop.classList.contains('bell-pop') && isPeekOpen(pop));
1060- peekHover = hoverOn === 'bell';
1061- }, true);
1062-
1063- // Capture on window, so it runs before the soft navigation (capture on document) follows the
1064- // bell's link to the inbox, which would swap the page and close the popover it just opened.
1065- window.addEventListener('click', function (e) {
1066- if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) { return; }
1067- var bell = e.target && e.target.closest ? e.target.closest('.corner-bell') : null;
1068- if (!bell) { return; }
1069- var pop = bell.nextElementSibling;
1070- if (!pop || !pop.classList.contains('bell-pop')) { return; }
1071- // The mouse opened the popover by resting on the bell: this click goes to the inbox instead. The
1072- // press decides, as light dismiss has closed the popover by now.
1073- clearTimeout(hoverTimer);
1074- hoverTimer = 0;
1075- if (peekHover) { peekHover = false; hoverOn = null; peekPress = null; hoverMute = true; return; }
1076- e.preventDefault();
1077- // A keyboard click has no press: the popover's own state decides.
1078- var was = peekPress === null ? isPeekOpen(pop) : peekPress;
1079- peekPress = null;
1080- try {
1081- if (was) { pop.hidePopover(); } else { pop.showPopover(); }
1082- } catch (err) { }
1083- }, true);
1084-
1085- // The popover's open state drives its bell's aria-expanded; opening places it and fetches its list.
1086- document.addEventListener('toggle', function (e) {
1087- var pop = e.target;
1088- if (!pop || !pop.classList || !pop.classList.contains('bell-pop')) { return; }
1089- var bell = pop.previousElementSibling;
1090- var open = e.newState === 'open';
1091- if (bell && bell.classList.contains('corner-bell')) { bell.setAttribute('aria-expanded', open ? 'true' : 'false'); }
1092- if (open) {
1093- placePeek(bell, pop);
1094- loadPeek(pop);
1095- } else {
1096- pop.classList.remove('bell-ready');
1097- if (hoverOn === 'bell') {
1098- // Closed by Escape or a light dismiss: the mouse no longer holds it open.
1099- hoverOn = null;
1100- }
1101- }
1102- }, true);
1103-
1104- // A page swap re-renders the page and its corner; an open popover goes with the page it was opened on.
1105- document.addEventListener('forge:swapped', function () {
1106- document.querySelectorAll('.bell-pop').forEach(function (pop) {
1107- try { pop.hidePopover(); } catch (err) { }
1108- });
1109- });
1110- // A swap that took the mouse's popover or menu away leaves nothing for hover to close.
945+ // A swap that took the mouse's menu away leaves nothing for hover to close.
1111946 document.addEventListener('forge:swapped', function () {
1112- if (hoverOn && !hoverIsOpen(hoverOn)) { hoverOn = null; }
947+ if (hoverOn && !menuOpen()) { hoverOn = false; }
1113948 });
1114949
1115950 // Escape closes the open dropdowns and returns focus to the summary of the one that held it.
@@ -1979,7 +1814,7 @@
19791814 // looked up on each update. The count arrives as an `unread` event of the shell stream (see
19801815 // `/-/shell/events`, opened with the alive handlers above), which the server pushes on each change;
19811816 // 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.
19831818
19841819 // Shows the count in one link the way the server renders it: a span with the number, or no span at zero.
19851820 function setCount(el, cls, n) {
@@ -1996,10 +1831,22 @@
19961831 }
19971832 }
19981833
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+
19991845 function setUnread(n) {
2000- // The bell of the profile corner, `.bell-count` as the server renders it.
2001- var bells = document.querySelectorAll('.corner-bell');
2002- for (var i = 0; i < bells.length; i++) { setCount(bells[i], 'bell-count', n); }
1846+ // The notifications row of the profile corner, `.bell-count` as the server renders it.
1847+ var rows = document.querySelectorAll('.corner-bell');
1848+ for (var i = 0; i < rows.length; i++) { setCount(rows[i], 'bell-count', n); }
1849+ paintCorner();
20031850 }
20041851
20051852 // An `unread` event: the count, then the activity is fetched again.
@@ -2008,8 +1855,7 @@
20081855 refreshActivity();
20091856 }
20101857
2011- // The live activity: the profile corner (heat ring, chips) and the live strip after
2012- // the path bar. The server's activity JSON (GET /-/activity) is the source. An `activity` event of
1858+ // The live activity: the profile corner's dot and the live strip after the path bar. The server's activity JSON (GET /-/activity) is the source. An `activity` event of
20131859 // the shell stream, and every `unread` event, fetches it again and redraws whatever is on the page.
20141860 // Nothing changes before the JSON says so. A finished run leaves the strip when the server's window
20151861 // ends, so while any is listed the JSON is fetched again every 30 s.
@@ -2119,39 +1965,13 @@
21191965 });
21201966 }
21211967
2122- // The chips: one per non-zero count. The titles come from the chip box's templates, with `{n}`
2123- // standing for the count; the singular template is used for one.
2124- function drawChips(box, json) {
2125- // Each chip links to the newest thing it counts, or to the inbox when that is not listed.
2126- var newest = function (kind) {
2127- var item = (json.waiting || []).filter(function (w) { return w.kind === kind; })[0];
2128- return item ? item.href : '/notifications';
2129- };
2130- var chips = [
2131- { kind: 'review', cls: 'corner-link chip-review', n: json.reviews, tpl: 'data-review', href: newest('review') },
2132- { kind: 'mention', cls: 'corner-link chip-mention', n: json.mentions, tpl: 'data-mention', href: newest('mention') },
2133- { kind: 'failing', cls: 'corner-link chip-failing', n: json.failing, tpl: 'data-failing', href: json.failing_href || '/notifications' }
2134- ];
2135- box.textContent = '';
2136- chips.forEach(function (c) {
2137- var n = Number(c.n) || 0;
2138- if (n <= 0) { return; }
2139- var tpl = box.getAttribute(c.tpl + (n === 1 ? '-one' : '')) || '';
2140- var chip = document.createElement('a');
2141- chip.className = c.cls;
2142- chip.setAttribute('href', c.href);
2143- chip.textContent = tpl.split('{n}').join(String(n));
2144- box.appendChild(chip);
2145- });
2146- }
2147-
2148- // Redraws every strip and chip box on the page from one activity JSON. The
1968+ // Redraws every strip from one activity JSON, and the avatar's dot from its waiting counts. The
21491969 // elements are looked up here each time, since a swap may have replaced them.
21501970 function drawActivity(json) {
21511971 var strips = document.querySelectorAll('.live-strip[data-activity]');
21521972 for (var i = 0; i < strips.length; i++) { drawStrip(strips[i], json); }
2153- var boxes = document.querySelectorAll('.corner-chips');
2154- for (var b = 0; b < boxes.length; b++) { drawChips(boxes[b], json); }
1973+ waitingNow = (Number(json.reviews) || 0) + (Number(json.mentions) || 0) + (Number(json.failing) || 0) > 0;
1974+ paintCorner();
21551975 // Finished runs leave the strip when the server's window ends, so the JSON is asked for again.
21561976 clearTimeout(activityTimer);
21571977 activityTimer = null;
crates/forge-web/src/pages/admin_backups.rsmodified+107 -94
@@ -1,9 +1,13 @@
11 //! Page: backups (`/admin/backups`). Instance admins only; anyone else gets 404.
22 //!
3-//! Shows the `[backup]` settings (the healthcheck URL only as its host, since it may hold a token),
4-//! the last 20 backup and fsck runs, and two POST buttons that start a run in the background.
5-//! A button press is audited and redirects back here with a notice.
3+//! Shows the backup settings as a settings topic, saved here (`POST /admin/backups`, the same rows
4+//! and save as the server settings), then the last 20 backup and fsck runs, and two POST buttons
5+//! that start a run in the background. A button press is audited and redirects back here with a
6+//! notice. The rail beside the page holds Replication too.
67
8+use std::collections::HashMap;
9+
10+use forge_core::server_settings::Group;
711 use forge_core::store::backup_runs::{BackupRun, RunKind};
812 use forge_core::{AuditAction, Error, Store, User};
913 use serde::Deserialize;
@@ -19,13 +23,16 @@ use crate::audit::{self, Actor, Target};
1923 use crate::auth::check_csrf;
2024 use crate::backup::scheduler::{configured_dir, start_manual};
2125 use crate::i18n::admin::{self as g, K};
22-use crate::i18n::{self, Lang};
26+use crate::i18n::{self, Key, Lang};
2327 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+};
2431 use crate::pages::admin_users::admin_only;
2532 use crate::pages::issues_list::stamp_unix;
2633 use crate::state::AppState;
27-use crate::views::parts::{SubPart, head, post_act};
28-use crate::views::{enc, rel_time, shell};
34+use crate::views::parts::{RailItem, head, post_act, rail};
35+use crate::views::{alert, enc, rel_time, shell};
2936
3037 /// Runs shown on the page.
3138 const RUN_LIMIT: u32 = 20;
@@ -52,35 +59,6 @@ struct RunRow {
5259 detail: String,
5360 }
5461
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-
8462 /// `"512 B"`, `"12.3 KiB"`, `"4.0 MiB"` and so on.
8563 fn human_bytes(bytes: u64) -> String {
8664 const UNITS: [&str; 4] = ["KiB", "MiB", "GiB", "TiB"];
@@ -129,11 +107,34 @@ fn run_row(run: &BackupRun, lang: Lang) -> RunRow {
129107 }
130108 }
131109
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+
132132 #[component]
133133 async fn backups_view(
134134 lang: Lang,
135135 csrf: String,
136- settings: Settings,
136+ enabled: bool,
137+ settings: Vec<Row>,
137138 rows: Vec<RunRow>,
138139 running: Option<RunKind>,
139140 notice: Option<String>,
@@ -142,9 +143,8 @@ async fn backups_view(
142143 matches!(running, Some(RunKind::Backup)).then(|| g::running_line(lang, RunKind::Backup));
143144 let fsck_running =
144145 matches!(running, Some(RunKind::Fsck)).then(|| g::running_line(lang, RunKind::Fsck));
145- let sub = vec![SubPart::text(g::t(lang, K::BackupsIntro))];
146146 Ok(view! {
147- head(title: g::t(lang, K::Backups), sub: sub,
147+ head(title: g::t(lang, K::Backups),
148148 <form id="run-backup" method="post" action="/admin/backups/run" class="act-form">
149149 <input type="hidden" name="csrf" value=(csrf.as_str())>
150150 <button type="submit" class="button">(g::t(lang, K::RunBackupNow))</button>
@@ -154,64 +154,51 @@ async fn backups_view(
154154 if let Some(message) = notice {
155155 <p class="state" role="status">(message.as_str())</p>
156156 }
157- <div class="sheet" data-live="/admin/backups/events">
158- if let Some(line) = backup_running {
159- <p class="state">(line)</p>
160- }
161- if let Some(line) = fsck_running {
162- <p class="state">(line)</p>
163- }
164- <section class="sec">
165- if settings.enabled {
166- <h2>(crate::pages::passkeys::s(lang, "Configuration", "Yapılandırma"))</h2>
167- <div class="line" data-kb-row="">
168- <span class="name">(g::t(lang, K::Directory))</span>
169- <span class="val"><code>(settings.dir.as_str())</code></span>
170- </div>
171- <div class="line" data-kb-row="">
172- <span class="name">(g::t(lang, K::BackupInterval))</span>
173- <span class="val">(settings.interval.as_str())</span>
174- </div>
175- <div class="line" data-kb-row="">
176- <span class="name">(g::t(lang, K::Retention))</span>
177- <span class="val">(settings.keep.as_str())</span>
178- </div>
179- <div class="line" data-kb-row="">
180- <span class="name">(g::t(lang, K::Fsck))</span>
181- <span class="val">(settings.fsck_interval.as_str())</span>
182- </div>
183- <div class="line" data-kb-row="">
184- <span class="name">(g::t(lang, K::Healthcheck))</span>
185- <span class="val">(settings.healthcheck.as_str())</span>
186- </div>
187- } else {
188- <h2>(g::t(lang, K::Settings))</h2>
189- <p class="state">(g::t(lang, K::ScheduledBackupsOff))</p>
157+ <div class="work">
158+ backups_rail(lang: lang, current: "backups")
159+ <div class="sheet" data-live="/admin/backups/events">
160+ if let Some(line) = backup_running {
161+ <p class="state">(line)</p>
162+ }
163+ if let Some(line) = fsck_running {
164+ <p class="state">(line)</p>
190165 }
191- </section>
192- <section class="sec">
193- <h2>(g::t(lang, K::RecentRuns))</h2>
194- if rows.is_empty() {
195- <p class="state">(g::t(lang, K::NoRunsYet))</p>
196- <p class="hint">(g::t(lang, K::BackupsEmptyHint))</p>
197- } else {
198- for row in rows.into_iter() {
199- <div class="line" data-kb-row="">
200- <span class="name">(row.kind.as_str()) " · " (row.trigger.as_str())</span>
201- <span class="val">(row.status.as_str()) " · " rel_time(lang: lang, stamp: row.started.as_str())</span>
166+ <section class="sec">
167+ <h2>(g::t(lang, K::Settings))</h2>
168+ if !enabled {
169+ <p class="state">(g::t(lang, K::ScheduledBackupsOff))</p>
170+ }
171+ <form method="post" action="/admin/backups" class="srv-form">
172+ <input type="hidden" name="csrf" value=(csrf.as_str())>
173+ <input type="hidden" name="back" value="/admin/backups">
174+ setting_lines(lang: lang, rows: settings)
175+ <div class="acts srv-save">
176+ <button type="submit" class="primary">(i18n::t(lang, Key::Save))</button>
202177 </div>
203- <p class="hint">
204- (row.duration.as_str())
205- if !row.size.is_empty() {
206- " · " (row.size.as_str())
178+ </form>
179+ reset_form(csrf: csrf.clone(), back: "/admin/backups".to_owned())
180+ </section>
181+ <section class="sec">
182+ <h2>(g::t(lang, K::RecentRuns))</h2>
183+ if rows.is_empty() {
184+ <p class="state">(g::t(lang, K::NoRunsYet))</p>
185+ } else {
186+ for row in rows.into_iter() {
187+ <div class="line" data-kb-row="">
188+ <span class="name">(row.kind.as_str()) " · " (row.trigger.as_str())</span>
189+ <span class="val">(row.status.as_str()) " · " rel_time(lang: lang, stamp: row.started.as_str()) " · " (row.duration.as_str())
190+ if !row.size.is_empty() {
191+ " · " (row.size.as_str())
192+ }
193+ </span>
194+ </div>
195+ if !row.detail.is_empty() {
196+ alert(message: row.detail.as_str())
207197 }
208- </p>
209- if !row.detail.is_empty() {
210- <p class="hint bad">(row.detail.as_str())</p>
211198 }
212199 }
213- }
214- </section>
200+ </section>
201+ </div>
215202 </div>
216203 })
217204 }
@@ -251,14 +238,40 @@ async fn backups_page(cx: &Cx) -> Result<impl View> {
251238 let runs = state.store.recent_runs(RUN_LIMIT).await?;
252239 let rows: Vec<RunRow> = runs.iter().map(|run| run_row(run, lang)).collect();
253240 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();
255243 let csrf = viewer.1.csrf_token.clone();
256244 let title = g::t(lang, K::Backups);
257245 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()))
259247 })
260248 }
261249
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", &notice)).into())
273+}
274+
262275 #[route(POST "/admin/backups/run")]
263276 async fn backups_run(cx: &Cx, Form(form): Form<RunForm>) -> Result<Response> {
264277 start_run(cx, form.csrf, RunKind::Backup).await
@@ -535,7 +548,7 @@ mod tests {
535548 assert_eq!(status, 200);
536549 assert!(body.contains("schedule"));
537550 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");
539552 assert!(
540553 !body.contains("SECRET-TOKEN"),
541554 "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(
510510 class: "b health-sum ok",
511511 }
512512 };
513- let sub = vec![summary, SubPart::text(at(lang, A::HealthIntro))];
513+ let sub = vec![summary];
514514 Ok(view! {
515515 head(title: at(lang, A::Health), sub: sub, live: Some("/admin/health/events"))
516516 <div class="sheet health-sheet">
crates/forge-web/src/pages/admin_mail.rsmodified+43 -28
@@ -7,10 +7,12 @@
77 //! saved setting re-renders the tab through `/admin/mail/events` with no reload and no polling.
88 //! Saving the settings and queuing a test are audited.
99
10-use forge_core::config::MailTransport;
10+use std::collections::HashMap;
11+
1112 use forge_core::mail::{
1213 MailKind, MailSettings, MailSettingsUpdate, MailState, OutboxEntry, Security,
1314 };
15+use forge_core::server_settings::Group;
1416 use forge_core::time::now_stamp;
1517 use forge_core::{AuditAction, Error};
1618 use futures_util::{Stream, stream};
@@ -30,10 +32,13 @@ use crate::auth::check_csrf;
3032 use crate::i18n::admin::{self as g, K};
3133 use crate::i18n::{self, Key, Lang};
3234 use crate::mail::{enqueue, live, templates};
35+use crate::pages::admin_server::{
36+ MAIL_KEYS, Row, refusal, save_topic, setting_lines, setting_rows,
37+};
3338 use crate::pages::admin_users::admin_only;
3439 use crate::pages::ci_runs::{changed_event, events_response};
3540 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};
3742 use crate::views::{enc, rel_time, shell};
3843
3944 /// Rows shown in the queue at most.
@@ -93,7 +98,8 @@ struct PageData {
9398 from_name: String,
9499 enabled: bool,
95100 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>,
97103 tab: Tab,
98104 queue: Option<QueueData>,
99105 }
@@ -110,13 +116,6 @@ fn state_class(state: MailState) -> &'static str {
110116 }
111117 }
112118
113-fn transport_name(transport: MailTransport) -> &'static str {
114- match transport {
115- MailTransport::Smtp => "smtp",
116- MailTransport::Log => "log",
117- }
118-}
119-
120119 fn row_view(entry: &OutboxEntry, now: &str, lang: Lang) -> QueueRow {
121120 let state = entry.state_at(now);
122121 QueueRow {
@@ -182,6 +181,7 @@ async fn page_data(
182181 Tab::Queue => Some(queue_data(state, lang, filter).await?),
183182 Tab::Settings => None,
184183 };
184+ let transport = setting_rows(state, lang, MAIL_KEYS).await?;
185185 Ok(PageData {
186186 host: settings.host,
187187 port: settings.port.to_string(),
@@ -191,7 +191,7 @@ async fn page_data(
191191 from_name: settings.from_name,
192192 enabled: settings.enabled,
193193 has_password: settings.has_password,
194- transport: transport_name(state.config.mail.transport),
194+ transport,
195195 tab,
196196 queue,
197197 })
@@ -207,20 +207,14 @@ async fn mail_view(
207207 let starttls = data.security == Security::StartTls;
208208 let tls = data.security == Security::Tls;
209209 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- };
215210 let settings_on = data.tab == Tab::Settings;
216211 let filter_param = data
217212 .queue
218213 .as_ref()
219214 .map(|q| q.filter_param.clone())
220215 .unwrap_or_default();
221- let sub = vec![SubPart::text(g::t(lang, K::MailIntro))];
222216 Ok(view! {
223- head(title: g::t(lang, K::Mail), sub: sub)
217+ head(title: g::t(lang, K::Mail))
224218 if let Some(message) = notice {
225219 <p class="state" role="status">(message.as_str())</p>
226220 }
@@ -232,12 +226,14 @@ async fn mail_view(
232226 // Saved by any admin session: the stream re-renders the settings with the same signal
233227 // as the queue (the save bumps it too), and the form keeps what was typed.
234228 <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">
236230 <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>
237235 <section class="sec" id="smtp">
238236 <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>
241237 <div class="fields">
242238 <div class="field">
243239 <label for="mail-host">(g::t(lang, K::MailHost))</label>
@@ -262,8 +258,10 @@ async fn mail_view(
262258 <div class="field">
263259 <label for="mail-password">(i18n::t(lang, Key::Password))</label>
264260 <input id="mail-password" type="password" name="password" autocomplete="new-password" maxlength="1024">
265- <p class="hint">(password_hint)</p>
266261 </div>
262+ if !data.has_password {
263+ <p class="state">(g::t(lang, K::NoPasswordStored))</p>
264+ }
267265 </div>
268266 </section>
269267 <section class="sec">
@@ -299,7 +297,6 @@ async fn mail_view(
299297 <a class="act" href=(chip.href.as_str()) aria-current=(chip.current.then_some("page"))>(chip.label) " (" (chip.count) ")"</a>
300298 }
301299 </div>
302- <p class="hint">(g::t(lang, K::MailQueueIntro))</p>
303300 if queue.rows.is_empty() {
304301 if queue.filter_param.is_empty() {
305302 <p class="state">(g::t(lang, K::MailQueueEmpty))</p>
@@ -323,7 +320,7 @@ async fn mail_view(
323320 </span>
324321 if row.failed {
325322 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)
327324 }
328325 </div>
329326 }
@@ -376,6 +373,9 @@ async fn mail_events(cx: &Cx) -> Result<Response> {
376373 struct SettingsForm {
377374 #[serde(default)]
378375 csrf: String,
376+ /// The delivery setting, saved as an override like the server settings.
377+ #[serde(default, rename = "mail.transport")]
378+ transport: String,
379379 #[serde(default)]
380380 host: String,
381381 #[serde(default)]
@@ -402,10 +402,25 @@ async fn mail_save(cx: &Cx, Form(form): Form<SettingsForm>) -> Result<Response>
402402 }
403403 let lang = i18n::lang(cx, Some(&viewer.0));
404404 let state = app_context::<AppState>(cx);
405- let notice = match save_settings(cx, state, &viewer.0, &form, lang).await {
406- Ok(()) => g::t(lang, K::MailSettingsSaved).to_owned(),
407- Err(Error::Invalid(message)) => message,
408- Err(other) => other.to_string(),
405+ let saved = save_settings(cx, state, &viewer.0, &form, lang).await;
406+ let transport = if form.transport.is_empty() {
407+ Ok(None)
408+ } else {
409+ let posted = HashMap::from([("mail.transport".to_owned(), form.transport.clone())]);
410+ save_topic(
411+ cx,
412+ state,
413+ &viewer.0,
414+ Group::Integrations,
415+ MAIL_KEYS,
416+ posted,
417+ lang,
418+ )
419+ .await
420+ };
421+ let notice = match (saved, transport) {
422+ (Ok(()), Ok(_)) => g::t(lang, K::MailSettingsSaved).to_owned(),
423+ (Err(error), _) | (Ok(()), Err(error)) => refusal(error),
409424 };
410425 let location = format!("/admin/mail?notice={}", enc(&notice));
411426 Err(see_other(&location).into())
crates/forge-web/src/pages/admin_replication.rsmodified+84 -68
@@ -1,13 +1,16 @@
11 //! Page: standby replication (`/admin/replication`). Instance admins only; anyone else gets 404.
22 //!
3-//! Shows the `[replication]` target, the last database snapshot shipped, and one row per repo
4-//! with its health: ok, lagging (no success within twice the interval), error, or never replicated.
3+//! Shows the replication settings as a settings topic, saved here (`POST /admin/replication`, the
4+//! same rows and save as the server settings), the last database snapshot shipped, and one row per
5+//! repo with its health: ok, lagging (no success within twice the interval), error, or never
6+//! replicated. The rail beside the page holds Backups too.
57 //! "Reconcile now" queues a full pass for the worker. It is a POST with a CSRF token, and it is
68 //! audited as `replication_reconcile_started`.
79
810 use std::collections::HashMap;
911 use std::time::Duration;
1012
13+use forge_core::server_settings::Group;
1114 use forge_core::store::replication::{DB_SUBJECT, ReplicationStatus};
1215 use forge_core::time::stamp_ago;
1316 use forge_core::{AuditAction, Error};
@@ -23,16 +26,21 @@ use topcoat::view::{View, component, view};
2326 use crate::audit::{self, Actor, Target};
2427 use crate::auth::check_csrf;
2528 use crate::i18n::admin::{self as g, K};
26-use crate::i18n::{self, Lang};
29+use crate::i18n::{self, Key, Lang};
2730 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+};
2836 use crate::pages::admin_users::admin_only;
29-use crate::state::AppState;
3037 use crate::pages::issues_list::list_href;
3138 use crate::pages::passkeys::s;
39+use crate::state::AppState;
3240 use crate::views::find::{Finder, finder_field};
33-use crate::views::parts::{SubPart, head, post_act};
41+use crate::views::parts::{head, post_act};
3442 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};
3644
3745 #[query_params(error = bad_request)]
3846 pub(crate) struct NoticeQuery {
@@ -148,14 +156,11 @@ impl RepoRow {
148156 /// Everything the page shows, already formatted.
149157 struct PageData {
150158 enabled: bool,
151- target: String,
152159 db_dot: &'static str,
153160 db_health: &'static str,
154161 db_last_ok: Option<String>,
155162 db_last_attempt: Option<String>,
156163 db_error: String,
157- interval: String,
158- healthcheck: &'static str,
159164 repos: Vec<RepoRow>,
160165 }
161166
@@ -213,18 +218,11 @@ async fn page_data(state: &AppState, lang: Lang) -> forge_core::Result<PageData>
213218
214219 Ok(PageData {
215220 enabled: config.enabled(),
216- target: config.target.clone(),
217221 db_dot: health(db, &db_cutoff).dot(),
218222 db_health: health(db, &db_cutoff).label(lang),
219223 db_last_ok: db.and_then(|s| s.last_ok_at.clone()),
220224 db_last_attempt: db.and_then(|s| s.last_attempt_at.clone()),
221225 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- },
228226 repos,
229227 })
230228 }
@@ -234,6 +232,7 @@ async fn replication_view(
234232 lang: Lang,
235233 csrf: String,
236234 data: PageData,
235+ settings: Vec<Row>,
237236 notice: Option<String>,
238237 list: RepoList,
239238 ) -> Result<impl View> {
@@ -249,61 +248,56 @@ async fn replication_view(
249248 let all_label = s(lang, "All", "Tümü");
250249 let health_label = s(lang, "Health", "Durum");
251250 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);
253252 Ok(view! {
254- head(title: g::t(lang, K::Replication), sub: sub,
253+ head(title: g::t(lang, K::Replication),
255254 post_act(label: g::t(lang, K::ReconcileNow), action: "/admin/replication/reconcile", csrf: csrf.as_str())
256255 )
257256 if let Some(message) = notice {
258257 <p class="state" role="status">(message.as_str())</p>
259258 }
260- <div class="sheet" data-live="/admin/replication/events">
261- if data.enabled {
259+ <div class="work">
260+ backups_rail(lang: lang, current: "replication")
261+ <div class="sheet" data-live="/admin/replication/events">
262262 <section class="sec">
263- <h2>(crate::pages::passkeys::s(lang, "Target and schedule", "Hedef ve zamanlama"))</h2>
264- <div class="line" data-kb-row="">
265- <span class="name">(g::t(lang, K::ReplicationTarget))</span>
266- <span class="val"><code>(data.target.as_str())</code></span>
267- </div>
268- <div class="line" data-kb-row="">
269- <span class="name">(g::t(lang, K::Interval))</span>
270- <span class="val">(data.interval.as_str())</span>
271- </div>
272- <div class="line" data-kb-row="">
273- <span class="name">(g::t(lang, K::Healthcheck))</span>
274- <span class="val">(data.healthcheck)</span>
275- </div>
276- </section>
277- <section class="sec">
278- <h2>(crate::pages::passkeys::s(lang, "Status", "Durum"))</h2>
279- <div class="line" data-kb-row="">
280- <span class="name">(g::t(lang, K::Database))</span>
281- <span class="val"><span class=(data.db_dot) aria-hidden="true"></span> (data.db_health)</span>
282- </div>
283- if !data.db_error.is_empty() {
284- <p class="hint bad">(g::t(lang, K::DatabaseErrorPrefix))(data.db_error.as_str())</p>
263+ <h2>(g::t(lang, K::Settings))</h2>
264+ if !data.enabled {
265+ <p class="state">(g::t(lang, K::ReplicationOff))</p>
285266 }
286- <div class="line" data-kb-row="">
287- <span class="name">(g::t(lang, K::LastDbSnapshotShipped))</span>
288- <span class="val">rel_time_or_never(lang: lang, stamp: data.db_last_ok.as_deref())</span>
289- </div>
290- <div class="line" data-kb-row="">
291- <span class="name">(g::t(lang, K::LastDbAttempt))</span>
292- <span class="val">rel_time_or_never(lang: lang, stamp: data.db_last_attempt.as_deref())</span>
293- </div>
294- </section>
295- } else {
296- <section class="sec">
297- <h2>(g::t(lang, K::Replication))</h2>
298- <p class="state">(g::t(lang, K::ReplicationOff))</p>
267+ <form method="post" action="/admin/replication" class="srv-form">
268+ <input type="hidden" name="csrf" value=(csrf.as_str())>
269+ <input type="hidden" name="back" value="/admin/replication">
270+ setting_lines(lang: lang, rows: settings)
271+ <div class="acts srv-save">
272+ <button type="submit" class="primary">(i18n::t(lang, Key::Save))</button>
273+ </div>
274+ </form>
275+ reset_form(csrf: csrf.clone(), back: "/admin/replication".to_owned())
299276 </section>
300- }
277+ if data.enabled {
278+ <section class="sec">
279+ <h2>(crate::pages::passkeys::s(lang, "Status", "Durum"))</h2>
280+ <div class="line" data-kb-row="">
281+ <span class="name">(g::t(lang, K::Database))</span>
282+ <span class="val"><span class=(data.db_dot) aria-hidden="true"></span> (data.db_health)</span>
283+ </div>
284+ if !data.db_error.is_empty() {
285+ alert(message: db_error.as_str())
286+ }
287+ <div class="line" data-kb-row="">
288+ <span class="name">(g::t(lang, K::LastDbSnapshotShipped))</span>
289+ <span class="val">rel_time_or_never(lang: lang, stamp: data.db_last_ok.as_deref())</span>
290+ </div>
291+ <div class="line" data-kb-row="">
292+ <span class="name">(g::t(lang, K::LastDbAttempt))</span>
293+ <span class="val">rel_time_or_never(lang: lang, stamp: data.db_last_attempt.as_deref())</span>
294+ </div>
295+ </section>
296+ }
301297 <section class="sec">
302298 <h2>(g::t(lang, K::Repos))</h2>
303299 if !has_repos {
304300 <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>
307301 } else {
308302 <form class="sec-tools" method="get" action="/admin/replication" role="search">
309303 finder_field(lang: lang, finder: finder, placeholder: placeholder, id: Some("replication-q"))
@@ -328,12 +322,13 @@ async fn replication_view(
328322 <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>
329323 </div>
330324 if !row.error.is_empty() {
331- <p class="hint bad">(row.error.as_str())</p>
325+ alert(message: row.error.as_str())
332326 }
333327 }
334328 }
335329 </section>
336330 pager(page: page, pages: pages, links: links, prev: prev, next: next, lang: lang)
331+ </div>
337332 </div>
338333 })
339334 }
@@ -348,14 +343,8 @@ async fn page_fingerprint(state: &AppState) -> Result<String> {
348343 .map(|row| (&row.name, row.health, &row.last_ok, &row.error))
349344 .collect();
350345 Ok(format!(
351- "{}|{}|{:?}|{:?}|{}|{}|{:?}",
352- data.enabled,
353- data.db_health,
354- data.db_last_ok,
355- data.db_last_attempt,
356- data.db_error,
357- data.target,
358- rows
346+ "{}|{}|{:?}|{:?}|{}|{:?}",
347+ data.enabled, data.db_health, data.db_last_ok, data.db_last_attempt, data.db_error, rows
359348 ))
360349 }
361350
@@ -439,13 +428,39 @@ async fn replication_page(cx: &Cx) -> Result<impl View> {
439428 let state = app_context::<AppState>(cx);
440429 let mut data = page_data(state, lang).await?;
441430 let list = repo_list(&mut data, query);
431+ let settings = setting_rows(state, lang, REPLICATION_KEYS).await?;
442432 let csrf = viewer.1.csrf_token.clone();
443433 let title = g::t(lang, K::Replication);
444434 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))
446436 })
447437 }
448438
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", &notice)).into())
462+}
463+
449464 #[derive(Deserialize)]
450465 struct ReconcileForm {
451466 #[serde(default)]
@@ -531,6 +546,7 @@ mod tests {
531546 config.replication.target = TARGET.into();
532547 }
533548 state.config = std::sync::Arc::new(config);
549+ state.settings = crate::state::settings_for(&state.config);
534550 let admin = state
535551 .store
536552 .create_user("root", None, "h", true)
crates/forge-web/src/pages/admin_runners.rsmodified+56 -186
@@ -64,20 +64,20 @@ fn s(lang: Lang, en: &'static str, tr: &'static str) -> &'static str {
6464 const EXTRA_NOTICES: [(&str, &str, &str, bool); 8] = [
6565 (
6666 "saved",
67- "Saved. The runner picks it up on its next check-in.",
68- "Kaydedildi. Çalıştırıcı bir sonraki yoklamasında uygular.",
67+ "Saved.",
68+ "Kaydedildi.",
6969 false,
7070 ),
7171 (
7272 "saved-restart",
73- "Saved. It applies when the runner next starts.",
74- "Kaydedildi. Çalıştırıcı yeniden başlayınca uygulanır.",
73+ "Saved.",
74+ "Kaydedildi.",
7575 false,
7676 ),
7777 (
7878 "reset",
79- "Override removed. The runner.toml value is used again.",
80- "Üzerine yazma kaldırıldı. runner.toml değeri yeniden kullanılıyor.",
79+ "Override removed.",
80+ "Üzerine yazma kaldırıldı.",
8181 false,
8282 ),
8383 (
@@ -88,8 +88,8 @@ const EXTRA_NOTICES: [(&str, &str, &str, bool); 8] = [
8888 ),
8989 (
9090 "restart-requested",
91- "Restart requested. The runner restarts as soon as it sees the request.",
92- "Yeniden başlatma istendi. Çalıştırıcı isteği görür görmez yeniden başlar.",
91+ "Restart requested.",
92+ "Yeniden başlatma istendi.",
9393 false,
9494 ),
9595 (
@@ -329,7 +329,6 @@ async fn runners_view(
329329 pages: u64,
330330 nav: (Vec<PageLink>, Option<String>, Option<String>),
331331 notice: Option<(&'static str, bool)>,
332- note: String,
333332 ) -> Result<impl View> {
334333 let (links, prev, next) = nav;
335334 Ok(view! {
@@ -365,14 +364,12 @@ async fn runners_view(
365364 pager(page: page, pages: pages, links: links, prev: prev, next: next, lang: lang)
366365 }
367366 </section>
368- <section class="sec">
369- <h2>(g::t(lang, K::AddARunner))</h2>
370- <p class="hint">(note.as_str())</p>
371- if rows.is_empty() {
372- <p class="hint">(g::t(lang, K::RunnersEmptyHint))</p>
367+ if rows.is_empty() {
368+ <section class="sec">
369+ <h2>(g::t(lang, K::AddARunner))</h2>
373370 <pre><code>"forge runner register --url <forge-url> --token <token> --name <name> --labels linux,x86_64"</code></pre>
374- }
375- </section>
371+ </section>
372+ }
376373 </div>
377374 })
378375 }
@@ -407,7 +404,7 @@ pub(crate) async fn confirm_post(
407404 for (name, value) in fields.iter() {
408405 <input type="hidden" name=(*name) value=(value.as_str())>
409406 }
410- <p class="hint">(message)</p>
407+ <p class="state">(message)</p>
411408 <div class="acts">
412409 <button type="submit" class="small">(confirm)</button>
413410 <button type="button" class="act" data-close-details="">(s(lang, "Keep it", "Vazgeç"))</button>
@@ -419,20 +416,20 @@ pub(crate) async fn confirm_post(
419416
420417 fn delete_message(lang: Lang, name: &str) -> String {
421418 match lang {
422- Lang::Tr => format!("{name} silinsin mi? Makinenin sonrasında yeniden kaydolması gerekir."),
423- _ => format!("Delete runner {name}? The machine has to register again afterwards."),
419+ Lang::Tr => format!("{name} silinsin mi?"),
420+ _ => format!("Delete runner {name}?"),
424421 }
425422 }
426423
427424 fn disable_message(lang: Lang, name: &str) -> String {
428425 match lang {
429- Lang::Tr => format!("{name} devre dışı bırakılsın mı? Yeni iş almayı bırakır."),
430- _ => format!("Disable runner {name}? It stops taking new jobs."),
426+ Lang::Tr => format!("{name} devre dışı bırakılsın mı?"),
427+ _ => format!("Disable runner {name}?"),
431428 }
432429 }
433430
434431 /// 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
436433 /// pending the control shows that instead, and the runner clears it by coming back with a new id.
437434 #[component]
438435 async fn restart_control(
@@ -445,18 +442,16 @@ async fn restart_control(
445442 ) -> Result<impl View> {
446443 Ok(view! {
447444 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>
449446 } else if can_restart {
450447 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>
453448 <div class="acts">
454449 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)
456451 </div>
457452 )
458453 } 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>
460455 }
461456 })
462457 }
@@ -501,12 +496,10 @@ async fn token_view(
501496 lang: Lang,
502497 token: String,
503498 command: String,
504- expiry: String,
505499 ) -> Result<impl View> {
506500 Ok(view! {
507501 head(title: g::t(lang, K::RegistrationToken))
508502 <p class="state" role="status"><strong>(g::t(lang, K::CopyTokenNow))</strong></p>
509- <p class="hint">(expiry.as_str())</p>
510503 <div class="sheet">
511504 <div class="sheet-tools"><strong>(g::t(lang, K::Token))</strong> <a class="act" href="/admin/runners">(g::t(lang, K::BackToRunners))</a></div>
512505 <section class="sec" data-once="">
@@ -515,7 +508,6 @@ async fn token_view(
515508 <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>
516509 </div>
517510 <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>
519511 <div class="copy-box">
520512 <code id="reg-command">(command.as_str())</code>
521513 <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> {
560552 String::new()
561553 };
562554 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- );
567555 let title = g::t(lang, K::CiRunners);
568556 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))
570558 })
571559 }
572560
@@ -606,10 +594,9 @@ async fn runner_token_create(cx: &Cx, Form(form): Form<CsrfForm>) -> Result<impl
606594 )
607595 .await;
608596 let command = register_command(&state.config.base_url, &token);
609- let expiry = g::token_expiry_line(lang, &g::hours_text(lang, ttl_hours));
610597 let title = g::t(lang, K::RegistrationToken);
611598 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))
613600 })
614601 }
615602
@@ -816,143 +803,30 @@ fn tab_from_query(cx: &Cx) -> &'static str {
816803 tab_slug(wanted.as_deref())
817804 }
818805
819-/// The human label and the one-line hint of a config field.
820-fn field_text(lang: Lang, key: &str) -> (&'static str, &'static str) {
806+/// The human label of a config field.
807+fn field_text(lang: Lang, key: &str) -> &'static str {
821808 match key {
822- "concurrency" => (
823- s(lang, "Concurrency", "Eşzamanlılık"),
824- s(
825- lang,
826- "Jobs this runner runs at once, 1 to 64.",
827- "Bu çalıştırıcının aynı anda yürüttüğü iş sayısı, 1 ile 64 arası.",
828- ),
829- ),
830- "labels" => (
831- s(lang, "Labels", "Etiketler"),
832- s(
833- lang,
834- "Comma separated. A job runs where its labels are all present.",
835- "Virgülle ayrılır. İş, etiketlerinin hepsinin bulunduğu yerde çalışır.",
836- ),
837- ),
838- "executor" => (
839- s(lang, "Executor", "Yürütücü"),
840- s(
841- lang,
842- "How jobs run: builtin on the host, or podman in containers.",
843- "İşlerin nasıl çalışacağı: sunucuda yerleşik ya da podman kapsayıcılarında.",
844- ),
845- ),
846- "auto_update" => (
847- s(lang, "Auto update", "Otomatik güncelleme"),
848- s(
849- lang,
850- "Replace the runner when the forge offers a newer build.",
851- "Forge daha yeni bir sürüm sunduğunda çalıştırıcıyı güncelle.",
852- ),
853- ),
854- "limits.memory" => (
855- s(lang, "Memory limit", "Bellek sınırı"),
856- s(
857- lang,
858- "Per job, for example 2g or 512m.",
859- "İş başına, örneğin 2g veya 512m.",
860- ),
861- ),
862- "limits.reserve_memory" => (
863- s(lang, "Default reservation", "Varsayılan ayırma"),
864- s(
865- lang,
866- "Memory held for a job that declares no memory, for example 1g.",
867- "Bellek bildirmeyen bir iş için ayrılan bellek, örneğin 1g.",
868- ),
869- ),
870- "limits.memory_budget" => (
871- s(lang, "Memory budget", "Bellek bütçesi"),
872- s(
873- lang,
874- "All running jobs together may reserve this much: auto, or a size such as 6g.",
875- "Çalışan işlerin toplamda ayırabileceği bellek: auto veya 6g gibi bir boyut.",
876- ),
877- ),
878- "limits.cpus" => (
879- s(lang, "CPU limit", "CPU sınırı"),
880- s(
881- lang,
882- "Per job, for example 2 or 1.5.",
883- "İş başına, örneğin 2 veya 1.5.",
884- ),
885- ),
886- "limits.pids" => (
887- s(lang, "Process limit", "İşlem sınırı"),
888- s(
889- lang,
890- "Most processes one job may have running.",
891- "Bir işin aynı anda çalıştırabileceği en çok işlem.",
892- ),
893- ),
894- "work_dir" => (
895- s(lang, "Work directory", "Çalışma dizini"),
896- s(
897- lang,
898- "Where checkouts and job files live on the runner host.",
899- "Çıkışların ve iş dosyalarının çalıştırıcı sunucusundaki yeri.",
900- ),
901- ),
902- "limits.image_max_gb" => (
903- s(
904- lang,
905- "Image cache max (GB)",
906- "Kalıp önbelleği üst sınırı (GB)",
907- ),
908- s(
909- lang,
910- "Upper bound for stored container images.",
911- "Saklanan kapsayıcı kalıpları için üst sınır.",
912- ),
913- ),
914- "limits.job_disk_gb" => (
915- s(lang, "Disk per job (GB)", "İş başına disk (GB)"),
916- s(
917- lang,
918- "A job that fills more than this (workspace, /tmp and its writes over the image) is stopped. 0 means no cap.",
919- "Bundan fazlasını (çalışma alanı, /tmp ve kalıbın üstüne yazdıkları) dolduran iş durdurulur. 0 sınır yok demektir.",
920- ),
921- ),
922- "images.keep_days" => (
923- s(lang, "Keep images (days)", "Kalıpları sakla (gün)"),
924- s(
925- lang,
926- "Unused images older than this are removed.",
927- "Bundan eski ve kullanılmayan kalıplar silinir.",
928- ),
929- ),
930- "cache_max_gib" => (
931- s(
932- lang,
933- "Build cache max (GiB)",
934- "Derleme önbelleği üst sınırı (GiB)",
935- ),
936- s(
937- lang,
938- "Upper bound for the shared build cache.",
939- "Ortak derleme önbelleği için üst sınır.",
940- ),
941- ),
942- "sandbox.userns" => (
943- s(lang, "User namespaces", "Kullanıcı ad alanları"),
944- s(
945- lang,
946- "How the sandbox maps user ids: auto, single or subuid.",
947- "Kum havuzunun kullanıcı kimliklerini eşleme biçimi: auto, single veya subuid.",
948- ),
949- ),
950- "name" => (s(lang, "Name", "Ad"), ""),
951- "url" => (s(lang, "Forge URL", "Forge adresi"), ""),
952- "runner_id" => (s(lang, "Runner id", "Çalıştırıcı kimliği"), ""),
953- "runner_secret" => (s(lang, "Runner secret", "Çalıştırıcı sırrı"), ""),
954- "registry" => (s(lang, "Registry", "Kayıt sunucusu"), ""),
955- _ => ("", ""),
809+ "concurrency" => s(lang, "Concurrency", "Eşzamanlılık"),
810+ "labels" => s(lang, "Labels", "Etiketler"),
811+ "executor" => s(lang, "Executor", "Yürütücü"),
812+ "auto_update" => s(lang, "Auto update", "Otomatik güncelleme"),
813+ "limits.memory" => s(lang, "Memory limit", "Bellek sınırı"),
814+ "limits.reserve_memory" => s(lang, "Default reservation", "Varsayılan ayırma"),
815+ "limits.memory_budget" => s(lang, "Memory budget", "Bellek bütçesi"),
816+ "limits.cpus" => s(lang, "CPU limit", "CPU sınırı"),
817+ "limits.pids" => s(lang, "Process limit", "İşlem sınırı"),
818+ "work_dir" => s(lang, "Work directory", "Çalışma dizini"),
819+ "limits.image_max_gb" => s(lang, "Image cache max (GB)", "Kalıp önbelleği üst sınırı (GB)"),
820+ "limits.job_disk_gb" => s(lang, "Disk per job (GB)", "İş başına disk (GB)"),
821+ "images.keep_days" => s(lang, "Keep images (days)", "Kalıpları sakla (gün)"),
822+ "cache_max_gib" => s(lang, "Build cache max (GiB)", "Derleme önbelleği üst sınırı (GiB)"),
823+ "sandbox.userns" => s(lang, "User namespaces", "Kullanıcı ad alanları"),
824+ "name" => s(lang, "Name", "Ad"),
825+ "url" => s(lang, "Forge URL", "Forge adresi"),
826+ "runner_id" => s(lang, "Runner id", "Çalıştırıcı kimliği"),
827+ "runner_secret" => s(lang, "Runner secret", "Çalıştırıcı sırrı"),
828+ "registry" => s(lang, "Registry", "Kayıt sunucusu"),
829+ _ => "",
956830 }
957831 }
958832
@@ -972,7 +846,6 @@ type Choice = (&'static str, &'static str, bool);
972846 struct DetailField {
973847 key: &'static str,
974848 label: &'static str,
975- hint: &'static str,
976849 value: String,
977850 kind_label: &'static str,
978851 source_label: &'static str,
@@ -990,7 +863,7 @@ fn detail_fields(lang: Lang, tab: &str, fields: &[FieldRow]) -> Vec<DetailField>
990863 .into_iter()
991864 .filter_map(|key| fields.iter().find(|f| f.key == key))
992865 .map(|f| {
993- let (label, hint) = field_text(lang, f.key);
866+ let label = field_text(lang, f.key);
994867 let kind_label = if f.kind == FieldKind::Live {
995868 g::t(lang, K::SrvKindLive)
996869 } else {
@@ -1019,7 +892,6 @@ fn detail_fields(lang: Lang, tab: &str, fields: &[FieldRow]) -> Vec<DetailField>
1019892 DetailField {
1020893 key: f.key,
1021894 label,
1022- hint,
1023895 value: f.value.clone(),
1024896 kind_label,
1025897 source_label: source_text(lang, f.source),
@@ -1109,7 +981,7 @@ fn identity_rows(lang: Lang, fields: &[FieldRow]) -> Vec<(&'static str, String)>
1109981 } else {
1110982 f.value.clone()
1111983 };
1112- (field_text(lang, f.key).0, value)
984+ (field_text(lang, f.key), value)
1113985 })
1114986 .collect()
1115987 }
@@ -1606,7 +1478,7 @@ async fn runner_detail_view(
16061478 <div class="mx-head">
16071479 <h2 class="mx-caption">(c.caption.as_str())</h2>
16081480 if !fact.is_empty() {
1609- <p class="hint mx-facts">(fact.as_str())</p>
1481+ <p class="mx-facts">(fact.as_str())</p>
16101482 }
16111483 if !c.legend.is_empty() {
16121484 <ul class="mx-legend">
@@ -1654,7 +1526,7 @@ async fn runner_detail_view(
16541526 }
16551527 if metrics.empty {
16561528 <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>
16581530 </section>
16591531 } else {
16601532 <section class="sec">
@@ -1684,8 +1556,7 @@ async fn runner_detail_view(
16841556 for (label, value) in identity.iter() {
16851557 <div class="line"><span class="name">(*label)</span><span class="val"><code class="srv-fixed">(value.as_str())</code></span></div>
16861558 }
1687- <p class="hint">(g::t(lang, K::SrvKindReadOnly))</p>
1688- <p class="hint">(s(lang, "Set when the runner registered. These cannot be changed from the forge.", "Çalıştırıcı kaydolurken belirlenir. Forge üzerinden değiştirilemez."))</p>
1559+ <p class="state">(g::t(lang, K::SrvKindReadOnly))</p>
16891560 </section>
16901561 } else if editing {
16911562 <section class="sec">
@@ -1706,8 +1577,7 @@ async fn runner_detail_view(
17061577 } else {
17071578 <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">
17081579 }
1709- <p class="hint">(f.hint)</p>
1710- <p class="hint">(f.kind_label) " · " (f.source_label)
1580+ <p class="state">(f.kind_label) " · " (f.source_label)
17111581 if !f.pending_label.is_empty() {
17121582 " · " (f.pending_label)
17131583 }
@@ -1734,7 +1604,7 @@ async fn runner_detail_view(
17341604 }
17351605 <section class="sec">
17361606 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>
17381608 } else {
17391609 <pre id="runner-log" class="ci-log runner-log" role="log" aria-label=(s(lang, "Runner log", "Çalıştırıcı günlüğü"))>
17401610 for row in log.iter() {
@@ -1747,7 +1617,7 @@ async fn runner_detail_view(
17471617 <section class="sec">
17481618 <h2>(s(lang, "Running now", "Şu an çalışan"))</h2>
17491619 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>
17511621 }
17521622 for job in running_jobs.iter() {
17531623 <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(
17561626 <section class="sec">
17571627 <h2>(s(lang, "Recent", "Son"))</h2>
17581628 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>
17601630 }
17611631 <div class="runner-recent">
17621632 for job in recent_jobs.iter() {
crates/forge-web/src/pages/admin_server.rsmodified+333 -123
@@ -89,10 +89,9 @@ struct OptionRow {
8989 }
9090
9191 /// One field, already formatted for the template. A secret's value is never in here.
92-struct Row {
92+pub(crate) struct Row {
9393 key: &'static str,
9494 label: &'static str,
95- help: &'static str,
9695 kind_label: &'static str,
9796 /// What a line shows for the value: the text, the chosen option, On or Off, or the secret state.
9897 value_text: String,
@@ -130,77 +129,109 @@ impl SrvPage {
130129 }
131130 }
132131
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`).
134135 pub(crate) const PAGES: &[SrvPage] = &[
135136 SrvPage {
136137 slug: "general",
137138 group: Group::General,
138139 en: "General",
139140 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+ ],
141149 },
142150 SrvPage {
143151 slug: "addresses",
144152 group: Group::General,
145153 en: "Addresses",
146154 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+ ],
148166 },
149167 SrvPage {
150168 slug: "limits",
151169 group: Group::Limits,
152170 en: "CI",
153171 tr: "CI",
154- keys: &["ci.enabled", "ci.registration_token_hours", "ci.max_log_mb", "ci.max_artifact_mb", "ci.max_artifacts_per_job", "ci.max_job_artifacts_mb"],
155- },
156- SrvPage {
157- slug: "retention",
158- group: Group::Limits,
159- en: "Retention and uploads",
160- tr: "Saklama ve yüklemeler",
161- keys: &["ci.log_retention_days", "ci.artifact_retention_days", "ci.artifact_keep_runs", "ci.artifact_max_total_mb", "lfs.max_object_mb", "releases.max_asset_mb"],
172+ keys: &[
173+ "ci.enabled",
174+ "ci.registration_token_hours",
175+ "ci.max_log_mb",
176+ "ci.max_artifact_mb",
177+ "ci.max_artifacts_per_job",
178+ "ci.max_job_artifacts_mb",
179+ "ci.log_retention_days",
180+ "ci.artifact_retention_days",
181+ "ci.artifact_keep_runs",
182+ "ci.artifact_max_total_mb",
183+ "lfs.max_object_mb",
184+ "releases.max_asset_mb",
185+ ],
162186 },
163187 SrvPage {
164188 slug: "storage",
165189 group: Group::Storage,
166190 en: "Storage",
167191 tr: "Depolama",
168- keys: &["storage.backend", "storage.r2.account_id", "storage.r2.bucket", "storage.r2.jurisdiction", "storage.r2.prefix", "storage.r2.access_key_id", "storage.r2.secret_access_key_file"],
169- },
170- SrvPage {
171- slug: "s3",
172- group: Group::Storage,
173- en: "S3 storage",
174- tr: "S3 depolama",
175- keys: &["storage.s3.bucket", "storage.s3.region", "storage.s3.endpoint", "storage.s3.prefix", "storage.s3.access_key_id", "storage.s3.secret_access_key_file", "storage.s3.allow_http", "storage.s3.virtual_hosted_style"],
176- },
177- SrvPage {
178- slug: "backups",
179- group: Group::Backups,
180- en: "Backups",
181- tr: "Yedekler",
182- keys: &["backup.dir", "backup.interval_hours", "backup.keep", "backup.fsck_interval_days", "backup.healthcheck_url"],
183- },
184- SrvPage {
185- slug: "replication",
186- group: Group::Backups,
187- en: "Replication",
188- tr: "Çoğaltma",
189- keys: &["replication.target", "replication.ssh_port", "replication.identity_file", "replication.known_hosts_file", "replication.db_snapshot_minutes", "replication.reconcile_minutes", "replication.healthcheck_url"],
192+ keys: &[
193+ "storage.backend",
194+ "storage.r2.account_id",
195+ "storage.r2.bucket",
196+ "storage.r2.jurisdiction",
197+ "storage.r2.prefix",
198+ "storage.r2.access_key_id",
199+ "storage.r2.secret_access_key_file",
200+ "storage.s3.bucket",
201+ "storage.s3.region",
202+ "storage.s3.endpoint",
203+ "storage.s3.prefix",
204+ "storage.s3.access_key_id",
205+ "storage.s3.secret_access_key_file",
206+ "storage.s3.allow_http",
207+ "storage.s3.virtual_hosted_style",
208+ ],
190209 },
191210 SrvPage {
192211 slug: "integrations",
193212 group: Group::Integrations,
194213 en: "Integrations",
195214 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+ ],
197222 },
198223 SrvPage {
199224 slug: "self-update",
200225 group: Group::Integrations,
201226 en: "Self-update",
202227 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+ ],
204235 },
205236 SrvPage {
206237 slug: "alerts",
@@ -208,21 +239,125 @@ pub(crate) const PAGES: &[SrvPage] = &[
208239 en: "Alerts",
209240 tr: "Uyarılar",
210241 // 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+ ],
212255 },
213256 ];
214257
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`.
216282 pub(crate) fn page_by_slug(slug: &str) -> Option<&'static SrvPage> {
217283 PAGES.iter().find(|page| page.slug == slug)
218284 }
219285
220-/// The page that holds the setting `key`.
221-pub(crate) fn page_of(key: &str) -> &'static SrvPage {
222- PAGES
286+/// Where the old slugs of moved pages went: `retention`, `s3`, `backups` and `replication`. `None`
287+/// for every slug that still names a page.
288+fn moved_slug(slug: &str) -> Option<&'static str> {
289+ match slug {
290+ "retention" => Some("/admin/server?cat=limits"),
291+ "s3" => Some("/admin/server?cat=storage"),
292+ "backups" => Some("/admin/backups"),
293+ "replication" => Some("/admin/replication"),
294+ _ => None,
295+ }
296+}
297+
298+/// Where a setting's row lives: the page's name and the link to the row.
299+pub(crate) struct Home {
300+ /// The page's name, with the area it belongs to when that is not obvious ("Backups").
301+ pub(crate) label: String,
302+ /// True for a setting on the server settings page, so the area name is written before it.
303+ pub(crate) server: bool,
304+ pub(crate) href: String,
305+}
306+
307+/// The page that holds the setting `key`, and the link to its row.
308+pub(crate) fn page_of(lang: Lang, key: &str) -> Home {
309+ if BACKUP_KEYS.contains(&key) {
310+ return Home {
311+ label: g::t(lang, K::Backups).to_owned(),
312+ server: false,
313+ href: format!("/admin/backups#srv-{key}"),
314+ };
315+ }
316+ if REPLICATION_KEYS.contains(&key) {
317+ return Home {
318+ label: g::t(lang, K::Replication).to_owned(),
319+ server: false,
320+ href: format!("/admin/replication#srv-{key}"),
321+ };
322+ }
323+ if MAIL_KEYS.contains(&key) {
324+ return Home {
325+ label: g::t(lang, K::Mail).to_owned(),
326+ server: false,
327+ href: format!("/admin/mail#srv-{key}"),
328+ };
329+ }
330+ let page = PAGES
223331 .iter()
224332 .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()
226361 }
227362
228363 /// 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 {
290425 } else {
291426 view.value.clone()
292427 };
293- let (label, help) = match (lang, i18n::server_settings::field_tr(field.key)) {
294- (Lang::Tr, Some(tr)) => tr,
295- _ => (field.label, field.help),
428+ let label = match (lang, i18n::server_settings::field_tr(field.key)) {
429+ (Lang::Tr, Some((tr, _))) => tr,
430+ _ => field.label,
296431 };
297432 Row {
298433 key: field.key,
299434 label,
300- help,
301435 kind_label,
302436 value_text,
303437 value: view.value.clone(),
@@ -322,27 +456,128 @@ fn row(lang: Lang, view: &FieldView) -> Row {
322456 }
323457 }
324458
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.
326468 async fn rows_for(state: &AppState, lang: Lang, page: &SrvPage) -> forge_core::Result<Vec<Row>> {
327469 let overrides = state.store.server_overrides().await?;
328470 let views = state.settings.views(&overrides);
329- Ok(page
330- .keys
471+ Ok(rows_of(lang, &views, page.keys))
472+}
473+
474+/// The rows of a settings topic outside the server page (Backups, Replication, Mail), in `keys` order.
475+pub(crate) async fn setting_rows(
476+ state: &AppState,
477+ lang: Lang,
478+ keys: &[&str],
479+) -> forge_core::Result<Vec<Row>> {
480+ let overrides = state.store.server_overrides().await?;
481+ let views = state.settings.views(&overrides);
482+ Ok(rows_of(lang, &views, keys))
483+}
484+
485+/// Saves the posted values of one settings topic. `topic` is every key the topic can show; only
486+/// the ones it shows now (see `shown_keys`) are read, and an unchecked switch of those counts as
487+/// off. `Ok(None)` means nothing differed from what is in effect.
488+pub(crate) async fn save_topic(
489+ cx: &Cx,
490+ state: &AppState,
491+ user: &forge_core::User,
492+ group: Group,
493+ topic: &[&str],
494+ mut form: HashMap<String, String>,
495+ lang: Lang,
496+) -> forge_core::Result<Option<()>> {
497+ let existing = state.store.server_overrides().await?;
498+ let shown = shown_keys(topic, &state.settings.views(&existing));
499+ for field in ss::FIELDS
331500 .iter()
332- .filter_map(|key| views.iter().find(|view| view.field.key == *key))
333- .map(|view| row(lang, view))
334- .collect())
501+ .filter(|f| shown.contains(&f.key) && f.ty == Ty::Bool && f.kind != Kind::ReadOnly)
502+ {
503+ form.entry(field.key.to_owned())
504+ .or_insert_with(|| "false".to_owned());
505+ }
506+ let submitted: BTreeMap<String, String> = form
507+ .into_iter()
508+ .filter(|(key, _)| shown.contains(&key.as_str()))
509+ .collect();
510+ save(cx, state, user, group, &submitted, lang).await
335511 }
336512
337-/// The settings from every category whose key, label or help matches the search.
338-async fn search_hits(state: &AppState, lang: Lang, finder: &Finder) -> forge_core::Result<Vec<Row>> {
513+/// The notice a settings save shows: saved, nothing changed, or why it was refused.
514+pub(crate) fn notice_of(lang: Lang, result: forge_core::Result<Option<()>>) -> String {
515+ match result {
516+ Ok(Some(())) => g::t(lang, K::SrvSaved).to_owned(),
517+ Ok(None) => g::t(lang, K::SrvNothingChanged).to_owned(),
518+ Err(other) => refusal(other),
519+ }
520+}
521+
522+/// The words for an error a page shows: the message itself for a refusal the user can fix.
523+pub(crate) fn refusal(error: Error) -> String {
524+ match error {
525+ Error::Invalid(message) | Error::Config(message) => message,
526+ other => other.to_string(),
527+ }
528+}
529+
530+/// The page a settings form goes back to. Only a page of the admin area is taken; anything else
531+/// goes to the server settings.
532+pub(crate) fn back_to(raw: &str) -> &str {
533+ if raw.starts_with("/admin/") && !raw.contains("//") && !raw.contains('\\') {
534+ raw
535+ } else {
536+ "/admin/server"
537+ }
538+}
539+
540+/// `back` with a notice on its query string.
541+pub(crate) fn with_notice(back: &str, notice: &str) -> String {
542+ let sep = if back.contains('?') { '&' } else { '?' };
543+ format!("{back}{sep}notice={}", enc(notice))
544+}
545+
546+/// The hidden form that resets one setting: the rows' "Reset to file value" buttons post to it by
547+/// id. It goes outside the forms that save, since a form cannot hold another.
548+#[component]
549+pub(crate) async fn reset_form(csrf: String, back: String) -> Result<impl View> {
550+ Ok(view! {
551+ <form id="srv-reset" method="post" action="/admin/server/reset">
552+ <input type="hidden" name="csrf" value=(csrf.as_str())>
553+ <input type="hidden" name="back" value=(back.as_str())>
554+ </form>
555+ })
556+}
557+
558+/// The rows of a settings topic, one line each. The caller's form holds them.
559+#[component]
560+pub(crate) async fn setting_lines(lang: Lang, rows: Vec<Row>) -> Result<impl View> {
561+ Ok(view! {
562+ for r in rows.iter() {
563+ srv_row(lang: lang, row: r)
564+ }
565+ })
566+}
567+
568+/// The settings from every category whose key or label matches the search.
569+async fn search_hits(
570+ state: &AppState,
571+ lang: Lang,
572+ finder: &Finder,
573+) -> forge_core::Result<Vec<Row>> {
339574 let overrides = state.store.server_overrides().await?;
340575 Ok(state
341576 .settings
342577 .views(&overrides)
343578 .iter()
344579 .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]))
346581 .collect())
347582 }
348583
@@ -382,18 +617,11 @@ async fn srv_row(lang: Lang, row: &Row) -> Result<impl View> {
382617 })
383618 }
384619
385-/// What a setting says after its control, one sentence after another: its help, its kind, a
386-/// secret's rule and its override.
620+/// The facts after a setting's control: its kind, whether a restart is needed, and its override.
387621 #[component]
388622 async fn srv_hints(lang: Lang, row: &Row) -> Result<impl View> {
389623 Ok(view! {
390624 <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- }
397625 if !row.kind_label.is_empty() {
398626 <span class="hint">(row.kind_label)</span>
399627 }
@@ -446,27 +674,23 @@ async fn server_view(
446674 current: search.is_none() && item.slug == page.slug,
447675 })
448676 .collect();
449- let sub = vec![
450- SubPart::text(g::t(lang, K::ServerSettingsIntro)),
451- SubPart::mono(format!(
452- "{} {}",
453- s(lang, "Version", "Sürüm"),
454- forge_ci::build::display()
455- )),
456- ];
677+ let sub = vec![SubPart::mono(format!(
678+ "{} {}",
679+ s(lang, "Version", "Sürüm"),
680+ forge_ci::build::display()
681+ ))];
457682 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.");
459683 Ok(view! {
460684 head(title: g::t(lang, K::ServerSettings), sub: sub,
461685 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()))
463687 }
464688 )
465689 <div data-live=(live.as_str())>
466690 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>
468692 } 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>
470694 }
471695 if let Some(message) = notice {
472696 <p class="state" role="status">(message.as_str())</p>
@@ -485,9 +709,9 @@ async fn server_view(
485709 <p class="state">(s(lang, "No setting matches.", "Eşleşen ayar yok."))</p>
486710 }
487711 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)>
489713 <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>
491715 </a>
492716 }
493717 </section>
@@ -495,9 +719,7 @@ async fn server_view(
495719 <form method="post" action="/admin/server" class="srv-form">
496720 <input type="hidden" name="csrf" value=(csrf.as_str())>
497721 <input type="hidden" name="tab" value=(tab)>
498- for r in rows.iter() {
499- srv_row(lang: lang, row: r)
500- }
722+ setting_lines(lang: lang, rows: rows)
501723 if any_editable {
502724 <div class="acts srv-save">
503725 <button type="submit" class="primary">(i18n::t(lang, Key::Save))</button>
@@ -505,10 +727,7 @@ async fn server_view(
505727 }
506728 </form>
507729 }
508- <form id="srv-reset" method="post" action="/admin/server/reset">
509- <input type="hidden" name="csrf" value=(csrf.as_str())>
510- <input type="hidden" name="tab" value=(tab)>
511- </form>
730+ reset_form(csrf: csrf.clone(), back: format!("/admin/server?cat={tab}"))
512731 </div>
513732 </div>
514733 </div>
@@ -521,12 +740,11 @@ async fn server_page(cx: &Cx) -> Result<impl View> {
521740 let query = query_params::<ServerQuery>(cx)?;
522741 let state = app_context::<AppState>(cx);
523742 let lang = i18n::lang(cx, Some(&viewer.0));
524- let page = query
525- .cat
526- .as_deref()
527- .or(query.tab.as_deref())
528- .and_then(page_by_slug)
529- .unwrap_or(&PAGES[0]);
743+ let slug = query.cat.as_deref().or(query.tab.as_deref()).unwrap_or("");
744+ if let Some(to) = moved_slug(slug) {
745+ return Err(see_other(to).into());
746+ }
747+ let page = page_by_slug(slug).unwrap_or(&PAGES[0]);
530748 let finder = Finder::new(
531749 query.q.as_deref(),
532750 query.exact.as_deref(),
@@ -545,7 +763,7 @@ async fn server_page(cx: &Cx) -> Result<impl View> {
545763 }
546764
547765 #[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> {
549767 let viewer = admin_only(cx).await?;
550768 if !check_csrf(&viewer.1, form.get("csrf").map_or("", String::as_str)) {
551769 return Err(forbidden().into());
@@ -556,22 +774,10 @@ async fn server_save(cx: &Cx, Form(mut form): Form<HashMap<String, String>>) ->
556774 .get("tab")
557775 .and_then(|t| page_by_slug(t))
558776 .unwrap_or(&PAGES[0]);
559- let group = page.group;
560- // An unchecked box is absent from the post. Only the page's own switches were on the form.
561- for field in ss::FIELDS.iter().filter(|f| {
562- page.keys.contains(&f.key) && f.ty == Ty::Bool && f.kind != Kind::ReadOnly
563- }) {
564- form.entry(field.key.to_owned())
565- .or_insert_with(|| "false".to_owned());
566- }
567- let submitted: BTreeMap<String, String> = form.into_iter().collect();
568- let notice = match save(cx, state, &viewer.0, group, &submitted, lang).await {
569- Ok(Some(())) => g::t(lang, K::SrvSaved).to_owned(),
570- Ok(None) => g::t(lang, K::SrvNothingChanged).to_owned(),
571- Err(Error::Invalid(message)) => message,
572- Err(Error::Config(message)) => message,
573- Err(other) => other.to_string(),
574- };
777+ let notice = notice_of(
778+ lang,
779+ save_topic(cx, state, &viewer.0, page.group, page.keys, form, lang).await,
780+ );
575781 Err(see_other(format!(
576782 "/admin/server?cat={}&notice={}",
577783 page.slug,
@@ -690,9 +896,10 @@ struct ResetForm {
690896 #[serde(default)]
691897 csrf: String,
692898 #[serde(default)]
693- tab: String,
694- #[serde(default)]
695899 key: String,
900+ /// The page the reset came from: where the viewer goes back to.
901+ #[serde(default)]
902+ back: String,
696903 }
697904
698905 #[route(POST "/admin/server/reset")]
@@ -703,19 +910,13 @@ async fn server_reset(cx: &Cx, Form(form): Form<ResetForm>) -> Result<Response>
703910 }
704911 let lang = i18n::lang(cx, Some(&viewer.0));
705912 let state = app_context::<AppState>(cx);
706- let group = Group::parse(&form.tab).unwrap_or(Group::General);
707913 let notice = match reset(cx, state, &viewer.0, &form.key).await {
708914 Ok(()) => g::t(lang, K::SrvResetDone).to_owned(),
709915 Err(Error::Invalid(message)) => message,
710916 Err(Error::Config(message)) => message,
711917 Err(other) => other.to_string(),
712918 };
713- Err(see_other(format!(
714- "/admin/server?cat={}&notice={}",
715- group.slug(),
716- enc(&notice)
717- ))
718- .into())
919+ Err(see_other(with_notice(back_to(&form.back), &notice)).into())
719920 }
720921
721922 async fn reset(
@@ -845,6 +1046,15 @@ mod tests {
8451046 admin_get(fx, &location).await
8461047 }
8471048
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+
8481058 // Scenario: non-admins get 404 on every route, bad CSRF is refused and refused values are
8491059 // never stored. Nothing here saves, so the store stays pristine for the next scenarios.
8501060 #[tokio::test]
@@ -911,7 +1121,6 @@ mod tests {
9111121 ("limits", "ci.max_log_mb=0"),
9121122 ("limits", "ci.max_log_mb=lots"),
9131123 ("storage", "storage.backend=r2"),
914- ("backups", "backup.keep=0&backup.dir=%2Fvar%2Fbackups"),
9151124 ] {
9161125 let body = save(&fx, tab, fields).await;
9171126 assert!(!body.contains("Server settings saved."), "{fields}: {body}");
@@ -987,18 +1196,19 @@ mod tests {
9871196
9881197 // A secret is saved, never shown on any tab, and a blank post keeps it.
9891198 let secret = "https://hc.example/ping/TOPSECRET-TOKEN";
990- let body = save(
1199+ let body = save_topic_at(
9911200 &fx,
992- "backups",
1201+ "/admin/backups",
9931202 &format!("backup.healthcheck_url={}", enc(secret)),
9941203 )
9951204 .await;
9961205 assert!(body.contains("Server settings saved."), "{body}");
997- for tab in ["backups", "general", "limits", "storage", "integrations"] {
1206+ for tab in ["general", "limits", "storage", "integrations"] {
9981207 let page = admin_get(&fx, &format!("/admin/server?tab={tab}")).await;
9991208 assert!(!page.contains("TOPSECRET"), "tab {tab}");
10001209 }
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");
10021212 assert!(page.contains("set"));
10031213 assert_eq!(
10041214 fx.state
@@ -1010,7 +1220,7 @@ mod tests {
10101220 .map(String::as_str),
10111221 Some(secret)
10121222 );
1013- save(&fx, "backups", "backup.healthcheck_url=").await;
1223+ save_topic_at(&fx, "/admin/backups", "backup.healthcheck_url=").await;
10141224 assert!(
10151225 fx.state
10161226 .store
crates/forge-web/src/pages/admin_user_detail.rsmodified+4 -16
@@ -247,11 +247,6 @@ async fn detail_body(
247247 let profile = format!("/{}", enc(&target.username));
248248 let repos_href = format!("/{}?tab=repositories", enc(&target.username));
249249 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- );
255250 let passkeys_question = s(
256251 lang,
257252 "Remove every passkey of this user?",
@@ -383,11 +378,11 @@ async fn detail_body(
383378 post_act(label: at(lang, A::Unsuspend), action: unsuspend_action.as_str(), csrf: csrf)
384379 }
385380 if !suspended && !own {
386- <details class="reveal" id="suspend" title=(at(lang, A::SuspendHelp))>
381+ <details class="reveal" id="suspend">
387382 <summary class="act danger">(suspend_open.as_str())</summary>
388383 <form class="opened" method="post" action=(suspend_action.as_str())>
389384 <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)>
391386 <button type="submit" class="danger small">(suspend_title)</button>
392387 </form>
393388 </details>
@@ -416,16 +411,11 @@ async fn detail_body(
416411 <h2>(s(lang, "Recovery", "Kurtarma"))</h2>
417412 <div class="line">
418413 <span class="key">(s(lang, "Password", "Parola"))</span>
419- <span class="val">(at(lang, A::ResetHelp))</span>
420- confirm_act(lang: lang, label: at(lang, A::GenerateLink), action: reset_action.as_str(), csrf: csrf, note: Some(reset_note.to_owned()))
414+ confirm_act(lang: lang, label: at(lang, A::GenerateLink), action: reset_action.as_str(), csrf: csrf, note: None)
421415 </div>
422416 <div class="line">
423417 <span class="key">(at(lang, A::TwoFactor))</span>
424- <span class="val">(tfa)
425- if tfa_on {
426- " · " (at(lang, A::Disable2faHelp))
427- }
428- </span>
418+ <span class="val">(tfa)</span>
429419 if tfa_on {
430420 confirm_act(lang: lang, label: g::t(lang, K::Disable), action: tfa_action.as_str(), csrf: csrf)
431421 }
@@ -443,7 +433,6 @@ async fn detail_body(
443433 <h2>(i18n::t(lang, Key::DangerZone))</h2>
444434 <div class="line">
445435 <span class="key">(i18n::t(lang, Key::Delete))</span>
446- <span class="val">(at(lang, A::DeleteHelp))</span>
447436 <a class="act danger" href=(delete_href.as_str())>(i18n::t(lang, Key::Delete))</a>
448437 </div>
449438 </section>
@@ -537,7 +526,6 @@ async fn org_body(
537526 <h2>(i18n::t(lang, Key::DangerZone))</h2>
538527 <div class="line">
539528 <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>
541529 <a class="act danger" href=(delete_action.as_str())>(g::t(lang, K::DeleteOrgTitle))</a>
542530 </div>
543531 </section>
crates/forge-web/src/pages/admin_users.rsmodified+70 -46
@@ -20,11 +20,11 @@ use crate::i18n::admin::{self as g, K};
2020 use crate::i18n::orgs::{self as og, K as OG};
2121 use crate::i18n::{self, Key, Lang};
2222 use crate::live::{Topic, stream_changes};
23+use crate::pages::issues_list::list_href;
2324 use crate::pages::passkeys::s;
2425 use crate::state::AppState;
25-use crate::views::parts::{head, reveal};
26-use crate::pages::issues_list::list_href;
2726 use crate::views::find::{Finder, finder_field};
27+use crate::views::parts::{RailItem, head, rail, reveal};
2828 use crate::views::repo_list::{pager, pager_links};
2929 use crate::views::{alert, enc, rel_time, shell, user_facing_message};
3030
@@ -198,17 +198,17 @@ async fn users_view(
198198 let open = error.is_some();
199199 // The field says what the current tab lists.
200200 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+ ),
202206 Kind::People => s(lang, "Search users", "Kullanıcılarda ara"),
203207 Kind::Organizations => s(lang, "Search organizations", "Kuruluşlarda ara"),
204208 };
205209 let filter_label = s(lang, "Filter", "Filtre");
206210 let all_label = format!("{} {}", s(lang, "All", "Tümü"), all_count);
207- let people_label = format!(
208- "{} {}",
209- s(lang, "People", "Kişiler"),
210- all_count - org_count
211- );
211+ let people_label = format!("{} {}", s(lang, "People", "Kişiler"), all_count - org_count);
212212 let orgs_label = format!("{} {}", og::t(lang, OG::Organizations), org_count);
213213 let all_href = users_href(&finder, Kind::All, 1);
214214 let people_href = users_href(&finder, Kind::People, 1);
@@ -232,7 +232,6 @@ async fn users_view(
232232 <div class="field">
233233 <label for="new-password">(i18n::t(lang, Key::Password))</label>
234234 <input id="new-password" type="password" name="password" required=(true) autocomplete="new-password">
235- <p class="hint">(g::t(lang, K::AtLeast12Chars))</p>
236235 </div>
237236 <label class="switch">
238237 <input type="checkbox" name="is_admin" value="yes">
@@ -247,44 +246,69 @@ async fn users_view(
247246 <a href=(people_href.as_str()) aria-current=((kind == Kind::People).then_some("page"))>(people_label.as_str())</a>
248247 <a href=(orgs_href.as_str()) aria-current=((kind == Kind::Organizations).then_some("page"))>(orgs_label.as_str())</a>
249248 </nav>
250- <div class="sheet" data-live="/admin/users/events">
251- <div class="sheet-tools">
252- <form method="get" action="/admin/users" role="search">
253- finder_field(lang: lang, finder: finder.clone(), placeholder: search_label, id: Some("user-search"))
254- <input type="hidden" name="kind" value=(kind.key())>
255- </form>
256- </div>
257- if empty {
258- <p class="state">(s(lang, "No account matches.", "Eşleşen hesap yok."))</p>
259- }
260- for row in rows.into_iter() {
261- if row.linkable {
262- <a class="line" href=(row.href.as_str()) data-kb-row="">
263- <span class="name">(row.username.as_str())</span>
264- <span class="val">
265- if !row.email.is_empty() {
266- (row.email.as_str()) " · "
267- }
268- (row.role.as_str()) " · " rel_time(lang: lang, stamp: row.created_at.as_str())
269- </span>
270- </a>
271- } else {
272- <div class="line" data-kb-row="">
273- <span class="name">(row.username.as_str())</span>
274- <span class="val">
275- if !row.email.is_empty() {
276- (row.email.as_str()) " · "
277- }
278- (row.role.as_str()) " · " rel_time(lang: lang, stamp: row.created_at.as_str())
279- </span>
280- </div>
249+ <div class="work">
250+ users_rail(lang: lang, current: "users")
251+ <div class="sheet" data-live="/admin/users/events">
252+ <div class="sheet-tools">
253+ <form method="get" action="/admin/users" role="search">
254+ finder_field(lang: lang, finder: finder.clone(), placeholder: search_label, id: Some("user-search"))
255+ <input type="hidden" name="kind" value=(kind.key())>
256+ </form>
257+ </div>
258+ if empty {
259+ <p class="state">(s(lang, "No account matches.", "Eşleşen hesap yok."))</p>
281260 }
282- }
283- pager(page: page, pages: pages, links: links, prev: prev, next: next, lang: lang)
261+ for row in rows.into_iter() {
262+ if row.linkable {
263+ <a class="line" href=(row.href.as_str()) data-kb-row="">
264+ <span class="name">(row.username.as_str())</span>
265+ <span class="val">
266+ if !row.email.is_empty() {
267+ (row.email.as_str()) " · "
268+ }
269+ (row.role.as_str()) " · " rel_time(lang: lang, stamp: row.created_at.as_str())
270+ </span>
271+ </a>
272+ } else {
273+ <div class="line" data-kb-row="">
274+ <span class="name">(row.username.as_str())</span>
275+ <span class="val">
276+ if !row.email.is_empty() {
277+ (row.email.as_str()) " · "
278+ }
279+ (row.role.as_str()) " · " rel_time(lang: lang, stamp: row.created_at.as_str())
280+ </span>
281+ </div>
282+ }
283+ }
284+ pager(page: page, pages: pages, links: links, prev: prev, next: next, lang: lang)
285+ </div>
284286 </div>
285287 })
286288 }
287289
290+/// The rail of the Users tab: Users and Invites. `current` is `users` or `invites`.
291+#[component]
292+pub(crate) async fn users_rail(lang: Lang, current: &'static str) -> Result<impl View> {
293+ let items = vec![
294+ RailItem {
295+ name: g::t(lang, K::Users).to_owned(),
296+ val: String::new(),
297+ href: "/admin/users".to_owned(),
298+ current: current == "users",
299+ },
300+ RailItem {
301+ name: g::t(lang, K::Invites).to_owned(),
302+ val: String::new(),
303+ href: "/admin/invites".to_owned(),
304+ current: current == "invites",
305+ },
306+ ];
307+ Ok(view! {
308+ rail(label: g::t(lang, K::Users), items: items)
309+ })
310+}
311+
288312 /// What the account list shows, as one string: a change to any of it is sent to the page.
289313 async fn list_fingerprint(store: &Store) -> topcoat::Result<String> {
290314 let users = store.list_users().await?;
@@ -489,7 +513,7 @@ async fn delete_body(
489513 <p class="state">(g::t(lang, K::DeletesAccount))<strong>(target.username.as_str())</strong>(g::t(lang, K::DeleteAccountRest))</p>
490514 if has_repos {
491515 <section class="sec">
492- <p class="hint">(g::t(lang, K::TransferOrDeleteFirst))</p>
516+ <p class="state">(g::t(lang, K::TransferOrDeleteFirst))</p>
493517 <ul class="item-list">
494518 for name in repos.into_iter() {
495519 <li>(name)</li>
@@ -500,13 +524,13 @@ async fn delete_body(
500524 if let Some(impact) = impact {
501525 <section class="sec">
502526 <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>
504528 <ul class="item-list">
505529 for line in impact.moved.into_iter() {
506530 <li>(line)</li>
507531 }
508532 </ul>
509- <p class="hint">(g::t(lang, K::RemovedWithAccount))</p>
533+ <p class="state">(g::t(lang, K::RemovedWithAccount))</p>
510534 <ul class="item-list">
511535 for line in impact.removed.into_iter() {
512536 <li>(line)</li>
@@ -553,7 +577,7 @@ async fn org_delete_note(
553577 <p class="state"><strong>(target.username.as_str())</strong>(g::t(lang, K::OrgNotAUser))</p>
554578 if has_repos {
555579 <section class="sec">
556- <p class="hint">(g::t(lang, K::OrgReposFirst))</p>
580+ <p class="state">(g::t(lang, K::OrgReposFirst))</p>
557581 <ul class="item-list">
558582 for name in repos.into_iter() {
559583 <li>(name)</li>
crates/forge-web/src/pages/audit_log.rsmodified+9 -15
@@ -19,10 +19,10 @@ use crate::live::{Topic, stream_changes};
1919 use crate::pages::admin_users::admin_only;
2020 use crate::pages::issues_list::list_href;
2121 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;
2323 use crate::state::AppState;
2424 use crate::views::find::{Finder, finder_field};
25-use crate::views::parts::{RailItem, SubPart, head, rail};
25+use crate::views::parts::{RailItem, head, rail};
2626 use crate::views::repo_list::{PageLink, pager, pager_links};
2727 use crate::views::{rel_time, shell};
2828
@@ -497,12 +497,11 @@ async fn audit_table(lang: Lang, groups: Vec<Group>, show_actor: bool) -> Result
497497 #[component]
498498 async fn single_row(lang: Lang, mut group: Group, show_actor: bool) -> Result<impl View> {
499499 let row = group.rows.remove(0);
500- let title = row.details.clone();
501500 let name = row.name.clone();
502501 let action = row.action.clone();
503502 Ok(view! {
504- <div class="line" data-kb-row="" title=(title.as_str())>
505- <span class="name" title=(action.as_str())>(name.as_str())</span>
503+ <div class="line" data-kb-row="" data-action=(action.as_str())>
504+ <span class="name">(name.as_str())</span>
506505 <span class="val">entry_facts(lang: lang, row: row, show_actor: show_actor, show_target: true, show_ip: true, show_details: true)</span>
507506 </div>
508507 })
@@ -538,8 +537,8 @@ async fn group_row(lang: Lang, mut group: Group, show_actor: bool) -> Result<imp
538537 let rows = std::mem::take(&mut group.rows);
539538 Ok(view! {
540539 <details class="log-group">
541- <summary class="line" data-kb-row="">
542- <span class="name" title=(action.as_str())>(name.as_str())</span>
540+ <summary class="line" data-kb-row="" data-action=(action.as_str())>
541+ <span class="name">(name.as_str())</span>
543542 <span class="count">"×" (count.as_str())</span>
544543 <span class="val">
545544 rel_time(lang: lang, stamp: when.as_str())
@@ -575,9 +574,8 @@ async fn item_line(
575574 show_ip: bool,
576575 show_details: bool,
577576 ) -> Result<impl View> {
578- let title = row.details.clone();
579577 Ok(view! {
580- <div class="line" title=(title.as_str())>
578+ <div class="line">
581579 <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>
582580 </div>
583581 })
@@ -599,9 +597,8 @@ async fn admin_audit_view(
599597 nav: (Vec<PageLink>, Option<String>, Option<String>),
600598 ) -> Result<impl View> {
601599 let (links, prev, next) = nav;
602- let sub = vec![SubPart::text(g::t(lang, K::AuditIntro))];
603600 Ok(view! {
604- head(title: g::t(lang, K::AuditLog), sub: sub)
601+ head(title: g::t(lang, K::AuditLog))
605602 <div class="sheet" data-live=(live.as_str())>
606603 log_tools(lang: lang, form_action: "/admin/audit", finder: finder, action: action, actor: actor, span: span, total: total)
607604 if let Some(message) = notice {
@@ -627,9 +624,8 @@ async fn own_log_view(
627624 nav: (Vec<PageLink>, Option<String>, Option<String>),
628625 ) -> Result<impl View> {
629626 let (links, prev, next) = nav;
630- let sub = vec![SubPart::text(security_sub(lang))];
631627 Ok(view! {
632- head(title: i18n::t(lang, i18n::Key::Security), sub: sub)
628+ head(title: i18n::t(lang, i18n::Key::Security))
633629 <div class="work">
634630 rail(label: i18n::t(lang, i18n::Key::Security), items: items)
635631 <div class="sheet">
@@ -923,8 +919,6 @@ mod tests {
923919 )
924920 .await;
925921 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);
928922 assert!(body.contains("password_reset_by_admin"));
929923
930924 // 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> {
117117 <span class="blame-author">(meta.author.as_str())</span>
118118 <time class="hint" data-rel="true" datetime=(meta.iso.as_str())>(meta.age.as_str())</time>
119119 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>
121121 }
122122 </div>
123123 <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> {
354354 <a class="act" href=(raw.clone())>(g::t(lang, K::RawLink))</a>
355355 <a class="act" href=(download_href) download=(download_name)>(g::t(lang, K::DownloadLink))</a>
356356 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=""
358358 data-copied=(b::t(lang, b::K::PermalinkCopied))>(b::t(lang, b::K::CopyPermalink))</button>
359359 }
360360 </div>
crates/forge-web/src/pages/branches.rsmodified+1 -1
@@ -119,7 +119,7 @@ async fn new_branch_form(
119119 <div class="field">
120120 <label for="branch-from">(b::t(lang, b::K::BranchFromLabel))</label>
121121 <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">
123123 </div>
124124 <datalist id="branch-sources">
125125 for option in options.iter() {
crates/forge-web/src/pages/ci_job.rsmodified+4 -5
@@ -479,11 +479,11 @@ async fn job_body(
479479 <strong>(g::t(lang, K::Log))</strong>
480480 <div class="ci-tl-tools">
481481 <input type="search" class="ci-logsearch" data-log-q="true" placeholder=(g::t(lang, K::LogSearch)) aria-label=(g::t(lang, K::LogSearch)) autocomplete="off" spellcheck="false">
482- <label class="find-opt" title=(crate::pages::passkeys::s(lang, "Only the text as typed, as one piece", "Yalnızca yazılan metin, tek parça olarak"))><input type="checkbox" data-log-exact="true"><span>(crate::pages::passkeys::s(lang, "Exact", "Tam"))</span></label>
483- <label class="find-opt" title=(crate::pages::passkeys::s(lang, "Keep upper and lower case apart", "Büyük ve küçük harfi ayırt et"))><input type="checkbox" data-log-case="true"><span>"Aa"</span></label>
482+ <label class="find-opt"><input type="checkbox" data-log-exact="true"><span>(crate::pages::passkeys::s(lang, "Exact", "Tam"))</span></label>
483+ <label class="find-opt"><input type="checkbox" data-log-case="true"><span>"Aa"</span></label>
484484 <span class="ci-logcount" data-log-count="true" data-none=(g::t(lang, K::LogNoMatches)) aria-live="polite"></span>
485- <button type="button" class="act" data-log-prev="true" aria-label=(g::t(lang, K::LogPrev)) title=(g::t(lang, K::LogPrev))>"\u{2191}"</button>
486- <button type="button" class="act" data-log-next="true" aria-label=(g::t(lang, K::LogNext)) title=(g::t(lang, K::LogNext))>"\u{2193}"</button>
485+ <button type="button" class="act" data-log-prev="true" aria-label=(g::t(lang, K::LogPrev))>"\u{2191}"</button>
486+ <button type="button" class="act" data-log-next="true" aria-label=(g::t(lang, K::LogNext))>"\u{2193}"</button>
487487 <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>
488488 <a class="act" href=(job.log_href.as_str())>(g::t(lang, K::FullLog))</a>
489489 <span class="ci-logfold" data-log-fold-box="true" hidden="hidden">
@@ -511,7 +511,6 @@ async fn job_body(
511511 </div>
512512 }
513513 <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>
515514 <div class="dock-history">
516515 history_strip(lang: lang, owner: owner, repo: repo, bars: bars)
517516 </div>
crates/forge-web/src/pages/ci_runs.rsmodified+39 -41
@@ -422,12 +422,11 @@ struct BadgeInfo {
422422 snippet: String,
423423 }
424424
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.
426426 struct ListView {
427427 manual: Option<ManualRun>,
428428 badge: BadgeInfo,
429429 total: u64,
430- scale: String,
431430 rows: Vec<RunRow>,
432431 newer_href: Option<String>,
433432 older_href: Option<String>,
@@ -1848,7 +1847,6 @@ async fn runs_split(
18481847 manual,
18491848 badge: badge_info(state, &title, &ctx.repo.default_branch),
18501849 total,
1851- scale: g::scale_label(lang, &span_text(scale)),
18521850 rows,
18531851 newer_href,
18541852 older_href,
@@ -2184,16 +2182,14 @@ fn query_value(cx: &Cx, key: &str) -> Option<String> {
21842182 .map(|(_, value)| value.into_owned())
21852183 }
21862184
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.
21882186 #[component]
21892187 async fn ci_menus(lang: Lang, list: &ListView) -> Result<impl View> {
2190- let badge = &list.badge;
21912188 Ok(view! {
21922189 if let Some(form) = list.manual.as_ref() {
21932190 <details class="menu ci-tool">
2194- <summary>(g::t(lang, K::RunWorkflow))</summary>
2191+ <summary class="button primary">(g::t(lang, K::RunWorkflow))</summary>
21952192 <div class="menu-list ci-pop">
2196- <p class="muted small">(g::t(lang, K::RunWorkflowHelp))</p>
21972193 <form method="post" action=(form.action.as_str()) class="ci-manual-form">
21982194 <input type="hidden" name="csrf" value=(form.csrf.as_str())>
21992195 <label>
@@ -2209,17 +2205,6 @@ async fn ci_menus(lang: Lang, list: &ListView) -> Result<impl View> {
22092205 </div>
22102206 </details>
22112207 }
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>
22232208 })
22242209 }
22252210
@@ -2228,8 +2213,8 @@ async fn ci_menus(lang: Lang, list: &ListView) -> Result<impl View> {
22282213 #[component]
22292214 async fn runs_sheet(lang: Lang, list: &ListView) -> Result<impl View> {
22302215 let ListView {
2216+ badge,
22312217 total,
2232- scale,
22332218 rows,
22342219 newer_href,
22352220 older_href,
@@ -2242,13 +2227,22 @@ async fn runs_sheet(lang: Lang, list: &ListView) -> Result<impl View> {
22422227 <div class="sheet-tools">
22432228 <strong>(g::t(lang, K::Runs))</strong>
22442229 <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>
22462240 </div>
22472241 if let Some(next) = next_scheduled.as_ref() {
22482242 <p class="ci-next hint">(g::t(lang, K::NextScheduledRun)) ": " rel_time(lang: lang, stamp: next.as_str())</p>
22492243 }
22502244 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))
22522246 } else {
22532247 <div class="ci-run-list">
22542248 for row in rows.iter() {
@@ -2263,9 +2257,17 @@ async fn runs_sheet(lang: Lang, list: &ListView) -> Result<impl View> {
22632257 </svg>
22642258 if let Some(est) = row.est.as_ref() {
22652259 <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>
22672265 } 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>
22692271 }
22702272 </a>
22712273 if let Some((action, token)) = row.rerun.as_ref() {
@@ -2293,8 +2295,7 @@ async fn runs_sheet(lang: Lang, list: &ListView) -> Result<impl View> {
22932295 })
22942296 }
22952297
2296-/// The runs page body: the repo head with the Run workflow and badge menus beside its title, then the
2297-/// runs sheet. The live region is the list's stream, so the list re-renders when a run changes.
2298+/// The runs page body: the repo head with its Run workflow menu beside its title, then the runs sheet. The live region is the list's stream, so the list re-renders when a run changes.
22982299 #[component]
22992300 async fn runs_body(
23002301 head: RepoHead,
@@ -2447,12 +2448,13 @@ async fn run_head(lang: Lang, run: &RunDetail, all_href: Option<String>) -> Resu
24472448 if run.can_cancel && run.stopping {
24482449 <button type="button" class="ci-stopping" disabled="disabled">(g::t(lang, K::StoppingButton))</button>
24492450 } 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![])
24512452 }
24522453 if rerun_failed_shown {
24532454 action_button(action: format!("{}/rerun-failed", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::RerunFailed), primary: true)
24542455 }
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 {
24562458 action_button(action: format!("{}/rerun", run.action_base), csrf: csrf.clone(), label: g::t(lang, K::Rerun), primary: !rerun_failed_shown)
24572459 }
24582460 }
@@ -2460,12 +2462,12 @@ async fn run_head(lang: Lang, run: &RunDetail, all_href: Option<String>) -> Resu
24602462 <p class="head-sub">
24612463 <span class="b" data-run=(run.number) title=(run.title.as_str())>(run.title.as_str())</span>
24622464 <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>
24642466 <span class="sep" aria-hidden="true">"·"</span>
24652467 if let Some(href) = run.commit_href.as_ref() {
24662468 <a class="mono" href=(href.as_str())>(run.commit.as_str())</a>
24672469 } 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>
24692471 }
24702472 if !run.actor.is_empty() {
24712473 <span class="sep" aria-hidden="true">"·"</span>
@@ -2574,12 +2576,7 @@ async fn run_artifacts(lang: Lang, run: &RunDetail) -> Result<impl View> {
25742576 Ok(view! {
25752577 if !run.artifacts.is_empty() {
25762578 <div class="sec">
2577- <div class="acts">
2578- <h2>(g::t(lang, K::Artifacts))</h2>
2579- if let Some(href) = run.zip_href.as_ref() {
2580- <a class="act" href=(href.as_str()) download="">(g::t(lang, K::DownloadAll))</a>
2581- }
2582- </div>
2579+ <h2>(g::t(lang, K::Artifacts))</h2>
25832580 for artifact in run.artifacts.iter() {
25842581 <div class="line">
25852582 <span class="name">(artifact.name.as_str())</span>
@@ -2623,13 +2620,16 @@ async fn run_log(
26232620 if let Some(log) = run.log.as_ref() {
26242621 <div class="ci-tl-tools">
26252622 <input type="search" class="ci-logsearch" data-log-q="true" placeholder=(g::t(lang, K::LogSearch)) aria-label=(g::t(lang, K::LogSearch)) autocomplete="off" spellcheck="false">
2626- <label class="find-opt" title=(crate::pages::passkeys::s(lang, "Only the text as typed, as one piece", "Yalnızca yazılan metin, tek parça olarak"))><input type="checkbox" data-log-exact="true"><span>(crate::pages::passkeys::s(lang, "Exact", "Tam"))</span></label>
2627- <label class="find-opt" title=(crate::pages::passkeys::s(lang, "Keep upper and lower case apart", "Büyük ve küçük harfi ayırt et"))><input type="checkbox" data-log-case="true"><span>"Aa"</span></label>
2623+ <label class="find-opt"><input type="checkbox" data-log-exact="true"><span>(crate::pages::passkeys::s(lang, "Exact", "Tam"))</span></label>
2624+ <label class="find-opt"><input type="checkbox" data-log-case="true"><span>"Aa"</span></label>
26282625 <span class="ci-logcount" data-log-count="true" data-none=(g::t(lang, K::LogNoMatches)) aria-live="polite"></span>
2629- <button type="button" class="act" data-log-prev="true" aria-label=(g::t(lang, K::LogPrev)) title=(g::t(lang, K::LogPrev))>"\u{2191}"</button>
2630- <button type="button" class="act" data-log-next="true" aria-label=(g::t(lang, K::LogNext)) title=(g::t(lang, K::LogNext))>"\u{2193}"</button>
2626+ <button type="button" class="act" data-log-prev="true" aria-label=(g::t(lang, K::LogPrev))>"\u{2191}"</button>
2627+ <button type="button" class="act" data-log-next="true" aria-label=(g::t(lang, K::LogNext))>"\u{2193}"</button>
26312628 <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>
26322629 <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+ }
26332633 if let (Some(action), Some(csrf)) = (log.rerun.as_ref(), run.writer_csrf.as_ref()) {
26342634 <form method="post" action=(action.as_str()) class="act-form ci-job-rerun">
26352635 <input type="hidden" name="csrf" value=(csrf.as_str())>
@@ -2650,7 +2650,6 @@ async fn run_log(
26502650 if !run.warnings.is_empty() {
26512651 <section class="ci-warnings" role="status">
26522652 <p class="ci-warnings-title">(g::t(lang, K::ConfigWarnings))</p>
2653- <p class="hint">(g::t(lang, K::ConfigWarningsHint))</p>
26542653 <ul>
26552654 for warning in run.warnings.iter() {
26562655 <li><code>(warning.as_str())</code></li>
@@ -2680,7 +2679,6 @@ async fn run_log(
26802679 run_timeline(lang: lang, run: run)
26812680 run_artifacts(lang: lang, run: run)
26822681 <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>
26842682 <div class="dock-history">
26852683 history_strip(lang: lang, owner: owner, repo: repo, bars: bars)
26862684 </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() {
261261 let run = run_with(&fx, &["build"], false).await;
262262 let run_url = format!("{RUN_BASE}/runs/{}", run.number);
263263 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");
265265 assert!(writer.text().contains(">Cancel<"), "writer sees cancel");
266266 let reader = get(&fx.app, &run_url, Some(&cookie_for("dave-token"))).await;
267267 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> {
224224 </div>
225225 <div class="field">
226226 <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="">
228228 </div>
229229 <label class="switch">
230230 <input type="checkbox" name="case" value="1" checked=(match_case) data-autosubmit=(true)>
crates/forge-web/src/pages/discussion_settings.rsmodified+14 -24
@@ -1,6 +1,6 @@
1-//! The Discussions switch on the repo settings page. `POST /{owner}/{repo}/settings/discussions`
2-//! with `enabled=1` or `enabled=0`. Admins only. Turning discussions off hides the tab and makes
3-//! the discussion pages 404; the discussions themselves are kept.
1+//! The Discussions switch in the Features topic of the General settings page. `POST
2+//! /{owner}/{repo}/settings/discussions` with `enabled=1` or `enabled=0`. Admins only. Turning
3+//! discussions off hides the tab and makes the discussion pages 404; the discussions themselves are kept.
44
55 use forge_core::AuditAction;
66 use serde::Deserialize;
@@ -14,7 +14,6 @@ use topcoat::view::{View, component, view};
1414 use crate::audit::{self, Actor, Target};
1515 use crate::auth::require_csrf;
1616 use crate::i18n::Lang;
17-use crate::i18n::community::{self as g, K};
1817 use crate::live::Topic;
1918 use crate::pages::repo_ctx::load_repo;
2019 use crate::state::AppState;
@@ -23,32 +22,24 @@ use crate::views::repo_href;
2322 path_param!(owner);
2423 path_param!(repo);
2524
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
2726 /// the form on change (`data-autosubmit`); an unchecked box sends no `enabled`, which the handler reads as off.
2827 #[component]
29-pub(crate) async fn discussions_card(
28+pub(crate) async fn discussions_switch(
3029 lang: Lang,
3130 action: String,
3231 csrf: String,
3332 enabled: bool,
3433 ) -> Result<impl View> {
35- let switch_label = if enabled {
36- g::t(lang, K::TurnOffDiscussions)
37- } else {
38- g::t(lang, K::TurnOnDiscussions)
39- };
34+ let switch_label = crate::pages::passkeys::s(lang, "Discussions", "Tartışmalar");
4035 Ok(view! {
41- <section class="sec" id="discussions">
42- <h2>(g::t(lang, K::Discussions))</h2>
43- <form method="post" action=(action.as_str())>
44- <input type="hidden" name="csrf" value=(csrf.as_str())>
45- <label class="switch">
46- <input type="checkbox" name="enabled" value="1" checked=(enabled) data-autosubmit="true">
47- <span>(switch_label)</span>
48- </label>
49- <p class="hint">(g::t(lang, K::DiscussionsDescription))</p>
50- </form>
51- </section>
36+ <form method="post" action=(action.as_str()) id="discussions">
37+ <input type="hidden" name="csrf" value=(csrf.as_str())>
38+ <label class="switch">
39+ <input type="checkbox" name="enabled" value="1" checked=(enabled) data-autosubmit="true">
40+ <span>(switch_label)</span>
41+ </label>
42+ </form>
5243 })
5344 }
5445
@@ -94,6 +85,5 @@ async fn settings_discussions_save(cx: &Cx, Form(form): Form<ToggleForm>) -> Res
9485 serde_json::Value::Null,
9586 )
9687 .await;
97- let back = repo_href(&ctx.repo.owner_name, &ctx.repo.name, "settings", "");
98- Ok(see_other(format!("{back}?section=discussions")))
88+ Ok(see_other(repo_href(&ctx.repo.owner_name, &ctx.repo.name, "settings", "")))
9989 }
crates/forge-web/src/pages/discussion_view.rsmodified+1 -11
@@ -32,15 +32,6 @@ path_param!(owner);
3232 path_param!(repo);
3333 path_param!(number);
3434
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-
4435 /// One comment, with every string the template shows already built.
4536 pub(crate) struct CommentView {
4637 lang: Lang,
@@ -457,7 +448,7 @@ async fn discussion_page(
457448 <button type="submit" class="primary">(g::t(lang, K::Save))</button>
458449 </form>
459450 )
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())
461452 </div>
462453 }
463454 </article>
@@ -471,7 +462,6 @@ async fn discussion_page(
471462 <div class="field">
472463 <label for="new-comment">(g::t(lang, K::AddComment))</label>
473464 <textarea id="new-comment" name="body" rows="6"></textarea>
474- <p class="hint">(g::t(lang, K::MarkdownSupported))</p>
475465 </div>
476466 <button type="submit" class="primary">(g::t(lang, K::CommentButton))</button>
477467 </form>
crates/forge-web/src/pages/discussions.rsmodified+0 -1
@@ -404,7 +404,6 @@ async fn new_discussion_body(
404404 <div class="field">
405405 <label for="discussion-body">(g::t(lang, K::Description))</label>
406406 <textarea id="discussion-body" name="body" rows="12">(draft.body.as_str())</textarea>
407- <p class="hint">(g::t(lang, K::MarkdownSupported))</p>
408407 </div>
409408 <div class="acts">
410409 <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> {
281281 if let Some(text) = title_text {
282282 <p class="mono">(text.as_str())</p>
283283 }
284- if body_unchanged {
285- <p class="hint">(g::t(lang, K::NoTextChange))</p>
286- } else {
284+ if !body_unchanged {
287285 <div class="diff-file">
288286 <div class="diff-file-body">
289287 <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};
1717 use crate::i18n::{self, Lang};
1818 use crate::live::{Topic, stream_changes};
1919 use crate::state::AppState;
20-use crate::views::parts::{SubPart, head};
20+use crate::views::parts::head;
2121 use crate::views::repo_list::{
2222 PageLink, RepoRow, SortLink, pager, pager_links, repo_rows, sort_chips,
2323 };
@@ -301,7 +301,7 @@ async fn explore_body(
301301 g::t(lang, K::NoPublicReposMatch)
302302 };
303303 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))
305305 <nav class="tabs" aria-label=(g::t(lang, K::Explore))>
306306 for (label, href, count, on) in tabs.into_iter() {
307307 <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 {
374374
375375 let body = get_with_language(&router, "/explore", "tr").await;
376376 assert!(body.contains("Keşfet"), "heading in Turkish: {body}");
377- assert!(body.contains("Bu forge üzerindeki herkese açık depolar."));
378377 assert!(body.contains("Herkese açık depolarda ara"));
379378 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."));
383379 }
384380 }
crates/forge-web/src/pages/forgot.rsmodified+3 -8
@@ -22,7 +22,7 @@ use crate::mail::account;
2222 use crate::pages::register::check_new_password;
2323 use crate::state::AppState;
2424 use crate::throttle;
25-use crate::views::parts::{SubPart, head};
25+use crate::views::parts::head;
2626 use crate::views::{alert, shell};
2727
2828 /// Reset requests allowed per client IP inside the throttle window.
@@ -59,7 +59,7 @@ enum ResetMode {
5959 #[component]
6060 async fn forgot_form(lang: Lang, precsrf: &str) -> Result<impl View> {
6161 Ok(view! {
62- head(title: t(lang, Key::ForgotTitle), sub: vec![SubPart::text(t(lang, Key::ForgotSub))])
62+ head(title: t(lang, Key::ForgotTitle))
6363 <div class="sheet fit">
6464 <form data-hard="true" method="post" action="/forgot" class="fields">
6565 <input type="hidden" name="precsrf" value=(precsrf)>
@@ -149,13 +149,8 @@ async fn reset_body(
149149 mode: ResetMode,
150150 error: Option<String>,
151151 ) -> Result<impl View> {
152- let sub = if mode == ResetMode::Form {
153- vec![SubPart::text(t(lang, Key::ResetSub))]
154- } else {
155- Vec::new()
156- };
157152 Ok(view! {
158- head(title: t(lang, Key::ResetTitle), sub: sub)
153+ head(title: t(lang, Key::ResetTitle))
159154 <div class="sheet fit">
160155 if mode == ResetMode::Form {
161156 <form data-hard="true" method="post" action=(format!("/reset/{token}")) class="fields">
crates/forge-web/src/pages/home.rsmodified+237 -12
@@ -1,40 +1,265 @@
1-//! Page: home. The landing page for visitors. A signed-in viewer is sent to their own profile.
1+//! Page: home (`/`). Visitors get the landing. A signed-in viewer gets Home: the head's actions, what
2+//! needs them (review requests, mentions, failed runs) and their own repositories, at most five rows
3+//! each with a link to the full list.
24
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;
39 use topcoat::Result;
410 use topcoat::context::{Cx, app_context};
5-use topcoat::router::error::see_other;
611 use topcoat::router::page;
712 use topcoat::view::{View, component, view};
813
914 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};
1018 use crate::i18n::orgs::{self as g, K};
1119 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;
1223 use crate::pages::repo_settings::{notice_banner_for, take_notice};
1324 use crate::state::AppState;
14-use crate::views::parts::{SubPart, head};
15-use crate::views::{enc, shell};
25+use crate::views::parts::head;
26+use crate::views::repo_list::private_fact;
27+use crate::views::{repo_href, rel_time, shell, user_href};
28+
29+/// Rows a topic lists on the home page, before its link to the full list.
30+const TOPIC_ROWS: usize = 5;
31+
32+/// The words around a row's time when the row's facts are not a repo's: " · " before, nothing after.
33+const FACT_JOIN: (&str, &str) = (" \u{b7} ", "");
34+
35+/// One row of a home topic: its link, its name, its facts, and when it last changed.
36+struct HomeRow {
37+ href: String,
38+ name: String,
39+ /// The facts before the time, as text.
40+ detail: String,
41+ /// The words that join the facts to the relative time, and that close it.
42+ before: &'static str,
43+ after: &'static str,
44+ stamp: String,
45+}
46+
47+/// What the signed-in home shows.
48+struct SignedHome {
49+ needs: Vec<HomeRow>,
50+ repos: Vec<HomeRow>,
51+ /// The viewer's repositories, as the profile's Repositories tab lists them.
52+ repos_href: String,
53+}
1654
1755 #[page("/")]
1856 async fn home(cx: &Cx) -> Result<impl View> {
1957 let state = app_context::<AppState>(cx);
20- if let Some((user, _)) = current_user(cx).await? {
21- return Err(see_other(format!("/{}", enc(&user.username))).into());
22- }
23- let lang = i18n::lang(cx, None);
24- let has_users = state.store.user_count().await? > 0;
58+ let viewer = current_user(cx).await?;
59+ let lang = i18n::lang(cx, viewer.as_ref().map(|(user, _)| user));
2560 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));
2669 Ok(view! {
27- shell(title: g::t(lang, K::Home), viewer: None,
70+ shell(title: g::t(lang, K::Home), viewer: viewer.as_ref(),
2871 notice_banner_for(lang: lang, title: notice)
29- landing(has_users: has_users, lang: lang)
72+ if let Some(signed) = signed {
73+ signed_home(lang: lang, data: signed, may_org: may_org)
74+ } else {
75+ landing(has_users: has_users, lang: lang)
76+ }
77+ )
78+ })
79+}
80+
81+/// The signed-in viewer's home: what needs them, and their repositories. Review requests come first,
82+/// then mentions, then failed runs, five rows in all. A repo the viewer can no longer read is left out.
83+async fn load_home(state: &AppState, user: &User, lang: Lang) -> Result<SignedHome> {
84+ let mut needs: Vec<HomeRow> = Vec::new();
85+ for item in state.store.review_requests_for_user(&user.id).await? {
86+ if needs.len() >= TOPIC_ROWS {
87+ break;
88+ }
89+ let Some(repo) = state
90+ .store
91+ .repo_by_owner_and_name(&item.repo_owner, &item.repo_name)
92+ .await?
93+ else {
94+ continue;
95+ };
96+ let role = state.store.collaborator_role(&repo.id, &user.id).await?;
97+ let org_role = state
98+ .store
99+ .org_repo_role(&repo.owner_id, &user.id, &repo.id)
100+ .await?;
101+ if authorize(Some(user), &repo, role, org_role, Action::Read).is_err() {
102+ continue;
103+ }
104+ needs.push(HomeRow {
105+ href: repo_href(
106+ &item.repo_owner,
107+ &item.repo_name,
108+ "pulls",
109+ &item.number.to_string(),
110+ ),
111+ name: item.title.clone(),
112+ detail: format!(
113+ "{}/{} #{} \u{b7} {}",
114+ item.repo_owner,
115+ item.repo_name,
116+ item.number,
117+ ga::requested_by(lang, &item.requested_by)
118+ ),
119+ before: FACT_JOIN.0,
120+ after: FACT_JOIN.1,
121+ stamp: item.created_at.clone(),
122+ });
123+ }
124+
125+ for item in state
126+ .store
127+ .mentions_waiting(&user.id, TOPIC_ROWS as i64, 0)
128+ .await?
129+ {
130+ if needs.len() >= TOPIC_ROWS {
131+ break;
132+ }
133+ let section = if item.is_pull { "pulls" } else { "issues" };
134+ needs.push(HomeRow {
135+ href: repo_href(&item.owner, &item.repo, section, &item.number.to_string()),
136+ name: item.title.clone(),
137+ detail: format!("{}/{} #{}", item.owner, item.repo, item.number),
138+ before: FACT_JOIN.0,
139+ after: FACT_JOIN.1,
140+ stamp: item.updated_at.clone(),
141+ });
142+ }
143+
144+ for run in state
145+ .store
146+ .failing_runs(&user.id, TOPIC_ROWS as i64, 0)
147+ .await?
148+ {
149+ if needs.len() >= TOPIC_ROWS {
150+ break;
151+ }
152+ let title = format!("{}/{}", run.owner, run.repo);
153+ needs.push(HomeRow {
154+ href: run_href(&title, run.number),
155+ name: format!("{title} #{}", run.number),
156+ detail: run.git_ref.clone(),
157+ before: FACT_JOIN.0,
158+ after: FACT_JOIN.1,
159+ stamp: run.created_at.clone(),
160+ });
161+ }
162+
163+ // The viewer's own repositories, newest activity first, as the profile's Repositories tab lists them.
164+ let (listed, _) = state
165+ .store
166+ .list_visible_repos(
167+ RepoScope::OwnedBy(&user.id),
168+ Some(user),
169+ None,
170+ RepoSort::RecentlyUpdated,
171+ 1,
172+ TOPIC_ROWS as u64,
173+ )
174+ .await?;
175+ let (before, after) = g::updated_parts(lang);
176+ let repos = listed
177+ .into_iter()
178+ .map(|(repo, stars, updated)| {
179+ let private = private_fact(lang, repo.visibility).unwrap_or_default();
180+ HomeRow {
181+ href: repo_href(&repo.owner_name, &repo.name, "", ""),
182+ name: format!("{}/{}", repo.owner_name, repo.name),
183+ detail: format!("{private}\u{2605} {stars}"),
184+ before,
185+ after,
186+ stamp: updated,
187+ }
188+ })
189+ .collect();
190+
191+ Ok(SignedHome {
192+ needs,
193+ repos,
194+ repos_href: format!("{}?tab=repositories", user_href(&user.username)),
195+ })
196+}
197+
198+/// The signed-in home: the head's actions, then the two topics on one sheet.
199+#[component]
200+async fn signed_home(lang: Lang, data: SignedHome, may_org: bool) -> Result<impl View> {
201+ let SignedHome {
202+ needs,
203+ repos,
204+ repos_href,
205+ } = data;
206+ let needs_heading = ni::t(lang, NK::NeedsYou);
207+ let repos_heading = s(lang, "Your repositories", "Depolarınız");
208+ let all = s(lang, "View all", "Tümünü gör");
209+ let no_repos = s(lang, "You have no repositories yet.", "Henüz deponuz yok.");
210+ let import_label = mg::t(lang, MGK::TabImport);
211+ Ok(view! {
212+ head(title: g::t(lang, K::Home),
213+ <a class="button primary" href="/new">(g::t(lang, K::NewRepository))</a>
214+ <a class="button" href="/new/import">(import_label)</a>
215+ if may_org {
216+ <a class="button" href="/org/new">(g::t(lang, K::NewOrganization))</a>
217+ }
30218 )
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>
31255 })
32256 }
33257
258+/// The visitor's landing: the wordmark's tagline and the way in.
34259 #[component]
35260 async fn landing(has_users: bool, lang: Lang) -> Result<impl View> {
36261 Ok(view! {
37- head(title: "forge", sub: vec![SubPart::text(g::t(lang, K::LandingTagline))],
262+ head(title: "forge",
38263 <a class="button primary" href="/login">(g::t(lang, K::LogIn))</a>
39264 if !has_users {
40265 <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
207207 <label><input type="radio" name="visibility" value="private" checked=(private)><span>(crate::i18n::community::t(lang, crate::i18n::community::K::VisibilityPrivate))</span></label>
208208 <label><input type="radio" name="visibility" value="public" checked=(!private)><span>(crate::i18n::community::t(lang, crate::i18n::community::K::VisibilityPublic))</span></label>
209209 </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>
211210 </div>
212211 })
213212 }
@@ -223,7 +222,6 @@ async fn option_boxes(lang: Lang, opts: ImportOptions) -> Result<impl View> {
223222 <label class="switch"><input type="checkbox" name="opt_pulls" value="on" checked=(opts.pulls)><span>(g::t(lang, K::OptPulls))</span></label>
224223 <label class="switch"><input type="checkbox" name="opt_releases" value="on" checked=(opts.releases)><span>(g::t(lang, K::OptReleases))</span></label>
225224 </div>
226- <p class="hint">(g::t(lang, K::OptionsNote))</p>
227225 </div>
228226 })
229227 }
@@ -325,7 +323,7 @@ async fn import_form(
325323 let private = draft.private;
326324 let opts = draft.opts;
327325 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))
329327 crate::pages::profile::own_profile_tabs(lang: lang, username: username, current: "repositories".to_owned())
330328 newrepo_tabs(lang: lang, active: "import")
331329 <div class="sheet fit">
@@ -355,7 +353,6 @@ async fn import_form(
355353 <div class="field">
356354 <label for="import-token">(token_label)</label>
357355 <input id="import-token" type="password" name="token" autocomplete="new-password" maxlength="1024">
358- <p class="hint">(g::t(lang, K::TokenHelp))</p>
359356 </div>
360357 if !is_git {
361358 option_boxes(lang: lang, opts: opts)
@@ -371,7 +368,6 @@ async fn import_form(
371368 <div class="field">
372369 <label for="import-name">(g::t(lang, K::TargetName))</label>
373370 <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>
375371 </div>
376372 <div class="field">
377373 <label for="import-description">(g::t(lang, K::Description))</label>
@@ -383,7 +379,6 @@ async fn import_form(
383379 if !is_git {
384380 <section class="sec">
385381 <h2>(g::t(lang, K::BulkLink))</h2>
386- <p class="hint">(g::t(lang, K::BulkIntro))</p>
387382 <div class="acts">
388383 <a class="act" href=(bulk_href.as_str())>(g::t(lang, K::BulkLinkButton))</a>
389384 </div>
@@ -613,7 +608,7 @@ async fn bulk_form(
613608 // A Forgejo token can list its own repositories, so the owner may stay empty.
614609 let owner_required = source != Source::Forgejo;
615610 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))
617612 crate::pages::profile::own_profile_tabs(lang: lang, username: username, current: "repositories".to_owned())
618613 newrepo_tabs(lang: lang, active: "import")
619614 <div class="sheet fit">
@@ -638,7 +633,6 @@ async fn bulk_form(
638633 <div class="field">
639634 <label for="bulk-token">(g::t(lang, K::TokenOptional))</label>
640635 <input id="bulk-token" type="password" name="token" autocomplete="new-password" maxlength="1024">
641- <p class="hint">(g::t(lang, K::TokenHelp))</p>
642636 </div>
643637 <input type="hidden" name="owner" value=(owners.first().map(String::as_str).unwrap_or(""))>
644638 <button type="submit" class="primary">(g::t(lang, K::BulkListButton))</button>
@@ -696,7 +690,6 @@ async fn bulk_select(
696690 <option value=(name.as_str()) selected=(*name == selected_owner)>(name.as_str())</option>
697691 }
698692 </select>
699- <p class="hint">(g::t(lang, K::BulkOwnerHelp))</p>
700693 </div>
701694 visibility_pick(lang: lang, private: private)
702695 if form.source != "git" {
@@ -1240,7 +1233,6 @@ async fn job_view(
12401233 <div class="field">
12411234 <label for="retry-token">(g::t(lang, K::TokenOptional))</label>
12421235 <input id="retry-token" type="password" name="token" autocomplete="new-password" maxlength="1024">
1243- <p class="hint">(g::t(lang, K::JobRetryHelp))</p>
12441236 </div>
12451237 <button type="submit" class="primary">(g::t(lang, K::JobRetry))</button>
12461238 </form>
@@ -1438,7 +1430,6 @@ async fn retry_list(lang: Lang, username: String, csrf: &str, rows: Vec<(ImportJ
14381430 <div class="field">
14391431 <label for="retry-token">(g::t(lang, K::TokenOptional))</label>
14401432 <input id="retry-token" type="password" name="token" autocomplete="new-password" maxlength="1024">
1441- <p class="hint">(g::t(lang, K::RetryTokenHelp))</p>
14421433 </div>
14431434 <label class="line" data-kb-row="">
14441435 <input type="checkbox" data-select-all=".import-pick-list">
crates/forge-web/src/pages/invites.rsmodified+22 -18
@@ -1,5 +1,6 @@
11 //! 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.
34
45 use forge_core::store::validate_email;
56 use forge_core::{AuditAction, Registration};
@@ -15,9 +16,9 @@ use crate::audit::{self, Actor, Target};
1516 use crate::auth::check_csrf;
1617 use crate::i18n::{self, Key, Lang, t};
1718 use crate::mail::account;
18-use crate::pages::admin_users::admin_only;
19+use crate::pages::admin_users::{admin_only, users_rail};
1920 use crate::state::AppState;
20-use crate::views::parts::{SubPart, head};
21+use crate::views::parts::head;
2122 use crate::views::{alert, shell, user_facing_message};
2223
2324 #[derive(Deserialize)]
@@ -36,21 +37,24 @@ async fn invite_body(
3637 error: Option<String>,
3738 ) -> Result<impl View> {
3839 Ok(view! {
39- head(title: t(lang, Key::InvitesTitle), sub: vec![SubPart::text(t(lang, Key::InvitesSub))])
40- <div class="sheet">
41- <section class="sec">
42- if let Some(message) = error {
43- alert(message: message.as_str())
44- }
45- <form method="post" action="/admin/invites" class="fields">
46- <input type="hidden" name="csrf" value=(csrf)>
47- <div class="field">
48- <label for="invite-email">(t(lang, Key::Email))</label>
49- <input id="invite-email" type="email" name="email" autocomplete="off" maxlength="254" required=(true)>
50- </div>
51- <button type="submit" class="primary">(t(lang, Key::InvitesSubmit))</button>
52- </form>
53- </section>
40+ head(title: t(lang, Key::InvitesTitle))
41+ <div class="work">
42+ users_rail(lang: lang, current: "invites")
43+ <div class="sheet">
44+ <section class="sec">
45+ if let Some(message) = error {
46+ alert(message: message.as_str())
47+ }
48+ <form method="post" action="/admin/invites" class="fields">
49+ <input type="hidden" name="csrf" value=(csrf)>
50+ <div class="field">
51+ <label for="invite-email">(t(lang, Key::Email))</label>
52+ <input id="invite-email" type="email" name="email" autocomplete="off" maxlength="254" required=(true)>
53+ </div>
54+ <button type="submit" class="primary">(t(lang, Key::InvitesSubmit))</button>
55+ </form>
56+ </section>
57+ </div>
5458 </div>
5559 if let Some(message) = notice {
5660 <p class="state" role="status">(message)</p>
crates/forge-web/src/pages/issue_parts.rsmodified+315 -125
@@ -19,7 +19,7 @@ use crate::i18n::Lang;
1919 use crate::i18n::issues::{self as g, K};
2020 use crate::notify::{self, Activity};
2121 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};
2323 use crate::pages::pull_reviews::suggest_states;
2424 use crate::pages::repo_ctx::RepoCtx;
2525 use crate::pages::tree::link_context;
@@ -31,7 +31,7 @@ use crate::views::{
3131 alert, avatar_url, avatar_url_unknown, display_name, iso_time, now_unix, relative_time, repo_href, short_oid,
3232 user_href, user_link,
3333 };
34-use crate::views::parts::{confirm_act, reveal};
34+use crate::views::parts::{confirm_act, post_act, reveal};
3535 use crate::webhooks::emit::{Sender, emit_comment, emit_item_action};
3636
3737 /// 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 {
291291 /// One timeline event as a line: the actor, `before`, an optional commit link, then `after`.
292292 pub(crate) struct EventLine {
293293 actor: String,
294+ actor_id: String,
294295 when: When,
296+ /// Unix seconds, and the event kind and label name, for folding runs.
297+ at: i64,
298+ kind: String,
299+ label: String,
295300 before: String,
296301 link_href: Option<String>,
297302 link_label: String,
298303 after: String,
299304 }
300305
306+/// Events by the same actor this close together fold into one line.
307+const RUN_GAP_SECS: i64 = 300;
308+
301309 /// A submitted review of a pull request: its verb, its body (when it has one) and the threads it
302310 /// opened, which render under it with their diff hunks.
303311 pub(crate) struct ReviewView {
@@ -317,6 +325,8 @@ pub(crate) struct ReviewView {
317325 pub(crate) enum Entry {
318326 Comment(CommentView),
319327 Event(EventLine),
328+ /// Consecutive events by one actor within a few minutes, one line.
329+ Run(Vec<EventLine>),
320330 Review(ReviewView),
321331 }
322332
@@ -410,7 +420,11 @@ fn event_line(
410420 };
411421 EventLine {
412422 actor,
423+ actor_id: event.actor_id.clone().unwrap_or_default(),
413424 when,
425+ at: stamp_unix(&event.created_at),
426+ kind: event.kind.clone(),
427+ label: text("label"),
414428 before,
415429 link_href,
416430 link_label,
@@ -435,7 +449,13 @@ pub(crate) async fn comment_item(lang: Lang, item: CommentView) -> Result<impl V
435449 reactions,
436450 } = item;
437451 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();
439459 Ok(view! {
440460 <article class="sec thread-entry" id=(anchor.as_str())>
441461 <header class="thread-head">
@@ -451,19 +471,28 @@ pub(crate) async fn comment_item(lang: Lang, item: CommentView) -> Result<impl V
451471 } else {
452472 <div class="issue-item-body markdown-body">(Unescaped::new_unchecked(html))</div>
453473 }
454- if let Some(bar) = reactions {
455- reaction_row(lang: lang, bar: bar)
456- }
457- if has_acts {
458- <div class="acts">
459- if let Some(href) = edit_href {
460- <a class="act" href=(href.as_str())>(g::t(lang, K::Edit))</a>
461- }
462- if let Some(action) = delete_href {
463- confirm_act(lang: lang, label: g::t(lang, K::Delete), action: action.as_str(), csrf: csrf.as_str())
474+ if !chips.is_empty() {
475+ <div class="reactions">
476+ for chip in chips.into_iter() {
477+ reaction_button(button: chip)
464478 }
465479 </div>
466480 }
481+ if has_tools {
482+ <div>
483+ <div class="acts">
484+ if has_react {
485+ reaction_picker(lang: lang, picker: picker)
486+ }
487+ if let Some(href) = edit_href {
488+ <a class="act" href=(href.as_str())>(g::t(lang, K::Edit))</a>
489+ }
490+ if let Some(action) = delete_href {
491+ confirm_act(lang: lang, label: g::t(lang, K::Delete), action: action.as_str(), csrf: csrf.as_str())
492+ }
493+ </div>
494+ </div>
495+ }
467496 </article>
468497 })
469498 }
@@ -482,19 +511,27 @@ pub(crate) async fn reaction_row(lang: Lang, bar: ReactionBar) -> Result<impl Vi
482511 reaction_button(button: chip)
483512 }
484513 if enabled {
485- <details class="reaction-picker">
486- <summary>(g::t(lang, K::AddReaction))</summary>
487- <div class="reaction-options">
488- for option in picker.into_iter() {
489- reaction_button(button: option)
490- }
491- </div>
492- </details>
514+ reaction_picker(lang: lang, picker: picker)
493515 }
494516 </div>
495517 })
496518 }
497519
520+/// The React tool: a word that opens the reaction options in place.
521+#[component]
522+pub(crate) async fn reaction_picker(lang: Lang, picker: Vec<ReactionButton>) -> Result<impl View> {
523+ Ok(view! {
524+ <details class="reaction-picker">
525+ <summary class="act">(g::t(lang, K::AddReaction))</summary>
526+ <div class="reaction-options">
527+ for option in picker.into_iter() {
528+ reaction_button(button: option)
529+ }
530+ </div>
531+ </details>
532+ })
533+}
534+
498535 /// One reaction button. Enabled buttons are POST forms that toggle the viewer's reaction; the
499536 /// others only show the emoji and count.
500537 #[component]
@@ -552,6 +589,7 @@ pub(crate) async fn event_item(line: EventLine) -> Result<impl View> {
552589 link_href,
553590 link_label,
554591 after,
592+ ..
555593 } = line;
556594 Ok(view! {
557595 <div class="thread-event">
@@ -576,6 +614,43 @@ pub(crate) async fn event_item(line: EventLine) -> Result<impl View> {
576614 })
577615 }
578616
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+
579654 /// The verb of a dismissed review: the verb it had before dismissal, marked as dismissed. Reviews
580655 /// dismissed before the previous state was recorded keep the generic verb.
581656 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
635710 match entry {
636711 Entry::Comment(item) => comment_item(lang: lang, item: item),
637712 Entry::Event(line) => event_item(line: line),
713+ Entry::Run(lines) => event_run(lines: lines),
638714 Entry::Review(review) => review_item(lang: lang, review: review),
639715 }
640716 })
@@ -824,7 +900,7 @@ pub(crate) async fn load_discussion(
824900 keyed.extend(review_entries(lang, state, ctx, item, &link, &tz, now).await?);
825901 }
826902 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());
828904
829905 Ok(Discussion {
830906 author: display_name(lang, &author),
@@ -835,6 +911,74 @@ pub(crate) async fn load_discussion(
835911 })
836912 }
837913
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+
838982 /// The reaction bar of one target, or `None` when there is nothing to show (no reactions and no
839983 /// way to react). Every reaction in the set gets a picker button.
840984 pub(crate) fn reaction_bar_for(
@@ -1082,26 +1226,28 @@ pub(crate) async fn labels_box(
10821226 labels: Vec<LabelRow>,
10831227 ) -> Result<impl View> {
10841228 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+ };
10851234 Ok(view! {
10861235 <section class="sec meta">
10871236 <h2>(g::t(lang, K::Labels))</h2>
1088- <p class="hint">
1089- if !any_attached {
1090- (g::t(lang, K::NoneYet))
1091- }
1092- for row in labels.iter() {
1093- if row.attached {
1094- <span class=(row.chip.as_str())>(row.name.as_str())</span>
1237+ <div class="line">
1238+ <span class="val">
1239+ for row in labels.iter() {
1240+ if row.attached {
1241+ <span class=(row.chip.as_str())>(row.name.as_str())</span>
1242+ }
10951243 }
1096- }
1097- </p>
1098- if write {
1099- <div class="acts">
1100- reveal(label: g::t(lang, K::Edit),
1244+ </span>
1245+ if write {
1246+ reveal(label: tool,
11011247 <form method="post" action=(action.as_str()) class="fields" data-apply="true">
11021248 <input type="hidden" name="csrf" value=(csrf.as_str())>
11031249 if labels.is_empty() {
1104- <p class="hint">(g::t(lang, K::NoRepoLabels))</p>
1250+ <p class="state">(g::t(lang, K::NoRepoLabels))</p>
11051251 }
11061252 for row in labels.iter() {
11071253 <label class="switch">
@@ -1112,8 +1258,8 @@ pub(crate) async fn labels_box(
11121258 <noscript><div><button type="submit" class="primary">(g::t(lang, K::SaveLabels))</button></div></noscript>
11131259 </form>
11141260 )
1115- </div>
1116- }
1261+ }
1262+ </div>
11171263 </section>
11181264 })
11191265 }
@@ -1128,38 +1274,38 @@ pub(crate) async fn assignees_box(
11281274 assign_next: Option<String>,
11291275 ) -> Result<impl View> {
11301276 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+ };
11311282 Ok(view! {
11321283 <section class="sec meta">
11331284 <h2>(g::t(lang, K::Assignees))</h2>
1134- <p class="hint">
1135- if names.is_empty() {
1136- (g::t(lang, K::NoOneAssigned))
1137- } else {
1138- (text.as_str())
1285+ <div class="line">
1286+ if !names.is_empty() {
1287+ <span class="val">(text.as_str())</span>
11391288 }
1140- </p>
1141- if write {
1142- <div class="acts">
1143- reveal(label: g::t(lang, K::Edit),
1144- if let Some(next) = assign_next {
1145- <form method="post" action=(action.as_str()) class="act-form">
1289+ if write {
1290+ reveal(label: tool,
1291+ if let Some(next) = assign_next {
1292+ <form method="post" action=(action.as_str()) class="act-form">
1293+ <input type="hidden" name="csrf" value=(csrf.as_str())>
1294+ <input type="hidden" name="assignees" value=(next.as_str())>
1295+ <button type="submit" class="act" data-palette-action="post">(g::t(lang, K::AssignToMe))</button>
1296+ </form>
1297+ }
1298+ <form method="post" action=(action.as_str()) class="fields" data-apply="true">
11461299 <input type="hidden" name="csrf" value=(csrf.as_str())>
1147- <input type="hidden" name="assignees" value=(next.as_str())>
1148- <button type="submit" class="act" data-palette-action="post">(g::t(lang, K::AssignToMe))</button>
1300+ <div class="field">
1301+ <label for="issue-assignees">(g::t(lang, K::Assignees))</label>
1302+ <input id="issue-assignees" type="text" name="assignees" value=(text.as_str()) autocomplete="off" spellcheck="false">
1303+ </div>
1304+ <noscript><div><button type="submit" class="primary">(g::t(lang, K::SaveAssignees))</button></div></noscript>
11491305 </form>
1150- }
1151- <form method="post" action=(action.as_str()) class="fields" data-apply="true">
1152- <input type="hidden" name="csrf" value=(csrf.as_str())>
1153- <div class="field">
1154- <label for="issue-assignees">(g::t(lang, K::Assignees))</label>
1155- <input id="issue-assignees" type="text" name="assignees" value=(text.as_str()) autocomplete="off" spellcheck="false" placeholder=(crate::pages::passkeys::s(lang, "Type a username", "Kullanıcı adı yaz"))>
1156- <p class="hint">(g::t(lang, K::CommaUsernames))</p>
1157- </div>
1158- <noscript><div><button type="submit" class="primary">(g::t(lang, K::SaveAssignees))</button></div></noscript>
1159- </form>
1160- )
1161- </div>
1162- }
1306+ )
1307+ }
1308+ </div>
11631309 </section>
11641310 })
11651311 }
@@ -1174,19 +1320,20 @@ pub(crate) async fn milestone_box(
11741320 current: String,
11751321 none_selected: bool,
11761322 ) -> 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+ };
11771328 Ok(view! {
11781329 <section class="sec meta">
11791330 <h2>(g::t(lang, K::MilestoneBox))</h2>
1180- <p class="hint">
1181- if current.is_empty() {
1182- (g::t(lang, K::NoMilestone))
1183- } else {
1184- (current.as_str())
1331+ <div class="line">
1332+ if !current.is_empty() {
1333+ <span class="val">(current.as_str())</span>
11851334 }
1186- </p>
1187- if write {
1188- <div class="acts">
1189- reveal(label: g::t(lang, K::Edit),
1335+ if write {
1336+ reveal(label: tool,
11901337 <form method="post" action=(action.as_str()) class="fields" data-apply="true">
11911338 <input type="hidden" name="csrf" value=(csrf.as_str())>
11921339 <div class="field">
@@ -1201,14 +1348,14 @@ pub(crate) async fn milestone_box(
12011348 <noscript><div><button type="submit" class="primary">(g::t(lang, K::SaveMilestone))</button></div></noscript>
12021349 </form>
12031350 )
1204- </div>
1205- }
1351+ }
1352+ </div>
12061353 </section>
12071354 })
12081355 }
12091356
1210-/// The conversation lock. Triage holders get a form that locks it, with a reason, or unlocks it.
1211-/// Everyone else sees the lock state only when there is one.
1357+/// The conversation row, shown only when the conversation is locked, with its unlock word for
1358+/// triage holders. Locking is one of the tools at the foot of the sidebar (`item_tools`).
12121359 #[component]
12131360 pub(crate) async fn lock_box(
12141361 lang: Lang,
@@ -1225,27 +1372,47 @@ pub(crate) async fn lock_box(
12251372 .to_owned();
12261373 let none = reason.is_none();
12271374 Ok(view! {
1228- <section class="sec meta">
1229- <h2>(g::t(lang, K::ConversationBox))</h2>
1230- <p class="hint">
1231- if locked {
1232- (g::t(lang, K::LockedToCollaborators))
1233- if !none {
1234- " (" (reason_text.as_str()) ")"
1375+ if locked {
1376+ <section class="sec meta">
1377+ <h2>(g::t(lang, K::ConversationBox))</h2>
1378+ <div class="line">
1379+ <span class="val">
1380+ (g::t(lang, K::LockedToCollaborators))
1381+ if !none {
1382+ " (" (reason_text.as_str()) ")"
1383+ }
1384+ </span>
1385+ if write {
1386+ post_act(label: g::t(lang, K::UnlockConversation), action: action.as_str(), csrf: csrf.as_str(), fields: vec![("locked".to_owned(), "0".to_owned())])
12351387 }
1236- } else {
1237- (g::t(lang, K::OpenToEveryone))
1238- }
1239- </p>
1240- if write {
1241- <div class="acts">
1242- reveal(label: g::t(lang, K::Edit),
1243- <form method="post" action=(action.as_str()) class="fields">
1244- <input type="hidden" name="csrf" value=(csrf.as_str())>
1245- if locked {
1246- <input type="hidden" name="locked" value="0">
1247- <button type="submit" class="primary">(g::t(lang, K::UnlockConversation))</button>
1248- } else {
1388+ </div>
1389+ </section>
1390+ }
1391+ })
1392+}
1393+
1394+/// The tools at the foot of the sidebar, one quiet line: Pin issue, and Lock conversation with its
1395+/// reason. `pin` is the pin action when the issue is not pinned and the viewer may pin it.
1396+#[component]
1397+pub(crate) async fn item_tools(
1398+ lang: Lang,
1399+ pin: Option<String>,
1400+ lock: Option<String>,
1401+ csrf: String,
1402+) -> Result<impl View> {
1403+ let pin_label = g::t(lang, K::PinIssue);
1404+ let lock_label = g::t(lang, K::LockConversation);
1405+ Ok(view! {
1406+ if pin.is_some() || lock.is_some() {
1407+ <section class="sec">
1408+ <div class="line">
1409+ if let Some(action) = pin {
1410+ post_act(label: pin_label, action: action.as_str(), csrf: csrf.as_str(), fields: vec![("pinned".to_owned(), "1".to_owned())])
1411+ }
1412+ if let Some(action) = lock {
1413+ reveal(label: lock_label,
1414+ <form method="post" action=(action.as_str()) class="fields">
1415+ <input type="hidden" name="csrf" value=(csrf.as_str())>
12491416 <div class="field">
12501417 <label for="issue-lock-reason">(g::t(lang, K::Reason))</label>
12511418 <select id="issue-lock-reason" name="reason">
@@ -1258,17 +1425,18 @@ pub(crate) async fn lock_box(
12581425 </div>
12591426 <input type="hidden" name="locked" value="1">
12601427 <button type="submit" class="primary">(g::t(lang, K::LockConversation))</button>
1261- }
1262- </form>
1263- )
1428+ </form>
1429+ )
1430+ }
12641431 </div>
1265- }
1266- </section>
1432+ </section>
1433+ }
12671434 })
12681435 }
12691436
1270-/// The sidebar boxes. `base` is the item's URL; the forms post to `{base}/labels`, `/assignees`
1271-/// and `/milestone`. `write` shows the forms instead of the read-only lists.
1437+/// The sidebar facts. `base` is the item's URL; the forms post to `{base}/labels`, `/assignees`,
1438+/// `/milestone` and `/lock`. `write` shows the forms instead of the read-only lists. `pin` is
1439+/// `(pinned, action)` for an issue; the pinned row sits in the page (`pin_box`).
12721440 #[component]
12731441 pub(crate) async fn item_sidebar(
12741442 lang: Lang,
@@ -1277,7 +1445,7 @@ pub(crate) async fn item_sidebar(
12771445 csrf: String,
12781446 viewer: Option<String>,
12791447 sidebar: Sidebar,
1280- notify: Option<NotifyBox>,
1448+ pin: Option<(bool, String)>,
12811449 ) -> Result<impl View> {
12821450 let Sidebar {
12831451 labels,
@@ -1301,56 +1469,78 @@ pub(crate) async fn item_sidebar(
13011469 let assignees_action = format!("{base}/assignees");
13021470 let milestone_action = format!("{base}/milestone");
13031471 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());
13041474 Ok(view! {
13051475 labels_box(lang: lang, write: write, action: labels_action, csrf: csrf.clone(), labels: labels)
13061476 assignees_box(lang: lang, write: write, action: assignees_action, csrf: csrf.clone(), names: assignees, assign_next: assign_next)
13071477 milestone_box(lang: lang, write: write, action: milestone_action, csrf: csrf.clone(),
13081478 options: milestones, current: current_milestone, none_selected: none_selected)
13091479 lock_box(lang: lang, write: write, action: lock_action, csrf: csrf.clone(), locked: locked, reason: lock_reason)
1310- if let Some(notify) = notify {
1311- notify_box(lang: lang, action: notify.action, csrf: notify.csrf, subscribed: notify.subscribed, reason: notify.reason)
1312- }
1480+ item_tools(lang: lang, pin: pin_tool, lock: lock_tool, csrf: csrf.clone())
13131481 })
13141482 }
13151483
13161484 // Comment form
13171485
1318-/// The comment box with its close, reopen and comment buttons. The comment is posted to
1319-/// `action`; the close and reopen buttons post to `state_action` (the same URL for issues).
1486+/// The id of the comment form. The head's Close and Reopen buttons post it with `form=`, so a
1487+/// close can carry the draft text as its comment, as it always did.
1488+pub(crate) const COMMENT_FORM: &str = "item-comment";
1489+
1490+/// The head tools of an item: Close (a menu of the two ways) or Reopen when closed, and the
1491+/// Subscribe or Unsubscribe pill, whose reason is its title. `close` is `(open, state action)`
1492+/// and is given only when the viewer may close the item.
1493+#[component]
1494+pub(crate) async fn item_head_tools(
1495+ lang: Lang,
1496+ close: Option<(bool, String)>,
1497+ notify: Option<NotifyBox>,
1498+) -> Result<impl View> {
1499+ let close_label = g::t(lang, K::Close);
1500+ let reopen_label = g::t(lang, K::Reopen);
1501+ let completed = g::t(lang, K::CloseCompleted);
1502+ let not_planned = g::t(lang, K::CloseNotPlanned);
1503+ Ok(view! {
1504+ if let Some((open, state_action)) = close {
1505+ if open {
1506+ reveal(label: close_label,
1507+ <div class="acts">
1508+ <button type="submit" class="act" form=(COMMENT_FORM) name="action" value="close_completed" formaction=(state_action.as_str())>(completed)</button>
1509+ <button type="submit" class="act" form=(COMMENT_FORM) name="action" value="close_not_planned" formaction=(state_action.as_str())>(not_planned)</button>
1510+ </div>
1511+ )
1512+ } else {
1513+ <button type="submit" class="act" form=(COMMENT_FORM) name="action" value="reopen" formaction=(state_action.as_str())>(reopen_label)</button>
1514+ }
1515+ }
1516+ if let Some(notify) = notify {
1517+ notify_pill(lang: lang, action: notify.action, csrf: notify.csrf, subscribed: notify.subscribed)
1518+ }
1519+ })
1520+}
1521+
1522+/// The comment box: the text, and Comment as its one filled button. Its label is for screen
1523+/// readers only.
13201524 #[component]
13211525 pub(crate) async fn comment_form(
13221526 lang: Lang,
13231527 action: String,
1324- state_action: String,
13251528 csrf: String,
13261529 draft: String,
13271530 error: Option<String>,
1328- can_close: bool,
1329- open: bool,
13301531 ) -> Result<impl View> {
13311532 Ok(view! {
13321533 <section class="sec issue-comment">
1333- <h2>(g::t(lang, K::AddComment))</h2>
13341534 if let Some(message) = error {
13351535 alert(message: message.as_str())
13361536 }
1337- <form method="post" action=(action.as_str()) class="fields">
1537+ <form id=(COMMENT_FORM) method="post" action=(action.as_str()) class="fields">
13381538 <input type="hidden" name="csrf" value=(csrf.as_str())>
13391539 <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>
13411541 <textarea id="issue-comment-body" name="body" rows="3">(draft.as_str())</textarea>
13421542 </div>
13431543 <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- }
13541544 </form>
13551545 </section>
13561546 })
crates/forge-web/src/pages/issue_pin.rsmodified+12 -22
@@ -75,8 +75,8 @@ async fn issue_pin_save(cx: &Cx, Form(form): Form<PinForm>) -> Result<impl View>
7575 Err(see_other(back).into())
7676 }
7777
78-/// The sidebar box for pinning. Triage holders get the button, which posts the opposite of the
79-/// current state; others see whether the issue is pinned.
78+/// The pinned row, shown only while the issue is pinned, with its unpin word for triage holders.
79+/// Pinning is a tool at the foot of the sidebar (`item_tools`).
8080 #[component]
8181 pub(crate) async fn pin_box(
8282 lang: Lang,
@@ -85,27 +85,17 @@ pub(crate) async fn pin_box(
8585 action: String,
8686 csrf: String,
8787 ) -> 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- };
9488 Ok(view! {
95- <section class="sec meta">
96- <h2>(g::t(lang, K::Pinned))</h2>
97- <p class="hint">
98- if pinned {
99- (g::t(lang, K::PinnedTopNote))
100- } else {
101- (g::t(lang, K::NotPinned))
102- }
103- </p>
104- if write {
105- <div class="acts">
106- post_act(label: label, action: action.as_str(), csrf: csrf.as_str(), fields: vec![("pinned".to_owned(), next.to_owned())])
89+ if pinned {
90+ <section class="sec meta">
91+ <h2>(g::t(lang, K::Pinned))</h2>
92+ <div class="line">
93+ <span class="val">(g::t(lang, K::PinnedTopNote))</span>
94+ if write {
95+ post_act(label: g::t(lang, K::UnpinIssue), action: action.as_str(), csrf: csrf.as_str(), fields: vec![("pinned".to_owned(), "0".to_owned())])
96+ }
10797 </div>
108- }
109- </section>
98+ </section>
99+ }
110100 })
111101 }
crates/forge-web/src/pages/issue_view.rsmodified+8 -6
@@ -21,8 +21,8 @@ use crate::i18n::issues::{self as g, K};
2121 use crate::notify;
2222 use crate::pages::issue_parts::{
2323 CommentForm, ItemKind, Posted, bump_live, check_write, comment_for, comment_form, csrf_of,
24- discussion_timeline, issue_for, item_for, item_sidebar, load_discussion, load_sidebar,
25- lock_message, may_change, may_converse, parse_number, post_comment, triage,
24+ discussion_timeline, issue_for, item_for, item_head_tools, item_sidebar, load_discussion,
25+ load_sidebar, lock_message, may_change, may_converse, parse_number, post_comment, triage,
2626 };
2727 use crate::pages::issue_pin::pin_box;
2828 use crate::pages::issues_live::item_live_url;
@@ -60,7 +60,7 @@ async fn issue_page(
6060 let viewer_login = ctx.viewer.as_ref().map(|(u, _)| u.username.clone());
6161 let pinned = state.store.is_pinned(&ctx.repo.id, &issue.id).await?;
6262 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?;
6464 let author = discussion.author.clone();
6565 let author_login = discussion.author_login.clone();
6666 let opened = discussion.opened.clone();
@@ -74,6 +74,8 @@ async fn issue_page(
7474 let locked_for_viewer = !may_converse(&ctx, &issue);
7575 let lock_notice = lock_message(lang, &issue);
7676 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")));
7779
7880 let (state_class, state_text) = match (&issue.state, &issue.state_reason) {
7981 (IssueState::Open, _) => ("issue-badge issue-badge-open", g::t(lang, K::Open)),
@@ -106,13 +108,13 @@ async fn issue_page(
106108 shell(title: page_title.as_str(), viewer: ctx.viewer.as_ref(), extra_stylesheet: Some(labels_href.as_str()),
107109 repo_head(head: header, title: Some(issue.title.clone()), sub: sub,
108110 <span class="num">(number_label.as_str())</span>
111+ item_head_tools(lang: lang, close: close, notify: notify)
109112 )
110113 <div class="work" data-live=(live_href.as_str()) data-live-now="">
111114 <div class="sheet">
112115 discussion_timeline(lang: lang, discussion: discussion)
113116 if can_comment {
114- comment_form(lang: lang, action: comment_action.clone(), state_action: comment_action.clone(),
115- csrf: csrf.clone(), draft: draft, error: error, can_close: editable_issue, open: open)
117+ comment_form(lang: lang, action: comment_action.clone(), csrf: csrf.clone(), draft: draft, error: error)
116118 }
117119 if archived {
118120 <p class="state">(g::t(lang, K::ArchivedIssuesReadOnly))</p>
@@ -123,7 +125,7 @@ async fn issue_page(
123125 <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>
124126 }
125127 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())))
127129 </div>
128130 </div>
129131 )
crates/forge-web/src/pages/issues_list.rsmodified+1 -2
@@ -604,7 +604,7 @@ async fn issues_list_page(cx: &Cx) -> Result<impl View> {
604604 <a class="act" href=(milestones_href.as_str())>(g::t(lang, K::Milestones))</a>
605605 </form>
606606 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>
608608 }
609609 if !pinned.is_empty() {
610610 <section class="sec" aria-label=(g::t(lang, K::PinnedIssues))>
@@ -788,7 +788,6 @@ async fn new_issue_body(
788788 <div class="field">
789789 <label for="issue-body">(g::t(lang, K::Description))</label>
790790 <textarea id="issue-body" name="body" rows="12">(draft.body.as_str())</textarea>
791- <p class="hint">(g::t(lang, K::MarkdownSupported))</p>
792791 </div>
793792 if has_labels {
794793 <div class="field">
crates/forge-web/src/pages/labels_page.rsmodified+2 -3
@@ -148,7 +148,7 @@ async fn labels_body(
148148 </span>
149149 </summary>
150150 <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>
152152 if can_triage {
153153 <div class="acts">
154154 reveal(label: g::t(lang, K::Edit),
@@ -169,8 +169,7 @@ async fn labels_body(
169169 <button type="submit">(g::t(lang, K::SaveLabel))</button>
170170 </form>
171171 )
172- confirm_act(lang: lang, label: g::t(lang, K::Delete), action: row.delete_action.as_str(), csrf: csrf.as_str(),
173- note: Some(crate::pages::passkeys::s(lang, "It is removed from every issue that has it.", "Onu taşıyan her konudan kaldırılır.").to_owned()))
172+ confirm_act(lang: lang, label: g::t(lang, K::Delete), action: row.delete_action.as_str(), csrf: csrf.as_str())
174173 </div>
175174 }
176175 </div>
crates/forge-web/src/pages/login.rsmodified+2 -2
@@ -25,7 +25,7 @@ use crate::i18n::{self, Key, Lang, t};
2525 use crate::pages::passkeys::{available as passkeys_available, login_passkey, s};
2626 use crate::state::AppState;
2727 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;
2929 use crate::views::{alert, shell};
3030
3131 /// 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>
279279 #[component]
280280 async fn two_factor_form(lang: Lang, precsrf: &str, error: Option<String>) -> Result<impl View> {
281281 Ok(view! {
282- head(title: t(lang, Key::TwoFactorCheck), sub: vec![SubPart::text(t(lang, Key::TwoFactorCheckSub))])
282+ head(title: t(lang, Key::TwoFactorCheck))
283283 <div class="sheet fit">
284284 <form data-hard="true" method="post" action="/login/2fa" class="fields">
285285 if let Some(message) = error {
crates/forge-web/src/pages/merge_queue.rsmodified+2 -8
@@ -359,11 +359,10 @@ async fn queue_body(
359359 csrf: String,
360360 ) -> Result<impl View> {
361361 let remove_label = g::t(lang, K::RemoveFromQueue);
362- let hint = g::t(lang, K::RequireMergeQueueHint);
363362 let remove_note = crate::pages::passkeys::s(
364363 lang,
365- "The pull request leaves the queue. It can join again later.",
366- "Çekme isteği sıradan çıkar. Daha sonra yeniden ekleyebilirsin.",
364+ "Remove it from the queue?",
365+ "Sıradan çıkarılsın mı?",
367366 )
368367 .to_owned();
369368 Ok(view! {
@@ -430,11 +429,6 @@ async fn queue_body(
430429 }
431430 }
432431 }
433- if protected {
434- <section class="sec">
435- <p class="hint">(hint)</p>
436- </section>
437- }
438432 </div>
439433 })
440434 }
crates/forge-web/src/pages/milestones_page.rsmodified+5 -8
@@ -136,16 +136,14 @@ async fn milestone_row(
136136 <span class="val">(open_text.as_str()) " \u{b7} " (closed_text.as_str())</span>
137137 </summary>
138138 <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>
141141 (g::due_text(lang, due))
142142 if row.overdue {
143143 " " <span class="badge overdue">(g::t(lang, K::Overdue))</span>
144144 }
145- } else {
146- (g::t(lang, K::NoDueDate))
147- }
148- </p>
145+ </p>
146+ }
149147 <progress value=(row.closed) max=(max)></progress>
150148 <div class="acts">
151149 <a class="act" href=(row.open_href.as_str())>(open_text.as_str())</a>
@@ -157,8 +155,7 @@ async fn milestone_row(
157155 if can_triage {
158156 <div class="acts">
159157 <a class="act" href=(row.edit_href.as_str())>(g::t(lang, K::Edit))</a>
160- confirm_act(lang: lang, label: g::t(lang, K::Delete), action: row.delete_action.as_str(), csrf: csrf.as_str(),
161- note: Some(crate::pages::passkeys::s(lang, "Its issues stay open or closed and lose the milestone.", "Konular açık ya da kapalı kalır, yalnızca kilometre taşını kaybeder.").to_owned()))
158+ confirm_act(lang: lang, label: g::t(lang, K::Delete), action: row.delete_action.as_str(), csrf: csrf.as_str())
162159 </div>
163160 }
164161 </div>
crates/forge-web/src/pages/needs_you.rsmodified+2 -4
@@ -20,9 +20,8 @@ use crate::i18n::needs::{self as ni, K};
2020 use crate::i18n::{self, Lang};
2121 use crate::live::{Topic, stream_wakes};
2222 use crate::pages::ci_runs::run_href;
23-use crate::pages::passkeys::s;
2423 use crate::state::AppState;
25-use crate::views::parts::{SubPart, head};
24+use crate::views::parts::head;
2625 use crate::views::repo_list::{PageLink, pager, pager_links};
2726 use crate::views::{rel_time, repo_href, shell};
2827
@@ -411,10 +410,9 @@ async fn needs_you(cx: &Cx) -> Result<impl View> {
411410 let back = full.as_ref().map(|_| ni::t(lang, K::BackToNeedsYou));
412411 let heading = ni::t(lang, K::NeedsYou);
413412 let unread = state.store.unread_count(&user.id).await?;
414- let sub = vec![SubPart::text(s(lang, "Waiting on you", "Senden beklenenler"))];
415413 Ok(view! {
416414 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()),
418416 if let Some(back) = back {
419417 <a class="act" href="/needs-you">(back)</a>
420418 }
crates/forge-web/src/pages/new_repo.rsmodified+0 -3
@@ -273,7 +273,6 @@ async fn new_repo_form(
273273 <input type="checkbox" name="add_readme" value="on" checked=(add_readme)>
274274 <span>(g::t(lang, K::ReadmeLabel))</span>
275275 </label>
276- <p class="hint">(g::t(lang, K::ReadmeHelp))</p>
277276 <div class="field">
278277 <label for="new-license">(g::t(lang, K::LicenseLabel))</label>
279278 <select id="new-license" name="license">
@@ -282,10 +281,8 @@ async fn new_repo_form(
282281 <option value=(*id) selected=(*id == draft_license.as_str())>(*label)</option>
283282 }
284283 </select>
285- <p class="hint">(g::t(lang, K::LicenseHelp))</p>
286284 </div>
287285 reveal(label: g::t(lang, K::MirrorLegend), id: Some("new-mirror"), open: mirror_open,
288- <p class="hint">(g::t(lang, K::MirrorIntro))</p>
289286 <div class="field">
290287 <label for="new-mirror-url">(g::t(lang, K::SourceUrl))</label>
291288 <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
10091009 pub(crate) async fn notify_box_for(
10101010 state: &AppState,
10111011 ctx: &RepoCtx,
1012- lang: Lang,
10131012 issue_id: &str,
10141013 base: &str,
10151014 ) -> Result<Option<NotifyBox>> {
@@ -1020,47 +1019,28 @@ pub(crate) async fn notify_box_for(
10201019 publish_unread(state, &user.id).await;
10211020 let level = state.store.watch_level(&user.id, &ctx.repo.id).await?;
10221021 let subscription = state.store.subscription(&user.id, issue_id).await?;
1023- let (subscribed, reason) = if level == WatchLevel::Ignoring {
1024- (false, g::t(lang, K::NotReceivingRepo).to_owned())
1022+ let subscribed = if level == WatchLevel::Ignoring {
1023+ false
10251024 } else {
10261025 match subscription {
1027- Some((SubState::Ignored, _)) => (false, g::t(lang, K::NotReceivingThread).to_owned()),
1028- Some((SubState::Subscribed, reason)) => (true, because(lang, reason)),
1029- None if level == WatchLevel::Watching => {
1030- (true, g::receiving_because(lang, K::WhyWatching))
1031- }
1032- None => (false, g::t(lang, K::NotReceivingThread).to_owned()),
1026+ Some((SubState::Ignored, _)) => false,
1027+ Some((SubState::Subscribed, _)) => true,
1028+ None => level == WatchLevel::Watching,
10331029 }
10341030 };
10351031 Ok(Some(NotifyBox {
10361032 action: format!("{base}/subscription"),
10371033 csrf: session.csrf_token.clone(),
10381034 subscribed,
1039- reason,
10401035 }))
10411036 }
10421037
1043-/// The notification sidebar box data: where the form posts, the session CSRF token, whether the
1044-/// viewer is receiving notifications, and the sentence explaining why.
1038+/// The notification sidebar box data: where the form posts, the session CSRF token, and whether the
1039+/// viewer is receiving notifications.
10451040 pub(crate) struct NotifyBox {
10461041 pub(crate) action: String,
10471042 pub(crate) csrf: String,
10481043 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)
10641044 }
10651045
10661046 /// The human label of a notification reason.
@@ -1158,7 +1138,6 @@ async fn inbox_list(
11581138 let filters = inbox_items(lang, if all { "all" } else { "unread" }, unread_count);
11591139 Ok(view! {
11601140 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"))],
11621141 if !empty {
11631142 <form method="post" action="/notifications/mark_all_read" class="act-form">
11641143 <input type="hidden" name="csrf" value=(csrf.as_str())>
@@ -1211,15 +1190,13 @@ async fn inbox_list(
12111190 })
12121191 }
12131192
1214-/// The Notifications box in the issue and pull sidebar: the reason and a Subscribe or
1215-/// Unsubscribe button.
1193+/// The Subscribe or Unsubscribe pill of an issue or pull request, in its head.
12161194 #[component]
1217-pub(crate) async fn notify_box(
1195+pub(crate) async fn notify_pill(
12181196 lang: Lang,
12191197 action: String,
12201198 csrf: String,
12211199 subscribed: bool,
1222- reason: String,
12231200 ) -> Result<impl View> {
12241201 let (label, value_text) = if subscribed {
12251202 (g::t(lang, K::Unsubscribe), "unsubscribe")
@@ -1227,13 +1204,11 @@ pub(crate) async fn notify_box(
12271204 (g::t(lang, K::Subscribe), "subscribe")
12281205 };
12291206 Ok(view! {
1230- <section class="sec meta">
1231- <h2>(i18n::t(lang, Key::Notifications))</h2>
1232- <p class="hint">(reason.as_str())</p>
1233- <div class="acts">
1234- post_act(label: label, action: action.as_str(), csrf: csrf.as_str(), fields: vec![("action".to_owned(), value_text.to_owned())])
1235- </div>
1236- </section>
1207+ <form class="act-form" method="post" action=(action.as_str())>
1208+ <input type="hidden" name="csrf" value=(csrf.as_str())>
1209+ <input type="hidden" name="action" value=(value_text)>
1210+ <button type="submit" class="act">(label)</button>
1211+ </form>
12371212 })
12381213 }
12391214
@@ -1277,7 +1252,6 @@ pub(crate) async fn watch_form(
12771252 <input type="hidden" name="level" value="participating">
12781253 <button type="submit" class=(cls_participating)>
12791254 <span class="watch-option-title">(g::t(lang, K::OptParticipating))</span>
1280- <span class="watch-option-desc">(g::t(lang, K::WatchDescParticipating))</span>
12811255 </button>
12821256 </form>
12831257 </li>
@@ -1287,7 +1261,6 @@ pub(crate) async fn watch_form(
12871261 <input type="hidden" name="level" value="watching">
12881262 <button type="submit" class=(cls_watching) data-palette-action="post" data-palette-label=(g::t(lang, K::OptWatching))>
12891263 <span class="watch-option-title">(g::t(lang, K::OptWatching))</span>
1290- <span class="watch-option-desc">(g::t(lang, K::WatchDescWatching))</span>
12911264 </button>
12921265 </form>
12931266 </li>
@@ -1297,7 +1270,6 @@ pub(crate) async fn watch_form(
12971270 <input type="hidden" name="level" value="ignoring">
12981271 <button type="submit" class=(cls_ignoring)>
12991272 <span class="watch-option-title">(g::t(lang, K::OptIgnoring))</span>
1300- <span class="watch-option-desc">(g::t(lang, K::WatchDescIgnoring))</span>
13011273 </button>
13021274 </form>
13031275 </li>
@@ -1474,7 +1446,7 @@ mod tests {
14741446 let unread = get(&site, "/notifications", Some(&cookie)).await;
14751447 assert_eq!(unread.status, 200);
14761448 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."));
14781450
14791451 let all = get(&site, "/notifications?all=1", Some(&cookie)).await;
14801452 assert_eq!(all.status, 200);
@@ -1624,7 +1596,6 @@ mod tests {
16241596 assert_eq!(sub, Some((SubState::Subscribed, Reason::Subscribed)));
16251597
16261598 let page = get(&site, "/tahinli/demo/issues/1", Some(&cookie)).await;
1627- assert!(page.body.contains("because you subscribed to this."));
16281599 assert!(page.body.contains("value=\"unsubscribe\""));
16291600
16301601 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)> {
184184 .map(|(_, key, is_error)| (g::t(lang, *key), *is_error))
185185 }
186186
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-
198187 /// The counts on an organization's tab labels: the repos the viewer may read and the packages the
199188 /// viewer may see, as the profile counts them.
200189 pub async fn org_tab_counts(state: &AppState, org: &User, viewer: &User) -> Result<(u64, usize)> {
crates/forge-web/src/pages/org_members.rsmodified+43 -91
@@ -24,7 +24,7 @@ use crate::pages::org_ctx::{
2424 };
2525 use crate::pages::passkeys;
2626 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};
2828 use crate::views::{avatar_url, display_name, shell};
2929
3030 path_param!(org);
@@ -57,25 +57,15 @@ struct RemoveForm {
5757 user_id: String,
5858 }
5959
60-/// One table row: a member, their org role, and whether it is the viewer.
61-struct MemberRow {
62- user_id: String,
63- username: String,
64- /// What to show: the login name, or "Deleted user" for the ghost account.
65- label: String,
66- avatar: String,
67- is_owner: bool,
68- is_self: bool,
69-}
70-
71-/// The members table and the add form. Owners get the role, remove and add controls.
60+/// The members list and its add form. Owners get the role, remove and add controls; everyone
61+/// else sees the plain list.
7262 #[component]
7363 async fn members_body(
7464 name: String,
7565 description: String,
7666 base: String,
7767 owner: bool,
78- rows: Vec<MemberRow>,
68+ rows: Vec<PersonRow>,
7969 csrf: String,
8070 notice: Option<(&'static str, bool)>,
8171 lang: Lang,
@@ -83,85 +73,41 @@ async fn members_body(
8373 repo_count: u64,
8474 package_count: usize,
8575 ) -> 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");
8976 let sub = if description.is_empty() {
9077 Vec::new()
9178 } else {
9279 vec![SubPart::text(description)]
9380 };
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+ };
94105 Ok(view! {
95106 head(title: name.as_str(), sub: sub, live: Some(live.as_str()))
96107 org_tabs(lang: lang, name: name.clone(), current: "members".to_owned(), owner: owner, repo_count: repo_count, package_count: package_count)
97108 org_notice(notice: notice)
98109 <div class="sheet">
99- <div class="sheet-tools">
100- <strong>(g::t(lang, K::Members))</strong>
101- if owner {
102- reveal(label: g::t(lang, K::AddMemberButton), id: Some("add-member"),
103- <form method="post" action=(add_action.as_str()) class="fields">
104- <input type="hidden" name="csrf" value=(csrf.as_str())>
105- <div class="field">
106- <label for="add-member-username">(g::t(lang, K::Username))</label>
107- <input id="add-member-username" type="text" name="username" autocomplete="off" spellcheck="false" required=(true)>
108- </div>
109- <div class="field">
110- <label for="add-member-role">(g::t(lang, K::Role))</label>
111- <select id="add-member-role" name="role">
112- <option value="member" selected=(true)>(g::t(lang, K::RoleMember))</option>
113- <option value="owner">(g::t(lang, K::RoleOwner))</option>
114- </select>
115- </div>
116- <button type="submit" class="primary">(g::t(lang, K::AddMemberButton))</button>
117- </form>
118- )
119- }
120- </div>
121- if owner {
122- <p class="hint">(g::t(lang, K::OwnersHelp))</p>
123- }
124- for row in rows.iter() {
125- if owner || row.is_self {
126- <details class="row-open">
127- <summary class="line" data-kb-row="">
128- <span class="name org-who">
129- <img class="avatar avatar-sm" src=(row.avatar.as_str()) alt="" width="24" height="24">
130- <span>(row.label.as_str())</span>
131- </span>
132- <span class="val">(if row.is_owner { g::t(lang, K::RoleOwner) } else { g::t(lang, K::RoleMember) })</span>
133- </summary>
134- <div class="opened">
135- if owner {
136- <form method="post" action=(role_action.as_str()) class="fields">
137- <input type="hidden" name="csrf" value=(csrf.as_str())>
138- <input type="hidden" name="user_id" value=(row.user_id.as_str())>
139- <div class="field">
140- <label for=(format!("role-{}", row.user_id))>(g::t(lang, K::Role))</label>
141- <select id=(format!("role-{}", row.user_id)) name="role">
142- <option value="owner" selected=(row.is_owner)>(g::t(lang, K::RoleOwner))</option>
143- <option value="member" selected=(!row.is_owner)>(g::t(lang, K::RoleMember))</option>
144- </select>
145- </div>
146- <button type="submit" class="primary small">(g::t(lang, K::Save))</button>
147- </form>
148- }
149- <div class="acts">
150- <a class="act" href=(format!("/{}", row.username.as_str()))>(passkeys::s(lang, "Open profile", "Profili aç"))</a>
151- confirm_act(lang: lang, label: g::t(lang, if row.is_self { K::Leave } else { K::Remove }), action: remove_action.as_str(), csrf: csrf.as_str(), fields: vec![("user_id".to_owned(), row.user_id.clone())])
152- </div>
153- </div>
154- </details>
155- } else {
156- <a class="line" href=(format!("/{}", row.username.as_str())) data-kb-row="">
157- <span class="name org-who">
158- <img class="avatar avatar-sm" src=(row.avatar.as_str()) alt="" width="24" height="24">
159- <span>(row.label.as_str())</span>
160- </span>
161- <span class="val">(if row.is_owner { g::t(lang, K::RoleOwner) } else { g::t(lang, K::RoleMember) })</span>
162- </a>
163- }
164- }
110+ people_list(list: list)
165111 </div>
166112 })
167113 }
@@ -174,15 +120,21 @@ async fn org_members_page(cx: &Cx) -> Result<impl View> {
174120 let lang = i18n::lang(cx, Some(&ctx.viewer.0));
175121 let state = app_context::<AppState>(cx);
176122 let members = state.store.org_members(&ctx.org.id).await?;
177- let rows: Vec<MemberRow> = members
123+ let rows: Vec<PersonRow> = members
178124 .into_iter()
179- .map(|(user, role)| MemberRow {
180- is_self: user.id == ctx.viewer.0.id,
181- user_id: user.id.clone(),
182- avatar: avatar_url(&user.username, user.avatar_hash.as_deref()),
183- label: display_name(lang, &user.username),
184- username: user.username,
185- is_owner: role == OrgMemberRole::Owner,
125+ .map(|(user, role)| {
126+ let is_owner = role == OrgMemberRole::Owner;
127+ let is_self = user.id == ctx.viewer.0.id;
128+ PersonRow {
129+ is_self,
130+ user_id: user.id.clone(),
131+ avatar: avatar_url(&user.username, user.avatar_hash.as_deref()),
132+ label: display_name(lang, &user.username),
133+ username: user.username,
134+ role: if is_owner { "owner" } else { "member" }.to_owned(),
135+ role_name: g::t(lang, if is_owner { K::RoleOwner } else { K::RoleMember }).to_owned(),
136+ remove_label: g::t(lang, if is_self { K::Leave } else { K::Remove }).to_owned(),
137+ }
186138 })
187139 .collect();
188140 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};
1818 use crate::i18n::{self, Lang};
1919 use crate::live::Topic;
2020 use crate::state::AppState;
21-use crate::views::parts::{SubPart, head};
21+use crate::views::parts::head;
2222 use crate::views::{alert, csrf_field, shell, user_facing_message};
2323
2424 const MAX_DESCRIPTION_CHARS: usize = 2000;
@@ -51,7 +51,7 @@ async fn new_org_form(
5151 username: String,
5252 ) -> Result<impl View> {
5353 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())
5555 crate::pages::profile::own_profile_tabs(lang: lang, username: username, current: "organizations".to_owned())
5656 <div class="sheet fit">
5757 if let Some(message) = error {
crates/forge-web/src/pages/org_settings.rsmodified+0 -3
@@ -114,7 +114,6 @@ async fn settings_body(
114114 <option value=(*choice) selected=(*choice == default_role.as_str())>(g::role_name(lang, choice))</option>
115115 }
116116 </select>
117- <p class="hint">(g::t(lang, K::DefaultRoleHelp))</p>
118117 </div>
119118 <label class="switch">
120119 <input type="checkbox" name="members_can_create" value="on" checked=(members_can_create)>
@@ -128,7 +127,6 @@ async fn settings_body(
128127 <section class="sec">
129128 <h2>(t(lang, Key::Avatar))</h2>
130129 <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>
132130 <div class="acts">
133131 reveal(label: t(lang, Key::UploadPhoto), id: Some("org-avatar"),
134132 <form method="post" action=(avatar_action.as_str()) enctype="multipart/form-data" class="fields">
@@ -147,7 +145,6 @@ async fn settings_body(
147145 </section>
148146 <section class="sec">
149147 <h2>(g::t(lang, K::DeleteOrg))</h2>
150- <p class="hint">(g::t(lang, K::DeleteOrgIntro))</p>
151148 <div class="acts">
152149 <details class="reveal">
153150 <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(
237237 )
238238 }
239239 </div>
240- <p class="hint">(g::t(lang, K::TeamsIntro))</p>
241240 if rows.is_empty() {
242241 <p class="state">(g::t(lang, K::NoTeamsYet))</p>
243242 }
crates/forge-web/src/pages/packages.rsmodified+0 -1
@@ -334,7 +334,6 @@ async fn package_view(page: PackagePage) -> Result<impl View> {
334334 <p>(description.as_str())</p>
335335 }
336336 <h2>(install)</h2>
337- <p class="hint">(pk::t(lang, K::InstallHelp))</p>
338337 <p class="hint">(pk::t(lang, K::InstallRegistryConfig))</p>
339338 <div class="copy-box">
340339 <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> {
127127 <div class="sheet">
128128 <section class="sec">
129129 <h2>(pk::t(lang, K::Install))</h2>
130- <p class="hint">(pk::t(lang, K::ContainerInstallHelp))</p>
131130 <p class="state">(pk::t(lang, K::ContainerLogin))</p>
132131 <div class="copy-box">
133132 <code id="oci-login">(login.as_str())</code>
@@ -156,8 +155,7 @@ pub async fn oci_package_view(page: OciPage) -> Result<impl View> {
156155 <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>
157156 if can_delete {
158157 confirm_act(lang: lang, label: pk::t(lang, K::DeleteTag), action: delete_action.as_str(), csrf: csrf.as_str(),
159- fields: vec![("package".to_owned(), package.name.clone()), ("tag".to_owned(), tag.clone())],
160- note: Some(pk::t(lang, K::DeleteTagMessage).to_owned()))
158+ fields: vec![("package".to_owned(), package.name.clone()), ("tag".to_owned(), tag.clone())])
161159 }
162160 </div>
163161 }
crates/forge-web/src/pages/palette.rsmodified+41 -15
@@ -318,12 +318,13 @@ fn repo_pages(lang: Lang) -> Vec<Value> {
318318 "settings",
319319 true,
320320 &[
321- "Visibility",
322- "Görünürlük",
323- "Archive",
324- "Arşiv",
325321 "Description",
326322 "Açıklama",
323+ "Features",
324+ "Özellikler",
325+ "Wiki",
326+ "Discussions",
327+ "Tartışmalar",
327328 ],
328329 ),
329330 repo_page(
@@ -338,12 +339,6 @@ fn repo_pages(lang: Lang) -> Vec<Value> {
338339 true,
339340 &["Access", "Erişim", "Members"],
340341 ),
341- repo_page(
342- admin(RK::RenameTransferNav),
343- "settings/rename",
344- true,
345- &["Rename", "Transfer"],
346- ),
347342 repo_page(admin(RK::Webhooks), "settings/hooks", true, &["Hooks"]),
348343 repo_page(
349344 admin(RK::Mirrors),
@@ -357,12 +352,20 @@ fn repo_pages(lang: Lang) -> Vec<Value> {
357352 true,
358353 &["Variables", "Env"],
359354 ),
360- repo_page(code(CK::TabWiki), "settings/wiki", true, &[]),
361355 repo_page(
362356 admin(RK::DangerZone),
363357 "settings?section=danger",
364358 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+ ],
366369 ),
367370 ]
368371 }
@@ -445,6 +448,25 @@ async fn palette(cx: &Cx) -> Result<Response> {
445448 let terms = terms_for(ADMIN_TERMS, &item.href);
446449 push_terms(&mut items, &mut seen, &label, &item.href, "page", terms);
447450 }
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+ }
448470 let queue = format!(
449471 "{admin_area} \u{b7} {}",
450472 s(lang, "Mail queue", "E-posta kuyruğu")
@@ -467,9 +489,13 @@ async fn palette(cx: &Cx) -> Result<Response> {
467489 (Lang::Tr, Some((tr, _))) => tr,
468490 _ => field.label,
469491 };
470- let page = page_of(field.key);
471- let label = format!("{server} \u{b7} {} \u{b7} {name}", page.label(lang));
472- let href = format!("/admin/server?cat={}#srv-{}", page.slug, field.key);
492+ let home = page_of(lang, field.key);
493+ let label = if home.server {
494+ format!("{server} \u{b7} {} \u{b7} {name}", home.label)
495+ } else {
496+ format!("{} \u{b7} {name}", home.label)
497+ };
498+ let href = home.href;
473499 let terms = [field.key, field.label];
474500 push_terms(&mut items, &mut seen, &label, &href, "page", &terms);
475501 }
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
675675 }
676676 if let Some(text) = problem_text {
677677 <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>
680678 }
681679 for (item, rename_action, delete_action, field) in rows.into_iter() {
682680 <details class="row-open">
@@ -696,7 +694,7 @@ pub async fn passkeys_panel(lang: Lang, csrf: &str, panel: PasskeyPanel) -> Resu
696694 <button type="submit" class="primary">(t(lang, Key::Save))</button>
697695 </form>
698696 )
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)
700698 </div>
701699 </div>
702700 </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() {
589589 passkeys[0].id
590590 );
591591 assert!(page.body.contains(&delete_action));
592- assert!(page.body.contains("Delete this passkey?"));
593592 let login = send(&fx.router, "GET", "/login", None, &[]).await;
594593 assert!(login.body.contains("data-passkey-signin"));
595594 assert!(login.body.contains("autocomplete=\"username webauthn\""));
crates/forge-web/src/pages/profile.rsmodified+1 -2
@@ -771,7 +771,7 @@ async fn profile_card(
771771 if let Some(summary) = org {
772772 <section class="sec profile-org">
773773 <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>
775775 if summary.members.is_empty() {
776776 <p class="state">(g::t(lang, K::NoMembers))</p>
777777 } else {
@@ -816,7 +816,6 @@ async fn profile_card(
816816 if packages_on {
817817 <section class="sec package-listing" data-live=(packages_events.as_str())>
818818 <h2>(pk::t(lang, PK::PackagesHeading))</h2>
819- <p class="hint">(pk::t(lang, PK::PackagesHelp))</p>
820819 if has_packages {
821820 for row in package_rows.into_iter() {
822821 <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(
7070 <summary class="act">(g::t(lang, K::CustomizePins))</summary>
7171 <form method="post" action=(action.as_str()) class="menu-list">
7272 <input type="hidden" name="csrf" value=(csrf.as_str())>
73- <p class="hint">(g::t(lang, K::PinsIntro))</p>
7473 <ul class="pin-options">
7574 for option in options.into_iter() {
7675 <li>
crates/forge-web/src/pages/pull_files.rsmodified+5 -14
@@ -214,12 +214,11 @@ async fn files_rail(
214214 ) -> Result<impl View> {
215215 let mark = g::t(lang, K::ViewedMark);
216216 let changed = g::t(lang, K::ChangedSinceViewed);
217- let hint = g::t(lang, K::ViewedHint);
218217 let viewed_files = g::t(lang, K::ViewedFiles);
219218 let heading = passkeys::s(lang, "Files", "Dosyalar");
220219 Ok(view! {
221220 <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>
223222 <div class="rail-list">
224223 for file in rows.into_iter() {
225224 <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(
359358 let comment = g::t(lang, K::CommentChoice).trim();
360359 let approve = review_strings::t(lang, review_strings::K::ApproveChoice).trim();
361360 let changes = review_strings::t(lang, review_strings::K::RequestChangesChoice).trim();
362- let placeholder = passkeys::s(lang, "Optional", "İsteğe bağlı");
363361 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");
371362 let threads_text = match lang {
372363 Lang::Tr => format!("{open_threads} açık konu"),
373364 Lang::En if open_threads == 1 => "1 open thread".to_owned(),
@@ -388,14 +379,14 @@ async fn review_bar(
388379 <input type="hidden" name="csrf" value=(csrf.as_str())>
389380 <div class="field">
390381 <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>
392383 </div>
393384 // An author cannot approve or block their own pull, so they only comment.
394385 if !is_author {
395- <label class="opt"><input type="radio" name="state" value="approve"><span>(approve)<small>(approve_hint)</small></span></label>
396- <label class="opt"><input type="radio" name="state" value="request_changes"><span>(changes)<small>(changes_hint)</small></span></label>
386+ <label class="opt"><input type="radio" name="state" value="approve"><span>(approve)</span></label>
387+ <label class="opt"><input type="radio" name="state" value="request_changes"><span>(changes)</span></label>
397388 }
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>
399390 <div class="acts decide-send">
400391 <button type="submit" class="primary">(submit)</button>
401392 <span class="hint">(pending_text.as_str())</span>
crates/forge-web/src/pages/pull_view.rsmodified+46 -56
@@ -17,7 +17,7 @@ use topcoat::router::content::Form;
1717 use topcoat::router::error::{not_found, see_other};
1818 use topcoat::router::request::uri;
1919 use topcoat::router::{page, path_param};
20-use topcoat::view::{View, component, view};
20+use topcoat::view::{Child, View, component, view};
2121
2222 use crate::auth::require_user;
2323 use crate::i18n::pulls_review::{self as g, K};
@@ -26,8 +26,8 @@ use crate::pages::commits::{CommitRow, now_secs};
2626 use crate::pages::issue_meta::item_href;
2727 use crate::pages::issue_parts::{
2828 CommentForm, ItemKind, Posted, When, check_write, comment_form, csrf_of, discussion_timeline,
29- item_sidebar, load_discussion, load_sidebar, lock_message, may_change, may_converse,
30- parse_number, post_comment, reachable_among, triage, viewer,
29+ item_head_tools, item_sidebar, load_discussion, load_sidebar, lock_message, may_change,
30+ may_converse, parse_number, post_comment, reachable_among, triage, viewer,
3131 };
3232 use crate::pages::notifications::notify_box_for;
3333 use crate::pages::pull_branch::{self, branch_box, branch_error_from};
@@ -191,7 +191,11 @@ pub(crate) async fn frame_in(
191191 /// The head of every pull request tab: the title with the review buttons beside it, the byline,
192192 /// then the pull request's tabs. `active` names the tab that is open.
193193 #[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> {
195199 let Frame {
196200 title,
197201 number,
@@ -235,6 +239,7 @@ pub(crate) async fn pull_header(frame: Frame, active: String) -> Result<impl Vie
235239 <section class="head" data-live=(live_url.as_str())>
236240 <div class="head-title">
237241 <h1>(title.as_str()) " " <span class="num">(number_label.as_str())</span></h1>
242+ (child)
238243 </div>
239244 <p class="head-sub">
240245 <span class=(state_class)>(state_text)</span>
@@ -315,7 +320,6 @@ async fn merge_box(
315320 headline: String,
316321 tone: String,
317322 conflicts: Vec<String>,
318- reload: Option<String>,
319323 form: Option<MergeForm>,
320324 merge_error: Option<String>,
321325 approvals: Option<String>,
@@ -326,13 +330,11 @@ async fn merge_box(
326330 lang: Lang,
327331 ) -> Result<impl View> {
328332 let class = format!("sec merge-{tone}");
329- let heading = crate::pages::passkeys::s(lang, "Merge", "Birleştirme");
330333 let required_heading = g::t(lang, K::RequiredChecksHeading);
331334 let style_rebase = g::t(lang, K::StyleRebase);
332335 let style_merge_option = g::t(lang, K::StyleMergeCommit);
333336 let style_squash_option = g::t(lang, K::StyleSquash);
334337 let enable_auto = g::t(lang, K::EnableAutoMerge);
335- let auto_hint = g::t(lang, K::AutoMergeHint);
336338 let disable_auto = g::t(lang, K::DisableAutoMerge);
337339 let FlowView {
338340 csrf: flow_csrf,
@@ -346,8 +348,6 @@ async fn merge_box(
346348 crate::i18n::merge_queue::t(lang, crate::i18n::merge_queue::K::AddToMergeQueue);
347349 let queue_remove_label =
348350 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);
351351 let style_legend = g::t(lang, K::MergeStyleLegend);
352352 let style_merge = g::t(lang, K::StyleMergeCommit);
353353 let style_squash = g::t(lang, K::StyleSquash);
@@ -356,27 +356,28 @@ async fn merge_box(
356356 let merge_button = g::t(lang, K::MergeButton);
357357 Ok(view! {
358358 <section class=(class.as_str())>
359- <h2>(heading)</h2>
360359 if let Some(text) = merge_error {
361360 <p class="alert merge-error" role="alert">(text.as_str())</p>
362361 }
363- <p class="state merge-headline">(headline.as_str())</p>
364- if let Some(summary) = checks {
365- checks_summary(summary: summary, lang: StatusLang(lang))
366- }
362+ <div class="line merge-state">
363+ <span class="val merge-headline">(headline.as_str())</span>
364+ if let Some(summary) = checks {
365+ checks_summary(summary: summary, lang: StatusLang(lang))
366+ }
367+ </div>
367368 if !required.is_empty() {
368369 <div>
369- <p class="hint">(required_heading)</p>
370+ <p class="state">(required_heading)</p>
370371 for row in required.iter() {
371372 <div class=(format!("line {}", row.class))><span class="name"><code>(row.context.as_str())</code></span><span class="val">(row.label)</span></div>
372373 }
373374 </div>
374375 }
375376 if let Some(text) = approvals {
376- <p class="hint">(text.as_str())</p>
377+ <p class="state">(text.as_str())</p>
377378 }
378379 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>
380381 }
381382 if !conflicts.is_empty() {
382383 <div>
@@ -385,11 +386,6 @@ async fn merge_box(
385386 }
386387 </div>
387388 }
388- if let Some(href) = reload {
389- <div class="acts">
390- <a class="act" href=(href.as_str())>(reload_text)</a>
391- </div>
392- }
393389 if let Some(f) = form {
394390 <form method="post" action=(f.action.as_str()) class="fields merge-form">
395391 <input type="hidden" name="csrf" value=(f.csrf.as_str())>
@@ -413,15 +409,14 @@ async fn merge_box(
413409 </form>
414410 }
415411 if let Some((text, action)) = queue_position {
416- <p class="state">(text.as_str())</p>
417- <div class="acts">
412+ <div class="line">
413+ <span class="val">(text.as_str())</span>
418414 confirm_act(lang: lang, label: queue_remove_label, action: action.as_str(), csrf: flow_csrf.as_str())
419415 </div>
420416 }
421417 if let Some(action) = queue_add {
422418 <form method="post" action=(action.as_str()) class="fields">
423419 <input type="hidden" name="csrf" value=(flow_csrf.as_str())>
424- <p class="hint">(queue_hint)</p>
425420 <div class="field">
426421 <label for="queue-style">(queue_add_label)</label>
427422 <select id="queue-style" name="style">
@@ -434,15 +429,14 @@ async fn merge_box(
434429 </form>
435430 }
436431 if let Some((text, action)) = auto_on {
437- <p class="state">(text.as_str())</p>
438- <div class="acts">
432+ <div class="line">
433+ <span class="val">(text.as_str())</span>
439434 post_act(label: disable_auto, action: action.as_str(), csrf: flow_csrf.as_str())
440435 </div>
441436 }
442437 if let Some(action) = auto_enable {
443438 <form method="post" action=(action.as_str()) class="fields">
444439 <input type="hidden" name="csrf" value=(flow_csrf.as_str())>
445- <p class="hint">(auto_hint)</p>
446440 <div class="field">
447441 <label for="auto-style">(enable_auto)</label>
448442 <select id="auto-style" name="style">
@@ -455,7 +449,7 @@ async fn merge_box(
455449 </form>
456450 }
457451 if let Some((action, label)) = draft_toggle {
458- <div class="acts">
452+ <div class="line">
459453 post_act(label: label, action: action.as_str(), csrf: flow_csrf.as_str())
460454 </div>
461455 }
@@ -524,7 +518,7 @@ async fn review_box(
524518 <p class="state">(text.as_str())</p>
525519 }
526520 if let Some(text) = approved_before {
527- <p class="hint">(text.as_str())</p>
521+ <p class="state">(text.as_str())</p>
528522 }
529523 if let Some(text) = changes {
530524 <p class="state">(text.as_str())</p>
@@ -640,7 +634,7 @@ async fn pull_conversation(
640634 .await?;
641635 let sidebar = load_sidebar(state, &ctx.repo.id, &pr.issue).await?;
642636 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?;
644638 let reviewers = load_reviewers(cx, state, &ctx, &pr.issue, &href).await?;
645639 let csrf = csrf_of(&ctx);
646640 let checks = head_checks(state, &ctx, &pr).await?;
@@ -655,32 +649,27 @@ async fn pull_conversation(
655649 let write_meta = !archived && triage(&ctx);
656650 let comment_action = format!("{href}/comments");
657651 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()));
658654 let login_href = "/login".to_owned();
659655 let archived_text = g::t(lang, K::ArchivedReadOnly);
660656 let login_before = g::t(lang, K::LoginBefore);
661657 let login_link = g::t(lang, K::LoginLink);
662658 let login_after = g::t(lang, K::LoginAfter);
663659
664- let (headline, tone, conflicts, reload) = match pr.mergeable {
665- Mergeable::Clean => (g::t(lang, K::MergeClean).to_owned(), "ok", Vec::new(), None),
660+ // A result still being computed arrives on the page's live stream (`refresh_mergeability`
661+ // bumps the pull), so the state line updates by itself and needs no reload control.
662+ let (headline, tone, conflicts) = match pr.mergeable {
663+ Mergeable::Clean => (g::t(lang, K::MergeClean).to_owned(), "ok", Vec::new()),
666664 Mergeable::Conflict => (
667665 g::t(lang, K::MergeConflict).to_owned(),
668666 "bad",
669667 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()),
683668 ),
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+ }
684673 };
685674 let can_write = !archived
686675 && authorize(
@@ -914,7 +903,9 @@ async fn pull_conversation(
914903 let live = format!("{href}/events");
915904 Ok(view! { cx =>
916905 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+ )
918909 if let Some(message) = review_error {
919910 alert(message: message)
920911 }
@@ -926,7 +917,7 @@ async fn pull_conversation(
926917 }
927918 if open {
928919 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,
930921 approvals: approvals, blocked: blocked, checks: checks,
931922 required: required, flow: flow, lang: lang)
932923 }
@@ -938,19 +929,18 @@ async fn pull_conversation(
938929 branch_box(lang: lang, action: branch, error: branch_error)
939930 }
940931 if can_comment {
941- comment_form(lang: lang, action: comment_action, state_action: state_action,
942- csrf: csrf.clone(), draft: draft, error: error, can_close: can_close, open: open)
932+ comment_form(lang: lang, action: comment_action, csrf: csrf.clone(), draft: draft, error: error)
943933 }
944934 // What the pull request is filed under comes after the conversation, as on an issue.
945935 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)
947937 if archived {
948- <p class="hint">(archived_text)</p>
938+ <p class="state">(archived_text)</p>
949939 }
950940 if locked_for_viewer {
951- <p class="hint">(lock_notice.as_str())</p>
941+ <p class="state">(lock_notice.as_str())</p>
952942 } 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>
954944 }
955945 </div>
956946 )
@@ -1314,7 +1304,7 @@ mod tests {
13141304 assert!(body.contains("Add feature"), "clean: {body}");
13151305 assert!(body.contains("issue-badge-open\">Open<"), "clean: {body}");
13161306 assert!(
1317- body.contains("This branch has no conflicts with the base branch"),
1307+ body.contains("Ready to merge"),
13181308 "clean: {body}"
13191309 );
13201310 assert!(
@@ -1333,7 +1323,7 @@ mod tests {
13331323 let (status, _, body) = send(&fx.router, "GET", &uri, Some("bob-token"), None).await;
13341324 assert_eq!(status, 200, "reader");
13351325 assert!(
1336- body.contains("This branch has no conflicts with the base branch"),
1326+ body.contains("Ready to merge"),
13371327 "reader: {body}"
13381328 );
13391329 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> {
333333 </div>
334334 </form>
335335 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>
337337 }
338338 if rows.is_empty() {
339339 <p class="state">(empty_text)</p>
crates/forge-web/src/pages/register.rsmodified+3 -13
@@ -26,7 +26,7 @@ use crate::mail::account;
2626 use crate::pages::settings_security::mail_can_send;
2727 use crate::state::AppState;
2828 use crate::throttle;
29-use crate::views::parts::{SubPart, head};
29+use crate::views::parts::head;
3030 use crate::views::{alert, shell, user_facing_message};
3131
3232 const MIN_PASSWORD_CHARS: usize = 12;
@@ -129,13 +129,8 @@ async fn register_form(
129129 precsrf: &str,
130130 error: Option<String>,
131131 ) -> 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- };
137132 Ok(view! {
138- head(title: t(lang, Key::RegisterTitle), sub: sub)
133+ head(title: t(lang, Key::RegisterTitle))
139134 <div class="sheet fit">
140135 if gate == Gate::NeedsInvite {
141136 <p class="state">(t(lang, Key::RegisterNeedsInvite))</p>
@@ -353,13 +348,8 @@ async fn verify_body(
353348 precsrf: &str,
354349 mode: VerifyMode,
355350 ) -> Result<impl View> {
356- let sub = if mode == VerifyMode::Confirm {
357- vec![SubPart::text(t(lang, Key::VerifyConfirmSub))]
358- } else {
359- Vec::new()
360- };
361351 Ok(view! {
362- head(title: t(lang, Key::VerifyTitle), sub: sub)
352+ head(title: t(lang, Key::VerifyTitle))
363353 <div class="sheet fit">
364354 if mode == VerifyMode::Confirm {
365355 <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(
353353 branches: Vec<String>,
354354 submit: &'static str,
355355 ) -> Result<impl View> {
356- let tag_hint = g::t(lang, K::TagHint);
357- let edit_tag_help = g::t(lang, K::EditTagHelp);
358356 Ok(view! {
359357 <form method="post" action=(action.as_str()) class="fields release-form">
360358 if let Some(message) = draft.error {
@@ -365,7 +363,6 @@ async fn release_form(
365363 <div class="field">
366364 <label for="release-tag">(g::t(lang, K::Tag))</label>
367365 <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>
369366 </div>
370367 <div class="field">
371368 <label for="release-target">(g::t(lang, K::TargetBranch))</label>
@@ -374,13 +371,11 @@ async fn release_form(
374371 <option value=(branch.as_str()) selected=(branch.as_str() == draft.target.as_str())>(branch.as_str())</option>
375372 }
376373 </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>
378374 </div>
379375 } else {
380376 <div class="field">
381377 <label for="release-tag">(g::t(lang, K::Tag))</label>
382378 <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>
384379 </div>
385380 if move_target {
386381 <div class="field">
@@ -391,10 +386,7 @@ async fn release_form(
391386 <option value=(branch.as_str()) selected=(branch.as_str() == draft.target.as_str())>(branch.as_str())</option>
392387 }
393388 </select>
394- <p class="hint">(g::t(lang, K::TargetMoveHelp))</p>
395389 </div>
396- } else {
397- <p class="hint">(g::t(lang, K::TargetLockedHelp))</p>
398390 }
399391 }
400392 <div class="field">
@@ -859,7 +851,7 @@ async fn release_tag_page(cx: &Cx) -> Result<impl View> {
859851 if writer {
860852 <section class="sec">
861853 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())])
863855 </section>
864856 }
865857 </div>
@@ -918,7 +910,6 @@ async fn edit_body(
918910 </section>
919911 <section class="sec">
920912 <h2>(g::t(lang, K::DeleteRelease))</h2>
921- <p class="hint">(g::t(lang, K::DeleteReleaseHelp))</p>
922913 <div class="acts">
923914 confirm_act(lang: lang, label: g::t(lang, K::DeleteRelease), action: delete_href.as_str(), csrf: csrf.as_str(),
924915 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() {
668668 !html.contains("name=\"target\""),
669669 "published hides the target"
670670 );
671- assert!(
672- html.contains("Published releases keep their commit"),
673- "{html}"
674- );
675671 }
676672
677673 // 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(
243243 <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>
244244 <label for="clone-ssh">"SSH"</label>
245245 <input id="clone-ssh" class="mono" type="text" readonly=(true) value=(ssh.as_str())>
246- <p class="hint">(g::t(lang, K::SshRequiresKey))</p>
247246 if let Some((zip, tar)) = downloads {
248247 <nav class="sub" aria-label=(g::t(lang, K::DownloadNav))>
249248 <a href=(zip)>(g::t(lang, K::DownloadZip))</a>
@@ -711,7 +710,7 @@ mod tests {
711710 assert!(body.contains("default"), "default branch marked");
712711 let (status, body) = get(&router, "/tahinli/demo/tags").await;
713712 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."));
715714 let (status, body) = get(&router, "/tahinli/demo/tree/main").await;
716715 assert_eq!(status, 200);
717716 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};
3131 use crate::pages::repo_settings::settings_frame;
3232 use crate::pages::repo_settings_live::settings_head;
3333 use crate::state::AppState;
34-use crate::views::parts::{confirm_act, reveal};
34+use crate::views::parts::{PeopleList, PersonRow, people_list};
3535 use crate::views::{alert, avatar_url, display_name, shell};
3636
3737 path_param!(owner);
@@ -62,15 +62,6 @@ const ROLES: [Role; 5] = [
6262 Role::Admin,
6363 ];
6464
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-
7465 #[derive(Deserialize)]
7566 struct AddForm {
7667 #[serde(default)]
@@ -99,16 +90,6 @@ struct RemoveForm {
9990 user_id: String,
10091 }
10192
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-
11293 /// Sets the notice shown on the next collaborators page view.
11394 fn set_notice(cx: &Cx, word: &'static str) {
11495 cookies(cx).add(
@@ -157,94 +138,6 @@ fn collaborators_redirect(title: &str) -> SeeOther {
157138 see_other(format!("/{title}/settings/collaborators"))
158139 }
159140
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-
248141 /// Everything the collaborators page shows besides the repo header.
249142 struct FrameData {
250143 page_title: String,
@@ -268,7 +161,7 @@ impl FrameData {
268161 async fn collaborators_body(
269162 lang: Lang,
270163 frame: FrameData,
271- rows: Vec<CollabRow>,
164+ rows: Vec<PersonRow>,
272165 csrf: String,
273166 notice: Option<(K, bool)>,
274167 ) -> Result<impl View> {
@@ -280,11 +173,47 @@ async fn collaborators_body(
280173 // A refused add (or role change) reopens the add panel; a missing collaborator does not.
281174 let add_open = matches!(notice, Some((key, true)) if !matches!(key, K::NotCollaborator));
282175 let notice = notice.map(|(key, is_error)| (g::t(lang, key), is_error));
283- let can_delete = header.can_delete;
284176 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+ };
285214 Ok(view! {
286215 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",
288217 if let Some((text, is_error)) = notice {
289218 if is_error {
290219 alert(message: text)
@@ -292,8 +221,7 @@ async fn collaborators_body(
292221 <p class="state" role="status">(text)</p>
293222 }
294223 }
295- collaborators_pane(lang: lang, rows: rows, role_action: role_action,
296- remove_action: remove_action, add_action: add_action, csrf: csrf, add_open: add_open)
224+ people_list(list: list)
297225 )
298226 })
299227 }
@@ -312,14 +240,26 @@ async fn collaborators_page(cx: &Cx) -> Result<impl View> {
312240 let lang = i18n::lang(cx, Some(&user));
313241 let state = app_context::<AppState>(cx);
314242 let collaborators = state.store.list_collaborators(&ctx.repo.id).await?;
243+ let viewer_id = user.id.clone();
315244 let rows = collaborators
316245 .into_iter()
317- .map(|(user, role)| CollabRow {
318- user_id: user.id.clone(),
319- avatar: avatar_url(&user.username, user.avatar_hash.as_deref()),
320- label: display_name(lang, &user.username),
321- username: user.username,
322- role,
246+ .map(|(member, role)| {
247+ let is_self = member.id == viewer_id;
248+ PersonRow {
249+ user_id: member.id.clone(),
250+ avatar: avatar_url(&member.username, member.avatar_hash.as_deref()),
251+ label: display_name(lang, &member.username),
252+ role: role.as_str().to_owned(),
253+ role_name: crate::i18n::orgs::role_name(lang, role.as_str()).to_owned(),
254+ is_self,
255+ remove_label: if is_self {
256+ crate::i18n::orgs::t(lang, crate::i18n::orgs::K::Leave)
257+ } else {
258+ g::t(lang, K::Remove)
259+ }
260+ .to_owned(),
261+ username: member.username,
262+ }
323263 })
324264 .collect();
325265 let notice = take_notice(cx);
crates/forge-web/src/pages/repo_ctx.rsmodified+0 -3
@@ -62,8 +62,6 @@ pub struct RepoHead {
6262 pub active: &'static str,
6363 /// Whether the viewer may open the Settings tab.
6464 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,
6765 /// Open issues, for the Issues tab count.
6866 pub open_issues: u64,
6967 /// Open pull requests, for the Pull requests tab count.
@@ -258,7 +256,6 @@ impl RepoCtx {
258256 archived: self.repo.archived,
259257 active,
260258 can_admin: self.can_admin(),
261- can_delete: self.can_delete(),
262259 open_issues: self.open_issues(state).await?,
263260 open_pulls,
264261 forked_from,
crates/forge-web/src/pages/repo_mirrors.rsmodified+3 -31
@@ -399,10 +399,9 @@ async fn frame_top(
399399 lang: Lang,
400400 #[default] child: Child<'_>,
401401 ) -> Result<impl View> {
402- let can_delete = head.can_delete;
403402 Ok(view! {
404403 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",
406405 if let Some((text, is_error)) = notice {
407406 if is_error {
408407 alert(message: text)
@@ -442,16 +441,6 @@ async fn mirror_form(
442441 } else {
443442 g::t(lang, K::RemoteUrl)
444443 };
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- };
455444 let url_id = format!("{prefix}-url");
456445 let username_id = format!("{prefix}-username");
457446 let secret_id = format!("{prefix}-secret");
@@ -471,7 +460,6 @@ async fn mirror_form(
471460 <div class="field">
472461 <label for=(url_id.as_str())>(url_label)</label>
473462 <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>
475463 </div>
476464 <div class="field">
477465 <label for=(username_id.as_str())>(g::t(lang, K::UsernameOptional))</label>
@@ -480,7 +468,6 @@ async fn mirror_form(
480468 <div class="field">
481469 <label for=(secret_id.as_str())>(g::t(lang, K::SecretOptional))</label>
482470 <input id=(secret_id.as_str()) type="password" name="secret" autocomplete="new-password" maxlength="1024">
483- <p class="hint">(secret_hint)</p>
484471 </div>
485472 if has_secret {
486473 <label class="switch">
@@ -519,7 +506,6 @@ async fn mirrors_list_body(
519506 ) -> Result<impl View> {
520507 let add_action = mirrors_href(&title);
521508 let empty = rows.is_empty();
522- let can_pull = pull_form.is_some();
523509 let pull_open = pull_form.as_ref().is_some_and(|pull| pull.error.is_some());
524510 let push_open = draft.error.is_some();
525511 Ok(view! {
@@ -562,10 +548,6 @@ async fn mirrors_list_body(
562548 if let Some(pull) = pull_form {
563549 <section class="sec" id="add-pull-mirror">
564550 <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- }
569551 <div class="acts">
570552 reveal(label: g::t(lang, K::AddPullMirror), open: pull_open,
571553 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(
577559 }
578560 <section class="sec" id="add-push-mirror">
579561 <h2>(g::t(lang, K::AddPushMirror))</h2>
580- if !empty || can_pull {
581- <p class="hint">(g::t(lang, K::AddPushIntro))</p>
582- }
583562 <div class="acts">
584563 reveal(label: g::t(lang, K::AddPushMirror), open: push_open,
585564 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(
803782 let sync_action = format!("{edit_action}/sync");
804783 let delete_action = format!("{edit_action}/delete");
805784 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- };
811785 let current_url = redacted_url(&mirror.url);
812786 let heading = current_url.clone();
813787 Ok(view! {
@@ -816,7 +790,7 @@ async fn mirror_body(
816790 <section class="sec">
817791 <h2>(mirror_kind(lang, mirror.direction))</h2>
818792 <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>
820794 if let Some(error) = mirror.last_error.clone() {
821795 <pre class="mirror-error">(error.as_str())</pre>
822796 }
@@ -833,16 +807,14 @@ async fn mirror_body(
833807 if !archived {
834808 <section class="sec">
835809 <h2>(g::t(lang, K::SyncHeading))</h2>
836- <p class="hint">(g::t(lang, K::SyncIntro))</p>
837810 <div class="acts">
838811 post_act(label: g::t(lang, K::SyncNow), action: sync_action.as_str(), csrf: csrf.as_str())
839812 </div>
840813 </section>
841814 <section class="sec">
842815 <h2>(g::t(lang, K::DeleteMirror))</h2>
843- <p class="hint">(delete_text)</p>
844816 <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())])
846818 </div>
847819 </section>
848820 }
crates/forge-web/src/pages/repo_rename.rsmodified+57 -187
@@ -1,45 +1,34 @@
1-//! Page: rename and transfer a repo (`/{owner}/{repo}/settings/rename`). Renaming needs `Action::Admin`
2-//! (owner, instance admin, or an Admin collaborator). Transferring needs `Action::Delete` (owner or
3-//! instance admin) and a typed `owner/name` confirmation. A non-admin transfer is only offered: the
4-//! target accepts it on `pages::repo_transfer`, and an instance admin's moves at once. The old
5-//! owner/name keeps working through a redirect (see `store::move_repo` and `pages::repo_ctx`). The
6-//! bare repo on disk never moves.
1+//! Rename and transfer, the first two topics of the danger zone (`/{owner}/{repo}/settings?section=danger`,
2+//! see `pages::repo_settings`). `POST /{owner}/{repo}/settings/rename` renames the repo and needs
3+//! `Action::Admin` (owner, instance admin, or an Admin collaborator). `POST /{owner}/{repo}/settings/transfer`
4+//! needs `Action::Delete` (owner or instance admin) and a typed `owner/name` confirmation. A non-admin
5+//! transfer is only offered: the target accepts it on `pages::repo_transfer`, and an instance admin's
6+//! moves happen at once. The old owner/name keeps working through a redirect (see `store::move_repo` and
7+//! `pages::repo_ctx`). The bare repo on disk never moves.
78
89 use forge_core::store::orgs::OrgMemberRole;
910 use forge_core::{AuditAction, Error as CoreError};
1011 use serde::Deserialize;
1112 use topcoat::Result;
1213 use topcoat::context::{Cx, app_context};
13-use topcoat::cookie::{Cookie, Cookies, SameSite, cookies};
1414 use topcoat::router::content::Form;
15-use topcoat::router::error::{forbidden, see_other};
16-use topcoat::router::{page, path_param};
15+use topcoat::router::error::{SeeOther, forbidden, see_other};
16+use topcoat::router::{page, path_param, route};
1717 use topcoat::view::{View, component, view};
1818
1919 use crate::audit::{self, Actor, Target};
20-use crate::auth::{require_csrf, require_user};
20+use crate::auth::require_csrf;
2121 use crate::i18n::repo_admin::{self as g, K};
2222 use crate::i18n::{self, Lang};
23-use crate::pages::repo::repo_head;
24-use crate::pages::repo_ctx::{RepoCtx, RepoHead, load_repo};
25-use crate::pages::repo_settings::settings_frame;
26-use crate::pages::repo_settings_live::settings_head;
23+use crate::pages::repo_ctx::load_repo;
24+use crate::pages::repo_settings::{DangerForms, Shown, render_settings, set_settings_notice};
2725 use crate::state::AppState;
26+use crate::views::alert;
2827 use crate::views::parts::reveal;
29-use crate::views::{alert, shell};
3028
3129 path_param!(owner);
3230 path_param!(repo);
3331
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-
4332 #[derive(Deserialize)]
4433 struct RenameForm {
4534 #[serde(default)]
@@ -58,170 +47,50 @@ struct TransferForm {
5847 confirm: String,
5948 }
6049
61-/// What the two forms show: the drafts the viewer typed and any error for each form.
62-struct Forms {
63- rename_name: String,
64- rename_error: Option<String>,
65- transfer_owner: String,
66- transfer_error: Option<String>,
67-}
68-
69-impl Forms {
70- fn fresh(ctx: &RepoCtx) -> Self {
71- Self {
72- rename_name: ctx.repo.name.clone(),
73- rename_error: None,
74- transfer_owner: String::new(),
75- transfer_error: None,
76- }
77- }
78-}
79-
80-fn set_notice(cx: &Cx, word: &'static str) {
81- cookies(cx).add(
82- Cookie::build((NOTICE_COOKIE, word))
83- .path("/")
84- .http_only(true)
85- .same_site(SameSite::Lax)
86- .build(),
87- );
88-}
89-
90-/// Reads and clears the notice cookie. Only the fixed words are shown.
91-fn take_notice(cx: &Cx) -> Option<K> {
92- let jar = cookies(cx);
93- let value = jar.get(NOTICE_COOKIE)?.value().to_owned();
94- jar.remove(Cookie::build((NOTICE_COOKIE, "")).path("/"));
95- NOTICES
96- .iter()
97- .find(|(word, _)| *word == value)
98- .map(|(_, key)| *key)
99-}
100-
101-/// Rename and transfer forms. The transfer section is shown only when the viewer may delete the repo.
50+/// The Rename topic of the danger zone: the form opens in place. `error` is a refused name, and the
51+/// form opens with it and keeps the typed `name`.
10252 #[component]
103-async fn rename_body(
53+pub(crate) async fn rename_section(
10454 lang: Lang,
105- head: RepoHead,
10655 title: String,
10756 csrf: String,
108- can_delete: bool,
109- notice: Option<K>,
110- forms: Forms,
57+ name: String,
58+ error: Option<String>,
11159 ) -> Result<impl View> {
112- let rename_action = format!("/{title}/settings/rename");
113- let transfer_action = format!("/{title}/settings/transfer");
114- let status_href = format!("/{title}/transfer");
115- let nav_title = title.clone();
116- let Forms {
117- rename_name,
118- rename_error,
119- transfer_owner,
120- transfer_error,
121- } = forms;
122- // A form whose submit was refused opens in place, so its message is visible.
123- let rename_open = rename_error.is_some();
124- let transfer_open = transfer_error.is_some();
60+ let action = format!("/{title}/settings/rename");
61+ let open = error.is_some();
12562 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- }
13163 <section class="sec">
132- <h2>(g::t(lang, K::RenameRepo))</h2>
133- <p class="hint">(g::t(lang, K::RenameHelp))</p>
64+ <h2>(g::t(lang, K::RenameHeading))</h2>
13465 <div class="acts">
135- reveal(label: g::t(lang, K::RenameRepo), open: rename_open,
136- if let Some(message) = rename_error {
66+ reveal(label: g::t(lang, K::RenameRepo), open: open,
67+ if let Some(message) = error {
13768 alert(message: message.as_str())
13869 }
139- <form method="post" action=(rename_action.as_str()) class="fields">
70+ <form method="post" action=(action.as_str()) class="fields">
14071 <input type="hidden" name="csrf" value=(csrf.as_str())>
14172 <div class="field">
14273 <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)>
14475 </div>
14576 <button type="submit" class="primary">(g::t(lang, K::RenameRepo))</button>
14677 </form>
14778 )
14879 </div>
14980 </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- )
17681 })
17782 }
17883
179-/// The repo fields the page shows, copied out of the context so the view borrows nothing from it.
180-struct Frame {
181- page_title: String,
182- title: String,
183- can_delete: bool,
184- head: RepoHead,
185-}
186-
187-impl Frame {
188- async fn new(ctx: &RepoCtx, state: &AppState, lang: Lang) -> Result<Self> {
189- let title = format!("{}/{}", ctx.repo.owner_name, ctx.repo.name);
190- Ok(Self {
191- page_title: g::page_title(lang, &title),
192- title,
193- can_delete: ctx.can_delete(),
194- head: settings_head(ctx, state).await?,
195- })
196- }
197-}
198-
199-/// The rename and transfer page. Anonymous viewers go to login; signed-in viewers without the
200-/// Admin right get 403.
201-#[page("/{owner}/{repo}/settings/rename")]
202-async fn rename_get(cx: &Cx) -> Result<impl View> {
84+/// The rename form moved into the danger zone; the old address goes there.
85+#[route(GET "/{owner}/{repo}/settings/rename")]
86+async fn rename_get(cx: &Cx) -> Result<SeeOther> {
20387 let owner = path_param::<Owner>(cx);
20488 let name = path_param::<Repo>(cx);
205- let ctx = load_repo(cx, owner, name).await?;
206- let (user, session) = require_user(cx).await?;
207- if !ctx.can_admin() {
208- return Err(forbidden().into());
209- }
210- let lang = i18n::lang(cx, Some(&user));
211- let notice = take_notice(cx);
212- let forms = Forms::fresh(&ctx);
213- let frame = Frame::new(&ctx, app_context::<AppState>(cx), lang).await?;
214- let csrf = session.csrf_token.clone();
215- Ok(view! {
216- shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(),
217- rename_body(lang: lang, head: frame.head, title: frame.title, csrf: csrf,
218- can_delete: frame.can_delete,
219- notice: notice, forms: forms))
220- })
89+ Ok(see_other(format!("/{owner}/{name}/settings?section=danger")))
22190 }
22291
22392 /// 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.
22594 #[page(POST "/{owner}/{repo}/settings/rename")]
22695 async fn rename_post(cx: &Cx, Form(form): Form<RenameForm>) -> Result<impl View> {
22796 let owner = path_param::<Owner>(cx);
@@ -270,27 +139,28 @@ async fn rename_post(cx: &Cx, Form(form): Form<RenameForm>) -> Result<impl View>
270139 serde_json::json!({ "from": ctx.repo.name }),
271140 )
272141 .await;
273- set_notice(cx, "renamed");
142+ set_settings_notice(cx, "renamed");
274143 Err(see_other(format!(
275- "/{}/{new_name}/settings/rename",
144+ "/{}/{new_name}/settings?section=danger",
276145 ctx.repo.owner_name
277146 ))
278147 .into())
279148 }
280149 Err(CoreError::InvalidName(message) | CoreError::Conflict(message)) => {
281- let forms = Forms {
150+ let danger = DangerForms {
282151 rename_name: new_name,
283152 rename_error: Some(message),
284- ..Forms::fresh(&ctx)
153+ ..DangerForms::fresh(&ctx)
285154 };
286- let frame = Frame::new(&ctx, app_context::<AppState>(cx), lang).await?;
287- let csrf = session.csrf_token.clone();
288- Ok(view! {
289- shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(),
290- rename_body(lang: lang, head: frame.head, title: frame.title, csrf: csrf,
291- can_delete: frame.can_delete,
292- notice: None, forms: forms))
293- })
155+ render_settings(
156+ cx,
157+ ctx,
158+ user,
159+ session.csrf_token.clone(),
160+ lang,
161+ Shown::danger(danger),
162+ )
163+ .await
294164 }
295165 Err(other) => Err(other.into()),
296166 }
@@ -357,8 +227,7 @@ async fn transfer_post(cx: &Cx, Form(form): Form<TransferForm>) -> Result<impl V
357227 )
358228 .await;
359229 return Err(see_other(format!(
360- "/{}/{}/transfer",
361- ctx.repo.owner_name, ctx.repo.name
230+ "/{title}/settings?section=danger"
362231 ))
363232 .into());
364233 }
@@ -390,9 +259,9 @@ async fn transfer_post(cx: &Cx, Form(form): Form<TransferForm>) -> Result<impl V
390259 serde_json::json!({ "to": new_owner.username }),
391260 )
392261 .await;
393- set_notice(cx, "transferred");
262+ set_settings_notice(cx, "transferred");
394263 return Err(see_other(format!(
395- "/{}/{}/settings/rename",
264+ "/{}/{}/settings?section=danger",
396265 new_owner.username, ctx.repo.name
397266 ))
398267 .into());
@@ -402,17 +271,18 @@ async fn transfer_post(cx: &Cx, Form(form): Form<TransferForm>) -> Result<impl V
402271 }
403272 };
404273
405- let forms = Forms {
274+ let danger = DangerForms {
406275 transfer_owner: target,
407276 transfer_error: error,
408- ..Forms::fresh(&ctx)
277+ ..DangerForms::fresh(&ctx)
409278 };
410- let frame = Frame::new(&ctx, state, lang).await?;
411- let csrf = session.csrf_token.clone();
412- Ok(view! {
413- shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(),
414- rename_body(lang: lang, head: frame.head, title: frame.title, csrf: csrf,
415- can_delete: frame.can_delete,
416- notice: None, forms: forms))
417- })
279+ render_settings(
280+ cx,
281+ ctx,
282+ user,
283+ session.csrf_token.clone(),
284+ lang,
285+ Shown::danger(danger),
286+ )
287+ .await
418288 }
crates/forge-web/src/pages/repo_scrub.rsmodified+1 -5
@@ -19,7 +19,6 @@ use topcoat::view::{View, component, view};
1919
2020 use crate::i18n::Lang;
2121 use crate::i18n::code::{self as g};
22-use crate::pages::passkeys::s;
2322 use crate::pages::repo_ctx::{RepoCtx, load_repo};
2423 use crate::pages::tree::{entry_rows, load_readme, read_dir, readme_card};
2524 use crate::state::AppState;
@@ -205,10 +204,7 @@ async fn scrub_page(cx: &Cx) -> Result<impl View> {
205204 let readme = parts.readme.clone();
206205 let lang = ctx.lang;
207206 let short: String = oid.chars().take(7).collect();
208- let sub = vec![
209- SubPart::text(s(lang, "Files at this commit", "Bu commit'teki dosyalar")),
210- SubPart::text(title.clone()),
211- ];
207+ let sub = vec![SubPart::text(title.clone())];
212208 Ok(view! {
213209 shell(title: title.as_str(), viewer: ctx.viewer.as_ref(),
214210 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};
1818 use crate::auth::{require_csrf, require_user};
1919 use crate::i18n::repo_admin::{self as g, K};
2020 use crate::i18n::{self, Lang};
21-use crate::pages::passkeys;
2221 use crate::pages::repo::repo_head;
2322 use crate::pages::repo_ctx::{RepoCtx, RepoHead, load_repo};
2423 use crate::pages::repo_settings::settings_frame;
@@ -160,10 +159,9 @@ async fn frame_top(
160159 #[default] child: Child<'_>,
161160 ) -> Result<impl View> {
162161 let notice = notice.map(|(key, is_error)| (g::t(lang, key), is_error));
163- let can_delete = head.can_delete;
164162 Ok(view! {
165163 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",
167165 if let Some((text, is_error)) = notice {
168166 if is_error {
169167 alert(message: text)
@@ -212,13 +210,11 @@ async fn secrets_body(
212210 <div class="field">
213211 <label for="secret-name">(g::t(lang, K::Name))</label>
214212 <input id="secret-name" type="text" name="name" value=(draft_name.as_str()) required=(true) maxlength="64"
215- pattern="[A-Z_][A-Z0-9_]{0,63}" autocomplete="off" spellcheck="false"
216- placeholder="DEPLOY_TOKEN">
213+ pattern="[A-Z_][A-Z0-9_]{0,63}" autocomplete="off" spellcheck="false">
217214 </div>
218215 <div class="field">
219216 <label for="secret-value">(g::t(lang, K::Value))</label>
220217 <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>
222218 </div>
223219 <button type="submit" class="primary">(g::t(lang, K::SaveSecret))</button>
224220 </form>
@@ -230,8 +226,6 @@ async fn secrets_body(
230226 <h2>(g::t(lang, K::Secrets))</h2>
231227 if rows.is_empty() {
232228 <p class="state">(g::t(lang, K::NoSecrets))</p>
233- } else {
234- <p class="hint">(g::t(lang, K::SecretsHelp))</p>
235229 }
236230 <div>
237231 for row in rows.iter() {
@@ -245,8 +239,7 @@ async fn secrets_body(
245239 <span class="name"><code>(row.name.as_str())</code></span>
246240 <span class="val">rel_time(lang: lang, stamp: row.updated_at.as_str())</span>
247241 confirm_act(lang: lang, label: g::t(lang, K::Delete), action: delete_action.as_str(), csrf: csrf.as_str(),
248- fields: vec![("name".to_owned(), row.name.clone())],
249- note: Some(passkeys::s(lang, "Jobs that use it fail until it is set again.", "Onu kullanan işler, yeniden ayarlanana kadar başarısız olur.").to_owned()))
242+ fields: vec![("name".to_owned(), row.name.clone())])
250243 </div>
251244 }
252245 }
crates/forge-web/src/pages/repo_security.rsmodified+0 -1
@@ -129,7 +129,6 @@ async fn security_body(
129129 <p class="state">(g::t(lang, K::SecurityOff))</p>
130130 } else {
131131 <p class="state">(g::dependencies_summary(lang, dependencies, open_count))</p>
132- <p class="hint">(g::t(lang, K::LockfilesRead))</p>
133132 }
134133 if rows.is_empty() {
135134 <p class="state">(g::t(lang, K::NoAlerts))</p>
crates/forge-web/src/pages/repo_settings.rsmodified+272 -176
@@ -1,9 +1,10 @@
11 //! Page: repo settings (`/{owner}/{repo}/settings`). The owner, an instance admin and collaborators
22 //! with the Admin role get the page. It shows one section at a time, chosen by `?section=`: General
3-//! (description, default branch, visibility, archive; the default), branch protection rules (Admin),
4-//! discussions and the danger zone (Delete: owner or instance admin only). Deleting moves the bare repo into `data_dir/trash` and removes its database
5-//! rows in one transaction. The repo is never erased from disk, so an admin can recover it from the
6-//! trash.
3+//! (description, default branch, and the Features switches: discussions and wiki; the default), branch
4+//! protection rules (Admin), and the danger zone (rename, then transfer, visibility, archive and
5+//! delete). Transfer and delete need Delete: owner or instance admin only. Deleting moves the bare repo
6+//! into `data_dir/trash` and removes its database rows in one transaction. The repo is never erased
7+//! from disk, so an admin can recover it from the trash.
78
89 use std::path::Path;
910
@@ -12,7 +13,7 @@ use forge_core::protection::{
1213 validate_required_approvals,
1314 };
1415 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};
1617 use forge_git::browse::RefKind;
1718 use forge_git::command::{GitCommand, GitEnv};
1819 use forge_git::repo::{
@@ -33,12 +34,15 @@ use crate::auth::{require_csrf, require_user};
3334 use crate::i18n::merge_queue as mq;
3435 use crate::i18n::repo_admin::{self as g, K};
3536 use crate::i18n::{self, Lang};
36-use crate::pages::discussion_settings::discussions_card;
37+use crate::pages::discussion_settings::discussions_switch;
3738 use crate::pages::passkeys;
3839 use crate::pages::refs::load_refs;
3940 use crate::pages::repo::repo_head;
4041 use crate::pages::repo_ctx::{RepoCtx, RepoHead, load_repo};
42+use crate::pages::repo_rename::rename_section;
4143 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;
4246 use crate::state::AppState;
4347 use crate::views::parts::{RailItem, confirm_act, post_act, rail};
4448 use crate::views::{alert, enc, shell};
@@ -52,13 +56,12 @@ pub(crate) struct SectionQuery {
5256 section: Option<String>,
5357 }
5458
55-/// The section to show: `branches`, `discussions`, or `danger` (only for a viewer who may delete the
56-/// repo). Anything else is `general`.
57-fn pick_section(raw: Option<&str>, can_delete: bool) -> &'static str {
59+/// The section to show: `branches`, or `danger` (the danger zone, for a viewer who may admin the
60+/// repo, which the page requires). Anything else, including the old `discussions`, is `general`.
61+fn pick_section(raw: Option<&str>) -> &'static str {
5862 match raw {
5963 Some("branches") => "branches",
60- Some("discussions") => "discussions",
61- Some("danger") if can_delete => "danger",
64+ Some("danger") => "danger",
6265 _ => "general",
6366 }
6467 }
@@ -71,13 +74,15 @@ pub const NOTICE_COOKIE: &str = "forge_notice";
7174 const SETTINGS_NOTICE_COOKIE: &str = "forge_settings_notice";
7275
7376 /// 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] = [
7578 ("saved", K::BranchRuleSaved, false),
7679 ("removed", K::BranchRuleRemoved, false),
7780 ("general", K::GeneralSaved, false),
7881 ("visibility", K::VisibilityChanged, false),
7982 ("archived", K::RepoArchived, false),
8083 ("unarchived", K::RepoUnarchived, false),
84+ ("renamed", K::RenamedNotice, false),
85+ ("transferred", K::TransferredNotice, false),
8186 ("description_long", K::DescriptionLong, true),
8287 ("branch_missing", K::BranchMissing, true),
8388 ("git_failed", K::DefaultBranchFailed, true),
@@ -192,7 +197,7 @@ pub fn take_notice(cx: &Cx) -> Option<String> {
192197 }
193198
194199 /// 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) {
196201 cookies(cx).add(
197202 Cookie::build((SETTINGS_NOTICE_COOKIE, word))
198203 .path("/")
@@ -266,9 +271,131 @@ pub async fn notice_banner_for(lang: Lang, title: Option<String>) -> Result<impl
266271 })
267272 }
268273
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.
270364 #[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(
272399 lang: Lang,
273400 csrf: String,
274401 title: String,
@@ -278,9 +405,7 @@ async fn danger_zone(
278405 let open = error.is_some();
279406 Ok(view! {
280407 <section class="sec">
281- <h2>(g::t(lang, K::DangerZone))</h2>
282- <p class="hint">(g::t(lang, K::DeleteRepoHelp))</p>
283- <p class="hint">(g::t(lang, K::DeleteTrashHelp))</p>
408+ <h2>(g::t(lang, K::Delete))</h2>
284409 <div class="acts">
285410 <details class="reveal" open=(open)>
286411 <summary class="act danger">(g::t(lang, K::DeleteRepo))</summary>
@@ -308,37 +433,30 @@ async fn danger_zone(
308433
309434 /// The settings frame: the rail of settings pages beside the sheet holding the page's own content
310435 /// (its children). Every settings page shows the same rail, one list of every page. `current` names
311-/// the page shown (`general`, `branches`, `webhooks`, ...) and marks its rail item. Danger zone is
312-/// listed only for a viewer who may delete the repo (`can_delete`).
436+/// the page shown (`general`, `branches`, `webhooks`, ...) and marks its rail item. Every settings
437+/// page is for a repo admin, so the Danger zone is always listed.
313438 #[component]
314439 pub async fn settings_frame(
315440 lang: Lang,
316441 title: String,
317442 current: &'static str,
318- can_delete: bool,
319443 #[default] child: Child<'_>,
320444 ) -> Result<impl View> {
321- let discussions_label = crate::i18n::community::t(lang, crate::i18n::community::K::Discussions);
322445 let item = |name: &str, href: String, on: bool| RailItem {
323446 name: name.to_owned(),
324447 val: String::new(),
325448 href,
326449 current: on,
327450 };
328- let mut items = vec![
451+ let items = vec![
329452 item(g::t(lang, K::General), format!("/{title}/settings"), current == "general"),
330453 item(g::t(lang, K::Collaborators), format!("/{title}/settings/collaborators"), current == "collaborators"),
331454 item(g::t(lang, K::BranchProtection), format!("/{title}/settings?section=branches"), current == "branches"),
332- item(discussions_label, format!("/{title}/settings?section=discussions"), current == "discussions"),
333455 item(g::t(lang, K::Webhooks), format!("/{title}/settings/hooks"), current == "webhooks"),
334456 item(g::t(lang, K::Mirrors), format!("/{title}/settings/mirrors"), current == "mirrors"),
335457 item(g::t(lang, K::Secrets), format!("/{title}/settings/secrets"), current == "secrets"),
336- item(crate::i18n::code::t(lang, crate::i18n::code::K::TabWiki), format!("/{title}/settings/wiki"), current == "wiki"),
337- item(g::t(lang, K::RenameTransferNav), format!("/{title}/settings/rename"), current == "rename"),
458+ item(g::t(lang, K::DangerZone), format!("/{title}/settings?section=danger"), current == "danger"),
338459 ];
339- if can_delete {
340- items.push(item(g::t(lang, K::DangerZone), format!("/{title}/settings?section=danger"), current == "danger"));
341- }
342460 Ok(view! {
343461 <div class="work">
344462 rail(label: g::t(lang, K::SettingsNavLabel), items: items)
@@ -349,8 +467,10 @@ pub async fn settings_frame(
349467 })
350468 }
351469
352-/// The General section: description and default branch (one form), then visibility and archive.
353-/// Each form carries its own CSRF token. An empty repo shows "No branches yet" and no selector.
470+
471+/// The General section: description and default branch in one form, under no heading (the page's
472+/// head names it), then the Features topic with one switch per feature. Each form carries its own
473+/// CSRF token. An empty repo shows "No branches yet" and no selector.
354474 #[component]
355475 async fn general_section(
356476 lang: Lang,
@@ -359,29 +479,10 @@ async fn general_section(
359479 description: String,
360480 default_branch: String,
361481 branches: Vec<String>,
362- visibility: Visibility,
363- archived: bool,
482+ discussions_on: bool,
483+ wiki_on: bool,
364484 ) -> Result<impl View> {
365485 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- };
385486 let options: Vec<(String, bool)> = branches
386487 .into_iter()
387488 .map(|b| {
@@ -391,12 +492,10 @@ async fn general_section(
391492 .collect();
392493 Ok(view! {
393494 <section class="sec">
394- <h2>(g::t(lang, K::General))</h2>
395495 <form method="post" action=(general_action) class="fields">
396496 <div class="field">
397497 <label for="repo-description">(g::t(lang, K::Description))</label>
398498 <input id="repo-description" type="text" name="description" value=(description) maxlength="350" autocomplete="off">
399- <p class="hint">(g::t(lang, K::DescriptionHelp))</p>
400499 </div>
401500 if options.is_empty() {
402501 <p class="state">(g::t(lang, K::DefaultBranch)) ": " (g::t(lang, K::NoBranchesYet))</p>
@@ -416,30 +515,9 @@ async fn general_section(
416515 </section>
417516
418517 <section class="sec">
419- <h2>(g::t(lang, K::VisibilityHeading))</h2>
420- <p class="state">(current_visibility)</p>
421- <div class="acts">
422- confirm_act(lang: lang, label: flip_label, action: visibility_action.as_str(), csrf: csrf.as_str(),
423- fields: vec![("visibility".to_owned(), flip_to.to_owned()), ("understand".to_owned(), "on".to_owned())],
424- note: Some(flip_confirm.to_owned()))
425- </div>
426- </section>
427-
428- <section class="sec">
429- <h2>(g::t(lang, K::ArchiveHeading))</h2>
430- if archived {
431- <p class="hint">(g::t(lang, K::ArchivedHelp))</p>
432- <div class="acts">
433- post_act(label: g::t(lang, K::UnarchiveRepo), action: archive_action.as_str(), csrf: csrf.as_str(),
434- fields: vec![("archived".to_owned(), "0".to_owned())])
435- </div>
436- } else {
437- <p class="hint">(g::t(lang, K::ArchiveHelp))</p>
438- <div class="acts">
439- confirm_act(lang: lang, label: g::t(lang, K::ArchiveRepo), action: archive_action.as_str(), csrf: csrf.as_str(),
440- fields: vec![("archived".to_owned(), "1".to_owned())], note: Some(g::t(lang, K::ArchiveConfirm).to_owned()))
441- </div>
442- }
518+ <h2>(g::t(lang, K::Features))</h2>
519+ discussions_switch(lang: lang, action: format!("/{title}/settings/discussions"), csrf: csrf.clone(), enabled: discussions_on)
520+ wiki_switch(action: format!("/{title}/settings/wiki"), csrf: csrf.clone(), enabled: wiki_on)
443521 </section>
444522 })
445523 }
@@ -648,7 +726,6 @@ async fn branch_rule_form(
648726 <div class="field">
649727 <label for=(pattern_id.as_str())>(g::t(lang, K::BranchPattern))</label>
650728 <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>
652729 </div>
653730 }
654731 <div class="rule-section">
@@ -694,7 +771,7 @@ async fn branch_rule_form(
694771 </div>
695772 <div class="field">
696773 <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))>
698775 if !contexts.is_empty() {
699776 <div class="acts recent-checks">
700777 <span class="hint">(g::t(lang, K::RecentContexts))</span>
@@ -781,13 +858,80 @@ struct SettingsView {
781858 /// A settings notice: its text and whether it is an error.
782859 notice: Option<(K, bool)>,
783860 draft: RuleDraft,
784- delete_error: Option<String>,
861+ danger: DangerForms,
862+ transfer: TransferStatus,
863+ wiki_on: bool,
785864 /// Recently reported status contexts, offered as required-check suggestions.
786865 contexts: Vec<String>,
787866 }
788867
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+
789933 /// 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.
791935 #[component]
792936 async fn settings_body(
793937 lang: Lang,
@@ -811,7 +955,9 @@ async fn settings_body(
811955 rules,
812956 notice,
813957 draft,
814- delete_error,
958+ danger,
959+ transfer,
960+ wiki_on,
815961 contexts,
816962 } = page;
817963 // 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(
848994 let notice = notice.map(|(key, is_error)| (g::t(lang, key), is_error));
849995 let section_name = match section {
850996 "branches" => g::t(lang, K::BranchProtection),
851- "discussions" => crate::i18n::community::t(lang, crate::i18n::community::K::Discussions),
852997 "danger" => g::t(lang, K::DangerZone),
853998 _ => g::t(lang, K::General),
854999 };
855- // Only one section is rendered. The danger section is only chosen for a viewer who may delete
856- // (see `pick_section`), and it is last so that its moves come after every clone.
1000+ // Only one section is rendered.
8571001 Ok(view! {
8581002 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,
8601004 if let Some((text, is_error)) = notice {
8611005 if is_error {
8621006 alert(message: text)
@@ -867,22 +1011,19 @@ async fn settings_body(
8671011 if section == "general" {
8681012 general_section(lang: lang, title: title.clone(), csrf: csrf.clone(), description: description,
8691013 default_branch: default_branch.clone(), branches: branches,
870- visibility: visibility, archived: archived)
1014+ discussions_on: discussions_on, wiki_on: wiki_on)
8711015 }
8721016 if section == "branches" {
8731017 <section class="sec">
8741018 <h2>(g::t(lang, K::BranchProtection))</h2>
875- <p class="hint">(g::t(lang, K::BranchProtectionHelp))</p>
8761019 branch_rule_cards(lang: lang, cards: cards, builtin_row: builtin_row, default_branch: default_branch.clone(),
8771020 new_draft: new_draft, new_open: new_open, csrf: csrf.clone(), save_action: rules_action,
8781021 delete_action: delete_action, contexts: contexts)
8791022 </section>
8801023 }
881- if section == "discussions" {
882- discussions_card(lang: lang, action: format!("/{title}/settings/discussions"), csrf: csrf.clone(), enabled: discussions_on)
883- }
884- if section == "danger" && can_delete {
885- danger_zone(lang: lang, csrf: csrf, title: title, error: delete_error)
1024+ if section == "danger" {
1025+ danger_section(lang: lang, title: title, csrf: csrf, can_delete: can_delete,
1026+ visibility: visibility, archived: archived, forms: danger, transfer: transfer)
8861027 }
8871028 )
8881029 })
@@ -925,30 +1066,13 @@ async fn settings_page(cx: &Cx) -> Result<impl View> {
9251066 }
9261067 let lang = i18n::lang(cx, Some(&user));
9271068 let query = query_params::<SectionQuery>(cx)?;
928- let section = pick_section(query.section.as_deref(), ctx.can_delete());
929- let rules = app_context::<AppState>(cx)
930- .store
931- .list_branch_rules(&ctx.repo.id)
932- .await?;
933- let page = SettingsView {
934- rules,
1069+ let shown = Shown {
1070+ section: pick_section(query.section.as_deref()),
9351071 notice: take_settings_notice(cx),
936- draft: RuleDraft::for_default_branch(&ctx.repo.default_branch),
937- delete_error: None,
938- contexts: app_context::<AppState>(cx)
939- .store
940- .recent_status_contexts(&ctx.repo.id, 20)
941- .await?,
1072+ draft: None,
1073+ danger: DangerForms::fresh(&ctx),
9421074 };
943- let csrf = session.csrf_token.clone();
944- let frame = SettingsFrame::new(&ctx, app_context::<AppState>(cx), lang).await?;
945- let branches = load_branch_names(&ctx).await?;
946- Ok(view! {
947- shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(),
948- settings_body(lang: lang, head: frame.head, default_branch: frame.default_branch, archived: frame.archived,
949- branches: branches, title: frame.title, csrf: csrf,
950- can_delete: frame.can_delete, section: section, page: page))
951- })
1075+ render_settings(cx, ctx, user, session.csrf_token.clone(), lang, shown).await
9521076 }
9531077
9541078 /// 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>) ->
10351159 let title = format!("{}/{}", ctx.repo.owner_name, ctx.repo.name);
10361160 let Ok(target) = form.visibility.parse::<Visibility>() else {
10371161 set_settings_notice(cx, "bad_form");
1038- return Ok(back_to_settings(&title));
1162+ return Ok(back_to_section(&title, "danger"));
10391163 };
10401164 if target != ctx.repo.visibility {
10411165 if form.understand.is_none() {
10421166 set_settings_notice(cx, "understand");
1043- return Ok(back_to_settings(&title));
1167+ return Ok(back_to_section(&title, "danger"));
10441168 }
10451169 let state = app_context::<AppState>(cx);
10461170 state
@@ -1070,7 +1194,7 @@ async fn settings_visibility_save(cx: &Cx, Form(form): Form<VisibilityForm>) ->
10701194 .await;
10711195 set_settings_notice(cx, "visibility");
10721196 }
1073- Ok(back_to_settings(&title))
1197+ Ok(back_to_section(&title, "danger"))
10741198 }
10751199
10761200 /// 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
10901214 "0" => false,
10911215 _ => {
10921216 set_settings_notice(cx, "bad_form");
1093- return Ok(back_to_settings(&title));
1217+ return Ok(back_to_section(&title, "danger"));
10941218 }
10951219 };
10961220 let state = app_context::<AppState>(cx);
@@ -1125,7 +1249,7 @@ async fn settings_archive_save(cx: &Cx, Form(form): Form<ArchiveForm>) -> Result
11251249 "repo archive flag changed"
11261250 );
11271251 set_settings_notice(cx, if archived { "archived" } else { "unarchived" });
1128- Ok(back_to_settings(&title))
1252+ Ok(back_to_section(&title, "danger"))
11291253 }
11301254
11311255 /// 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
12371361 return Err(see_other(format!("/{}?tab=repositories", enc(&ctx.repo.owner_name))).into());
12381362 }
12391363
1240- let rules = app_context::<AppState>(cx)
1241- .store
1242- .list_branch_rules(&ctx.repo.id)
1243- .await?;
1244- let page = SettingsView {
1245- rules,
1364+ // The delete form lives in the danger zone, so a failed confirmation draws that section again.
1365+ let shown = Shown {
1366+ section: "danger",
12461367 notice: None,
1247- draft: RuleDraft::for_default_branch(&ctx.repo.default_branch),
1248- delete_error: error,
1249- contexts: app_context::<AppState>(cx)
1250- .store
1251- .recent_status_contexts(&ctx.repo.id, 20)
1252- .await?,
1368+ draft: None,
1369+ danger: DangerForms {
1370+ delete_error: error,
1371+ ..DangerForms::fresh(&ctx)
1372+ },
12531373 };
1254- let csrf = session.csrf_token.clone();
1255- let frame = SettingsFrame::new(&ctx, app_context::<AppState>(cx), lang).await?;
1256- let branches = load_branch_names(&ctx).await?;
1257- // The delete form lives in the danger section, so a failed confirmation re-renders that section.
1258- Ok(view! {
1259- shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(),
1260- settings_body(lang: lang, head: frame.head, default_branch: frame.default_branch, archived: frame.archived,
1261- branches: branches, title: frame.title, csrf: csrf,
1262- can_delete: frame.can_delete, section: "danger", page: page))
1263- })
1374+ render_settings(cx, ctx, user, session.csrf_token.clone(), lang, shown).await
12641375 }
12651376
12661377 /// Adds a branch rule or updates the one with the same pattern. The form is checked for CSRF and
@@ -1299,41 +1410,26 @@ async fn settings_branch_save(cx: &Cx, Form(form): Form<BranchForm>) -> Result<i
12991410 let flags = match checked.and_then(|()| parse_rule_flags(lang, &form)) {
13001411 Ok(flags) => flags,
13011412 Err(message) => {
1302- let rules = app_context::<AppState>(cx)
1303- .store
1304- .list_branch_rules(&ctx.repo.id)
1305- .await?;
1306- let page = SettingsView {
1307- rules,
1413+ let draft = RuleDraft {
1414+ pattern,
1415+ allow_force_push: form.allow_force_push.is_some(),
1416+ allow_deletion: form.allow_deletion.is_some(),
1417+ required_approvals: form.required_approvals.clone(),
1418+ block_on_changes_requested: form.block_on_changes_requested.is_some(),
1419+ require_up_to_date: form.require_up_to_date.is_some(),
1420+ restrict_push: form.restrict_push.is_some(),
1421+ require_merge_queue: form.require_merge_queue.is_some(),
1422+ required_checks: form.required_checks.clone(),
1423+ error: Some(message),
1424+ is_new,
1425+ };
1426+ let shown = Shown {
1427+ section: "branches",
13081428 notice: None,
1309- draft: RuleDraft {
1310- pattern,
1311- allow_force_push: form.allow_force_push.is_some(),
1312- allow_deletion: form.allow_deletion.is_some(),
1313- required_approvals: form.required_approvals.clone(),
1314- block_on_changes_requested: form.block_on_changes_requested.is_some(),
1315- require_up_to_date: form.require_up_to_date.is_some(),
1316- restrict_push: form.restrict_push.is_some(),
1317- require_merge_queue: form.require_merge_queue.is_some(),
1318- required_checks: form.required_checks.clone(),
1319- error: Some(message),
1320- is_new,
1321- },
1322- delete_error: None,
1323- contexts: app_context::<AppState>(cx)
1324- .store
1325- .recent_status_contexts(&ctx.repo.id, 20)
1326- .await?,
1429+ draft: Some(draft),
1430+ danger: DangerForms::fresh(&ctx),
13271431 };
1328- let csrf = session.csrf_token.clone();
1329- let frame = SettingsFrame::new(&ctx, app_context::<AppState>(cx), lang).await?;
1330- let branches = load_branch_names(&ctx).await?;
1331- return Ok(view! {
1332- shell(title: frame.page_title.as_str(), viewer: ctx.viewer.as_ref(),
1333- settings_body(lang: lang, head: frame.head, default_branch: frame.default_branch, archived: frame.archived,
1334- branches: branches, title: frame.title, csrf: csrf,
1335- can_delete: frame.can_delete, section: "branches", page: page))
1336- });
1432+ return render_settings(cx, ctx, user, session.csrf_token.clone(), lang, shown).await;
13371433 }
13381434 };
13391435
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 {
3939 format!("/{owner}/{repo}/security/live")
4040 }
4141
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-
4742 /// The header of a settings page. It follows the settings stream, which carries the refs too, since
4843 /// the branch picker of the protection rules lists them.
4944 pub async fn settings_head(ctx: &RepoCtx, state: &AppState) -> Result<RepoHead> {
@@ -83,16 +78,6 @@ async fn security_live(cx: &Cx) -> Result<Response> {
8378 stream_wakes(cx, &state.live, &[Topic::RepoSettings(ctx.repo.id.clone())])
8479 }
8580
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-
9681 // The write layer
9782
9883 /// 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() {
102102 let anonymous = get(&site, "/owner/proj/settings/live", None).await;
103103 assert_ne!(anonymous.status().as_u16(), 200, "settings: anonymous");
104104
105- for path in ["/owner/proj/security/live", "/owner/proj/transfer/live"] {
105+ for path in ["/owner/proj/security/live"] {
106106 let reader = get(&site, path, Some(&reader_cookie)).await;
107107 assert_eq!(reader.status().as_u16(), 200, "{path}: reader");
108108 let anonymous = get(&site, path, None).await;
crates/forge-web/src/pages/repo_transfer.rsmodified+94 -87
@@ -1,10 +1,10 @@
1-//! Repo transfer status and actions. `GET /{owner}/{repo}/transfer` shows the open transfer of a
2-//! repo, if any, to viewers who can read it. The POST actions accept, decline and cancel a transfer
3-//! by its repo id under `/-/transfers/{id}/...`: a target who cannot read a private repo can still
4-//! act on it from the inbox (`transfer_list_for`), so those routes check the transfer rules in the
5-//! store and the repo rules here, not the read rule of `load_repo`.
1+//! Repo transfer status and actions. The Transfer topic of the danger zone (`pages::repo_settings`)
2+//! shows the open transfer of a repo, and `GET /{owner}/{repo}/transfer` goes there. The POST actions
3+//! accept, decline and cancel a transfer by its repo id under `/-/transfers/{id}/...`: a target who
4+//! cannot read a private repo can still act on it from the inbox (`transfer_list_for`), so those
5+//! routes check the transfer rules in the store and the repo rules here, not the read rule of `load_repo`.
66 //!
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
88 //! acceptance entirely.
99
1010 use forge_core::authz::{Action, authorize};
@@ -15,19 +15,17 @@ use topcoat::Result;
1515 use topcoat::context::{Cx, app_context};
1616 use topcoat::router::content::Form;
1717 use topcoat::router::error::{SeeOther, forbidden, see_other};
18-use topcoat::router::{page, path_param, route};
18+use topcoat::router::{path_param, route};
1919 use topcoat::view::{View, component, view};
2020
2121 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;
2324 use crate::i18n::repo_admin::{self as g, K};
24-use crate::i18n::{self, Lang};
25-use crate::pages::repo::repo_head;
26-use crate::pages::repo_ctx::{RepoHead, load_repo};
27-use crate::pages::repo_settings_live::{bump_settings, transfer_live_url};
25+use crate::pages::repo_settings_live::bump_settings;
2826 use crate::state::AppState;
29-use crate::views::parts::{confirm_act, post_act};
30-use crate::views::{rel_time, shell};
27+use crate::views::parts::{confirm_act, post_act, reveal};
28+use crate::views::{alert, rel_time};
3129
3230 path_param!(owner);
3331 path_param!(repo);
@@ -39,7 +37,7 @@ struct ActionForm {
3937 csrf: String,
4038 }
4139
42-/// One line describing an open transfer, for the repo page.
40+/// One line describing an open transfer, for the danger zone.
4341 fn summary_text(lang: Lang, transfer: &PendingTransfer) -> TransferSummary {
4442 let (before, after) = g::transfer_summary(
4543 lang,
@@ -55,93 +53,102 @@ fn summary_text(lang: Lang, transfer: &PendingTransfer) -> TransferSummary {
5553 }
5654
5755 /// The pending-transfer sentence, with its expiry as a live relative time between two parts.
58-struct TransferSummary {
56+pub(crate) struct TransferSummary {
5957 before: String,
6058 expires_at: String,
6159 after: &'static str,
6260 }
6361
64-/// The open transfer and the action forms the viewer may use. Each action is `None` when hidden.
65-#[component]
66-async fn transfer_body(
67- lang: Lang,
68- head: RepoHead,
62+/// The open transfer of a repo as the danger zone shows it: its sentence, and the action forms the
63+/// viewer may use. An action is `None` when hidden.
64+#[derive(Default)]
65+pub(crate) struct TransferStatus {
6966 summary: Option<TransferSummary>,
7067 accept: Option<String>,
7168 decline: Option<String>,
7269 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,
7399 csrf: String,
74- settings: Option<String>,
100+ status: TransferStatus,
101+ new_owner: String,
102+ error: Option<String>,
75103 ) -> Result<impl View> {
104+ let action = format!("/{title}/settings/transfer");
105+ let open = error.is_some();
76106 Ok(view! {
77- repo_head(head: head, title: Some(g::t(lang, K::TransferTitle).to_owned()))
78- <div class="sheet">
79- <section class="sec">
80- <h2>(g::t(lang, K::TransferTitle))</h2>
81- if let Some(summary) = summary.as_ref() {
82- <p class="state">(summary.before.as_str()) rel_time(lang: lang, stamp: summary.expires_at.as_str()) (summary.after)</p>
83- <div class="acts">
84- if let Some(action) = accept {
85- post_act(label: g::t(lang, K::AcceptTransfer), action: action.as_str(), csrf: csrf.as_str())
86- }
87- if let Some(action) = decline {
88- confirm_act(lang: lang, label: g::t(lang, K::DeclineTransfer), action: action.as_str(), csrf: csrf.as_str())
89- }
90- if let Some(action) = cancel {
91- confirm_act(lang: lang, label: g::t(lang, K::CancelTransfer), action: action.as_str(), csrf: csrf.as_str())
92- }
93- </div>
94- }
95- if summary.is_none() {
96- <p class="state">(g::t(lang, K::NoPendingTransfer))</p>
97- }
98- if let Some(href) = settings {
99- <div class="acts">
100- <a class="act" href=(href.as_str())>(g::t(lang, K::StartTransferLink))</a>
101- </div>
102- }
103- </section>
104- </div>
107+ <section class="sec">
108+ <h2>(g::t(lang, K::TransferTitle))</h2>
109+ if let Some(summary) = status.summary.as_ref() {
110+ <p class="state">(summary.before.as_str()) rel_time(lang: lang, stamp: summary.expires_at.as_str()) (summary.after)</p>
111+ <div class="acts">
112+ if let Some(accept) = status.accept.as_ref() {
113+ post_act(label: g::t(lang, K::AcceptTransfer), action: accept.as_str(), csrf: csrf.as_str())
114+ }
115+ if let Some(decline) = status.decline.as_ref() {
116+ confirm_act(lang: lang, label: g::t(lang, K::DeclineTransfer), action: decline.as_str(), csrf: csrf.as_str())
117+ }
118+ if let Some(cancel) = status.cancel.as_ref() {
119+ confirm_act(lang: lang, label: g::t(lang, K::CancelTransfer), action: cancel.as_str(), csrf: csrf.as_str())
120+ }
121+ </div>
122+ }
123+ <div class="acts">
124+ reveal(label: g::t(lang, K::TransferRepo), open: open,
125+ if let Some(message) = error {
126+ alert(message: message.as_str())
127+ }
128+ <form method="post" action=(action.as_str()) class="fields">
129+ <input type="hidden" name="csrf" value=(csrf.as_str())>
130+ <div class="field">
131+ <label for="transfer-owner">(g::t(lang, K::NewOwnerLabel))</label>
132+ <input id="transfer-owner" type="text" name="new_owner" value=(new_owner.as_str()) autocomplete="off" spellcheck="false" required=(true)>
133+ </div>
134+ <div class="field">
135+ <label for="transfer-confirm">(g::t(lang, K::TypeToConfirmBefore))<code>(title.clone())</code>(g::t(lang, K::TypeToConfirmAfter))</label>
136+ <input id="transfer-confirm" type="text" name="confirm" autocomplete="off" spellcheck="false" required=(true)>
137+ </div>
138+ <button type="submit" class="danger small">(g::t(lang, K::TransferRepo))</button>
139+ </form>
140+ )
141+ </div>
142+ </section>
105143 })
106144 }
107145
108-/// The transfer status page. Anonymous viewers go to login; viewers who cannot read the repo get
109-/// 404 from `load_repo`.
110-#[page("/{owner}/{repo}/transfer")]
111-async fn transfer_get(cx: &Cx) -> Result<impl View> {
146+/// The transfer page moved into the danger zone; the old address goes there.
147+#[route(GET "/{owner}/{repo}/transfer")]
148+async fn transfer_get(cx: &Cx) -> Result<SeeOther> {
112149 let owner = path_param::<Owner>(cx);
113- let name = path_param::<Repo>(cx);
114- let ctx = load_repo(cx, owner, name).await?;
115- let (user, session) = require_user(cx).await?;
116- let lang = i18n::lang(cx, Some(&user));
117- let state = app_context::<AppState>(cx);
118- let title = format!("{}/{}", ctx.repo.owner_name, ctx.repo.name);
119- let may_delete = ctx.can_delete();
120- let pending = state.store.pending_transfer(&ctx.repo.id).await?;
121-
122- let (summary, accept, decline, cancel) = match &pending {
123- Some(transfer) => {
124- let may_accept = state.store.can_accept_transfer(&user.id, transfer).await?;
125- let may_cancel = may_delete || transfer.initiated_by_id == user.id;
126- (
127- Some(summary_text(lang, transfer)),
128- may_accept.then(|| format!("/-/transfers/{}/accept", transfer.repo_id)),
129- may_accept.then(|| format!("/-/transfers/{}/decline", transfer.repo_id)),
130- may_cancel.then(|| format!("/-/transfers/{}/cancel", transfer.repo_id)),
131- )
132- }
133- None => (None, None, None, None),
134- };
135- let settings = may_delete.then(|| format!("/{title}/settings/rename"));
136- let mut head = ctx.head(state, "settings").await?;
137- head.live = transfer_live_url(&ctx.repo.owner_name, &ctx.repo.name);
138- let page_title = g::transfer_page_title(lang, &title);
139- let csrf = session.csrf_token.clone();
140- Ok(view! {
141- shell(title: page_title.as_str(), viewer: ctx.viewer.as_ref(),
142- transfer_body(lang: lang, head: head, summary: summary, accept: accept, decline: decline,
143- cancel: cancel, csrf: csrf, settings: settings))
144- })
150+ let repo = path_param::<Repo>(cx);
151+ Ok(see_other(format!("/{owner}/{repo}/settings?section=danger")))
145152 }
146153
147154 /// The open transfer `repo_id`, or `NotFound`.
@@ -252,7 +259,7 @@ async fn cancel_post(cx: &Cx, Form(form): Form<ActionForm>) -> Result<SeeOther>
252259 )
253260 .await;
254261 Ok(see_other(format!(
255- "/{}/{}/transfer",
262+ "/{}/{}/settings?section=danger",
256263 pending.from_owner_name, pending.repo_name
257264 )))
258265 }
crates/forge-web/src/pages/repo_webhooks.rsmodified+8 -15
@@ -499,14 +499,13 @@ async fn frame_top(
499499 #[default] action: Option<(String, &'static str)>,
500500 #[default] child: Child<'_>,
501501 ) -> Result<impl View> {
502- let can_delete = head.can_delete;
503502 Ok(view! {
504503 repo_head(head: head, title: Some(heading),
505504 if let Some((href, label)) = action {
506505 <a class="button primary" href=(href.as_str())>(label)</a>
507506 }
508507 )
509- settings_frame(lang: lang, title: title, current: "webhooks", can_delete: can_delete,
508+ settings_frame(lang: lang, title: title, current: "webhooks",
510509 if let Some((text, is_error)) = notice {
511510 if is_error {
512511 alert(message: text)
@@ -546,12 +545,13 @@ async fn hook_form(
546545 <div class="field">
547546 <label for="hook-url">(g::t(lang, K::PayloadUrl))</label>
548547 <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>
550548 </div>
551549 <div class="field">
552550 <label for="hook-secret">(g::t(lang, K::Secret))</label>
553551 <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+ }
555555 </div>
556556 </section>
557557 <section class="sec">
@@ -599,8 +599,6 @@ async fn hooks_list_body(
599599 <section class="sec">
600600 if empty {
601601 <p class="state">(g::t(lang, K::NoWebhooks))</p>
602- } else {
603- <p class="hint">(g::t(lang, K::WebhooksIntro))</p>
604602 }
605603 for row in rows.iter() {
606604 <a class="line" href=(row.href.as_str()) data-kb-row="">
@@ -646,7 +644,7 @@ async fn delivery_list(
646644 <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>
647645 </summary>
648646 <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>
650648 <h3 class="part-title">(g::t(lang, K::RequestHeaders))</h3>
651649 <pre class="code">(row.request_headers.as_str())</pre>
652650 <h3 class="part-title">(g::t(lang, K::RequestBody))</h3>
@@ -655,7 +653,7 @@ async fn delivery_list(
655653 if !row.error.is_empty() {
656654 alert(message: row.error.as_str())
657655 }
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>
659657 <h3 class="part-title">(g::t(lang, K::ResponseHeaders))</h3>
660658 <pre class="code">(row.response_headers.as_str())</pre>
661659 <h3 class="part-title">(g::t(lang, K::ResponseBody))</h3>
@@ -700,7 +698,6 @@ async fn hook_body(
700698 <section class="sec">
701699 <h2>(crate::pages::passkeys::s(lang, "Endpoint", "Uç nokta"))</h2>
702700 <p class="state">(draft.url.as_str())</p>
703- <p class="hint">(g::t(lang, K::ArchivedHookNote))</p>
704701 </section>
705702 } else {
706703 hook_form(action: edit_action.clone(), csrf: csrf.clone(), url: draft.url,
@@ -710,7 +707,6 @@ async fn hook_body(
710707 if !archived {
711708 <section class="sec">
712709 <h2>(g::t(lang, K::Test))</h2>
713- <p class="hint">(g::t(lang, K::TestIntro))</p>
714710 <div class="acts">
715711 post_act(label: g::t(lang, K::SendTestPing), action: test_action.as_str(), csrf: csrf.as_str())
716712 </div>
@@ -718,15 +714,13 @@ async fn hook_body(
718714 }
719715 <section class="sec">
720716 <h2>(g::t(lang, K::RecentDeliveries))</h2>
721- <p class="hint">(g::recent_deliveries(lang, DELIVERIES_SHOWN))</p>
722717 delivery_list(deliveries: deliveries, csrf: csrf.clone(), archived: archived, lang: lang)
723718 </section>
724719 if !archived {
725720 <section class="sec">
726721 <h2>(g::t(lang, K::DeleteWebhook))</h2>
727- <p class="hint">(g::t(lang, K::DeleteIntro))</p>
728722 <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())])
730724 </div>
731725 </section>
732726 }
@@ -812,13 +806,12 @@ async fn hook_new_body(
812806 Ok(view! {
813807 frame_top(head: head, title: title.clone(), heading: g::t(lang, K::AddWebhook).to_owned(), notice: None, archived: archived, lang: lang,
814808 <section class="sec">
815- <p class="hint">(g::t(lang, K::AddWebhookIntro))</p>
816809 <div class="acts">
817810 <a class="act quiet" href=(back.as_str())>(g::t(lang, K::BackToWebhooks))</a>
818811 </div>
819812 </section>
820813 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(),
822815 error: draft.error, submit: g::t(lang, K::CreateWebhook), lang: lang)
823816 )
824817 })
crates/forge-web/src/pages/review_requests.rsmodified+10 -13
@@ -17,14 +17,14 @@ use topcoat::view::{View, component, view};
1717
1818 use crate::auth::{current_user, require_user};
1919 use crate::i18n::authoring::{self as ga, K as AK};
20+use crate::i18n::issues::{self as ig, K as IK};
2021 use crate::i18n::{self, Lang};
2122 use crate::live::{Topic, stream_wakes};
2223 use crate::notify;
2324 use crate::pages::issue_parts::{ItemKind, check_write, may_change, parse_number};
24-use crate::pages::passkeys::s;
2525 use crate::pages::repo_ctx::{RepoCtx, load_repo};
2626 use crate::state::AppState;
27-use crate::views::parts::{SubPart, head, post_act, reveal};
27+use crate::views::parts::{head, post_act, reveal};
2828 use crate::views::{alert, rel_time, repo_href, shell};
2929
3030 path_param!(owner);
@@ -210,15 +210,17 @@ pub(crate) async fn reviewers_box(lang: Lang, reviewers: ReviewersView) -> Resul
210210 error,
211211 } = reviewers;
212212 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+ };
213218 Ok(view! {
214219 <section class="sec meta" id="reviewers">
215220 <h2>(ga::t(lang, AK::Reviewers))</h2>
216221 if let Some(message) = message {
217222 alert(message: message)
218223 }
219- if names.is_empty() {
220- <p class="hint">(ga::t(lang, AK::NoReviewers))</p>
221- }
222224 for name in names.iter() {
223225 <div class="line">
224226 <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
228230 </div>
229231 }
230232 if write {
231- <div class="acts">
232- reveal(label: ga::t(lang, AK::RequestReview), id: Some("request-review"),
233+ <div class="line">
234+ reveal(label: tool, id: Some("request-review"),
233235 <form method="post" action=(action.as_str()) class="fields">
234236 <input type="hidden" name="csrf" value=(csrf.as_str())>
235237 <div class="field">
@@ -287,14 +289,9 @@ async fn review_requests(cx: &Cx) -> Result<impl View> {
287289 let heading = ga::t(lang, AK::ReviewRequests);
288290 let empty = rows.is_empty();
289291 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- ))];
295292 Ok(view! {
296293 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"))
298295 <div class="work">
299296 crate::pages::notifications::inbox_rail(lang: lang, current: "reviews", unread_count: unread)
300297 <div class="sheet">
crates/forge-web/src/pages/settings_appearance.rsmodified+4 -17
@@ -98,7 +98,7 @@ struct Stripe {
9898 const ACCENT_VIVID: u8 = 50;
9999 const BASE_VIVID: u8 = 30;
100100
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.
102102 fn row_lightness(base: bool, dark: bool) -> f64 {
103103 match (base, dark) {
104104 (false, true) => 0.75,
@@ -133,7 +133,6 @@ struct ColourGroup {
133133 hue: &'static str,
134134 vividness: &'static str,
135135 hex: &'static str,
136- note: &'static str,
137136 bases: Vec<Choice>,
138137 accents: Vec<Choice>,
139138 base_stripe: Stripe,
@@ -153,7 +152,6 @@ struct ColourRow {
153152 hue_label: &'static str,
154153 vivid_label: &'static str,
155154 hex_label: &'static str,
156- note: &'static str,
157155 }
158156
159157 struct AppearancePage {
@@ -274,7 +272,6 @@ fn colour_group(lang: Lang, dark: bool, base: &str, accent_id: &str) -> ColourGr
274272 hue: g::t(lang, K::HueLabel),
275273 vividness: g::t(lang, K::VividnessLabel),
276274 hex: g::t(lang, K::HexLabel),
277- note: g::t(lang, K::LightnessNote),
278275 bases: with_hues(
279276 choices(&base_codes, base_shown, |id| base_name(lang, id)),
280277 preset_base_hue,
@@ -304,7 +301,6 @@ async fn colour_row(row: ColourRow) -> Result<impl View> {
304301 hue_label,
305302 vivid_label,
306303 hex_label,
307- note,
308304 } = row;
309305 let value = custom_id(stripe.hue, stripe.vivid);
310306 let hue_value = stripe.hue.to_string();
@@ -353,7 +349,6 @@ async fn colour_row(row: ColourRow) -> Result<impl View> {
353349 <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">
354350 <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">
355351 </div>
356- <small class="hex-note" data-hex-note="true" data-message=(note)></small>
357352 </div>
358353 </div>
359354 </div>
@@ -372,7 +367,6 @@ async fn colour_panel(group: ColourGroup) -> Result<impl View> {
372367 hue,
373368 vividness,
374369 hex,
375- note,
376370 bases,
377371 accents,
378372 base_stripe,
@@ -392,7 +386,6 @@ async fn colour_panel(group: ColourGroup) -> Result<impl View> {
392386 hue_label: hue,
393387 vivid_label: vividness,
394388 hex_label: hex,
395- note,
396389 };
397390 let accent_row = ColourRow {
398391 dark,
@@ -405,7 +398,6 @@ async fn colour_panel(group: ColourGroup) -> Result<impl View> {
405398 hue_label: hue,
406399 vivid_label: vividness,
407400 hex_label: hex,
408- note,
409401 };
410402 Ok(view! {
411403 <div class="colour-panel" data-colour-panel=(panel)>
@@ -490,9 +482,8 @@ async fn appearance_body(page: AppearancePage) -> Result<impl View> {
490482 <span>(s(lang, "Off", "Kapalı"))</span>
491483 </label>
492484 </div>
493- <span class="hint">(g::t(lang, K::SoundOwnRuns))</span>
494- <button type="button" class="act play" data-sound-play="passed" title=(g::t(lang, K::SoundPassedNote))>(g::t(lang, K::SoundPassed))</button>
495- <button type="button" class="act play" data-sound-play="failed" title=(g::t(lang, K::SoundFailedNote))>(g::t(lang, K::SoundFailed))</button>
485+ <button type="button" class="act play" data-sound-play="passed">(g::t(lang, K::SoundPassed))</button>
486+ <button type="button" class="act play" data-sound-play="failed">(g::t(lang, K::SoundFailed))</button>
496487 </div>
497488 </div>
498489 </section>
@@ -605,11 +596,7 @@ async fn appearance_page(cx: &Cx) -> Result<impl View> {
605596 .user_prefs(&viewer.0.id)
606597 .await?;
607598 let page = page_for(&viewer, lang, &prefs);
608- let sub = vec![SubPart::text(s(
609- lang,
610- "Saved to your account, follows you on every device",
611- "Hesabına kaydedilir, her cihazda seninle gelir",
612- ))];
599+ let sub = Vec::<SubPart>::new();
613600 Ok(view! {
614601 shell(title: g::t(lang, K::Appearance), viewer: Some(&viewer),
615602 head(title: g::t(lang, K::Appearance), sub: sub)
crates/forge-web/src/pages/settings_export.rsmodified+185 -27
@@ -2,10 +2,13 @@
22 //! profile, watch it build, and download it until it expires. The page follows an event stream
33 //! while an export is building, so it turns ready with no reload and no polling.
44
5+use std::time::Duration;
6+
57 use forge_core::store::exports::{DataExport, ExportState};
8+use forge_core::{Session, User};
69 use futures_util::{TryStreamExt, stream};
710 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,
912 X_CONTENT_TYPE_OPTIONS,
1013 };
1114 use http_body::Frame;
@@ -17,16 +20,16 @@ use topcoat::context::{Cx, app_context};
1720 use topcoat::router::content::Form;
1821 use topcoat::router::error::{SeeOther, not_found, see_other};
1922 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};
2124 use topcoat::view::{View, component, view};
2225
23-use crate::auth::{require_csrf, require_user};
26+use crate::auth::{require_csrf, require_user, two_factor_enabled};
2427 use crate::exporter;
2528 use crate::i18n::migrate::{self as g, K};
26-use crate::i18n::{self, Lang};
29+use crate::i18n::{self, Key, Lang};
2730 use crate::pages::ci_runs::{changed_event, events_response};
2831 use crate::state::AppState;
29-use crate::views::parts::{SubPart, confirm_act, head};
32+use crate::views::parts::{RailItem, SubPart, confirm_act, head, rail};
3033 use crate::views::{alert, csrf_field, human_size, rel_time, shell};
3134
3235 path_param!(export_id);
@@ -42,6 +45,11 @@ struct SeenQuery {
4245 v: Option<String>,
4346 }
4447
48+#[query_params(error = bad_request)]
49+struct TopicQuery {
50+ part: Option<String>,
51+}
52+
4553 /// One word per export and its state, so the stream can tell the page is out of date.
4654 fn signature(exports: &[DataExport]) -> String {
4755 exports
@@ -51,8 +59,27 @@ fn signature(exports: &[DataExport]) -> String {
5159 .join(",")
5260 }
5361
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.
5481 #[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> {
5683 let building = exports.iter().any(|e| e.state == ExportState::Building);
5784 let live = building.then(|| {
5885 format!(
@@ -65,20 +92,8 @@ async fn export_view(lang: Lang, csrf: &str, exports: Vec<DataExport>) -> Result
6592 .iter()
6693 .map(|e| format!("/settings/export/{}/delete", e.id))
6794 .collect();
68- let ttl_note = g::export_ttl_note(lang, exporter::EXPORT_TTL_DAYS);
6995 Ok(view! {
70- head(title: g::t(lang, K::ExportTitle), sub: vec![SubPart::text(g::t(lang, K::ExportIntro))],
71- <form method="post" action="/settings/export">
72- csrf_field(token: csrf)
73- <button type="submit" class="primary" disabled=(building)>(g::t(lang, K::ExportRequest))</button>
74- </form>
75- )
76- <div class="sheet fit export-page" data-live=(live.as_deref()) data-live-state=(if building { "building" } else { "idle" })>
77- <section class="sec">
78- <h2>(crate::pages::passkeys::s(lang, "Archive", "Arşiv"))</h2>
79- <p class="hint">(g::t(lang, K::ExportContents))</p>
80- <p class="hint">(g::t(lang, K::ExportEmailNote)) " " (ttl_note.as_str())</p>
81- </section>
96+ <div class="sheet export-page" data-live=(live.as_deref()) data-live-state=(if building { "building" } else { "idle" })>
8297 <section class="sec">
8398 <h2>(crate::pages::passkeys::s(lang, "Your archives", "Arşivleriniz"))</h2>
8499 if empty {
@@ -104,7 +119,7 @@ async fn export_view(lang: Lang, csrf: &str, exports: Vec<DataExport>) -> Result
104119 <a class="act" href=(format!("/settings/export/{}/download", export.id))>(g::t(lang, K::ExportDownload))</a>
105120 }
106121 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)
108123 }
109124 </div>
110125 if export.state == ExportState::Building {
@@ -120,18 +135,161 @@ async fn export_view(lang: Lang, csrf: &str, exports: Vec<DataExport>) -> Result
120135 })
121136 }
122137
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+
123286 #[page("/settings/export")]
124287 async fn export_page(cx: &Cx) -> Result<impl View> {
125288 let viewer = require_user(cx).await?;
126- let lang = i18n::lang(cx, Some(&viewer.0));
127289 let state = app_context::<AppState>(cx);
128290 exporter::sweep_expired(state).await;
129- let exports = state.store.list_exports(&viewer.0.id).await?;
130- let csrf = viewer.1.csrf_token.clone();
131- Ok(view! { cx =>
132- shell(title: g::t(lang, K::SettingsExport), viewer: Some(&viewer),
133- export_view(lang: lang, csrf: csrf.as_str(), exports: exports))
134- })
291+ let query = query_params::<TopicQuery>(cx)?;
292+ page_view(cx, viewer, query.part.as_deref() == Some("delete"), None, None).await
135293 }
136294
137295 #[route(POST "/settings/export")]
crates/forge-web/src/pages/settings_gpg.rsmodified+0 -1
@@ -62,7 +62,6 @@ pub(crate) async fn gpg_section(
6262 <div class="field">
6363 <label for="gpg-key">(t(lang, Key::ArmoredPublicKeyLabel))</label>
6464 <textarea id="gpg-key" name="armored" rows="8" spellcheck="false" required=(true)>(armored)</textarea>
65- <p class="hint">(t(lang, Key::ArmoredHint))</p>
6665 </div>
6766 <div class="acts asks">
6867 <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 {
185185 KeyKind::Tokens => t(lang, Key::NewToken),
186186 }
187187 }
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- }
204188 }
205189
206190 #[query_params(error = bad_request)]
@@ -236,10 +220,7 @@ pub(crate) async fn keys_page_view(
236220 current: k == kind,
237221 })
238222 .collect();
239- let sub = vec![
240- SubPart::text(kind.about(lang)),
241- SubPart::text(key_count(lang, count(kind))),
242- ];
223+ let sub = Vec::<SubPart>::new();
243224 let add_href = format!("{}?add", kind.href());
244225 let add_open = draft.add
245226 || draft.ssh_error.is_some()
@@ -268,14 +249,6 @@ pub(crate) async fn keys_page_view(
268249 })
269250 }
270251
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-
279252 fn pk_title(lang: Lang) -> &'static str {
280253 crate::pages::passkeys::s(lang, "Keys", "Anahtarlar")
281254 }
@@ -305,7 +278,6 @@ async fn ssh_section(
305278 <div class="field">
306279 <label for="ssh-key">(t(lang, Key::PublicKeyLabel))</label>
307280 <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>
309281 </div>
310282 <div class="acts asks">
311283 <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> {
7171 // locked and the notes below say why.
7272 let blocked = unverified_note.is_some() || server_note.is_some();
7373 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())
7575 if let Some(message) = notice {
7676 <p class="state" role="status">(message.as_str())</p>
7777 }
@@ -85,7 +85,6 @@ async fn notifications_body(page: NotificationsPage) -> Result<impl View> {
8585 <input type="checkbox" form="notify-form" name="email_notifications" value="1" checked=(on) disabled=(blocked) data-autosubmit="true">
8686 <span>(t(lang, Key::EmailNotifyLabel))</span>
8787 </label>
88- <p class="hint">(t(lang, Key::EmailNotifyHelp))</p>
8988 if let Some(message) = server_note {
9089 <p class="hint warn" role="note">(message)</p>
9190 }
@@ -102,7 +101,6 @@ async fn notifications_body(page: NotificationsPage) -> Result<impl View> {
102101 <h2>(push_text::t(lang, push_text::K::DeviceHeading))</h2>
103102 <p class="state" data-push-state="on" hidden=(true)>(push_text::t(lang, push_text::K::DeviceOn))</p>
104103 <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>
106104 <p class="hint" role="note" data-push-state="unsupported" hidden=(true)>(push_text::t(lang, push_text::K::DeviceUnsupported))</p>
107105 <p class="hint" role="note" data-push-state="https" hidden=(true)>(push_text::t(lang, push_text::K::DeviceNeedsHttps))</p>
108106 <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};
2323 use crate::auth::{require_csrf, require_user};
2424 use crate::i18n::{self, Key, Lang, about_too_long, display_name_too_long, t};
2525 use crate::live::Topic;
26-use crate::pages::passkeys::s;
2726 use crate::state::AppState;
2827 use crate::views::parts::{SubPart, confirm_act, head, reveal};
2928 use crate::views::{alert, avatar_url, shell, user_facing_message};
@@ -141,7 +140,7 @@ async fn profile_body(page: ProfilePage) -> Result<impl View> {
141140 } = page;
142141 let avatar_open = errors.avatar.is_some();
143142 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())
145144 if let Some(message) = notice {
146145 <p class="state" role="status">(message)</p>
147146 }
@@ -149,7 +148,6 @@ async fn profile_body(page: ProfilePage) -> Result<impl View> {
149148 <section class="sec">
150149 <h2>(t(lang, Key::Avatar))</h2>
151150 <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>
153151 <div class="acts">
154152 reveal(label: t(lang, Key::UploadPhoto), open: avatar_open,
155153 if let Some(message) = errors.avatar {
@@ -174,8 +172,7 @@ async fn profile_body(page: ProfilePage) -> Result<impl View> {
174172 <section class="sec">
175173 <div class="field">
176174 <label for="profile-display-name">(t(lang, Key::DisplayName))</label>
177- <input id="profile-display-name" type="text" name="display_name" maxlength="80" autocomplete="name" value=(draft.display_name.as_str()) aria-describedby="profile-display-name-hint">
178- <p class="hint" id="profile-display-name-hint">(t(lang, Key::DisplayNameHint))</p>
175+ <input id="profile-display-name" type="text" name="display_name" maxlength="80" autocomplete="name" value=(draft.display_name.as_str())>
179176 </div>
180177 if let Some(message) = errors.display_name {
181178 alert(message: message.as_str())
@@ -184,8 +181,7 @@ async fn profile_body(page: ProfilePage) -> Result<impl View> {
184181 <section class="sec">
185182 <div class="field">
186183 <label for="profile-username">(t(lang, Key::Username))</label>
187- <input id="profile-username" type="text" name="username" maxlength="64" required=(true) autocomplete="username" value=(draft.username.as_str()) aria-describedby="profile-username-hint">
188- <p class="hint" id="profile-username-hint">(t(lang, Key::UsernameHint))</p>
184+ <input id="profile-username" type="text" name="username" maxlength="64" required=(true) autocomplete="username" value=(draft.username.as_str())>
189185 </div>
190186 if let Some(message) = errors.username {
191187 alert(message: message.as_str())
@@ -194,8 +190,7 @@ async fn profile_body(page: ProfilePage) -> Result<impl View> {
194190 <section class="sec">
195191 <div class="field">
196192 <label for="profile-about">(t(lang, Key::About))</label>
197- <textarea id="profile-about" name="about" rows="6" maxlength="2000" aria-describedby="profile-about-hint">(draft.about.as_str())</textarea>
198- <p class="hint" id="profile-about-hint">(t(lang, Key::AboutHint))</p>
193+ <textarea id="profile-about" name="about" rows="6" maxlength="2000">(draft.about.as_str())</textarea>
199194 </div>
200195 if let Some(message) = errors.about {
201196 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};
2626 use crate::i18n::releases_ci::{self as rc, K as RC};
2727 use crate::i18n::{self, Key, Lang, password_too_long, password_too_short, t};
2828 use crate::pages::passkeys::{PasskeyPanel, build_panel, passkeys_panel, s};
29+use crate::pages::settings_export;
2930 use crate::pages::settings_sessions::session_label;
3031 use crate::state::AppState;
3132 use crate::throttle::{self, LOGIN_USER_LIMIT, TWO_FACTOR_USER_LIMIT};
@@ -45,7 +46,7 @@ const MAX_DEVICE_NAME_CHARS: usize = 40;
4546 #[query_params(error = bad_request)]
4647 struct SecurityQuery {
4748 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.
4950 part: Option<String>,
5051 }
5152
@@ -124,7 +125,6 @@ struct DeleteAccountForm {
124125 #[derive(Default)]
125126 struct Shown {
126127 notice: Option<&'static str>,
127- delete_error: Option<String>,
128128 password_error: Option<String>,
129129 email_error: Option<String>,
130130 email_draft: Option<String>,
@@ -187,10 +187,7 @@ struct SecurityPage {
187187 password_changed: Option<String>,
188188 /// The enabled device. `None` when two-factor is off.
189189 two_factor: Option<DeviceView>,
190- delete_error: Option<String>,
191190 passkeys: PasskeyPanel,
192- /// Repositories still owned by the user. Deletion is refused while there are any.
193- owned_repos: Vec<String>,
194191 /// Web sessions open on the account, listed by the Sessions topic.
195192 sessions: Vec<Session>,
196193 /// The id of the session that is viewing the page.
@@ -250,24 +247,9 @@ pub(crate) fn security_rail_items(
250247 href: "/settings/security/log".to_owned(),
251248 current: active == "log",
252249 },
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- },
259250 ]
260251 }
261252
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-
271253 /// The rail for a page outside the topics (the security log), with live counts.
272254 pub(crate) async fn security_rail_for(
273255 state: &AppState,
@@ -310,9 +292,7 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> {
310292 pending,
311293 password_changed,
312294 two_factor,
313- delete_error,
314295 passkeys,
315- owned_repos,
316296 sessions,
317297 current_session_id,
318298 part,
@@ -338,17 +318,8 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> {
338318 let setup_error = two_factor_error.filter(|_| two_factor_panel == TwoFactorPanel::Setup);
339319 let regenerate_open = regenerate_error.is_some();
340320 let disable_open = disable_error.is_some();
341- let delete_open = delete_error.is_some();
342- let delete_blocked = !owned_repos.is_empty();
343321 // One topic shows at a time: the one with an error or fresh codes, else the one asked for.
344- const TOPICS: [&str; 6] = [
345- "password",
346- "email",
347- "two-factor",
348- "passkeys",
349- "sessions",
350- "danger",
351- ];
322+ const TOPICS: [&str; 5] = ["password", "email", "two-factor", "passkeys", "sessions"];
352323 let active: &'static str = if password_open {
353324 "password"
354325 } else if email_open {
@@ -360,8 +331,6 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> {
360331 || (pending_set && part.is_none())
361332 {
362333 "two-factor"
363- } else if delete_open {
364- "danger"
365334 } else {
366335 part.as_deref()
367336 .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> {
369338 };
370339 let items = security_rail_items(lang, active, two_factor_on, passkey_count, session_count);
371340 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())
373342 if let Some(message) = notice {
374343 <p class="state" role="status">(message)</p>
375344 }
@@ -393,7 +362,6 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> {
393362 <div class="field">
394363 <label for="new-password">(t(lang, Key::NewPassword))</label>
395364 <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>
397365 </div>
398366 <div class="field">
399367 <label for="confirm-password">(t(lang, Key::ConfirmNewPassword))</label>
@@ -448,7 +416,7 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> {
448416 }
449417 if let Some(device) = two_factor {
450418 <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>
452420 <div class="line">
453421 <span class="name">(t(lang, Key::RecoveryCodes))</span>
454422 <span class="val">(device.codes_line.as_str())</span>
@@ -464,7 +432,6 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> {
464432 }
465433 <form data-hard="true" method="post" action="/settings/security/2fa/recovery" class="fields">
466434 <input type="hidden" name="csrf" value=(csrf)>
467- <p class="hint">(t(lang, Key::RegenerateCodesHint))</p>
468435 <div class="field">
469436 <label for="regenerate-password">(t(lang, Key::CurrentPassword))</label>
470437 <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> {
501468 <p class="state">(t(lang, Key::SetupInProgress))</p>
502469 } else {
503470 <p class="state">(t(lang, Key::PillOff))</p>
504- <p class="hint">(t(lang, Key::TwoFactorOffIntro))</p>
505471 <div class="acts">
506472 <form data-hard="true" method="post" action="/settings/security/2fa/enable" class="act-form">
507473 <input type="hidden" name="csrf" value=(csrf)>
@@ -510,9 +476,8 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> {
510476 </div>
511477 }
512478 if let Some((secret, uri)) = pending {
513- <p class="hint">(t(lang, Key::TwoFactorPendingIntro))</p>
514- <p class="hint">(t(lang, Key::SecretPrefix)) <code>(secret)</code></p>
515- <p class="hint">(t(lang, Key::LinkPrefix)) <code>(uri)</code></p>
479+ <p class="state">(t(lang, Key::SecretPrefix)) <code>(secret)</code></p>
480+ <p class="state">(t(lang, Key::LinkPrefix)) <code>(uri)</code></p>
516481 if let Some(message) = setup_error {
517482 alert(message: message.as_str())
518483 }
@@ -525,7 +490,6 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> {
525490 <div class="field">
526491 <label for="enrol-name">(t(lang, Key::DeviceName))</label>
527492 <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>
529493 </div>
530494 <button type="submit" class="primary">(t(lang, Key::ConfirmAndTurnOn))</button>
531495 </form>
@@ -536,7 +500,7 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> {
536500 <h2>(t(lang, Key::Sessions))</h2>
537501 if others > 0 {
538502 <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)
540504 </div>
541505 }
542506 for session in sessions.into_iter() {
@@ -552,49 +516,8 @@ async fn security_body(page: SecurityPage, csrf: &str) -> Result<impl View> {
552516 (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())
553517 </span>
554518 if session.id != current_session_id {
555- confirm_act(lang: lang, label: t(lang, Key::Revoke), action: "/settings/sessions/revoke", csrf: csrf, fields: vec![("id".to_owned(), session.id.clone())], note: Some(s(lang, "This browser is signed out at once.", "Bu tarayıcıda oturum hemen kapanır.").to_owned()))
556- }
557- </div>
558- }
559- </section>
560- <section class="sec" id="danger">
561- <h2>(t(lang, Key::DangerZone))</h2>
562- if delete_blocked {
563- <p class="state">(t(lang, Key::TransferOrDeleteRepos))</p>
564- <ul class="topic-list">
565- for name in owned_repos.into_iter() {
566- <li class="line"><span class="name">(name)</span></li>
519+ confirm_act(lang: lang, label: t(lang, Key::Revoke), action: "/settings/sessions/revoke", csrf: csrf, fields: vec![("id".to_owned(), session.id.clone())])
567520 }
568- </ul>
569- } else {
570- <p class="state">(t(lang, Key::DeleteAccountIntro))</p>
571- <div class="acts">
572- <details class="reveal" open=(delete_open)>
573- <summary class="act danger">(t(lang, Key::DeleteAccount))</summary>
574- <div class="opened">
575- if let Some(message) = delete_error {
576- alert(message: message.as_str())
577- }
578- <form data-hard="true" method="post" action="/settings/security/delete" class="fields">
579- <input type="hidden" name="csrf" value=(csrf)>
580- <div class="field">
581- <label for="delete-password">(t(lang, Key::CurrentPassword))</label>
582- <input id="delete-password" type="password" name="current_password" autocomplete="current-password" required=(true)>
583- </div>
584- if two_factor_on {
585- <div class="field">
586- <label for="delete-code">(t(lang, Key::Code))</label>
587- <input id="delete-code" type="text" name="code" autocomplete="one-time-code" required=(true)>
588- </div>
589- }
590- <div class="field">
591- <label for="delete-username">(t(lang, Key::TypeUsernameToConfirm))</label>
592- <input id="delete-username" type="text" name="confirm_username" autocomplete="off" required=(true)>
593- </div>
594- <button type="submit" class="act danger">(t(lang, Key::DeleteAccount))</button>
595- </form>
596- </div>
597- </details>
598521 </div>
599522 }
600523 </section>
@@ -683,13 +606,6 @@ async fn build_page(
683606 None => (None, None),
684607 };
685608 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();
693609 let stored_email = viewer.0.email.clone().unwrap_or_default();
694610 let email_verified = state.store.email_is_verified(&viewer.0.id).await?;
695611 let mut email_sent = None;
@@ -714,9 +630,7 @@ async fn build_page(
714630 };
715631 Ok(SecurityPage {
716632 lang,
717- delete_error: shown.delete_error,
718633 passkeys: build_panel(state, &viewer.0.id).await?,
719- owned_repos,
720634 email_verified,
721635 stored_email,
722636 email_status,
@@ -836,6 +750,10 @@ async fn security_page(cx: &Cx) -> Result<impl View> {
836750 let viewer = require_user(cx).await?;
837751 let lang = i18n::lang(cx, Some(&viewer.0));
838752 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+ }
839757 let saved = query.saved.clone();
840758 // A notice belongs to a topic: the page opens on it.
841759 let part = query.part.clone().or_else(|| {
@@ -1065,27 +983,24 @@ async fn account_delete(cx: &Cx, Form(form): Form<DeleteAccountForm>) -> Result<
1065983 let lang = i18n::lang(cx, Some(&viewer.0));
1066984 let state = app_context::<AppState>(cx);
1067985 let user_id = viewer.0.id.clone();
1068- let mut shown = Shown::default();
1069986 if form.confirm_username != viewer.0.username {
1070- shown.delete_error = Some(t(lang, Key::ErrConfirmUsername).into());
1071- return respond(cx, viewer, shown).await;
987+ let error = Some(t(lang, Key::ErrConfirmUsername).into());
988+ return settings_export::respond_delete(cx, viewer, error, None).await;
1072989 }
1073990 if let Err(refused) = require_password(lang, state, &viewer.0, &form.current_password).await? {
1074- shown.delete_error = Some(refused.message.into());
1075- shown.throttled = refused.retry;
1076- return respond(cx, viewer, shown).await;
991+ let error = Some(refused.message.into());
992+ return settings_export::respond_delete(cx, viewer, error, refused.retry).await;
1077993 }
1078994 if two_factor_enabled(&state.store, &user_id).await? {
1079995 if let Some(retry) = second_factor_blocked(state, &user_id) {
1080- shown.delete_error = Some(t(lang, Key::ErrThrottled).into());
1081- shown.throttled = Some(retry);
1082- return respond(cx, viewer, shown).await;
996+ let error = Some(t(lang, Key::ErrThrottled).into());
997+ return settings_export::respond_delete(cx, viewer, error, Some(retry)).await;
1083998 }
1084999 let key = throttle::two_factor_key(&user_id);
10851000 if !verify_second_factor(&state.store, &state.key, &user_id, &form.code).await? {
10861001 state.throttle.record_failure(&key, Instant::now());
1087- shown.delete_error = Some(t(lang, Key::ErrWrongCode).into());
1088- return respond(cx, viewer, shown).await;
1002+ let error = Some(t(lang, Key::ErrWrongCode).into());
1003+ return settings_export::respond_delete(cx, viewer, error, None).await;
10891004 }
10901005 state.throttle.clear(&key);
10911006 }
@@ -1111,10 +1026,7 @@ async fn account_delete(cx: &Cx, Form(form): Form<DeleteAccountForm>) -> Result<
11111026 Err(see_other("/").into())
11121027 }
11131028 Err(e) => match user_facing_message(&e) {
1114- Some(message) => {
1115- shown.delete_error = Some(message);
1116- respond(cx, viewer, shown).await
1117- }
1029+ Some(message) => settings_export::respond_delete(cx, viewer, Some(message), None).await,
11181030 None => Err(e.into()),
11191031 },
11201032 }
crates/forge-web/src/pages/settings_tokens.rsmodified+1 -11
@@ -53,14 +53,6 @@ struct DeleteTokenForm {
5353 id: String,
5454 }
5555
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-
6456 /// Maps the form's expiry choice to a lifetime. `None` means the token never expires.
6557 /// An unrecognised value falls back to the 90-day default.
6658 fn expiry_days(choice: &str) -> Option<u64> {
@@ -91,7 +83,6 @@ pub(crate) async fn tokens_section(
9183 <pre class="code"><code id="new-token">(token)</code></pre>
9284 <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>
9385 </div>
94- <p class="hint">(t(lang, Key::UseAsPassword))</p>
9586 </div>
9687 }
9788 if add {
@@ -118,7 +109,6 @@ pub(crate) async fn tokens_section(
118109 <input type="checkbox" name="packages" value="on">
119110 <span>(pk::t(lang, PK::ScopePackages))</span>
120111 </label>
121- <p class="hint">(pk::t(lang, PK::ScopePackagesHelp)) " " (t(lang, Key::ScopeNote))</p>
122112 <div class="acts asks">
123113 <button type="submit" class="primary">(t(lang, Key::CreateToken))</button>
124114 <a class="act" href="/settings/tokens">(s(lang, "Keep it", "Vazgeç"))</a>
@@ -133,7 +123,7 @@ pub(crate) async fn tokens_section(
133123 <div class="line">
134124 <span class="name">(token.name.clone())</span>
135125 <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)
137127 </div>
138128 }
139129 })
crates/forge-web/src/pages/setup.rsmodified+2 -2
@@ -14,7 +14,7 @@ use crate::audit::{self, Actor, Target};
1414 use crate::auth::{check_pre_csrf, clear_pre_csrf, hash_password_async, login, pre_csrf_token};
1515 use crate::i18n::{self, Key, Lang, password_too_long, password_too_short, t};
1616 use crate::state::AppState;
17-use crate::views::parts::{SubPart, head};
17+use crate::views::parts::head;
1818 use crate::views::{alert, shell, user_facing_message};
1919
2020 const MIN_PASSWORD_CHARS: usize = 12;
@@ -43,7 +43,7 @@ async fn setup_form(
4343 error: Option<String>,
4444 ) -> Result<impl View> {
4545 Ok(view! {
46- head(title: t(lang, Key::WelcomeToForge), sub: vec![SubPart::text(t(lang, Key::SetupSub))])
46+ head(title: t(lang, Key::WelcomeToForge))
4747 <div class="sheet fit">
4848 <form data-hard="true" method="post" action="/setup" class="fields">
4949 if let Some(message) = error {
crates/forge-web/src/pages/snippets.rsmodified+0 -1
@@ -485,7 +485,6 @@ async fn snippet_body(
485485 }
486486 <p class="hint">(g::updated_before(lang)) rel_time(lang: lang, stamp: updated_at) (g::updated_after(lang))</p>
487487 if !is_owner {
488- <p class="hint">(g::t(lang, K::OnlyOwnerEdits))</p>
489488 }
490489 </section>
491490 for file in files.into_iter() {
crates/forge-web/src/pages/wiki.rsmodified+15 -46
@@ -26,7 +26,6 @@ use crate::i18n::{self, Lang};
2626 use crate::live::Topic;
2727 use crate::pages::repo::repo_head;
2828 use crate::pages::repo_ctx::{RepoCtx, load_repo};
29-use crate::pages::repo_settings::settings_frame;
3029 use crate::pages::wiki_live::{bump_wiki, page_live_url, wiki_live_url};
3130 use crate::render::markdown::render_markdown;
3231 use crate::state::AppState;
@@ -343,13 +342,11 @@ async fn wiki_edit_body(
343342 <div class="field">
344343 <label for="wiki-name">(g::t(lang, K::PageName))</label>
345344 <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>
347345 </div>
348346 }
349347 <div class="field">
350348 <label for="wiki-content">(g::t(lang, K::ContentMarkdown))</label>
351349 <textarea id="wiki-content" name="content" rows="24" spellcheck="false">(content.as_str())</textarea>
352- <p class="hint">(g::t(lang, K::WikiLinkHint))</p>
353350 </div>
354351 <div class="field">
355352 <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
764761 Ok(SaveOutcome::Saved(page_href(ctx, name)))
765762 }
766763
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.
767766 #[component]
768-async fn wiki_settings_body(
769- lang: Lang,
767+pub(crate) async fn wiki_switch(
770768 action: String,
771769 csrf: String,
772770 enabled: bool,
773771 ) -> Result<impl View> {
774772 Ok(view! {
775- <section class="sec">
776- <h2>(g::t(lang, K::WikiSettings))</h2>
777- <form method="post" action=(action.as_str()) class="fields wiki-form">
778- <input type="hidden" name="csrf" value=(csrf.as_str())>
779- <label class="switch">
780- <input type="checkbox" name="enabled" value="1" checked=(enabled)>
781- <span>(g::t(lang, K::EnableWiki))</span>
782- </label>
783- <p class="hint">(g::t(lang, K::WikiDisabledHint))</p>
784- <button type="submit" class="primary">(g::t(lang, K::Save))</button>
785- </form>
786- </section>
773+ <form method="post" action=(action.as_str()) id="wiki">
774+ <input type="hidden" name="csrf" value=(csrf.as_str())>
775+ <label class="switch">
776+ <input type="checkbox" name="enabled" value="1" checked=(enabled) data-autosubmit="true">
777+ <span>"Wiki"</span>
778+ </label>
779+ </form>
787780 })
788781 }
789782
790-#[page("/{owner}/{repo}/settings/wiki")]
791-async fn wiki_settings_page(cx: &Cx) -> Result<impl View> {
783+/// The wiki switch moved to the General settings page; the old address goes there.
784+#[route(GET "/{owner}/{repo}/settings/wiki")]
785+async fn wiki_settings_page(cx: &Cx) -> Result<SeeOther> {
792786 let owner = path_param::<Owner>(cx);
793787 let repo_param = path_param::<Repo>(cx);
794- let ctx = load_repo(cx, owner, repo_param).await?;
795- let (user, session) = require_user(cx).await?;
796- if !ctx.can_admin() {
797- return Err(not_found().into());
798- }
799- let lang = i18n::lang(cx, Some(&user));
800- let state = app_context::<AppState>(cx);
801- let enabled = state.store.wiki_enabled(&ctx.repo.id).await?;
802- let title = format!(
803- "{}/{} \u{b7} {}",
804- ctx.repo.owner_name,
805- ctx.repo.name,
806- g::t(lang, K::WikiSettings)
807- );
808- let header = ctx.head(state, "settings").await?;
809- let action = repo_href(&ctx.repo.owner_name, &ctx.repo.name, "settings/wiki", "");
810- let csrf = session.csrf_token.clone();
811- Ok(view! { cx =>
812- shell(title: title.as_str(), viewer: ctx.viewer.as_ref(),
813- repo_head(head: header, title: Some(g::t(lang, K::Wiki).to_owned()))
814- settings_frame(lang: lang, title: format!("{}/{}", ctx.repo.owner_name, ctx.repo.name), current: "wiki",
815- can_delete: ctx.can_delete(),
816- wiki_settings_body(lang: lang, action: action, csrf: csrf, enabled: enabled)
817- )
818- )
819- })
788+ Ok(see_other(repo_href(owner, repo_param, "settings", "")))
820789 }
821790
822791 #[derive(Deserialize)]
@@ -865,7 +834,7 @@ async fn wiki_settings_post(cx: &Cx, Form(form): Form<WikiSettingsForm>) -> Resu
865834 Ok(see_other(repo_href(
866835 &ctx.repo.owner_name,
867836 &ctx.repo.name,
868- "settings/wiki",
837+ "settings",
869838 "",
870839 )))
871840 }
crates/forge-web/src/views/heatmap.rsmodified+0 -2
@@ -368,7 +368,6 @@ pub async fn contribution_calendar(
368368 calendar.current_streak,
369369 calendar.longest_streak,
370370 );
371- let motivation = g::heatmap_motivation(lang, calendar.today_count, calendar.current_streak);
372371 let total = g::thousands(lang, calendar.total);
373372 let current = g::streak_days(lang, calendar.current_streak);
374373 let longest = g::streak_days(lang, calendar.longest_streak);
@@ -489,7 +488,6 @@ pub async fn contribution_calendar(
489488 </div>
490489 </div>
491490 <div class="heat-foot">
492- <p class="muted small">(motivation.as_str())</p>
493491 <div class="legend" aria-hidden="true">
494492 <span>(less)</span>
495493 <span class="cell l0"></span>
crates/forge-web/src/views/mod.rsmodified+31 -142
@@ -475,8 +475,8 @@ fn no_runs() -> ActorRuns {
475475 }
476476 }
477477
478-/// What the profile corner shows: the viewer, their unread notification count, their inbox counts
479-/// with where each leads, and whether any of their runs is going (the ring glows).
478+/// What the profile corner shows: the viewer, their unread notification count, and whether review
479+/// requests, mentions or failed runs wait for them (the avatar's dot says so with the count).
480480 #[derive(Clone)]
481481 struct ProfileCorner {
482482 username: String,
@@ -484,125 +484,48 @@ struct ProfileCorner {
484484 name: String,
485485 avatar: String,
486486 csrf: String,
487- back: String,
488487 is_admin: bool,
489- theme: String,
490- /// Unread notifications, shown as a count on the bell.
488+ /// Unread notifications, shown as a count on the notifications row.
491489 unread: u64,
492- reviews: u64,
493- mentions: u64,
494- failing: u64,
495- /// The newest waiting review request, mention and failed run, each chip's link.
496- review_href: String,
497- mention_href: String,
498- failing_href: String,
490+ /// Whether a review request, a mention or a failed run waits for the viewer.
491+ waiting: bool,
499492 }
500493
501494 /// The profile at the start of the top bar (signed in only): the avatar, with a dot when something
502-/// waits. Its menu holds the name, notifications with their popover, what waits on the viewer, the
503-/// profile, settings and admin links, the theme choice and log out.
495+/// waits. Its menu holds the name, notifications with their count, the settings and admin links and
496+/// log out.
504497 #[component]
505498 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);
537499 let profile_href = user_href(&corner.username);
538500 let profile_label = mi::t(lang, MK::YourProfile);
539501 let settings_label = o::t(lang, OK::Settings);
540502 let admin_label = ad::t(lang, AK::AdminArea);
541503 let logout_label = t(lang, Key::LogOut);
542- let bell_title = i18n::t(lang, Key::Notifications);
543- let open_label = mi::t(lang, MK::OpenNotifications);
544- let clear_label = mi::t(lang, MK::ClearNotifications);
545- let clear_title = mi::t(lang, MK::MarkAllRead);
546- let loading_label = mi::t(lang, MK::PeekLoading);
547- let error_label = mi::t(lang, MK::PeekError);
504+ let inbox_label = t(lang, Key::Notifications);
505+ let class = if corner.unread > 0 || corner.waiting {
506+ "corner waiting"
507+ } else {
508+ "corner"
509+ };
548510 Ok(view! {
549- <details class="corner" data-unread-stream="">
511+ <details class=(class) data-unread-stream="">
550512 <summary class="corner-btn" aria-label=(corner.username.as_str())>
551513 <img class="avatar corner-avatar" src=(corner.avatar.as_str()) alt="" width="32" height="32">
552514 </summary>
553515 <div class="corner-menu">
554516 <a class="corner-who" href=(profile_href.as_str()) title=(profile_label)>(corner.name.as_str())</a>
555- <a class="corner-link corner-bell" href="/notifications" title=(bell_label) aria-expanded="false">
556- <span>(bell_title)</span>
517+ <a class="corner-link corner-bell" href="/notifications">
518+ <span>(inbox_label)</span>
557519 if corner.unread > 0 {
558520 <span class="bell-count">(corner.unread.to_string())</span>
559521 }
560522 </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>
585523 <div class="corner-sep"></div>
586524 <a class="corner-link" href="/settings/profile">(settings_label)</a>
587525 if corner.is_admin {
588526 <a class="corner-link" href="/admin/users">(admin_label)</a>
589527 }
590528 <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>
606529 <form data-hard="true" method="post" action="/logout">
607530 <input type="hidden" name="csrf" value=(corner.csrf.as_str())>
608531 <button type="submit" class="corner-link link-button">(logout_label)</button>
@@ -628,17 +551,16 @@ pub async fn shell(
628551 let full_title = format!("{title} \u{b7} forge");
629552 // The unread count, the profile corner's inbox counts, their CI runs and the items waiting on
630553 // them. Signed-in only.
631- let (unread, inbox, runs, waiting) = match viewer {
554+ let (unread, inbox, runs) = match viewer {
632555 Some((user, _)) => match try_app_context::<AppState>(__cx) {
633556 Some(state) => (
634557 state.store.unread_count(&user.id).await?,
635558 state.store.inbox_kind_counts(&user.id).await?,
636559 state.store.actor_runs(&user.id, 120).await?,
637- state.store.waiting_on(&user.id, 5).await?,
638560 ),
639- None => (0, InboxKinds::default(), no_runs(), Vec::new()),
561+ None => (0, InboxKinds::default(), no_runs()),
640562 },
641- None => (0, InboxKinds::default(), no_runs(), Vec::new()),
563+ None => (0, InboxKinds::default(), no_runs()),
642564 };
643565 let signed_in = viewer.is_some();
644566 // 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(
725647 );
726648 let palette_label = br::t(lang, br::K::PaletteOpen).to_owned();
727649 let explore_label = t(lang, Key::Explore);
650+ let home_label = o::t(lang, OK::Home);
728651 // The path bar: one segment per part of the request path, the last one unlinked.
729652 let mut segments = path_segments(lang, uri(__cx).path(), title);
730653 // 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(
778701 let cancelled_tpl = count_template(&mi::cancelled_count(lang, 2), 2);
779702 let runs_label = mi::t(lang, MK::YourCiRuns);
780703 let search_for_label = mi::t(lang, MK::SearchPublicReposFor);
781- // The profile corner, the signed-in account panel.
782- // Each chip leads to the newest thing it counts; a review or mention past the five newest
783- // waiting items falls back to the inbox.
784- let newest_waiting = |review: bool| {
785- waiting
786- .iter()
787- .find(|item| {
788- matches!(
789- item.reason,
790- forge_core::notifications::Reason::ReviewRequested
791- ) == review
792- })
793- .map_or_else(
794- || "/notifications".to_owned(),
795- |item| {
796- let section = if item.is_pull { "pulls" } else { "issues" };
797- repo_href(&item.owner, &item.repo, section, &item.number.to_string())
798- },
799- )
800- };
801- let review_href = newest_waiting(true);
802- let mention_href = newest_waiting(false);
803- let failing_href = runs.newest_failing.as_ref().map_or_else(
804- || "/notifications".to_owned(),
805- |(owner, repo, number)| repo_href(owner, repo, "ci", &format!("runs/{number}")),
806- );
704+ // The profile corner, the signed-in account panel. Its dot says something waits: an unread
705+ // notification, a review request, a mention or a failed run.
807706 let corner = viewer.map(|(user, session)| ProfileCorner {
808707 username: user.username.clone(),
809708 name: user
@@ -815,16 +714,9 @@ pub async fn shell(
815714 .to_owned(),
816715 avatar: avatar_url(&user.username, user.avatar_hash.as_deref()),
817716 csrf: session.csrf_token.clone(),
818- back: back.clone().unwrap_or_else(|| "/".to_owned()),
819717 is_admin: user.is_admin,
820- theme: theme_pref.to_owned(),
821718 unread,
822- reviews: inbox.reviews,
823- mentions: inbox.mentions,
824- failing: runs.failing,
825- review_href,
826- mention_href,
827- failing_href,
719+ waiting: inbox.reviews + inbox.mentions + runs.failing > 0,
828720 });
829721 Ok(view! {
830722 <!DOCTYPE html>
@@ -857,7 +749,7 @@ pub async fn shell(
857749 profile_corner(lang: lang, corner: corner)
858750 </div>
859751 }
860- <a class="wordmark" href="/">"forge"</a>
752+ <a class="wordmark" href="/" title=(home_label)>"forge"</a>
861753 </div>
862754 <nav class="pathbar" aria-label=(mi::t(lang, MK::BreadcrumbNav))>
863755 <ol class="pathbar-segs">
@@ -1013,16 +905,10 @@ pub fn admin_items(lang: Lang) -> Vec<NavItem> {
1013905 };
1014906 vec![
1015907 item("users", "/admin/users", ad::t(lang, AK::Users)),
1016- item("invites", "/admin/invites", ad::t(lang, AK::Invites)),
1017908 item("runners", "/admin/runners", ad::t(lang, AK::Runners)),
1018909 item("server", "/admin/server", ad::t(lang, AK::ServerSettings)),
1019910 item("mail", "/admin/mail", ad::t(lang, AK::Mail)),
1020911 item("backups", "/admin/backups", ad::t(lang, AK::Backups)),
1021- item(
1022- "replication",
1023- "/admin/replication",
1024- ad::t(lang, AK::Replication),
1025- ),
1026912 item(
1027913 "health",
1028914 "/admin/health",
@@ -1156,10 +1042,13 @@ pub fn section_for(lang: Lang, path: &str) -> Option<Section> {
11561042 ),
11571043 _ => return None,
11581044 };
1159- let second = match second {
1160- "sessions" => "security",
1161- "gpg" | "tokens" => "keys",
1162- other => other,
1045+ let second = match (first, second) {
1046+ (_, "sessions") => "security",
1047+ (_, "gpg" | "tokens") => "keys",
1048+ // Invites are a rail item of Users, replication one of Backups.
1049+ ("admin", "invites") => "users",
1050+ ("admin", "replication") => "backups",
1051+ (_, other) => other,
11631052 };
11641053 let current = items
11651054 .iter()
crates/forge-web/src/views/parts.rsmodified+161 -0
@@ -81,6 +81,167 @@ pub async fn post_act(
8181 })
8282 }
8383
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+
84245 /// One piece of a head's sub line. Pieces are joined with a middle dot.
85246 #[derive(Clone, Default)]
86247 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
7676 list itself carries no second "New ..." line under it.
7777 - **Facts**: a page that describes one thing (an account, an organization) lists it as `.sec.facts`:
7878 compact 34px lines of a `.key` on the label column, the `.val`, and the action for that fact on the
79- same line. No hints stacked under a heading: what a fact means or why its action is missing goes in
80- its value.
79+ same line. No hints under a heading or a fact.
8180 - **Time range**: every log has a When filter (Any time, Last hour, Last 24 hours, Last 7 days, Last
8281 30 days, Today, Dates…). Dates… shows From and To day fields in the viewer's timezone, and the tools
8382 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
9998
10099 ```html
101100 <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>
103102 <button type="submit" class="primary">Save</button>
104103 </form>
105104 ```
106105
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
108107 fields. A checkbox is `<label class="switch"><input type="checkbox"><span>..</span></label>`, the box right
109108 before its label. Few fixed options are `.choice`:
110109
@@ -160,7 +159,9 @@ letter-spacing, no Archivo. `h1` 26/34 bold; `h2` 13 semibold dim; body 15/22; t
160159
161160 ## Words
162161
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
164165 `crate::pages::passkeys::s(lang, "English", "Türkçe")`, in proper Turkish ("çevrim içi" is two words). A
165166 Turkish page shows no English, an English page no Turkish.
166167
@@ -177,6 +178,23 @@ Turkish page shows no English, an English page no Turkish.
177178 `fit` sheet takes the whole width there.
178179 - Pages fit one screen where they can: use tabs and the rail, not stacked unrelated topics.
179180
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+
180198 ## Fixed places
181199
182200 - 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 @@
5656 .corner-menu,
5757 .ref-menu,
5858 .pop-panel,
59-.row-menu-panel,
60-.bell-pop {
59+.row-menu-panel {
6160 max-width: calc(100vw - 32px);
6261 transition: none;
6362 animation: none;
style/_one.scssmodified+18 -55
@@ -590,6 +590,18 @@ input[type="radio"] {
590590 margin-left: 0;
591591 }
592592
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+
593605 // A quiet action leading the row keeps its words, not its padding, on the fields' edge.
594606 .fields > .acts > .act:first-child {
595607 margin-left: -10px;
@@ -879,24 +891,15 @@ summary.corner-btn {
879891 }
880892 }
881893
882-.corner-chips {
883- display: flex;
884- flex-direction: column;
885- gap: 2px;
886-}
887-
888-.corner-chips:empty {
889- display: none;
890-}
891-
892894 .bell-count {
893895 color: var(--muted);
894896 font-family: var(--mono);
895897 font-size: 12.5px;
896898 }
897899
898-// Something waits for the viewer: a dot on the avatar. It follows the menu's own rows.
899-details.corner:has(.bell-count, .corner-chips > a) > .corner-btn::after {
900+// Something waits for the viewer (an unread notification, a review request, a mention or a failed
901+// run): a dot on the avatar. nav.js keeps the `waiting` class in step with the counts.
902+details.corner.waiting > .corner-btn::after {
900903 content: "";
901904 position: absolute;
902905 top: -1px;
@@ -955,43 +958,6 @@ button.corner-link {
955958 }
956959 }
957960
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-
995961 // The avatar is the whole button: no inset, so it sits on the top bar's middle line.
996962 .corner-float summary.corner-btn {
997963 padding: 0;
@@ -1580,7 +1546,6 @@ a.line:hover .name,
15801546 .ci-tl-more > p,
15811547 .dock-expand > .dock-message,
15821548 details > .status-list,
1583-.bell-box,
15841549 .palette-box {
15851550 border: 0 !important;
15861551 border-radius: 20px !important;
@@ -2471,8 +2436,7 @@ dialog[data-finder] {
24712436 text-transform: none;
24722437 }
24732438
2474-.select-search-none,
2475-.bell-empty {
2439+.select-search-none {
24762440 padding: 8px 12px;
24772441 color: var(--muted);
24782442 font-size: 14px;
@@ -3160,13 +3124,12 @@ details:not([open])::details-content {
31603124 }
31613125 }
31623126
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.
31653127 .head-title {
31663128 min-height: 38px;
31673129 }
31683130
3169-main:has(> nav.tabs) > .head {
3131+main:has(> nav.tabs) > .head:has(.head-sub),
3132+main:has(> nav.tabs[data-section="admin"]) > .head {
31703133 min-height: 64px;
31713134 }
31723135
style/_one_admin.scssmodified+12 -0
@@ -396,3 +396,15 @@ $repo: 'main:has(> section.repo-head .tab.active[href$="/settings"])';
396396 #{$repo} .recent-checks {
397397 margin-left: 0;
398398 }
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 @@
125125 right: auto;
126126 }
127127
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+
128143 // The run's estimate bar is the step strip's job: the head keeps only the words.
129144 .ci-run > .head progress.ci-est-run {
130145 display: none;
style/_shell.scssmodified+2 -246
@@ -636,13 +636,6 @@
636636 }
637637 }
638638
639-.corner-chips {
640- display: flex;
641- align-items: center;
642- gap: 4px;
643- margin-left: auto;
644-}
645-
646639 // Chips count what waits on the user. They never take the accent.
647640 .chip {
648641 display: inline-flex;
@@ -676,192 +669,6 @@ a.chip {
676669 }
677670 }
678671
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-
865672 .corner-menu {
866673 position: absolute;
867674 bottom: calc(100% + 8px);
@@ -876,8 +683,8 @@ a.chip {
876683 box-shadow: var(--shadow);
877684 }
878685
879-// The profile corner: a small panel fixed at the bottom left of the window, the avatar, the name, the
880-// chips and the bell. The name is always shown in full (see `.corner-name` below).
686+// The profile corner: a small panel fixed at the bottom left of the window, the avatar, the name and
687+// the notifications row. The name is always shown in full (see `.corner-name` below).
881688 .corner-float {
882689 position: fixed;
883690 left: 16px;
@@ -977,57 +784,6 @@ button.corner-link.link-button {
977784 }
978785 }
979786
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-
1031787 // Page column and footer. The footer sits under the page in the same column, so a short page and
1032788 // its footer fit in the viewport the shell fills (no scroll for a footer's height).
1033789