Skip to content

Commit 2221441

Browse files
committed
Using underscore in url as placeholder for uncategorized recipes
Signed-off-by: Sebastian Fey <[email protected]>
1 parent 7173809 commit 2221441

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

lib/Db/RecipeDb.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,13 @@ public function findAllCategories(string $user_id) {
188188

189189
/**
190190
* @throws \OCP\AppFramework\Db\DoesNotExistException if not found
191+
*
192+
* Using '_' as a placeholder for recipes w/o category
191193
*/
192194
public function getRecipesByCategory(string $category, string $user_id) {
193195
$qb = $this->db->getQueryBuilder();
194196

195-
if ($category != 'None')
197+
if ($category != '_')
196198
{
197199
$qb->select(['r.recipe_id', 'r.name'])
198200
->from(self::DB_TABLE_CATEGORIES, 'k')

src/components/AppControls.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</Breadcrumb>
1414
<!-- SEARCH PAGE -->
1515
<Breadcrumb v-if="isSearch" class="not-link" :title="searchTitle" :disableDrop="true" />
16-
<Breadcrumb v-if="isSearch && $route.params.value" class="active" :title="$route.params.value" :disableDrop="true" />
16+
<Breadcrumb v-if="isSearch && $route.params.value" class="active" :title="$route.params.value=='_'?'None':$route.params.value" :disableDrop="true" />
1717
<!-- RECIPE PAGES -->
1818
<!-- Edit recipe -->
1919
<Breadcrumb v-if="isEdit" class="not-link" :title="t('cookbook', 'Edit recipe')" :disableDrop="true" />

src/components/AppNavi.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<AppNavigationItem :title="t('cookbook', 'All recipes')" icon="icon-category-organization" :to="'/'">
2323
<AppNavigationCounter slot="counter">{{ totalRecipeCount }}</AppNavigationCounter>
2424
</AppNavigationItem>
25-
<AppNavigationItem :title="t('cookbook', 'Uncategorized recipes')" icon="icon-category-organization" :to="'/category/None/'">
25+
<AppNavigationItem :title="t('cookbook', 'Uncategorized recipes')" icon="icon-category-organization" :to="'/category/_/'">
2626
<AppNavigationCounter slot="counter">{{ uncatRecipes }}</AppNavigationCounter>
2727
</AppNavigationItem>
2828
<AppNavigationItem v-for="(cat,idx) in categories"

0 commit comments

Comments
 (0)