Skip to content

Commit

Permalink
Added angular-bootstrap and removed angular-material (still available…
Browse files Browse the repository at this point in the history
… on angular-reservation-material branch). Changed module name to hm.reservation
  • Loading branch information
hmartos committed Mar 27, 2016
1 parent d6db434 commit b5ca68b
Show file tree
Hide file tree
Showing 12 changed files with 140 additions and 41 deletions.
32 changes: 22 additions & 10 deletions dist/angular-reservation.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/angular-reservation.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/angular-reservation.min.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var minCssFile = 'angular-reservation.min.css';
//Generates templates
gulp.task('templates', function () {
return gulp.src('src/templates/*.html')
.pipe(templateCache(jsFile, {module: 'angular.reservation'}))
.pipe(templateCache(jsFile, {module: 'hm.reservation'}))
.pipe(gulp.dest(dist));
});

Expand All @@ -41,5 +41,10 @@ gulp.task('minify-css', function() {
.pipe(gulp.dest(dist));
});

//Configure watch to execute build task on source changes
gulp.task('watch', function() {
gulp.watch('src/**', ['build']);
});

gulp.task('default', ['concat-js', 'concat-uglify-js', 'minify-css']);
gulp.task('build', ['default']);
23 changes: 5 additions & 18 deletions src/css/style.css
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
/* TABS */
.tabs md-content {
background-color: transparent !important;
}
/*UI Bootstap fix @see https://angular-ui.github.io/bootstrap/#/getting_started */
.nav, .pagination, .carousel, .panel-title a { cursor: pointer; }

.tabs md-content md-tabs {
background: #f6f6f6;
border: 1px solid #e1e1e1;
min-height: 400px;
max-height: 500px !important;
max-width: 340px;
}

.tabs md-content md-tabs md-tabs-wrapper {
background: white;
}

.tabs md-content h1:first-child {
margin-top: 0;
.selected {
color: #fff !important;
background-color: #5cb85c;
}
2 changes: 1 addition & 1 deletion src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
*/
(function() {
//Module definition with dependencies
angular.module('angular.reservation', ['ngMaterial', 'pascalprecht.translate']);
angular.module('hm.reservation', ['ui.bootstrap', 'pascalprecht.translate']);

})();
2 changes: 1 addition & 1 deletion src/js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @author hmartos
*/
(function() {
angular.module('angular.reservation').provider('reservationConfig', [reservationConfigProvider]);
angular.module('hm.reservation').provider('reservationConfig', [reservationConfigProvider]);

function reservationConfigProvider() {

Expand Down
14 changes: 10 additions & 4 deletions src/js/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
*/
(function () {
//Controller
angular.module('angular.reservation').controller('ReservationCtrl', ['$filter', '$mdDialog', 'reservationAPIFactory', reservationCtrl]);
angular.module('hm.reservation').controller('ReservationCtrl', ['$filter', 'reservationAPIFactory', reservationCtrl]);

function reservationCtrl($filter, $mdDialog, reservationAPIFactory) {
function reservationCtrl($filter, reservationAPIFactory) {
//Capture the this context of the Controller using vm, standing for procedureModel
var vm = this;

Expand All @@ -22,6 +22,12 @@

vm.showLoader = false;

//Calendar options
vm.calendarOptions = {
minDate: new Date(),
showWeeks: false
};


//METHODS
vm.onSelectDate = function() {
Expand All @@ -38,7 +44,7 @@
}

vm.showConfirm = function(event) {
var confirm = $mdDialog.confirm()
/*var confirm = $mdDialog.confirm()
.title($filter('translate')('confirmTitle'))
.textContent($filter('translate')('confirmText', {name: vm.userData.name, selectedDate: $filter('date')(vm.selectedDate, 'dd/MM/yyyy'), selectedHour:vm.selectedHour}))
.ariaLabel($filter('translate')('confirmTitle'))
Expand All @@ -53,7 +59,7 @@
}, function() {
//Cancel handler
console.log("Reservation cancelled");
});
});*/
}


Expand Down
2 changes: 1 addition & 1 deletion src/js/directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
(function() {
//Directive
angular.module('angular.reservation').directive('reservation', ['$document', '$compile', function($document, $compile) {
angular.module('hm.reservation').directive('reservation', [function() {
return {
restrict: 'E',
controller: 'ReservationCtrl',
Expand Down
2 changes: 1 addition & 1 deletion src/js/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@

return reservationAPI;
}
angular.module('angular.reservation').factory('reservationAPIFactory', ['$http', 'reservationConfig', reservationAPIFactory]);
angular.module('hm.reservation').factory('reservationAPIFactory', ['$http', 'reservationConfig', reservationAPIFactory]);
})();
8 changes: 7 additions & 1 deletion src/js/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
*/
(function() {
"use strict";
angular.module('angular.reservation').config(['$translateProvider', function($translateProvider) {
angular.module('hm.reservation').config(['$translateProvider', function($translateProvider) {
$translateProvider.translations('es', {
date: "Fecha",
time: "Hora",
client: "Cliente",
name: "Nombre",
save: "Guardar",
cancel: "Cancelar",
Expand All @@ -20,6 +23,9 @@
});

$translateProvider.translations('en', {
date: "Date",
time: "Time",
client: "Client",
name: "Name",
save: "Save",
cancel: "Cancel",
Expand Down
85 changes: 84 additions & 1 deletion src/templates/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,86 @@
<div>
<uib-tabset active="reservationCtrl.selectedTab" justified="true" style="border: 2px dotted gainsboro">
<uib-tab index="0">
<uib-tab-heading>
<span class="glyphicon glyphicon-calendar" aria-hidden="true" style="font-size: 18px"></span>
<h5>{{"date" | translate}}</h5>
</uib-tab-heading>

<uib-datepicker ng-model="reservationCtrl.selectedDate" ng-change="reservationCtrl.onSelectDate()" datepicker-options="reservationCtrl.calendarOptions"></uib-datepicker>
</uib-tab>

<uib-tab index="1">
<uib-tab-heading>
<span class="glyphicon glyphicon-time" aria-hidden="true" style="font-size: 18px"></span>
<h5>{{"time" | translate}}</h5>
</uib-tab-heading>

<div class="list-group">
<a class="list-group-item" href="" ng-repeat="item in reservationCtrl.availableHours" ng-click="reservationCtrl.selectHour(item)" ng-class="{'selected': reservationCtrl.selectedHour == item}">
{{item}}
</a>
</div>
</uib-tab>

<uib-tab index="2">
<uib-tab-heading>
<span class="glyphicon glyphicon-user" aria-hidden="true" style="font-size: 18px"></span>
<h5>{{"client" | translate}}</h5>
</uib-tab-heading>

<form class="form-horizontal" name="reservationCtrl.reserveForm" novalidate>
<fieldset>
<div class="form-group col-md-12">
<label class="col-md-4 control-label" for="name">{{"name" | translate}}</label>
<div class="col-md-8">
<div class="input-group">
<span class="input-group-addon">
<span class="glyphicon glyphicon-user" aria-hidden="true" style="font-size: 14px"></span>
</span>
<input id="name" name="name" class="form-control" placeholder="{{'name' | translate}}" type="text" required>
</div>

</div>
</div>

<div class="form-group col-md-12">
<label class="col-md-4 control-label" for="phone">{{"phone" | translate}}</label>
<div class="col-md-8">
<div class="input-group">
<span class="input-group-addon">
<span class="glyphicon glyphicon-earphone" aria-hidden="true" style="font-size: 14px"></span>
</span>
<input id="phone" name="phone" class="form-control" placeholder="{{'phone' | translate}}" type="text" required>
</div>

</div>
</div>

<div class="form-group col-md-12">
<label class="col-md-4 control-label" for="email">{{"email" | translate}}</label>
<div class="col-md-8">
<div class="input-group">
<span class="input-group-addon">
<span class="glyphicon glyphicon-envelope" aria-hidden="true" style="font-size: 14px"></span>
</span>
<input id="email" name="email" class="form-control" placeholder="{{'email' | translate}}" type="text" required>
</div>

</div>
</div>

<div class="form-group">
<div class="col-md-12">
<button id="reserve" name="reserve" class="btn btn-success">{{"reserve" | translate}}</button>
</div>
</div>
</fieldset>
</form>
</uib-tab>
</uib-tabset>
</div>

<!--
<div class="tabs">
<md-content>
<md-tabs md-selected="reservationCtrl.selectedTab" md-center-tabs md-swipe-content md-dynamic-height md-border-bottom>
Expand Down Expand Up @@ -72,4 +155,4 @@ <h3>{{item}}</h3>
</md-tab>
</md-tabs>
</md-content>
</div>
</div>-->

0 comments on commit b5ca68b

Please sign in to comment.