Compare commits

...

4 Commits

Author SHA1 Message Date
a5180e4ee9 merge upstream
All checks were successful
mnemo-build-and-publish / gractwo-mnemo-build (push) Successful in 44s
2026-04-09 11:17:01 +00:00
3eb1da8319 don't show photos link on navbar 2026-04-09 13:07:40 +02:00
30254864a9 add page margin to tag listing 2026-04-09 13:04:17 +02:00
18f420c7d4 remove quote cursorscroll, chronological: sort by ts instead of id 2026-04-09 13:01:39 +02:00
3 changed files with 3 additions and 21 deletions

View File

@@ -113,31 +113,13 @@ impl Quote {
None => Ok(None), 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( pub fn get_chronological_offset(
conn: &Connection, conn: &Connection,
offset: i64, offset: i64,
limit: i64, limit: i64,
) -> Result<Vec<Quote>, QuoteError> { ) -> Result<Vec<Quote>, QuoteError> {
let ids = conn 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))? .query_map((limit, offset), |r| r.get(0))?
.collect::<Result<Vec<Uuid>, _>>()?; .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="w-px h-5 bg-neutral-200/15 hidden sm:block" {}
div class="flex flex-row" { div class="flex flex-row" {
@for link in LINKS { @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" { 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) { @if uri.starts_with(link.1) {
div class="scale-[.75] text-neutral-300" {(PreEscaped(link.2))} 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) { @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 { @for tag in &tags {
div class="rounded-full px-3 py-1 bg-neutral-200/10 border border-neutral-200/15 flex" { 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" {"#"} span class="text-neutral-400 text-sm" {"#"}