-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5bc34a
commit ecb06e1
Showing
7 changed files
with
563 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
'use strict'; | ||
|
||
define(['paw'], function(paw) { | ||
paw.controller('AdminsEditCtrl', [ | ||
'$routeParams', | ||
'$log', | ||
'$window', | ||
'Paths', | ||
function($routeParams, $log, $window, Paths) { | ||
var _this = this; | ||
|
||
var dni = $routeParams.adminDni; | ||
|
||
this.admin = { | ||
firstName: 'Matías', | ||
lastName: 'Mercado', | ||
email: 'mmercado@itba.edu.ar', | ||
genre: 'Masculino', | ||
dni: '38917403', | ||
birthday: '1995-05-04', | ||
address: { | ||
country: 'Argentina', | ||
city: 'Buenos Aires', | ||
neighborhood: 'Almagro', | ||
number: '682', | ||
street: 'Corrientes', | ||
floor: '2', | ||
door: 'A', | ||
telephone: '1544683390', | ||
zipCode: '1100' | ||
} | ||
}; | ||
|
||
this.editedAdmin = angular.copy(this.admin); | ||
|
||
this.cancel = function() { | ||
$window.history.back(); | ||
}; | ||
|
||
this.update = function(editedAdmin) { | ||
var path = Paths.get().admins(_this.admin); | ||
$log.info('POST ' + path.absolutePath() + ' ' + JSON.stringify(editedAdmin)); | ||
path.go(); | ||
}; | ||
}]); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@import 'modules/variables/importer'; | ||
|
||
.admins-edit-container { | ||
.data-container { | ||
width: 100%; | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: space-between; | ||
|
||
.data-item { | ||
width: 230px; | ||
padding: 5px; | ||
|
||
.align-to-input-field { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
height: 35px; | ||
} | ||
|
||
.align-data-to-input-field { | ||
height: 35px; | ||
line-height: 35px; | ||
} | ||
} | ||
} | ||
|
||
.user-address-data { | ||
padding-top: 15px; | ||
border-top: 1px solid $gallery; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,254 @@ | ||
<div ng-controller='AdminsEditCtrl as controller' class='admins-edit-container'> | ||
<!-- Page Heading --> | ||
<div class='page-header break-words'> | ||
<h1 class='inline'> | ||
<span translate='i18nAdminsPanelSection'></span> | ||
</h1> | ||
<h2 class='inline'> | ||
<span> - </span> | ||
<span> {{controller.admin.firstName}} {{controller.admin.lastName}}</span> | ||
<small> - </small> | ||
<small translate='i18nAdminEdit'></small> | ||
</h2> | ||
</div> | ||
<!-- /Page Heading --> | ||
|
||
<!-- Content --> | ||
<div class='required-fields'> | ||
<span translate='i18nRequiredFields'/> | ||
(<span class='text-danger' translate='i18nRequiredIcon'/>) | ||
</div> | ||
<form name='form' novalidate class='data-container'> | ||
<!-- User Data --> | ||
<div class='data-container'> | ||
<!-- dni --> | ||
<div class='data-item'> | ||
<label for='dni'> | ||
<span translate='i18nDni'/> | ||
(<span class='text-danger' translate='i18nRequiredIcon'/>) | ||
</label> | ||
<div class='align-data-to-input-field'> | ||
<p id='dni'>{{ controller.editedAdmin.dni }}</p> | ||
</div> | ||
</div> | ||
<!-- /dni --> | ||
|
||
<!-- firstName and lastName --> | ||
<div class='data-item'> | ||
<label for='firstName'> | ||
<span translate='i18nFirstName'/> | ||
(<span class='text-danger' translate='i18nRequiredIcon'/>) | ||
</label> | ||
<input type='text' name='firstName' id='firstName' class='form-input-field' ng-model='controller.editedAdmin.firstName' required ng-minlength='2' ng-maxlength='50'/> | ||
<div ng-messages='form.firstName.$error' ng-show='form.firstName.$touched || form.$submitted' class='form-errors' role='alert'> | ||
<div ng-message='required'> | ||
<p translate='i18nRequiredField'></p> | ||
</div> | ||
<div ng-message-exp="['minlength', 'maxlength']"> | ||
<span translate='i18nLengthPrefix'></span> | ||
<span> 2 </span> | ||
<span translate='i18nLengthAnd'></span> | ||
<span> 50 </span> | ||
<span translate='i18nLengthSuffix'></span> | ||
</div> | ||
</div> | ||
</div> | ||
<div class='data-item'> | ||
<label for='lastName'> | ||
<span translate='i18nLastName'/> | ||
(<span class='text-danger' translate='i18nRequiredIcon'/>) | ||
</label> | ||
<input type='text' name='lastName' id='lastName' class='form-input-field' ng-model='controller.editedAdmin.lastName' required ng-minlength='2' ng-maxlength='50'/> | ||
<div ng-messages='form.lastName.$error' ng-show='form.lastName.$touched || form.$submitted' class='form-errors' role='alert' ng-messages-multiple> | ||
<div ng-message='required'> | ||
<p translate='i18nRequiredField'></p> | ||
</div> | ||
<div ng-message-exp="['minlength', 'maxlength']"> | ||
<span translate='i18nLengthPrefix'></span> | ||
<span> 2 </span> | ||
<span translate='i18nLengthAnd'></span> | ||
<span> 50 </span> | ||
<span translate='i18nLengthSuffix'></span> | ||
</div> | ||
</div> | ||
</div> | ||
<!-- /firstName and lastName --> | ||
|
||
<!-- birthday and genre --> | ||
<div class='data-item'> | ||
<label for='birthday'> | ||
<span translate='i18nBirthday'/> | ||
</label> | ||
<input type='date' name='birthday' id='birthday' class='form-input-field' ng-model='controller.admin.birthday' placeholder="{{ 'i18nBirthdayPlaceholder' | translate}}"/> | ||
</div> | ||
<div class='data-item'> | ||
<label translate='i18nGenre'/> | ||
<div class='align-to-input-field'> | ||
<label class='radio-inline'> | ||
<input type='radio' name='genre' ng-model='controller.editedAdmin.genre' value="{{'i18nMale' | translate }}"/> <span translate='i18nMale'/> | ||
</label> | ||
<label class='radio-inline'> | ||
<input type='radio' name='genre' ng-model='controller.editedAdmin.genre' value="{{'i18nFemale' | translate }}"/> <span translate='i18nFemale'/> | ||
</label> | ||
</div> | ||
</div> | ||
<!-- /birthday and genre --> | ||
|
||
<!-- telephone and email --> | ||
<div class='data-item'> | ||
<label for='telephone'> | ||
<span translate='i18nTelephone'/> | ||
</label> | ||
<input type='text' name='telephone' id='telephone' class='form-input-field' ng-model='controller.editedAdmin.address.telephone' ng-pattern="'^[0-9]{1,15}$'"/> | ||
<div ng-messages='form.telephone.$error' ng-show='form.telephone.$touched || form.$submitted' class='form-errors' role='alert'> | ||
<div ng-message='pattern'> | ||
<p translate='i18nFormErrorTelephone'></p> | ||
</div> | ||
</div> | ||
</div> | ||
<div class='data-item'> | ||
<label for='email'> | ||
<span translate='i18nEmail'/> | ||
</label> | ||
<div class='align-data-to-input-field'> | ||
<p id='email'>{{ controller.editedAdmin.email }}</p> | ||
</div> | ||
</div> | ||
<!-- /telephone and email --> | ||
</div> | ||
<!-- \User Data --> | ||
|
||
<!-- User Address Data --> | ||
<div class='data-container user-address-data'> | ||
<!-- country and city --> | ||
<div class='data-item'> | ||
<label for='country'> | ||
<span translate='i18nCountry'/> | ||
(<span class='text-danger' translate='i18nRequiredIcon'/>) | ||
</label> | ||
<input type='text' name='country' id='country' class='form-input-field' ng-model='controller.editedAdmin.address.country' required ng-minlength='2' ng-maxlength='50'/> | ||
<div ng-messages='form.country.$error' ng-show='form.country.$touched || form.$submitted' class='form-errors' role='alert'> | ||
<div ng-message='required'> | ||
<p translate='i18nRequiredField'></p> | ||
</div> | ||
<div ng-message-exp="['minlength', 'maxlength']"> | ||
<span translate='i18nLengthPrefix'></span> | ||
<span> 2 </span> | ||
<span translate='i18nLengthAnd'></span> | ||
<span> 50 </span> | ||
<span translate='i18nLengthSuffix'></span> | ||
</div> | ||
</div> | ||
</div> | ||
<div class='data-item'> | ||
<label for='city'> | ||
<span translate='i18nCity'/> | ||
(<span class='text-danger' translate='i18nRequiredIcon'/>) | ||
</label> | ||
<input type='text' name='city' id='city' class='form-input-field' ng-model='controller.editedAdmin.address.city' required ng-minlength='2' ng-maxlength='50'/> | ||
<div ng-messages='form.city.$error' ng-show='form.city.$touched || form.$submitted' class='form-errors' role='alert'> | ||
<div ng-message='required'> | ||
<p translate='i18nRequiredField'></p> | ||
</div> | ||
<div ng-message-exp="['minlength', 'maxlength']"> | ||
<span translate='i18nLengthPrefix'></span> | ||
<span> 2 </span> | ||
<span translate='i18nLengthAnd'></span> | ||
<span> 50 </span> | ||
<span translate='i18nLengthSuffix'></span> | ||
</div> | ||
</div> | ||
</div> | ||
<!-- /country and city --> | ||
|
||
<!-- neighborhood and street --> | ||
<div class='data-item'> | ||
<label for='neighborhood'> | ||
<span translate='i18nNeighborhood'/> | ||
(<span class='text-danger' translate='i18nRequiredIcon'/>) | ||
</label> | ||
<input type='text' name='neighborhood' id='neighborhood' class='form-input-field' ng-model='controller.admin.editedAdmin.neighborhood' required ng-minlength='2' ng-maxlength='50'/> | ||
<div ng-messages='form.neighborhood.$error' ng-show='form.neighborhood.$touched || form.$submitted' class='form-errors' role='alert'> | ||
<div ng-message='required'> | ||
<p translate='i18nRequiredField'></p> | ||
</div> | ||
<div ng-message-exp="['minlength', 'maxlength']"> | ||
<span translate='i18nLengthPrefix'></span> | ||
<span> 2 </span> | ||
<span translate='i18nLengthAnd'></span> | ||
<span> 50 </span> | ||
<span translate='i18nLengthSuffix'></span> | ||
</div> | ||
</div> | ||
</div> | ||
<div class='data-item'> | ||
<label for='street'> | ||
<span translate='i18nStreet'/> | ||
(<span class='text-danger' translate='i18nRequiredIcon'/>) | ||
</label> | ||
<input type='text' name='street' id='street' class='form-input-field' ng-model='controller.editedAdmin.address.street' required ng-minlength='2' ng-maxlength='50'/> | ||
<div ng-messages='form.street.$error' ng-show='form.street.$touched || form.$submitted' class='form-errors' role='alert'> | ||
<div ng-message='required'> | ||
<p translate='i18nRequiredField'></p> | ||
</div> | ||
<div ng-message-exp="['minlength', 'maxlength']"> | ||
<span translate='i18nLengthPrefix'></span> | ||
<span> 2 </span> | ||
<span translate='i18nLengthAnd'></span> | ||
<span> 50 </span> | ||
<span translate='i18nLengthSuffix'></span> | ||
</div> | ||
</div> | ||
</div> | ||
<!-- /neighborhood and street --> | ||
|
||
<!-- number and floor --> | ||
<div class='data-item'> | ||
<label for='number'> | ||
<span translate='i18nNumber'/> | ||
(<span class='text-danger' translate='i18nRequiredIcon'/>) | ||
</label> | ||
<input type='text' name='number' id='number' class='form-input-field' ng-model='controller.admin.address.number' required ng-pattern="'^[1-9][0-9]{0,15}$'"/> | ||
<div ng-messages='form.number.$error' ng-show='form.number.$touched || form.$submitted' class='form-errors' role='alert'> | ||
<div ng-message='required'> | ||
<p translate='i18nRequiredField'></p> | ||
</div> | ||
<div ng-message='pattern'> | ||
<p translate='i18nNumericField'></p> | ||
</div> | ||
</div> | ||
</div> | ||
<div class='data-item'> | ||
<label for='floor' translate='i18nFloor'/> | ||
<input type='text' name='floor' id='floor' class='form-input-field' ng-model='controller.editedAdmin.address.floor' ng-pattern="'^[1-9][0-9]{0,15}$'"/> | ||
<div ng-messages='form.floor.$error' ng-show='form.floor.$touched || form.$submitted' class='form-errors' role='alert'> | ||
<div ng-message='pattern'> | ||
<p translate='i18nNumericField'></p> | ||
</div> | ||
</div> | ||
</div> | ||
<!-- /number and floor --> | ||
|
||
<!-- door and zipcode --> | ||
<div class='data-item'> | ||
<label for='door' translate='i18nDoor'/> | ||
<input type='text' id='door' class='form-input-field' ng-model='controller.editedAdmin.address.door'/> | ||
</div> | ||
<div class='data-item'> | ||
<label for='zipCode' translate='i18nZipCode'/> | ||
<input type='text' name='zipCode' id='zipCode' class='form-input-field' ng-model='controller.editedAdmin.address.zipCode' ng-pattern="'^[1-9][0-9]{0,15}$'"/> | ||
<div ng-messages='form.zipCode.$error' ng-show='form.zipCode.$touched || form.$submitted' class='form-errors' role='alert'> | ||
<div ng-message='pattern'> | ||
<p translate='i18nNumericField'></p> | ||
</div> | ||
</div> | ||
</div> | ||
<!-- /door and zipcode --> | ||
</div> | ||
<!-- \User Address Data --> | ||
<div class='buttons-container'> | ||
<input type='submit' class='btn btn-action' ng-click='form.$valid && controller.update(controller.editedAdmin)' value="{{ 'i18nButtonSaveChanges' | translate }}" /> | ||
<input type='button' class='btn btn-default' ng-click='controller.cancel()' value="{{ 'i18nButtonCancel' | translate }}" /> | ||
</div> | ||
</form> | ||
</div> |
Oops, something went wrong.