From 022e037eeaf91336726233c84a9d944969863e04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Gali=C4=87?= Date: Mon, 27 Jan 2020 23:45:09 +0100 Subject: [PATCH] when using macros!() we need to import the things that they use --- src/routes/instance.rs | 1 + src/routes/posts.rs | 2 +- templates/base.rs.html | 4 ++++ templates/blogs/details.rs.html | 2 ++ templates/blogs/edit.rs.html | 2 ++ templates/posts/details.rs.html | 2 ++ 6 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/routes/instance.rs b/src/routes/instance.rs index 72d41c3f..59407720 100644 --- a/src/routes/instance.rs +++ b/src/routes/instance.rs @@ -7,6 +7,7 @@ use rocket_i18n::I18n; use scheduled_thread_pool::ScheduledThreadPool; use serde_json; use std::str::FromStr; +use std::path::PathBuf; use validator::{Validate, ValidationErrors}; use crate::inbox; diff --git a/src/routes/posts.rs b/src/routes/posts.rs index d070bb5f..c10ae0da 100644 --- a/src/routes/posts.rs +++ b/src/routes/posts.rs @@ -11,7 +11,7 @@ use std::{ use validator::{Validate, ValidationError, ValidationErrors}; use crate::routes::{ - comments::NewCommentForm, errors::ErrorPage, ContentLen, RemoteForm, RespondOrRedirect, + comments::NewCommentForm, errors::ErrorPage, Page, ContentLen, RemoteForm, RespondOrRedirect, }; use crate::template_utils::{IntoContext, Ructe}; use plume_common::activity_pub::{broadcast, ActivityStream, ApRequest}; diff --git a/templates/base.rs.html b/templates/base.rs.html index 110c764d..e5310276 100644 --- a/templates/base.rs.html +++ b/templates/base.rs.html @@ -1,8 +1,12 @@ @use plume_models::CONFIG; @use plume_models::instance::Instance; +@use rocket::http::RawStr; +@use rocket::request::Form; @use std::path::Path; +@use std::path::PathBuf; @use crate::template_utils::*; @use crate::routes::*; +@use crate::routes::search::SearchQuery; @(ctx: BaseContext, title: String, head: Content, header: Content, content: Content) diff --git a/templates/blogs/details.rs.html b/templates/blogs/details.rs.html index 5dacdd98..8b6d58e4 100644 --- a/templates/blogs/details.rs.html +++ b/templates/blogs/details.rs.html @@ -2,7 +2,9 @@ @use plume_models::instance::Instance; @use plume_models::posts::Post; @use plume_models::users::User; +@use rocket::http::RawStr; @use std::path::Path; +@use std::path::PathBuf; @use crate::templates::{base, partials::post_card}; @use crate::template_utils::*; @use crate::routes::*; diff --git a/templates/blogs/edit.rs.html b/templates/blogs/edit.rs.html index b7806830..ef89d684 100644 --- a/templates/blogs/edit.rs.html +++ b/templates/blogs/edit.rs.html @@ -5,10 +5,12 @@ @use crate::template_utils::*; @use crate::templates::base; @use crate::templates::partials::image_select; +@use crate::routes::Page; @use crate::routes::blogs; @use crate::routes::blogs::EditForm; @use crate::routes::medias; + @(ctx: BaseContext, blog: &Blog, medias: Vec, form: &EditForm, errors: ValidationErrors) @:base(ctx, i18n!(ctx.1, "Edit \"{}\""; &blog.title), {}, { diff --git a/templates/posts/details.rs.html b/templates/posts/details.rs.html index 54482ed6..bc1db2dc 100644 --- a/templates/posts/details.rs.html +++ b/templates/posts/details.rs.html @@ -3,7 +3,9 @@ @use plume_models::posts::Post; @use plume_models::tags::Tag; @use plume_models::users::User; +@use rocket::http::RawStr; @use std::path::Path; +@use std::path::PathBuf; @use validator::ValidationErrors; @use crate::templates::{base, partials::comment}; @use crate::template_utils::*;