Create / edit category

This commit is contained in:
James Cole 2015-05-02 09:25:45 +02:00
parent 84fd92bf5a
commit be0adb7cf2
2 changed files with 78 additions and 0 deletions

View File

@ -0,0 +1,45 @@
{% extends "./layout/default.twig" %}
{% block content %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName) }}
{{ Form.open({'class' : 'form-horizontal','id' : 'store','url' : route('categories.store')}) }}
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
<div class="panel panel-primary">
<div class="panel-heading">
<i class="fa fa-exclamation"></i> Mandatory fields
</div>
<div class="panel-body">
{{ ExpandedForm.text('name') }}
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
<!-- panel for options -->
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-bolt"></i> Options
</div>
<div class="panel-body">
{{ ExpandedForm.optionsList('create','category') }}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<p>
<button type="submit" class="btn btn-lg btn-success">
<i class="fa fa-plus-circle"></i> Store new category
</button>
</p>
</div>
</div>
</form>
{% endblock %}

View File

@ -0,0 +1,33 @@
{% extends "./layout/default.twig" %}
{% block content %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, category) }}
{{ Form.open({'class' : 'form-horizontal','id' : 'destroy','url' : route('categories.destroy',category.id)}) }}
<div class="row">
<div class="col-lg-6 col-md-12 col-sm-12">
<div class="panel panel-red">
<div class="panel-heading">
Delete category "{{ category.name }}"
</div>
<div class="panel-body">
<p>
Are you sure that you want to delete category "{{ category.name }}"?
</p>
{% if category.transactionjournals|length > 0 %}
<p class="text-info">
Category "{{ category.name }}" still has {{ category.transactionjournals|length }} transactions connected
to it. These will <strong>not</strong> be removed but will lose their connection to this category.
</p>
{% endif %}
<p>
<button type="submit" class="btn btn-default btn-danger">Delete permanently</button>
<a href="{{ URL.previous() }}" class="btn-default btn">Cancel</a >
</p>
</div>
</div>
</div>
</div>
</form>
{% endblock %}