Move v1 views

This commit is contained in:
James Cole
2022-01-29 14:15:34 +01:00
parent a12fd4a3ae
commit 6da6a68e33
251 changed files with 17989 additions and 0 deletions

View File

@@ -0,0 +1,204 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<p>
<a href="{{ route('rule-groups.create') }}" id="new_rule_group" class="btn btn-success">{{ 'new_rule_group'|_ }}</a>
</p>
</div>
</div>
{% if ruleGroups|length == 1 and ruleGroups[0].rules.count() == 0 %}
{% include 'v1.partials.empty' with {objectType: 'default', type: 'rules',route: route('rules.create')} %}
{# make FF ignore demo for now. #}
{% set shownDemo = true %}
{% endif %}
{% for ruleGroup in ruleGroups %}
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box rules-box" data-group="{{ ruleGroup.id }}">
<div class="box-header with-border">
<h3 class="box-title">
{% if ruleGroup.active %}
{{ ruleGroup.title }}
{% else %}
<s>{{ ruleGroup.title }}</s> ({{ 'inactive'|_|lower }})
{% endif %}
</h3>
<div class="box-tools pull-right">
<div class="btn-group">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><span class="fa fa-minus"></span>
</button>
<button class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown"><span
class="fa fa-ellipsis-v"></span></button>
<ul class="dropdown-menu" role="menu">
<li><a href="{{ route('rule-groups.edit',ruleGroup.id) }}"><span class="fa fa-fw fa-pencil"></span> {{ 'edit'|_ }}</a></li>
<li><a href="{{ route('rule-groups.delete',ruleGroup.id) }}"><span class="fa fa-fw fa-trash"></span> {{ 'delete'|_ }}</a></li>
<li><a href="{{ route('rule-groups.select-transactions',ruleGroup.id) }}"><span
class="fa fa-fw fa-power-off"></span> {{ trans('firefly.apply_rule_group_selection', {title: ruleGroup.title}) }}
</a></li>
{% if ruleGroup.order > 1 %}
<li><a href="#" class="move-group" data-direction="up" data-id="{{ ruleGroup.id }}"><span
class="fa fa-fw fa-arrow-up"></span> {{ 'move_rule_group_up'|_ }}</a></li>
{% endif %}
{% if ruleGroup.order < ruleGroups|length %}
<li><a href="#" class="move-group" data-direction="down" data-id="{{ ruleGroup.id }}"><span
class="fa fa-fw fa-arrow-down"></span> {{ 'move_rule_group_down'|_ }}
</a></li>
{% endif %}
</ul>
</div>
</div>
</div>
<div class="box-body">
<p>
<em>{{ ruleGroup.description }}</em>
</p>
{% if ruleGroup.rules.count() > 0 %}
<table class="table table-hover table-striped group-rules">
<thead>
<tr>
<th style="width:5%;">&nbsp;</th>
<th style="width:10%;">&nbsp;</th>
<th style="width:10%;">&nbsp;</th>
<th style="width:25%;">{{ 'rule_name'|_ }}</th>
<th style="width:25%;" class="hidden-xs">{{ 'rule_triggers'|_ }}</th>
<th style="width:25%;" class="hidden-xs">{{ 'rule_actions'|_ }}</th>
</tr>
</thead>
<tbody class="rule-connected-list">
{% for rule in ruleGroup.rules %}
<tr class="single-rule" data-order="{{ rule.order }}" data-id="{{ rule.id }}" data-group-id="{{ ruleGroup.id }}" data-position="{{ loop.index0 }}">
<td>
<div class="btn-group btn-group-xs prio_buttons">
<span class="fa fa-fw fa-bars rule-handle"></span>
</div>
</td>
<td>
<div class="btn-group btn-group-xs edit_buttons">
<a title="{{ 'edit'|_ }}" href="{{ route('rules.edit', rule.id) }}"
class="btn btn-default"><span
class="fa fa-fw fa-pencil"></span></a>
<a title="{{ 'delete'|_ }}"
href="{{ route('rules.delete', rule.id) }}"
class="btn btn-danger"><span
class="fa fa-fw fa-trash"></span></a>
</div>
</td>
<td>
<div class="btn-group btn-group-xs test_buttons">
{% if rule.active %}
{# show which transactions would match #}
<a href="{{ route('rules.search',rule.id) }}" class="btn btn-default {% if false == rule.strict %}test_rule_triggers{% endif %}" data-id="{{ rule.id }}" title="{{ 'test_rule_triggers'|_ }}"><span data-id="{{ rule.id }}" class="fa fa-fw fa-flask"></span></a>
{# actually execute rule #}
<a href="{{ route('rules.select-transactions',rule.id) }}" class="btn btn-default" title=" {{ trans('firefly.apply_rule_selection', {title: rule.title}) }}"><span class="fa fa-fw fa-power-off "></span></a>
{% endif %}
{# duplicate rule #}
<a href="#" class="btn btn-default duplicate-rule" data-id="{{ rule.id }}" title=" {{ trans('firefly.duplicate_rule', {title: rule.title}) }}"><span class="fa fa-fw fa-copy"></span></a>
</div>
</td>
<td class="markdown">
{% if rule.active %}
{{ rule.title }}
{% else %}
<s>{{ rule.title }}</s> ({{ 'inactive'|_|lower }})
{% endif %}
{% if rule.stop_processing %}
<span class="fa fa-stop-circle-o"></span>
{% endif %}
{% if rule.description != "" %}
<small class="hidden-xs"
{% if not rule.active %}
class="text-muted"
{% endif %}
><br/>{{ rule.description|default('')|markdown }}</small>
{% endif %}
<small><br />{% if rule.strict %}<span class="text-danger">{{ 'rule_is_strict'|_ }}</span>{% else %}<span class="text-success">{{ 'rule_is_not_strict'|_ }}</span>{% endif %}</small>
</td>
<td class="hidden-xs">
{% if rule.ruleTriggers.count() > 0 %}
<ul class="small" data-id="{{ rule.id }}">
{% for trigger in rule.ruleTriggers %}
{% if trigger.trigger_type != "user_action" %}
<li
{% if not rule.active %}
class="text-muted"
{% endif %}
data-id="{{ trigger.id }}">
{{ trans(('firefly.rule_trigger_' ~ getRootSearchOperator(trigger.trigger_type)), {trigger_value: trigger.trigger_value}) }}
{% if trigger.stop_processing %}
<span class="fa fa-stop-circle-o"></span>
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
</td>
<td class="hidden-xs">
{% if rule.ruleActions.count() > 0 %}
<ul class="small" data-id="{{ rule.id }}">
{% for action in rule.ruleActions %}
<li
{% if not rule.active %}
class="text-muted"
{% endif %}
data-id="{{ action.id }}">{{ trans(('firefly.rule_action_' ~ action.action_type), {action_value: action.action_value}) }}
{% if action.stop_processing %}
<span class="fa fa-stop-circle-o"></span>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>
<em>{{ 'no_rules_in_group'|_ }}</em>
</p>
{% endif %}
<p>
<br/>
<a href="{{ route('rules.create', ruleGroup.id) }}"
class="btn btn-success new_rule">{{ 'new_rule'|_ }}</a>
</p>
</div>
</div>
</div>
</div>
{% endfor %}
{% include 'v1.rules.partials.test-trigger-modal' %}
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<a href="{{ route('rule-groups.create') }}" class="btn btn-success">{{ 'new_rule_group'|_ }}</a>
</div>
</div>
{% endblock %}
{% block scripts %}
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var moveRuleGroupUrl = '{{ route('rule-groups.move') }}';
var duplicateRuleUrl = '{{ route('rules.duplicate') }}';
</script>
<script type="text/javascript" src="v1/js/lib/jquery-ui.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/rules/index.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}

View File

@@ -0,0 +1,32 @@
<tr data-count="{{ count }}" class="rule-action-holder">
<td style="width:40px;">
<a href="#" class="btn btn-danger btn-sm remove-action"><span class="fa fa-trash"></span></a>
</td>
<td style="width:30%;">
{# See reference nr. 2 #}
<select name="actions[{{ count }}][type]" class="form-control">
{% for key,type in allRuleActions() %}
<option value="{{ key }}" label="{{ type }}" {% if key == oldAction %} selected{% endif %}>{{ type }}</option>
{% endfor %}
</select>
</td>
<td style="position: relative;">
<input autocomplete="off" type="text" value="{{ oldValue }}" name="actions[{{ count }}][value]"
class="form-control">
{% if errors.has('actions.'~count~'.value') %}
<p class="text-danger">
{{ errors.first('actions.'~count~'.value') }}
</p>
{% endif %}
</td>
<td style="width:20%;">
<div class="checkbox">
<label>
<input type="checkbox" name="actions[{{ count }}][stop_processing]" value="1"
{% if oldChecked %}checked{% endif %}
/>
</label>
</div>
</td>
</tr>

View File

@@ -0,0 +1,21 @@
<div class="modal fade" id="testTriggerModal" tabindex="-1" role="dialog" aria-labelledby="testTriggerLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span>&times;</span></button>
<h4 class="modal-title" id="testTriggerLabel">{{ 'test_rule_triggers'|_ }}</h4>
</div>
<div class="modal-body">
<div class="transaction-warning alert alert-warning">
<h4><span class="icon fa fa-warning"></span> {{ 'flash_warning'|_ }}</h4>
<span class="warning-contents"></span>
</div>
<div class="transactions-list">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ 'close'|_ }}</button>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,34 @@
<tr data-count="{{ count }}" class="rule-trigger-holder">
<td style="width:40px;">
<a href="#" class="btn btn-danger btn-sm remove-trigger"><span class="fa fa-trash"></span></a>
</td>
<td style="width:30%;">
<select name="triggers[{{ count }}][type]" class="form-control">
{% for key,type in triggers %}
<option value="{{ key }}" label="{{ type }}"
{% if key == oldTrigger %}
selected
{% endif %}
>{{ type }}</option>
{% endfor %}
</select>
</td>
<td>
<input autocomplete="off" type="text" value="{{ oldValue }}" name="triggers[{{ count }}][value]"
class="form-control">
{% if errors.has('triggers.'~count~'.value') %}
<p class="text-danger">
{{ errors.first('triggers.'~count~'.value') }}
</p>
{% endif %}
</td>
<td style="width:20%;">
<div class="checkbox">
<label>
<input type="checkbox" name="triggers[{{ count }}][stop_processing]" value="1"
{% if oldChecked %}checked{% endif %}
/>
</label>
</div>
</td>
</tr>

View File

@@ -0,0 +1,56 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('rule-groups.store') }}" accept-charset="UTF-8" class="form-horizontal" id="store">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mandatoryFields'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.text('title') }}
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
{# optional fields #}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.textarea('description') }}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
{# 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-group') }}
</div>
<div class="box-footer">
<button type="submit" class="btn pull-right btn-success">{{ 'store_new_rule_group'|_ }}</button>
</div>
</div>
</div>
</div>
</form>
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="v1/js/ff/rule-groups/create.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}

View File

@@ -0,0 +1,54 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, ruleGroup) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('rule-groups.destroy',ruleGroup.id) }}" accept-charset="UTF-8" class="form-horizontal" id="destroy">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-6 col-lg-offset-3 col-md-12 col-sm-12">
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('form.delete_rule_group', {'title': ruleGroup.title}) }}</h3>
</div>
<div class="box-body">
<p class="text-danger">
{{ trans('form.permDeleteWarning') }}
</p>
<p>
{{ trans('form.ruleGroup_areYouSure', {'title': ruleGroup.title}) }}
</p>
{% if ruleGroup.rules|length > 0 %}
<p class="text-danger">
{{ trans_choice('form.also_delete_rules', ruleGroup.rules|length) }}
</p>
<p class="text-success">
{{ trans_choice('firefly.save_rules_by_moving', ruleGroup.rules|length) }}
</p>
<p>
{{ RuleForm.ruleGroupListWithEmpty('move_rules_before_delete',null, {'hidden': ruleGroup.id}) }}
</p>
{% else %}
<input type="hidden" name="move_rules_before_delete" value="0"/>
{% endif %}
</div>
<div class="box-footer">
<input type="submit" name="submit" value="{{ trans('form.deletePermanently') }}" class="btn btn-danger pull-right"/>
<a href="{{ URL.previous() }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
</div>
</div>
</div>
</div>
</form>
{% endblock %}

View File

@@ -0,0 +1,60 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, ruleGroup) }}
{% endblock %}
{% block content %}
{{ Form.model(ruleGroup, {'class' : 'form-horizontal','id' : 'update','url' : route('rule-groups.update',ruleGroup.id) } ) }}
<input type="hidden" name="id" value="{{ ruleGroup.id }}"/>
<div class="row">
<div class="col-lg-6 col-md-12 col-sm-6">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mandatoryFields'|_ }}</h3>
</div>
<div class="box-body">
{# only correct way to do active checkbox #}
{{ ExpandedForm.checkbox('active', 1) }}
{{ ExpandedForm.text('title') }}
</div>
</div>
</div>
<div class="col-lg-6 col-md-12 col-sm-6">
{# optional fields #}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.textarea('description', ruleGroup.description) }}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
{# 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('update','rule-group') }}
</div>
<div class="box-footer">
<button type="submit" class="btn pull-right btn-success">{{ 'update_rule_group'|_ }}</button>
</div>
</div>
</div>
</div>
</form>
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="v1/js/ff/rule-groups/edit.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}

View File

@@ -0,0 +1,56 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, ruleGroup) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('rule-groups.execute', ruleGroup.id) }}" accept-charset="UTF-8" class="form-horizontal" id="execute-rule-group">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-12 col-sm-12 col-xs-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ subTitle }}</h3>
</div>
<div class="box-body">
<div id="form-body">
<p>
{{ trans('firefly.apply_rule_group_selection_intro', {title: ruleGroup.title}) }}
</p>
<p class="text-danger">
{{ 'apply_rule_warning'|_ }}
</p>
<div class="row">
<div class="col-lg-6 col-md-8 col-sm-12 col-xs-12">
{{ ExpandedForm.date('start', first) }}
{{ ExpandedForm.date('end', today) }}
{{ AccountForm.assetAccountCheckList('accounts', {'select_all': true,'class': 'account-checkbox', 'label': trans('firefly.include_transactions_from_accounts') }) }}
</div>
</div>
</div>
</div>
<div class="box-footer">
<input type="submit" name="submit" value="{{ 'execute'|_ }}" id="do-execute-button" class="btn btn-success pull-right"/>
</div>
</div>
</div>
</div>
</form>
{% endblock %}
{% block scripts %}
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var askReadWarning = "{{ trans('firefly.rules_have_read_warning')|escape('js') }}";
</script>
<script type="text/javascript" src="v1/js/lib/modernizr-custom.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/jquery-ui.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/rules/select-transactions.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}
{% block styles %}
<link href="v1/css/jquery-ui/jquery-ui.structure.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all" nonce="{{ JS_NONCE }}">
<link href="v1/css/jquery-ui/jquery-ui.theme.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all" nonce="{{ JS_NONCE }}">
{% endblock %}

View File

@@ -0,0 +1,158 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, ruleGroup) }}
{% endblock %}
{% block content %}
<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 }}"/>
<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 %}"/>
<input type="hidden" name="active" value="1"/>
{% 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">
<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()) }}
{{ RuleForm.ruleGroupList('rule_group_id', ruleGroup.id) }}
{{ ExpandedForm.checkbox('stop_processing',1,null, {helpText: trans('firefly.rule_help_stop_processing')}) }}
{{ ExpandedForm.checkbox('strict',1, null,{helpText: trans('firefly.rule_help_strict')}) }}
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
{# optional fields #}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.textarea('description', null, {helpText: trans('firefly.field_supports_markdown')}) }}
</div>
</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>
</table>
<p>
<br/>
<button type="button" class="btn btn-default add_rule_trigger">{{ 'add_rule_trigger'|_ }}</button>
<a href="#" class="btn btn-default test_rule_triggers"><span class="fa fa-flask"></span> {{ 'test_rule_triggers'|_ }}</a>
</p>
</div>
</div>
</div>
</div>
{% include 'v1.rules.partials.test-trigger-modal' %}
<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>
<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>
</table>
<p>
<br/>
<a href="#" class="btn btn-default add_rule_action">{{ 'add_rule_action'|_ }}</a>
</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
{# 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>
</div>
</div>
</div>
</form>
{% endblock %}
{% block scripts %}
<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 }}">
var triggerCount = {{ triggerCount }};
var actionCount = {{ actionCount }};
var testRuleTriggersText = '{{ 'test_rule_triggers'|_|escape('js') }}';
</script>
<script type="text/javascript" src="v1/js/ff/rules/create-edit.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}
{% block styles %}
{% endblock %}

View File

@@ -0,0 +1,34 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, rule) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('rules.destroy',rule.id) }}" accept-charset="UTF-8" class="form-horizontal" id="destroy">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-6 col-lg-offset-3 col-md-12 col-sm-12">
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('form.delete_rule', {'title': rule.title}) }}</h3>
</div>
<div class="box-body">
<p class="text-danger">
{{ trans('form.permDeleteWarning') }}
</p>
<p>
{{ trans('form.rule_areYouSure', {'title': rule.title}) }}
</p>
</div>
<div class="box-footer">
<input type="submit" name="submit" value="{{ trans('form.deletePermanently') }}" class="btn btn-danger pull-right"/>
<a href="{{ URL.previous() }}" class="btn-default btn">{{ trans('form.cancel') }}</a>
</div>
</div>
</div>
</div>
</form>
{% endblock %}

View File

@@ -0,0 +1,139 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, rule) }}
{% endblock %}
{% block content %}
{{ Form.model(rule, {'class' : 'form-horizontal','id' : 'store','url' : route('rules.update', rule.id)}) }}
<input type="hidden" name="id" value="{{ rule.id }}"/>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ 'mandatoryFields'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.text('title') }}
{{ RuleForm.ruleGroupList('rule_group_id', ruleGroup.id) }}
{{ ExpandedForm.select('trigger',allJournalTriggers(), primaryTrigger) }}
{# only correct way to do active checkbox #}
{{ ExpandedForm.checkbox('active', 1, null, {helpText: trans('firefly.rule_help_active')}) }}
{{ ExpandedForm.checkbox('stop_processing',1,rule.stop_processing, {helpText: trans('firefly.rule_help_stop_processing')}) }}
{{ ExpandedForm.checkbox('strict',1,rule.strict, {helpText: trans('firefly.rule_help_strict')}) }}
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
{# optional fields #}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
</div>
<div class="box-body">
{{ ExpandedForm.textarea('description', rule.description, {helpText: trans('firefly.field_supports_markdown')}) }}
</div>
</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>
</table>
<p>
<br/>
<a href="#" class="btn btn-default add_rule_trigger">{{ 'add_rule_trigger'|_ }}</a>
<a href="#" class="btn btn-default test_rule_triggers"><span class="fa fa-flask"></span> {{ 'test_rule_triggers'|_ }}</a>
</p>
</div>
</div>
</div>
</div>
{% include 'v1.rules.partials.test-trigger-modal' %}
<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>
<div class="box-body">
<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>
</table>
<p>
<br/>
<a href="#" class="btn btn-default add_rule_action">{{ 'add_rule_action'|_ }}</a>
</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
{# 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('update','rule') }}
</div>
<div class="box-footer">
<button type="submit" class="btn pull-right btn-success">{{ 'update_rule'|_ }}</button>
</div>
</div>
</div>
</div>
</form>
{% endblock %}
{% block scripts %}
<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 }}">
var triggerCount = {{ triggerCount }};
var actionCount = {{ actionCount }};
var testRuleTriggersText = '{{ 'test_rule_triggers'|_|escape('js') }}';
</script>
<script type="text/javascript" src="v1/js/ff/rules/create-edit.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}

View File

@@ -0,0 +1,56 @@
{% extends './v1/layout/default' %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, rule) }}
{% endblock %}
{% block content %}
<form method="POST" action="{{ route('rules.execute', rule.id) }}" accept-charset="UTF-8" class="form-horizontal" id="execute-rule">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-12 col-sm-12 col-xs-12">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ subTitle }}</h3>
</div>
<div class="box-body">
<div id="form-body">
<p>
{{ trans('firefly.apply_rule_selection_intro', {title: rule.title}) }}
</p>
<p class="text-danger">
{{ 'apply_rule_warning'|_ }}
</p>
<div class="row">
<div class="col-lg-6 col-md-8 col-sm-12 col-xs-12">
{{ ExpandedForm.date('start', first) }}
{{ ExpandedForm.date('end', today) }}
{{ AccountForm.assetAccountCheckList('accounts', {'select_all': true, 'class': 'account-checkbox', 'label': trans('firefly.include_transactions_from_accounts') }) }}
</div>
</div>
</div>
</div>
<div class="box-footer">
<input type="submit" name="submit" value="{{ 'execute'|_ }}" id="do-execute-button" class="btn btn-success pull-right"/>
</div>
</div>
</div>
</div>
</form>
{% endblock %}
{% block scripts %}
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var askReadWarning = "{{ trans('firefly.rules_have_read_warning')|escape('js') }}";
</script>
<script type="text/javascript" src="v1/js/lib/modernizr-custom.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/jquery-ui.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/rules/select-transactions.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>
{% endblock %}
{% block styles %}
<link href="v1/css/jquery-ui/jquery-ui.structure.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all" nonce="{{ JS_NONCE }}">
<link href="v1/css/jquery-ui/jquery-ui.theme.min.css?v={{ FF_VERSION }}" type="text/css" rel="stylesheet" media="all" nonce="{{ JS_NONCE }}">
{% endblock %}