-
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.
Add remaining API integrations & other issues (#119)
- Add students delete - Add admins delete button but no API endpoint found - Add courses delete - Add users change password - Update HomeCtrl to redirect to user's profile - Update sidebar items opened by default - Add not found view - Add server error view && (500 || 503) redirections - Add footer to index and style it
- Loading branch information
1 parent
3d4af22
commit 87c82e8
Showing
26 changed files
with
260 additions
and
172 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
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,10 @@ | ||
'use strict'; | ||
|
||
define(['paw', 'services/Paths'], | ||
function(paw) { | ||
paw.controller('NotFoundCtrl', | ||
['Paths', | ||
function(Paths) { | ||
this.indexPath = Paths.get().index().path; | ||
}]); | ||
}); |
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,10 @@ | ||
'use strict'; | ||
|
||
define(['paw', 'services/Paths'], | ||
function(paw) { | ||
paw.controller('ServerErrorCtrl', | ||
['Paths', | ||
function(Paths) { | ||
this.indexPath = Paths.get().index().path; | ||
}]); | ||
}); |
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 |
---|---|---|
@@ -1,15 +1,37 @@ | ||
'use strict'; | ||
|
||
define(['paw'], function(paw) { | ||
paw.controller('UserChangePasswordCtrl', ['$window',function($window) { | ||
define(['paw', 'services/navDataService', 'services/flashMessages', 'services/Users'], function(paw) { | ||
paw.controller('UserChangePasswordCtrl', | ||
['$window', 'navDataService', 'flashMessages', 'Users', '$route', | ||
function($window, navDataService, flashMessages, Users, $route) { | ||
var _this = this; | ||
_this.errors = []; | ||
|
||
this.cancel = function() { | ||
$window.history.back(); | ||
var getUserCallback = function() { | ||
_this.user = navDataService.get('user'); | ||
}; | ||
navDataService.registerObserverCallback('user', getUserCallback); | ||
getUserCallback(); | ||
|
||
this.changePassword = function(passwordForm) { | ||
// Change Password | ||
Users.updatePassword(passwordForm, _this.user.dni).then(function(response) { | ||
flashMessages.setSuccess('i18nPasswordSuccessfullyUpdated'); | ||
$route.reload(); | ||
}, function(response) { | ||
if (response.status === 409) { // dni repeated | ||
_this.errors = [ | ||
'i18nWrongOriginalPassword' | ||
]; | ||
return; | ||
} | ||
$log.warn(JSON.stringify(response)); | ||
flashMessages.setError('i18nFormErrors'); | ||
$route.reload(); | ||
}); | ||
}; | ||
|
||
this.cancel = function() { | ||
$window.history.back(); | ||
}; | ||
}]); | ||
}); |
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
Oops, something went wrong.