@@ -25,122 +25,124 @@ <h1>{{ title | translate }}</h1>
25
25
26
26
< core-loading [hideUntil] ="loaded() ">
27
27
@if (showMyEntriesToggle) {
28
- < ion-item class ="ion-text-wrap ">
29
- < ion-toggle [(ngModel)] ="onlyMyEntries " (ionChange) ="onlyMyEntriesToggleChanged(onlyMyEntries) ">
30
- {{ 'addon.blog.showonlyyourentries' | translate }}
31
- </ ion-toggle >
32
- </ ion-item >
28
+ < ion-item class ="ion-text-wrap ">
29
+ < ion-toggle [(ngModel)] ="onlyMyEntries " (ionChange) ="onlyMyEntriesToggleChanged(onlyMyEntries) ">
30
+ {{ 'addon.blog.showonlyyourentries' | translate }}
31
+ </ ion-toggle >
32
+ </ ion-item >
33
33
}
34
34
35
35
@if (hasOfflineDataToSync()) {
36
- < ion-card class ="core-warning-card ">
37
- < ion-item >
38
- < ion-icon name ="fas-triangle-exclamation " slot ="start " aria-hidden ="true " />
39
- < ion-label > {{ 'core.hasdatatosync' | translate:{ $a: 'addon.blog.blog' | translate } }}</ ion-label >
40
- </ ion-item >
41
- </ ion-card >
36
+ < ion-card class ="core-warning-card ">
37
+ < ion-item >
38
+ < ion-icon name ="fas-triangle-exclamation " slot ="start " aria-hidden ="true " />
39
+ < ion-label > {{ 'core.hasdatatosync' | translate:{ $a: 'addon.blog.blog' | translate } }}</ ion-label >
40
+ </ ion-item >
41
+ </ ion-card >
42
42
}
43
43
44
44
@for (entry of entries; track getEntryTemplateId(entry)) {
45
- < div class ="entry ion-padding-start ion-padding-top ion-padding-end " [id] ="getEntryTemplateId(entry) ">
46
- < div class ="entry-subject flex ion-text-wrap ion-justify-content-between ion-align-items-center ">
47
- < h3 >
48
- < core-format-text [text] ="entry.subject " [contextLevel] ="contextLevel " [contextInstanceId] ="contextInstanceId "
49
- [courseId] ="entry.courseid " />
50
- @if (entry.userid === currentUserId && entry.publishTranslated === 'publishtonoone') {
51
- < span class ="entry-draft ">
52
- < ion-badge color ="warning "> {{ 'addon.blog.publishtonoone' | translate }} </ ion-badge >
53
- </ span >
45
+ < div class ="entry ion-padding-start ion-padding-top ion-padding-end " [id] ="getEntryTemplateId(entry) ">
46
+ < div class ="entry-subject flex ion-text-wrap ion-justify-content-between ion-align-items-center ">
47
+ < h3 >
48
+ < core-format-text [text] ="entry.subject " [contextLevel] ="contextLevel " [contextInstanceId] ="contextInstanceId "
49
+ [courseId] ="entry.courseid " />
50
+ @if (entry.userid === currentUserId && entry.publishTranslated === 'publishtonoone') {
51
+ < span class ="entry-draft ">
52
+ < ion-badge color ="warning "> {{ 'addon.blog.publishtonoone' | translate }} </ ion-badge >
53
+ </ span >
54
+ }
55
+
56
+ @if (!getEntryId(entry) || entry.updatedOffline) {
57
+ < span class ="entry-draft ">
58
+ < ion-badge color ="light ">
59
+ < ion-icon name ="fas-clock " [attr.aria-label] ="'core.lastmodified' | translate " />
60
+ {{ 'core.notsent' | translate }}
61
+ </ ion-badge >
62
+ </ span >
63
+ }
64
+ </ h3 >
65
+
66
+ @if (entry.userid === currentUserId && optionsAvailable && !entry.deleted) {
67
+ < ion-button fill ="clear " [ariaLabel] ="'core.displayoptions' | translate "
68
+ (click) ="showEntryActionsPopover($event, entry) " class ="entry-options ">
69
+ < ion-icon slot ="icon-only " aria-hidden ="true " name ="ellipsis-vertical " />
70
+ </ ion-button >
54
71
}
55
72
56
- @if (!getEntryId(entry) || entry.updatedOffline) {
57
- < span class ="entry-draft ">
58
- < ion-badge color ="light ">
59
- < ion-icon name ="fas-clock " [attr.aria-label] ="'core.lastmodified' | translate " />
60
- {{ 'core.notsent' | translate }}
61
- </ ion-badge >
62
- </ span >
73
+ @if (entry.deleted) {
74
+ < ion-button slot ="end " fill ="clear " color ="danger " (click) ="undoDelete(entry) "
75
+ [ariaLabel] ="'core.restore' | translate ">
76
+ < ion-icon name ="fas-rotate-left " slot ="icon-only " aria-hidden ="true " />
77
+ </ ion-button >
63
78
}
64
- </ h3 >
65
-
66
- @if (entry.userid === currentUserId && optionsAvailable && !entry.deleted) {
67
- < ion-button fill ="clear " [ariaLabel] ="'core.displayoptions' | translate " (click) ="showEntryActionsPopover($event, entry) "
68
- class ="entry-options ">
69
- < ion-icon slot ="icon-only " aria-hidden ="true " name ="ellipsis-vertical " />
70
- </ ion-button >
71
- }
72
-
73
- @if (entry.deleted) {
74
- < ion-button slot ="end " fill ="clear " color ="danger " (click) ="undoDelete(entry) " [ariaLabel] ="'core.restore' | translate ">
75
- < ion-icon name ="fas-rotate-left " slot ="icon-only " aria-hidden ="true " />
76
- </ ion-button >
77
- }
78
- </ div >
79
-
80
- < div class ="entry-creation-info flex ion-align-items-center ">
81
- < div class ="entry-avatar ">
82
- < core-user-avatar [user] ="entry.user " [courseId] ="entry.courseid " />
83
79
</ div >
84
80
85
- @if (entry.user?.fullname && entry.created) {
86
- < span [innerHTML] ="'core.bynameondate' | translate: {
81
+ < div class ="entry-creation-info flex ion-align-items-center ">
82
+ < div class ="entry-avatar ">
83
+ < core-user-avatar [user] ="entry.user " [courseId] ="entry.courseid " />
84
+ </ div >
85
+
86
+ @if (entry.user?.fullname && entry.created) {
87
+ < span [innerHTML] ="'core.bynameondate' | translate: {
87
88
'$a': { name: '<strong>' + entry.user?.fullname + '</strong>', date: (entry.created | coreDateDayOrTime) }
88
89
} "> </ span >
89
- } @else if (!entry.user?.fullname && entry.created) {
90
- < span > {{ entry.created | coreDateDayOrTime }}</ span >
91
- }
92
- </ div >
93
-
94
- < div class ="entry-summary " [collapsible-item] ="64 ">
95
- < div class ="ion-margin-bottom ">
96
- < core-format-text [text] ="entry.summary " [component] ="component " [componentId] ="getEntryId(entry) "
97
- [contextLevel] ="contextLevel " [contextInstanceId] ="contextInstanceId " [courseId] ="entry.courseid " />
90
+ } @else if (!entry.user?.fullname && entry.created) {
91
+ < span > {{ entry.created | coreDateDayOrTime }}</ span >
92
+ }
98
93
</ div >
99
94
100
- @if (tagsEnabled && entry.tags && entry.tags!.length > 0) {
101
- < ion-item class ="ion-text-wrap " lines ="none ">
102
- < ion-label >
103
- < div slot ="start "> {{ 'core.tag.tags' | translate }}:</ div >
104
- < core-tag-list [tags] ="entry.tags " />
105
- </ ion-label >
106
- </ ion-item >
107
- }
95
+ < div class ="entry-summary " [collapsible-item] ="64 ">
96
+ < div class ="ion-margin-bottom ">
97
+ < core-format-text [text] ="entry.summary " [component] ="component " [componentId] ="getEntryId(entry) "
98
+ [contextLevel] ="contextLevel " [contextInstanceId] ="contextInstanceId " [courseId] ="entry.courseid " />
99
+ </ div >
100
+
101
+ @if (tagsEnabled && entry.tags && entry.tags!.length > 0) {
102
+ < ion-item class ="ion-text-wrap " lines ="none ">
103
+ < ion-label >
104
+ < div slot ="start "> {{ 'core.tag.tags' | translate }}:</ div >
105
+ < core-tag-list [tags] ="entry.tags " />
106
+ </ ion-label >
107
+ </ ion-item >
108
+ }
108
109
109
- < core-files [files] ="entry.attachmentfiles " [component] ="component " [componentId] ="getEntryId(entry) ?? entry.created " />
110
+ < core-files [files] ="entry.attachmentfiles " [component] ="component "
111
+ [componentId] ="getEntryId(entry) ?? entry.created " />
110
112
111
- @if (entry.uniquehash) {
112
- < ion-item [href] ="entry.uniquehash " core-link [detail] ="true " lines ="none ">
113
- < ion-label > {{ 'addon.blog.linktooriginalentry' | translate }}</ ion-label >
114
- </ ion-item >
115
- }
116
- </ div >
113
+ @if (entry.uniquehash) {
114
+ < ion-item [href] ="entry.uniquehash " core-link [detail] ="true " lines ="none ">
115
+ < ion-label > {{ 'addon.blog.linktooriginalentry' | translate }}</ ion-label >
116
+ </ ion-item >
117
+ }
118
+ </ div >
117
119
118
- @if (entry.lastmodified > entry.created || (entry.userid === currentUserId && entry.publishstate !== 'draft')) {
119
- < ion-item class ="entry-last-modification " lines ="none ">
120
- @if (entry.lastmodified > entry.created) {
121
- < ion-note class ="flex ion-align-items-center " slot ="start ">
122
- < ion-icon name ="fas-clock " [attr.aria-label] ="'core.lastmodified' | translate " />
123
- {{ entry.lastmodified | coreTimeAgo }}
124
- </ ion-note >
120
+ @if (entry.lastmodified > entry.created || (entry.userid === currentUserId && entry.publishstate !== 'draft')) {
121
+ < ion-item class ="entry-last-modification " lines ="none ">
122
+ @if (entry.lastmodified > entry.created) {
123
+ < ion-note class ="flex ion-align-items-center " slot ="start ">
124
+ < ion-icon name ="fas-clock " [attr.aria-label] ="'core.lastmodified' | translate " />
125
+ {{ entry.lastmodified | coreTimeAgo }}
126
+ </ ion-note >
127
+ }
128
+
129
+ @if (entry.userid === currentUserId && entry.publishstate !== 'draft') {
130
+ < ion-badge class ="entry-visibility-permission " color ="success " slot ="end ">
131
+ < ion-icon name ="fas-eye " />
132
+ {{ 'addon.blog.' + entry.publishTranslated | translate }}
133
+ </ ion-badge >
134
+ }
135
+ </ ion-item >
125
136
}
126
137
127
- @if (entry.userid === currentUserId && entry.publishstate !== 'draft') {
128
- < ion-badge class ="entry-visibility-permission " color ="success " slot ="end ">
129
- < ion-icon name ="fas-eye " />
130
- {{ 'addon.blog.' + entry.publishTranslated | translate }}
131
- </ ion-badge >
138
+ @if (getEntryId(entry) && commentsEnabled) {
139
+ < core-comments [component] ="this.component " [itemId] ="getEntryId(entry) " area ="format_blog " [instanceId] ="entry.userid "
140
+ contextLevel ="user " [showItem] ="true " [courseId] ="entry.courseid " />
132
141
}
133
- </ ion-item >
134
- }
135
-
136
- @if (getEntryId(entry) && commentsEnabled) {
137
- < core-comments [component] ="this.component " [itemId] ="getEntryId(entry) " area ="format_blog " [instanceId] ="entry.userid "
138
- contextLevel ="user " [showItem] ="true " [courseId] ="entry.courseid " />
139
- }
140
142
141
- </ div >
143
+ </ div >
142
144
} @empty {
143
- < core-empty-box icon ="far-newspaper " [message] ="'addon.blog.noentriesyet' | translate " />
145
+ < core-empty-box icon ="far-newspaper " [message] ="'addon.blog.noentriesyet' | translate " />
144
146
}
145
147
146
148
< core-infinite-loading [enabled] ="canLoadMore " (action) ="loadMore($event) " [error] ="loadMoreError " />
@@ -149,12 +151,12 @@ <h3>
149
151
150
152
<!-- Create a blog entry. -->
151
153
@if ((filter.userid === currentUserId || showMyEntriesToggle) && loaded() && optionsAvailable) {
152
- < ion-fab slot ="fixed " core-fab vertical ="bottom " horizontal ="end ">
153
- < ion-fab-button (click) ="createNewEntry() " [attr.aria-label] ="'addon.blog.addnewentry' | translate ">
154
- < ion-icon name ="fas-pen-to-square " aria-hidden ="true " />
155
- < span class ="sr-only "> {{ 'addon.blog.addnewentry' | translate }}</ span >
156
- </ ion-fab-button >
157
- </ ion-fab >
154
+ < ion-fab slot ="fixed " core-fab vertical ="bottom " horizontal ="end ">
155
+ < ion-fab-button (click) ="createNewEntry() " [attr.aria-label] ="'addon.blog.addnewentry' | translate ">
156
+ < ion-icon name ="fas-pen-to-square " aria-hidden ="true " />
157
+ < span class ="sr-only "> {{ 'addon.blog.addnewentry' | translate }}</ span >
158
+ </ ion-fab-button >
159
+ </ ion-fab >
158
160
}
159
161
160
162
</ ion-content >
0 commit comments