Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/08/15 14:10:49 (9 years ago)
Author:
ascheibe
Message:

#2413 merged r12583 and r12666 into stable

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Services.WebApp.Status/3.3/WebApp/history/history.cshtml

    r12563 r12685  
    2424            <label for="fromDate">To:&nbsp;</label>
    2525            <div class="input-group">
    26                 <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" />
     26                <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"/>
    2727                <span class="input-group-btn">
    2828                    <button type="button" class="btn btn-default" ng-click="openToDateSelection($event)"><i class="glyphicon glyphicon-calendar"></i></button>
    2929                </span>
     30            </div>
     31        </div>
     32        <div class="form-group" style="margin-left: 5px; margin-right: 5px;">
     33            <div class="btn-group" dropdown dropdown-append-to-body>
     34                <button type="button" class="btn btn-default dropdown-toggle" dropdown-toggle style="width: 130px; text-align: left;">
     35                    <span class="text-left" style="display: inline-block; width: 85px;">{{curQuickSelection.name}}</span>
     36                    <span class="glyphicon glyphicon-chevron-down" style="margin-top: 3px;"></span>
     37                </button>
     38                <ul class="dropdown-menu" role="menu">
     39                    <li ng-repeat="quickSelection in quickSelectionList">
     40                        <a ng-click="changeQuickSelection(quickSelection)">{{quickSelection.name}}</a>
     41                    </li>
     42                </ul>
    3043            </div>
    3144        </div>
  • stable/HeuristicLab.Services.WebApp.Status/3.3/WebApp/history/historyCtrl.js

    r12563 r12685  
    4747            $scope.toIsOpen = false;
    4848
     49            $scope.quickSelectionList = [
     50                { id: 0, name: 'Custom' },
     51                { id: 1, name: 'Today' },
     52                { id: 2, name: 'Yesterday' },
     53                { id: 3, name: 'Last 7 Days' },
     54                { id: 4, name: 'Last 30 Days' }
     55            ];
     56            $scope.changeQuickSelection = function (quickSelection) {
     57                var today = new Date();
     58                var oneDayInMs = 24 * 60 * 60 * 1000;
     59                switch (quickSelection.id) {
     60                    case 1:
     61                        $scope.fromDate = new Date(today.valueOf());
     62                        $scope.toDate = new Date(today.valueOf());
     63                        break;
     64                    case 2:
     65                        $scope.fromDate = new Date(today.valueOf() - oneDayInMs);
     66                        $scope.toDate = new Date(today.valueOf() - oneDayInMs);
     67                        break;
     68                    case 3:
     69                        $scope.fromDate = new Date(today.valueOf() - (7 * oneDayInMs));
     70                        $scope.toDate = new Date(today.valueOf());
     71                        break;
     72                    case 4:
     73                        $scope.fromDate = new Date(today.valueOf() - (30 * oneDayInMs));
     74                        $scope.toDate = new Date(today.valueOf());
     75                        break;
     76                }
     77                $scope.curQuickSelection = quickSelection;
     78            };
     79            // set default 'today'
     80            $scope.changeQuickSelection($scope.quickSelectionList[1]);
     81
    4982            $scope.openFromDateSelection = function ($event) {
    5083                $event.preventDefault();
     
    5285                $scope.toIsOpen = false;
    5386                $scope.fromIsOpen = true;
     87                $scope.curQuickSelection = $scope.quickSelectionList[0];
    5488            };
    5589
     
    5993                $scope.fromIsOpen = false;
    6094                $scope.toIsOpen = true;
     95                $scope.curQuickSelection = $scope.quickSelectionList[0];
    6196            };
    6297
Note: See TracChangeset for help on using the changeset viewer.