Improve modal

This commit is contained in:
Jan Bader 2017-01-19 22:55:02 +01:00
parent 019ffa34cd
commit c598694eb4

View File

@ -1,7 +1,9 @@
{{define "budget-new"}} {{define "budget-new"}}
<div id="newbudgetmodal" class="modal"> <div id="newbudgetmodal" class="modal fade">
<div class="modal-dialog" role="document">
<script> <script>
$(document).ready(function () { $(document).ready(function () {
$('#errorcreatingbudget').hide();
$('#newbudgetform').ajaxForm({ $('#newbudgetform').ajaxForm({
error: function() { error: function() {
$('#errorcreatingbudget').show(); $('#errorcreatingbudget').show();
@ -9,8 +11,15 @@
}); });
}); });
</script> </script>
<h3>New Budget</h3> <div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">New Budget</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form id="newbudgetform" action="/api/v1/budget/new" method="POST"> <form id="newbudgetform" action="/api/v1/budget/new" method="POST">
<div class="modal-body">
<div class="form-group"> <div class="form-group">
<label for="name">Name</label> <label for="name">Name</label>
<input type="text" name="name" class="form-control" placeholder="Name" /> <input type="text" name="name" class="form-control" placeholder="Name" />
@ -19,8 +28,13 @@
<div id="errorcreatingbudget"> <div id="errorcreatingbudget">
Error creating budget. Error creating budget.
</div> </div>
</div>
<input type="submit" value="Create" class="form-control" /> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<input type="submit" class="btn btn-primary" value="Create" class="form-control" />
</div>
</form> </form>
</div> </div>
</div>
</div>
{{end}} {{end}}