Add modal for new budget

This commit is contained in:
Jan Bader 2017-01-19 22:37:55 +01:00
parent 725555bdc9
commit 019ffa34cd
2 changed files with 28 additions and 1 deletions

26
templates/budget-new.html Normal file
View File

@ -0,0 +1,26 @@
{{define "budget-new"}}
<div id="newbudgetmodal" class="modal">
<script>
$(document).ready(function () {
$('#newbudgetform').ajaxForm({
error: function() {
$('#errorcreatingbudget').show();
}
});
});
</script>
<h3>New Budget</h3>
<form id="newbudgetform" action="/api/v1/budget/new" method="POST">
<div class="form-group">
<label for="name">Name</label>
<input type="text" name="name" class="form-control" placeholder="Name" />
</div>
<div id="errorcreatingbudget">
Error creating budget.
</div>
<input type="submit" value="Create" class="form-control" />
</form>
</div>
{{end}}

View File

@ -18,10 +18,11 @@
</div> </div>
{{end}} {{end}}
<div class="budget-item"> <div class="budget-item">
<a href="budgets/new">New Budget</a> <a data-toggle="modal" data-target="#newbudgetmodal">New Budget</a>
<span class="time"></span> <span class="time"></span>
</div> </div>
</div> </div>
{{template "budget-new"}}
</body> </body>
</html> </html>
{{end}} {{end}}