Skip to content

Commit

Permalink
Show source
Browse files Browse the repository at this point in the history
  • Loading branch information
karlomikus committed Dec 23, 2024
1 parent 43a26af commit 8b6dc31
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 21 deletions.
25 changes: 18 additions & 7 deletions src/components/Cocktail/CocktailDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,15 @@ async function addMissingIngredients() {
})
}
function isValidUrl(input: string) {
try {
new URL(input.startsWith('http') ? input : `https://${input}`);
return true;
} catch (err) {
return false;
}
}
fetchShoppingList()
</script>

Expand Down Expand Up @@ -518,13 +527,6 @@ fetchShoppingList()
<NoteDialog :resource-id="cocktail.id" resource="cocktail" @note-dialog-closed="showNoteDialog = false; fetchCocktailUserNotes()" />
</template>
</SaltRimDialog>
<a v-if="cocktail.source" class="dropdown-menu__item" target="_blank" :href="cocktail.source">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18">
<path fill="none" d="M0 0h24v24H0z" />
<path d="M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm11-3v8h-2V6.413l-7.793 7.794-1.414-1.414L17.585 5H13V3h8z" />
</svg>
{{ t('cocktail.source') }}
</a>
<hr v-if="cocktail.access && cocktail.access.can_delete" class="dropdown-menu__separator">
<a v-if="cocktail.access && cocktail.access.can_delete" class="dropdown-menu__item" href="javascript:;" @click.prevent="deleteCocktail">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="18" height="18">
Expand All @@ -539,6 +541,15 @@ fetchShoppingList()
<div class="block-container block-container--padded">
<h3 class="details-block-container__title">{{ t('description') }}</h3>
<div class="item-details__chips">
<div v-if="cocktail.source" class="item-details__chips__group">
<div class="item-details__chips__group__title">{{ t('source') }}:</div>
<ul class="chips-list">
<li>
<a v-if="isValidUrl(cocktail.source)" :href="cocktail.source" target="_blank">{{ t('website') }}</a>
<span v-else>{{ cocktail.source }}</span>
</li>
</ul>
</div>
<div v-if="cocktail.tags && cocktail.tags.length > 0" class="item-details__chips__group">
<div class="item-details__chips__group__title">{{ t('tag.tags') }}:</div>
<ul class="chips-list">
Expand Down
3 changes: 2 additions & 1 deletion src/locales/messages/cs-CZ.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,5 +624,6 @@
},
"bar-shelf-ingredients": "Bar shelf ingredients",
"target-pour-cost": "Target pour cost",
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients."
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients.",
"website": "webové stránky"
}
3 changes: 2 additions & 1 deletion src/locales/messages/da-DK.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,5 +624,6 @@
},
"bar-shelf-ingredients": "Bar shelf ingredients",
"target-pour-cost": "Target pour cost",
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients."
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients.",
"website": "Hjemmeside"
}
3 changes: 2 additions & 1 deletion src/locales/messages/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,5 +624,6 @@
},
"bar-shelf-ingredients": "Bar shelf ingredients",
"target-pour-cost": "Target pour cost",
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients."
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients.",
"website": "Webseite"
}
3 changes: 2 additions & 1 deletion src/locales/messages/el-GR.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,5 +624,6 @@
},
"bar-shelf-ingredients": "Bar shelf ingredients",
"target-pour-cost": "Target pour cost",
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients."
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients.",
"website": "Δικτυακός τόπος"
}
3 changes: 2 additions & 1 deletion src/locales/messages/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -628,5 +628,6 @@
"is_favorited": "Your favorite cocktail",
"in_bar_shelf": "Available in bar shelf",
"in_your_shelf": "Available in your shelf",
"is_public": "Has public link"
"is_public": "Has public link",
"website": "Website"
}
3 changes: 2 additions & 1 deletion src/locales/messages/es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,5 +624,6 @@
},
"bar-shelf-ingredients": "Bar shelf ingredients",
"target-pour-cost": "Target pour cost",
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients."
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients.",
"website": "Sitio web"
}
3 changes: 2 additions & 1 deletion src/locales/messages/fi-FI.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,5 +624,6 @@
},
"bar-shelf-ingredients": "Bar shelf ingredients",
"target-pour-cost": "Target pour cost",
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients."
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients.",
"website": "Verkkosivusto"
}
3 changes: 2 additions & 1 deletion src/locales/messages/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,5 +624,6 @@
},
"bar-shelf-ingredients": "Bar shelf ingredients",
"target-pour-cost": "Target pour cost",
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients."
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients.",
"website": "Site web"
}
3 changes: 2 additions & 1 deletion src/locales/messages/hr-HR.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,5 +624,6 @@
},
"bar-shelf-ingredients": "Bar shelf ingredients",
"target-pour-cost": "Target pour cost",
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients."
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients.",
"website": "Web stranica"
}
3 changes: 2 additions & 1 deletion src/locales/messages/hu-HU.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,5 +624,6 @@
},
"bar-shelf-ingredients": "Bar shelf ingredients",
"target-pour-cost": "Target pour cost",
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients."
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients.",
"website": "Weboldal"
}
3 changes: 2 additions & 1 deletion src/locales/messages/it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,5 +624,6 @@
},
"bar-shelf-ingredients": "Bar shelf ingredients",
"target-pour-cost": "Target pour cost",
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients."
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients.",
"website": "Sito web"
}
3 changes: 2 additions & 1 deletion src/locales/messages/pl-PL.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,5 +624,6 @@
},
"bar-shelf-ingredients": "Bar shelf ingredients",
"target-pour-cost": "Target pour cost",
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients."
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients.",
"website": "Strona internetowa"
}
3 changes: 2 additions & 1 deletion src/locales/messages/ro-RO.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,5 +624,6 @@
},
"bar-shelf-ingredients": "Bar shelf ingredients",
"target-pour-cost": "Target pour cost",
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients."
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients.",
"website": "Site-ul web"
}
3 changes: 2 additions & 1 deletion src/locales/messages/sv-SE.json
Original file line number Diff line number Diff line change
Expand Up @@ -624,5 +624,6 @@
},
"bar-shelf-ingredients": "Bar shelf ingredients",
"target-pour-cost": "Target pour cost",
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients."
"target-pour-cost-help": "Percentage of the cocktail's selling price that comes from the cost of the ingredients.",
"website": "Webbplats"
}

0 comments on commit 8b6dc31

Please sign in to comment.