Merge pull request #3417 from FinnStutzenstein/HidePassword

Hide password in change password view
This commit is contained in:
Emanuel Schütze 2017-09-27 10:52:09 +02:00 committed by GitHub
commit 0b10933d67
4 changed files with 21 additions and 5 deletions

View File

@ -603,7 +603,7 @@ angular.module('OpenSlidesApp.core.pdf', [])
}, },
// Helper function for determinating whether a parent of element is a list item. // Helper function for determinating whether a parent of element is a list item.
isInsideAList = function (element) { isInsideAList = function (element) {
parent = element.parentNode; var parent = element.parentNode;
while(parent !== null) { while(parent !== null) {
if (parent.nodeName.toLowerCase() === 'li') { if (parent.nodeName.toLowerCase() === 'li') {
return true; return true;

View File

@ -987,7 +987,7 @@ angular.module('OpenSlidesApp.motions.site', [
function (motion) {return motion.category ? motion.category.name : '';}, function (motion) {return motion.category ? motion.category.name : '';},
function (motion) {return motion.motionBlock ? motion.motionBlock.name : '';}, function (motion) {return motion.motionBlock ? motion.motionBlock.name : '';},
function (motion) {return motion.recommendation ? motion.getRecommendationName() : '';}, function (motion) {return motion.recommendation ? motion.getRecommendationName() : '';},
function (motion) {return _.filter(motion.comments, function (comment) {return !!comment;}).join(' ');}, function (motion) {return _.filter(motion.comments).join(' ');},
]; ];
$scope.filter.propertyDict = { $scope.filter.propertyDict = {
'submitters': function (submitter) { 'submitters': function (submitter) {

View File

@ -109,7 +109,7 @@ angular.module('OpenSlidesApp.users.site', [
} }
]) ])
.value('LoginDialog', {id: undefined}) .value('LoginDialog', {})
/* /*
* Directive to check for permissions * Directive to check for permissions
@ -913,6 +913,18 @@ angular.module('OpenSlidesApp.users.site', [
} }
]) ])
.directive("showPassword", function() {
return function linkFn(scope, elem, attrs) {
scope.$watch(attrs.showPassword, function(value) {
if (value) {
elem.attr("type", "text");
} else {
elem.attr("type", "password");
}
});
};
})
.controller('UserPasswordCtrl', [ .controller('UserPasswordCtrl', [
'$scope', '$scope',
'$state', '$state',

View File

@ -20,9 +20,9 @@
{{ alert.msg }} {{ alert.msg }}
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="inputOldPassword" translate>New password</label> <label for="inputNewPassword" translate>New password</label>
<div class="input-group"> <div class="input-group">
<input type="text" <input show-password="showPassword"
ng-model="new_password" ng-model="new_password"
class="form-control" class="form-control"
name="inputNewPassword" name="inputNewPassword"
@ -38,6 +38,10 @@
<i class="fa fa-info-circle"></i> <i class="fa fa-info-circle"></i>
<translate>Initial password</translate>: {{ user.default_password }} <translate>Initial password</translate>: {{ user.default_password }}
</span> </span>
<span class="pull-right spacer-right pointer" ng-click="showPassword = !showPassword">
<translate>Show password</translate>
<i class="fa" ng-class="showPassword ? 'fa-check-square-o' : 'fa-square-o'"></i>
</span>
</div> </div>
</div> </div>
<button type="submit" ng-click="save(user)" class="btn btn-primary btn-sm" translate> <button type="submit" ng-click="save(user)" class="btn btn-primary btn-sm" translate>