From 16a1b756438578715a1aa9d68c7e891227b19a68 Mon Sep 17 00:00:00 2001 From: Rasmus Kaj Date: Sat, 2 Sep 2017 00:05:44 +0200 Subject: [PATCH] Cleanup some more. Get rid of lib.rs, and move main entry point to main.rs. --- Cargo.toml | 4 --- src/adm/findphotos.rs | 6 ++-- src/adm/makepublic.rs | 6 ++-- src/adm/readkpa.rs | 22 ++++++------ src/adm/stats.rs | 10 +++--- src/adm/users.rs | 6 ++-- src/lib.rs | 9 ----- src/{rphotosadm.rs => main.rs} | 6 +++- src/photosdir.rs | 2 +- src/server/mod.rs | 62 +++++++++++++++++----------------- src/server/views_by_date.rs | 16 ++++----- templates/details.rs.html | 2 +- templates/img_link.rs.html | 2 +- templates/index.rs.html | 2 +- templates/people.rs.html | 2 +- templates/person.rs.html | 2 +- templates/place.rs.html | 2 +- templates/places.rs.html | 2 +- templates/tag.rs.html | 2 +- templates/tags.rs.html | 2 +- 20 files changed, 79 insertions(+), 88 deletions(-) delete mode 100644 src/lib.rs rename src/{rphotosadm.rs => main.rs} (98%) diff --git a/Cargo.toml b/Cargo.toml index 8f2916a..454e98d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,10 +8,6 @@ build = "src/build.rs" [build-dependencies] ructe = { version = "^0.3.2", features = ["sass", "mime02"] } -[[bin]] -name = "rphotosadm" -path = "src/rphotosadm.rs" - [dependencies] nickel = "~0.10.0" nickel-jwt-session = "~0.10.0" diff --git a/src/adm/findphotos.rs b/src/adm/findphotos.rs index 4ac4bec..b76db04 100644 --- a/src/adm/findphotos.rs +++ b/src/adm/findphotos.rs @@ -5,7 +5,7 @@ use diesel::pg::PgConnection; use diesel::prelude::*; use photosdir::PhotosDir; use rexif::{ExifData, ExifEntry, ExifTag, TagValue}; -use rphotos::models::{Modification, Photo, Camera}; +use models::{Modification, Photo, Camera}; use std::path::Path; pub fn crawl(db: &PgConnection, photos: &PhotosDir, only_in: &Path) @@ -44,7 +44,7 @@ fn save_photo(db: &PgConnection, }; if let Some((lat, long)) = find_position(&exif)? { debug!("Position for {} is {} {}", file_path, lat, long); - use rphotos::schema::positions::dsl::*; + use schema::positions::dsl::*; if let Ok((pos, clat, clong)) = positions.filter(photo_id.eq(photo.id)) .select((id, latitude, longitude)) @@ -59,7 +59,7 @@ fn save_photo(db: &PgConnection, } } else { info!("Position for {} is {} {}", file_path, lat, long); - use rphotos::models::NewPosition; + use models::NewPosition; insert(&NewPosition { photo_id: photo.id, latitude: (lat * 1e6) as i32, diff --git a/src/adm/makepublic.rs b/src/adm/makepublic.rs index d220233..cd7615b 100644 --- a/src/adm/makepublic.rs +++ b/src/adm/makepublic.rs @@ -4,14 +4,14 @@ use diesel::prelude::*; use diesel::result::Error as DieselError; use diesel::update; use photosdir::PhotosDir; -use rphotos::models::{Modification, Photo}; +use models::{Modification, Photo}; use std::io::prelude::*; pub fn one(db: &PgConnection, photodir: &PhotosDir, tpath: &str) -> Result<(), Error> { - use rphotos::schema::photos::dsl::*; + use schema::photos::dsl::*; match update(photos.filter(path.eq(&tpath))) .set(is_public.eq(true)) .get_result::(db) { @@ -45,7 +45,7 @@ pub fn by_file_list(db: &PgConnection, fn register_photo(db: &PgConnection, tpath: &str) -> Result { - use rphotos::schema::photos::dsl::{photos, is_public}; + use schema::photos::dsl::{photos, is_public}; let photo = match Photo::create_or_set_basics(&db, &tpath, None, 0, None)? { Modification::Created(photo) => photo, diff --git a/src/adm/readkpa.rs b/src/adm/readkpa.rs index 94d676e..f23ea1f 100644 --- a/src/adm/readkpa.rs +++ b/src/adm/readkpa.rs @@ -3,7 +3,7 @@ use chrono::naive::NaiveDateTime; use diesel; use diesel::pg::PgConnection; use diesel::prelude::*; -use rphotos::models::{Modification, Person, Photo, Place, Tag}; +use models::{Modification, Person, Photo, Place, Tag}; use std::fs::File; use std::path::Path; use std::result; @@ -123,9 +123,9 @@ pub fn photo_by_path(db: &PgConnection, } fn tag_photo(db: &PgConnection, thephoto: &Photo, tagname: &str) -> Result<()> { - use rphotos::models::{NewPhotoTag, NewTag, PhotoTag}; + use models::{NewPhotoTag, NewTag, PhotoTag}; let tag = { - use rphotos::schema::tags::dsl::*; + use schema::tags::dsl::*; tags.filter(tag_name.eq(tagname)) .first::(db) .or_else(|_| { @@ -138,7 +138,7 @@ fn tag_photo(db: &PgConnection, thephoto: &Photo, tagname: &str) -> Result<()> { }) }?; debug!(" tag {:?}", tag); - use rphotos::schema::photo_tags::dsl::*; + use schema::photo_tags::dsl::*; let q = photo_tags.filter(photo_id.eq(thephoto.id)) .filter(tag_id.eq(tag.id)); if let Ok(result) = q.first::(db) { @@ -157,9 +157,9 @@ fn tag_photo(db: &PgConnection, thephoto: &Photo, tagname: &str) -> Result<()> { } fn person_photo(db: &PgConnection, photo: &Photo, name: &str) -> Result<()> { - use rphotos::models::{NewPerson, NewPhotoPerson, PhotoPerson}; + use models::{NewPerson, NewPhotoPerson, PhotoPerson}; let person = { - use rphotos::schema::people::dsl::*; + use schema::people::dsl::*; people.filter(person_name.eq(name)) .first::(db) .or_else(|_| { @@ -172,7 +172,7 @@ fn person_photo(db: &PgConnection, photo: &Photo, name: &str) -> Result<()> { }) }?; debug!(" person {:?}", person); - use rphotos::schema::photo_people::dsl::*; + use schema::photo_people::dsl::*; let q = photo_people.filter(photo_id.eq(photo.id)) .filter(person_id.eq(person.id)); if let Ok(result) = q.first::(db) { @@ -193,9 +193,9 @@ fn person_photo(db: &PgConnection, photo: &Photo, name: &str) -> Result<()> { } fn place_photo(db: &PgConnection, photo: &Photo, name: &str) -> Result<()> { - use rphotos::models::{NewPhotoPlace, NewPlace, PhotoPlace}; + use models::{NewPhotoPlace, NewPlace, PhotoPlace}; let place = { - use rphotos::schema::places::dsl::*; + use schema::places::dsl::*; places.filter(place_name.eq(name)) .first::(db) .or_else(|_| { @@ -208,7 +208,7 @@ fn place_photo(db: &PgConnection, photo: &Photo, name: &str) -> Result<()> { }) }?; debug!(" place {:?}", place); - use rphotos::schema::photo_places::dsl::*; + use schema::photo_places::dsl::*; photo_places.filter(photo_id.eq(photo.id)) .filter(place_id.eq(place.id)) .first::(db) @@ -238,7 +238,7 @@ fn grade_photo(db: &PgConnection, photo: &mut Photo, name: &str) -> Result<()> { photo))) } }); - use rphotos::schema::photos::dsl::*; + use schema::photos::dsl::*; let n = diesel::update(photos.find(photo.id)) .set(grade.eq(photo.grade)) .execute(db) diff --git a/src/adm/stats.rs b/src/adm/stats.rs index edf7969..bfb0194 100644 --- a/src/adm/stats.rs +++ b/src/adm/stats.rs @@ -4,10 +4,10 @@ use diesel::expression::dsl::{count_star, sql}; use diesel::pg::PgConnection; use diesel::prelude::*; use diesel::types::{BigInt, Double, Nullable, Text, Timestamp}; -use rphotos::schema::people::dsl::people; -use rphotos::schema::photos::dsl::photos; -use rphotos::schema::places::dsl::places; -use rphotos::schema::tags::dsl::tags; +use schema::people::dsl::people; +use schema::photos::dsl::photos; +use schema::places::dsl::places; +use schema::tags::dsl::tags; sql_function!(date_part, date_part_t, @@ -25,7 +25,7 @@ pub fn show_stats(db: &PgConnection) -> Result<(), Error> { // Something like this should be possible, I guess? // - // use rphotos::schema::photos::dsl::date; + // use schema::photos::dsl::date; // let year = date_part("year", date).aliased("y"); // println!("Count per year: {:?}", // photos.select((year, count_star())) diff --git a/src/adm/users.rs b/src/adm/users.rs index 1614d09..6a74f27 100644 --- a/src/adm/users.rs +++ b/src/adm/users.rs @@ -9,7 +9,7 @@ use rand::os::OsRng; use std::iter::Iterator; pub fn list(db: &PgConnection) -> Result<(), Error> { - use rphotos::schema::users::dsl::*; + use schema::users::dsl::*; println!("Existing users: {:?}.", users.select(username).load::(db)?); Ok(()) @@ -18,7 +18,7 @@ pub fn list(db: &PgConnection) -> Result<(), Error> { pub fn passwd(db: &PgConnection, uname: &str) -> Result<(), Error> { let pword = random_password(14); let hashword = make_password(&pword); - use rphotos::schema::users::dsl::*; + use schema::users::dsl::*; match update(users.filter(username.eq(&uname))) .set(password.eq(&hashword)) .execute(db)? { @@ -26,7 +26,7 @@ pub fn passwd(db: &PgConnection, uname: &str) -> Result<(), Error> { println!("Updated password for {:?} to {:?}", uname, pword); } 0 => { - use rphotos::models::NewUser; + use models::NewUser; insert(&NewUser { username: &uname, password: &hashword, diff --git a/src/lib.rs b/src/lib.rs deleted file mode 100644 index 5de4a7a..0000000 --- a/src/lib.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![recursion_limit="128"] -extern crate chrono; -#[macro_use] -extern crate diesel; -#[macro_use] -extern crate diesel_codegen; - -pub mod schema; -pub mod models; diff --git a/src/rphotosadm.rs b/src/main.rs similarity index 98% rename from src/rphotosadm.rs rename to src/main.rs index 420a67a..9d40706 100644 --- a/src/rphotosadm.rs +++ b/src/main.rs @@ -1,9 +1,11 @@ -extern crate rphotos; +#![recursion_limit="128"] extern crate brotli2; extern crate clap; extern crate chrono; #[macro_use] extern crate diesel; +#[macro_use] +extern crate diesel_codegen; extern crate djangohashers; extern crate dotenv; extern crate env_logger; @@ -30,11 +32,13 @@ extern crate xml; mod adm; mod env; mod memcachemiddleware; +mod models; mod nickel_diesel; mod photosdir; mod photosdirmiddleware; mod pidfiles; mod requestloggermiddleware; +mod schema; mod server; use adm::{findphotos, makepublic, readkpa, users, storestatics}; diff --git a/src/photosdir.rs b/src/photosdir.rs index 9f18055..a248524 100644 --- a/src/photosdir.rs +++ b/src/photosdir.rs @@ -1,6 +1,6 @@ use image::{self, FilterType, GenericImage, ImageError, ImageFormat}; use rexif::{self, ExifData}; -use rphotos::models::Photo; +use models::Photo; use std::{fs, io}; use std::ffi::OsStr; use std::path::{Path, PathBuf}; diff --git a/src/server/mod.rs b/src/server/mod.rs index 187cbee..22c29fe 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -21,7 +21,7 @@ use nickel_diesel::{DieselMiddleware, DieselRequestExtensions}; use nickel_jwt_session::{SessionMiddleware, SessionRequestExtensions, SessionResponseExtensions}; use r2d2::NopErrorHandler; -use rphotos::models::{Person, Photo, Place, Tag}; +use models::{Person, Photo, Place, Tag}; use env::{dburl, env_or, jwt_key, photos_dir}; @@ -126,7 +126,7 @@ fn do_login<'mw>(req: &mut Request, let next = sanitize_next(form_data.get("next")).map(String::from); if let (Some(user), Some(pw)) = (form_data.get("user"), form_data.get("password")) { - use rphotos::schema::users::dsl::*; + use schema::users::dsl::*; if let Ok(hash) = users.filter(username.eq(user)) .select(password) .first::(c) { @@ -223,7 +223,7 @@ fn show_image<'mw>(req: &Request, the_id: i32, size: SizeTag) -> MiddlewareResult<'mw> { - use rphotos::schema::photos::dsl::photos; + use schema::photos::dsl::photos; let c: &PgConnection = &req.db_conn(); if let Ok(tphoto) = photos.find(the_id).first::(c) { if req.authorized_user().is_some() || tphoto.is_public() { @@ -258,14 +258,14 @@ fn get_image_data(req: &Request, fn tag_all<'mw>(req: &mut Request, res: Response<'mw>) -> MiddlewareResult<'mw> { - use rphotos::schema::tags::dsl::{id, tag_name, tags}; + use schema::tags::dsl::{id, tag_name, tags}; let c: &PgConnection = &req.db_conn(); let query = tags.into_boxed(); let query = if req.authorized_user().is_some() { query } else { - use rphotos::schema::photo_tags::dsl as tp; - use rphotos::schema::photos::dsl as p; + use schema::photo_tags::dsl as tp; + use schema::photos::dsl as p; query.filter(id.eq_any(tp::photo_tags .select(tp::tag_id) .filter(tp::photo_id @@ -284,11 +284,11 @@ fn tag_one<'mw>(req: &mut Request, res: Response<'mw>, tslug: String) -> MiddlewareResult<'mw> { - use rphotos::schema::tags::dsl::{slug, tags}; + use schema::tags::dsl::{slug, tags}; let c: &PgConnection = &req.db_conn(); if let Ok(tag) = tags.filter(slug.eq(tslug)).first::(c) { - use rphotos::schema::photos::dsl::{date, grade, id}; - use rphotos::schema::photo_tags::dsl::{photo_id, photo_tags, tag_id}; + use schema::photos::dsl::{date, grade, id}; + use schema::photo_tags::dsl::{photo_id, photo_tags, tag_id}; return res.ok(|o| { templates::tag(o, req, @@ -307,13 +307,13 @@ fn tag_one<'mw>(req: &mut Request, fn place_all<'mw>(req: &mut Request, res: Response<'mw>) -> MiddlewareResult<'mw> { - use rphotos::schema::places::dsl::{id, place_name, places}; + use schema::places::dsl::{id, place_name, places}; let query = places.into_boxed(); let query = if req.authorized_user().is_some() { query } else { - use rphotos::schema::photo_places::dsl as pp; - use rphotos::schema::photos::dsl as p; + use schema::photo_places::dsl as pp; + use schema::photos::dsl as p; query.filter(id.eq_any(pp::photo_places .select(pp::place_id) .filter(pp::photo_id @@ -345,11 +345,11 @@ fn place_one<'mw>(req: &mut Request, res: Response<'mw>, tslug: String) -> MiddlewareResult<'mw> { - use rphotos::schema::places::dsl::{places, slug}; + use schema::places::dsl::{places, slug}; let c: &PgConnection = &req.db_conn(); if let Ok(place) = places.filter(slug.eq(tslug)).first::(c) { - use rphotos::schema::photos::dsl::{date, grade, id}; - use rphotos::schema::photo_places::dsl::{photo_id, photo_places, + use schema::photos::dsl::{date, grade, id}; + use schema::photo_places::dsl::{photo_id, photo_places, place_id}; return res.ok(|o| templates::place( o, @@ -367,13 +367,13 @@ fn place_one<'mw>(req: &mut Request, fn person_all<'mw>(req: &mut Request, res: Response<'mw>) -> MiddlewareResult<'mw> { - use rphotos::schema::people::dsl::{id, people, person_name}; + use schema::people::dsl::{id, people, person_name}; let query = people.into_boxed(); let query = if req.authorized_user().is_some() { query } else { - use rphotos::schema::photo_people::dsl as pp; - use rphotos::schema::photos::dsl as p; + use schema::photo_people::dsl as pp; + use schema::photos::dsl as p; query.filter(id.eq_any(pp::photo_people .select(pp::person_id) .filter(pp::photo_id @@ -392,11 +392,11 @@ fn person_one<'mw>(req: &mut Request, res: Response<'mw>, tslug: String) -> MiddlewareResult<'mw> { - use rphotos::schema::people::dsl::{people, slug}; + use schema::people::dsl::{people, slug}; let c: &PgConnection = &req.db_conn(); if let Ok(person) = people.filter(slug.eq(tslug)).first::(c) { - use rphotos::schema::photos::dsl::{date, grade, id}; - use rphotos::schema::photo_people::dsl::{person_id, photo_id, + use schema::photos::dsl::{date, grade, id}; + use schema::photo_people::dsl::{person_id, photo_id, photo_people}; return res.ok(|o| templates::person( o, @@ -415,7 +415,7 @@ fn photo_details<'mw>(req: &mut Request, res: Response<'mw>, id: i32) -> MiddlewareResult<'mw> { - use rphotos::schema::photos::dsl::photos; + use schema::photos::dsl::photos; let c: &PgConnection = &req.db_conn(); if let Ok(tphoto) = photos.find(id).first::(c) { if req.authorized_user().is_some() || tphoto.is_public() { @@ -428,28 +428,28 @@ fn photo_details<'mw>(req: &mut Request, Link::day(d.year(), d.month(), d.day())]) .unwrap_or_else(|| vec![]), &{ - use rphotos::schema::people::dsl::{people, id}; - use rphotos::schema::photo_people::dsl::{photo_people, photo_id, person_id}; + use schema::people::dsl::{people, id}; + use schema::photo_people::dsl::{photo_people, photo_id, person_id}; people.filter(id.eq_any(photo_people.select(person_id) .filter(photo_id.eq(tphoto.id)))) .load(c).unwrap() }, &{ - use rphotos::schema::places::dsl::{places, id}; - use rphotos::schema::photo_places::dsl::{photo_places, photo_id, place_id}; + use schema::places::dsl::{places, id}; + use schema::photo_places::dsl::{photo_places, photo_id, place_id}; places.filter(id.eq_any(photo_places.select(place_id) .filter(photo_id.eq(tphoto.id)))) .load(c).unwrap() }, &{ - use rphotos::schema::tags::dsl::{tags, id}; - use rphotos::schema::photo_tags::dsl::{photo_tags, photo_id, tag_id}; + use schema::tags::dsl::{tags, id}; + use schema::photo_tags::dsl::{photo_tags, photo_id, tag_id}; tags.filter(id.eq_any(photo_tags.select(tag_id) .filter(photo_id.eq(tphoto.id)))) .load(c).unwrap() }, { - use rphotos::schema::positions::dsl::*; + use schema::positions::dsl::*; match positions.filter(photo_id.eq(tphoto.id)) .select((latitude, longitude)) .first::<(i32, i32)>(c) { @@ -465,13 +465,13 @@ fn photo_details<'mw>(req: &mut Request, } }, { - use rphotos::schema::attributions::dsl::*; + use schema::attributions::dsl::*; tphoto.attribution_id.map(|i| { attributions.find(i).select(name).first(c).unwrap() }) }, { - use rphotos::schema::cameras::dsl::*; + use schema::cameras::dsl::*; tphoto.camera_id.map(|i| { cameras.find(i).first(c).unwrap() }) diff --git a/src/server/views_by_date.rs b/src/server/views_by_date.rs index b618944..18a79b5 100644 --- a/src/server/views_by_date.rs +++ b/src/server/views_by_date.rs @@ -4,11 +4,11 @@ use chrono::naive::NaiveDate; use diesel::expression::sql_literal::SqlLiteral; use diesel::pg::PgConnection; use diesel::prelude::*; +use models::Photo; use nickel::{MiddlewareResult, Request, Response}; use nickel_diesel::DieselRequestExtensions; use nickel_jwt_session::SessionRequestExtensions; use server::nickelext::MyResponse; -use rphotos::models::Photo; use templates; use time; @@ -17,7 +17,7 @@ pub fn all_years<'mw>(req: &mut Request, res: Response<'mw>) -> MiddlewareResult<'mw> { - use rphotos::schema::photos::dsl::{date, grade}; + use schema::photos::dsl::{date, grade}; let c: &PgConnection = &req.db_conn(); let groups: Vec = @@ -59,7 +59,7 @@ pub fn months_in_year<'mw>(req: &mut Request, res: Response<'mw>, year: i32) -> MiddlewareResult<'mw> { - use rphotos::schema::photos::dsl::{date, grade}; + use schema::photos::dsl::{date, grade}; let c: &PgConnection = &req.db_conn(); let title: String = format!("Photos from {}", year); @@ -109,7 +109,7 @@ pub fn days_in_month<'mw>(req: &mut Request, year: i32, month: u32) -> MiddlewareResult<'mw> { - use rphotos::schema::photos::dsl::{date, grade}; + use schema::photos::dsl::{date, grade}; let c: &PgConnection = &req.db_conn(); let lpath: Vec = vec![Link::year(year)]; @@ -155,7 +155,7 @@ pub fn days_in_month<'mw>(req: &mut Request, pub fn all_null_date<'mw>(req: &mut Request, res: Response<'mw>) -> MiddlewareResult<'mw> { - use rphotos::schema::photos::dsl::{date, path}; + use schema::photos::dsl::{date, path}; let c: &PgConnection = &req.db_conn(); res.ok(|o| templates::index( @@ -177,7 +177,7 @@ pub fn all_for_day<'mw>(req: &mut Request, day: u32) -> MiddlewareResult<'mw> { let thedate = NaiveDate::from_ymd(year, month, day).and_hms(0, 0, 0); - use rphotos::schema::photos::dsl::date; + use schema::photos::dsl::date; let c: &PgConnection = &req.db_conn(); @@ -247,7 +247,7 @@ pub fn part_for_day<'mw>( part: usize, ) -> MiddlewareResult<'mw> { let thedate = NaiveDate::from_ymd(year, month, day).and_hms(0, 0, 0); - use rphotos::schema::photos::dsl::date; + use schema::photos::dsl::date; let c: &PgConnection = &req.db_conn(); @@ -293,7 +293,7 @@ pub fn part_for_day<'mw>( pub fn on_this_day<'mw>(req: &mut Request, res: Response<'mw>) -> MiddlewareResult<'mw> { - use rphotos::schema::photos::dsl::{date, grade}; + use schema::photos::dsl::{date, grade}; let c: &PgConnection = &req.db_conn(); let (month, day) = { diff --git a/templates/details.rs.html b/templates/details.rs.html index 0b45dc0..680d658 100644 --- a/templates/details.rs.html +++ b/templates/details.rs.html @@ -1,7 +1,7 @@ @use ::{Coord, Link}; @use nickel::Request; @use nickel_jwt_session::SessionRequestExtensions; -@use rphotos::models::{Photo, Person, Place, Tag, Camera}; +@use models::{Photo, Person, Place, Tag, Camera}; @use templates::page_base; @(req: &Request, lpath: &[Link], people: &[Person], places: &[Place], tags: &[Tag], position: Option, attribution: Option, camera: Option, photo: Photo) diff --git a/templates/img_link.rs.html b/templates/img_link.rs.html index f72a317..7c3a1a5 100644 --- a/templates/img_link.rs.html +++ b/templates/img_link.rs.html @@ -1,4 +1,4 @@ -@use rphotos::models::Photo; +@use models::Photo; @(photo: &Photo)

diff --git a/templates/index.rs.html b/templates/index.rs.html index 17c4ad7..594fce1 100644 --- a/templates/index.rs.html +++ b/templates/index.rs.html @@ -1,6 +1,6 @@ @use ::Link; @use nickel::Request; -@use rphotos::models::Photo; +@use models::Photo; @use templates::{page_base, img_link}; @(req: &Request, title: &str, lpath: &[Link], photos: &[Photo]) diff --git a/templates/people.rs.html b/templates/people.rs.html index bb9d76c..bb1b683 100644 --- a/templates/people.rs.html +++ b/templates/people.rs.html @@ -1,5 +1,5 @@ @use nickel::Request; -@use rphotos::models::Person; +@use models::Person; @use templates::page_base; @(req: &Request, people: &[Person]) diff --git a/templates/person.rs.html b/templates/person.rs.html index 735dd3b..93147b1 100644 --- a/templates/person.rs.html +++ b/templates/person.rs.html @@ -1,5 +1,5 @@ @use nickel::Request; -@use rphotos::models::{Photo, Person}; +@use models::{Photo, Person}; @use templates::{page_base, img_link}; @(req: &Request, photos: &[Photo], person: Person) diff --git a/templates/place.rs.html b/templates/place.rs.html index cc20cc6..91fd832 100644 --- a/templates/place.rs.html +++ b/templates/place.rs.html @@ -1,5 +1,5 @@ @use nickel::Request; -@use rphotos::models::{Photo, Place}; +@use models::{Photo, Place}; @use templates::{page_base, img_link}; @(req: &Request, photos: &[Photo], place: Place) diff --git a/templates/places.rs.html b/templates/places.rs.html index 163e3f2..96f3d05 100644 --- a/templates/places.rs.html +++ b/templates/places.rs.html @@ -1,5 +1,5 @@ @use nickel::Request; -@use rphotos::models::Place; +@use models::Place; @use templates::page_base; @(req: &Request, places: &[Place]) diff --git a/templates/tag.rs.html b/templates/tag.rs.html index 7fcf26f..283aacd 100644 --- a/templates/tag.rs.html +++ b/templates/tag.rs.html @@ -1,5 +1,5 @@ @use nickel::Request; -@use rphotos::models::{Photo, Tag}; +@use models::{Photo, Tag}; @use templates::{page_base, img_link}; @(req: &Request, photos: &[Photo], tag: Tag) diff --git a/templates/tags.rs.html b/templates/tags.rs.html index 24b5149..5f5509e 100644 --- a/templates/tags.rs.html +++ b/templates/tags.rs.html @@ -1,5 +1,5 @@ @use nickel::Request; -@use rphotos::models::Tag; +@use models::Tag; @use templates::page_base; @(req: &Request, tags: &[Tag])