Skip to content

Commit d0218fa

Browse files
authored
Merge pull request #4305 from crazyserver/MOBILE-4653
Mobile 4653
2 parents 92df96c + 5dc6ae4 commit d0218fa

File tree

85 files changed

+1538
-1261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1538
-1261
lines changed

.vscode/extensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"recommendations": [
33
"ionic.ionic",
44
"dbaeumer.vscode-eslint",
5-
"angular.ng-template"
5+
"angular.ng-template",
6+
"nesterenok.js-beautify-extentions",
67
]
78
}

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
77
"[html]": {
8-
"editor.defaultFormatter": "vscode.html-language-features",
8+
"editor.defaultFormatter": "nesterenok.js-beautify-extentions",
99
},
1010
"editor.formatOnSave": true,
1111
"eslint.format.enable": true,

src/addons/block/timeline/components/events/addon-block-timeline-events.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ <h3>
1010
<ion-item>
1111
<ion-label>
1212
@if (course) {
13-
<h3><ng-container *ngTemplateOutlet="date" /></h3>
13+
<h3><ng-container *ngTemplateOutlet="date" /></h3>
1414
} @else {
15-
<h4><ng-container *ngTemplateOutlet="date" /></h4>
15+
<h4><ng-container *ngTemplateOutlet="date" /></h4>
1616
}
1717
<ng-template #date>
1818
{{ dayEvents.dayTimestamp * 1000 | coreFormatDate:"strftimedaydate" }}

src/addons/blog/pages/edit-entry/edit-entry.html

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -40,35 +40,35 @@ <h1>{{ entry ? entry.subject : 'addon.blog.addnewentry' | translate }}</h1>
4040
[componentId]="entry?.id ?? 0" />
4141

4242
@if (courseId && associatedCourse) {
43-
<ion-item class="divider section" (click)="toggleAssociations()" button [detail]="false"
44-
[attr.aria-label]="(associationsExpanded ? 'core.collapse' : 'core.expand') | translate"
45-
[attr.aria-expanded]="associationsExpanded" aria-controls="addon-blog-associations"
46-
[class.expandable-status-icon-expanded]="associationsExpanded">
47-
<ion-icon [name]="associationsExpanded ? 'fas-chevron-down' : 'fas-chevron-right'" flip-rtl slot="start"
48-
class="expandable-status-icon" />
49-
<ion-label>
50-
<h2>{{ 'addon.blog.associations' | translate }}</h2>
51-
</ion-label>
52-
</ion-item>
53-
<div id="addon-blog-associations">
54-
@if (associationsExpanded) {
55-
<ion-item>
56-
@if (associatedModule) {
57-
<ion-toggle formControlName="associateWithModule">
58-
<core-format-text [text]="'addon.blog.associatewithmodule' | translate: {
43+
<ion-item class="divider section" (click)="toggleAssociations()" button [detail]="false"
44+
[attr.aria-label]="(associationsExpanded ? 'core.collapse' : 'core.expand') | translate"
45+
[attr.aria-expanded]="associationsExpanded" aria-controls="addon-blog-associations"
46+
[class.expandable-status-icon-expanded]="associationsExpanded">
47+
<ion-icon [name]="associationsExpanded ? 'fas-chevron-down' : 'fas-chevron-right'" flip-rtl slot="start"
48+
class="expandable-status-icon" />
49+
<ion-label>
50+
<h2>{{ 'addon.blog.associations' | translate }}</h2>
51+
</ion-label>
52+
</ion-item>
53+
<div id="addon-blog-associations">
54+
@if (associationsExpanded) {
55+
<ion-item>
56+
@if (associatedModule) {
57+
<ion-toggle formControlName="associateWithModule">
58+
<core-format-text [text]="'addon.blog.associatewithmodule' | translate: {
5959
$a: { modtype: associatedModule.modname, modname: associatedModule.name }
6060
}" [contextLevel]="moduleContext" [contextInstanceId]="modId" [courseId]="courseId" />
61-
</ion-toggle>
62-
} @else if (associatedCourse) {
63-
<ion-toggle formControlName="associateWithCourse">
64-
<core-format-text
65-
[text]="'addon.blog.associatewithcourse' | translate: { $a: { coursename: associatedCourse.fullname } }"
66-
[contextLevel]="courseContext" [contextInstanceId]="courseId" [courseId]="courseId" />
67-
</ion-toggle>
61+
</ion-toggle>
62+
} @else if (associatedCourse) {
63+
<ion-toggle formControlName="associateWithCourse">
64+
<core-format-text
65+
[text]="'addon.blog.associatewithcourse' | translate: { $a: { coursename: associatedCourse.fullname } }"
66+
[contextLevel]="courseContext" [contextInstanceId]="courseId" [courseId]="courseId" />
67+
</ion-toggle>
68+
}
69+
</ion-item>
6870
}
69-
</ion-item>
70-
}
71-
</div>
71+
</div>
7272
}
7373

7474
<ion-button class="ion-margin" expand="block" [ariaLabel]="'core.save' | translate"

src/addons/blog/pages/index/index.html

Lines changed: 101 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -25,122 +25,124 @@ <h1>{{ title | translate }}</h1>
2525

2626
<core-loading [hideUntil]="loaded()">
2727
@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>
3333
}
3434

3535
@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>
4242
}
4343

4444
@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>
5471
}
5572

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>
6378
}
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" />
8379
</div>
8480

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: {
8788
'$a': { name: '<strong>' + entry.user?.fullname + '</strong>', date: (entry.created | coreDateDayOrTime) }
8889
}"></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+
}
9893
</div>
9994

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+
}
108109

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" />
110112

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>
117119

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>
125136
}
126137

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" />
132141
}
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-
}
140142

141-
</div>
143+
</div>
142144
} @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" />
144146
}
145147

146148
<core-infinite-loading [enabled]="canLoadMore" (action)="loadMore($event)" [error]="loadMoreError" />
@@ -149,12 +151,12 @@ <h3>
149151

150152
<!-- Create a blog entry. -->
151153
@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>
158160
}
159161

160162
</ion-content>

0 commit comments

Comments
 (0)