This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit 51cb31a31b0b2e2a16d24241c0402df0f895899a Author: Yannick Martel <martel@©odelutin.com> Date: Mon Dec 7 14:55:22 2015 +0100 refs-90 #6742 #7775 Add 2 last closed projects in connected users home page list --- .../src/main/webapp/js/coselmar-controllers.js | 10 +++++++ coselmar-ui/src/main/webapp/views/home.html | 32 ++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index df83aa7..4af43f9 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -117,6 +117,8 @@ coselmarControllers.controller("unauthorizedCtrl", ['$scope', '$location', funct // Controller for home when user connected, load 5 last projects coselmarControllers.controller("homeConnectedCtrl", ['$scope', 'questionsService', function ($scope, questionsService) { + $scope.closedQuestions = []; + if ($scope.context && $scope.context.currentUser) { var searchOptions = {'status' : 'IN_PROGRESS', 'limit' : 5, 'page' : 0}; @@ -126,6 +128,14 @@ coselmarControllers.controller("homeConnectedCtrl", ['$scope', 'questionsService }, function(fail) { $scope.questions = []; }); + + var closedSearchOptions = {'status' : 'CLOSED', 'limit' : 2, 'page' : 0}; + + questionsService.getQuestions(closedSearchOptions, function(questions) { + $scope.closedQuestions = questions; + }, function(fail) { + $scope.closedQuestions = []; + }); } else { questionsService.getPublicQuestions(function(questions) { diff --git a/coselmar-ui/src/main/webapp/views/home.html b/coselmar-ui/src/main/webapp/views/home.html index e5660ec..f11dc65 100644 --- a/coselmar-ui/src/main/webapp/views/home.html +++ b/coselmar-ui/src/main/webapp/views/home.html @@ -74,6 +74,38 @@ <td ng-if="!question.relatedDocuments && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">0</td> </tr> + <tr ng-repeat="question in closedQuestions" > + <td ng-if="context.currentUser && context.currentUser.role != 'MEMBER'"> + <span class="status-{{question.status|lowercase}}" title="{{question.status | translate}}"></span> + <a href="#/questions/{{question.id}}" class="paddingLeft10" tooltip-placement="bottom" tooltip-html-unsafe="{{question.summary}}">{{question.title}}</a> + </td> + <td ng-if="!context.currentUSer || context.currentUser.role == 'MEMBER'">{{question.title}}</td> + + <td>{{question.submissionDate | date:'mediumDate'}}</td> + + <td><span ng-repeat="theme in question.themes">{{theme}}, </span></td> + + <td>{{question.deadline | date:'mediumDate'}}</td> + + <!-- clients : we use ng-if for better tooltip management --> + <td ng-if="question.clients && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'"> + <span tooltip-placement="bottom" tooltip-html-unsafe="{{getUserNames(question.clients)}}" >{{question.clients.length}}</span> + </td> + <td ng-if="!question.clients && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">0</td> + + <!-- participants --> + <td ng-if="question.participants && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'"> + <span tooltip-placement="bottom" tooltip-html-unsafe="{{getUserNames(question.participants)}}" >{{question.participants.length}}</span> + </td> + <td ng-if="!question.participants && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">0</td> + + <!-- related documents --> + <td ng-if="question.relatedDocuments && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'"> + <span tooltip-placement="bottom" tooltip-html-unsafe="{{getDocumentTitles(question.relatedDocuments)}}" tooltip-trigger="mouseenter" >{{question.relatedDocuments.length}}</span> + </td> + <td ng-if="!question.relatedDocuments && context.currentUser.role != 'MEMBER' && context.currentUser.role != 'CLIENT'">0</td> + + </tr> </tbody> </table> <p ng-if="questions && questions.length == 0" translate="common.search.noResult" class="info"/> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.