General UI review/test

This commit is contained in:
Bernd Bestel
2020-12-19 14:03:28 +01:00
parent 7ef5bc6f77
commit 574d17fa52
15 changed files with 64 additions and 42 deletions

View File

@@ -591,10 +591,10 @@ msgstr ""
msgid "Quantity unit" msgid "Quantity unit"
msgstr "" msgstr ""
msgid "Only check if a single unit is in stock (a different quantity can then be used below)" msgid "Only check if any amount is in stock"
msgstr "" msgstr ""
msgid "Are you sure to consume all ingredients needed by recipe \"%s\" (ingredients marked with \"check only if a single unit is in stock\" will be ignored)?" msgid "Are you sure to consume all ingredients needed by recipe \"%s\" (ingredients marked with \"only check if any amount is in stock\" will be ignored)?"
msgstr "" msgstr ""
msgid "Removed all ingredients of recipe \"%s\" from stock" msgid "Removed all ingredients of recipe \"%s\" from stock"
@@ -2026,3 +2026,6 @@ msgstr ""
msgid "Hide/view columns" msgid "Hide/view columns"
msgstr "" msgstr ""
msgid "A different amount/unit can then be used below while for stock fulfillment checking it is sufficient when any amount of the product in stock"
msgstr ""

View File

@@ -938,7 +938,7 @@ $(".change-table-columns-visibility-button").on("click", function(e)
data-table-selector="' + dataTableSelector + '" \ data-table-selector="' + dataTableSelector + '" \
data-column-index="-1" \ data-column-index="-1" \
> \ > \
<label class="custom-control-label" \ <label class="custom-control-label font-italic" \
for="column-rowgroup-none">' + __t("None") + ' \ for="column-rowgroup-none">' + __t("None") + ' \
</label > \ </label > \
</div>'; </div>';
@@ -998,10 +998,10 @@ $(".change-table-columns-visibility-button").on("click", function(e)
} }
}); });
var message = '<div class="text-center"><h5>' + __t('Table options') + '</h5><hr><h5>' + __t('Hide/view columns') + '</h5><div class="text-left form-group">' + columnCheckBoxesHtml + '</div></div>'; var message = '<div class="text-center"><h5>' + __t('Table options') + '</h5><hr><h5 class="mb-0">' + __t('Hide/view columns') + '</h5><div class="text-left form-group">' + columnCheckBoxesHtml + '</div></div>';
if (rowGroupDefined) if (rowGroupDefined)
{ {
message += '<div class="text-center mt-1"><h5>' + __t('Group by') + '</h5><div class="text-left form-group">' + rowGroupRadioBoxesHtml + '</div></div>'; message += '<div class="text-center mt-1"><h5 class="pt-3 mb-0">' + __t('Group by') + '</h5><div class="text-left form-group">' + rowGroupRadioBoxesHtml + '</div></div>';
} }
bootbox.dialog({ bootbox.dialog({
@@ -1009,7 +1009,6 @@ $(".change-table-columns-visibility-button").on("click", function(e)
size: 'small', size: 'small',
backdrop: true, backdrop: true,
closeButton: false, closeButton: false,
onEscape: true,
buttons: { buttons: {
reset: { reset: {
label: __t('Reset'), label: __t('Reset'),
@@ -1017,16 +1016,15 @@ $(".change-table-columns-visibility-button").on("click", function(e)
callback: function() callback: function()
{ {
bootbox.confirm({ bootbox.confirm({
swapButtonOrder: true,
message: __t("Are you sure to reset the table options?"), message: __t("Are you sure to reset the table options?"),
buttons: { buttons: {
confirm: {
label: 'Yes',
className: 'btn-danger'
},
cancel: { cancel: {
label: 'No', label: 'No',
className: 'btn-primary' className: 'btn-danger'
},
confirm: {
label: 'Yes',
className: 'btn-success'
} }
}, },
callback: function(result) callback: function(result)
@@ -1084,7 +1082,7 @@ $(document).on("click", ".change-table-columns-rowgroup-toggle", function()
dataTable.rowGroup().enable(false); dataTable.rowGroup().enable(false);
//remove fixed order // Remove fixed order
dataTable.order.fixed({}); dataTable.order.fixed({});
} }
else else
@@ -1097,7 +1095,7 @@ $(document).on("click", ".change-table-columns-rowgroup-toggle", function()
dataTable.rowGroup().enable(true); dataTable.rowGroup().enable(true);
dataTable.rowGroup().dataSrc(columnIndex); dataTable.rowGroup().dataSrc(columnIndex);
//apply fixed order for group column // Apply fixed order for group column
var fixedOrder = { var fixedOrder = {
pre: [columnIndex, 'asc'] pre: [columnIndex, 'asc']
}; };

View File

@@ -76,6 +76,8 @@ Grocy.Components.ProductAmountPicker.AllowAnyQu = function(keepInitialQu = false
Grocy.Components.ProductAmountPicker.SetQuantityUnit($("#qu_id").attr("data-initial-qu-id")); Grocy.Components.ProductAmountPicker.SetQuantityUnit($("#qu_id").attr("data-initial-qu-id"));
} }
$("#qu_id").removeAttr("disabled");
$(".input-group-productamountpicker").trigger("change"); $(".input-group-productamountpicker").trigger("change");
} }

View File

@@ -667,7 +667,7 @@ $(document).on('click', '.recipe-consume-button', function(e)
var servings = $(e.currentTarget).attr('data-mealplan-servings'); var servings = $(e.currentTarget).attr('data-mealplan-servings');
bootbox.confirm({ bootbox.confirm({
message: __t('Are you sure to consume all ingredients needed by recipe "%s" (ingredients marked with "check only if a single unit is in stock" will be ignored)?', objectName), message: __t('Are you sure to consume all ingredients needed by recipe "%s" (ingredients marked with "only check if any amount is in stock" will be ignored)?', objectName),
closeButton: false, closeButton: false,
buttons: { buttons: {
confirm: { confirm: {

View File

@@ -136,7 +136,7 @@ $('#recipe-pos-form input').keydown(function(event)
} }
}); });
$("#only_check_single_unit_in_stock").on("click", function() $("#only_check_single_unit_in_stock").on("change", function()
{ {
if (this.checked) if (this.checked)
{ {

View File

@@ -192,7 +192,7 @@ $(".recipe-consume").on('click', function(e)
var objectId = $(e.currentTarget).attr('data-recipe-id'); var objectId = $(e.currentTarget).attr('data-recipe-id');
bootbox.confirm({ bootbox.confirm({
message: __t('Are you sure to consume all ingredients needed by recipe "%s" (ingredients marked with "check only if a single unit is in stock" will be ignored)?', objectName), message: __t('Are you sure to consume all ingredients needed by recipe "%s" (ingredients marked with "only check if any amount is in stock" will be ignored)?', objectName),
closeButton: false, closeButton: false,
buttons: { buttons: {
confirm: { confirm: {

View File

@@ -74,6 +74,8 @@ $("#clear-filter-button").on("click", function()
$("#transaction-type-filter").val("all"); $("#transaction-type-filter").val("all");
$("#location-filter").val("all"); $("#location-filter").val("all");
$("#user-filter").val("all"); $("#user-filter").val("all");
$("#product-filter").val("all");
stockJournalTable.column(1).search("").draw();
stockJournalTable.column(4).search("").draw(); stockJournalTable.column(4).search("").draw();
stockJournalTable.column(5).search("").draw(); stockJournalTable.column(5).search("").draw();
stockJournalTable.column(6).search("").draw(); stockJournalTable.column(6).search("").draw();

View File

@@ -62,6 +62,7 @@ $("#clear-filter-button").on("click", function()
$("#transaction-type-filter").val("all"); $("#transaction-type-filter").val("all");
$("#location-filter").val("all"); $("#location-filter").val("all");
$("#user-filter").val("all"); $("#user-filter").val("all");
$("#product-filter").val("all");
journalSummaryTable.column(1).search("").draw(); journalSummaryTable.column(1).search("").draw();
journalSummaryTable.column(2).search("").draw(); journalSummaryTable.column(2).search("").draw();
journalSummaryTable.column(3).search("").draw(); journalSummaryTable.column(3).search("").draw();

View File

@@ -119,13 +119,9 @@
<th>{{ $__t('Chore') }}</th> <th>{{ $__t('Chore') }}</th>
<th>{{ $__t('Next estimated tracking') }}</th> <th>{{ $__t('Next estimated tracking') }}</th>
<th>{{ $__t('Last tracked') }}</th> <th>{{ $__t('Last tracked') }}</th>
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS) <th class="@if(!GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS) d-none @endif">{{ $__t('Assigned to') }}</th>
<th>{{ $__t('Assigned to') }}</th>
@endif
<th class="d-none">Hidden status</th> <th class="d-none">Hidden status</th>
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
<th class="d-none">Hidden assigned to user id</th> <th class="d-none">Hidden assigned to user id</th>
@endif
@include('components.userfields_thead', array( @include('components.userfields_thead', array(
'userfields' => $userfields 'userfields' => $userfields
@@ -195,8 +191,8 @@
class="timeago timeago-contextual @if($curentChoreEntry->track_date_only == 1) timeago-date-only @endif" class="timeago timeago-contextual @if($curentChoreEntry->track_date_only == 1) timeago-date-only @endif"
datetime="{{ $curentChoreEntry->last_tracked_time }}"></time> datetime="{{ $curentChoreEntry->last_tracked_time }}"></time>
</td> </td>
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
<td> <td class="@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS) d-none @endif">
<span id="chore-{{ $curentChoreEntry->chore_id }}-next-execution-assigned-user"> <span id="chore-{{ $curentChoreEntry->chore_id }}-next-execution-assigned-user">
@if(!empty($curentChoreEntry->next_execution_assigned_to_user_id)) @if(!empty($curentChoreEntry->next_execution_assigned_to_user_id))
{{ FindObjectInArrayByPropertyValue($users, 'id', $curentChoreEntry->next_execution_assigned_to_user_id)->display_name }} {{ FindObjectInArrayByPropertyValue($users, 'id', $curentChoreEntry->next_execution_assigned_to_user_id)->display_name }}
@@ -205,7 +201,6 @@
@endif @endif
</span> </span>
</td> </td>
@endif
<td id="chore-{{ $curentChoreEntry->chore_id }}-due-filter-column" <td id="chore-{{ $curentChoreEntry->chore_id }}-due-filter-column"
class="d-none"> class="d-none">
@if(FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->period_type !== \Grocy\Services\ChoresService::CHORE_PERIOD_TYPE_MANUALLY && $curentChoreEntry->next_estimated_execution_time < date('Y-m-d @if(FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->period_type !== \Grocy\Services\ChoresService::CHORE_PERIOD_TYPE_MANUALLY && $curentChoreEntry->next_estimated_execution_time < date('Y-m-d
@@ -223,12 +218,10 @@
duesoon duesoon
@endif @endif
</td> </td>
@if(GROCY_FEATURE_FLAG_CHORES_ASSIGNMENTS)
<td <td
class="d-none"> class="d-none">
@if(!empty($curentChoreEntry->next_execution_assigned_to_user_id)) @if(!empty($curentChoreEntry->next_execution_assigned_to_user_id))
xx{{ $curentChoreEntry->next_execution_assigned_to_user_id }}xx xx{{ $curentChoreEntry->next_execution_assigned_to_user_id }}xx
@endif
</td> </td>
@endif @endif

View File

@@ -1,12 +1,16 @@
<label> <div class="custom-control custom-checkbox">
<input type="checkbox" <input type="checkbox"
name="{{ $perm->permission_name }}" name="{{ $perm->permission_name }}"
class="permission-cb" class="permission-cb form-check-input custom-control-input"
data-perm-id="{{ $perm->permission_id }}" data-perm-id="{{ $perm->permission_id }}"
id="perm-{{ $perm->permission_id }}"
@if($perm->has_permission) checked @endif @if($perm->has_permission) checked @endif
@if(isset($permParent) && $permParent->has_permission) disabled @endif> @if(isset($permParent) && $permParent->has_permission) disabled @endif>
{{ $__t($perm->permission_name) }} <label class="form-check-label custom-control-label"
</label> for="perm-{{ $perm->permission_id }}">
{{ $__t($perm->permission_name) }}
</label>
</div>
<div id="permission-sub-{{ $perm->permission_name }}"> <div id="permission-sub-{{ $perm->permission_name }}">
<ul> <ul>
@foreach($perm->uihelper_user_permissionsList(array('user_id' => $user->id))->via('parent') as $p) @foreach($perm->uihelper_user_permissionsList(array('user_id' => $user->id))->via('parent') as $p)

View File

@@ -18,7 +18,7 @@
Workaround because of Firefox bug Workaround because of Firefox bug
see https://github.com/twbs/bootstrap/issues/22753 see https://github.com/twbs/bootstrap/issues/22753
and https://bugzilla.mozilla.org/show_bug.cgi?id=1413121 and https://bugzilla.mozilla.org/show_bug.cgi?id=1413121
*/ */
.row { .row {
display: inline !important; display: inline !important;
} }
@@ -56,7 +56,7 @@
@foreach($locations as $location) @foreach($locations as $location)
<div class="page"> <div class="page">
<h1 class="pt-4"> <h1 class="pt-4 text-center">
<img src="{{ $U('/img/grocy_logo.svg?v=', true) }}{{ $version }}" <img src="{{ $U('/img/grocy_logo.svg?v=', true) }}{{ $version }}"
height="30" height="30"
class="d-none d-print-flex mx-auto"> class="d-none d-print-flex mx-auto">
@@ -66,7 +66,7 @@
{{ $__t('Print') . ' (' . $__t('this location') . ')' }} {{ $__t('Print') . ' (' . $__t('this location') . ')' }}
</a> </a>
</h1> </h1>
<h6 class="mb-4 d-none d-print-block"> <h6 class="mb-4 d-none d-print-block text-center">
{{ $__t('Time of printing') }}: {{ $__t('Time of printing') }}:
<span class="d-inline print-timestamp"></span> <span class="d-inline print-timestamp"></span>
</h6> </h6>

View File

@@ -154,7 +154,12 @@
@endif @endif
</td> </td>
<td class="@if(!GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING) d-none @endif"> <td class="@if(!GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING) d-none @endif">
{{ FindObjectInArrayByPropertyValue($locations, 'id', $product->location_id)->name }} @php
$location = FindObjectInArrayByPropertyValue($locations, 'id', $product->location_id);
@endphp
@if($location != null)
{{ $location->name }}
@endif
</td> </td>
<td> <td>
<span class="locale-number locale-number-quantity-amount">{{ $product->min_stock_amount }}</span> <span class="locale-number locale-number-quantity-amount">{{ $product->min_stock_amount }}</span>
@@ -169,8 +174,11 @@
@if(!empty($product->product_group_id)) {{ FindObjectInArrayByPropertyValue($productGroups, 'id', $product->product_group_id)->name }} @endif @if(!empty($product->product_group_id)) {{ FindObjectInArrayByPropertyValue($productGroups, 'id', $product->product_group_id)->name }} @endif
</td> </td>
<td class="@if(!GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif"> <td class="@if(!GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif">
@if(!empty($product->shopping_location_id)) @php
{{ FindObjectInArrayByPropertyValue($shoppingLocations, 'id', $product->shopping_location_id)->name }} $store = FindObjectInArrayByPropertyValue($shoppingLocations, 'id', $product->shopping_location_id);
@endphp
@if($store != null)
{{ $store->name }}
@endif @endif
</td> </td>

View File

@@ -46,13 +46,15 @@
'nextInputSelector' => '#amount' 'nextInputSelector' => '#amount'
)) ))
<div class="form-group mb-1"> <div class="form-group mb-2">
<div class="custom-control custom-checkbox"> <div class="custom-control custom-checkbox">
<input @if($mode=='edit' <input @if($mode=='edit'
&& &&
$recipePos->only_check_single_unit_in_stock == 1) checked @endif class="form-check-input custom-control-input" type="checkbox" id="only_check_single_unit_in_stock" name="only_check_single_unit_in_stock" value="1"> $recipePos->only_check_single_unit_in_stock == 1) checked @endif class="form-check-input custom-control-input" type="checkbox" id="only_check_single_unit_in_stock" name="only_check_single_unit_in_stock" value="1">
<label class="form-check-label custom-control-label" <label class="form-check-label custom-control-label"
for="only_check_single_unit_in_stock">{{ $__t('Only check if a single unit is in stock (a different quantity can then be used below)') }}</label> for="only_check_single_unit_in_stock">{{ $__t('Only check if any amount is in stock') }}&nbsp;<i class="fas fa-question-circle text-muted"
data-toggle="tooltip"
title="{{ $__t('A different amount/unit can then be used below while for stock fulfillment checking it is sufficient when any amount of the product in stock') }}"></i></label>
</div> </div>
</div> </div>
@@ -61,7 +63,7 @@
@include('components.productamountpicker', array( @include('components.productamountpicker', array(
'value' => $value, 'value' => $value,
'initialQuId' => $initialQuId, 'initialQuId' => $initialQuId,
'additionalGroupCssClasses' => 'mb-1' 'additionalGroupCssClasses' => 'mb-2'
)) ))
<div class="form-group"> <div class="form-group">

View File

@@ -73,7 +73,7 @@
for="use_specific_stock_entry">{{ $__t('Use a specific stock item') }} for="use_specific_stock_entry">{{ $__t('Use a specific stock item') }}
&nbsp;<i class="fas fa-question-circle text-muted" &nbsp;<i class="fas fa-question-circle text-muted"
data-toggle="tooltip" data-toggle="tooltip"
title="{{ $__t('The first item in this list would be picked by the default rule which is "Opened first, then first due first, then first in first out') }}"></i> title="{{ $__t('The first item in this list would be picked by the default rule which is "Opened first, then first due first, then first in first out"') }}"></i>
</label> </label>
</div> </div>
<select disabled <select disabled

View File

@@ -10,6 +10,15 @@
</script> </script>
@endpush @endpush
@push('pageStyles')
<style>
ul {
list-style-type: none;
}
</style>
@endpush
@section('content') @section('content')
<div class="row"> <div class="row">
<div class="col"> <div class="col">
@@ -21,7 +30,7 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<ul> <ul class="pl-0">
@foreach($permissions as $perm) @foreach($permissions as $perm)
<li> <li>
@include('components.userpermission_select', array( @include('components.userpermission_select', array(