mirror of
https://github.com/arnaucube/commonroutesApp.git
synced 2026-02-07 11:36:42 +01:00
added password change
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
# carsincommonApp
|
# carsincommonApp
|
||||||
|
|
||||||
server code: https://github.com/arnaucode/carsincommonServer
|
- server code: https://github.com/arnaucode/carsincommonServer
|
||||||
|
- frontend app code: https://github.com/arnaucode/carsincommonApp
|
||||||
|
- images server: https://github.com/arnaucode/goImgServer
|
||||||
|
- admin web: https://github.com/arnaucode/carsincommonAdminWeb
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@@ -53,6 +53,7 @@
|
|||||||
<script src="js/editUser.js"></script>
|
<script src="js/editUser.js"></script>
|
||||||
<script src="js/notifications.js"></script>
|
<script src="js/notifications.js"></script>
|
||||||
<script src="js/settings.js"></script>
|
<script src="js/settings.js"></script>
|
||||||
|
<script src="js/password.js"></script>
|
||||||
<script src="js/help.js"></script>
|
<script src="js/help.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ angular.module('starter', [
|
|||||||
'app.editUser',
|
'app.editUser',
|
||||||
'app.notifications',
|
'app.notifications',
|
||||||
'app.settings',
|
'app.settings',
|
||||||
|
'app.password',
|
||||||
'app.help'
|
'app.help'
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -218,6 +219,15 @@ angular.module('starter', [
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
.state('app.password', {
|
||||||
|
url: '/password',
|
||||||
|
views: {
|
||||||
|
'menuContent': {
|
||||||
|
templateUrl: 'templates/password.html',
|
||||||
|
controller: 'PasswordCtrl'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
.state('app.help', {
|
.state('app.help', {
|
||||||
url: '/help',
|
url: '/help',
|
||||||
views: {
|
views: {
|
||||||
|
|||||||
33
www/js/password.js
Normal file
33
www/js/password.js
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
angular.module('app.password', ['pascalprecht.translate'])
|
||||||
|
|
||||||
|
.controller('PasswordCtrl', function($scope, $stateParams, $translate,
|
||||||
|
$http, $ionicLoading) {
|
||||||
|
$scope.newPass = {};
|
||||||
|
$scope.changePassword = function() {
|
||||||
|
console.log($scope.newPass);
|
||||||
|
$http({
|
||||||
|
url: urlapi + 'changePassword',
|
||||||
|
method: "PUT",
|
||||||
|
data: $scope.newPass
|
||||||
|
})
|
||||||
|
.then(function(data) {
|
||||||
|
console.log(data);
|
||||||
|
$ionicLoading.show({
|
||||||
|
template: 'Password updated',
|
||||||
|
noBackdrop: true,
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
window.location = "#app/settings";
|
||||||
|
},
|
||||||
|
function(data) { // optional
|
||||||
|
// failed
|
||||||
|
console.log(data);
|
||||||
|
$ionicLoading.show({
|
||||||
|
template: 'Error updating password',
|
||||||
|
noBackdrop: true,
|
||||||
|
duration: 2000
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
};
|
||||||
|
});
|
||||||
@@ -15,6 +15,10 @@ var translations = {
|
|||||||
"Help": "Help",
|
"Help": "Help",
|
||||||
"Username": "Username",
|
"Username": "Username",
|
||||||
"Password": "Password",
|
"Password": "Password",
|
||||||
|
"Old_Password": "Old Password",
|
||||||
|
"New_Password": "New Password",
|
||||||
|
"Repeat_New_Password": "Repeat New Password",
|
||||||
|
"Change_password": "Change password",
|
||||||
"Email": "Email",
|
"Email": "Email",
|
||||||
"Phone": "Phone",
|
"Phone": "Phone",
|
||||||
"Telegram": "Telegram",
|
"Telegram": "Telegram",
|
||||||
|
|||||||
21
www/templates/password.html
Normal file
21
www/templates/password.html
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<ion-view view-title="{{'Change_password' | translate}}">
|
||||||
|
<ion-content>
|
||||||
|
<div class="list">
|
||||||
|
<label class="item item-input">
|
||||||
|
<span class="input-label">{{'Old_Password' | translate}}</span>
|
||||||
|
<input ng-model="newPassword.old" type="password" placeholder="{{'Old_Password' | translate}}" style="-webkit-text-security: disc;">
|
||||||
|
</label>
|
||||||
|
<label class="item item-input">
|
||||||
|
<span class="input-label">{{'New_Password' | translate}}</span>
|
||||||
|
<input ng-model="newPassword.new1" type="password" placeholder="{{'New_Password' | translate}}" style="-webkit-text-security: disc;">
|
||||||
|
</label>
|
||||||
|
<label class="item item-input">
|
||||||
|
<span class="input-label">{{'New_Password' | translate}}</span>
|
||||||
|
<input ng-model="newPassword.new2" type="password" placeholder="{{'Repeat_New_Password' | translate}}" style="-webkit-text-security: disc;">
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div ng-click="changePassword()" class="button button-block c_deepPurple200">
|
||||||
|
{{'Change_password' | translate}}
|
||||||
|
</div>
|
||||||
|
</ion-content>
|
||||||
|
</ion-view>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<ion-view view-title="{{'Settings' | translate}}">
|
<ion-view view-title="{{'Settings' | translate}}">
|
||||||
<ion-content class="has-footer">
|
<ion-content>
|
||||||
<label class="item item-input item-select">
|
<label class="item item-input item-select">
|
||||||
<div class="input-label">
|
<div class="input-label">
|
||||||
{{'Actual_language' | translate}}
|
{{'Actual_language' | translate}}
|
||||||
@@ -12,5 +12,9 @@
|
|||||||
<p>
|
<p>
|
||||||
{{'version' | translate}}: CarsInCommon-v0.1
|
{{'version' | translate}}: CarsInCommon-v0.1
|
||||||
</p>
|
</p>
|
||||||
|
Security:
|
||||||
|
<a ng-href="#/app/password" class="button button-small c_deepPurple200">
|
||||||
|
{{'Change_password' | translate}}
|
||||||
|
</a>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
</ion-view>
|
</ion-view>
|
||||||
|
|||||||
Reference in New Issue
Block a user