Commit 800e255949a10b0656b308d7966e3610a84e586c
Committed by
Michel Felipe

1 parent
4840baa9
Exists in
master
and in
26 other branches
Limit comments identation and display replied comment in tooltip
Showing
4 changed files
with
28 additions
and
5 deletions
Show diff stats
src/app/article/comment/comment.component.ts
... | ... | @@ -9,6 +9,8 @@ export class CommentComponent { |
9 | 9 | |
10 | 10 | @Input() comment: noosfero.CommentViewModel; |
11 | 11 | @Input() article: noosfero.Article; |
12 | + @Input() displayActions = true; | |
13 | + @Input() displayReplies = true; | |
12 | 14 | |
13 | 15 | showReply() { |
14 | 16 | return this.comment && this.comment.__show_reply === true; | ... | ... |
src/app/article/comment/comment.html
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | <a class="pull-left" ui-sref="main.profile.home({profile: ctrl.comment.author.identifier})"> |
10 | 10 | <h4 class="media-heading">{{ctrl.comment.author.name}}</h4> |
11 | 11 | </a> |
12 | - <span class="reply-of" ng-if="ctrl.comment.reply_of"> | |
12 | + <span class="reply-of" ng-if="ctrl.comment.reply_of" uib-tooltip-template="'app/article/comment/comment-reply-tooltip.html'"> | |
13 | 13 | <i class="fa fa-fw fa-mail-forward"></i> |
14 | 14 | <span class="author">{{ctrl.comment.reply_of.author.name}}</span> |
15 | 15 | </span> |
... | ... | @@ -17,9 +17,11 @@ |
17 | 17 | </div> |
18 | 18 | <div class="title">{{ctrl.comment.title}}</div> |
19 | 19 | <div class="body">{{ctrl.comment.body}}</div> |
20 | - <a href="#" (click)="ctrl.reply()" class="small text-muted"> | |
21 | - {{"comment.reply" | translate}} | |
22 | - </a> | |
20 | + <div class="actions" ng-if="ctrl.displayActions"> | |
21 | + <a href="#" (click)="ctrl.reply()" class="small text-muted"> | |
22 | + {{"comment.reply" | translate}} | |
23 | + </a> | |
24 | + </div> | |
23 | 25 | </div> |
24 | - <noosfero-comments [show-form]="ctrl.showReply()" [article]="ctrl.article" [parent]="ctrl.comment"></noosfero-comments> | |
26 | + <noosfero-comments [show-form]="ctrl.showReply" [article]="ctrl.article" [parent]="ctrl.comment" ng-if="ctrl.displayReplies"></noosfero-comments> | |
25 | 27 | </div> | ... | ... |
src/app/article/comment/comment.scss
... | ... | @@ -39,8 +39,24 @@ |
39 | 39 | font-size: 1.7em; |
40 | 40 | } |
41 | 41 | } |
42 | + // Limit identation of replies | |
42 | 43 | .comments { |
43 | 44 | margin-left: 30px; |
45 | + .comments .comments { | |
46 | + margin-left: 0px; | |
47 | + .comment { | |
48 | + margin-left: 0px; | |
49 | + } | |
50 | + } | |
51 | + } | |
52 | + .tooltip-inner { | |
53 | + max-width: 350px; | |
54 | + text-align: left; | |
55 | + .reply-tooltip { | |
56 | + .comment { | |
57 | + margin: 5px; | |
58 | + } | |
59 | + } | |
44 | 60 | } |
45 | 61 | } |
46 | 62 | } | ... | ... |