From e7268582161cac45d118f11dadbcde056c5f712d Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Mon, 1 Mar 2021 14:47:47 +0100 Subject: [PATCH] MOBILE-3643 forum: Format templates --- .../forum/components/edit-post/edit-post.html | 22 ++++-- .../mod/forum/components/index/index.html | 74 ++++++++++++++----- .../mod/forum/components/index/index.scss | 2 +- .../mod/forum/components/post/post.html | 23 ++++-- .../mod/forum/components/post/post.scss | 2 +- src/addons/mod/forum/components/post/post.ts | 6 ++ .../sort-order-selector.html | 2 +- .../forum/pages/discussion/discussion.html | 55 +++++++++++--- .../pages/new-discussion/new-discussion.html | 11 ++- .../index/addon-mod-lesson-index.html | 2 +- .../mod/lesson/pages/player/player.html | 2 +- .../match/component/addon-qtype-match.html | 2 +- .../components/format/core-course-format.html | 2 +- .../login/pages/credentials/credentials.html | 2 +- .../pages/email-signup/email-signup.html | 4 +- .../forgotten-password.html | 2 +- 16 files changed, 158 insertions(+), 55 deletions(-) diff --git a/src/addons/mod/forum/components/edit-post/edit-post.html b/src/addons/mod/forum/components/edit-post/edit-post.html index ab09104f8..73f363b9a 100644 --- a/src/addons/mod/forum/components/edit-post/edit-post.html +++ b/src/addons/mod/forum/components/edit-post/edit-post.html @@ -12,14 +12,21 @@ -
+ {{ 'addon.mod_forum.subject' | translate }} - + + {{ 'addon.mod_forum.message' | translate }} - + + @@ -27,12 +34,17 @@ {{ 'addon.mod_forum.advanced' | translate }} - + + - {{ 'core.savechanges' | translate }} + + {{ 'core.savechanges' | translate }} + {{ 'core.cancel' | translate }} diff --git a/src/addons/mod/forum/components/index/index.html b/src/addons/mod/forum/components/index/index.html index cb0eaa788..cf63909d5 100644 --- a/src/addons/mod/forum/components/index/index.html +++ b/src/addons/mod/forum/components/index/index.html @@ -1,14 +1,37 @@ - - - - - - - - + + + + + + + + + + + + + + + + @@ -64,7 +87,10 @@

- + +

- + +

{{discussion.userfullname}}

{{ discussion.groupname }}

-

{{discussion.created * 1000 | coreFormatDate: "strftimerecentfull"}}

-

{{ 'core.notsent' | translate }}

+

+ {{discussion.created * 1000 | coreFormatDate: "strftimerecentfull"}} +

+

+ + {{ 'core.notsent' | translate }} +

- + {{ 'addon.mod_forum.lastpost' | translate }} - {{discussion.timemodified | coreTimeAgo}} - {{discussion.created | coreTimeAgo}} + + {{ discussion.timemodified | coreTimeAgo }} + + + {{ discussion.created | coreTimeAgo }} + - {{ 'addon.mod_forum.numreplies' | translate:{numreplies: discussion.numreplies} }} + + {{ 'addon.mod_forum.numreplies' | translate:{numreplies: discussion.numreplies} }} {{ discussion.numunread }} @@ -104,7 +142,9 @@ - + diff --git a/src/addons/mod/forum/components/index/index.scss b/src/addons/mod/forum/components/index/index.scss index 1a1c03ae2..51951a796 100644 --- a/src/addons/mod/forum/components/index/index.scss +++ b/src/addons/mod/forum/components/index/index.scss @@ -1,4 +1,4 @@ -@import '../../../../../theme/globals.scss'; +@import "~theme/globals"; :host { diff --git a/src/addons/mod/forum/components/post/post.html b/src/addons/mod/forum/components/post/post.html index 4848208cd..6f48c3db6 100644 --- a/src/addons/mod/forum/components/post/post.html +++ b/src/addons/mod/forum/components/post/post.html @@ -9,7 +9,9 @@ - + + fill="clear" color="dark" [attr.aria-label]="('core.displayoptions' | translate)" + (click)="showOptionsMenu($event)"> @@ -43,7 +46,8 @@ + fill="clear" color="dark" [attr.aria-label]="('core.displayoptions' | translate)" + (click)="showOptionsMenu($event)"> @@ -85,8 +89,10 @@ - + {{ 'addon.mod_forum.reply' | translate }} @@ -94,11 +100,12 @@ - + {{ 'addon.mod_forum.subject' | translate }} - + + {{ 'addon.mod_forum.message' | translate }} diff --git a/src/addons/mod/forum/components/post/post.scss b/src/addons/mod/forum/components/post/post.scss index 3d4be6ec6..b9d4db52a 100644 --- a/src/addons/mod/forum/components/post/post.scss +++ b/src/addons/mod/forum/components/post/post.scss @@ -1,4 +1,4 @@ -@import "../../../../../theme/globals.scss"; +@import "~theme/globals"; :host .addon-mod_forum-post { background-color: var(--white); diff --git a/src/addons/mod/forum/components/post/post.ts b/src/addons/mod/forum/components/post/post.ts index 0eaf6f52d..f41115ace 100644 --- a/src/addons/mod/forum/components/post/post.ts +++ b/src/addons/mod/forum/components/post/post.ts @@ -98,6 +98,12 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges @Optional() protected content?: IonContent, ) {} + get showForm(): boolean { + return this.post.id > 0 + ? !this.replyData.isEditing && this.replyData.replyingTo === this.post.id + : this.replyData.isEditing && this.replyData.replyingTo === this.post.parentid; + } + /** * Component being initialized. */ diff --git a/src/addons/mod/forum/components/sort-order-selector/sort-order-selector.html b/src/addons/mod/forum/components/sort-order-selector/sort-order-selector.html index 6911e0bdc..5ac48825b 100644 --- a/src/addons/mod/forum/components/sort-order-selector/sort-order-selector.html +++ b/src/addons/mod/forum/components/sort-order-selector/sort-order-selector.html @@ -15,7 +15,7 @@

{{ sortOrder.label | translate }}

diff --git a/src/addons/mod/forum/pages/discussion/discussion.html b/src/addons/mod/forum/pages/discussion/discussion.html index 976b0e0a6..e3e987118 100644 --- a/src/addons/mod/forum/pages/discussion/discussion.html +++ b/src/addons/mod/forum/pages/discussion/discussion.html @@ -14,17 +14,50 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/addons/mod/forum/pages/new-discussion/new-discussion.html b/src/addons/mod/forum/pages/new-discussion/new-discussion.html index d5e298a1d..def9148e6 100644 --- a/src/addons/mod/forum/pages/new-discussion/new-discussion.html +++ b/src/addons/mod/forum/pages/new-discussion/new-discussion.html @@ -15,10 +15,13 @@ - + {{ 'addon.mod_forum.subject' | translate }} - + + {{ 'addon.mod_forum.message' | translate }} @@ -64,7 +67,9 @@ - + {{ 'addon.mod_forum.posttoforum' | translate }} diff --git a/src/addons/mod/lesson/components/index/addon-mod-lesson-index.html b/src/addons/mod/lesson/components/index/addon-mod-lesson-index.html index ab10934b6..35033669b 100644 --- a/src/addons/mod/lesson/components/index/addon-mod-lesson-index.html +++ b/src/addons/mod/lesson/components/index/addon-mod-lesson-index.html @@ -53,7 +53,7 @@ - + {{ 'addon.mod_lesson.enterpassword' | translate }} diff --git a/src/addons/mod/lesson/pages/player/player.html b/src/addons/mod/lesson/pages/player/player.html index e534fbc27..bf33c0984 100644 --- a/src/addons/mod/lesson/pages/player/player.html +++ b/src/addons/mod/lesson/pages/player/player.html @@ -53,7 +53,7 @@ - diff --git a/src/addons/qtype/match/component/addon-qtype-match.html b/src/addons/qtype/match/component/addon-qtype-match.html index f388fff84..495d0ea09 100644 --- a/src/addons/qtype/match/component/addon-qtype-match.html +++ b/src/addons/qtype/match/component/addon-qtype-match.html @@ -1,4 +1,4 @@ -
+
-
+
{{siteUrl}}

- + - @@ -74,7 +74,7 @@ -
diff --git a/src/core/features/login/pages/forgotten-password/forgotten-password.html b/src/core/features/login/pages/forgotten-password/forgotten-password.html index 2736767f6..ed7c39de0 100644 --- a/src/core/features/login/pages/forgotten-password/forgotten-password.html +++ b/src/core/features/login/pages/forgotten-password/forgotten-password.html @@ -14,7 +14,7 @@ - + {{ 'core.login.searchby' | translate }}