mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-02 03:26:06 +01:00
Confirmation dialog for password changing
This commit is contained in:
@@ -55,13 +55,21 @@
|
||||
<div class="pull-right">
|
||||
<a href="@context.path/@account.userName/_delete" class="btn btn-danger" id="delete">Delete account</a>
|
||||
</div>
|
||||
<input type="submit" class="btn btn-success" value="Save"/>
|
||||
<input type="submit" class="btn btn-success" value="Save" id="save"/>
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
}
|
||||
<script>
|
||||
$(function(){
|
||||
$('#save').click(function(){
|
||||
if($('#password').val() != ''){
|
||||
return confirm('Are you sure you want to change password?');
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
$('#delete').click(function(){
|
||||
return confirm('Once you delete your account, there is no going back.\nAre you sure?');
|
||||
});
|
||||
|
||||
@@ -85,10 +85,21 @@
|
||||
@if(account.isEmpty){
|
||||
<input type="submit" class="btn btn-success" value="Create user" formaction="@context.path/admin/users/_newuser"/>
|
||||
} else {
|
||||
<input type="submit" class="btn btn-success" value="Update user" formaction="@context.path/admin/users/@account.get.userName/_edituser"/>
|
||||
<input type="submit" class="btn btn-success" value="Update user" formaction="@context.path/admin/users/@account.get.userName/_edituser" id="update"/>
|
||||
}
|
||||
<a href="@context.path/admin/users" class="btn btn-default">Cancel</a>
|
||||
</fieldset>
|
||||
</form>
|
||||
}
|
||||
}
|
||||
<script>
|
||||
$(function(){
|
||||
$('#update').click(function(){
|
||||
if($('#password').val() != ''){
|
||||
return confirm('Are you sure you want to change password of this user?');
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user