mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2025-12-24 02:39:20 -05:00
Merge remote-tracking branch 'upstream/develop' into recipe_description
This commit is contained in:
@@ -27,11 +27,11 @@
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-plugin-vue": "^7.0.0-0",
|
||||
"webpack-bundle-tracker": "0.4.3",
|
||||
"workbox-expiration": "^6.0.2",
|
||||
"workbox-navigation-preload": "^6.0.2",
|
||||
"workbox-precaching": "^6.0.2",
|
||||
"workbox-routing": "^6.0.2",
|
||||
"workbox-strategies": "^6.0.2",
|
||||
"workbox-expiration": "^6.0.2"
|
||||
"workbox-strategies": "^6.0.2"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
|
||||
110
vue/src/apps/ImportResponseView/ImportResponseView.vue
Normal file
110
vue/src/apps/ImportResponseView/ImportResponseView.vue
Normal file
@@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
|
||||
<div class="row">
|
||||
<div class="col col-md-12">
|
||||
<h2>{{ _('Import') }}</h2>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
<template v-if="import_info !== undefined">
|
||||
|
||||
<template v-if="import_info.running" style="text-align: center;">
|
||||
<div class="row">
|
||||
<div class="col col-md-12">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<loading-spinner></loading-spinner>
|
||||
<br/>
|
||||
<br/>
|
||||
<h5 style="text-align: center">{{ _('Import running, please wait!') }}</h5>
|
||||
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="row">
|
||||
<div class="col col-md-12">
|
||||
<span>{{ _('Import finished') }}! </span>
|
||||
<a :href="`${resolveDjangoUrl('view_search') }?keywords=${import_info.keyword.id}`"
|
||||
v-if="import_info.keyword !== null">{{ _('View Recipes') }}</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="row">
|
||||
<div class="col col-md-12">
|
||||
<label for="id_textarea">{{ _('Information') }}</label>
|
||||
<textarea id="id_textarea" class="form-control" style="height: 50vh" v-html="import_info.msg"
|
||||
disabled></textarea>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</template>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import {BootstrapVue} from 'bootstrap-vue'
|
||||
|
||||
import 'bootstrap-vue/dist/bootstrap-vue.css'
|
||||
|
||||
import {GettextMixin, ResolveUrlMixin, ToastMixin} from "@/utils/utils";
|
||||
|
||||
import {apiLoadImportLog} from "@/utils/api";
|
||||
import LoadingSpinner from "@/components/LoadingSpinner";
|
||||
|
||||
Vue.use(BootstrapVue)
|
||||
|
||||
export default {
|
||||
name: 'ImportResponseView',
|
||||
mixins: [
|
||||
GettextMixin,
|
||||
ResolveUrlMixin,
|
||||
ToastMixin,
|
||||
],
|
||||
components: {
|
||||
LoadingSpinner
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
import_id: window.IMPORT_ID,
|
||||
import_info: undefined,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.refreshData()
|
||||
|
||||
setInterval(() => {
|
||||
if ((this.import_id !== null) && window.navigator.onLine && this.import_info.running) {
|
||||
this.refreshData()
|
||||
}
|
||||
}, 5000)
|
||||
|
||||
},
|
||||
methods: {
|
||||
refreshData: function () {
|
||||
apiLoadImportLog(this.import_id).then(data => {
|
||||
this.import_info = data
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
|
||||
</style>
|
||||
8
vue/src/apps/ImportResponseView/main.js
Normal file
8
vue/src/apps/ImportResponseView/main.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import Vue from 'vue'
|
||||
import App from './ImportResponseView.vue'
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
new Vue({
|
||||
render: h => h(App),
|
||||
}).$mount('#app')
|
||||
@@ -122,7 +122,7 @@
|
||||
<PdfViewer :recipe="recipe"></PdfViewer>
|
||||
</div>
|
||||
<div
|
||||
v-if="recipe.file_path.includes('.png') || recipe.file_path.includes('.jpg') || recipe.file_path.includes('.jpeg')">
|
||||
v-if="recipe.file_path.includes('.png') || recipe.file_path.includes('.jpg') || recipe.file_path.includes('.jpeg') || recipe.file_path.includes('.gif')">
|
||||
<ImageViewer :recipe="recipe"></ImageViewer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
|
||||
<div>
|
||||
<img :src="pdfUrl" width="100%" height="700px" :alt="_('External Recipe Image')">
|
||||
<div style="text-align: center">
|
||||
<b-img :src="pdfUrl" :alt="_('External Recipe Image')"></b-img>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<i class="fas fa-shopping-cart fa-fw"></i> {{ _('Add to Shopping') }}
|
||||
</a>
|
||||
|
||||
<a class="dropdown-item" :href="`${resolveDjangoUrl('new_meal_plan') }?r=${recipe.id}`"
|
||||
<a class="dropdown-item" :href="`${resolveDjangoUrl('new_meal_plan') }?recipe=${recipe.id}`"
|
||||
target="_blank" rel="noopener noreferrer"><i
|
||||
class="fas fa-calendar fa-fw"></i> {{ _('Add to Plan') }}
|
||||
</a>
|
||||
|
||||
@@ -18,6 +18,16 @@ export function apiLoadRecipe(recipe_id) {
|
||||
})
|
||||
}
|
||||
|
||||
export function apiLoadImportLog(id) {
|
||||
let url = resolveDjangoUrl('api:importlog-detail', id)
|
||||
|
||||
return axios.get(url).then((response) => {
|
||||
return response.data
|
||||
}).catch((err) => {
|
||||
handleError(err, 'There was an error loading a resource!', 'danger')
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function apiLogCooking(cook_log) {
|
||||
return axios.post(resolveDjangoUrl('api:cooklog-list',), cook_log).then((response) => {
|
||||
|
||||
@@ -9,6 +9,10 @@ const pages = {
|
||||
entry: './src/apps/OfflineView/main.js',
|
||||
chunks: ['chunk-vendors']
|
||||
},
|
||||
'import_response_view': {
|
||||
entry: './src/apps/ImportResponseView/main.js',
|
||||
chunks: ['chunk-vendors']
|
||||
},
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"status":"done","chunks":{"chunk-vendors":[{"name":"css/chunk-vendors.css","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\css\\chunk-vendors.css"},{"name":"js/chunk-vendors.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\chunk-vendors.js"}],"offline_view":[{"name":"js/offline_view.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\offline_view.js"}],"recipe_view":[{"name":"js/recipe_view.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\recipe_view.js"}]}}
|
||||
{"status":"done","chunks":{"chunk-vendors":[{"name":"css/chunk-vendors.css","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\css\\chunk-vendors.css"},{"name":"js/chunk-vendors.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\chunk-vendors.js"}],"import_response_view":[{"name":"js/import_response_view.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\import_response_view.js"}],"offline_view":[{"name":"js/offline_view.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\offline_view.js"}],"recipe_view":[{"name":"js/recipe_view.js","path":"F:\\Developement\\Django\\recipes\\cookbook\\static\\vue\\js\\recipe_view.js"}]}}
|
||||
5569
vue/yarn.lock
5569
vue/yarn.lock
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user