First code for YNAB import #145

This commit is contained in:
James Cole
2018-07-29 07:30:06 +02:00
parent a1005d91df
commit 8efbeb14d2
16 changed files with 627 additions and 13 deletions

View File

@@ -18,11 +18,18 @@
{% for name, provider in providers %}
{# button for each import thing: #}
<div class="col-lg-1 col-md-4 col-sm-6 text-center">
{% if not provider.allowed_for_demo and isDemoUser %}
<img src="images/logos/{{ name }}.png" alt="{{ trans(('import.button_'~name)) }}"/><br/>
{{ trans(('import.button_'~name)) }}<br>
({{ trans('import.disabled_for_demo_user') }})
{% else %}
<a href="{{ route('import.create', [name]) }}">
<img src="images/logos/{{ name }}.png" alt="{{ trans(('import.button_'~name)) }}"/><br/>
{{ trans(('import.button_'~name)) }}
</a>
{% endif %}
</div>
{% endfor %}
</div>
</div>

View File

@@ -11,4 +11,4 @@
<body>
If you are not redirected automatically, follow this <a href='{{ data['token-url'] }}'>link to Spectre.</a>.
</body>
</html>#}
</html>

View File

@@ -0,0 +1,53 @@
{% extends "./layout/default" %}
{% block breadcrumbs %}
{{ Breadcrumbs.render }}
{% endblock %}
{% block content %}
<div class="row">
<form class="form-horizontal" action="{{ route('import.prerequisites.post',['ynab', importJob.key]) }}" method="post">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('import.prereq_ynab_title') }}</h3>
</div>
<div class="box-body">
<div class="row">
<div class="col-lg-8">
<p>
{{ trans('import.prereq_ynab_text')|raw }}
</p>
<p>
{{ trans('import.prereq_ynab_redirect')|raw }}
<br /><br />
<code>{{ callback_uri }}</code>
</p>
</div>
</div>
<div class="row">
<div class="col-lg-8">
{{ ExpandedForm.text('client_id', client_id) }}
</div>
</div>
<div class="row">
<div class="col-lg-8">
{{ ExpandedForm.text('client_secret', client_secret) }}
</div>
</div>
</div>
<div class="box-footer">
<button type="submit" class="btn pull-right btn-success">
{{ ('submit')|_ }}
</button>
</div>
</div>
</div>
</form>
</div>
{% endblock %}
{% block scripts %}
{% endblock %}
{% block styles %}
{% endblock %}

View File

@@ -0,0 +1,14 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url={{ data['token-url'] }}">
<script type="text/javascript">
window.location.href = "{{ data['token-url'] }}";
</script>
<title>Page Redirection</title>
</head>
<body>
If you are not redirected automatically, follow this <a href='{{ data['token-url'] }}'>link to YNAB.</a>.
</body>
</html>