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
19 changes: 16 additions & 3 deletions src/Http/Controllers/Profile/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,24 @@ public function getView()
// available options
$skins = config('web.skins');
$sidebar = Profile::$options['sidebar'];
$page_limit = Profile::$options['page_limit'];
$thousand = Profile::$options['thousand_seperator'];
$decimal = Profile::$options['decimal_seperator'];

return view('web::profile.view',
compact('user', 'history', 'characters', 'skins', 'languages',
'sidebar', 'thousand', 'decimal'));
return view(
'web::profile.view',
compact(
'user',
'history',
'characters',
'skins',
'languages',
'sidebar',
'page_limit',
'thousand',
'decimal'
)
);
}

/**
Expand Down Expand Up @@ -101,6 +113,7 @@ public function postUpdateUserSettings(ProfileSettings $request)
Profile::set('language', $request->language);
Profile::set('sidebar', $request->sidebar);
Profile::set('mail_threads', $request->mail_threads);
Profile::set('page_limit', $request->page_limit);

Profile::set('thousand_seperator', $request->thousand_seperator);
Profile::set('decimal_seperator', $request->decimal_seperator);
Expand Down
2 changes: 2 additions & 0 deletions src/Http/Validation/ProfileSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public function rules()
}, config('web.locale.languages')));
$allowed_sidebar = implode(',', Profile::$options['sidebar']);
$mail_threads = implode(',', Profile::$options['mail_threads']);
$page_limit = implode(',', Profile::$options['page_limit']);

// Workaround if the thousands seperator is null to convert it
// to a space. We dont receive a space from the request as a
Expand All @@ -64,6 +65,7 @@ public function rules()
'language' => 'required|in:' . $allowed_languages,
'sidebar' => 'required|in:' . $allowed_sidebar,
'mail_threads' => 'required|in:' . $mail_threads,
'page_limit' => 'required|numeric|in:' . $page_limit,
'thousand_seperator' => 'nullable|in:" ",",","."|size:1',
'decimal_seperator' => 'required|in:",","."|size:1',
'reprocessing_yield' => 'required|numeric|min:0|max:1',
Expand Down
1 change: 1 addition & 0 deletions src/WebServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ private function register_settings()
Profile::define('skin', 'default');
Profile::define('language', 'en');
Profile::define('mail_threads', 'yes');
Profile::define('page_limit', 10);

// Numbers
Profile::define('thousand_separator', ' ');
Expand Down
10 changes: 8 additions & 2 deletions src/resources/js/seat.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,17 @@ $(document).ready(function () {
});
});

// Configure some defaults for Datatables
$.extend(true, $.fn.dataTable.defaults, {
responsive: true,
autoWidth: false,
order: [[0, 'desc']]
order: [[0, 'desc']],
// External javascript variable defined in `app.blade.php`.
pageLength: typeof pageLength !== 'undefined' ? pageLength : 10,
// Improved `lengthMenu` options to include showing all table rows.
lengthMenu: [
[10, 25, 50, 100, -1],
[10, 25, 50, 100, "All"]
]
});

// put some animation on the caret neat to the user dropdown
Expand Down
1 change: 1 addition & 0 deletions src/resources/lang/af/seat.php
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@
'user_sharelink' => 'User Sharing',
'user_sharelink_description' => 'You can generate a sharing link that can be shared with other SeAT users to allow them to view your linked characters information.',
'user_sharelink_generate' => 'Generate Link',
'page_limit' => 'Paginagrense',

// Queue
'queue_manage' => 'Tou Bestuur',
Expand Down
1 change: 1 addition & 0 deletions src/resources/lang/de/seat.php
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,7 @@
'user_sharelink' => 'User Sharing',
'user_sharelink_description' => 'You can generate a sharing link that can be shared with other SeAT users to allow them to view your linked characters information.',
'user_sharelink_generate' => 'Generate Link',
'page_limit' => 'Seitenlimit',

// Queue
'queue_manage' => 'Warteschlange Verwaltung',
Expand Down
1 change: 1 addition & 0 deletions src/resources/lang/en/seat.php
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@
'user_sharelink' => 'User Sharing',
'user_sharelink_description' => 'You can generate a sharing link that can be shared with other SeAT users to allow them to view your linked characters information.',
'user_sharelink_generate' => 'Generate Link',
'page_limit' => 'Page Limit',

// Queue
'queue_manage' => 'Queue Management',
Expand Down
1 change: 1 addition & 0 deletions src/resources/lang/fr/seat.php
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,7 @@
'user_sharelink' => 'Partage d\'accès',
'user_sharelink_description' => 'Vous pouvez générer un lien de partage qui peut être utilisé par un autre utilisateur de SeAT pour leur permettre d\'accéder aux informations de vos différents personnages.',
'user_sharelink_generate' => 'Générer un lien',
'page_limit' => 'Limite de page',

// Queue
'queue_manage' => 'Gestion de la fil d\'attente',
Expand Down
1 change: 1 addition & 0 deletions src/resources/lang/ja/seat.php
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,7 @@
'user_sharelink' => 'ユーザー共有',
'user_sharelink_description' => '他のSeATユーザーと共有できる共有リンクを生成して、リンクされたキャラクター情報を表示することができます。',
'user_sharelink_generate' => 'リンクを生成する',
'page_limit' => 'ページ制限',

// Queue
'queue_manage' => 'キュー管理',
Expand Down
1 change: 1 addition & 0 deletions src/resources/lang/ko/seat.php
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,7 @@
'user_sharelink' => 'User Sharing',
'user_sharelink_description' => 'You can generate a sharing link that can be shared with other SeAT users to allow them to view your linked characters information.',
'user_sharelink_generate' => 'Generate Link',
'page_limit' => '페이지 제한',

// Queue
'queue_manage' => 'Queue Management',
Expand Down
1 change: 1 addition & 0 deletions src/resources/lang/ro/seat.php
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,7 @@
'user_sharelink' => 'User Sharing',
'user_sharelink_description' => 'You can generate a sharing link that can be shared with other SeAT users to allow them to view your linked characters information.',
'user_sharelink_generate' => 'Generate Link',
'page_limit' => 'Limită de pagină',

// Queue
'queue_manage' => 'Queue Management',
Expand Down
1 change: 1 addition & 0 deletions src/resources/lang/ru/seat.php
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,7 @@
'user_sharelink' => 'User Sharing',
'user_sharelink_description' => 'You can generate a sharing link that can be shared with other SeAT users to allow them to view your linked characters information.',
'user_sharelink_generate' => 'Generate Link',
'page_limit' => 'Ограничение страницы',

// Queue
'queue_manage' => 'Управление очередями производства',
Expand Down
1 change: 1 addition & 0 deletions src/resources/lang/zh-CN/seat.php
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,7 @@
'user_sharelink' => 'User Sharing',
'user_sharelink_description' => 'You can generate a sharing link that can be shared with other SeAT users to allow them to view your linked characters information.',
'user_sharelink_generate' => 'Generate Link',
'page_limit' => '页面限制',

// Queue
'queue_manage' => '队列管理',
Expand Down
8 changes: 8 additions & 0 deletions src/resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@
<script src="{{ asset('web/js/chart.min.js') }}"></script>
<!-- Theme JS -->
<script src="{{ asset('web/js/adminlte.min.js') }}"></script>

<script>
// Inject the page limit value with fallback to 10 if not set.
//
// This is required as `seat.js` uses this variable, with their own fallback, just in case.
var pageLength = {{ setting('page_limit') ?? 10 }};
</script>

Comment on lines +137 to +144
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally I could have used this variable directly in seat.js but since it's not a blade template, that wasn't possible. I'd love to have another look and see if there is a better way to solve this. Could use some guidance on doing so but I think I can manage that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will have a think about that... iirc there is elsewhere that profile info is added to the views, but cannot remember where at the moment.

<!-- SeAT JS -->
<script src="{{ asset('web/js/seat.js') }}"></script>

Expand Down
30 changes: 22 additions & 8 deletions src/resources/views/profile/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class="form-horizontal" id="user-settings-form">

<!-- Select Basic -->
<div class="form-group row">
<label class="col-md-4 col-form-label" for="skin">{{ trans('web::seat.seat_skin') }}</label>
<label class="col-md-6 col-form-label" for="skin">{{ trans('web::seat.seat_skin') }}</label>
<div class="col-md-6">
<select id="skin" name="skin" class="form-control w-100">
@foreach($skins as $skin)
Expand All @@ -35,7 +35,7 @@ class="form-horizontal" id="user-settings-form">

<!-- Select Basic -->
<div class="form-group row">
<label class="col-md-4 col-form-label" for="language">{{ trans('web::seat.language') }}</label>
<label class="col-md-6 col-form-label" for="language">{{ trans('web::seat.language') }}</label>
<div class="col-md-6">
<select id="language" name="language" class="form-control w-100">
@foreach($languages as $language)
Expand All @@ -51,7 +51,7 @@ class="form-horizontal" id="user-settings-form">

<!-- Select Basic -->
<div class="form-group row">
<label class="col-md-4 col-form-label" for="sidebar">{{ trans('web::seat.sidebar_size') }}</label>
<label class="col-md-6 col-form-label" for="sidebar">{{ trans('web::seat.sidebar_size') }}</label>
<div class="col-md-6">
<select id="sidebar" name="sidebar" class="form-control w-100">
@foreach($sidebar as $style)
Expand All @@ -67,7 +67,7 @@ class="form-horizontal" id="user-settings-form">

<!-- Select Basic -->
<div class="form-group row">
<label class="col-md-4 col-form-label" for="sidebar">{{ trans('web::seat.mail_as_threads') }}</label>
<label class="col-md-6 col-form-label" for="sidebar">{{ trans('web::seat.mail_as_threads') }}</label>
<div class="col-md-6">
<select id="sidebar" name="mail_threads" class="form-control w-100">
<option value="yes"
Expand All @@ -82,11 +82,25 @@ class="form-horizontal" id="user-settings-form">
</div>
</div>

<!-- Select Basic -->
<div class="form-group row">
<label class="col-md-6 col-form-label" for="page_limit">{{ trans('web::seat.page_limit') }}</label>
<div class="col-md-6">
<select id="page_limit" name="page_limit" class="form-control w-100">
@foreach([10, 25, 50, 100, -1] as $limit)
<option value="{{ $limit }}" {{ old('page_limit', setting('page_limit')) == $limit ? 'selected' : '' }}>
{{ $limit == -1 ? 'All' : $limit }}
</option>
@endforeach
</select>
</div>
</div>

<legend>{{ trans('web::seat.number_format') }}</legend>

<!-- Select Basic -->
<div class="form-group row">
<label class="col-md-4 col-form-label"
<label class="col-md-6 col-form-label"
for="thousand_seperator">{{ trans('web::seat.thousands_seperator') }}</label>
<div class="col-md-6">
<div class="form-inline input-group">
Expand All @@ -107,7 +121,7 @@ class="form-horizontal" id="user-settings-form">

<!-- Select Basic -->
<div class="form-group row">
<label class="col-md-4 col-form-label"
<label class="col-md-6 col-form-label"
for="decimal_seperator">{{ trans('web::seat.decimal_seperator') }}</label>
<div class="col-md-6">
<div class="form-inline input-group">
Expand All @@ -126,7 +140,7 @@ class="form-horizontal" id="user-settings-form">
</div>

<div class="form-group row">
<label class="col-md-4 col-form-label"
<label class="col-md-6 col-form-label"
for="reprocessing_yield">{{ trans('web::seat.reprocessing_yield') }}</label>
<div class="col-md-6">
<div class="form-inline input-group">
Expand All @@ -139,7 +153,7 @@ class="form-horizontal" id="user-settings-form">

<!-- Select Basic -->
<div class="form-group row">
<label class="col-md-4 col-form-label"
<label class="col-md-6 col-form-label"
for="email_notifications">{{ trans('web::seat.email_notifications') }}</label>
<div class="col-md-6">
<div class="form-inline input-group">
Expand Down