2015-09-17 21:01:06 +02:00
|
|
|
<div role="tabpanel" class="tab-pane {{ isset($active) && $active ? 'active' : '' }}" id="{{ $field }}">
|
2015-11-05 11:02:14 +01:00
|
|
|
<div class="panel-body" style="padding-bottom: 0px">
|
2015-09-17 21:01:06 +02:00
|
|
|
@if (isset($isReminder) && $isReminder)
|
2015-12-28 11:15:56 +01:00
|
|
|
|
|
|
|
{!! Former::populateField('enable_' . $field, intval($account->{'enable_' . $field})) !!}
|
2017-07-27 12:23:39 +02:00
|
|
|
@if (floatval($fee = $account->account_email_settings->{"late_fee{$number}_amount"}))
|
|
|
|
{!! Former::populateField('late_fee' . $number . '_amount', $fee) !!}
|
|
|
|
@endif
|
|
|
|
@if (floatval($fee = $account->account_email_settings->{"late_fee{$number}_percent"}))
|
|
|
|
{!! Former::populateField('late_fee' . $number . '_percent', $fee) !!}
|
|
|
|
@endif
|
2015-12-28 11:15:56 +01:00
|
|
|
|
2017-07-18 20:15:51 +02:00
|
|
|
<div class="well" style="padding-bottom:20px">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6">
|
|
|
|
{!! Former::plaintext('schedule')
|
|
|
|
->value(
|
|
|
|
Former::input('num_days_' . $field)
|
|
|
|
->style('float:left;width:20%')
|
|
|
|
->raw() .
|
|
|
|
Former::select('direction_' . $field)
|
|
|
|
->addOption(trans('texts.days_before'), REMINDER_DIRECTION_BEFORE)
|
|
|
|
->addOption(trans('texts.days_after'), REMINDER_DIRECTION_AFTER)
|
|
|
|
->style('float:left;width:40%')
|
|
|
|
->raw() .
|
|
|
|
'<div id="days_after_'. $field .'" style="float:left;width:40%;display:none;padding-top:8px;padding-left:16px;font-size:16px;">' . trans('texts.days_after') . '</div>' .
|
|
|
|
Former::select('field_' . $field)
|
|
|
|
->addOption(trans('texts.field_due_date'), REMINDER_FIELD_DUE_DATE)
|
|
|
|
->addOption(trans('texts.field_invoice_date'), REMINDER_FIELD_INVOICE_DATE)
|
|
|
|
->style('float:left;width:40%')
|
|
|
|
->raw()
|
|
|
|
) !!}
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
|
|
|
|
|
|
{!! Former::checkbox('enable_' . $field)
|
|
|
|
->text('enable')
|
|
|
|
->label('send_email')
|
|
|
|
->value(1) !!}
|
|
|
|
|
|
|
|
</div>
|
2017-02-02 21:07:17 +01:00
|
|
|
</div>
|
2017-07-18 20:15:51 +02:00
|
|
|
<div class="row" style="padding-top:30px">
|
|
|
|
<div class="col-md-6">
|
|
|
|
{!! Former::text('late_fee' . $number . '_amount')
|
|
|
|
->label('late_fee_amount')
|
|
|
|
->type('number')
|
|
|
|
->step('any') !!}
|
|
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
|
|
{!! Former::text('late_fee' . $number . '_percent')
|
|
|
|
->label('late_fee_percent')
|
|
|
|
->type('number')
|
|
|
|
->step('any')
|
|
|
|
->append('%') !!}
|
|
|
|
</div>
|
2015-09-17 21:01:06 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-07-18 20:15:51 +02:00
|
|
|
|
2017-02-05 13:48:26 +01:00
|
|
|
<br/>
|
2015-09-17 21:01:06 +02:00
|
|
|
@endif
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6">
|
2015-11-04 22:52:12 +01:00
|
|
|
<div class="pull-right"><a href="#" onclick="return resetText('{{ 'subject' }}', '{{ $field }}')">{{ trans("texts.reset") }}</a></div>
|
2015-09-20 23:05:02 +02:00
|
|
|
{!! Former::text('email_subject_' . $field)
|
|
|
|
->label(trans('texts.subject'))
|
2015-12-02 14:26:06 +01:00
|
|
|
->appendIcon('question-sign')
|
2017-02-02 21:07:17 +01:00
|
|
|
->addGroupClass('email-subject') !!}
|
2015-09-17 21:01:06 +02:00
|
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
|
|
<p> <p/>
|
|
|
|
<div id="{{ $field }}_subject_preview"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
2015-11-04 22:52:12 +01:00
|
|
|
<br/>
|
2015-09-17 21:01:06 +02:00
|
|
|
<div class="col-md-6">
|
2015-11-04 22:52:12 +01:00
|
|
|
<div class="pull-right"><a href="#" onclick="return resetText('{{ 'template' }}', '{{ $field }}')">{{ trans("texts.reset") }}</a></div>
|
2015-09-20 23:05:02 +02:00
|
|
|
{!! Former::textarea('email_template_' . $field)
|
|
|
|
->label(trans('texts.body'))
|
2015-11-04 22:52:12 +01:00
|
|
|
->style('display:none') !!}
|
2017-02-02 21:07:17 +01:00
|
|
|
<div id="{{ $field }}Editor" class="form-control" style="min-height:160px">
|
2015-11-04 22:52:12 +01:00
|
|
|
</div>
|
2015-09-17 21:01:06 +02:00
|
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
|
|
<p> <p/>
|
|
|
|
<div id="{{ $field }}_template_preview"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-05-05 16:46:22 +02:00
|
|
|
<p> <p/>
|
2015-11-04 22:52:12 +01:00
|
|
|
<div class="row">
|
2017-10-24 14:55:16 +02:00
|
|
|
<div class="pull-left show-when-ready" style="display:none">
|
2015-11-04 22:52:12 +01:00
|
|
|
@include('partials/quill_toolbar', ['name' => $field])
|
|
|
|
</div>
|
2017-10-24 14:55:16 +02:00
|
|
|
<div class="pull-right" style="padding-top:13px;text-align:right">
|
2016-09-19 11:49:15 +02:00
|
|
|
{!! Button::normal(trans('texts.raw'))->withAttributes(['onclick' => 'showRaw("'.$field.'")'])->small() !!}
|
2016-05-05 16:46:22 +02:00
|
|
|
{!! Button::primary(trans('texts.preview'))->withAttributes(['onclick' => 'serverPreview("'.$field.'")'])->small() !!}
|
|
|
|
</div>
|
2015-11-04 22:52:12 +01:00
|
|
|
</div>
|
2015-09-17 21:01:06 +02:00
|
|
|
</div>
|
2015-11-04 22:52:12 +01:00
|
|
|
</div>
|
|
|
|
|
2015-12-02 14:26:06 +01:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(function() {
|
|
|
|
var editor = new Quill('#{{ $field }}Editor', {
|
|
|
|
modules: {
|
|
|
|
'toolbar': { container: '#{{ $field }}Toolbar' },
|
|
|
|
'link-tooltip': true
|
|
|
|
},
|
|
|
|
theme: 'snow'
|
2015-11-04 22:52:12 +01:00
|
|
|
});
|
2015-12-02 14:26:06 +01:00
|
|
|
editor.setHTML($('#email_template_{{ $field }}').val());
|
|
|
|
editor.on('text-change', function(delta, source) {
|
|
|
|
if (source == 'api') {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
var html = editors['{{ $field }}'].getHTML();
|
|
|
|
$('#email_template_{{ $field }}').val(html);
|
|
|
|
refreshPreview();
|
|
|
|
NINJA.formIsChanged = true;
|
|
|
|
});
|
|
|
|
editors['{{ $field }}'] = editor;
|
|
|
|
|
2015-12-28 11:15:56 +01:00
|
|
|
$('#field_{{ $field }}').change(function() {
|
|
|
|
setDirectionShown('{{ $field }}');
|
|
|
|
})
|
|
|
|
setDirectionShown('{{ $field }}');
|
|
|
|
|
|
|
|
$('.email-subject .input-group-addon').click(function() {
|
|
|
|
$('#templateHelpModal').modal('show');
|
|
|
|
});
|
2015-12-02 14:26:06 +01:00
|
|
|
});
|
|
|
|
|
2016-08-18 11:24:26 +02:00
|
|
|
</script>
|