From 57b461e0ffc3ec3ef877e3cee7611f85c992a62c Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Fri, 18 Jul 2014 10:43:32 +0100 Subject: [PATCH] added little icons to the table for when you want to sort --- .../web/app/views/project/list/project-list.jade | 15 +++++++++------ .../web/public/coffee/main/project-list.coffee | 8 ++++++++ .../web/public/stylesheets/app/project-list.less | 3 +++ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/services/web/app/views/project/list/project-list.jade b/services/web/app/views/project/list/project-list.jade index 05489defb9..05fa427b22 100644 --- a/services/web/app/views/project/list/project-list.jade +++ b/services/web/app/views/project/list/project-list.jade @@ -117,16 +117,19 @@ ) li.container-fluid .row - .col-md-6 + .col-md-6(ng-click="changePredicate('name')") input.select-all( select-all, type="checkbox" ) - span.header(ng-click="changePredicate('name')") Title - .col-md-2 - span.header(ng-click="changePredicate('accessLevel')") Owner - .col-md-4 - span.header(ng-click="changePredicate('lastUpdated')") Last Modified + span.header Title + i.tablesort.fa(ng-class="getSortIconClass('name')") + .col-md-2(ng-click="changePredicate('accessLevel')") + span.header Owner + i.tablesort.fa(ng-class="getSortIconClass('accessLevel')") + .col-md-4(ng-click="changePredicate('lastUpdated')") + span.header Last Modified + i.tablesort.fa(ng-class="getSortIconClass('lastUpdated')") li.project_entry.container-fluid( ng-repeat="project in visibleProjects | orderBy:predicate:reverse", ng-controller="ProjectListItemController" diff --git a/services/web/public/coffee/main/project-list.coffee b/services/web/public/coffee/main/project-list.coffee index 8035bc9054..d64f2bbcde 100644 --- a/services/web/public/coffee/main/project-list.coffee +++ b/services/web/public/coffee/main/project-list.coffee @@ -82,6 +82,14 @@ define [ $scope.reverse = !$scope.reverse $scope.predicate = newPredicate + $scope.getSortIconClass = (column)-> + if column == $scope.predicate and $scope.reverse + return "fa-sort-down" + else if column == $scope.predicate and !$scope.reverse + return "fa-sort-up" + else + return "fa-sort" + $scope.clearSearchText = () -> $scope.searchText = "" $scope.$emit "search:clear" diff --git a/services/web/public/stylesheets/app/project-list.less b/services/web/public/stylesheets/app/project-list.less index e6456f0c00..6d49493825 100644 --- a/services/web/public/stylesheets/app/project-list.less +++ b/services/web/public/stylesheets/app/project-list.less @@ -148,6 +148,9 @@ ul.project-list { color: white; } } + i.tablesort { + padding-left: 8px; + } } #institution_auto_complete {