1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 07:02:34 +01:00
invoiceninja/app/views/accounts/payments.blade.php

115 lines
3.5 KiB
PHP
Raw Normal View History

2013-11-26 13:45:07 +01:00
@extends('accounts.nav')
@section('content')
@parent
2013-12-15 13:55:50 +01:00
{{ Former::open()->addClass('col-md-8 col-md-offset-2') }}
2013-12-04 17:20:14 +01:00
{{ Former::populate($account) }}
2014-01-30 23:29:09 +01:00
{{ Former::populateField('notify_sent', intval(Auth::user()->notify_sent)) }}
{{ Former::populateField('notify_viewed', intval(Auth::user()->notify_viewed)) }}
{{ Former::populateField('notify_paid', intval(Auth::user()->notify_paid)) }}
2013-12-04 17:20:14 +01:00
{{ Former::legend('Payment Gateway') }}
2014-04-13 07:28:16 +02:00
<div class="two-column">
{{ Former::radios('recommendedGateway_id')
->label('Recommended Gateways')
->radios($recommendedGateways)
->class('recommended-gateway')}}
</div>
2013-11-26 13:45:07 +01:00
@if ($accountGateway)
{{ Former::populateField('gateway_id', $accountGateway->gateway_id) }}
@foreach ($accountGateway->fields as $field => $junk)
2014-03-19 09:49:33 +01:00
@if (in_array($field, ['solutionType', 'landingPage', 'headerImageUrl', 'brandName']))
{{-- do nothing --}}
2014-01-09 00:22:56 +01:00
@else
{{ Former::populateField($accountGateway->gateway_id.'_'.$field, $config->$field) }}
@endif
@endforeach
@endif
2013-11-26 13:45:07 +01:00
{{ Former::select('gateway_id')->label('PayPal & Other Gateways')->addOption('', '')
->dataClass('gateway-dropdown')
->fromQuery($gateways, 'name', 'id')
->onchange('setFieldsShown()'); }}
@foreach ($gateways as $gateway)
2013-11-26 13:45:07 +01:00
<div id="gateway_{{ $gateway->id }}_div" class='gateway-fields' style="display: none">
2013-11-26 13:45:07 +01:00
@foreach ($gateway->fields as $field => $details)
2014-03-18 22:25:54 +01:00
@if (in_array($field, ['solutionType', 'landingPage', 'headerImageUrl', 'brandName']))
{{-- do nothing --}}
@elseif ($field == 'testMode' || $field == 'developerMode')
2014-02-02 21:37:37 +01:00
{{-- Former::checkbox($gateway->id.'_'.$field)->label(Utils::toSpaceCase($field))->text('Enable') --}}
2014-03-17 19:05:01 +01:00
@elseif ($field == 'username' || $field == 'password')
{{ Former::text($gateway->id.'_'.$field)->label('API '. ucfirst(Utils::toSpaceCase($field))) }}
@else
2013-12-07 21:33:07 +01:00
{{ Former::text($gateway->id.'_'.$field)->label(Utils::toSpaceCase($field)) }}
2013-11-26 13:45:07 +01:00
@endif
2013-11-26 13:45:07 +01:00
@endforeach
</div>
2013-11-26 13:45:07 +01:00
@endforeach
{{ Former::actions( Button::lg_success_submit('Save')->append_with_icon('floppy-disk') ) }}
2013-11-26 13:45:07 +01:00
{{ Former::close() }}
<script type="text/javascript">
function setFieldsShown() {
var val = $('#gateway_id').val();
var activeElement = $('.recommended-gateway[value=' + val + ']');
var recommendedRadios = $('#recommendedGateway_id');
$('.gateway-fields').hide();
$('#gateway_' + val + '_div').show();
if(activeElement && !activeElement.attr('checked'))
{
activeElement.attr('checked', true);
}
}
2013-11-26 13:45:07 +01:00
$(document).ready(function() {
$('.recommended-gateway').change(
function(){
var recVal = $(this).val();
$('#gateway_id').val(recVal);
setFieldsShown();
}
);
$('select[data-class=gateway-dropdown]').change(function(){
$('.recommended-gateway').attr('checked', false);
var activeElement = $('.recommended-gateway[value=' + $(this).val() + ']');
if(activeElement)
{
activeElement.attr('checked', true);
}
});
$('.recommended-gateway').each(function(){
var contents = $(this).parent().contents();
contents[contents.length - 1].nodeValue = '';
$(this).after('<img src="' +$(this).attr('data-imageUrl') + '" /><br />');
$(this).parent().children().last().after('<a href="' + $(this).attr('data-siteUrl') + '">Create an account</a>');
if($(this).attr('data-newRow') && true)
{
}
});
setFieldsShown();
2014-03-30 01:21:37 +01:00
$('.two-column .form-group .col-lg-8').removeClass('col-lg-8');
$('.two-column .form-group .col-sm-8').removeClass('col-sm-8');
2013-11-26 13:45:07 +01:00
});
</script>
@stop