Merge pull request #175 from alberanid/master

fixes #174 and #78: new date and time pickers
This commit is contained in:
Davide Alberani 2017-04-04 22:00:17 +02:00 committed by GitHub
commit 4e69fa7b75
5 changed files with 26 additions and 23 deletions

View file

@ -44,33 +44,33 @@
<div class="input-group top5 well form-horizontal" ng-controller="DatetimePickerCtrl">
<div class="form-group">
<label for="begin-date" class="col-sm-6 control-label">{{'begin date:' | translate}}</label>
<label for="begin-date" class="col-sm-3 control-label">{{'begin date:' | translate}}</label>
<div id="begin-date" class="input-group col-sm-6">
<input type="text" class="form-control" datepicker-popup="dd-MMMM-yyyy" ng-model="event.begin_date" is-open="opened" />
<input type="text" class="form-control" uib-datepicker-popup="dd-MMMM-yyyy" ng-model="event.begin_date" is-open="opened" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="open($event)"><i class="fa fa-calendar"></i></button>
<button type="button" class="btn btn-default" ng-click="open()"><i class="fa fa-calendar"></i></button>
</span>
</div>
</div>
<div class="form-group">
<label for="begin-time" class="col-sm-6 control-label">{{'begin time:' | translate}}</label>
<timepicker id="begin-time" class="input-group" ng-model="event.begin_time" show-meridian="false"></timepicker>
<label for="begin-time" class="col-sm-3 control-label">{{'begin time:' | translate}}</label>
<div uib-timepicker id="begin-time" class="input-group" ng-model="event.begin_time" show-meridian="false"></div>
</div>
</div>
<div class="input-group top5 well form-horizontal" ng-controller="DatetimePickerCtrl">
<div class="form-group">
<label for="end-date" class="col-sm-6 control-label">{{'end date:' | translate}}</label>
<label for="end-date" class="col-sm-3 control-label">{{'end date:' | translate}}</label>
<div id="end-date" class="input-group col-sm-6">
<input type="text" class="form-control" datepicker-popup="dd-MMMM-yyyy" ng-model="event.end_date" is-open="opened" />
<input type="text" class="form-control" uib-datepicker-popup="dd-MMMM-yyyy" ng-model="event.end_date" is-open="opened" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="open($event)"><i class="fa fa-calendar"></i></button>
<button type="button" class="btn btn-default" ng-click="open()"><i class="fa fa-calendar"></i></button>
</span>
</div>
</div>
<div class="form-group">
<label for="end-time" class="col-sm-6 control-label">{{'end time:' | translate}}</label>
<timepicker id="end-time" class="input-group" ng-model="event.end_time" show-meridian="false"></timepicker>
<label for="end-time" class="col-sm-3 control-label">{{'end time:' | translate}}</label>
<div uib-timepicker id="end-time" class="input-group" ng-model="event.end_time" show-meridian="false"></div>
</div>
</div>
@ -85,7 +85,7 @@
<div class="panel panel-default table-striped top30">
<div class="panel-heading">
<h3>{{'Ticket limits'}}</h3>
<h3>{{'Ticket limits' | translate}}</h3>
</div>
<div class="panel-body">
<div class="input-group input-group top5">
@ -97,15 +97,15 @@
<div class="form-group">
<label for="sales-begin-date" class="col-sm-6 control-label">{{'ticket sales begin date:' | translate}}</label>
<div id="sales-begin-date" class="input-group col-sm-6">
<input type="text" class="form-control" datepicker-popup="dd-MMMM-yyyy" ng-model="event.ticket_sales_begin_date" is-open="opened" />
<input type="text" class="form-control" uib-datepicker-popup="dd-MMMM-yyyy" ng-model="event.ticket_sales_begin_date" is-open="opened" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="open($event)"><i class="fa fa-calendar"></i></button>
<button type="button" class="btn btn-default" ng-click="open()"><i class="fa fa-calendar"></i></button>
</span>
</div>
</div>
<div class="form-group">
<label for="sales-begin-time" class="col-sm-6 control-label">{{'ticket sales begin time:' | translate}}</label>
<timepicker id="sales-begin-time" class="input-group" ng-model="event.ticket_sales_begin_time" show-meridian="false"></timepicker>
<div uib-timepicker id="sales-begin-time" class="input-group" ng-model="event.ticket_sales_begin_time" show-meridian="false"></div>
</div>
</div>
@ -113,15 +113,15 @@
<div class="form-group">
<label for="sales-end-date" class="col-sm-6 control-label">{{'ticket sales end date:' | translate}}</label>
<div id="sales-end-date" class="input-group col-sm-6">
<input type="text" class="form-control" datepicker-popup="dd-MMMM-yyyy" ng-model="event.ticket_sales_end_date" is-open="opened" />
<input type="text" class="form-control" uib-datepicker-popup="dd-MMMM-yyyy" ng-model="event.ticket_sales_end_date" is-open="opened" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="open($event)"><i class="fa fa-calendar"></i></button>
<button type="button" class="btn btn-default" ng-click="open()"><i class="fa fa-calendar"></i></button>
</span>
</div>
</div>
<div class="form-group">
<label for="sales-end-time" class="col-sm-6 control-label">{{'ticket sales end time:' | translate}}</label>
<timepicker id="sales-end-time" class="input-group" ng-model="event.ticket_sales_end_time" show-meridian="false"></timepicker>
<div uib-timepicker id="sales-end-time" class="input-group" ng-model="event.ticket_sales_end_time" show-meridian="false"></div>
</div>
</div>
</div>

View file

@ -50,7 +50,7 @@
<div ng-if="event.begin_date || event.end_date || event.where" class="top5">
<div ng-if="event.where">{{event.where}}</div>
<span ng-if="event.begin_date">{{'Begins:' | translate}} {{event.begin_date | date:'fullDate'}} {{event.begin_time | date:'HH:mm'}}<br/></span>
<span ng-if="event.end_date">{{'Ends:' | translate}} {{event.end_date | date:'fullDate' }} {{event.end_time | date:'HH:mm'}}</span>
<span ng-if="event.end_date">{{'Ends:' | translate}} {{event.end_date | date:'fullDate'}} {{event.end_time | date:'HH:mm'}}</span>
</div>
</td>
<td ng-if="hasPermission('event:tickets-all|read')" class="hcenter">

View file

@ -41,9 +41,7 @@ eventManControllers.controller('NavigationCtrl', ['$scope', '$rootScope', '$loca
/* Controller for a group of date and time pickers. */
eventManControllers.controller('DatetimePickerCtrl', ['$scope',
function ($scope) {
$scope.open = function($event) {
$event.preventDefault();
$event.stopPropagation();
$scope.open = function() {
$scope.opened = true;
};
}]

View file

@ -57,7 +57,12 @@ eventManServices.factory('Event', ['$resource', '$rootScope',
update: {
method: 'PUT',
interceptor : {responseError: $rootScope.errorHandler}
interceptor : {responseError: $rootScope.errorHandler},
transformResponse: function(data, headers) {
data = angular.fromJson(data);
convert_dates(data);
return data;
}
},
group_persons: {

View file

@ -39,7 +39,7 @@
</eda-easy-form-viewer>
<div ng-if="ticket._id">
<div ng-controller="NavigationCtrl">
<span><strong>{{'Save this URL if you want to modify your order later:'}} <a ng-href="{{getLocation()}}">{{getLocation()}}</a></strong></span>
<span><strong>{{'Save this URL if you want to modify your order later:' | translate}} <a ng-href="{{getLocation()}}">{{getLocation()}}</a></strong></span>
</div>
</div>
</div>