mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-03 18:24:12 +02:00
fix profile pages
This commit is contained in:
parent
69dbfe3f5e
commit
6181198f54
4 changed files with 17 additions and 13 deletions
|
|
@ -69,6 +69,9 @@ const onFilter = async (api, demoListBody, filter) => {
|
|||
|
||||
const more = async (api, demoListBody, filter) => {
|
||||
const rows = demoListBody.querySelectorAll('tr');
|
||||
if (rows.length === 0) {
|
||||
return;
|
||||
}
|
||||
const lastId = rows[rows.length-1].dataset.id;
|
||||
|
||||
const query = queryForFilter(filter);
|
||||
|
|
|
|||
|
|
@ -425,7 +425,7 @@ impl Filter {
|
|||
);
|
||||
}
|
||||
if let Some(before) = &self.before {
|
||||
query.and_where(Expr::col(Demos::Id).lt(*before));
|
||||
query.and_where(Expr::col((Demos::Table, Demos::Id)).lt(*before));
|
||||
}
|
||||
if let Some(uploader) = &self.uploader {
|
||||
query
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use maud::Render;
|
||||
use sea_query::Value;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde::{Deserialize, Deserializer, Serialize};
|
||||
use sqlx::database::HasValueRef;
|
||||
use sqlx::error::BoxDynError;
|
||||
use sqlx::{Database, Decode, Type};
|
||||
|
|
@ -11,7 +11,7 @@ use std::fmt::{Display, Write};
|
|||
use std::str::FromStr;
|
||||
use steamid_ng::SteamID;
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum SteamId {
|
||||
Id(u64),
|
||||
|
|
@ -64,15 +64,6 @@ impl SteamId {
|
|||
}
|
||||
}
|
||||
|
||||
impl Debug for SteamId {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
SteamId::Id(id) => Debug::fmt(&SteamID::from(*id), f),
|
||||
SteamId::Raw(raw) => Debug::fmt(raw, f),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<DB: Database> Type<DB> for SteamId
|
||||
where
|
||||
i64: Type<DB>,
|
||||
|
|
@ -98,6 +89,16 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<'de> Deserialize<'de> for SteamId {
|
||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||
where
|
||||
D: Deserializer<'de>,
|
||||
{
|
||||
let str = <&str as Deserialize>::deserialize(deserializer)?;
|
||||
Ok(str.parse().unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for SteamId {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
width: 180px;
|
||||
}
|
||||
|
||||
& tr:nth-child(odd) {
|
||||
& tbody tr:nth-child(odd) {
|
||||
background-color: var(--primary-color-accent);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue