Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions resources/views/others/import.edge
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

@section('content')
<div class="w-screen bg-purple-200 flex items-center justify-center">
@if(connectWithFranz)
<form class="w-full max-w-sm bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4"
action="/import" method="POST">
<h1 class="text-gray-700 text-center text-2xl pb-5">
Expand Down Expand Up @@ -63,5 +64,27 @@
</a>
</div>
</form>
@else
<div class="w-full max-w-sm bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
<h1 class="text-gray-700 text-center text-2xl pb-5">
Franz/Ferdi Import Unavailable
</h1>
<div class="bg-orange-100 border-l-4 border-orange-500 text-orange-700 p-4 mb-4">
<p class="font-bold mb-1">Account import is disabled</p>
<p class="text-sm">
This server does not have Franz/Ferdi account imports enabled. To use Ferdium with this server, please create a new account directly instead.
</p>
</div>
<p class="text-gray-600 text-sm text-center py-2 mb-4">
If you are the server administrator and want to enable imports, set the <code class="bg-gray-100 px-1 rounded">CONNECT_WITH_FRANZ</code> environment variable to <code class="bg-gray-100 px-1 rounded">true</code> and restart the server.
</p>
<div class="text-center space-y-2">
<a class="block w-full bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline text-center"
href="/user/login">
Login to an existing account
</a>
</div>
</div>
@endif
</div>
@endsection
5 changes: 4 additions & 1 deletion start/routes/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ Route.group(() => {
}).prefix('user');

// Franz/Ferdi account import
Route.get('import', ({ view }) => view.render('others/import'));
Route.get('import', ({ view }) => {
const { connectWithFranz } = require('../config/app');
return view.render('others/import', { connectWithFranz: connectWithFranz !== 'false' });
});
Route.post('import', 'UserController.import');

// 404 handler
Expand Down