mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-07 03:14:33 +08:00
#47 Hides the reply button based if comments are 2 levels deep.
This commit is contained in:
@ -745,11 +745,11 @@ module.exports = function (ngApp, events) {
|
|||||||
ngApp.controller('CommentListController', ['$scope', '$http', '$timeout', function ($scope, $http, $timeout) {
|
ngApp.controller('CommentListController', ['$scope', '$http', '$timeout', function ($scope, $http, $timeout) {
|
||||||
let vm = this;
|
let vm = this;
|
||||||
$scope.errors = {};
|
$scope.errors = {};
|
||||||
|
// keep track of comment levels
|
||||||
|
$scope.level = 1;
|
||||||
$scope.defaultAvatar = defaultAvatar;
|
$scope.defaultAvatar = defaultAvatar;
|
||||||
vm.totalCommentsStr = 'Loading...';
|
vm.totalCommentsStr = 'Loading...';
|
||||||
$scope.editorChange = function (content) {
|
|
||||||
console.log(content);
|
|
||||||
}
|
|
||||||
|
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$http.get(window.baseUrl(`/ajax/page/${$scope.pageId}/comments/`)).then(resp => {
|
$http.get(window.baseUrl(`/ajax/page/${$scope.pageId}/comments/`)).then(resp => {
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="comment-actions">
|
<div class="comment-actions">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#" comment-reply-link no-comment-reply-dupe="true" comment="comment" is-reply="true">Reply</a></li>
|
<li ng-if="level < 3"><a href="#" comment-reply-link no-comment-reply-dupe="true" comment="comment" is-reply="true">Reply</a></li>
|
||||||
<li><a href="#" comment-reply-link no-comment-reply-dupe="true" comment="comment">Edit</a></li>
|
<li><a href="#" comment-reply-link no-comment-reply-dupe="true" comment="comment">Edit</a></li>
|
||||||
<li><a href="#">@{{::comment.created_at}}</a></li>
|
<li><a href="#">@{{::comment.created_at}}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
@ -19,7 +19,7 @@
|
|||||||
<a href="#" ng-click="vm.loadSubComments($event, comment, $index)" class="load-more-comments" ng-if="comment.cnt_sub_comments > 0 && !comment.is_loaded">
|
<a href="#" ng-click="vm.loadSubComments($event, comment, $index)" class="load-more-comments" ng-if="comment.cnt_sub_comments > 0 && !comment.is_loaded">
|
||||||
Load @{{::comment.cnt_sub_comments}} more comment(s)
|
Load @{{::comment.cnt_sub_comments}} more comment(s)
|
||||||
</a>
|
</a>
|
||||||
<div class="comment-box" ng-repeat="comment in comments = comment.comments track by comment.id">
|
<div class="comment-box" ng-repeat="comment in comments = comment.comments track by comment.id" ng-init="level = level + 1">
|
||||||
<div ng-include src="'comment-list-item.html'">
|
<div ng-include src="'comment-list-item.html'">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user