Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/20/15 13:49:39 (9 years ago)
Author:
dglaser
Message:

#2388:

HeuristicLab.Services.WebApp.Statistics-3.3:

  • Added QuickSelection button to the client and group pag

HeuristicLab.Services.WebApp-3.3:
HeuristicLab.Services.WebApp.Statistics-3.3:

  • Changed 'User Name' to 'Username' to be consistent throughout the whole WebApp
Location:
branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApp/clients/details
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApp/clients/details/clientDetails.cshtml

    r12768 r12778  
    195195            <label for="fromDate">To:&nbsp;</label>
    196196            <div class="input-group">
    197                 <input id="fromDate" type="text" class="form-control" datepicker-popup="dd.MM.yyyy" ng-model="toDate" is-open="toIsOpen" datepicker-options="dateOptions" ng-required="true" close-text="Close" />
     197                <input id="fromDate" type="text" class="form-control" datepicker-popup="dd.MM.yyyy" ng-model="toDate" is-open="toIsOpen" datepicker-options="dateOptions" ng-required="true" close-text="Close"/>
    198198                <span class="input-group-btn">
    199199                    <button type="button" class="btn btn-default" ng-click="openToDateSelection($event)"><i class="glyphicon glyphicon-calendar"></i></button>
    200200                </span>
     201            </div>
     202        </div>
     203        <div class="form-group" style="margin-left: 5px; margin-right: 5px;">
     204            <div class="btn-group" dropdown dropdown-append-to-body>
     205                <button type="button" class="btn btn-default dropdown-toggle" dropdown-toggle style="width: 130px; text-align: left;">
     206                    <span class="text-left" style="display: inline-block; width: 85px;">{{curQuickSelection.name}}</span>
     207                    <span class="glyphicon glyphicon-chevron-down" style="margin-top: 3px;"></span>
     208                </button>
     209                <ul class="dropdown-menu" role="menu">
     210                    <li ng-repeat="quickSelection in quickSelectionList">
     211                        <a class="cursor-pointer" ng-click="changeQuickSelection(quickSelection)">{{quickSelection.name}}</a>
     212                    </li>
     213                </ul>
    201214            </div>
    202215        </div>
  • branches/HiveStatistics/sources/HeuristicLab.Services.WebApp.Statistics/3.3/WebApp/clients/details/clientDetailsCtrl.js

    r12584 r12778  
    171171            $scope.toIsOpen = false;
    172172
     173            $scope.quickSelectionList = [
     174                { id: 0, name: 'Custom' },
     175                { id: 1, name: 'Today' },
     176                { id: 2, name: 'Yesterday' },
     177                { id: 3, name: 'Last 7 Days' },
     178                { id: 4, name: 'Last 30 Days' }
     179            ];
     180            $scope.changeQuickSelection = function (quickSelection) {
     181                var today = new Date();
     182                var oneDayInMs = 24 * 60 * 60 * 1000;
     183                switch (quickSelection.id) {
     184                    case 1:
     185                        $scope.fromDate = new Date(today.valueOf());
     186                        $scope.toDate = new Date(today.valueOf());
     187                        break;
     188                    case 2:
     189                        $scope.fromDate = new Date(today.valueOf() - oneDayInMs);
     190                        $scope.toDate = new Date(today.valueOf() - oneDayInMs);
     191                        break;
     192                    case 3:
     193                        $scope.fromDate = new Date(today.valueOf() - (7 * oneDayInMs));
     194                        $scope.toDate = new Date(today.valueOf());
     195                        break;
     196                    case 4:
     197                        $scope.fromDate = new Date(today.valueOf() - (30 * oneDayInMs));
     198                        $scope.toDate = new Date(today.valueOf());
     199                        break;
     200                }
     201                $scope.curQuickSelection = quickSelection;
     202            };
     203            // set default 'today'
     204            $scope.changeQuickSelection($scope.quickSelectionList[1]);
     205
    173206            $scope.openFromDateSelection = function ($event) {
    174207                $event.preventDefault();
     
    176209                $scope.toIsOpen = false;
    177210                $scope.fromIsOpen = true;
     211                $scope.curQuickSelection = $scope.quickSelectionList[0];
    178212            };
    179213
     
    183217                $scope.fromIsOpen = false;
    184218                $scope.toIsOpen = true;
     219                $scope.curQuickSelection = $scope.quickSelectionList[0];
    185220            };
    186221
Note: See TracChangeset for help on using the changeset viewer.