Dan Brown

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.
...@@ -13,7 +13,7 @@ return [ ...@@ -13,7 +13,7 @@ return [
13 'page_update' => 'página actualizada', 13 'page_update' => 'página actualizada',
14 'page_update_notification' => 'Página actualizada exitosamente', 14 'page_update_notification' => 'Página actualizada exitosamente',
15 'page_delete' => 'página borrada', 15 'page_delete' => 'página borrada',
16 - 'page_delete_notification' => 'Página borrada exitosamente, 16 + 'page_delete_notification' => 'Página borrada exitosamente',
17 'page_restore' => 'página restaurada', 17 'page_restore' => 'página restaurada',
18 'page_restore_notification' => 'Página restaurada exitosamente', 18 'page_restore_notification' => 'Página restaurada exitosamente',
19 'page_move' => 'página movida', 19 'page_move' => 'página movida',
......
...@@ -21,6 +21,10 @@ ...@@ -21,6 +21,10 @@
21 <form action="{{ baseUrl("/settings/users/create") }}" method="post"> 21 <form action="{{ baseUrl("/settings/users/create") }}" method="post">
22 {!! csrf_field() !!} 22 {!! csrf_field() !!}
23 @include('users/forms/' . $authMethod) 23 @include('users/forms/' . $authMethod)
24 + <div class="form-group">
25 + <a href="{{ baseUrl($currentUser->can('users-manage') ? "/settings/users" : "/") }}" class="button muted">{{ trans('common.cancel') }}</a>
26 + <button class="button pos" type="submit">{{ trans('common.save') }}</button>
27 + </div>
24 </form> 28 </form>
25 </div> 29 </div>
26 30
......
...@@ -19,13 +19,13 @@ ...@@ -19,13 +19,13 @@
19 </div> 19 </div>
20 </div> 20 </div>
21 <div class="row"> 21 <div class="row">
22 - <div class="col-md-6" ng-non-bindable> 22 + <div class="col-sm-6" ng-non-bindable>
23 {!! csrf_field() !!} 23 {!! csrf_field() !!}
24 <input type="hidden" name="_method" value="put"> 24 <input type="hidden" name="_method" value="put">
25 @include('users.forms.' . $authMethod, ['model' => $user]) 25 @include('users.forms.' . $authMethod, ['model' => $user])
26 26
27 </div> 27 </div>
28 - <div class="col-md-6"> 28 + <div class="col-sm-6">
29 <div class="form-group" id="logo-control"> 29 <div class="form-group" id="logo-control">
30 <label for="user-avatar">{{ trans('settings.users_avatar') }}</label> 30 <label for="user-avatar">{{ trans('settings.users_avatar') }}</label>
31 <p class="small">{{ trans('settings.users_avatar_desc') }}</p> 31 <p class="small">{{ trans('settings.users_avatar_desc') }}</p>
...@@ -51,6 +51,10 @@ ...@@ -51,6 +51,10 @@
51 </div> 51 </div>
52 </div> 52 </div>
53 </div> 53 </div>
54 + <div class="form-group">
55 + <a href="{{ baseUrl($currentUser->can('users-manage') ? "/settings/users" : "/") }}" class="button muted">{{ trans('common.cancel') }}</a>
56 + <button class="button pos" type="submit">{{ trans('common.save') }}</button>
57 + </div>
54 </form> 58 </form>
55 59
56 <hr class="margin-top large"> 60 <hr class="margin-top large">
...@@ -60,7 +64,7 @@ ...@@ -60,7 +64,7 @@
60 <p class="text-muted">{{ trans('settings.users_social_accounts_info') }}</p> 64 <p class="text-muted">{{ trans('settings.users_social_accounts_info') }}</p>
61 <div class="row"> 65 <div class="row">
62 @foreach($activeSocialDrivers as $driver => $enabled) 66 @foreach($activeSocialDrivers as $driver => $enabled)
63 - <div class="col-md-3 text-center"> 67 + <div class="col-sm-3 col-xs-6 text-center">
64 <div>@icon($driver, ['width' => 56])</div> 68 <div>@icon($driver, ['width' => 56])</div>
65 <div> 69 <div>
66 @if($user->hasSocialAccount($driver)) 70 @if($user->hasSocialAccount($driver))
......
...@@ -23,8 +23,3 @@ ...@@ -23,8 +23,3 @@
23 @include('form.text', ['name' => 'external_auth_id']) 23 @include('form.text', ['name' => 'external_auth_id'])
24 </div> 24 </div>
25 @endif 25 @endif
...\ No newline at end of file ...\ No newline at end of file
26 -
27 -<div class="form-group">
28 - <a href="{{ baseUrl("/settings/users") }}" class="button muted">{{ trans('common.cancel') }}</a>
29 - <button class="button pos" type="submit">{{ trans('common.save') }}</button>
30 -</div>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -32,9 +32,3 @@ ...@@ -32,9 +32,3 @@
32 <label for="password-confirm">{{ trans('auth.password_confirm') }}</label> 32 <label for="password-confirm">{{ trans('auth.password_confirm') }}</label>
33 @include('form.password', ['name' => 'password-confirm']) 33 @include('form.password', ['name' => 'password-confirm'])
34 </div> 34 </div>
...\ No newline at end of file ...\ No newline at end of file
35 -
36 -<div class="form-group">
37 - <a href="{{ baseUrl("/settings/users") }}" class="button muted">{{ trans('common.cancel') }}</a>
38 - <button class="button pos" type="submit">{{ trans('common.save') }}</button>
39 -</div>
40 -
......
...@@ -19,8 +19,3 @@ ...@@ -19,8 +19,3 @@
19 </div> 19 </div>
20 @endif 20 @endif
21 21
22 -<div class="form-group">
23 - <a href="{{ baseUrl("/settings/users") }}" class="button muted">{{ trans('common.cancel') }}</a>
24 - <button class="button pos" type="submit">{{ trans('common.save') }}</button>
25 -</div>
26 -
......
...@@ -3,13 +3,24 @@ ...@@ -3,13 +3,24 @@
3 class LanguageTest extends TestCase 3 class LanguageTest extends TestCase
4 { 4 {
5 5
6 - public function test_js_endpoint_for_each_language() { 6 + protected $langs;
7 +
8 + /**
9 + * LanguageTest constructor.
10 + */
11 + public function setUp()
12 + {
13 + parent::setUp();
14 + $this->langs = array_diff(scandir(resource_path('lang')), ['..', '.']);
15 + }
16 +
17 + public function test_js_endpoint_for_each_language()
18 + {
7 19
8 - $langs = array_diff(scandir(resource_path('lang')), ['..', '.']);
9 $visibleKeys = ['common', 'components', 'entities', 'errors']; 20 $visibleKeys = ['common', 'components', 'entities', 'errors'];
10 21
11 $this->asEditor(); 22 $this->asEditor();
12 - foreach ($langs as $lang) { 23 + foreach ($this->langs as $lang) {
13 setting()->putUser($this->getEditor(), 'language', $lang); 24 setting()->putUser($this->getEditor(), 'language', $lang);
14 $transResp = $this->get('/translations'); 25 $transResp = $this->get('/translations');
15 foreach ($visibleKeys as $key) { 26 foreach ($visibleKeys as $key) {
...@@ -18,4 +29,20 @@ class LanguageTest extends TestCase ...@@ -18,4 +29,20 @@ class LanguageTest extends TestCase
18 } 29 }
19 } 30 }
20 31
32 + public function test_all_lang_files_loadable()
33 + {
34 + $files = array_diff(scandir(resource_path('lang/en')), ['..', '.']);
35 + foreach ($this->langs as $lang) {
36 + foreach ($files as $file) {
37 + $loadError = false;
38 + try {
39 + $translations = trans(str_replace('.php', '', $file), [], $lang);
40 + } catch (\Exception $e) {
41 + $loadError = true;
42 + }
43 + $this->assertFalse($loadError, "Translation file {$lang}/{$file} failed to load");
44 + }
45 + }
46 + }
47 +
21 } 48 }
...\ No newline at end of file ...\ No newline at end of file
......