2018-05-14 10:18:21 +02:00
<!-- Buttons to add to the header. -->
< core-navbar-buttons end >
< core-context-menu >
< core-context-menu-item * ngIf = "externalUrl" [ priority ] = " 900 " [ content ] = " ' core . openinbrowser ' | translate " [ href ] = " externalUrl " [ iconAction ] = " ' open ' " > < / core-context-menu-item >
< core-context-menu-item * ngIf = "description" [ priority ] = " 800 " [ content ] = " ' core . moduleintro ' | translate " ( action ) = " expandDescription ( ) " [ iconAction ] = " ' arrow-forward ' " > < / core-context-menu-item >
< core-context-menu-item * ngIf = "loaded && !hasOffline && isOnline" [ priority ] = " 700 " [ content ] = " ' addon . mod_forum . refreshdiscussions ' | translate " ( action ) = " doRefresh ( null , $ event ) " [ iconAction ] = " refreshIcon " [ closeOnClick ] = " false " > < / core-context-menu-item >
< core-context-menu-item * ngIf = "loaded && hasOffline && isOnline" [ priority ] = " 600 " [ content ] = " ' core . settings . synchronizenow ' | translate " ( action ) = " doRefresh ( null , $ event , true ) " [ iconAction ] = " syncIcon " [ closeOnClick ] = " false " > < / core-context-menu-item >
< core-context-menu-item * ngIf = "prefetchStatusIcon" [ priority ] = " 500 " [ content ] = " prefetchText " ( action ) = " prefetch ( ) " [ iconAction ] = " prefetchStatusIcon " [ closeOnClick ] = " false " > < / core-context-menu-item >
< core-context-menu-item * ngIf = "size" [ priority ] = " 400 " [ content ] = " size " [ iconDescription ] = " ' cube ' " ( action ) = " removeFiles ( ) " [ iconAction ] = " ' trash ' " > < / core-context-menu-item >
< / core-context-menu >
< / core-navbar-buttons >
<!-- Content. -->
< core-split-view >
2018-06-11 11:00:41 +02:00
< ion-content [ class . has-fab ] = " forum & & forum . cancreatediscussions " >
2018-05-14 10:18:21 +02:00
< ion-refresher [ enabled ] = " loaded " ( ionRefresh ) = " doRefresh ( $ event ) " >
< ion-refresher-content pullingText = "{{ 'core.pulltorefresh' | translate }}" > < / ion-refresher-content >
< / ion-refresher >
< core-loading [ hideUntil ] = " loaded " class = "core-loading-center" >
< core-course-module-description [ description ] = " description " [ component ] = " component " [ componentId ] = " componentId " [ note ] = " descriptionNote " > < / core-course-module-description >
<!-- Forum discussions found to be synchronized -->
< ion-card class = "core-warning-card" icon-start * ngIf = "hasOffline" >
< ion-icon name = "warning" > < / ion-icon > {{ 'core.hasdatatosync' | translate:{$a: moduleName} }}
< / ion-card >
< ng-container * ngIf = "forum && discussions.length > 0" >
< ion-card * ngFor = "let discussion of offlineDiscussions" ( click ) = " openNewDiscussion ( discussion . timecreated ) " [ class . addon-forum-discussion-selected ] = " discussion . timecreated = = -selectedDiscussion " >
< ion-item text-wrap >
< ion-avatar item-start core-user-link [ userId ] = " discussion . userid " [ courseId ] = " courseId " >
< img [ src ] = " discussion . userpictureurl " onError = "this.src='assets/img/user-avatar.png'" core-external-content [ alt ] = " ' core . pictureof ' | translate: { $ a: discussion . userfullname } " role = "presentation" >
< / ion-avatar >
2018-08-23 11:53:51 +02:00
< h2 > < core-format-text [ text ] = " discussion . subject " > < / core-format-text > < / h2 >
2018-05-14 10:18:21 +02:00
< p * ngIf = "discussion.userfullname" >
2018-09-04 12:14:23 +02:00
< ion-note float-end padding-left > < ion-icon name = "time" > < / ion-icon > {{ 'core.notsent' | translate }}< / ion-note >
2018-05-14 10:18:21 +02:00
{{discussion.userfullname}}
< / p >
< / ion-item >
< ion-card-content >
2018-09-04 12:14:23 +02:00
< ion-note text-end * ngIf = "discussion.groupname" >
2018-05-14 10:18:21 +02:00
< ion-icon name = "people" > < / ion-icon > {{ discussion.groupname }}
< / ion-note >
2018-08-22 13:44:39 +02:00
< p > < core-format-text [ maxHeight ] = " 60 " [ component ] = " component " [ componentId ] = " componentId " [ text ] = " discussion . message " > < / core-format-text > < / p >
2018-05-14 10:18:21 +02:00
< / 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-avatar item-start core-user-link [ userId ] = " discussion . userid " [ courseId ] = " courseId " >
2018-05-16 16:10:14 +02:00
< img [ src ] = " discussion . userpictureurl " onError = "this.src='assets/img/user-avatar.png'" core-external-content [ alt ] = " ' core . pictureof ' | translate: { $ a: discussion . userfullname } " role = "presentation" >
2018-05-14 10:18:21 +02:00
< / ion-avatar >
2018-10-16 17:27:24 +02:00
< h2 > < core-icon name = "fa-map-pin" * ngIf = "discussion.pinned" > < / core-icon > < core-format-text [ text ] = " discussion . subject " > < / core-format-text > < / h2 >
2018-05-14 10:18:21 +02:00
< p >
2018-09-04 12:14:23 +02:00
< ion-note float-end padding-left text-end >
2018-05-14 10:18:21 +02:00
{{discussion.created | coreDateDayOrTime}}
2018-09-04 12:14:23 +02:00
< div * ngIf = "discussion.numunread" > < core-icon name = "fa-circle" color = "primary" > < / core-icon > {{ 'addon.mod_forum.unreadpostsnumber' | translate:{ '$a' : discussion.numunread} }}< / div >
2018-05-14 10:18:21 +02:00
< / ion-note >
{{discussion.userfullname}}
< / p >
< / ion-item >
< ion-card-content >
2018-08-22 13:44:39 +02:00
< core-format-text [ maxHeight ] = " 60 " [ component ] = " component " [ componentId ] = " componentId " [ text ] = " discussion . message " > < / core-format-text >
2018-05-14 10:18:21 +02:00
< / 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 >
< / ng-container >
< core-empty-box * ngIf = "forum && discussions.length == 0" icon = "chatbubbles" [ message ] = " ' addon . mod_forum . forumnodiscussionsyet ' | translate " >
< div padding * ngIf = "forum.cancreatediscussions" >
2018-05-16 16:10:14 +02:00
< button ion-button block ( click ) = " openNewDiscussion ( ) " >
2018-05-14 10:18:21 +02:00
{{ 'addon.mod_forum.addanewdiscussion' | translate }}
< / button >
< / div >
< / core-empty-box >
2018-09-19 09:53:12 +02:00
< core-infinite-loading [ enabled ] = " canLoadMore " ( action ) = " fetchMoreDiscussions ( $ event ) " > < / core-infinite-loading >
2018-05-14 10:18:21 +02:00
< / core-loading >
2018-06-11 11:00:41 +02:00
2018-09-04 12:14:23 +02:00
< ion-fab bottom end * ngIf = "forum && forum.cancreatediscussions" >
2018-06-11 11:00:41 +02:00
< button ion-fab ( click ) = " openNewDiscussion ( ) " [ attr . aria-label ] = " addDiscussionText " >
< ion-icon name = "add" > < / ion-icon >
< / button >
< / ion-fab >
2018-05-14 10:18:21 +02:00
< / ion-content >
< / core-split-view >