mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-31 13:05:47 +08:00
Made fixes to es languge files and users page
Fixed PHP formatting error in ES lang file and added tests to cover. Made user edit page more responsive on smaller devices. Fixed 'cancel' button on profile screen when the user does not have permission to manage users.
This commit is contained in:
@ -13,7 +13,7 @@ return [
|
||||
'page_update' => 'página actualizada',
|
||||
'page_update_notification' => 'Página actualizada exitosamente',
|
||||
'page_delete' => 'página borrada',
|
||||
'page_delete_notification' => 'Página borrada exitosamente,
|
||||
'page_delete_notification' => 'Página borrada exitosamente',
|
||||
'page_restore' => 'página restaurada',
|
||||
'page_restore_notification' => 'Página restaurada exitosamente',
|
||||
'page_move' => 'página movida',
|
||||
|
@ -21,6 +21,10 @@
|
||||
<form action="{{ baseUrl("/settings/users/create") }}" method="post">
|
||||
{!! csrf_field() !!}
|
||||
@include('users/forms/' . $authMethod)
|
||||
<div class="form-group">
|
||||
<a href="{{ baseUrl($currentUser->can('users-manage') ? "/settings/users" : "/") }}" class="button muted">{{ trans('common.cancel') }}</a>
|
||||
<button class="button pos" type="submit">{{ trans('common.save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
@ -19,13 +19,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6" ng-non-bindable>
|
||||
<div class="col-sm-6" ng-non-bindable>
|
||||
{!! csrf_field() !!}
|
||||
<input type="hidden" name="_method" value="put">
|
||||
@include('users.forms.' . $authMethod, ['model' => $user])
|
||||
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group" id="logo-control">
|
||||
<label for="user-avatar">{{ trans('settings.users_avatar') }}</label>
|
||||
<p class="small">{{ trans('settings.users_avatar_desc') }}</p>
|
||||
@ -51,6 +51,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<a href="{{ baseUrl($currentUser->can('users-manage') ? "/settings/users" : "/") }}" class="button muted">{{ trans('common.cancel') }}</a>
|
||||
<button class="button pos" type="submit">{{ trans('common.save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<hr class="margin-top large">
|
||||
@ -60,7 +64,7 @@
|
||||
<p class="text-muted">{{ trans('settings.users_social_accounts_info') }}</p>
|
||||
<div class="row">
|
||||
@foreach($activeSocialDrivers as $driver => $enabled)
|
||||
<div class="col-md-3 text-center">
|
||||
<div class="col-sm-3 col-xs-6 text-center">
|
||||
<div>@icon($driver, ['width' => 56])</div>
|
||||
<div>
|
||||
@if($user->hasSocialAccount($driver))
|
||||
|
@ -23,8 +23,3 @@
|
||||
@include('form.text', ['name' => 'external_auth_id'])
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="form-group">
|
||||
<a href="{{ baseUrl("/settings/users") }}" class="button muted">{{ trans('common.cancel') }}</a>
|
||||
<button class="button pos" type="submit">{{ trans('common.save') }}</button>
|
||||
</div>
|
@ -32,9 +32,3 @@
|
||||
<label for="password-confirm">{{ trans('auth.password_confirm') }}</label>
|
||||
@include('form.password', ['name' => 'password-confirm'])
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<a href="{{ baseUrl("/settings/users") }}" class="button muted">{{ trans('common.cancel') }}</a>
|
||||
<button class="button pos" type="submit">{{ trans('common.save') }}</button>
|
||||
</div>
|
||||
|
||||
|
@ -19,8 +19,3 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="form-group">
|
||||
<a href="{{ baseUrl("/settings/users") }}" class="button muted">{{ trans('common.cancel') }}</a>
|
||||
<button class="button pos" type="submit">{{ trans('common.save') }}</button>
|
||||
</div>
|
||||
|
||||
|
@ -3,13 +3,24 @@
|
||||
class LanguageTest extends TestCase
|
||||
{
|
||||
|
||||
public function test_js_endpoint_for_each_language() {
|
||||
protected $langs;
|
||||
|
||||
/**
|
||||
* LanguageTest constructor.
|
||||
*/
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->langs = array_diff(scandir(resource_path('lang')), ['..', '.']);
|
||||
}
|
||||
|
||||
public function test_js_endpoint_for_each_language()
|
||||
{
|
||||
|
||||
$langs = array_diff(scandir(resource_path('lang')), ['..', '.']);
|
||||
$visibleKeys = ['common', 'components', 'entities', 'errors'];
|
||||
|
||||
$this->asEditor();
|
||||
foreach ($langs as $lang) {
|
||||
foreach ($this->langs as $lang) {
|
||||
setting()->putUser($this->getEditor(), 'language', $lang);
|
||||
$transResp = $this->get('/translations');
|
||||
foreach ($visibleKeys as $key) {
|
||||
@ -18,4 +29,20 @@ class LanguageTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
public function test_all_lang_files_loadable()
|
||||
{
|
||||
$files = array_diff(scandir(resource_path('lang/en')), ['..', '.']);
|
||||
foreach ($this->langs as $lang) {
|
||||
foreach ($files as $file) {
|
||||
$loadError = false;
|
||||
try {
|
||||
$translations = trans(str_replace('.php', '', $file), [], $lang);
|
||||
} catch (\Exception $e) {
|
||||
$loadError = true;
|
||||
}
|
||||
$this->assertFalse($loadError, "Translation file {$lang}/{$file} failed to load");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user