MOBILE-2862 forum: Update discussion template

main
Pau Ferrer Ocaña 2019-09-09 14:10:07 +02:00
parent 6964c01c77
commit 4302f70c38
8 changed files with 46 additions and 56 deletions

View File

@ -580,6 +580,7 @@
"addon.mod_forum.favouriteupdated": "forum",
"addon.mod_forum.forumnodiscussionsyet": "local_moodlemobileapp",
"addon.mod_forum.group": "local_moodlemobileapp",
"addon.mod_forum.lastpost": "forum",
"addon.mod_forum.lockdiscussion": "forum",
"addon.mod_forum.lockupdated": "forum",
"addon.mod_forum.message": "forum",

View File

@ -35,66 +35,64 @@
<core-empty-box *ngIf="discussions.length == 0 && offlineDiscussions.length == 0" icon="chatbubbles" [message]="'addon.mod_forum.forumnodiscussionsyet' | translate">
</core-empty-box>
<div text-wrap *ngIf="sortingAvailable && selectedSortOrder" ion-row padding-horizontal padding-top margin-bottom>
<div text-wrap *ngIf="discussions.length > 0 && sortingAvailable && selectedSortOrder" ion-row padding-horizontal padding-top margin-bottom>
<button *ngIf="sortingAvailable" ion-button padding-horizontal icon-end ion-col (click)="showSortOrderSelector($event)" color="light" class="core-button-select button-no-uppercase" [attr.aria-label]="('core.sort' | translate)" aria-haspopup="true" [attr.aria-expanded]="sortOrderSelectorExpanded" aria-controls="addon-mod-forum-sort-order-selector" id="addon-mod-forum-sort-order-button">
<span class="core-section-selector-text">{{ selectedSortOrder.label | translate }}</span>
<span class="core-button-select-text">{{ selectedSortOrder.label | translate }}</span>
<ion-icon name="arrow-dropdown" ios="md-arrow-dropdown"></ion-icon>
</button>
</div>
<ion-card *ngFor="let discussion of offlineDiscussions" (click)="openNewDiscussion(discussion.timecreated)" [class.addon-forum-discussion-selected]="discussion.timecreated == -selectedDiscussion">
<ion-item text-wrap>
<ng-container *ngFor="let discussion of offlineDiscussions">
<ion-item text-wrap (click)="openNewDiscussion(discussion.timecreated)" [attr.no-lines]="discussion.groupname" [class.core-split-item-selected]="discussion.timecreated == -selectedDiscussion">
<ion-avatar core-user-avatar [user]="discussion" item-start [courseId]="courseId"></ion-avatar>
<h2><core-format-text [text]="discussion.subject"></core-format-text></h2>
<p *ngIf="discussion.userfullname">
<h3 *ngIf="discussion.userfullname">
<ion-note float-end padding-left><ion-icon name="time"></ion-icon> {{ 'core.notsent' | translate }}</ion-note>
{{discussion.userfullname}}
</p>
</h3>
</ion-item>
<ion-card-content>
<ion-note text-end *ngIf="discussion.groupname">
<ion-item *ngIf="discussion.groupname" (click)="openNewDiscussion(discussion.timecreated)" [class.core-split-item-selected]="discussion.timecreated == -selectedDiscussion">
<ion-note text-end>
<ion-icon name="people"></ion-icon> {{ discussion.groupname }}
</ion-note>
<p><core-format-text [maxHeight]="60" [component]="component" [componentId]="componentId" [text]="discussion.message"></core-format-text></p>
</ion-card-content>
</ion-card>
<ion-card *ngFor="let discussion of discussions" (click)="openDiscussion(discussion)" [class.addon-forum-discussion-selected]="discussion.discussion == selectedDiscussion">
<ion-item text-wrap>
</ion-item>
</ng-container>
<ng-container *ngFor="let discussion of discussions">
<ion-item text-wrap (click)="openDiscussion(discussion)" no-lines [class.core-split-item-selected]="discussion.discussion == selectedDiscussion">
<ion-avatar core-user-avatar [user]="discussion" item-start [courseId]="courseId"></ion-avatar>
<h2>
<core-icon name="fa-map-pin" *ngIf="discussion.pinned"></core-icon>
<core-icon name="fa-star" class="addon-forum-star" *ngIf="!discussion.pinned && discussion.starred"></core-icon>
<core-format-text [text]="discussion.subject"></core-format-text>
</h2>
<p>
<h3>
<ion-note float-end padding-left text-end>
{{discussion.created | coreDateDayOrTime}}
<div *ngIf="discussion.numunread"><core-icon name="fa-circle" color="primary"></core-icon> {{ 'addon.mod_forum.unreadpostsnumber' | translate:{ '$a' : discussion.numunread} }}</div>
</ion-note>
{{discussion.userfullname}}
</p>
</h3>
<p>{{discussion.created | coreDateDayOrTime}}</p>
</ion-item>
<ion-card-content>
<core-format-text [maxHeight]="60" [component]="component" [componentId]="componentId" [text]="discussion.message"></core-format-text>
</ion-card-content>
<ion-row text-center>
<ion-col *ngIf="discussion.groupname">
<ion-note>
<ion-icon name="people"></ion-icon> {{ discussion.groupname }}
</ion-note>
</ion-col>
<ion-col>
<ion-note>
<ion-icon name="chatboxes"></ion-icon> {{ 'addon.mod_forum.numreplies' | translate:{numreplies: discussion.numreplies} }}
</ion-note>
</ion-col>
<ion-col *ngIf="discussion.timemodified > discussion.created">
<ion-note>
<ion-icon name="time"></ion-icon> {{discussion.timemodified | coreTimeAgo}}
</ion-note>
</ion-col>
</ion-row>
</ion-card>
<ion-item (click)="openDiscussion(discussion)" [class.core-split-item-selected]="discussion.discussion == selectedDiscussion">
<ion-row text-center>
<ion-col *ngIf="discussion.groupname">
<ion-note>
<ion-icon name="people"></ion-icon> {{ discussion.groupname }}
</ion-note>
</ion-col>
<ion-col>
<ion-note>
<ion-icon name="chatboxes"></ion-icon> {{ 'addon.mod_forum.numreplies' | translate:{numreplies: discussion.numreplies} }}
</ion-note>
</ion-col>
<ion-col *ngIf="discussion.timemodified > discussion.created">
<ion-note>
<ion-icon name="time"></ion-icon> {{ 'addon.mod_forum.lastpost' | translate }} {{discussion.timemodified | coreTimeAgo}}
</ion-note>
</ion-col>
</ion-row>
</ion-item>
</ng-container>
<core-infinite-loading [enabled]="canLoadMore" (action)="fetchMoreDiscussions($event)" [error]="loadMoreError"></core-infinite-loading>
</ng-container>

View File

@ -1,16 +1,5 @@
ion-app.app-root addon-mod-forum-index {
.addon-forum-discussion-selected {
border-top: 5px solid $core-splitview-selected;
}
.addon-forum-star {
color: $core-star-color;
}
button.core-button-select .core-section-selector-text {
overflow: hidden;
text-overflow: ellipsis;
line-height: 2em;
white-space: nowrap;
}
}

View File

@ -28,6 +28,7 @@
"favouriteupdated": "Your star option has been updated.",
"forumnodiscussionsyet": "There are no discussions yet in this forum.",
"group": "Group",
"lastpost": "Last post",
"lockdiscussion": "Lock this discussion",
"lockupdated": "The lock option has been updated.",
"message": "Message",

View File

@ -503,6 +503,13 @@ ion-app.app-root {
}
}
button.core-button-select .core-button-select-text {
overflow: hidden;
text-overflow: ellipsis;
line-height: 2em;
white-space: nowrap;
}
// File uploader.
// -------------------------
.core-fileuploader-file-handler {

View File

@ -579,6 +579,7 @@
"addon.mod_forum.favouriteupdated": "Your star option has been updated.",
"addon.mod_forum.forumnodiscussionsyet": "There are no discussions yet in this forum.",
"addon.mod_forum.group": "Group",
"addon.mod_forum.lastpost": "Last post",
"addon.mod_forum.lockdiscussion": "Lock this discussion",
"addon.mod_forum.lockupdated": "The lock option has been updated.",
"addon.mod_forum.message": "Message",

View File

@ -14,7 +14,7 @@
<div text-wrap *ngIf="displaySectionSelector && sections && sections.length" padding class="clearfix" ion-row justify-content-between class="safe-padding-horizontal" [class.core-section-download]="downloadEnabled">
<button float-start ion-button icon-start icon-end (click)="showSectionSelector($event)" color="light" class="core-button-select button-no-uppercase" ion-col [attr.aria-label]="('core.course.sections' | translate) + ': ' + (selectedSection && (selectedSection.formattedName || selectedSection.name))" aria-haspopup="true" [attr.aria-expanded]="sectionSelectorExpanded" aria-controls="core-course-section-selector" id="core-course-section-button">
<core-icon name="fa-folder"></core-icon>
<span class="core-section-selector-text">{{selectedSection && (selectedSection.formattedName || selectedSection.name) || 'core.course.sections' | translate }}</span>
<span class="core-button-select-text">{{selectedSection && (selectedSection.formattedName || selectedSection.name) || 'core.course.sections' | translate }}</span>
<ion-icon name="arrow-dropdown" ios="md-arrow-dropdown"></ion-icon>
</button>
<!-- Section download. -->

View File

@ -6,13 +6,6 @@ ion-app.app-root ion-badge.core-course-download-section-progress {
ion-app.app-root core-course-format {
button.core-button-select .core-section-selector-text {
overflow: hidden;
text-overflow: ellipsis;
line-height: 2em;
white-space: nowrap;
}
.core-format-progress-list {
margin-bottom: 0;