From 521964cf4fc5d6f1c6e57a75b805beb64fe13afd Mon Sep 17 00:00:00 2001 From: Alfonso Salces Date: Mon, 25 Mar 2024 14:58:55 +0100 Subject: [PATCH] MOBILE-4219 blog: Fix empty blog entries page and some styles --- src/addons/blog/pages/index/index.html | 23 +++++++++++++---------- src/addons/blog/pages/index/index.scss | 12 ++++++++++++ src/addons/blog/pages/index/index.ts | 3 +++ 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/addons/blog/pages/index/index.html b/src/addons/blog/pages/index/index.html index 7baa5871f..ce9ec0f9d 100644 --- a/src/addons/blog/pages/index/index.html +++ b/src/addons/blog/pages/index/index.html @@ -28,7 +28,6 @@ } @for (entry of entries; track entry.id) { - @if (!onlyMyEntries || entry.userid === currentUserId) {

@@ -56,10 +55,13 @@ + @if (entry.user?.fullname && entry.created) { - + '$a': { name: '' + entry.user?.fullname + '', date: (entry.created | coreDateDayOrTime) } + }"> + } @else if (!entry.user?.fullname && entry.created) { + {{ entry.created | coreDateDayOrTime }} + }

@@ -92,20 +94,22 @@
- @if (entry.lastmodified > entry.created) { -
- + @if (entry.lastmodified > entry.created || (entry.userid === currentUserId && entry.publishstate !== 'draft')) { + + @if (entry.lastmodified > entry.created) { + {{ entry.lastmodified | coreTimeAgo }} + } @if (entry.userid === currentUserId && entry.publishstate !== 'draft') { - + {{ 'addon.blog.' + entry.publishTranslated | translate }} } -
+ } @if (commentsEnabled) { @@ -114,7 +118,6 @@ } - } } @empty { } diff --git a/src/addons/blog/pages/index/index.scss b/src/addons/blog/pages/index/index.scss index ab579b29e..16cd7210f 100644 --- a/src/addons/blog/pages/index/index.scss +++ b/src/addons/blog/pages/index/index.scss @@ -45,6 +45,18 @@ } &-last-modification { + --border-width: 0 0 1px 0; + + &::part(native) { + padding: 0; + } + + ion-note { + padding-top: 0.9rem; + font-size: 0.875rem; + font-weight: 500; + } + ion-icon { margin-right: .3rem; } diff --git a/src/addons/blog/pages/index/index.ts b/src/addons/blog/pages/index/index.ts index 186c5b25c..b1b3d4b8e 100644 --- a/src/addons/blog/pages/index/index.ts +++ b/src/addons/blog/pages/index/index.ts @@ -229,6 +229,8 @@ export class AddonBlogIndexPage implements OnInit, OnDestroy { .sort((a, b) => b.created - a.created); } + this.entries = this.entries.filter(entry => !this.onlyMyEntries || entry.userid === this.currentUserId); + if (this.onlyMyEntries) { const count = this.entries.filter((entry) => entry.userid == this.currentUserId).length; this.canLoadMoreUserEntries = result.totalentries > count; @@ -273,6 +275,7 @@ export class AddonBlogIndexPage implements OnInit, OnDestroy { // First time but no entry loaded. Try to load some. this.loadMore(); } + } /**