counting delayed unchecked should check if null or in past

This commit is contained in:
smilerz
2024-03-18 18:09:56 -05:00
parent 2e6becb73d
commit bd61906aa4
2 changed files with 32 additions and 21 deletions

View File

@@ -75,26 +75,25 @@
<!-- --------------------------------------- shopping list table -->
<b-row v-for="c in shopping_list_store.get_entries_by_group" v-bind:key="c.id">
<b-col cols="12"
v-if="(c.count_unchecked > 0 || user_preference_store.device_settings.shopping_show_checked_entries) && (c.count_unchecked + c.count_checked) > 0 && (c.count_delayed_unchecked < c.count_unchecked ||user_preference_store.device_settings.shopping_show_delayed_entries )">
<b-button-group class="w-100 mt-1"
:class="{'flex-row-reverse': useUserPreferenceStore().user_settings.left_handed}">
v-if="(c.count_unchecked > 0 || user_preference_store.device_settings.shopping_show_checked_entries)
&& (c.count_unchecked + c.count_checked) > 0
&& (c.count_delayed_unchecked < c.count_unchecked || user_preference_store.device_settings.shopping_show_delayed_entries)"
>
<b-button-group class="w-100 mt-1" :class="{'flex-row-reverse': useUserPreferenceStore().user_settings.left_handed}">
<b-button variant="info" block class="btn btn-block text-left">
<span v-if="c.name === shopping_list_store.UNDEFINED_CATEGORY">{{
$t('Undefined')
}}</span>
<span v-if="c.name === shopping_list_store.UNDEFINED_CATEGORY">{{$t('Undefined')}}</span>
<span v-else>{{ c.name }}</span>
</b-button>
<b-button class="d-print-none "
:class="{'btn-success':(c.count_unchecked > 0), 'btn-warning': (c.count_unchecked <= 0)}"
@click="checkGroup(c, (c.count_unchecked > 0))">
<i class="fas fa-fw"
:class="{'fa-check':(c.count_unchecked > 0), 'fa-cart-plus':(c.count_unchecked <= 0) }"></i>
:class="{'btn-success':(c.count_unchecked > 0), 'btn-warning': (c.count_unchecked <= 0)}"
@click="checkGroup(c, (c.count_unchecked > 0))">
<i class="fas fa-fw" :class="{'fa-check':(c.count_unchecked > 0), 'fa-cart-plus':(c.count_unchecked <= 0) }"></i>
</b-button>
</b-button-group>
<span v-for="f in c.foods" v-bind:key="f.id">
<shopping-line-item :entries="f['entries']" class="mt-1"/>
</span>
<shopping-line-item :entries="f['entries']" class="mt-1"/>
</span>
</b-col>
</b-row>