feat(forums): load forum desc with markdown support

This commit is contained in:
OldHawk
2017-07-04 11:51:02 +08:00
parent 6bb9e22399
commit 061bc8a5f0
3 changed files with 20 additions and 2 deletions

View File

@@ -69,5 +69,17 @@
NotifycationService.showErrorNotify(res.data.message, 'FORUMS.ADD_FAILED');
});
};
/**
* getForumDesc
* @param f
* @returns {*}
*/
vm.getForumDesc = function (f) {
if (f) {
return marked(f.desc, {sanitize: true});
}
};
}
}());

View File

@@ -23,3 +23,9 @@
max-height: 300px;
}
}
.forum-list {
.forum-desc {
word-break: break-all;
}
}

View File

@@ -1,5 +1,5 @@
<section class="container padding-top-10" ng-controller="ForumsController as vm" ng-init="vm.init();">
<div class="row margin-top-20">
<div class="row margin-top-20 forum-list">
<div class="col-md-10 col-md-offset-1">
<button class="btn btn-success" ng-click="vm.openSideOverlay($event)">  {{ 'FORUMS.BTN_ADD_FORUM' | translate }}  </button>
</div>
@@ -24,7 +24,7 @@
<td scope="row">
<h4>{{f.name}} <span class="badge badge_mt" ng-show="f.readOnly">R</span></h4>
<p>{{f.desc}}</p>
<p class="forum-desc" ng-bind-html="vm.getForumDesc(f);"></p>
</td>
<td class="text-center">{{f.order}}</td>
<td class="text-center"></td>