Add a RON API to search recipes by title + a bit of refactoring
This commit is contained in:
parent
a3f61e3711
commit
084f7ef445
26 changed files with 499 additions and 333 deletions
|
|
@ -42,10 +42,10 @@
|
|||
|
||||
<label for="select-difficulty">{{ context.tr.t(Sentence::RecipeDifficulty) }}</label>
|
||||
<select id="select-difficulty">
|
||||
<option value="0" {%~ call is_difficulty(common::ron_api::Difficulty::Unknown) %}> - </option>
|
||||
<option value="1" {%~ call is_difficulty(common::ron_api::Difficulty::Easy) %}>{{ context.tr.t(Sentence::RecipeDifficultyEasy) }}</option>
|
||||
<option value="2" {%~ call is_difficulty(common::ron_api::Difficulty::Medium) %}>{{ context.tr.t(Sentence::RecipeDifficultyMedium) }}</option>
|
||||
<option value="3" {%~ call is_difficulty(common::ron_api::Difficulty::Hard) %}>{{ context.tr.t(Sentence::RecipeDifficultyHard) }}</option>
|
||||
<option value="0" {%~ call is_difficulty(common::web_api::Difficulty::Unknown) %}> - </option>
|
||||
<option value="1" {%~ call is_difficulty(common::web_api::Difficulty::Easy) %}>{{ context.tr.t(Sentence::RecipeDifficultyEasy) }}</option>
|
||||
<option value="2" {%~ call is_difficulty(common::web_api::Difficulty::Medium) %}>{{ context.tr.t(Sentence::RecipeDifficultyMedium) }}</option>
|
||||
<option value="3" {%~ call is_difficulty(common::web_api::Difficulty::Hard) %}>{{ context.tr.t(Sentence::RecipeDifficultyHard) }}</option>
|
||||
</select>
|
||||
|
||||
<div id="container-tags">
|
||||
|
|
|
|||
|
|
@ -39,12 +39,12 @@
|
|||
|
||||
<span class="difficulty">
|
||||
{% match recipe.difficulty %}
|
||||
{% when common::ron_api::Difficulty::Unknown %}
|
||||
{% when common::ron_api::Difficulty::Easy %}
|
||||
{% when common::web_api::Difficulty::Unknown %}
|
||||
{% when common::web_api::Difficulty::Easy %}
|
||||
{{ context.tr.t(Sentence::RecipeDifficultyEasy) }}
|
||||
{% when common::ron_api::Difficulty::Medium %}
|
||||
{% when common::web_api::Difficulty::Medium %}
|
||||
{{ context.tr.t(Sentence::RecipeDifficultyMedium) }}
|
||||
{% when common::ron_api::Difficulty::Hard %}
|
||||
{% when common::web_api::Difficulty::Hard %}
|
||||
{{ context.tr.t(Sentence::RecipeDifficultyHard) }}
|
||||
{% endmatch %}
|
||||
</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue