add: ability to enable pages instead of infinite scrolling
This commit is contained in:
parent
fa72d6a59d
commit
ffdf320c14
15 changed files with 47 additions and 15 deletions
|
@ -213,7 +213,7 @@ pub async fn upload_avatar_request(
|
|||
if mime == "image/gif" {
|
||||
// gif image, don't encode
|
||||
if img.0.len() > MAXIMUM_GIF_FILE_SIZE {
|
||||
return Json(Error::DataTooLong("gif".to_string()).into());
|
||||
return Json(Error::FileTooLarge.into());
|
||||
}
|
||||
|
||||
std::fs::write(&path, img.0).unwrap();
|
||||
|
@ -226,7 +226,7 @@ pub async fn upload_avatar_request(
|
|||
|
||||
// check file size
|
||||
if img.0.len() > MAXIMUM_FILE_SIZE {
|
||||
return Json(Error::DataTooLong("image".to_string()).into());
|
||||
return Json(Error::FileTooLarge.into());
|
||||
}
|
||||
|
||||
// upload image
|
||||
|
@ -314,7 +314,7 @@ pub async fn upload_banner_request(
|
|||
if mime == "image/gif" {
|
||||
// gif image, don't encode
|
||||
if img.0.len() > MAXIMUM_GIF_FILE_SIZE {
|
||||
return Json(Error::DataTooLong("gif".to_string()).into());
|
||||
return Json(Error::FileTooLarge.into());
|
||||
}
|
||||
|
||||
std::fs::write(&path, img.0).unwrap();
|
||||
|
@ -327,7 +327,7 @@ pub async fn upload_banner_request(
|
|||
|
||||
// check file size
|
||||
if img.0.len() > MAXIMUM_FILE_SIZE {
|
||||
return Json(Error::DataTooLong("image".to_string()).into());
|
||||
return Json(Error::FileTooLarge.into());
|
||||
}
|
||||
|
||||
// upload image
|
||||
|
|
|
@ -136,7 +136,7 @@ pub async fn upload_avatar_request(
|
|||
|
||||
// check file size
|
||||
if img.0.len() > MAXIMUM_FILE_SIZE {
|
||||
return Json(Error::DataTooLong("image".to_string()).into());
|
||||
return Json(Error::FileTooLarge.into());
|
||||
}
|
||||
|
||||
// upload image
|
||||
|
@ -191,7 +191,7 @@ pub async fn upload_banner_request(
|
|||
|
||||
// check file size
|
||||
if img.0.len() > MAXIMUM_FILE_SIZE {
|
||||
return Json(Error::DataTooLong("image".to_string()).into());
|
||||
return Json(Error::FileTooLarge.into());
|
||||
}
|
||||
|
||||
// upload image
|
||||
|
|
|
@ -133,7 +133,7 @@ pub async fn create_request(
|
|||
// check sizes
|
||||
for img in &images {
|
||||
if img.len() > MAXIMUM_FILE_SIZE {
|
||||
return Json(Error::DataTooLong("image".to_string()).into());
|
||||
return Json(Error::FileTooLarge.into());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -576,6 +576,8 @@ pub struct TimelineQuery {
|
|||
pub user_id: usize,
|
||||
#[serde(default)]
|
||||
pub tag: String,
|
||||
#[serde(default)]
|
||||
pub paginated: bool,
|
||||
}
|
||||
|
||||
/// `/_swiss_army_timeline`
|
||||
|
@ -697,6 +699,7 @@ pub async fn swiss_army_timeline_request(
|
|||
|
||||
context.insert("list", &list);
|
||||
context.insert("page", &req.page);
|
||||
context.insert("paginated", &req.paginated);
|
||||
Ok(Html(
|
||||
data.1
|
||||
.render("timelines/swiss_army.html", &context)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue