Files
firefly-iii/resources/views/v1/rules/rule/create.twig

159 lines
6.9 KiB
Twig
Raw Normal View History

2016-11-06 08:11:43 +01:00
{% extends "./layout/default" %}
2016-01-14 12:37:49 +01:00
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, ruleGroup) }}
2016-01-14 12:37:49 +01:00
{% endblock %}
{% block content %}
2018-04-08 16:27:52 +02:00
<form method="POST" action="{{ route('rules.store') }}" accept-charset="UTF-8" class="form-horizontal" id="store">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<input type="hidden" name="rule_group_id" value="{{ ruleGroup.id }}"/>
2018-04-08 16:27:52 +02:00
<input type="hidden" name="return_to_bill" value="{% if returnToBill %}true{% else %}false{% endif %}"/>
<input type="hidden" name="bill_id" value="{% if bill %}{{ bill.id }}{% else %}0{% endif %}"/>
2016-10-23 12:10:22 +02:00
<input type="hidden" name="active" value="1"/>
2018-04-07 22:23:16 +02:00
{% if bill %}
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box box-success" id="mandatory">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('firefly.create_rule_for_bill', {name: bill.name}) }}</h3>
</div>
<div class="box-body">
<p class="text-info">
{{ trans('firefly.create_rule_for_bill_txt', {name: bill.name}) }}
</p>
</div>
</div>
</div>
</div>
{% endif %}
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
2017-07-22 22:56:21 +02:00
<div class="box box-primary" id="mandatory">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mandatoryFields'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.text('title') }}
{{ ExpandedForm.select('trigger',allJournalTriggers()) }}
2019-08-10 16:50:37 +02:00
{{ RuleForm.ruleGroupList('rule_group_id', ruleGroup.id) }}
{{ ExpandedForm.checkbox('stop_processing',1,null, {helpText: trans('firefly.rule_help_stop_processing')}) }}
2018-04-14 20:31:31 +02:00
{{ ExpandedForm.checkbox('strict',1, null,{helpText: trans('firefly.rule_help_strict')}) }}
</div>
2016-01-14 12:37:49 +01:00
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
2016-01-14 12:37:49 +01:00
2018-01-12 18:42:48 +01:00
{# optional fields #}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
</div>
<div class="box-body">
2017-11-18 20:26:57 +01:00
{{ ExpandedForm.textarea('description', null, {helpText: trans('firefly.field_supports_markdown')}) }}
</div>
2016-01-14 12:37:49 +01:00
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'rule_triggers'|_ }}</h3>
</div>
<div class="box-body rule-trigger-box">
<table class="table table-condensed table-bordered table-striped">
<thead>
<tr>
<th colspan="2">{{ 'trigger'|_ }}</th>
<th>{{ 'trigger_value'|_ }}</th>
<th>{{ 'stop_processing_other_triggers'|_ }}</th>
</tr>
</thead>
<tbody class="rule-trigger-tbody">
{% for trigger in oldTriggers %}
{{ trigger|raw }}
{% endfor %}
</tbody>
2016-01-14 16:41:15 +01:00
</table>
<p>
<br/>
2017-01-22 09:15:53 +01:00
<button type="button" class="btn btn-default add_rule_trigger">{{ 'add_rule_trigger'|_ }}</button>
2018-04-14 09:59:04 +02:00
<a href="#" class="btn btn-default test_rule_triggers"><i class="fa fa-flask"></i> {{ 'test_rule_triggers'|_ }}</a>
</p>
</div>
2016-01-14 12:37:49 +01:00
</div>
</div>
</div>
2016-11-06 08:11:43 +01:00
{% include '/rules/partials/test-trigger-modal' %}
2016-01-14 12:37:49 +01:00
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'rule_actions'|_ }}</h3>
</div>
2017-07-22 22:56:21 +02:00
<div class="box-body rule-action-box">
<table class="table table-condensed table-bordered table-striped">
<thead>
<tr>
<th colspan="2">{{ 'action'|_ }}</th>
<th>{{ 'action_value'|_ }}</th>
<th>{{ 'stop_executing_other_actions'|_ }}</th>
</tr>
</thead>
<tbody class="rule-action-tbody">
{% for action in oldActions %}
{{ action|raw }}
{% endfor %}
</tbody>
2016-01-14 16:41:15 +01:00
</table>
<p>
<br/>
<a href="#" class="btn btn-default add_rule_action">{{ 'add_rule_action'|_ }}</a>
</p>
</div>
2016-01-14 12:37:49 +01:00
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
2018-01-12 18:42:48 +01:00
{# panel for options #}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'options'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.optionsList('create','rule') }}
</div>
<div class="box-footer">
<button type="submit" class="btn pull-right btn-success">{{ 'store_new_rule'|_ }}</button>
</div>
2016-01-14 12:37:49 +01:00
</div>
2016-01-14 12:37:49 +01:00
</div>
</div>
</form>
2016-01-14 12:37:49 +01:00
{% endblock %}
2016-01-14 16:41:15 +01:00
{% block scripts %}
2020-01-04 11:16:14 +01:00
<script type="text/javascript" src="v1/js/lib/typeahead/typeahead.bundle.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" nonce="{{ JS_NONCE }}">
2016-01-14 18:09:20 +01:00
var triggerCount = {{ triggerCount }};
var actionCount = {{ actionCount }};
2018-04-14 09:59:04 +02:00
var testRuleTriggersText = '{{ 'test_rule_triggers'|_|escape('js') }}';
2016-01-14 18:09:20 +01:00
</script>
2020-01-04 11:16:14 +01:00
<script type="text/javascript" src="v1/js/ff/rules/create-edit.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
2017-01-22 09:15:53 +01:00
2016-01-14 16:41:15 +01:00
{% endblock %}
{% block styles %}
{% endblock %}