Skip to content
Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
[#1108](https://github.com/nextcloud/cookbook/pull/1108) @christianlupus
- Fix UI glitches caused by improper use of Breadcrumbs component
[#1105](https://github.com/nextcloud/cookbook/pull/1105) @MarcelRobitaille
- Fix typos and styling issues
[#1112](https://github.com/nextcloud/cookbook/pull/1112) @christianlupus

### Maintenance
- Add composer.json to version control to have unique installed dependency versions
Expand Down
10 changes: 7 additions & 3 deletions lib/Helper/Filter/JSON/FixRecipeYieldFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function apply(array &$json): bool {

// Heuristics: Array with multiple entries.
// XXX How to parse an array correctly?
$this->logger->debug($this->l->t('Using heuristics to parse the recipeYield field of recipe {name}.', ['name' => $json['name']]));
$this->logger->debug($this->l->t('Using heuristics to parse the `recipeYield` field representing the number of servings of recipe {name}.', ['name' => $json['name']]));
$json[self::YIELD] = join(' ', $json[self::YIELD]);
}

Expand All @@ -77,14 +77,18 @@ public function apply(array &$json): bool {
sort($matches);
$last = end($matches);

$this->logger->debug($this->l->t('Using the highest number found in recipeYield string. Totally found: {num}', ['num' => $count]));
$this->logger->debug($this->l->n(
'Only a single number was found in the `recipeYield` field. Using it as number of servings.',
'There are %n numbers found in the `recipeYield` field. Using the highest number found as number of servings.',
$count
));

$json[self::YIELD] = (int) $last;
return true;
}

// We did not find anything useful.
$this->logger->info($this->l->t('Could not parse recipeYield field. Falling back to 1.'));
$this->logger->info($this->l->t('Could not parse `recipeYield` field. Falling back to 1 serving.'));
$json[self::YIELD] = 1;
return true;
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/RecipeEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
<action-button
class="btn-enable-recipe-yield"
:aria-label="
t('cookbook', 'Toggle if recipe yield field is present')
// prettier-ignore
t('cookbook', 'Toggle if the number of servings are present')
"
@click="toggleShowRecipeYield"
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/RecipeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ main {

main {
grid-column: 3/4;
grid-row: 1/4;
grid-row: 1/5;
}

@media screen and (max-width: 850px), print {
Expand Down