Skip to content

Firefly III: a personal finances manager

Create / edit category

James Colebe0adb7cf2ec
diff --git a/resources/twig/categories/create.twig b/resources/twig/categories/create.twig
new file mode 100644
index 0000000000..90ea9c57a5
--- /dev/null
+++ b/resources/twig/categories/create.twig
@@ -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 %}
+
diff --git a/resources/twig/categories/delete.twig b/resources/twig/categories/delete.twig
new file mode 100644
index 0000000000..bab3e41d0e
--- /dev/null
+++ b/resources/twig/categories/delete.twig
@@ -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 %}