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