merge upstream
All checks were successful
mnemo-build-and-publish / gractwo-mnemo-build (push) Successful in 44s

This commit is contained in:
2026-04-09 11:17:01 +00:00
3 changed files with 3 additions and 21 deletions

View File

@@ -113,31 +113,13 @@ impl Quote {
None => Ok(None),
}
}
pub fn get_chronological_cursorscroll(
conn: &Connection,
cursor: Option<Uuid>,
amount: i64,
) -> Result<Vec<Quote>, QuoteError> {
let ids = match cursor {
Some(c) => conn
.prepare("SELECT id FROM quotes WHERE id < ?1 ORDER BY id DESC LIMIT ?2")?
.query_map((c, amount), |r| r.get(0))?
.collect::<Result<Vec<Uuid>, _>>()?,
None => conn
.prepare("SELECT id FROM quotes ORDER BY id DESC LIMIT ?1")?
.query_map((amount,), |r| r.get(0))?
.collect::<Result<Vec<Uuid>, _>>()?,
};
ids.iter().map(|id| Self::get_by_id(conn, *id)).collect()
}
pub fn get_chronological_offset(
conn: &Connection,
offset: i64,
limit: i64,
) -> Result<Vec<Quote>, QuoteError> {
let ids = conn
.prepare("SELECT id FROM quotes ORDER BY id DESC LIMIT ?1 OFFSET ?2")?
.prepare("SELECT id FROM quotes ORDER BY timestamp DESC LIMIT ?1 OFFSET ?2")?
.query_map((limit, offset), |r| r.get(0))?
.collect::<Result<Vec<Uuid>, _>>()?;

View File

@@ -20,7 +20,7 @@ pub fn nav(user: Option<&User>, uri: &str) -> Markup {
div class="w-px h-5 bg-neutral-200/15 hidden sm:block" {}
div class="flex flex-row" {
@for link in LINKS {
@if !link.3 || user.is_some() {
@if (!link.3 || user.is_some()) && link.0 != "Photos" {
a href={(link.1)} class="flex flex-row px-2 py-1 rounded items-center gap-2 hover:bg-neutral-200/5 border border-transparent hover:border-neutral-200/25" {
@if uri.starts_with(link.1) {
div class="scale-[.75] text-neutral-300" {(PreEscaped(link.2))}

View File

@@ -43,7 +43,7 @@ pub async fn page(req: Request) -> Result<Response, AuthError> {
}
}
@if let Ok(tags) = Tag::get_all(&conn) {
div class="max-w-4xl mx-auto mt-4 flex flex-wrap gap-2" {
div class="max-w-4xl mx-auto px-2 mt-4 flex flex-wrap gap-2" {
@for tag in &tags {
div class="rounded-full px-3 py-1 bg-neutral-200/10 border border-neutral-200/15 flex" {
span class="text-neutral-400 text-sm" {"#"}