diff options
author | raimund-schluessler <raimund.schluessler@googlemail.com> | 2014-07-21 23:18:39 +0400 |
---|---|---|
committer | raimund-schluessler <raimund.schluessler@googlemail.com> | 2014-07-21 23:18:39 +0400 |
commit | 471c86fed24eec2dbe3544236a7676ed7619c8e7 (patch) | |
tree | 8fbeefbb6b95ebc68b281ca7e9b2d8f5115f82cc | |
parent | a1c8892afaf450c1b01a47e52de25330306bcce7 (diff) |
Use displayname instead of userID
-rw-r--r-- | js/app/controllers/detailscontroller.coffee | 1 | ||||
-rw-r--r-- | js/app/directives/avatar.coffee | 3 | ||||
-rw-r--r-- | js/public/app.js | 7 | ||||
-rw-r--r-- | lib/controller/taskscontroller.php | 1 | ||||
-rw-r--r-- | lib/helper.php | 1 | ||||
-rw-r--r-- | templates/part.details.php | 2 |
6 files changed, 11 insertions, 4 deletions
diff --git a/js/app/controllers/detailscontroller.coffee b/js/app/controllers/detailscontroller.coffee index c80f00b7..1960c04d 100644 --- a/js/app/controllers/detailscontroller.coffee +++ b/js/app/controllers/detailscontroller.coffee @@ -298,6 +298,7 @@ $timeout, $routeParams, SettingsModel) -> comment: CommentContent taskID: _$scope.route.taskID time: moment().format('YYYYMMDDTHHmmss') + name: $('#expandDisplayName').text() } _tasksbusinesslayer.addComment comment diff --git a/js/app/directives/avatar.coffee b/js/app/directives/avatar.coffee index b3d64445..494bcd03 100644 --- a/js/app/directives/avatar.coffee +++ b/js/app/directives/avatar.coffee @@ -24,5 +24,6 @@ angular.module('Tasks').directive 'avatar', -> scope: false link: (scope, elm, attr) -> attr.$observe('userID', () -> - elm.avatar(attr.userid,attr.size) + if(attr.userid) + elm.avatar(attr.userid,attr.size) )
\ No newline at end of file diff --git a/js/public/app.js b/js/public/app.js index 4162fc2d..96a8b759 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -150,7 +150,9 @@ scope: false, link: function(scope, elm, attr) { return attr.$observe('userID', function() { - return elm.avatar(attr.userid, attr.size); + if (attr.userid) { + return elm.avatar(attr.userid, attr.size); + } }); } }; @@ -687,7 +689,8 @@ tmpID: 'newComment' + Date.now(), comment: CommentContent, taskID: _$scope.route.taskID, - time: moment().format('YYYYMMDDTHHmmss') + time: moment().format('YYYYMMDDTHHmmss'), + name: $('#expandDisplayName').text() }; _tasksbusinesslayer.addComment(comment, function(data) { _$tasksmodel.updateComment(data.comment); diff --git a/lib/controller/taskscontroller.php b/lib/controller/taskscontroller.php index 04448d26..e18f7811 100644 --- a/lib/controller/taskscontroller.php +++ b/lib/controller/taskscontroller.php @@ -512,6 +512,7 @@ class TasksController extends Controller { 'taskID' => $taskId, 'id' => $commentId, 'tmpID' => $this->params('tmpID'), + 'name' => \OCP\USER::getDisplayName(), 'userID' => $userId, 'comment' => $comment, 'time' => $now->format('Ymd\THis') diff --git a/lib/helper.php b/lib/helper.php index ca7c8bcb..94ab287a 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -179,6 +179,7 @@ Class helper { $comments_parsed[] = array( 'id' => (int)$com['ID']->value, 'userID' => $com['USERID']->value, + 'name' => \OCP\USER::getDisplayName($com['USERID']->value), 'comment' => $com->value, 'time' => $time ); diff --git a/templates/part.details.php b/templates/part.details.php index fa73bd2b..6ae5654c 100644 --- a/templates/part.details.php +++ b/templates/part.details.php @@ -112,7 +112,7 @@ <a class="detail-delete" ng-click="deleteComment(comment.id)" stop-event="click"> <span class="icon detail-delete"></span> </a> - <span class="username">{{ comment.userID }}</span> + <span class="username">{{ comment.name }}</span> <div class="comment">{{ comment.comment }}</div> <span class="time"> {{ comment.time}} </span> </li> |