From 843db021a1e8490a72cec55a81cd36c2842284c2 Mon Sep 17 00:00:00 2001 From: vantezzen Date: Thu, 5 Sep 2019 10:38:50 +0200 Subject: Convert static pages to edge views --- public/import.html | 95 ------------------------------ public/index.html | 49 ---------------- public/new.html | 115 ------------------------------------- resources/views/others/import.edge | 19 ++++++ resources/views/others/index.edge | 38 ++++++++++++ resources/views/others/new.edge | 40 +++++++++++++ start/routes.js | 12 ++-- 7 files changed, 105 insertions(+), 263 deletions(-) delete mode 100644 public/import.html delete mode 100644 public/index.html delete mode 100644 public/new.html create mode 100644 resources/views/others/import.edge create mode 100644 resources/views/others/index.edge create mode 100644 resources/views/others/new.edge diff --git a/public/import.html b/public/import.html deleted file mode 100644 index 5c75d23..0000000 --- a/public/import.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - Import Franz account - - - - - - - -

Import a Franz account

-

Please login using your Franz account. We will create a new Ferdi account with the same credentials.

-
-
-
- -
-
- - - - By importing your Franz account, you accept the Terms of service and Privacy policy - -
- - - - - diff --git a/public/index.html b/public/index.html deleted file mode 100644 index ee9ff44..0000000 --- a/public/index.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - ferdi-server - - - - - - - -

ferdi-server

- -

You are accessing a custom Ferdi server.

-

- To use this server in your Ferdi client, open Ferdi's settings and as the server, enter -

-

- Alternatively, you can manage your account in the account dashboard. -

- -
- - ferdi-server is a project by vantezzen. - - - - - - diff --git a/public/new.html b/public/new.html deleted file mode 100644 index c11da47..0000000 --- a/public/new.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - Create a new service - - - - - - - -

Create a new recipe

-

Please create a recipe using the - official Franz guide, then publish it here.

-
-
-
- -
-
- -
-
- -
-
- -
-
- *These images must be publicly availible and have CORS enabled in order to work.

- -
-
-
- Drop recipe files here
or click here to select files -

- Drag and drop your recipe files into this area.
- Please do not select the folder that contains the files but rather the files itself. -

-
-
-

- - -
- - - - - diff --git a/resources/views/others/import.edge b/resources/views/others/import.edge new file mode 100644 index 0000000..b890bbb --- /dev/null +++ b/resources/views/others/import.edge @@ -0,0 +1,19 @@ +@layout('layouts.main') + +@section('content') +

Import a Franz account

+

Please login using your Franz account. We will create a new Ferdi account with the same credentials.

+
+
+
+ +
+
+ + + + By importing your Franz account, you accept the Terms of service and Privacy + policy + +
+@endsection diff --git a/resources/views/others/index.edge b/resources/views/others/index.edge new file mode 100644 index 0000000..c594d31 --- /dev/null +++ b/resources/views/others/index.edge @@ -0,0 +1,38 @@ +@layout('layouts.main') + +@section('content') + +

ferdi-server

+

You are accessing a custom Ferdi server.

+

+ To use this server in your Ferdi client, open Ferdi's settings and as the + server, enter +

+

+ Alternatively, you can manage your account in the account dashboard. +

+ +
+ + ferdi-server is a project by vantezzen. + + + +@endsection diff --git a/resources/views/others/new.edge b/resources/views/others/new.edge new file mode 100644 index 0000000..1b54558 --- /dev/null +++ b/resources/views/others/new.edge @@ -0,0 +1,40 @@ +@layout('layouts.main') + +@section('content') +

Create a new recipe

+

Please create a recipe using the + official Franz guide, then publish it here.

+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ *These images must be publicly availible and have CORS enabled in order to work.

+ +
+
+
+ Drop recipe files here
or click here to select files +

+ Drag and drop your recipe files into this area.
+ Please do not select the folder that contains the files but rather the files itself. +

+
+
+

+ + +
+ + +@endsection diff --git a/start/routes.js b/start/routes.js index d857ce9..5cf9fda 100644 --- a/start/routes.js +++ b/start/routes.js @@ -83,20 +83,24 @@ Route.group(() => { // Recipe creation Route.post('new', 'RecipeController.create') -Route.get('new', ({ response }) => { +Route.get('new', ({ response, view }) => { if (Env.get('IS_CREATION_ENABLED') == 'false') { return response.send('This server doesn\'t allow the creation of new recipes.\n\nIf you are the server owner, please set IS_CREATION_ENABLED to true to enable recipe creation.'); } else { - return response.redirect('/new.html') + return view.render('others.new') } }) // Franz account import Route.post('import', 'UserController.import') -Route.get('import', ({ response }) => response.redirect('/import.html')) +Route.get('import', ({ view }) => view.render('others.import')) // Legal documents Route.get('terms', ({ response }) => response.redirect('/terms.html')) Route.get('privacy', ({ response }) => response.redirect('/privacy.html')) -Route.get('/', ({ response }) => response.redirect('/index.html')) +// Index +Route.get('/', ({ view }) => view.render('others.index')) + +// 404 handler +Route.get('/*', ({ response }) => response.redirect('/')) \ No newline at end of file -- cgit v1.2.3-54-g00ecf