From a447c886c4472e532b9af5865c772e557a36adc1 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 22 May 2016 21:11:30 +0200 Subject: [PATCH] Basic for for #262 Signed-off-by: James Cole --- app/Http/Controllers/ImportController.php | 41 ++++++++++++++++++ app/Http/routes.php | 5 +++ app/Support/Twig/General.php | 3 +- resources/views/import/index.twig | 52 +++++++++++++++++++++++ 4 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 app/Http/Controllers/ImportController.php create mode 100644 resources/views/import/index.twig diff --git a/app/Http/Controllers/ImportController.php b/app/Http/Controllers/ImportController.php new file mode 100644 index 0000000000..0319bdb87f --- /dev/null +++ b/app/Http/Controllers/ImportController.php @@ -0,0 +1,41 @@ + 'Chart\ReportController@yearInOutSummarized']); Route::get('/chart/report/net-worth/{reportType}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\ReportController@netWorth']); + /** + * IMPORT CONTROLLER + */ + Route::get('/import', ['uses' => 'ImportController@index','as' => 'import.index']); + Route::post('/import/upload', ['uses' => 'ImportController@upload','as' => 'import.upload']); /** * Help Controller diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index 80315ff5d1..d937f51863 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -87,7 +87,8 @@ class General extends Twig_Extension 'activeRoutePartial', function () : string { $args = func_get_args(); $route = $args[0]; // name of the route. - if (!(strpos(Route::getCurrentRoute()->getName(), $route) === false)) { + $name = Route::getCurrentRoute()->getName() ?? ''; + if (!(strpos($name, $route) === false)) { return 'active'; } diff --git a/resources/views/import/index.twig b/resources/views/import/index.twig new file mode 100644 index 0000000000..16ea17886e --- /dev/null +++ b/resources/views/import/index.twig @@ -0,0 +1,52 @@ +{% extends "./layout/default.twig" %} + +{% block breadcrumbs %} + {{ Breadcrumbs.renderIfExists }} +{% endblock %} +{% block content %} +
+
+ +
+
+

{{ 'import'|_ }}

+
+
+

+ {{ 'import_intro_text'|_ }} +

+

+   +

+
+
+ + + +
+ {{ ExpandedForm.file('import_file',{helpText: 'import_file_help'|_}) }} + + {{ ExpandedForm.select('import_file_type', importFileTypes, defaultImportType, {'helpText' : 'import_file_type_help'|_}) }} + +
+ + +
+ +
+
+
+
+
+
+
+
+
+{% endblock %} +{% block scripts %} +{% endblock %} +{% block styles %} +{% endblock %}