diff --git a/assets/i18n/en-US/main.ftl b/assets/i18n/en-US/main.ftl index d0dd8c2..176a1d1 100644 --- a/assets/i18n/en-US/main.ftl +++ b/assets/i18n/en-US/main.ftl @@ -32,7 +32,7 @@ home-sub = news and updates. home-all-posts = All posts home-recent = Recent posts home-tagline = guitar player - original songs, albums, and notes -home-sections = about/ blog/ audio/ songs/ +home-picks = have a listen home-no-posts = no published posts yet blog-title = Blog blog-sub = published article(s) diff --git a/assets/i18n/en/main.ftl b/assets/i18n/en/main.ftl index d0dd8c2..176a1d1 100644 --- a/assets/i18n/en/main.ftl +++ b/assets/i18n/en/main.ftl @@ -32,7 +32,7 @@ home-sub = news and updates. home-all-posts = All posts home-recent = Recent posts home-tagline = guitar player - original songs, albums, and notes -home-sections = about/ blog/ audio/ songs/ +home-picks = have a listen home-no-posts = no published posts yet blog-title = Blog blog-sub = published article(s) diff --git a/assets/i18n/sk/main.ftl b/assets/i18n/sk/main.ftl index 6f39a90..736ef5d 100644 --- a/assets/i18n/sk/main.ftl +++ b/assets/i18n/sk/main.ftl @@ -32,7 +32,7 @@ home-sub = novinky a aktuality. home-all-posts = Všetky príspevky home-recent = Posledné príspevky home-tagline = gitarista - autorské skladby, albumy a poznámky -home-sections = about/ blog/ audio/ songs/ +home-picks = vypočuj si home-no-posts = zatiaľ žiadne zverejnené príspevky blog-title = Blog blog-sub = zverejnené články diff --git a/assets/views/home/index.html b/assets/views/home/index.html index f036e7b..ef387d7 100644 --- a/assets/views/home/index.html +++ b/assets/views/home/index.html @@ -17,9 +17,57 @@
→ {{ t(key="home-tagline", lang=lang | default(value='sk')) }}
-{{ t(key="home-sections", lang=lang | default(value='sk')) }}
# {{ t(key="home-picks", lang=lang | default(value='sk')) }}
+{{ featured_album.artist }}
+ {% endif %} + {% if featured_album.description %} +{{ featured_album.description }}
+ {% endif %} + +# {{ t(key="home-recent", lang=lang | default(value='sk')) }} ({{ articles | length }})
{% if articles | length > 0 %} @@ -63,9 +111,57 @@{{ t(key="home-tagline", lang=lang | default(value='sk')) }}
-{{ t(key="home-sections", lang=lang | default(value='sk')) }}
# {{ t(key="home-picks", lang=lang | default(value='sk')) }}
+{{ featured_album.artist }}
+ {% endif %} + {% if featured_album.description %} +{{ featured_album.description }}
+ {% endif %} + +# {{ t(key="home-recent", lang=lang | default(value='sk')) }} ({{ articles | length }})
{% if articles | length > 0 %} diff --git a/migration/src/m20260517_000003_blog_articles.rs b/migration/src/m20260517_000003_blog_articles.rs index 3cb95b6..de86fda 100644 --- a/migration/src/m20260517_000003_blog_articles.rs +++ b/migration/src/m20260517_000003_blog_articles.rs @@ -33,8 +33,17 @@ impl MigrationTrait for Migration { Table::create() .table(BlogArticles::Table) .if_not_exists() - .col(ColumnDef::new(BlogArticles::Id).uuid().not_null().primary_key()) - .col(ColumnDef::new(BlogArticles::Title).string_len(500).not_null()) + .col( + ColumnDef::new(BlogArticles::Id) + .uuid() + .not_null() + .primary_key(), + ) + .col( + ColumnDef::new(BlogArticles::Title) + .string_len(500) + .not_null(), + ) .col( ColumnDef::new(BlogArticles::Slug) .string_len(500) @@ -42,7 +51,11 @@ impl MigrationTrait for Migration { .unique_key(), ) .col(ColumnDef::new(BlogArticles::Content).text().not_null()) - .col(ColumnDef::new(BlogArticles::Excerpt).string_len(1000).null()) + .col( + ColumnDef::new(BlogArticles::Excerpt) + .string_len(1000) + .null(), + ) .col( ColumnDef::new(BlogArticles::Published) .boolean() diff --git a/migration/src/m20260517_000004_audit_logs.rs b/migration/src/m20260517_000004_audit_logs.rs index 5241a7b..f7dcd66 100644 --- a/migration/src/m20260517_000004_audit_logs.rs +++ b/migration/src/m20260517_000004_audit_logs.rs @@ -30,7 +30,12 @@ impl MigrationTrait for Migration { Table::create() .table(AuditLogs::Table) .if_not_exists() - .col(ColumnDef::new(AuditLogs::Id).uuid().not_null().primary_key()) + .col( + ColumnDef::new(AuditLogs::Id) + .uuid() + .not_null() + .primary_key(), + ) .col(ColumnDef::new(AuditLogs::AdminUserId).integer().not_null()) .col(ColumnDef::new(AuditLogs::Action).string_len(100).not_null()) .col(ColumnDef::new(AuditLogs::TargetType).string_len(50).null()) diff --git a/migration/src/m20260517_000005_audio_albums.rs b/migration/src/m20260517_000005_audio_albums.rs index 2564b96..74ca7bd 100644 --- a/migration/src/m20260517_000005_audio_albums.rs +++ b/migration/src/m20260517_000005_audio_albums.rs @@ -34,8 +34,17 @@ impl MigrationTrait for Migration { Table::create() .table(AudioAlbums::Table) .if_not_exists() - .col(ColumnDef::new(AudioAlbums::Id).uuid().not_null().primary_key()) - .col(ColumnDef::new(AudioAlbums::Title).string_len(500).not_null()) + .col( + ColumnDef::new(AudioAlbums::Id) + .uuid() + .not_null() + .primary_key(), + ) + .col( + ColumnDef::new(AudioAlbums::Title) + .string_len(500) + .not_null(), + ) .col( ColumnDef::new(AudioAlbums::Slug) .string_len(500) diff --git a/migration/src/m20260517_000006_audio_tracks.rs b/migration/src/m20260517_000006_audio_tracks.rs index e69a6a0..47ecae8 100644 --- a/migration/src/m20260517_000006_audio_tracks.rs +++ b/migration/src/m20260517_000006_audio_tracks.rs @@ -32,9 +32,18 @@ impl MigrationTrait for Migration { Table::create() .table(AudioTracks::Table) .if_not_exists() - .col(ColumnDef::new(AudioTracks::Id).uuid().not_null().primary_key()) + .col( + ColumnDef::new(AudioTracks::Id) + .uuid() + .not_null() + .primary_key(), + ) .col(ColumnDef::new(AudioTracks::AlbumId).uuid().not_null()) - .col(ColumnDef::new(AudioTracks::Title).string_len(500).not_null()) + .col( + ColumnDef::new(AudioTracks::Title) + .string_len(500) + .not_null(), + ) .col(ColumnDef::new(AudioTracks::Slug).string_len(500).not_null()) .col( ColumnDef::new(AudioTracks::AudioFileId) diff --git a/migration/src/m20260517_000007_audio_tags.rs b/migration/src/m20260517_000007_audio_tags.rs index b8e62a9..0a80549 100644 --- a/migration/src/m20260517_000007_audio_tags.rs +++ b/migration/src/m20260517_000007_audio_tags.rs @@ -19,7 +19,12 @@ impl MigrationTrait for Migration { Table::create() .table(AudioTags::Table) .if_not_exists() - .col(ColumnDef::new(AudioTags::Id).uuid().not_null().primary_key()) + .col( + ColumnDef::new(AudioTags::Id) + .uuid() + .not_null() + .primary_key(), + ) .col( ColumnDef::new(AudioTags::Name) .string_len(100) diff --git a/migration/src/m20260517_000011_site_pages.rs b/migration/src/m20260517_000011_site_pages.rs index f0eb15b..8da4a1b 100644 --- a/migration/src/m20260517_000011_site_pages.rs +++ b/migration/src/m20260517_000011_site_pages.rs @@ -21,7 +21,12 @@ impl MigrationTrait for Migration { Table::create() .table(SitePages::Table) .if_not_exists() - .col(ColumnDef::new(SitePages::Id).uuid().not_null().primary_key()) + .col( + ColumnDef::new(SitePages::Id) + .uuid() + .not_null() + .primary_key(), + ) .col( ColumnDef::new(SitePages::Slug) .string_len(100) diff --git a/src/controllers/blog.rs b/src/controllers/blog.rs index 4be4115..646d293 100644 --- a/src/controllers/blog.rs +++ b/src/controllers/blog.rs @@ -1,7 +1,4 @@ -use crate::{ - controllers::admin, - models::_entities::blog_articles, -}; +use crate::{controllers::admin, models::_entities::blog_articles}; use chrono::Utc; use loco_rs::prelude::*; use sea_orm::{ActiveModelTrait, ColumnTrait, EntityTrait, QueryFilter, QueryOrder, Set}; @@ -195,7 +192,11 @@ async fn admin_update( } #[debug_handler] -async fn admin_delete(auth: auth::JWT, Path(id): Path