The sidebar lists recent repositories without a view-all link
Browse files at this commitaf25eab5da253a737bc62ee97936748fdea73b59Parent: f8bdb15- ux
- the sidebar lists recent repositories without a view-all link
2 changed files +8 -16
crates/forge-web/src/i18n/orgs.rsmodified+4 -4
| @@ -127,8 +127,8 @@ pub enum K { | |||
| 127 | LogIn, | 127 | LogIn, |
| 128 | SetUpForge, | 128 | SetUpForge, |
| 129 | YourRepositories, | 129 | YourRepositories, |
| 130 | + RecentRepositories, | ||
| 130 | NoReposYet, | 131 | NoReposYet, |
| 131 | - ViewAllRepositories, | ||
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | pub fn t(lang: Lang, key: K) -> &'static str { | 134 | pub fn t(lang: Lang, key: K) -> &'static str { |
| @@ -381,10 +381,10 @@ pub fn t(lang: Lang, key: K) -> &'static str { | |||
| 381 | (SetUpForge, Tr) => "forge'u kur", | 381 | (SetUpForge, Tr) => "forge'u kur", |
| 382 | (YourRepositories, En) => "Your repositories", | 382 | (YourRepositories, En) => "Your repositories", |
| 383 | (YourRepositories, Tr) => "Depolarınız", | 383 | (YourRepositories, Tr) => "Depolarınız", |
| 384 | + (RecentRepositories, En) => "Recent repositories", | ||
| 385 | + (RecentRepositories, Tr) => "Son depolar", | ||
| 384 | (NoReposYet, En) => "You have no repositories yet.", | 386 | (NoReposYet, En) => "You have no repositories yet.", |
| 385 | (NoReposYet, Tr) => "Henüz deponuz yok.", | 387 | (NoReposYet, Tr) => "Henüz deponuz yok.", |
| 386 | - (ViewAllRepositories, En) => "View all repositories", | ||
| 387 | - (ViewAllRepositories, Tr) => "Tüm depoları gör", | ||
| 388 | } | 388 | } |
| 389 | } | 389 | } |
| 390 | 390 | ||
| @@ -613,8 +613,8 @@ mod tests { | |||
| 613 | K::LogIn, | 613 | K::LogIn, |
| 614 | K::SetUpForge, | 614 | K::SetUpForge, |
| 615 | K::YourRepositories, | 615 | K::YourRepositories, |
| 616 | + K::RecentRepositories, | ||
| 616 | K::NoReposYet, | 617 | K::NoReposYet, |
| 617 | - K::ViewAllRepositories, | ||
| 618 | ]; | 618 | ]; |
| 619 | 619 | ||
| 620 | #[test] | 620 | #[test] |
crates/forge-web/src/views/mod.rsmodified+4 -12
| @@ -135,7 +135,7 @@ pub async fn shell( | |||
| 135 | let full_title = format!("{title} \u{b7} forge"); | 135 | let full_title = format!("{title} \u{b7} forge"); |
| 136 | // The bell count and the viewer's freshest repos for the sidebar, with the total: two queries, | 136 | // The bell count and the viewer's freshest repos for the sidebar, with the total: two queries, |
| 137 | // signed-in only. | 137 | // signed-in only. |
| 138 | - let (unread, (listed, repo_total)) = match viewer { | 138 | + let (unread, (listed, _)) = match viewer { |
| 139 | Some((user, _)) => match try_app_context::<AppState>(__cx) { | 139 | Some((user, _)) => match try_app_context::<AppState>(__cx) { |
| 140 | Some(state) => ( | 140 | Some(state) => ( |
| 141 | state.store.unread_count(&user.id).await?, | 141 | state.store.unread_count(&user.id).await?, |
| @@ -193,8 +193,6 @@ pub async fn shell( | |||
| 193 | let theme_csrf = viewer.map(|(_, session)| session.csrf_token.clone()); | 193 | let theme_csrf = viewer.map(|(_, session)| session.csrf_token.clone()); |
| 194 | let back = uri(__cx).path_and_query().map(|p| p.as_str().to_owned()); | 194 | let back = uri(__cx).path_and_query().map(|p| p.as_str().to_owned()); |
| 195 | let lang = i18n::lang(__cx, viewer.map(|(user, _)| user)); | 195 | let lang = i18n::lang(__cx, viewer.map(|(user, _)| user)); |
| 196 | - let side_more = (repo_total > SIDE_REPOS) | ||
| 197 | - .then(|| format!("{} ({repo_total})", o::t(lang, OK::ViewAllRepositories))); | ||
| 198 | let banner = crate::pages::banner::current(__cx); | 196 | let banner = crate::pages::banner::current(__cx); |
| 199 | let banner_back = back.clone().unwrap_or_else(|| "/".to_owned()); | 197 | let banner_back = back.clone().unwrap_or_else(|| "/".to_owned()); |
| 200 | let dismiss_label = crate::i18n::accounts::t(lang, crate::i18n::accounts::A::Dismiss); | 198 | let dismiss_label = crate::i18n::accounts::t(lang, crate::i18n::accounts::A::Dismiss); |
| @@ -287,8 +285,6 @@ pub async fn shell( | |||
| 287 | let notif_label = t(lang, Key::Notifications); | 285 | let notif_label = t(lang, Key::Notifications); |
| 288 | let menu_label = t(lang, Key::SiteMenu); | 286 | let menu_label = t(lang, Key::SiteMenu); |
| 289 | let side_repos_menu = side_repos.clone(); | 287 | let side_repos_menu = side_repos.clone(); |
| 290 | - let side_more_menu = side_more.clone(); | ||
| 291 | - let side_more_aside = side_more; | ||
| 292 | let unread_menu = unread_badge.clone(); | 288 | let unread_menu = unread_badge.clone(); |
| 293 | let unread_aside = unread_badge.clone(); | 289 | let unread_aside = unread_badge.clone(); |
| 294 | Ok(view! { | 290 | Ok(view! { |
| @@ -325,7 +321,7 @@ pub async fn shell( | |||
| 325 | if let Some(section) = section_menu { | 321 | if let Some(section) = section_menu { |
| 326 | section_nav(title: section.title.as_str(), back: section.back, items: section.items, current: section.current, live: section.live) | 322 | section_nav(title: section.title.as_str(), back: section.back, items: section.items, current: section.current, live: section.live) |
| 327 | } else { | 323 | } else { |
| 328 | - side_nav(lang: lang, current: current, profile_repos_href: profile_repos_href.as_str(), unread: unread_menu, more: side_more_menu, repos: side_repos_menu) | 324 | + side_nav(lang: lang, current: current, profile_repos_href: profile_repos_href.as_str(), unread: unread_menu, repos: side_repos_menu) |
| 329 | } | 325 | } |
| 330 | </div> | 326 | </div> |
| 331 | </details> | 327 | </details> |
| @@ -412,7 +408,7 @@ pub async fn shell( | |||
| 412 | if let Some(section) = section { | 408 | if let Some(section) = section { |
| 413 | section_nav(title: section.title.as_str(), back: section.back, items: section.items, current: section.current, live: section.live) | 409 | section_nav(title: section.title.as_str(), back: section.back, items: section.items, current: section.current, live: section.live) |
| 414 | } else { | 410 | } else { |
| 415 | - side_nav(lang: lang, current: current, profile_repos_href: profile_repos_href.as_str(), unread: unread_aside, more: side_more_aside, repos: side_repos) | 411 | + side_nav(lang: lang, current: current, profile_repos_href: profile_repos_href.as_str(), unread: unread_aside, repos: side_repos) |
| 416 | } | 412 | } |
| 417 | </aside> | 413 | </aside> |
| 418 | } | 414 | } |
| @@ -450,7 +446,6 @@ async fn side_nav( | |||
| 450 | current: &str, | 446 | current: &str, |
| 451 | profile_repos_href: &str, | 447 | profile_repos_href: &str, |
| 452 | unread: Option<String>, | 448 | unread: Option<String>, |
| 453 | - more: Option<String>, | ||
| 454 | repos: Vec<SideRepo>, | 449 | repos: Vec<SideRepo>, |
| 455 | ) -> Result<impl View> { | 450 | ) -> Result<impl View> { |
| 456 | let dashboard = current == "dashboard"; | 451 | let dashboard = current == "dashboard"; |
| @@ -496,7 +491,7 @@ async fn side_nav( | |||
| 496 | </a> | 491 | </a> |
| 497 | </nav> | 492 | </nav> |
| 498 | <div class="side-group" data-live="/-/side/events"> | 493 | <div class="side-group" data-live="/-/side/events"> |
| 499 | - <h2 class="side-h">(o::t(lang, OK::YourRepositories))</h2> | 494 | + <h2 class="side-h">(o::t(lang, OK::RecentRepositories))</h2> |
| 500 | if empty { | 495 | if empty { |
| 501 | <p class="side-empty">(o::t(lang, OK::NoReposYet))</p> | 496 | <p class="side-empty">(o::t(lang, OK::NoReposYet))</p> |
| 502 | } else { | 497 | } else { |
| @@ -504,9 +499,6 @@ async fn side_nav( | |||
| 504 | for repo in repos.into_iter() { | 499 | for repo in repos.into_iter() { |
| 505 | <a href=(repo.href.as_str())>(repo.name.as_str())</a> | 500 | <a href=(repo.href.as_str())>(repo.name.as_str())</a> |
| 506 | } | 501 | } |
| 507 | - if let Some(label) = more { | ||
| 508 | - <a href=(profile_repos_href)>(label.as_str())</a> | ||
| 509 | - } | ||
| 510 | </nav> | 502 | </nav> |
| 511 | } | 503 | } |
| 512 | </div> | 504 | </div> |