mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Internationalise several forms for #1090
This commit is contained in:
parent
4ec123a19a
commit
fa676f60fb
@ -22,7 +22,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Auth;
|
||||
|
||||
use FireflyConfig;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
||||
|
||||
/**
|
||||
@ -43,6 +45,24 @@ class ForgotPasswordController extends Controller
|
||||
|
||||
use SendsPasswordResetEmails;
|
||||
|
||||
/**
|
||||
* Display the form to request a password reset link.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function showLinkRequestForm()
|
||||
{
|
||||
// is allowed to?
|
||||
$singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;
|
||||
$userCount = User::count();
|
||||
$allowRegistration = true;
|
||||
if (true === $singleUserMode && $userCount > 0) {
|
||||
$allowRegistration = false;
|
||||
}
|
||||
|
||||
return view('auth.passwords.email')->with(compact('allowRegistration'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*/
|
||||
|
@ -22,8 +22,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Auth;
|
||||
|
||||
use FireflyConfig;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
@ -52,4 +55,28 @@ class ResetPasswordController extends Controller
|
||||
parent::__construct();
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the password reset view for the given token.
|
||||
*
|
||||
* If no token is present, display the link request form.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param string|null $token
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function showResetForm(Request $request, $token = null)
|
||||
{
|
||||
// is allowed to?
|
||||
$singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;
|
||||
$userCount = User::count();
|
||||
$allowRegistration = true;
|
||||
if (true === $singleUserMode && $userCount > 0) {
|
||||
$allowRegistration = false;
|
||||
}
|
||||
return view('auth.passwords.reset')->with(
|
||||
['token' => $token, 'email' => $request->email, 'allowRegistration' => $allowRegistration]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -141,6 +141,16 @@ return [
|
||||
'invalid_server_configuration' => 'Invalid server configuration',
|
||||
'invalid_locale_settings' => 'Firefly III is unable to format monetary amounts because your server is missing the required packages. There are <a href="https://github.com/firefly-iii/help/wiki/Missing-locale-packages">instructions how to do this</a>.',
|
||||
'quickswitch' => 'Quickswitch',
|
||||
'sign_in_to_start' => 'Sign in to start your session',
|
||||
'sign_in' => 'Sign in',
|
||||
'register_new_account' => 'Register a new account',
|
||||
'forgot_my_password' => 'I forgot my password',
|
||||
'problems_with_input' => 'There were some problems with your input.',
|
||||
'reset_password' => 'Reset your password',
|
||||
'button_reset_password' => 'Reset password',
|
||||
'reset_button' => 'Reset',
|
||||
'want_to_login' => 'I want to login',
|
||||
'button_register' => 'Register',
|
||||
|
||||
// check for updates:
|
||||
'update_check_title' => 'Check for updates',
|
||||
@ -613,6 +623,7 @@ return [
|
||||
'bill_will_automatch' => 'Bill will automatically linked to matching transactions',
|
||||
'skips_over' => 'skips over',
|
||||
|
||||
|
||||
// accounts:
|
||||
'details_for_asset' => 'Details for asset account ":name"',
|
||||
'details_for_expense' => 'Details for expense account ":name"',
|
||||
|
@ -78,6 +78,7 @@ return [
|
||||
'new_email_address' => 'New email address',
|
||||
'verification' => 'Verification',
|
||||
'api_key' => 'API key',
|
||||
'remember_me' => 'Remember me',
|
||||
|
||||
'source_account_asset' => 'Source account (asset account)',
|
||||
'destination_account_expense' => 'Destination account (expense account)',
|
||||
|
@ -29,7 +29,7 @@
|
||||
<div class="alert alert-danger alert-dismissible" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert"><span>×</span><span class="sr-only">{{ 'close'|_ }}</span>
|
||||
</button>
|
||||
<strong>Error!</strong> {{ errors.get('email')[0] }}
|
||||
<strong>{{ 'flash_error'|_ }}!</strong> {{ errors.get('email')[0] }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -48,36 +48,36 @@
|
||||
{% endif %}
|
||||
|
||||
<div class="login-box-body">
|
||||
<p class="login-box-msg">Sign in to start your session</p>
|
||||
<p class="login-box-msg">{{ 'sign_in_to_start'|_ }}</p>
|
||||
|
||||
<form action="{{ URL.to('/login') }}" method="post">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
|
||||
|
||||
<div class="form-group has-feedback">
|
||||
<input type="email" name="email" value="{{ email }}" class="form-control" placeholder="Email"/>
|
||||
<input type="email" name="email" value="{{ email }}" class="form-control" placeholder="{{ trans('form.email') }}"/>
|
||||
</div>
|
||||
<div class="form-group has-feedback">
|
||||
<input type="password" name="password" class="form-control" placeholder="Password"/>
|
||||
<input type="password" name="password" class="form-control" placeholder="{{ trans('form.password') }}"/>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-8">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="remember" {% if remember %}checked="checked"{% endif %} value="1"> Remember Me
|
||||
<input type="checkbox" name="remember" {% if remember %}checked="checked"{% endif %} value="1"> {{ trans('form.remember_me') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
<div class="col-xs-4">
|
||||
<button type="submit" class="btn btn-primary btn-block btn-flat">Sign In</button>
|
||||
<button type="submit" class="btn btn-primary btn-block btn-flat">{{ 'sign_in'|_ }}</button>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
</form>
|
||||
{% if allowRegistration %}
|
||||
<a href="{{ URL.to('/register') }}" class="text-center">Register a new account</a><br>
|
||||
<a href="{{ URL.to('/register') }}" class="text-center">{{ 'register_new_account'|_ }}</a><br>
|
||||
{% endif %}
|
||||
<a href="{{ URL.to('/password/reset') }}">I forgot my password</a>
|
||||
<a href="{{ URL.to('/password/reset') }}">{{ 'forgot_my_password'|_ }}</a>
|
||||
</div>
|
||||
<!-- /.login-box-body -->
|
||||
{% endblock %}
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
{% if errors|length > 0 %}
|
||||
<div class="alert alert-danger">
|
||||
<strong>Whoops!</strong> There were some problems with your input.<br><br>
|
||||
<strong>{{ 'flash_error'|_ }}</strong> {{ 'problems_with_input'|_ }}<br><br>
|
||||
<ul>
|
||||
{% for error in errors.all %}
|
||||
<li>{{ error }}</li>
|
||||
@ -28,19 +28,19 @@
|
||||
{{ session('status') }}
|
||||
</p>
|
||||
{% else %}
|
||||
<p class="login-box-msg">Reset your password</p>
|
||||
<p class="login-box-msg">{{ 'reset_password'|_ }}</p>
|
||||
|
||||
<form role="form" method="POST" action="{{ URL.to('/password/email') }}">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
|
||||
|
||||
<div class="form-group has-feedback">
|
||||
<input type="email" class="form-control" name="email" placeholder="Email"/>
|
||||
<input type="email" class="form-control" name="email" placeholder="{{ trans('form.email') }}"/>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- /.col -->
|
||||
<div class="col-xs-12">
|
||||
<button type="submit" class="btn btn-primary btn-flat pull-right">Reset</button>
|
||||
<button type="submit" class="btn btn-primary btn-flat pull-right">{{ 'reset_button'|_ }}</button>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
@ -48,10 +48,9 @@
|
||||
</form>
|
||||
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ URL.to('/login') }}">I want to login</a><br>
|
||||
{% if Config.get('auth.allow_register') %}
|
||||
<a href="{{ route('register') }}" class="text-center">Register a new account</a><br>
|
||||
<a href="{{ URL.to('/login') }}">{{ 'want_to_login'|_ }}</a><br>
|
||||
{% if allowRegistration %}
|
||||
<a href="{{ route('register') }}" class="text-center">{{ 'register_new_account'|_ }}</a><br>
|
||||
{% endif %}
|
||||
|
||||
</div><!-- /.login-box-body -->
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
{% if errors|length > 0 %}
|
||||
<div class="alert alert-danger">
|
||||
<strong>Whoops!</strong> There were some problems with your input.<br><br>
|
||||
<strong>{{ 'flash_error'|_ }}</strong> {{ 'problems_with_input'|_ }}<br><br>
|
||||
<ul>
|
||||
{% for error in errors.all %}
|
||||
<li>{{ error }}</li>
|
||||
@ -14,36 +14,36 @@
|
||||
{% endif %}
|
||||
|
||||
<div class="register-box-body">
|
||||
<p class="login-box-msg">Reset your password</p>
|
||||
<p class="login-box-msg">{{ 'reset_password'|_ }}</p>
|
||||
<form method="POST" action="{{ url('/password/reset') }}">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
||||
<input type="hidden" name="token" value="{{ token }}">
|
||||
|
||||
<div class="form-group has-feedback">
|
||||
<input type="email" name="email" class="form-control" value="{{ old('email') }}" placeholder="Email"/>
|
||||
<input type="email" name="email" class="form-control" value="{{ old('email') }}" placeholder="{{ trans('form.email') }}"/>
|
||||
</div>
|
||||
|
||||
<div class="form-group has-feedback">
|
||||
<input type="password" class="form-control" placeholder="Password" name="password"/>
|
||||
<input type="password" class="form-control" placeholder="{{ trans('form.password') }}" name="password"/>
|
||||
</div>
|
||||
|
||||
<div class="form-group has-feedback">
|
||||
<input type="password" class="form-control" placeholder="Password (again)" name="password_confirmation"/>
|
||||
<input type="password" class="form-control" placeholder="{{ trans('form.password_confirmation') }}" name="password_confirmation"/>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<button type="submit" class="btn btn-primary pull-right btn-flat">Reset Password</button>
|
||||
<button type="submit" class="btn btn-primary pull-right btn-flat">{{ 'button_reset_password'|_ }}</button>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<a href="{{ URL.to('/login') }}">I want to login</a><br>
|
||||
{% if Config.get('auth.allow_register') %}
|
||||
<a href="{{ route('register') }}" class="text-center">Register a new account</a><br>
|
||||
<a href="{{ URL.to('/login') }}">{{ 'want_to_login'|_ }}</a><br>
|
||||
{% if allowRegistration %}
|
||||
<a href="{{ route('register') }}" class="text-center">{{ 'register_new_account'|_ }}</a><br>
|
||||
{% endif %}
|
||||
</div><!-- /.form-box -->
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
{% if errors|length > 0 %}
|
||||
<div class="alert alert-danger">
|
||||
<strong>Whoops!</strong> There were some problems with your input.<br><br>
|
||||
<strong>{{ 'flash_error'|_ }}</strong> {{ 'problems_with_input'|_ }}<br><br>
|
||||
<ul>
|
||||
{% for error in errors.all %}
|
||||
<li>{{ error }}</li>
|
||||
@ -16,42 +16,38 @@
|
||||
|
||||
|
||||
<div class="register-box-body">
|
||||
<p class="login-box-msg">Register a new account</p>
|
||||
{% if isDemoSite %}
|
||||
<p class="text-info login-box-msg">Please note that an account on this site will only
|
||||
work for one (1) month.</p>
|
||||
{% endif %}
|
||||
<p class="login-box-msg">{{ 'register_new_account'|_ }}</p>
|
||||
|
||||
<form id="register" method="POST" action="{{ URL.to('/register') }}">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
||||
|
||||
<div class="form-group has-feedback">
|
||||
<input type="email" name="email" value="{{ email }}" class="form-control" placeholder="Email"/>
|
||||
<input type="email" name="email" value="{{ email }}" class="form-control" placeholder="{{ trans('form.email') }}"/>
|
||||
</div>
|
||||
<div class="form-group has-feedback">
|
||||
<input type="password" class="form-control" placeholder="Password" name="password"/>
|
||||
<input type="password" class="form-control" placeholder="{{ trans('form.password') }}" name="password"/>
|
||||
</div>
|
||||
<div class="form-group has-feedback">
|
||||
<input type="password" class="form-control" placeholder="Retype password" name="password_confirmation"/>
|
||||
<input type="password" class="form-control" placeholder="{{ trans('form.password_confirmation') }}" name="password_confirmation"/>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-8">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="verify_password" value="1"> Verify password
|
||||
(<a data-toggle="modal" data-target="#passwordModal" href="#passwordModal">what's this?</a>)
|
||||
<input type="checkbox" name="verify_password" value="1"> {{ trans('form.verify_password') }}<br />
|
||||
<a data-toggle="modal" data-target="#passwordModal" href="#passwordModal">{{ 'what_is_pw_security'|_ }}</a>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<button class="btn btn-primary pull-right btn-flat">Register</button>
|
||||
<button class="btn btn-primary pull-right btn-flat">{{ 'button_register'|_ }}</button>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<a href="{{ URL.to('/login') }}">I want to login</a><br>
|
||||
<a href="{{ URL.to('/password/reset') }}">I forgot my password</a>
|
||||
<a href="{{ URL.to('/login') }}">{{ 'want_to_login'|_ }}</a><br>
|
||||
<a href="{{ URL.to('/password/reset') }}">{{ 'forgot_my_password'|_ }}</a>
|
||||
</div><!-- /.form-box -->
|
||||
|
||||
{% include 'partials.password-modal' %}
|
||||
|
Loading…
Reference in New Issue
Block a user