Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hdwilber committed Oct 27, 2016
1 parent 38966b8 commit bfc8f2c
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 9 deletions.
6 changes: 5 additions & 1 deletion src/main/scala/code/snippet/UserSnips.scala
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,11 @@ object UserLogin extends Loggable with SnippetHelper {
User.logUserIn(user, true)
if (remember) User.createExtSession(user.id.get)
else ExtSession.deleteExtCookie()
RedirectTo("/")

if ((user.roles.get contains "Usuario") && !(referer contains "login"))
RedirectTo(referer);
else
RedirectTo("/dashboard")
} else {
S.error("login_err", "Aun falta validar esta cuenta. Porfavor revise su correo electronico para terminar el proceso.")
Noop
Expand Down
64 changes: 64 additions & 0 deletions src/main/webapp/backend/record/event-form-page.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
<div data-lift="surround?with=base-wrap-backend;at=content">
<div class="col-md-12" ng-app="EventApp">
<div ng-show='loading' class='on-loading'>
<img src="/images/ajax-loader.gif" width="25" height="25" />
</div>
<script>
$(document).ready(function () {
$('#terms-agreement').modal({
keyboard: false,
backdrop: false
});

$('#button-ok').hide().click(function () {
$('#terms-agreement').modal('hide');
});
$('#terms-agreement input').click (function () {
if ($(this).prop('checked')) {
$('#button-ok').fadeIn();
} else {
$('#button-ok').fadeOut();
}
})


});
</script>
<div class="notifications margin-bottom-xs ">
</div>
<header class="page-header">
Expand All @@ -9,6 +33,46 @@ <h2 class="no-margin-top title-page">
</header>

<div id="event-wizard" ng-controller="EventController">

<div id='terms-agreement' class='modal fade' tabindex='-1' role='dialog'>
<div class='modal-dialog' role='document'>
<div class='modal-content'>
<div class='modal-header'>
<h3>
Importante
</h3>
</div>
<div class='modal-body'>
<p>La solicitud de un evento en el Proyecto mARTadero no implica su automática aprobación.
</p>
<p>
Ten en cuenta que:
<ul>
<li>
Una vez realizada la solicitud para por la evaluación de la coordinación de área.
</li>
<li>
En caso de ser aprobada se revisará la cotización que realizará el sistema y los datos que hayas ingresado por si hubiese alguna corrección pertinente.
</li>
</ul>
</p>
<p class='text-center'>
<label>
<input type='checkbox'>
He leído y entendido ésta información
</label>
</p>
<p class='text-center'>
<a id='button-ok' type='button' ng-click='myFunc()' class='btn btn-primary'>
Continuar
</a>
</p>
</div>
</div>
</div>
</div>


<div class="navbar wizard-nav">
<div class="navbar-inner">
<ul class="nav nav-pills">
Expand Down
37 changes: 30 additions & 7 deletions src/main/webapp/js/EventController.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
angular.module('EventApp', ['federica.event', 'ui.bootstrap'])

.controller('EventController', function ($scope, $log, EventService) {
$scope.loading = true;
$scope.rooms = [];
$scope.event = {};
$scope.currentTab = 'rooms';
$scope.shifts = ['Mañana', 'Tarde', 'Noche'];

var endLoadingCounter = 0;



$scope.switchRoom = function(room) {
if (_.includes($scope.event.rooms, room)) {
_.remove($scope.event.rooms, function(r) {
Expand Down Expand Up @@ -152,12 +158,29 @@ angular.module('EventApp', ['federica.event', 'ui.bootstrap'])

return '';
};
$scope.myFunc = function() {
console.log ("Continuing... Loading Event");
EventService.fetchEvent().then(function(response) {
$scope.event = response;
endLoading();

});
EventService.listRooms().then(function(response) {
$scope.rooms = response;
endLoading();
});
};

//init
EventService.fetchEvent().then(function(response) {
$scope.event = response;
});
EventService.listRooms().then(function(response) {
$scope.rooms = response;
});
});
//
//


function endLoading () {
endLoadingCounter++;
if (endLoadingCounter >= 2 ) {
$scope.loading = false;
}
}
});

2 changes: 1 addition & 1 deletion src/main/webapp/js/martadero.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ $(document).ready(function(){
$loginBox.slideUp();
}
});
});
});
16 changes: 16 additions & 0 deletions src/main/webapp/styles/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,19 @@ form .section-costs {
}
margin-top: 5em;
}

.on-loading {
position: absolute;
left: 0;
width: 100%;
height: 100%;
top: 0;
background: rgba(255,255,255,0.75);
z-index: 100;
}

.on-loading > img {
position: absolute;
left: 45%;
top:45%;
}

0 comments on commit bfc8f2c

Please sign in to comment.