From 5ee718b578521d0eb954d1fa452b31fe32ddbd66 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Mon, 26 Apr 2021 18:00:54 +0200 Subject: [PATCH] added persistent search settings and tweaked view --- cookbook/static/vue/js/chunk-vendors.js | 2 +- .../static/vue/js/import_response_view.js | 2 +- cookbook/static/vue/js/offline_view.js | 2 +- cookbook/static/vue/js/recipe_search_view.js | 2 +- cookbook/static/vue/js/recipe_view.js | 2 +- node_modules/.yarn-integrity | 16 ++ node_modules/vue-cookies/LICENSE | 21 ++ node_modules/vue-cookies/README.md | 223 ++++++++++++++++++ node_modules/vue-cookies/package.json | 29 +++ node_modules/vue-cookies/sample/welcome.html | 51 ++++ node_modules/vue-cookies/types/index.d.ts | 44 ++++ node_modules/vue-cookies/types/vue.d.ts | 11 + node_modules/vue-cookies/vue-cookies.js | 146 ++++++++++++ package.json | 5 + .../RecipeSearchView/RecipeSearchView.vue | 64 +++-- vue/src/components/RecipeCard.vue | 1 + vue/src/locales/en.json | 4 +- yarn.lock | 8 + 18 files changed, 605 insertions(+), 28 deletions(-) create mode 100644 node_modules/.yarn-integrity create mode 100644 node_modules/vue-cookies/LICENSE create mode 100644 node_modules/vue-cookies/README.md create mode 100644 node_modules/vue-cookies/package.json create mode 100644 node_modules/vue-cookies/sample/welcome.html create mode 100644 node_modules/vue-cookies/types/index.d.ts create mode 100644 node_modules/vue-cookies/types/vue.d.ts create mode 100644 node_modules/vue-cookies/vue-cookies.js create mode 100644 package.json create mode 100644 yarn.lock diff --git a/cookbook/static/vue/js/chunk-vendors.js b/cookbook/static/vue/js/chunk-vendors.js index b83658ab..d4bd8318 100644 --- a/cookbook/static/vue/js/chunk-vendors.js +++ b/cookbook/static/vue/js/chunk-vendors.js @@ -257,7 +257,7 @@ var e=t.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_augus //! moment.js locale configuration var e={ss:"sekundes_sekundēm_sekunde_sekundes".split("_"),m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(t,e,n){return n?e%10===1&&e%100!==11?t[2]:t[3]:e%10===1&&e%100!==11?t[0]:t[1]}function r(t,r,i){return t+" "+n(e[i],t,r)}function i(t,r,i){return n(e[i],t,r)}function a(t,e){return e?"dažas sekundes":"dažām sekundēm"}var o=t.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:a,ss:r,m:i,mm:r,h:i,hh:r,d:i,dd:r,M:i,MM:r,y:i,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return o}))},bb71:function(t,e,n){(function(t,e){e(n("c1df"))})(0,(function(t){"use strict"; //! moment.js locale configuration -function e(t,e,n,r){var i={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[t+" Tage",t+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[t+" Monate",t+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[t+" Jahre",t+" Jahren"]};return e?i[n][0]:i[n][1]}var n=t.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:e,mm:"%d Minuten",h:e,hh:"%d Stunden",d:e,dd:e,w:e,ww:"%d Wochen",M:e,MM:e,y:e,yy:e},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return n}))},bc3a:function(t,e,n){t.exports=n("cee4")},bc9a:function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n("8c4e"),i=Object(r["a"])("$listeners","bvListeners")},be29:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t&&t.$options._scopeId||e}},c04e:function(t,e,n){var r=n("861d");t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},c109:function(t,e,n){(function(t,e){e(n("c1df"))})(0,(function(t){"use strict"; +function e(t,e,n,r){var i={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[t+" Tage",t+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[t+" Monate",t+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[t+" Jahre",t+" Jahren"]};return e?i[n][0]:i[n][1]}var n=t.defineLocale("de-ch",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:e,mm:"%d Minuten",h:e,hh:"%d Stunden",d:e,dd:e,w:e,ww:"%d Wochen",M:e,MM:e,y:e,yy:e},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}});return n}))},bbf5:function(t,e,n){(function(){var e={expires:"1d",path:"; path=/",domain:"",secure:"",sameSite:"; SameSite=Lax"},n={install:function(t){t.prototype.$cookies=this,t.$cookies=this},config:function(t,n,r,i,a){e.expires=t||"1d",e.path=n?"; path="+n:"; path=/",e.domain=r?"; domain="+r:"",e.secure=i?"; Secure":"",e.sameSite=a?"; SameSite="+a:"; SameSite=Lax"},get:function(t){var e=decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null;if(e&&"{"===e.substring(0,1)&&"}"===e.substring(e.length-1,e.length))try{e=JSON.parse(e)}catch(n){return e}return e},set:function(t,n,r,i,a,o,s){if(!t)throw new Error("Cookie name is not find in first argument.");if(/^(?:expires|max\-age|path|domain|secure|SameSite)$/i.test(t))throw new Error('Cookie key name illegality, Cannot be set to ["expires","max-age","path","domain","secure","SameSite"]\t current key name: '+t);n&&n.constructor===Object&&(n=JSON.stringify(n));var c="";if(r=void 0==r?e.expires:r,r&&0!=r)switch(r.constructor){case Number:c=r===1/0||-1===r?"; expires=Fri, 31 Dec 9999 23:59:59 GMT":"; max-age="+r;break;case String:if(/^(?:\d+(y|m|d|h|min|s))$/i.test(r)){var u=r.replace(/^(\d+)(?:y|m|d|h|min|s)$/i,"$1");switch(r.replace(/^(?:\d+)(y|m|d|h|min|s)$/i,"$1").toLowerCase()){case"m":c="; max-age="+2592e3*+u;break;case"d":c="; max-age="+86400*+u;break;case"h":c="; max-age="+3600*+u;break;case"min":c="; max-age="+60*+u;break;case"s":c="; max-age="+u;break;case"y":c="; max-age="+31104e3*+u;break;default:new Error('unknown exception of "set operation"')}}else c="; expires="+r;break;case Date:c="; expires="+r.toUTCString();break}return document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(n)+c+(a?"; domain="+a:e.domain)+(i?"; path="+i:e.path)+(void 0==o?e.secure:o?"; Secure":"")+(void 0==s?e.sameSite:s?"; SameSite="+s:""),this},remove:function(t,n,r){return!(!t||!this.isKey(t))&&(document.cookie=encodeURIComponent(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(r?"; domain="+r:e.domain)+(n?"; path="+n:e.path)+"; SameSite=Lax",this)},isKey:function(t){return new RegExp("(?:^|;\\s*)"+encodeURIComponent(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(document.cookie)},keys:function(){if(!document.cookie)return[];for(var t=document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g,"").split(/\s*(?:\=[^;]*)?;\s*/),e=0;e1&&void 0!==arguments[1]?arguments[1]:null;return t&&t.$options._scopeId||e}},c04e:function(t,e,n){var r=n("861d");t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},c109:function(t,e,n){(function(t,e){e(n("c1df"))})(0,(function(t){"use strict"; //! moment.js locale configuration var e=t.defineLocale("tzm",{months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[ⴰⵙⴷⵅ ⴴ] LT",nextDay:"[ⴰⵙⴽⴰ ⴴ] LT",nextWeek:"dddd [ⴴ] LT",lastDay:"[ⴰⵚⴰⵏⵜ ⴴ] LT",lastWeek:"dddd [ⴴ] LT",sameElse:"L"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",ss:"%d ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"},week:{dow:6,doy:12}});return e}))},c1df:function(t,e,n){(function(t){var e;//! moment.js //! version : 2.29.1 diff --git a/cookbook/static/vue/js/import_response_view.js b/cookbook/static/vue/js/import_response_view.js index 41dc0fb1..688b0f69 100644 --- a/cookbook/static/vue/js/import_response_view.js +++ b/cookbook/static/vue/js/import_response_view.js @@ -1 +1 @@ -(function(e){function t(t){for(var r,a,c=t[0],s=t[1],u=t[2],p=0,h=[];p1){var i=r[1];t[i]=e(n)}})),t}r["default"].use(i["a"]),t["a"]=new i["a"]({locale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_LOCALE||"en",fallbackLocale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_FALLBACK_LOCALE||"en",messages:o()})},a625:function(e){e.exports=JSON.parse('{"import_running":"Er wordt geïmporteerd, even geduld!","all_fields_optional":"Alle velden zijn optioneel en kunnen leeg gelaten worden.","convert_internal":"Zet om naar intern recept","Log_Recipe_Cooking":"Log Bereiding","External_Recipe_Image":"Externe Afbeelding Recept","Add_to_Book":"Voeg toe aan Boek","Add_to_Shopping":"Voeg toe aan Boodschappenlijst","Add_to_Plan":"Voeg toe aan Plan","Step_start_time":"Starttijd stap","Select_Book":"Selecteer Boek","Recipe_Image":"Afbeelding Recept","Import_finished":"Importeren gereed","View_Recipes":"Bekijk Recepten","Log_Cooking":"Log Bereiding","Proteins":"Proteïnes","Fats":"Vetten","Carbohydrates":"Koolhydraten","Calories":"Calorieën","Nutrition":"Voedingswaarde","Date":"Datum","Share":"Deel","Export":"Exporteer","Rating":"Waardering","Close":"Sluit","Add":"Voeg toe","Ingredients":"Ingrediënten","min":"min","Servings":"Porties","Waiting":"Wachten","Preparation":"Bereiding","Edit":"Bewerk","Open":"Open","Save":"Sla op","Step":"Stap","Search":"Zoeken","Import":"Importeer","Print":"Afdrukken","Information":"Informatie"}')},d76c:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},i=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"row"},[n("div",{staticClass:"col",staticStyle:{"text-align":"center"}},[n("i",{staticClass:"fas fa-spinner fa-spin fa-10x"})])])}],o={name:"LoadingSpinner",props:{recipe:Object}},a=o,c=n("2877"),s=Object(c["a"])(a,r,i,!1,null,null,null);t["a"]=s.exports},edd4:function(e){e.exports=JSON.parse('{"import_running":"Import running, please wait!","all_fields_optional":"All fields are optional and can be left empty.","convert_internal":"Convert to internal recipe","show_only_internal":"Show only internal recipes","Log_Recipe_Cooking":"Log Recipe Cooking","External_Recipe_Image":"External Recipe Image","Add_to_Book":"Add to Book","Add_to_Shopping":"Add to Shopping","Add_to_Plan":"Add to Plan","Step_start_time":"Step start time","Select_Book":"Select Book","Recipe_Image":"Recipe Image","Import_finished":"Import finished","View_Recipes":"View Recipes","Log_Cooking":"Log Cooking","New_Recipe":"New Recipe","Url_Import":"Url Import","Reset_Search":"Reset Search","Keywords":"Keywords","Books":"Books","Proteins":"Proteins","Fats":"Fats","Carbohydrates":"Carbohydrates","Calories":"Calories","Nutrition":"Nutrition","Date":"Date","Share":"Share","Export":"Export","Rating":"Rating","Close":"Close","Add":"Add","Ingredients":"Ingredients","min":"min","Servings":"Servings","Waiting":"Waiting","Preparation":"Preparation","Edit":"Edit","Open":"Open","Save":"Save","Step":"Step","Search":"Search","Import":"Import","Print":"Print","or":"or","and":"and","Information":"Information"}')},fa7d:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"f",(function(){return a})),n.d(t,"a",(function(){return c})),n.d(t,"e",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"g",(function(){return d})),n.d(t,"d",(function(){return h}));n("99af");var r=n("59e4");function i(e,t,n){var r=Math.floor(e),i=1,o=r+1,a=1;if(e!==r)while(i<=t&&a<=t){var c=(r+o)/(i+a);if(e===c){i+a<=t?(i+=a,r+=o,a=t+1):i>a?a=t+1:i=t+1;break}et&&(i=a,r=o),!n)return[0,r,i];var s=Math.floor(r/i);return[s,r-s*i,i]}var o={methods:{makeToast:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return a(e,t,n)}}};function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=new r["a"];i.$bvToast.toast(t,{title:e,variant:n,toaster:"b-toaster-top-center",solid:!0})}var c={methods:{_:function(e){return s(e)}}};function s(e){return window.gettext(e)}var u={methods:{resolveDjangoUrl:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return d(e,t)}}};function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!==t?window.Urls[e](t):window.Urls[e]()}function p(e){return window.USER_PREF[e]}function h(e,t){if(p("use_fractions")){var n="",r=i(e*t,9,!0);return r[0]>0&&(n+=r[0]),r[1]>0&&(n+=" ".concat(r[1],"").concat(r[2],"")),n}return b(e*t)}function b(e){var t=p("user_fractions")?p("user_fractions"):2;return+(Math.round(e+"e+".concat(t))+"e-".concat(t))}}}); \ No newline at end of file +(function(e){function t(t){for(var r,a,c=t[0],s=t[1],u=t[2],p=0,h=[];p1){var i=r[1];t[i]=e(n)}})),t}r["default"].use(i["a"]),t["a"]=new i["a"]({locale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_LOCALE||"en",fallbackLocale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_FALLBACK_LOCALE||"en",messages:o()})},a625:function(e){e.exports=JSON.parse('{"import_running":"Er wordt geïmporteerd, even geduld!","all_fields_optional":"Alle velden zijn optioneel en kunnen leeg gelaten worden.","convert_internal":"Zet om naar intern recept","Log_Recipe_Cooking":"Log Bereiding","External_Recipe_Image":"Externe Afbeelding Recept","Add_to_Book":"Voeg toe aan Boek","Add_to_Shopping":"Voeg toe aan Boodschappenlijst","Add_to_Plan":"Voeg toe aan Plan","Step_start_time":"Starttijd stap","Select_Book":"Selecteer Boek","Recipe_Image":"Afbeelding Recept","Import_finished":"Importeren gereed","View_Recipes":"Bekijk Recepten","Log_Cooking":"Log Bereiding","Proteins":"Eiwitten","Fats":"Vetten","Carbohydrates":"Koolhydraten","Calories":"Calorieën","Nutrition":"Voedingswaarde","Date":"Datum","Share":"Deel","Export":"Exporteren","Rating":"Beoordeling","Close":"Sluiten","Add":"Voeg toe","Ingredients":"Ingrediënten","min":"min","Servings":"Porties","Waiting":"Wachten","Preparation":"Bereiding","Edit":"Bewerken","Open":"Open","Save":"Opslaan","Step":"Stap","Search":"Zoeken","Import":"Importeer","Print":"Afdrukken","Information":"Informatie","Keywords":"Etiketten","Books":"Boeken","show_only_internal":"Toon alleen interne recepten","New_Recipe":"Nieuw Recept","Url_Import":"Importeer URL","Reset_Search":"Zoeken resetten","or":"of","and":"en"}')},d76c:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},i=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"row"},[n("div",{staticClass:"col",staticStyle:{"text-align":"center"}},[n("i",{staticClass:"fas fa-spinner fa-spin fa-10x"})])])}],o={name:"LoadingSpinner",props:{recipe:Object}},a=o,c=n("2877"),s=Object(c["a"])(a,r,i,!1,null,null,null);t["a"]=s.exports},edd4:function(e){e.exports=JSON.parse('{"import_running":"Import running, please wait!","all_fields_optional":"All fields are optional and can be left empty.","convert_internal":"Convert to internal recipe","show_only_internal":"Show only internal recipes","Log_Recipe_Cooking":"Log Recipe Cooking","External_Recipe_Image":"External Recipe Image","Add_to_Book":"Add to Book","Add_to_Shopping":"Add to Shopping","Add_to_Plan":"Add to Plan","Step_start_time":"Step start time","Select_Book":"Select Book","Recipe_Image":"Recipe Image","Import_finished":"Import finished","View_Recipes":"View Recipes","Log_Cooking":"Log Cooking","New_Recipe":"New Recipe","Url_Import":"Url Import","Reset_Search":"Reset Search","Recently_Viewed":"Recently Viewed","Keywords":"Keywords","Books":"Books","Proteins":"Proteins","Fats":"Fats","Carbohydrates":"Carbohydrates","Calories":"Calories","Nutrition":"Nutrition","Date":"Date","Share":"Share","Export":"Export","Rating":"Rating","Close":"Close","Add":"Add","Ingredients":"Ingredients","min":"min","Servings":"Servings","Waiting":"Waiting","Preparation":"Preparation","External":"External","Edit":"Edit","Open":"Open","Save":"Save","Step":"Step","Search":"Search","Import":"Import","Print":"Print","or":"or","and":"and","Information":"Information"}')},fa7d:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"f",(function(){return a})),n.d(t,"a",(function(){return c})),n.d(t,"e",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"g",(function(){return d})),n.d(t,"d",(function(){return h}));n("99af");var r=n("59e4");function i(e,t,n){var r=Math.floor(e),i=1,o=r+1,a=1;if(e!==r)while(i<=t&&a<=t){var c=(r+o)/(i+a);if(e===c){i+a<=t?(i+=a,r+=o,a=t+1):i>a?a=t+1:i=t+1;break}et&&(i=a,r=o),!n)return[0,r,i];var s=Math.floor(r/i);return[s,r-s*i,i]}var o={methods:{makeToast:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return a(e,t,n)}}};function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=new r["a"];i.$bvToast.toast(t,{title:e,variant:n,toaster:"b-toaster-top-center",solid:!0})}var c={methods:{_:function(e){return s(e)}}};function s(e){return window.gettext(e)}var u={methods:{resolveDjangoUrl:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return d(e,t)}}};function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!==t?window.Urls[e](t):window.Urls[e]()}function p(e){return window.USER_PREF[e]}function h(e,t){if(p("use_fractions")){var n="",r=i(e*t,9,!0);return r[0]>0&&(n+=r[0]),r[1]>0&&(n+=" ".concat(r[1],"").concat(r[2],"")),n}return b(e*t)}function b(e){var t=p("user_fractions")?p("user_fractions"):2;return+(Math.round(e+"e+".concat(t))+"e-".concat(t))}}}); \ No newline at end of file diff --git a/cookbook/static/vue/js/offline_view.js b/cookbook/static/vue/js/offline_view.js index 6f4c934d..e7beb776 100644 --- a/cookbook/static/vue/js/offline_view.js +++ b/cookbook/static/vue/js/offline_view.js @@ -1 +1 @@ -(function(e){function t(t){for(var r,i,s=t[0],c=t[1],d=t[2],f=0,u=[];f1){var a=r[1];t[a]=e(n)}})),t}r["default"].use(a["a"]),t["a"]=new a["a"]({locale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_LOCALE||"en",fallbackLocale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_FALLBACK_LOCALE||"en",messages:o()})},a625:function(e){e.exports=JSON.parse('{"import_running":"Er wordt geïmporteerd, even geduld!","all_fields_optional":"Alle velden zijn optioneel en kunnen leeg gelaten worden.","convert_internal":"Zet om naar intern recept","Log_Recipe_Cooking":"Log Bereiding","External_Recipe_Image":"Externe Afbeelding Recept","Add_to_Book":"Voeg toe aan Boek","Add_to_Shopping":"Voeg toe aan Boodschappenlijst","Add_to_Plan":"Voeg toe aan Plan","Step_start_time":"Starttijd stap","Select_Book":"Selecteer Boek","Recipe_Image":"Afbeelding Recept","Import_finished":"Importeren gereed","View_Recipes":"Bekijk Recepten","Log_Cooking":"Log Bereiding","Proteins":"Proteïnes","Fats":"Vetten","Carbohydrates":"Koolhydraten","Calories":"Calorieën","Nutrition":"Voedingswaarde","Date":"Datum","Share":"Deel","Export":"Exporteer","Rating":"Waardering","Close":"Sluit","Add":"Voeg toe","Ingredients":"Ingrediënten","min":"min","Servings":"Porties","Waiting":"Wachten","Preparation":"Bereiding","Edit":"Bewerk","Open":"Open","Save":"Sla op","Step":"Stap","Search":"Zoeken","Import":"Importeer","Print":"Afdrukken","Information":"Informatie"}')},da67:function(e,t,n){"use strict";n.r(t);n("e260"),n("e6cf"),n("cca6"),n("a79d");var r=n("a026"),a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"app"}},[n("label",[e._v(" "+e._s(e.$t("Search"))+" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.filter,expression:"filter"}],staticClass:"form-control",attrs:{type:"text"},domProps:{value:e.filter},on:{input:function(t){t.target.composing||(e.filter=t.target.value)}}})]),n("div",{staticClass:"row"},e._l(e.filtered_recipes,(function(t){return n("div",{key:t.id,staticClass:"col-md-3"},[n("b-card",{attrs:{title:t.name,tag:"article"}},[n("b-card-text",[n("span",{staticClass:"text-muted"},[e._v(e._s(e.formatDateTime(t.updated_at)))]),e._v(" "+e._s(t.description)+" ")]),n("b-button",{attrs:{href:e.resolveDjangoUrl("view_recipe",t.id),variant:"primary"}},[e._v(e._s(e.$t("Open")))])],1)],1)})),0)])},o=[],i=(n("159b"),n("caad"),n("2532"),n("b0c0"),n("4de4"),n("d3b7"),n("ddb0"),n("466d"),n("ac1f"),n("5f5b")),s=(n("2dd8"),n("fa7d")),c=n("c1df"),d=n.n(c);r["default"].use(i["a"]),r["default"].prototype.moment=d.a;var l={name:"OfflineView",mixins:[s["b"]],computed:{filtered_recipes:function(){var e=this,t={};return this.recipes.forEach((function(n){n.name.toLowerCase().includes(e.filter.toLowerCase())&&(n.id in t?n.updated_at>t[n.id].updated_at&&(t[n.id]=n):t[n.id]=n)})),t}},data:function(){return{recipes:[],filter:""}},mounted:function(){this.loadRecipe()},methods:{formatDateTime:function(e){return d.a.locale(window.navigator.language),d()(e).format("LLL")},loadRecipe:function(){var e=this;caches.open("api-recipe").then((function(t){t.keys().then((function(t){t.forEach((function(t){caches.match(t).then((function(t){t.json().then((function(t){e.recipes.push(t)}))}))}))}))}))}}},f=l,u=n("2877"),p=Object(u["a"])(f,a,o,!1,null,null,null),b=p.exports,j=n("9225");r["default"].config.productionTip=!1,new r["default"]({i18n:j["a"],render:function(e){return e(b)}}).$mount("#app")},edd4:function(e){e.exports=JSON.parse('{"import_running":"Import running, please wait!","all_fields_optional":"All fields are optional and can be left empty.","convert_internal":"Convert to internal recipe","show_only_internal":"Show only internal recipes","Log_Recipe_Cooking":"Log Recipe Cooking","External_Recipe_Image":"External Recipe Image","Add_to_Book":"Add to Book","Add_to_Shopping":"Add to Shopping","Add_to_Plan":"Add to Plan","Step_start_time":"Step start time","Select_Book":"Select Book","Recipe_Image":"Recipe Image","Import_finished":"Import finished","View_Recipes":"View Recipes","Log_Cooking":"Log Cooking","New_Recipe":"New Recipe","Url_Import":"Url Import","Reset_Search":"Reset Search","Keywords":"Keywords","Books":"Books","Proteins":"Proteins","Fats":"Fats","Carbohydrates":"Carbohydrates","Calories":"Calories","Nutrition":"Nutrition","Date":"Date","Share":"Share","Export":"Export","Rating":"Rating","Close":"Close","Add":"Add","Ingredients":"Ingredients","min":"min","Servings":"Servings","Waiting":"Waiting","Preparation":"Preparation","Edit":"Edit","Open":"Open","Save":"Save","Step":"Step","Search":"Search","Import":"Import","Print":"Print","or":"or","and":"and","Information":"Information"}')},fa7d:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"f",(function(){return i})),n.d(t,"a",(function(){return s})),n.d(t,"e",(function(){return c})),n.d(t,"b",(function(){return d})),n.d(t,"g",(function(){return l})),n.d(t,"d",(function(){return u}));n("99af");var r=n("59e4");function a(e,t,n){var r=Math.floor(e),a=1,o=r+1,i=1;if(e!==r)while(a<=t&&i<=t){var s=(r+o)/(a+i);if(e===s){a+i<=t?(a+=i,r+=o,i=t+1):a>i?i=t+1:a=t+1;break}et&&(a=i,r=o),!n)return[0,r,a];var c=Math.floor(r/a);return[c,r-c*a,a]}var o={methods:{makeToast:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return i(e,t,n)}}};function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=new r["a"];a.$bvToast.toast(t,{title:e,variant:n,toaster:"b-toaster-top-center",solid:!0})}var s={methods:{_:function(e){return c(e)}}};function c(e){return window.gettext(e)}var d={methods:{resolveDjangoUrl:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return l(e,t)}}};function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!==t?window.Urls[e](t):window.Urls[e]()}function f(e){return window.USER_PREF[e]}function u(e,t){if(f("use_fractions")){var n="",r=a(e*t,9,!0);return r[0]>0&&(n+=r[0]),r[1]>0&&(n+=" ".concat(r[1],"").concat(r[2],"")),n}return p(e*t)}function p(e){var t=f("user_fractions")?f("user_fractions"):2;return+(Math.round(e+"e+".concat(t))+"e-".concat(t))}}}); \ No newline at end of file +(function(e){function t(t){for(var r,i,s=t[0],c=t[1],d=t[2],f=0,u=[];f1){var o=r[1];t[o]=e(n)}})),t}r["default"].use(o["a"]),t["a"]=new o["a"]({locale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_LOCALE||"en",fallbackLocale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_FALLBACK_LOCALE||"en",messages:a()})},a625:function(e){e.exports=JSON.parse('{"import_running":"Er wordt geïmporteerd, even geduld!","all_fields_optional":"Alle velden zijn optioneel en kunnen leeg gelaten worden.","convert_internal":"Zet om naar intern recept","Log_Recipe_Cooking":"Log Bereiding","External_Recipe_Image":"Externe Afbeelding Recept","Add_to_Book":"Voeg toe aan Boek","Add_to_Shopping":"Voeg toe aan Boodschappenlijst","Add_to_Plan":"Voeg toe aan Plan","Step_start_time":"Starttijd stap","Select_Book":"Selecteer Boek","Recipe_Image":"Afbeelding Recept","Import_finished":"Importeren gereed","View_Recipes":"Bekijk Recepten","Log_Cooking":"Log Bereiding","Proteins":"Eiwitten","Fats":"Vetten","Carbohydrates":"Koolhydraten","Calories":"Calorieën","Nutrition":"Voedingswaarde","Date":"Datum","Share":"Deel","Export":"Exporteren","Rating":"Beoordeling","Close":"Sluiten","Add":"Voeg toe","Ingredients":"Ingrediënten","min":"min","Servings":"Porties","Waiting":"Wachten","Preparation":"Bereiding","Edit":"Bewerken","Open":"Open","Save":"Opslaan","Step":"Stap","Search":"Zoeken","Import":"Importeer","Print":"Afdrukken","Information":"Informatie","Keywords":"Etiketten","Books":"Boeken","show_only_internal":"Toon alleen interne recepten","New_Recipe":"Nieuw Recept","Url_Import":"Importeer URL","Reset_Search":"Zoeken resetten","or":"of","and":"en"}')},da67:function(e,t,n){"use strict";n.r(t);n("e260"),n("e6cf"),n("cca6"),n("a79d");var r=n("a026"),o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"app"}},[n("label",[e._v(" "+e._s(e.$t("Search"))+" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.filter,expression:"filter"}],staticClass:"form-control",attrs:{type:"text"},domProps:{value:e.filter},on:{input:function(t){t.target.composing||(e.filter=t.target.value)}}})]),n("div",{staticClass:"row"},e._l(e.filtered_recipes,(function(t){return n("div",{key:t.id,staticClass:"col-md-3"},[n("b-card",{attrs:{title:t.name,tag:"article"}},[n("b-card-text",[n("span",{staticClass:"text-muted"},[e._v(e._s(e.formatDateTime(t.updated_at)))]),e._v(" "+e._s(t.description)+" ")]),n("b-button",{attrs:{href:e.resolveDjangoUrl("view_recipe",t.id),variant:"primary"}},[e._v(e._s(e.$t("Open")))])],1)],1)})),0)])},a=[],i=(n("159b"),n("caad"),n("2532"),n("b0c0"),n("4de4"),n("d3b7"),n("ddb0"),n("466d"),n("ac1f"),n("5f5b")),s=(n("2dd8"),n("fa7d")),c=n("c1df"),d=n.n(c);r["default"].use(i["a"]),r["default"].prototype.moment=d.a;var l={name:"OfflineView",mixins:[s["b"]],computed:{filtered_recipes:function(){var e=this,t={};return this.recipes.forEach((function(n){n.name.toLowerCase().includes(e.filter.toLowerCase())&&(n.id in t?n.updated_at>t[n.id].updated_at&&(t[n.id]=n):t[n.id]=n)})),t}},data:function(){return{recipes:[],filter:""}},mounted:function(){this.loadRecipe()},methods:{formatDateTime:function(e){return d.a.locale(window.navigator.language),d()(e).format("LLL")},loadRecipe:function(){var e=this;caches.open("api-recipe").then((function(t){t.keys().then((function(t){t.forEach((function(t){caches.match(t).then((function(t){t.json().then((function(t){e.recipes.push(t)}))}))}))}))}))}}},f=l,u=n("2877"),p=Object(u["a"])(f,o,a,!1,null,null,null),b=p.exports,j=n("9225");r["default"].config.productionTip=!1,new r["default"]({i18n:j["a"],render:function(e){return e(b)}}).$mount("#app")},edd4:function(e){e.exports=JSON.parse('{"import_running":"Import running, please wait!","all_fields_optional":"All fields are optional and can be left empty.","convert_internal":"Convert to internal recipe","show_only_internal":"Show only internal recipes","Log_Recipe_Cooking":"Log Recipe Cooking","External_Recipe_Image":"External Recipe Image","Add_to_Book":"Add to Book","Add_to_Shopping":"Add to Shopping","Add_to_Plan":"Add to Plan","Step_start_time":"Step start time","Select_Book":"Select Book","Recipe_Image":"Recipe Image","Import_finished":"Import finished","View_Recipes":"View Recipes","Log_Cooking":"Log Cooking","New_Recipe":"New Recipe","Url_Import":"Url Import","Reset_Search":"Reset Search","Recently_Viewed":"Recently Viewed","Keywords":"Keywords","Books":"Books","Proteins":"Proteins","Fats":"Fats","Carbohydrates":"Carbohydrates","Calories":"Calories","Nutrition":"Nutrition","Date":"Date","Share":"Share","Export":"Export","Rating":"Rating","Close":"Close","Add":"Add","Ingredients":"Ingredients","min":"min","Servings":"Servings","Waiting":"Waiting","Preparation":"Preparation","External":"External","Edit":"Edit","Open":"Open","Save":"Save","Step":"Step","Search":"Search","Import":"Import","Print":"Print","or":"or","and":"and","Information":"Information"}')},fa7d:function(e,t,n){"use strict";n.d(t,"c",(function(){return a})),n.d(t,"f",(function(){return i})),n.d(t,"a",(function(){return s})),n.d(t,"e",(function(){return c})),n.d(t,"b",(function(){return d})),n.d(t,"g",(function(){return l})),n.d(t,"d",(function(){return u}));n("99af");var r=n("59e4");function o(e,t,n){var r=Math.floor(e),o=1,a=r+1,i=1;if(e!==r)while(o<=t&&i<=t){var s=(r+a)/(o+i);if(e===s){o+i<=t?(o+=i,r+=a,i=t+1):o>i?i=t+1:o=t+1;break}et&&(o=i,r=a),!n)return[0,r,o];var c=Math.floor(r/o);return[c,r-c*o,o]}var a={methods:{makeToast:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return i(e,t,n)}}};function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=new r["a"];o.$bvToast.toast(t,{title:e,variant:n,toaster:"b-toaster-top-center",solid:!0})}var s={methods:{_:function(e){return c(e)}}};function c(e){return window.gettext(e)}var d={methods:{resolveDjangoUrl:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return l(e,t)}}};function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!==t?window.Urls[e](t):window.Urls[e]()}function f(e){return window.USER_PREF[e]}function u(e,t){if(f("use_fractions")){var n="",r=o(e*t,9,!0);return r[0]>0&&(n+=r[0]),r[1]>0&&(n+=" ".concat(r[1],"").concat(r[2],"")),n}return p(e*t)}function p(e){var t=f("user_fractions")?f("user_fractions"):2;return+(Math.round(e+"e+".concat(t))+"e-".concat(t))}}}); \ No newline at end of file diff --git a/cookbook/static/vue/js/recipe_search_view.js b/cookbook/static/vue/js/recipe_search_view.js index 20eeb006..1441f636 100644 --- a/cookbook/static/vue/js/recipe_search_view.js +++ b/cookbook/static/vue/js/recipe_search_view.js @@ -1 +1 @@ -(function(e){function t(t){for(var r,a,c=t[0],s=t[1],u=t[2],p=0,h=[];p0?n("div",e._l(e.recipe.keywords,(function(t){return n("small",{key:t.id,staticStyle:{padding:"2px"}},[n("b-badge",{attrs:{pill:"",variant:"light"}},[e._v(e._s(t.label))])],1)})),0):e._e()},i=[],o={name:"Keywords",props:{recipe:Object}},a=o,c=n("2877"),s=Object(c["a"])(a,r,i,!1,null,null,null);t["a"]=s.exports},9225:function(e,t,n){"use strict";n("159b"),n("d3b7"),n("ddb0"),n("466d"),n("ac1f");var r=n("a026"),i=n("a925");function o(){var e=n("49f8"),t={};return e.keys().forEach((function(n){var r=n.match(/([A-Za-z0-9-_]+)\./i);if(r&&r.length>1){var i=r[1];t[i]=e(n)}})),t}r["default"].use(i["a"]),t["a"]=new i["a"]({locale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_LOCALE||"en",fallbackLocale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_FALLBACK_LOCALE||"en",messages:o()})},a625:function(e){e.exports=JSON.parse('{"import_running":"Er wordt geïmporteerd, even geduld!","all_fields_optional":"Alle velden zijn optioneel en kunnen leeg gelaten worden.","convert_internal":"Zet om naar intern recept","Log_Recipe_Cooking":"Log Bereiding","External_Recipe_Image":"Externe Afbeelding Recept","Add_to_Book":"Voeg toe aan Boek","Add_to_Shopping":"Voeg toe aan Boodschappenlijst","Add_to_Plan":"Voeg toe aan Plan","Step_start_time":"Starttijd stap","Select_Book":"Selecteer Boek","Recipe_Image":"Afbeelding Recept","Import_finished":"Importeren gereed","View_Recipes":"Bekijk Recepten","Log_Cooking":"Log Bereiding","Proteins":"Proteïnes","Fats":"Vetten","Carbohydrates":"Koolhydraten","Calories":"Calorieën","Nutrition":"Voedingswaarde","Date":"Datum","Share":"Deel","Export":"Exporteer","Rating":"Waardering","Close":"Sluit","Add":"Voeg toe","Ingredients":"Ingrediënten","min":"min","Servings":"Porties","Waiting":"Wachten","Preparation":"Bereiding","Edit":"Bewerk","Open":"Open","Save":"Sla op","Step":"Stap","Search":"Zoeken","Import":"Importeer","Print":"Afdrukken","Information":"Informatie"}')},d76c:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},i=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"row"},[n("div",{staticClass:"col",staticStyle:{"text-align":"center"}},[n("i",{staticClass:"fas fa-spinner fa-spin fa-10x"})])])}],o={name:"LoadingSpinner",props:{recipe:Object}},a=o,c=n("2877"),s=Object(c["a"])(a,r,i,!1,null,null,null);t["a"]=s.exports},edd4:function(e){e.exports=JSON.parse('{"import_running":"Import running, please wait!","all_fields_optional":"All fields are optional and can be left empty.","convert_internal":"Convert to internal recipe","show_only_internal":"Show only internal recipes","Log_Recipe_Cooking":"Log Recipe Cooking","External_Recipe_Image":"External Recipe Image","Add_to_Book":"Add to Book","Add_to_Shopping":"Add to Shopping","Add_to_Plan":"Add to Plan","Step_start_time":"Step start time","Select_Book":"Select Book","Recipe_Image":"Recipe Image","Import_finished":"Import finished","View_Recipes":"View Recipes","Log_Cooking":"Log Cooking","New_Recipe":"New Recipe","Url_Import":"Url Import","Reset_Search":"Reset Search","Keywords":"Keywords","Books":"Books","Proteins":"Proteins","Fats":"Fats","Carbohydrates":"Carbohydrates","Calories":"Calories","Nutrition":"Nutrition","Date":"Date","Share":"Share","Export":"Export","Rating":"Rating","Close":"Close","Add":"Add","Ingredients":"Ingredients","min":"min","Servings":"Servings","Waiting":"Waiting","Preparation":"Preparation","Edit":"Edit","Open":"Open","Save":"Save","Step":"Step","Search":"Search","Import":"Import","Print":"Print","or":"or","and":"and","Information":"Information"}')},fa7d:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"f",(function(){return a})),n.d(t,"a",(function(){return c})),n.d(t,"e",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"g",(function(){return d})),n.d(t,"d",(function(){return h}));n("99af");var r=n("59e4");function i(e,t,n){var r=Math.floor(e),i=1,o=r+1,a=1;if(e!==r)while(i<=t&&a<=t){var c=(r+o)/(i+a);if(e===c){i+a<=t?(i+=a,r+=o,a=t+1):i>a?a=t+1:i=t+1;break}et&&(i=a,r=o),!n)return[0,r,i];var s=Math.floor(r/i);return[s,r-s*i,i]}var o={methods:{makeToast:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return a(e,t,n)}}};function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=new r["a"];i.$bvToast.toast(t,{title:e,variant:n,toaster:"b-toaster-top-center",solid:!0})}var c={methods:{_:function(e){return s(e)}}};function s(e){return window.gettext(e)}var u={methods:{resolveDjangoUrl:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return d(e,t)}}};function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!==t?window.Urls[e](t):window.Urls[e]()}function p(e){return window.USER_PREF[e]}function h(e,t){if(p("use_fractions")){var n="",r=i(e*t,9,!0);return r[0]>0&&(n+=r[0]),r[1]>0&&(n+=" ".concat(r[1],"").concat(r[2],"")),n}return b(e*t)}function b(e){var t=p("user_fractions")?p("user_fractions"):2;return+(Math.round(e+"e+".concat(t))+"e-".concat(t))}},fc0d:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticClass:"dropdown"},[e._m(0),n("div",{staticClass:"dropdown-menu dropdown-menu-right",attrs:{"aria-labelledby":"dropdownMenuLink"}},[n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("edit_recipe",e.recipe.id)}},[n("i",{staticClass:"fas fa-pencil-alt fa-fw"}),e._v(" "+e._s(e.$t("Edit")))]),e.recipe.internal?e._e():n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("edit_convert_recipe",e.recipe.id)}},[n("i",{staticClass:"fas fa-exchange-alt fa-fw"}),e._v(" "+e._s(e.$t("convert_internal")))]),n("button",{staticClass:"dropdown-item",on:{click:function(t){return e.$bvModal.show("id_modal_add_book")}}},[n("i",{staticClass:"fas fa-bookmark fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Book"))+" ")]),e.recipe.internal?n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("view_shopping")+"?r=["+e.recipe.id+","+e.servings_value+"]",target:"_blank",rel:"noopener noreferrer"}},[n("i",{staticClass:"fas fa-shopping-cart fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Shopping"))+" ")]):e._e(),n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("new_meal_plan")+"?recipe="+e.recipe.id,target:"_blank",rel:"noopener noreferrer"}},[n("i",{staticClass:"fas fa-calendar fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Plan"))+" ")]),n("button",{staticClass:"dropdown-item",on:{click:function(t){return e.$bvModal.show("id_modal_cook_log")}}},[n("i",{staticClass:"fas fa-clipboard-list fa-fw"}),e._v(" "+e._s(e.$t("Log_Cooking"))+" ")]),n("button",{staticClass:"dropdown-item",attrs:{onclick:"window.print()"}},[n("i",{staticClass:"fas fa-print fa-fw"}),e._v(" "+e._s(e.$t("Print"))+" ")]),n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("view_export")+"?r="+e.recipe.id,target:"_blank",rel:"noopener noreferrer"}},[n("i",{staticClass:"fas fa-file-export fa-fw"}),e._v(" "+e._s(e.$t("Export")))]),e.recipe.internal?n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("new_share_link",e.recipe.id),target:"_blank",rel:"noopener noreferrer"}},[n("i",{staticClass:"fas fa-share-alt fa-fw"}),e._v(" "+e._s(e.$t("Share")))]):e._e()])]),n("cook-log",{attrs:{recipe:e.recipe}})],1)},i=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a",{staticClass:"btn shadow-none",attrs:{href:"#",role:"button",id:"dropdownMenuLink","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[n("i",{staticClass:"fas fa-ellipsis-v"})])}],o=(n("a9e3"),n("fa7d")),a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("b-modal",{staticClass:"modal",attrs:{id:"id_modal_cook_log",title:e.$t("Log_Recipe_Cooking"),"ok-title":e.$t("Save"),"cancel-title":e.$t("Close")},on:{ok:function(t){return e.logCook()}}},[n("p",[e._v(e._s(e.$t("all_fields_optional")))]),n("form",[n("label",{attrs:{for:"id_log_servings"}},[e._v(e._s(e.$t("Servings")))]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.logObject.servings,expression:"logObject.servings"}],staticClass:"form-control",attrs:{type:"number",id:"id_log_servings"},domProps:{value:e.logObject.servings},on:{input:function(t){t.target.composing||e.$set(e.logObject,"servings",t.target.value)}}}),n("label",{staticStyle:{"margin-top":"2vh"}},[e._v(e._s(e.$t("Rating"))+" - "),n("span",{attrs:{id:"id_rating_show"}},[e._v(e._s(e.logObject.rating)+"/5")])]),n("b-form-rating",{model:{value:e.logObject.rating,callback:function(t){e.$set(e.logObject,"rating",t)},expression:"logObject.rating"}}),n("label",{staticStyle:{"margin-top":"2vh"},attrs:{for:"id_date"}},[e._v(e._s(e.$t("Date")))]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.logObject.created_at,expression:"logObject.created_at"}],staticClass:"form-control",attrs:{type:"datetime-local",id:"id_date"},domProps:{value:e.logObject.created_at},on:{input:function(t){t.target.composing||e.$set(e.logObject,"created_at",t.target.value)}}})],1)])],1)},c=[],s=n("c1df"),u=n.n(s),d=n("a026"),p=n("5f5b"),h=n("7c15");d["default"].prototype.moment=u.a,d["default"].use(p["a"]);var b={name:"CookLog",props:{recipe:Object},data:function(){return{logObject:{recipe:this.recipe.id,servings:0,rating:0,created_at:u()().format("yyyy-MM-DDTHH:mm")}}},methods:{logCook:function(){Object(h["d"])(this.logObject)}}},f=b,l=n("2877"),j=Object(l["a"])(f,a,c,!1,null,null,null),O=j.exports,v={name:"RecipeContextMenu",mixins:[o["b"]],components:{CookLog:O},data:function(){return{servings_value:0}},props:{recipe:Object,servings:{type:Number,default:-1}},mounted:function(){this.servings_value=-1===this.servings?this.recipe.servings:this.servings}},g=v,m=Object(l["a"])(g,r,i,!1,null,null,null);t["a"]=m.exports}}); \ No newline at end of file +(function(e){function t(t){for(var r,a,s=t[0],c=t[1],u=t[2],p=0,h=[];p0?n("div",e._l(e.recipe.keywords,(function(t){return n("small",{key:t.id,staticStyle:{padding:"2px"}},[n("b-badge",{attrs:{pill:"",variant:"light"}},[e._v(e._s(t.label))])],1)})),0):e._e()},i=[],o={name:"Keywords",props:{recipe:Object}},a=o,s=n("2877"),c=Object(s["a"])(a,r,i,!1,null,null,null);t["a"]=c.exports},9225:function(e,t,n){"use strict";n("159b"),n("d3b7"),n("ddb0"),n("466d"),n("ac1f");var r=n("a026"),i=n("a925");function o(){var e=n("49f8"),t={};return e.keys().forEach((function(n){var r=n.match(/([A-Za-z0-9-_]+)\./i);if(r&&r.length>1){var i=r[1];t[i]=e(n)}})),t}r["default"].use(i["a"]),t["a"]=new i["a"]({locale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_LOCALE||"en",fallbackLocale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_FALLBACK_LOCALE||"en",messages:o()})},a625:function(e){e.exports=JSON.parse('{"import_running":"Er wordt geïmporteerd, even geduld!","all_fields_optional":"Alle velden zijn optioneel en kunnen leeg gelaten worden.","convert_internal":"Zet om naar intern recept","Log_Recipe_Cooking":"Log Bereiding","External_Recipe_Image":"Externe Afbeelding Recept","Add_to_Book":"Voeg toe aan Boek","Add_to_Shopping":"Voeg toe aan Boodschappenlijst","Add_to_Plan":"Voeg toe aan Plan","Step_start_time":"Starttijd stap","Select_Book":"Selecteer Boek","Recipe_Image":"Afbeelding Recept","Import_finished":"Importeren gereed","View_Recipes":"Bekijk Recepten","Log_Cooking":"Log Bereiding","Proteins":"Eiwitten","Fats":"Vetten","Carbohydrates":"Koolhydraten","Calories":"Calorieën","Nutrition":"Voedingswaarde","Date":"Datum","Share":"Deel","Export":"Exporteren","Rating":"Beoordeling","Close":"Sluiten","Add":"Voeg toe","Ingredients":"Ingrediënten","min":"min","Servings":"Porties","Waiting":"Wachten","Preparation":"Bereiding","Edit":"Bewerken","Open":"Open","Save":"Opslaan","Step":"Stap","Search":"Zoeken","Import":"Importeer","Print":"Afdrukken","Information":"Informatie","Keywords":"Etiketten","Books":"Boeken","show_only_internal":"Toon alleen interne recepten","New_Recipe":"Nieuw Recept","Url_Import":"Importeer URL","Reset_Search":"Zoeken resetten","or":"of","and":"en"}')},d76c:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},i=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"row"},[n("div",{staticClass:"col",staticStyle:{"text-align":"center"}},[n("i",{staticClass:"fas fa-spinner fa-spin fa-10x"})])])}],o={name:"LoadingSpinner",props:{recipe:Object}},a=o,s=n("2877"),c=Object(s["a"])(a,r,i,!1,null,null,null);t["a"]=c.exports},edd4:function(e){e.exports=JSON.parse('{"import_running":"Import running, please wait!","all_fields_optional":"All fields are optional and can be left empty.","convert_internal":"Convert to internal recipe","show_only_internal":"Show only internal recipes","Log_Recipe_Cooking":"Log Recipe Cooking","External_Recipe_Image":"External Recipe Image","Add_to_Book":"Add to Book","Add_to_Shopping":"Add to Shopping","Add_to_Plan":"Add to Plan","Step_start_time":"Step start time","Select_Book":"Select Book","Recipe_Image":"Recipe Image","Import_finished":"Import finished","View_Recipes":"View Recipes","Log_Cooking":"Log Cooking","New_Recipe":"New Recipe","Url_Import":"Url Import","Reset_Search":"Reset Search","Recently_Viewed":"Recently Viewed","Keywords":"Keywords","Books":"Books","Proteins":"Proteins","Fats":"Fats","Carbohydrates":"Carbohydrates","Calories":"Calories","Nutrition":"Nutrition","Date":"Date","Share":"Share","Export":"Export","Rating":"Rating","Close":"Close","Add":"Add","Ingredients":"Ingredients","min":"min","Servings":"Servings","Waiting":"Waiting","Preparation":"Preparation","External":"External","Edit":"Edit","Open":"Open","Save":"Save","Step":"Step","Search":"Search","Import":"Import","Print":"Print","or":"or","and":"and","Information":"Information"}')},fa7d:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"f",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"e",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"g",(function(){return d})),n.d(t,"d",(function(){return h}));n("99af");var r=n("59e4");function i(e,t,n){var r=Math.floor(e),i=1,o=r+1,a=1;if(e!==r)while(i<=t&&a<=t){var s=(r+o)/(i+a);if(e===s){i+a<=t?(i+=a,r+=o,a=t+1):i>a?a=t+1:i=t+1;break}et&&(i=a,r=o),!n)return[0,r,i];var c=Math.floor(r/i);return[c,r-c*i,i]}var o={methods:{makeToast:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return a(e,t,n)}}};function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=new r["a"];i.$bvToast.toast(t,{title:e,variant:n,toaster:"b-toaster-top-center",solid:!0})}var s={methods:{_:function(e){return c(e)}}};function c(e){return window.gettext(e)}var u={methods:{resolveDjangoUrl:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return d(e,t)}}};function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!==t?window.Urls[e](t):window.Urls[e]()}function p(e){return window.USER_PREF[e]}function h(e,t){if(p("use_fractions")){var n="",r=i(e*t,9,!0);return r[0]>0&&(n+=r[0]),r[1]>0&&(n+=" ".concat(r[1],"").concat(r[2],"")),n}return b(e*t)}function b(e){var t=p("user_fractions")?p("user_fractions"):2;return+(Math.round(e+"e+".concat(t))+"e-".concat(t))}},fc0d:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticClass:"dropdown"},[e._m(0),n("div",{staticClass:"dropdown-menu dropdown-menu-right",attrs:{"aria-labelledby":"dropdownMenuLink"}},[n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("edit_recipe",e.recipe.id)}},[n("i",{staticClass:"fas fa-pencil-alt fa-fw"}),e._v(" "+e._s(e.$t("Edit")))]),e.recipe.internal?e._e():n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("edit_convert_recipe",e.recipe.id)}},[n("i",{staticClass:"fas fa-exchange-alt fa-fw"}),e._v(" "+e._s(e.$t("convert_internal")))]),n("button",{staticClass:"dropdown-item",on:{click:function(t){return e.$bvModal.show("id_modal_add_book")}}},[n("i",{staticClass:"fas fa-bookmark fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Book"))+" ")]),e.recipe.internal?n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("view_shopping")+"?r=["+e.recipe.id+","+e.servings_value+"]",target:"_blank",rel:"noopener noreferrer"}},[n("i",{staticClass:"fas fa-shopping-cart fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Shopping"))+" ")]):e._e(),n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("new_meal_plan")+"?recipe="+e.recipe.id,target:"_blank",rel:"noopener noreferrer"}},[n("i",{staticClass:"fas fa-calendar fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Plan"))+" ")]),n("button",{staticClass:"dropdown-item",on:{click:function(t){return e.$bvModal.show("id_modal_cook_log")}}},[n("i",{staticClass:"fas fa-clipboard-list fa-fw"}),e._v(" "+e._s(e.$t("Log_Cooking"))+" ")]),n("button",{staticClass:"dropdown-item",attrs:{onclick:"window.print()"}},[n("i",{staticClass:"fas fa-print fa-fw"}),e._v(" "+e._s(e.$t("Print"))+" ")]),n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("view_export")+"?r="+e.recipe.id,target:"_blank",rel:"noopener noreferrer"}},[n("i",{staticClass:"fas fa-file-export fa-fw"}),e._v(" "+e._s(e.$t("Export")))]),e.recipe.internal?n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("new_share_link",e.recipe.id),target:"_blank",rel:"noopener noreferrer"}},[n("i",{staticClass:"fas fa-share-alt fa-fw"}),e._v(" "+e._s(e.$t("Share")))]):e._e()])]),n("cook-log",{attrs:{recipe:e.recipe}})],1)},i=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a",{staticClass:"btn shadow-none",attrs:{href:"#",role:"button",id:"dropdownMenuLink","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[n("i",{staticClass:"fas fa-ellipsis-v"})])}],o=(n("a9e3"),n("fa7d")),a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("b-modal",{staticClass:"modal",attrs:{id:"id_modal_cook_log",title:e.$t("Log_Recipe_Cooking"),"ok-title":e.$t("Save"),"cancel-title":e.$t("Close")},on:{ok:function(t){return e.logCook()}}},[n("p",[e._v(e._s(e.$t("all_fields_optional")))]),n("form",[n("label",{attrs:{for:"id_log_servings"}},[e._v(e._s(e.$t("Servings")))]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.logObject.servings,expression:"logObject.servings"}],staticClass:"form-control",attrs:{type:"number",id:"id_log_servings"},domProps:{value:e.logObject.servings},on:{input:function(t){t.target.composing||e.$set(e.logObject,"servings",t.target.value)}}}),n("label",{staticStyle:{"margin-top":"2vh"}},[e._v(e._s(e.$t("Rating"))+" - "),n("span",{attrs:{id:"id_rating_show"}},[e._v(e._s(e.logObject.rating)+"/5")])]),n("b-form-rating",{model:{value:e.logObject.rating,callback:function(t){e.$set(e.logObject,"rating",t)},expression:"logObject.rating"}}),n("label",{staticStyle:{"margin-top":"2vh"},attrs:{for:"id_date"}},[e._v(e._s(e.$t("Date")))]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.logObject.created_at,expression:"logObject.created_at"}],staticClass:"form-control",attrs:{type:"datetime-local",id:"id_date"},domProps:{value:e.logObject.created_at},on:{input:function(t){t.target.composing||e.$set(e.logObject,"created_at",t.target.value)}}})],1)])],1)},s=[],c=n("c1df"),u=n.n(c),d=n("a026"),p=n("5f5b"),h=n("7c15");d["default"].prototype.moment=u.a,d["default"].use(p["a"]);var b={name:"CookLog",props:{recipe:Object},data:function(){return{logObject:{recipe:this.recipe.id,servings:0,rating:0,created_at:u()().format("yyyy-MM-DDTHH:mm")}}},methods:{logCook:function(){Object(h["d"])(this.logObject)}}},f=b,l=n("2877"),j=Object(l["a"])(f,a,s,!1,null,null,null),O=j.exports,v={name:"RecipeContextMenu",mixins:[o["b"]],components:{CookLog:O},data:function(){return{servings_value:0}},props:{recipe:Object,servings:{type:Number,default:-1}},mounted:function(){this.servings_value=-1===this.servings?this.recipe.servings:this.servings}},g=v,y=Object(l["a"])(g,r,i,!1,null,null,null);t["a"]=y.exports}}); \ No newline at end of file diff --git a/cookbook/static/vue/js/recipe_view.js b/cookbook/static/vue/js/recipe_view.js index 5e8c9475..7c8d2419 100644 --- a/cookbook/static/vue/js/recipe_view.js +++ b/cookbook/static/vue/js/recipe_view.js @@ -1 +1 @@ -(function(e){function t(t){for(var n,s,o=t[0],c=t[1],l=t[2],p=0,f=[];p0?i("div",{staticClass:"col-md-6 order-md-1 col-sm-12 order-sm-2 col-12 order-2"},[i("div",{staticClass:"card border-primary"},[i("div",{staticClass:"card-body"},[i("div",{staticClass:"row"},[i("div",{staticClass:"col col-md-8"},[i("h4",{staticClass:"card-title"},[i("i",{staticClass:"fas fa-pepper-hot"}),e._v(" "+e._s(e.$t("Ingredients")))])])]),i("br"),i("div",{staticClass:"row"},[i("div",{staticClass:"col-md-12"},[i("table",{staticClass:"table table-sm"},[e._l(e.recipe.steps,(function(t){return[e._l(t.ingredients,(function(t){return[i("Ingredient",{key:t.id,attrs:{ingredient:t,ingredient_factor:e.ingredient_factor},on:{"checked-state-changed":e.updateIngredientCheckedState}})]}))]}))],2)])])])])]):e._e(),i("div",{staticClass:"col-12 order-1 col-sm-12 order-sm-1 col-md-6 order-md-2"},[i("div",{staticClass:"row"},[i("div",{staticClass:"col-12"},[null!==e.recipe.image?i("img",{staticClass:"img img-fluid rounded",staticStyle:{"max-height":"30vh"},attrs:{src:e.recipe.image,alt:e.$t("Recipe_Image")}}):e._e()])]),i("div",{staticClass:"row",staticStyle:{"margin-top":"2vh","margin-bottom":"2vh"}},[i("div",{staticClass:"col-12"},[i("Nutrition",{attrs:{recipe:e.recipe,ingredient_factor:e.ingredient_factor}})],1)])])]),e.recipe.internal?e._e():[e.recipe.file_path.includes(".pdf")?i("div",[i("PdfViewer",{attrs:{recipe:e.recipe}})],1):e._e(),e.recipe.file_path.includes(".png")||e.recipe.file_path.includes(".jpg")||e.recipe.file_path.includes(".jpeg")||e.recipe.file_path.includes(".gif")?i("div",[i("ImageViewer",{attrs:{recipe:e.recipe}})],1):e._e()],e._l(e.recipe.steps,(function(t,n){return i("div",{key:t.id,staticStyle:{"margin-top":"1vh"}},[i("Step",{attrs:{recipe:e.recipe,step:t,ingredient_factor:e.ingredient_factor,index:n,start_time:e.start_time},on:{"update-start-time":e.updateStartTime,"checked-state-changed":e.updateIngredientCheckedState}})],1)}))],2),i("add-recipe-to-book",{attrs:{recipe:e.recipe}})],2)},r=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"my-auto",staticStyle:{"padding-right":"4px"}},[i("i",{staticClass:"fas fa-user-clock fa-2x text-primary"})])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"my-auto",staticStyle:{"padding-right":"4px"}},[i("i",{staticClass:"far fa-clock fa-2x text-primary"})])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"my-auto",staticStyle:{"padding-right":"4px"}},[i("i",{staticClass:"fas fa-pizza-slice fa-2x text-primary"})])}],s=i("b85c"),o=i("5f5b"),c=(i("2dd8"),i("7c15")),l=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("hr"),"TEXT"===e.step.type?[e.recipe.steps.length>1?i("div",{staticClass:"row"},[i("div",{staticClass:"col col-md-8"},[i("h5",{staticClass:"text-primary"},[e.step.name?[e._v(e._s(e.step.name))]:[e._v(e._s(e.$t("Step"))+" "+e._s(e.index+1))],0!==e.step.time?i("small",{staticClass:"text-muted",staticStyle:{"margin-left":"4px"}},[i("i",{staticClass:"fas fa-user-clock"}),e._v(" "+e._s(e.step.time)+" "+e._s(e.$t("min"))+" ")]):e._e(),""!==e.start_time?i("small",{staticClass:"d-print-none"},[i("b-link",{attrs:{id:"id_reactive_popover_"+e.step.id,href:"#"},on:{click:e.openPopover}},[e._v(" "+e._s(e.moment(e.start_time).add(e.step.time_offset,"minutes").format("HH:mm"))+" ")])],1):e._e()],2)]),i("div",{staticClass:"col col-md-4",staticStyle:{"text-align":"right"}},[i("b-button",{staticClass:"shadow-none",class:{"text-primary":e.details_visible,"text-success":!e.details_visible},staticStyle:{border:"none",background:"none"},on:{click:function(t){e.details_visible=!e.details_visible}}},[i("i",{staticClass:"far fa-check-circle"})])],1)]):e._e(),i("b-collapse",{attrs:{id:"collapse-1"},model:{value:e.details_visible,callback:function(t){e.details_visible=t},expression:"details_visible"}},[i("div",{staticClass:"row"},[e.step.ingredients.length>0&&e.recipe.steps.length>1?i("div",{staticClass:"col col-md-4"},[i("table",{staticClass:"table table-sm"},[e._l(e.step.ingredients,(function(t){return[i("Ingredient",{key:t.id,attrs:{ingredient:t,ingredient_factor:e.ingredient_factor},on:{"checked-state-changed":function(i){return e.$emit("checked-state-changed",t)}}})]}))],2)]):e._e(),i("div",{staticClass:"col",class:{"col-md-8":e.recipe.steps.length>1,"col-md-12":e.recipe.steps.length<=1}},[i("compile-component",{attrs:{code:e.step.ingredients_markdown,ingredient_factor:e.ingredient_factor}})],1)])])]:e._e(),"TIME"===e.step.type?[i("div",{staticClass:"row"},[i("div",{staticClass:"col-md-8 offset-md-2",staticStyle:{"text-align":"center"}},[i("h4",{staticClass:"text-primary"},[e.step.name?[e._v(e._s(e.step.name))]:[e._v(e._s(e.$t("Step"))+" "+e._s(e.index+1))]],2),0!==e.step.time?i("span",{staticClass:"text-muted",staticStyle:{"margin-left":"4px"}},[i("i",{staticClass:"fa fa-stopwatch"}),e._v(" "+e._s(e.step.time)+" "+e._s(e.$t("min")))]):e._e(),""!==e.start_time?i("b-link",{staticClass:"d-print-none",attrs:{id:"id_reactive_popover_"+e.step.id,href:"#"},on:{click:e.openPopover}},[e._v(" "+e._s(e.moment(e.start_time).add(e.step.time_offset,"minutes").format("HH:mm"))+" ")]):e._e()],1),i("div",{staticClass:"col-md-2",staticStyle:{"text-align":"right"}},[i("b-button",{staticClass:"shadow-none",class:{"text-primary":e.details_visible,"text-success":!e.details_visible},staticStyle:{border:"none",background:"none"},on:{click:function(t){e.details_visible=!e.details_visible}}},[i("i",{staticClass:"far fa-check-circle"})])],1)]),i("b-collapse",{attrs:{id:"collapse-1"},model:{value:e.details_visible,callback:function(t){e.details_visible=t},expression:"details_visible"}},[""!==e.step.instruction?i("div",{staticClass:"row"},[i("div",{staticClass:"col col-md-12",staticStyle:{"text-align":"center"}},[i("compile-component",{attrs:{code:e.step.ingredients_markdown,ingredient_factor:e.ingredient_factor}})],1)]):e._e()])]:e._e(),""!==e.start_time?i("div",[i("b-popover",{ref:"id_reactive_popover_"+e.step.id,attrs:{target:"id_reactive_popover_"+e.step.id,triggers:"click",placement:"bottom",title:e.$t("Step start time")}},[i("div",[i("b-form-group",{staticClass:"mb-1",attrs:{label:"Time","label-for":"popover-input-1","label-cols":"3"}},[i("b-form-input",{attrs:{type:"datetime-local",id:"popover-input-1",size:"sm"},model:{value:e.set_time_input,callback:function(t){e.set_time_input=t},expression:"set_time_input"}})],1)],1),i("div",{staticClass:"row",staticStyle:{"margin-top":"1vh"}},[i("div",{staticClass:"col-12",staticStyle:{"text-align":"right"}},[i("b-button",{staticStyle:{"margin-right":"8px"},attrs:{size:"sm",variant:"secondary"},on:{click:e.closePopover}},[e._v("Cancel")]),i("b-button",{attrs:{size:"sm",variant:"primary"},on:{click:e.updateTime}},[e._v("Ok")])],1)])])],1):e._e()],2)},d=[],p=(i("a9e3"),i("fa7d")),f=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("tr",{on:{click:function(t){return e.$emit("checked-state-changed",e.ingredient)}}},[e.ingredient.is_header?[i("td",{attrs:{colspan:"5"}},[i("b",[e._v(e._s(e.ingredient.note))])])]:[i("td",[e.ingredient.checked?i("i",{staticClass:"far fa-check-circle text-success"}):e._e(),e.ingredient.checked?e._e():i("i",{staticClass:"far fa-check-circle text-primary"})]),i("td",[0!==e.ingredient.amount?i("span",{domProps:{innerHTML:e._s(e.calculateAmount(e.ingredient.amount))}}):e._e()]),i("td",[null===e.ingredient.unit||e.ingredient.no_amount?e._e():i("span",[e._v(e._s(e.ingredient.unit.name))])]),i("td",[null!==e.ingredient.food?[null!==e.ingredient.food.recipe?i("a",{attrs:{href:e.resolveDjangoUrl("view_recipe",e.ingredient.food.recipe),target:"_blank",rel:"noopener noreferrer"}},[e._v(e._s(e.ingredient.food.name))]):e._e(),null===e.ingredient.food.recipe?i("span",[e._v(e._s(e.ingredient.food.name))]):e._e()]:e._e()],2),i("td",[e.ingredient.note?i("div",[i("span",{directives:[{name:"b-popover",rawName:"v-b-popover.hover",value:e.ingredient.note,expression:"ingredient.note",modifiers:{hover:!0}}],staticClass:"d-print-none"},[i("i",{staticClass:"far fa-comment"})]),i("div",{staticClass:"d-none d-print-block"},[i("i",{staticClass:"far fa-comment-alt"}),e._v(" "+e._s(e.ingredient.note)+" ")])]):e._e()])]],2)},u=[],m={name:"Ingredient",props:{ingredient:Object,ingredient_factor:{type:Number,default:1}},mixins:[p["b"]],data:function(){return{checked:!1}},methods:{calculateAmount:function(e){return Object(p["d"])(e,this.ingredient_factor)}}},_=m,g=i("2877"),v=Object(g["a"])(_,f,u,!1,null,null,null),b=v.exports,h=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i(e.compiled,{tag:"component",attrs:{ingredient_factor:e.ingredient_factor,code:e.code}})],1)},j=[],k=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("span",{domProps:{innerHTML:e._s(e.calculateAmount(e.number))}})},C=[],y={name:"ScalableNumber",props:{number:Number,factor:{type:Number,default:4}},methods:{calculateAmount:function(e){return Object(p["d"])(e,this.factor)}}},w=y,x=Object(g["a"])(w,k,C,!1,null,null,null),S=x.exports,O={name:"CompileComponent",props:["code","ingredient_factor"],data:function(){return{compiled:null}},mounted:function(){this.compiled=n["default"].component("compiled-component",{props:["ingredient_factor","code"],components:{ScalableNumber:S},template:"
".concat(this.code,"
")})}},$=O,E=Object(g["a"])($,h,j,!1,null,null,null),I=E.exports,R=i("c1df"),P=i.n(R);n["default"].prototype.moment=P.a;var A={name:"Step",mixins:[p["a"]],components:{Ingredient:b,CompileComponent:I},props:{step:Object,ingredient_factor:Number,index:Number,recipe:Object,start_time:String},data:function(){return{details_visible:!0,set_time_input:""}},mounted:function(){this.set_time_input=P()(this.start_time).add(this.step.time_offset,"minutes").format("yyyy-MM-DDTHH:mm")},methods:{calculateAmount:function(e){return Object(p["d"])(e,this.ingredient_factor)},updateTime:function(){var e=P()(this.set_time_input).add(-1*this.step.time_offset,"minutes").format("yyyy-MM-DDTHH:mm");this.$emit("update-start-time",e),this.closePopover()},closePopover:function(){this.$refs["id_reactive_popover_".concat(this.step.id)].$emit("close")},openPopover:function(){this.$refs["id_reactive_popover_".concat(this.step.id)].$emit("open")}}},N=A,L=Object(g["a"])(N,l,d,!1,null,null,null),z=L.exports,B=i("fc0d"),T=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("iframe",{staticStyle:{border:"none"},attrs:{src:e.pdfUrl,width:"100%",height:"700px"}})])},D=[],M={name:"PdfViewer",mixins:[p["b"]],props:{recipe:Object},computed:{pdfUrl:function(){return"/static/pdfjs/viewer.html?file="+Object(p["g"])("api_get_recipe_file",this.recipe.id)}}},U=M,V=Object(g["a"])(U,T,D,!1,null,null,null),H=V.exports,F=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticStyle:{"text-align":"center"}},[i("b-img",{attrs:{src:e.pdfUrl,alt:e.$t("External_Recipe_Image")}})],1)},K=[],J={name:"ImageViewer",props:{recipe:Object},computed:{pdfUrl:function(){return Object(p["g"])("api_get_recipe_file",this.recipe.id)}}},W=J,Z=Object(g["a"])(W,F,K,!1,null,null,null),q=Z.exports,G=function(){var e=this,t=e.$createElement,i=e._self._c||t;return null!==e.recipe.nutrition?i("div",[i("div",{staticClass:"card border-success"},[i("div",{staticClass:"card-body"},[i("div",{staticClass:"row"},[i("div",{staticClass:"col-12"},[i("h4",{staticClass:"card-title"},[i("i",{staticClass:"fas fa-carrot"}),e._v(" "+e._s(e.$t("Nutrition")))])])]),i("div",{staticClass:"row"},[i("div",{staticClass:"col-6"},[i("i",{staticClass:"fas fa-fire fa-fw text-primary"}),e._v(" "+e._s(e.$t("Calories"))+" ")]),i("div",{staticClass:"col-6"},[i("span",{domProps:{innerHTML:e._s(e.calculateAmount(e.recipe.nutrition.calories))}}),e._v(" kcal ")])]),i("div",{staticClass:"row"},[i("div",{staticClass:"col-6"},[i("i",{staticClass:"fas fa-bread-slice fa-fw text-primary"}),e._v(" "+e._s(e.$t("Carbohydrates"))+" ")]),i("div",{staticClass:"col-6"},[i("span",{domProps:{innerHTML:e._s(e.calculateAmount(e.recipe.nutrition.carbohydrates))}}),e._v(" g ")])]),i("div",{staticClass:"row"},[i("div",{staticClass:"col-6"},[i("i",{staticClass:"fas fa-cheese fa-fw text-primary"}),e._v(" "+e._s(e.$t("Fats"))+" ")]),i("div",{staticClass:"col-6"},[i("span",{domProps:{innerHTML:e._s(e.calculateAmount(e.recipe.nutrition.fats))}}),e._v(" g ")])]),i("div",{staticClass:"row"},[i("div",{staticClass:"col-6"},[i("i",{staticClass:"fas fa-drumstick-bite fa-fw text-primary"}),e._v(" "+e._s(e.$t("Proteins"))+" ")]),i("div",{staticClass:"col-6"},[i("span",{domProps:{innerHTML:e._s(e.calculateAmount(e.recipe.nutrition.proteins))}}),e._v(" g ")])])])])]):e._e()},X=[],Q={name:"Nutrition",props:{recipe:Object,ingredient_factor:Number},methods:{calculateAmount:function(e){return Object(p["d"])(e,this.ingredient_factor)}}},Y=Q,ee=Object(g["a"])(Y,G,X,!1,null,null,null),te=ee.exports,ie=i("81d5"),ne=i("d76c"),ae=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("b-modal",{staticClass:"modal",attrs:{id:"id_modal_add_book",title:e.$t("Add_to_Book"),"ok-title":e.$t("Add"),"cancel-title":e.$t("Close")},on:{ok:function(t){return e.addToBook()}}},[i("multiselect",{attrs:{options:e.books,"preserve-search":!0,placeholder:e.$t("Select_Book"),label:"name","track-by":"id",id:"id_books",multiple:!1},on:{"search-change":e.loadBook},model:{value:e.selected_book,callback:function(t){e.selected_book=t},expression:"selected_book"}})],1)],1)},re=[],se=i("8e5f"),oe=i.n(se);n["default"].prototype.moment=P.a,n["default"].use(o["a"]);var ce={name:"AddRecipeToBook",components:{Multiselect:oe.a},props:{recipe:Object},data:function(){return{books:[],selected_book:null}},mounted:function(){this.loadBook("")},methods:{loadBook:function(e){var t=this;Object(c["b"])(e).then((function(e){t.books=e}))},addToBook:function(){Object(c["a"])({recipe:this.recipe.id,book:this.selected_book.id})}}},le=ce,de=(i("60bc"),Object(g["a"])(le,ae,re,!1,null,null,null)),pe=de.exports;n["default"].prototype.moment=P.a,n["default"].use(o["a"]);var fe={name:"RecipeView",mixins:[p["b"],p["c"]],components:{PdfViewer:H,ImageViewer:q,Ingredient:b,Step:z,RecipeContextMenu:B["a"],Nutrition:te,Keywords:ie["a"],LoadingSpinner:ne["a"],AddRecipeToBook:pe},computed:{ingredient_factor:function(){return this.servings/this.recipe.servings}},data:function(){return{loading:!0,recipe:void 0,ingredient_count:0,servings:1,start_time:""}},mounted:function(){this.loadRecipe(window.RECIPE_ID)},methods:{loadRecipe:function(e){var t=this;Object(c["c"])(e).then((function(e){0!==window.USER_SERVINGS&&(e.servings=window.USER_SERVINGS),t.servings=e.servings;var i,n=0,a=Object(s["a"])(e.steps);try{for(a.s();!(i=a.n()).done;){var r=i.value;t.ingredient_count+=r.ingredients.length;var o,c=Object(s["a"])(r.ingredients);try{for(c.s();!(o=c.n()).done;){var l=o.value;t.$set(l,"checked",!1)}}catch(d){c.e(d)}finally{c.f()}r.time_offset=n,n+=r.time}}catch(d){a.e(d)}finally{a.f()}n>0&&(t.start_time=P()().format("yyyy-MM-DDTHH:mm")),t.recipe=e,t.loading=!1}))},updateStartTime:function(e){this.start_time=e},updateIngredientCheckedState:function(e){var t,i=Object(s["a"])(this.recipe.steps);try{for(i.s();!(t=i.n()).done;){var n,a=t.value,r=Object(s["a"])(a.ingredients);try{for(r.s();!(n=r.n()).done;){var o=n.value;o.id===e.id&&this.$set(o,"checked",!o.checked)}}catch(c){r.e(c)}finally{r.f()}}}catch(c){i.e(c)}finally{i.f()}}}},ue=fe,me=Object(g["a"])(ue,a,r,!1,null,null,null),_e=me.exports,ge=i("9225");n["default"].config.productionTip=!1,new n["default"]({i18n:ge["a"],render:function(e){return e(_e)}}).$mount("#app")},1:function(e,t,i){e.exports=i("0671")},4678:function(e,t,i){var n={"./af":"2bfb","./af.js":"2bfb","./ar":"8e73","./ar-dz":"a356","./ar-dz.js":"a356","./ar-kw":"423e","./ar-kw.js":"423e","./ar-ly":"1cfd","./ar-ly.js":"1cfd","./ar-ma":"0a84","./ar-ma.js":"0a84","./ar-sa":"8230","./ar-sa.js":"8230","./ar-tn":"6d83","./ar-tn.js":"6d83","./ar.js":"8e73","./az":"485c","./az.js":"485c","./be":"1fc1","./be.js":"1fc1","./bg":"84aa","./bg.js":"84aa","./bm":"a7fa","./bm.js":"a7fa","./bn":"9043","./bn-bd":"9686","./bn-bd.js":"9686","./bn.js":"9043","./bo":"d26a","./bo.js":"d26a","./br":"6887","./br.js":"6887","./bs":"2554","./bs.js":"2554","./ca":"d716","./ca.js":"d716","./cs":"3c0d","./cs.js":"3c0d","./cv":"03ec","./cv.js":"03ec","./cy":"9797","./cy.js":"9797","./da":"0f14","./da.js":"0f14","./de":"b469","./de-at":"b3eb","./de-at.js":"b3eb","./de-ch":"bb71","./de-ch.js":"bb71","./de.js":"b469","./dv":"598a","./dv.js":"598a","./el":"8d47","./el.js":"8d47","./en-au":"0e6b","./en-au.js":"0e6b","./en-ca":"3886","./en-ca.js":"3886","./en-gb":"39a6","./en-gb.js":"39a6","./en-ie":"e1d3","./en-ie.js":"e1d3","./en-il":"7333","./en-il.js":"7333","./en-in":"ec2e","./en-in.js":"ec2e","./en-nz":"6f50","./en-nz.js":"6f50","./en-sg":"b7e9","./en-sg.js":"b7e9","./eo":"65db","./eo.js":"65db","./es":"898b","./es-do":"0a3c","./es-do.js":"0a3c","./es-mx":"b5b7","./es-mx.js":"b5b7","./es-us":"55c9","./es-us.js":"55c9","./es.js":"898b","./et":"ec18","./et.js":"ec18","./eu":"0ff2","./eu.js":"0ff2","./fa":"8df4","./fa.js":"8df4","./fi":"81e9","./fi.js":"81e9","./fil":"d69a","./fil.js":"d69a","./fo":"0721","./fo.js":"0721","./fr":"9f26","./fr-ca":"d9f8","./fr-ca.js":"d9f8","./fr-ch":"0e49","./fr-ch.js":"0e49","./fr.js":"9f26","./fy":"7118","./fy.js":"7118","./ga":"5120","./ga.js":"5120","./gd":"f6b4","./gd.js":"f6b4","./gl":"8840","./gl.js":"8840","./gom-deva":"aaf2","./gom-deva.js":"aaf2","./gom-latn":"0caa","./gom-latn.js":"0caa","./gu":"e0c5","./gu.js":"e0c5","./he":"c7aa","./he.js":"c7aa","./hi":"dc4d","./hi.js":"dc4d","./hr":"4ba9","./hr.js":"4ba9","./hu":"5b14","./hu.js":"5b14","./hy-am":"d6b6","./hy-am.js":"d6b6","./id":"5038","./id.js":"5038","./is":"0558","./is.js":"0558","./it":"6e98","./it-ch":"6f12","./it-ch.js":"6f12","./it.js":"6e98","./ja":"079e","./ja.js":"079e","./jv":"b540","./jv.js":"b540","./ka":"201b","./ka.js":"201b","./kk":"6d79","./kk.js":"6d79","./km":"e81d","./km.js":"e81d","./kn":"3e92","./kn.js":"3e92","./ko":"22f8","./ko.js":"22f8","./ku":"2421","./ku.js":"2421","./ky":"9609","./ky.js":"9609","./lb":"440c","./lb.js":"440c","./lo":"b29d","./lo.js":"b29d","./lt":"26f9","./lt.js":"26f9","./lv":"b97c","./lv.js":"b97c","./me":"293c","./me.js":"293c","./mi":"688b","./mi.js":"688b","./mk":"6909","./mk.js":"6909","./ml":"02fb","./ml.js":"02fb","./mn":"958b","./mn.js":"958b","./mr":"39bd","./mr.js":"39bd","./ms":"ebe4","./ms-my":"6403","./ms-my.js":"6403","./ms.js":"ebe4","./mt":"1b45","./mt.js":"1b45","./my":"8689","./my.js":"8689","./nb":"6ce3","./nb.js":"6ce3","./ne":"3a39","./ne.js":"3a39","./nl":"facd","./nl-be":"db29","./nl-be.js":"db29","./nl.js":"facd","./nn":"b84c","./nn.js":"b84c","./oc-lnc":"167b","./oc-lnc.js":"167b","./pa-in":"f3ff","./pa-in.js":"f3ff","./pl":"8d57","./pl.js":"8d57","./pt":"f260","./pt-br":"d2d4","./pt-br.js":"d2d4","./pt.js":"f260","./ro":"972c","./ro.js":"972c","./ru":"957c","./ru.js":"957c","./sd":"6784","./sd.js":"6784","./se":"ffff","./se.js":"ffff","./si":"eda5","./si.js":"eda5","./sk":"7be6","./sk.js":"7be6","./sl":"8155","./sl.js":"8155","./sq":"c8f3","./sq.js":"c8f3","./sr":"cf1e","./sr-cyrl":"13e9","./sr-cyrl.js":"13e9","./sr.js":"cf1e","./ss":"52bd","./ss.js":"52bd","./sv":"5fbd","./sv.js":"5fbd","./sw":"74dc","./sw.js":"74dc","./ta":"3de5","./ta.js":"3de5","./te":"5cbb","./te.js":"5cbb","./tet":"576c","./tet.js":"576c","./tg":"3b1b","./tg.js":"3b1b","./th":"10e8","./th.js":"10e8","./tk":"5aff","./tk.js":"5aff","./tl-ph":"0f38","./tl-ph.js":"0f38","./tlh":"cf755","./tlh.js":"cf755","./tr":"0e81","./tr.js":"0e81","./tzl":"cf51","./tzl.js":"cf51","./tzm":"c109","./tzm-latn":"b53d","./tzm-latn.js":"b53d","./tzm.js":"c109","./ug-cn":"6117","./ug-cn.js":"6117","./uk":"ada2","./uk.js":"ada2","./ur":"5294","./ur.js":"5294","./uz":"2e8c","./uz-latn":"010e","./uz-latn.js":"010e","./uz.js":"2e8c","./vi":"2921","./vi.js":"2921","./x-pseudo":"fd7e","./x-pseudo.js":"fd7e","./yo":"7f33","./yo.js":"7f33","./zh-cn":"5c3a","./zh-cn.js":"5c3a","./zh-hk":"49ab","./zh-hk.js":"49ab","./zh-mo":"3a6c","./zh-mo.js":"3a6c","./zh-tw":"90ea","./zh-tw.js":"90ea"};function a(e){var t=r(e);return i(t)}function r(e){if(!i.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}a.keys=function(){return Object.keys(n)},a.resolve=r,e.exports=a,a.id="4678"},"49f8":function(e,t,i){var n={"./de.json":"6ce2","./en.json":"edd4","./nl.json":"a625","./sv.json":"4c5b"};function a(e){var t=r(e);return i(t)}function r(e){if(!i.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}a.keys=function(){return Object.keys(n)},a.resolve=r,e.exports=a,a.id="49f8"},"4c5b":function(e){e.exports=JSON.parse('{"import_running":"Import pågår, var god vänta!","all_fields_optional":"Alla rutor är valfria och kan lämnas tomma.","convert_internal":"Konvertera till internt recept","Log_Recipe_Cooking":"Logga tillagningen av receptet","External_Recipe_Image":"Externt receptbild","Add_to_Book":"Lägg till i kokbok","Add_to_Shopping":"Lägg till i handelslista","Add_to_Plan":"Lägg till i matsedel","Step_start_time":"Steg starttid","Select_Book":"Välj kokbok","Recipe_Image":"Receptbild","Import_finished":"Importering klar","View_Recipes":"Visa recept","Log_Cooking":"Logga tillagning","Proteins":"Protein","Fats":"Fett","Carbohydrates":"Kolhydrater","Calories":"Kalorier","Nutrition":"Näringsinnehåll","Date":"Datum","Share":"Dela","Export":"Exportera","Rating":"Betyg","Close":"Stäng","Add":"Lägg till","Ingredients":"Ingredienser","min":"min","Servings":"Portioner","Waiting":"Väntan","Preparation":"Förberedelse","Edit":"Redigera","Open":"Öppna","Save":"Spara","Step":"Steg","Search":"Sök","Import":"Importera","Print":"Skriv ut","Information":"Information"}')},"6ce2":function(e){e.exports=JSON.parse('{"Import":"Import","import_running":"Import läuft, bitte warten!","Import_finished":"Import fertig","View_Recipes":"Rezepte Ansehen","Information":"Information","all_fields_optional":"Alle Felder sind optional und können leer gelassen werden.","convert_internal":"Zu internem Rezept wandeln","Log_Recipe_Cooking":"Kochen protokollieren","External_Recipe_Image":"Externes Rezept Bild","Add_to_Book":"Zu Buch hinzufügen","Add_to_Shopping":"Zu Einkaufsliste hinzufügen","Add_to_Plan":"Zu Plan hinzufügen","Step_start_time":"Schritt Startzeit","Select_Book":"Buch wählen","Recipe_Image":"Rezept Bild","Log_Cooking":"Kochen protokollieren","Proteins":"Proteine","Fats":"Fette","Carbohydrates":"Kohlenhydrate","Calories":"Kalorien","Nutrition":"Nährwerte"}')},"7c15":function(e,t,i){"use strict";i.d(t,"c",(function(){return s})),i.d(t,"d",(function(){return o})),i.d(t,"b",(function(){return c})),i.d(t,"a",(function(){return l}));var n=i("bc3a"),a=i.n(n),r=i("fa7d");function s(e){var t=Object(r["g"])("api:recipe-detail",e);return void 0!==window.SHARE_UID&&(t+="?share="+window.SHARE_UID),a.a.get(t).then((function(e){return e.data})).catch((function(e){d(e,"There was an error loading a resource!","danger")}))}function o(e){return a.a.post(Object(r["g"])("api:cooklog-list"),e).then((function(e){Object(r["f"])("Saved","Cook Log entry saved!","success")})).catch((function(e){d(e,"There was an error creating a resource!","danger")}))}function c(e){return a.a.get(Object(r["g"])("api:recipebook-list")+"?query="+e).then((function(e){return e.data})).catch((function(e){}))}function l(e){return a.a.post(Object(r["g"])("api:recipebookentry-list"),e).then((function(e){Object(r["f"])("Saved","Recipe Book entry saved!","success")})).catch((function(e){d(e,"There was an error creating a resource!","danger")}))}function d(e,t){if("response"in e){console.log(e.response);var i="statusText"in e.response?e.response.statusText:Object(r["e"])("Error");t+="\n\n"+JSON.stringify(e.response.data),Object(r["f"])(i,t,"danger")}else Object(r["f"])("Error",t,"danger"),console.log(e)}a.a.defaults.xsrfCookieName="csrftoken",a.a.defaults.xsrfHeaderName="X-CSRFTOKEN"},"81d5":function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.recipe.keywords.length>0?i("div",e._l(e.recipe.keywords,(function(t){return i("small",{key:t.id,staticStyle:{padding:"2px"}},[i("b-badge",{attrs:{pill:"",variant:"light"}},[e._v(e._s(t.label))])],1)})),0):e._e()},a=[],r={name:"Keywords",props:{recipe:Object}},s=r,o=i("2877"),c=Object(o["a"])(s,n,a,!1,null,null,null);t["a"]=c.exports},9225:function(e,t,i){"use strict";i("159b"),i("d3b7"),i("ddb0"),i("466d"),i("ac1f");var n=i("a026"),a=i("a925");function r(){var e=i("49f8"),t={};return e.keys().forEach((function(i){var n=i.match(/([A-Za-z0-9-_]+)\./i);if(n&&n.length>1){var a=n[1];t[a]=e(i)}})),t}n["default"].use(a["a"]),t["a"]=new a["a"]({locale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_LOCALE||"en",fallbackLocale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_FALLBACK_LOCALE||"en",messages:r()})},a625:function(e){e.exports=JSON.parse('{"import_running":"Er wordt geïmporteerd, even geduld!","all_fields_optional":"Alle velden zijn optioneel en kunnen leeg gelaten worden.","convert_internal":"Zet om naar intern recept","Log_Recipe_Cooking":"Log Bereiding","External_Recipe_Image":"Externe Afbeelding Recept","Add_to_Book":"Voeg toe aan Boek","Add_to_Shopping":"Voeg toe aan Boodschappenlijst","Add_to_Plan":"Voeg toe aan Plan","Step_start_time":"Starttijd stap","Select_Book":"Selecteer Boek","Recipe_Image":"Afbeelding Recept","Import_finished":"Importeren gereed","View_Recipes":"Bekijk Recepten","Log_Cooking":"Log Bereiding","Proteins":"Proteïnes","Fats":"Vetten","Carbohydrates":"Koolhydraten","Calories":"Calorieën","Nutrition":"Voedingswaarde","Date":"Datum","Share":"Deel","Export":"Exporteer","Rating":"Waardering","Close":"Sluit","Add":"Voeg toe","Ingredients":"Ingrediënten","min":"min","Servings":"Porties","Waiting":"Wachten","Preparation":"Bereiding","Edit":"Bewerk","Open":"Open","Save":"Sla op","Step":"Stap","Search":"Zoeken","Import":"Importeer","Print":"Afdrukken","Information":"Informatie"}')},d76c:function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},a=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"row"},[i("div",{staticClass:"col",staticStyle:{"text-align":"center"}},[i("i",{staticClass:"fas fa-spinner fa-spin fa-10x"})])])}],r={name:"LoadingSpinner",props:{recipe:Object}},s=r,o=i("2877"),c=Object(o["a"])(s,n,a,!1,null,null,null);t["a"]=c.exports},edd4:function(e){e.exports=JSON.parse('{"import_running":"Import running, please wait!","all_fields_optional":"All fields are optional and can be left empty.","convert_internal":"Convert to internal recipe","show_only_internal":"Show only internal recipes","Log_Recipe_Cooking":"Log Recipe Cooking","External_Recipe_Image":"External Recipe Image","Add_to_Book":"Add to Book","Add_to_Shopping":"Add to Shopping","Add_to_Plan":"Add to Plan","Step_start_time":"Step start time","Select_Book":"Select Book","Recipe_Image":"Recipe Image","Import_finished":"Import finished","View_Recipes":"View Recipes","Log_Cooking":"Log Cooking","New_Recipe":"New Recipe","Url_Import":"Url Import","Reset_Search":"Reset Search","Keywords":"Keywords","Books":"Books","Proteins":"Proteins","Fats":"Fats","Carbohydrates":"Carbohydrates","Calories":"Calories","Nutrition":"Nutrition","Date":"Date","Share":"Share","Export":"Export","Rating":"Rating","Close":"Close","Add":"Add","Ingredients":"Ingredients","min":"min","Servings":"Servings","Waiting":"Waiting","Preparation":"Preparation","Edit":"Edit","Open":"Open","Save":"Save","Step":"Step","Search":"Search","Import":"Import","Print":"Print","or":"or","and":"and","Information":"Information"}')},fa7d:function(e,t,i){"use strict";i.d(t,"c",(function(){return r})),i.d(t,"f",(function(){return s})),i.d(t,"a",(function(){return o})),i.d(t,"e",(function(){return c})),i.d(t,"b",(function(){return l})),i.d(t,"g",(function(){return d})),i.d(t,"d",(function(){return f}));i("99af");var n=i("59e4");function a(e,t,i){var n=Math.floor(e),a=1,r=n+1,s=1;if(e!==n)while(a<=t&&s<=t){var o=(n+r)/(a+s);if(e===o){a+s<=t?(a+=s,n+=r,s=t+1):a>s?s=t+1:a=t+1;break}et&&(a=s,n=r),!i)return[0,n,a];var c=Math.floor(n/a);return[c,n-c*a,a]}var r={methods:{makeToast:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return s(e,t,i)}}};function s(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=new n["a"];a.$bvToast.toast(t,{title:e,variant:i,toaster:"b-toaster-top-center",solid:!0})}var o={methods:{_:function(e){return c(e)}}};function c(e){return window.gettext(e)}var l={methods:{resolveDjangoUrl:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return d(e,t)}}};function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!==t?window.Urls[e](t):window.Urls[e]()}function p(e){return window.USER_PREF[e]}function f(e,t){if(p("use_fractions")){var i="",n=a(e*t,9,!0);return n[0]>0&&(i+=n[0]),n[1]>0&&(i+=" ".concat(n[1],"").concat(n[2],"")),i}return u(e*t)}function u(e){var t=p("user_fractions")?p("user_fractions"):2;return+(Math.round(e+"e+".concat(t))+"e-".concat(t))}},fc0d:function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("div",{staticClass:"dropdown"},[e._m(0),i("div",{staticClass:"dropdown-menu dropdown-menu-right",attrs:{"aria-labelledby":"dropdownMenuLink"}},[i("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("edit_recipe",e.recipe.id)}},[i("i",{staticClass:"fas fa-pencil-alt fa-fw"}),e._v(" "+e._s(e.$t("Edit")))]),e.recipe.internal?e._e():i("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("edit_convert_recipe",e.recipe.id)}},[i("i",{staticClass:"fas fa-exchange-alt fa-fw"}),e._v(" "+e._s(e.$t("convert_internal")))]),i("button",{staticClass:"dropdown-item",on:{click:function(t){return e.$bvModal.show("id_modal_add_book")}}},[i("i",{staticClass:"fas fa-bookmark fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Book"))+" ")]),e.recipe.internal?i("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("view_shopping")+"?r=["+e.recipe.id+","+e.servings_value+"]",target:"_blank",rel:"noopener noreferrer"}},[i("i",{staticClass:"fas fa-shopping-cart fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Shopping"))+" ")]):e._e(),i("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("new_meal_plan")+"?recipe="+e.recipe.id,target:"_blank",rel:"noopener noreferrer"}},[i("i",{staticClass:"fas fa-calendar fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Plan"))+" ")]),i("button",{staticClass:"dropdown-item",on:{click:function(t){return e.$bvModal.show("id_modal_cook_log")}}},[i("i",{staticClass:"fas fa-clipboard-list fa-fw"}),e._v(" "+e._s(e.$t("Log_Cooking"))+" ")]),i("button",{staticClass:"dropdown-item",attrs:{onclick:"window.print()"}},[i("i",{staticClass:"fas fa-print fa-fw"}),e._v(" "+e._s(e.$t("Print"))+" ")]),i("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("view_export")+"?r="+e.recipe.id,target:"_blank",rel:"noopener noreferrer"}},[i("i",{staticClass:"fas fa-file-export fa-fw"}),e._v(" "+e._s(e.$t("Export")))]),e.recipe.internal?i("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("new_share_link",e.recipe.id),target:"_blank",rel:"noopener noreferrer"}},[i("i",{staticClass:"fas fa-share-alt fa-fw"}),e._v(" "+e._s(e.$t("Share")))]):e._e()])]),i("cook-log",{attrs:{recipe:e.recipe}})],1)},a=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("a",{staticClass:"btn shadow-none",attrs:{href:"#",role:"button",id:"dropdownMenuLink","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[i("i",{staticClass:"fas fa-ellipsis-v"})])}],r=(i("a9e3"),i("fa7d")),s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("b-modal",{staticClass:"modal",attrs:{id:"id_modal_cook_log",title:e.$t("Log_Recipe_Cooking"),"ok-title":e.$t("Save"),"cancel-title":e.$t("Close")},on:{ok:function(t){return e.logCook()}}},[i("p",[e._v(e._s(e.$t("all_fields_optional")))]),i("form",[i("label",{attrs:{for:"id_log_servings"}},[e._v(e._s(e.$t("Servings")))]),i("input",{directives:[{name:"model",rawName:"v-model",value:e.logObject.servings,expression:"logObject.servings"}],staticClass:"form-control",attrs:{type:"number",id:"id_log_servings"},domProps:{value:e.logObject.servings},on:{input:function(t){t.target.composing||e.$set(e.logObject,"servings",t.target.value)}}}),i("label",{staticStyle:{"margin-top":"2vh"}},[e._v(e._s(e.$t("Rating"))+" - "),i("span",{attrs:{id:"id_rating_show"}},[e._v(e._s(e.logObject.rating)+"/5")])]),i("b-form-rating",{model:{value:e.logObject.rating,callback:function(t){e.$set(e.logObject,"rating",t)},expression:"logObject.rating"}}),i("label",{staticStyle:{"margin-top":"2vh"},attrs:{for:"id_date"}},[e._v(e._s(e.$t("Date")))]),i("input",{directives:[{name:"model",rawName:"v-model",value:e.logObject.created_at,expression:"logObject.created_at"}],staticClass:"form-control",attrs:{type:"datetime-local",id:"id_date"},domProps:{value:e.logObject.created_at},on:{input:function(t){t.target.composing||e.$set(e.logObject,"created_at",t.target.value)}}})],1)])],1)},o=[],c=i("c1df"),l=i.n(c),d=i("a026"),p=i("5f5b"),f=i("7c15");d["default"].prototype.moment=l.a,d["default"].use(p["a"]);var u={name:"CookLog",props:{recipe:Object},data:function(){return{logObject:{recipe:this.recipe.id,servings:0,rating:0,created_at:l()().format("yyyy-MM-DDTHH:mm")}}},methods:{logCook:function(){Object(f["d"])(this.logObject)}}},m=u,_=i("2877"),g=Object(_["a"])(m,s,o,!1,null,null,null),v=g.exports,b={name:"RecipeContextMenu",mixins:[r["b"]],components:{CookLog:v},data:function(){return{servings_value:0}},props:{recipe:Object,servings:{type:Number,default:-1}},mounted:function(){this.servings_value=-1===this.servings?this.recipe.servings:this.servings}},h=b,j=Object(_["a"])(h,n,a,!1,null,null,null);t["a"]=j.exports}}); \ No newline at end of file +(function(e){function t(t){for(var n,s,o=t[0],c=t[1],l=t[2],p=0,f=[];p0?i("div",{staticClass:"col-md-6 order-md-1 col-sm-12 order-sm-2 col-12 order-2"},[i("div",{staticClass:"card border-primary"},[i("div",{staticClass:"card-body"},[i("div",{staticClass:"row"},[i("div",{staticClass:"col col-md-8"},[i("h4",{staticClass:"card-title"},[i("i",{staticClass:"fas fa-pepper-hot"}),e._v(" "+e._s(e.$t("Ingredients")))])])]),i("br"),i("div",{staticClass:"row"},[i("div",{staticClass:"col-md-12"},[i("table",{staticClass:"table table-sm"},[e._l(e.recipe.steps,(function(t){return[e._l(t.ingredients,(function(t){return[i("Ingredient",{key:t.id,attrs:{ingredient:t,ingredient_factor:e.ingredient_factor},on:{"checked-state-changed":e.updateIngredientCheckedState}})]}))]}))],2)])])])])]):e._e(),i("div",{staticClass:"col-12 order-1 col-sm-12 order-sm-1 col-md-6 order-md-2"},[i("div",{staticClass:"row"},[i("div",{staticClass:"col-12"},[null!==e.recipe.image?i("img",{staticClass:"img img-fluid rounded",staticStyle:{"max-height":"30vh"},attrs:{src:e.recipe.image,alt:e.$t("Recipe_Image")}}):e._e()])]),i("div",{staticClass:"row",staticStyle:{"margin-top":"2vh","margin-bottom":"2vh"}},[i("div",{staticClass:"col-12"},[i("Nutrition",{attrs:{recipe:e.recipe,ingredient_factor:e.ingredient_factor}})],1)])])]),e.recipe.internal?e._e():[e.recipe.file_path.includes(".pdf")?i("div",[i("PdfViewer",{attrs:{recipe:e.recipe}})],1):e._e(),e.recipe.file_path.includes(".png")||e.recipe.file_path.includes(".jpg")||e.recipe.file_path.includes(".jpeg")||e.recipe.file_path.includes(".gif")?i("div",[i("ImageViewer",{attrs:{recipe:e.recipe}})],1):e._e()],e._l(e.recipe.steps,(function(t,n){return i("div",{key:t.id,staticStyle:{"margin-top":"1vh"}},[i("Step",{attrs:{recipe:e.recipe,step:t,ingredient_factor:e.ingredient_factor,index:n,start_time:e.start_time},on:{"update-start-time":e.updateStartTime,"checked-state-changed":e.updateIngredientCheckedState}})],1)}))],2),i("add-recipe-to-book",{attrs:{recipe:e.recipe}})],2)},r=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"my-auto",staticStyle:{"padding-right":"4px"}},[i("i",{staticClass:"fas fa-user-clock fa-2x text-primary"})])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"my-auto",staticStyle:{"padding-right":"4px"}},[i("i",{staticClass:"far fa-clock fa-2x text-primary"})])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"my-auto",staticStyle:{"padding-right":"4px"}},[i("i",{staticClass:"fas fa-pizza-slice fa-2x text-primary"})])}],s=i("b85c"),o=i("5f5b"),c=(i("2dd8"),i("7c15")),l=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("hr"),"TEXT"===e.step.type?[e.recipe.steps.length>1?i("div",{staticClass:"row"},[i("div",{staticClass:"col col-md-8"},[i("h5",{staticClass:"text-primary"},[e.step.name?[e._v(e._s(e.step.name))]:[e._v(e._s(e.$t("Step"))+" "+e._s(e.index+1))],0!==e.step.time?i("small",{staticClass:"text-muted",staticStyle:{"margin-left":"4px"}},[i("i",{staticClass:"fas fa-user-clock"}),e._v(" "+e._s(e.step.time)+" "+e._s(e.$t("min"))+" ")]):e._e(),""!==e.start_time?i("small",{staticClass:"d-print-none"},[i("b-link",{attrs:{id:"id_reactive_popover_"+e.step.id,href:"#"},on:{click:e.openPopover}},[e._v(" "+e._s(e.moment(e.start_time).add(e.step.time_offset,"minutes").format("HH:mm"))+" ")])],1):e._e()],2)]),i("div",{staticClass:"col col-md-4",staticStyle:{"text-align":"right"}},[i("b-button",{staticClass:"shadow-none",class:{"text-primary":e.details_visible,"text-success":!e.details_visible},staticStyle:{border:"none",background:"none"},on:{click:function(t){e.details_visible=!e.details_visible}}},[i("i",{staticClass:"far fa-check-circle"})])],1)]):e._e(),i("b-collapse",{attrs:{id:"collapse-1"},model:{value:e.details_visible,callback:function(t){e.details_visible=t},expression:"details_visible"}},[i("div",{staticClass:"row"},[e.step.ingredients.length>0&&e.recipe.steps.length>1?i("div",{staticClass:"col col-md-4"},[i("table",{staticClass:"table table-sm"},[e._l(e.step.ingredients,(function(t){return[i("Ingredient",{key:t.id,attrs:{ingredient:t,ingredient_factor:e.ingredient_factor},on:{"checked-state-changed":function(i){return e.$emit("checked-state-changed",t)}}})]}))],2)]):e._e(),i("div",{staticClass:"col",class:{"col-md-8":e.recipe.steps.length>1,"col-md-12":e.recipe.steps.length<=1}},[i("compile-component",{attrs:{code:e.step.ingredients_markdown,ingredient_factor:e.ingredient_factor}})],1)])])]:e._e(),"TIME"===e.step.type?[i("div",{staticClass:"row"},[i("div",{staticClass:"col-md-8 offset-md-2",staticStyle:{"text-align":"center"}},[i("h4",{staticClass:"text-primary"},[e.step.name?[e._v(e._s(e.step.name))]:[e._v(e._s(e.$t("Step"))+" "+e._s(e.index+1))]],2),0!==e.step.time?i("span",{staticClass:"text-muted",staticStyle:{"margin-left":"4px"}},[i("i",{staticClass:"fa fa-stopwatch"}),e._v(" "+e._s(e.step.time)+" "+e._s(e.$t("min")))]):e._e(),""!==e.start_time?i("b-link",{staticClass:"d-print-none",attrs:{id:"id_reactive_popover_"+e.step.id,href:"#"},on:{click:e.openPopover}},[e._v(" "+e._s(e.moment(e.start_time).add(e.step.time_offset,"minutes").format("HH:mm"))+" ")]):e._e()],1),i("div",{staticClass:"col-md-2",staticStyle:{"text-align":"right"}},[i("b-button",{staticClass:"shadow-none",class:{"text-primary":e.details_visible,"text-success":!e.details_visible},staticStyle:{border:"none",background:"none"},on:{click:function(t){e.details_visible=!e.details_visible}}},[i("i",{staticClass:"far fa-check-circle"})])],1)]),i("b-collapse",{attrs:{id:"collapse-1"},model:{value:e.details_visible,callback:function(t){e.details_visible=t},expression:"details_visible"}},[""!==e.step.instruction?i("div",{staticClass:"row"},[i("div",{staticClass:"col col-md-12",staticStyle:{"text-align":"center"}},[i("compile-component",{attrs:{code:e.step.ingredients_markdown,ingredient_factor:e.ingredient_factor}})],1)]):e._e()])]:e._e(),""!==e.start_time?i("div",[i("b-popover",{ref:"id_reactive_popover_"+e.step.id,attrs:{target:"id_reactive_popover_"+e.step.id,triggers:"click",placement:"bottom",title:e.$t("Step start time")}},[i("div",[i("b-form-group",{staticClass:"mb-1",attrs:{label:"Time","label-for":"popover-input-1","label-cols":"3"}},[i("b-form-input",{attrs:{type:"datetime-local",id:"popover-input-1",size:"sm"},model:{value:e.set_time_input,callback:function(t){e.set_time_input=t},expression:"set_time_input"}})],1)],1),i("div",{staticClass:"row",staticStyle:{"margin-top":"1vh"}},[i("div",{staticClass:"col-12",staticStyle:{"text-align":"right"}},[i("b-button",{staticStyle:{"margin-right":"8px"},attrs:{size:"sm",variant:"secondary"},on:{click:e.closePopover}},[e._v("Cancel")]),i("b-button",{attrs:{size:"sm",variant:"primary"},on:{click:e.updateTime}},[e._v("Ok")])],1)])])],1):e._e()],2)},d=[],p=(i("a9e3"),i("fa7d")),f=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("tr",{on:{click:function(t){return e.$emit("checked-state-changed",e.ingredient)}}},[e.ingredient.is_header?[i("td",{attrs:{colspan:"5"}},[i("b",[e._v(e._s(e.ingredient.note))])])]:[i("td",[e.ingredient.checked?i("i",{staticClass:"far fa-check-circle text-success"}):e._e(),e.ingredient.checked?e._e():i("i",{staticClass:"far fa-check-circle text-primary"})]),i("td",[0!==e.ingredient.amount?i("span",{domProps:{innerHTML:e._s(e.calculateAmount(e.ingredient.amount))}}):e._e()]),i("td",[null===e.ingredient.unit||e.ingredient.no_amount?e._e():i("span",[e._v(e._s(e.ingredient.unit.name))])]),i("td",[null!==e.ingredient.food?[null!==e.ingredient.food.recipe?i("a",{attrs:{href:e.resolveDjangoUrl("view_recipe",e.ingredient.food.recipe),target:"_blank",rel:"noopener noreferrer"}},[e._v(e._s(e.ingredient.food.name))]):e._e(),null===e.ingredient.food.recipe?i("span",[e._v(e._s(e.ingredient.food.name))]):e._e()]:e._e()],2),i("td",[e.ingredient.note?i("div",[i("span",{directives:[{name:"b-popover",rawName:"v-b-popover.hover",value:e.ingredient.note,expression:"ingredient.note",modifiers:{hover:!0}}],staticClass:"d-print-none"},[i("i",{staticClass:"far fa-comment"})]),i("div",{staticClass:"d-none d-print-block"},[i("i",{staticClass:"far fa-comment-alt"}),e._v(" "+e._s(e.ingredient.note)+" ")])]):e._e()])]],2)},u=[],m={name:"Ingredient",props:{ingredient:Object,ingredient_factor:{type:Number,default:1}},mixins:[p["b"]],data:function(){return{checked:!1}},methods:{calculateAmount:function(e){return Object(p["d"])(e,this.ingredient_factor)}}},_=m,g=i("2877"),v=Object(g["a"])(_,f,u,!1,null,null,null),b=v.exports,h=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i(e.compiled,{tag:"component",attrs:{ingredient_factor:e.ingredient_factor,code:e.code}})],1)},j=[],k=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("span",{domProps:{innerHTML:e._s(e.calculateAmount(e.number))}})},C=[],y={name:"ScalableNumber",props:{number:Number,factor:{type:Number,default:4}},methods:{calculateAmount:function(e){return Object(p["d"])(e,this.factor)}}},w=y,x=Object(g["a"])(w,k,C,!1,null,null,null),S=x.exports,O={name:"CompileComponent",props:["code","ingredient_factor"],data:function(){return{compiled:null}},mounted:function(){this.compiled=n["default"].component("compiled-component",{props:["ingredient_factor","code"],components:{ScalableNumber:S},template:"
".concat(this.code,"
")})}},E=O,$=Object(g["a"])(E,h,j,!1,null,null,null),I=$.exports,R=i("c1df"),P=i.n(R);n["default"].prototype.moment=P.a;var A={name:"Step",mixins:[p["a"]],components:{Ingredient:b,CompileComponent:I},props:{step:Object,ingredient_factor:Number,index:Number,recipe:Object,start_time:String},data:function(){return{details_visible:!0,set_time_input:""}},mounted:function(){this.set_time_input=P()(this.start_time).add(this.step.time_offset,"minutes").format("yyyy-MM-DDTHH:mm")},methods:{calculateAmount:function(e){return Object(p["d"])(e,this.ingredient_factor)},updateTime:function(){var e=P()(this.set_time_input).add(-1*this.step.time_offset,"minutes").format("yyyy-MM-DDTHH:mm");this.$emit("update-start-time",e),this.closePopover()},closePopover:function(){this.$refs["id_reactive_popover_".concat(this.step.id)].$emit("close")},openPopover:function(){this.$refs["id_reactive_popover_".concat(this.step.id)].$emit("open")}}},N=A,L=Object(g["a"])(N,l,d,!1,null,null,null),B=L.exports,z=i("fc0d"),T=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("iframe",{staticStyle:{border:"none"},attrs:{src:e.pdfUrl,width:"100%",height:"700px"}})])},D=[],U={name:"PdfViewer",mixins:[p["b"]],props:{recipe:Object},computed:{pdfUrl:function(){return"/static/pdfjs/viewer.html?file="+Object(p["g"])("api_get_recipe_file",this.recipe.id)}}},M=U,V=Object(g["a"])(M,T,D,!1,null,null,null),H=V.exports,F=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticStyle:{"text-align":"center"}},[i("b-img",{attrs:{src:e.pdfUrl,alt:e.$t("External_Recipe_Image")}})],1)},K=[],Z={name:"ImageViewer",props:{recipe:Object},computed:{pdfUrl:function(){return Object(p["g"])("api_get_recipe_file",this.recipe.id)}}},J=Z,W=Object(g["a"])(J,F,K,!1,null,null,null),q=W.exports,G=function(){var e=this,t=e.$createElement,i=e._self._c||t;return null!==e.recipe.nutrition?i("div",[i("div",{staticClass:"card border-success"},[i("div",{staticClass:"card-body"},[i("div",{staticClass:"row"},[i("div",{staticClass:"col-12"},[i("h4",{staticClass:"card-title"},[i("i",{staticClass:"fas fa-carrot"}),e._v(" "+e._s(e.$t("Nutrition")))])])]),i("div",{staticClass:"row"},[i("div",{staticClass:"col-6"},[i("i",{staticClass:"fas fa-fire fa-fw text-primary"}),e._v(" "+e._s(e.$t("Calories"))+" ")]),i("div",{staticClass:"col-6"},[i("span",{domProps:{innerHTML:e._s(e.calculateAmount(e.recipe.nutrition.calories))}}),e._v(" kcal ")])]),i("div",{staticClass:"row"},[i("div",{staticClass:"col-6"},[i("i",{staticClass:"fas fa-bread-slice fa-fw text-primary"}),e._v(" "+e._s(e.$t("Carbohydrates"))+" ")]),i("div",{staticClass:"col-6"},[i("span",{domProps:{innerHTML:e._s(e.calculateAmount(e.recipe.nutrition.carbohydrates))}}),e._v(" g ")])]),i("div",{staticClass:"row"},[i("div",{staticClass:"col-6"},[i("i",{staticClass:"fas fa-cheese fa-fw text-primary"}),e._v(" "+e._s(e.$t("Fats"))+" ")]),i("div",{staticClass:"col-6"},[i("span",{domProps:{innerHTML:e._s(e.calculateAmount(e.recipe.nutrition.fats))}}),e._v(" g ")])]),i("div",{staticClass:"row"},[i("div",{staticClass:"col-6"},[i("i",{staticClass:"fas fa-drumstick-bite fa-fw text-primary"}),e._v(" "+e._s(e.$t("Proteins"))+" ")]),i("div",{staticClass:"col-6"},[i("span",{domProps:{innerHTML:e._s(e.calculateAmount(e.recipe.nutrition.proteins))}}),e._v(" g ")])])])])]):e._e()},X=[],Q={name:"Nutrition",props:{recipe:Object,ingredient_factor:Number},methods:{calculateAmount:function(e){return Object(p["d"])(e,this.ingredient_factor)}}},Y=Q,ee=Object(g["a"])(Y,G,X,!1,null,null,null),te=ee.exports,ie=i("81d5"),ne=i("d76c"),ae=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("b-modal",{staticClass:"modal",attrs:{id:"id_modal_add_book",title:e.$t("Add_to_Book"),"ok-title":e.$t("Add"),"cancel-title":e.$t("Close")},on:{ok:function(t){return e.addToBook()}}},[i("multiselect",{attrs:{options:e.books,"preserve-search":!0,placeholder:e.$t("Select_Book"),label:"name","track-by":"id",id:"id_books",multiple:!1},on:{"search-change":e.loadBook},model:{value:e.selected_book,callback:function(t){e.selected_book=t},expression:"selected_book"}})],1)],1)},re=[],se=i("8e5f"),oe=i.n(se);n["default"].prototype.moment=P.a,n["default"].use(o["a"]);var ce={name:"AddRecipeToBook",components:{Multiselect:oe.a},props:{recipe:Object},data:function(){return{books:[],selected_book:null}},mounted:function(){this.loadBook("")},methods:{loadBook:function(e){var t=this;Object(c["b"])(e).then((function(e){t.books=e}))},addToBook:function(){Object(c["a"])({recipe:this.recipe.id,book:this.selected_book.id})}}},le=ce,de=(i("60bc"),Object(g["a"])(le,ae,re,!1,null,null,null)),pe=de.exports;n["default"].prototype.moment=P.a,n["default"].use(o["a"]);var fe={name:"RecipeView",mixins:[p["b"],p["c"]],components:{PdfViewer:H,ImageViewer:q,Ingredient:b,Step:B,RecipeContextMenu:z["a"],Nutrition:te,Keywords:ie["a"],LoadingSpinner:ne["a"],AddRecipeToBook:pe},computed:{ingredient_factor:function(){return this.servings/this.recipe.servings}},data:function(){return{loading:!0,recipe:void 0,ingredient_count:0,servings:1,start_time:""}},mounted:function(){this.loadRecipe(window.RECIPE_ID)},methods:{loadRecipe:function(e){var t=this;Object(c["c"])(e).then((function(e){0!==window.USER_SERVINGS&&(e.servings=window.USER_SERVINGS),t.servings=e.servings;var i,n=0,a=Object(s["a"])(e.steps);try{for(a.s();!(i=a.n()).done;){var r=i.value;t.ingredient_count+=r.ingredients.length;var o,c=Object(s["a"])(r.ingredients);try{for(c.s();!(o=c.n()).done;){var l=o.value;t.$set(l,"checked",!1)}}catch(d){c.e(d)}finally{c.f()}r.time_offset=n,n+=r.time}}catch(d){a.e(d)}finally{a.f()}n>0&&(t.start_time=P()().format("yyyy-MM-DDTHH:mm")),t.recipe=e,t.loading=!1}))},updateStartTime:function(e){this.start_time=e},updateIngredientCheckedState:function(e){var t,i=Object(s["a"])(this.recipe.steps);try{for(i.s();!(t=i.n()).done;){var n,a=t.value,r=Object(s["a"])(a.ingredients);try{for(r.s();!(n=r.n()).done;){var o=n.value;o.id===e.id&&this.$set(o,"checked",!o.checked)}}catch(c){r.e(c)}finally{r.f()}}}catch(c){i.e(c)}finally{i.f()}}}},ue=fe,me=Object(g["a"])(ue,a,r,!1,null,null,null),_e=me.exports,ge=i("9225");n["default"].config.productionTip=!1,new n["default"]({i18n:ge["a"],render:function(e){return e(_e)}}).$mount("#app")},1:function(e,t,i){e.exports=i("0671")},4678:function(e,t,i){var n={"./af":"2bfb","./af.js":"2bfb","./ar":"8e73","./ar-dz":"a356","./ar-dz.js":"a356","./ar-kw":"423e","./ar-kw.js":"423e","./ar-ly":"1cfd","./ar-ly.js":"1cfd","./ar-ma":"0a84","./ar-ma.js":"0a84","./ar-sa":"8230","./ar-sa.js":"8230","./ar-tn":"6d83","./ar-tn.js":"6d83","./ar.js":"8e73","./az":"485c","./az.js":"485c","./be":"1fc1","./be.js":"1fc1","./bg":"84aa","./bg.js":"84aa","./bm":"a7fa","./bm.js":"a7fa","./bn":"9043","./bn-bd":"9686","./bn-bd.js":"9686","./bn.js":"9043","./bo":"d26a","./bo.js":"d26a","./br":"6887","./br.js":"6887","./bs":"2554","./bs.js":"2554","./ca":"d716","./ca.js":"d716","./cs":"3c0d","./cs.js":"3c0d","./cv":"03ec","./cv.js":"03ec","./cy":"9797","./cy.js":"9797","./da":"0f14","./da.js":"0f14","./de":"b469","./de-at":"b3eb","./de-at.js":"b3eb","./de-ch":"bb71","./de-ch.js":"bb71","./de.js":"b469","./dv":"598a","./dv.js":"598a","./el":"8d47","./el.js":"8d47","./en-au":"0e6b","./en-au.js":"0e6b","./en-ca":"3886","./en-ca.js":"3886","./en-gb":"39a6","./en-gb.js":"39a6","./en-ie":"e1d3","./en-ie.js":"e1d3","./en-il":"7333","./en-il.js":"7333","./en-in":"ec2e","./en-in.js":"ec2e","./en-nz":"6f50","./en-nz.js":"6f50","./en-sg":"b7e9","./en-sg.js":"b7e9","./eo":"65db","./eo.js":"65db","./es":"898b","./es-do":"0a3c","./es-do.js":"0a3c","./es-mx":"b5b7","./es-mx.js":"b5b7","./es-us":"55c9","./es-us.js":"55c9","./es.js":"898b","./et":"ec18","./et.js":"ec18","./eu":"0ff2","./eu.js":"0ff2","./fa":"8df4","./fa.js":"8df4","./fi":"81e9","./fi.js":"81e9","./fil":"d69a","./fil.js":"d69a","./fo":"0721","./fo.js":"0721","./fr":"9f26","./fr-ca":"d9f8","./fr-ca.js":"d9f8","./fr-ch":"0e49","./fr-ch.js":"0e49","./fr.js":"9f26","./fy":"7118","./fy.js":"7118","./ga":"5120","./ga.js":"5120","./gd":"f6b4","./gd.js":"f6b4","./gl":"8840","./gl.js":"8840","./gom-deva":"aaf2","./gom-deva.js":"aaf2","./gom-latn":"0caa","./gom-latn.js":"0caa","./gu":"e0c5","./gu.js":"e0c5","./he":"c7aa","./he.js":"c7aa","./hi":"dc4d","./hi.js":"dc4d","./hr":"4ba9","./hr.js":"4ba9","./hu":"5b14","./hu.js":"5b14","./hy-am":"d6b6","./hy-am.js":"d6b6","./id":"5038","./id.js":"5038","./is":"0558","./is.js":"0558","./it":"6e98","./it-ch":"6f12","./it-ch.js":"6f12","./it.js":"6e98","./ja":"079e","./ja.js":"079e","./jv":"b540","./jv.js":"b540","./ka":"201b","./ka.js":"201b","./kk":"6d79","./kk.js":"6d79","./km":"e81d","./km.js":"e81d","./kn":"3e92","./kn.js":"3e92","./ko":"22f8","./ko.js":"22f8","./ku":"2421","./ku.js":"2421","./ky":"9609","./ky.js":"9609","./lb":"440c","./lb.js":"440c","./lo":"b29d","./lo.js":"b29d","./lt":"26f9","./lt.js":"26f9","./lv":"b97c","./lv.js":"b97c","./me":"293c","./me.js":"293c","./mi":"688b","./mi.js":"688b","./mk":"6909","./mk.js":"6909","./ml":"02fb","./ml.js":"02fb","./mn":"958b","./mn.js":"958b","./mr":"39bd","./mr.js":"39bd","./ms":"ebe4","./ms-my":"6403","./ms-my.js":"6403","./ms.js":"ebe4","./mt":"1b45","./mt.js":"1b45","./my":"8689","./my.js":"8689","./nb":"6ce3","./nb.js":"6ce3","./ne":"3a39","./ne.js":"3a39","./nl":"facd","./nl-be":"db29","./nl-be.js":"db29","./nl.js":"facd","./nn":"b84c","./nn.js":"b84c","./oc-lnc":"167b","./oc-lnc.js":"167b","./pa-in":"f3ff","./pa-in.js":"f3ff","./pl":"8d57","./pl.js":"8d57","./pt":"f260","./pt-br":"d2d4","./pt-br.js":"d2d4","./pt.js":"f260","./ro":"972c","./ro.js":"972c","./ru":"957c","./ru.js":"957c","./sd":"6784","./sd.js":"6784","./se":"ffff","./se.js":"ffff","./si":"eda5","./si.js":"eda5","./sk":"7be6","./sk.js":"7be6","./sl":"8155","./sl.js":"8155","./sq":"c8f3","./sq.js":"c8f3","./sr":"cf1e","./sr-cyrl":"13e9","./sr-cyrl.js":"13e9","./sr.js":"cf1e","./ss":"52bd","./ss.js":"52bd","./sv":"5fbd","./sv.js":"5fbd","./sw":"74dc","./sw.js":"74dc","./ta":"3de5","./ta.js":"3de5","./te":"5cbb","./te.js":"5cbb","./tet":"576c","./tet.js":"576c","./tg":"3b1b","./tg.js":"3b1b","./th":"10e8","./th.js":"10e8","./tk":"5aff","./tk.js":"5aff","./tl-ph":"0f38","./tl-ph.js":"0f38","./tlh":"cf755","./tlh.js":"cf755","./tr":"0e81","./tr.js":"0e81","./tzl":"cf51","./tzl.js":"cf51","./tzm":"c109","./tzm-latn":"b53d","./tzm-latn.js":"b53d","./tzm.js":"c109","./ug-cn":"6117","./ug-cn.js":"6117","./uk":"ada2","./uk.js":"ada2","./ur":"5294","./ur.js":"5294","./uz":"2e8c","./uz-latn":"010e","./uz-latn.js":"010e","./uz.js":"2e8c","./vi":"2921","./vi.js":"2921","./x-pseudo":"fd7e","./x-pseudo.js":"fd7e","./yo":"7f33","./yo.js":"7f33","./zh-cn":"5c3a","./zh-cn.js":"5c3a","./zh-hk":"49ab","./zh-hk.js":"49ab","./zh-mo":"3a6c","./zh-mo.js":"3a6c","./zh-tw":"90ea","./zh-tw.js":"90ea"};function a(e){var t=r(e);return i(t)}function r(e){if(!i.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}a.keys=function(){return Object.keys(n)},a.resolve=r,e.exports=a,a.id="4678"},"49f8":function(e,t,i){var n={"./de.json":"6ce2","./en.json":"edd4","./nl.json":"a625","./sv.json":"4c5b"};function a(e){var t=r(e);return i(t)}function r(e){if(!i.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}a.keys=function(){return Object.keys(n)},a.resolve=r,e.exports=a,a.id="49f8"},"4c5b":function(e){e.exports=JSON.parse('{"import_running":"Import pågår, var god vänta!","all_fields_optional":"Alla rutor är valfria och kan lämnas tomma.","convert_internal":"Konvertera till internt recept","Log_Recipe_Cooking":"Logga tillagningen av receptet","External_Recipe_Image":"Externt receptbild","Add_to_Book":"Lägg till i kokbok","Add_to_Shopping":"Lägg till i handelslista","Add_to_Plan":"Lägg till i matsedel","Step_start_time":"Steg starttid","Select_Book":"Välj kokbok","Recipe_Image":"Receptbild","Import_finished":"Importering klar","View_Recipes":"Visa recept","Log_Cooking":"Logga tillagning","Proteins":"Protein","Fats":"Fett","Carbohydrates":"Kolhydrater","Calories":"Kalorier","Nutrition":"Näringsinnehåll","Date":"Datum","Share":"Dela","Export":"Exportera","Rating":"Betyg","Close":"Stäng","Add":"Lägg till","Ingredients":"Ingredienser","min":"min","Servings":"Portioner","Waiting":"Väntan","Preparation":"Förberedelse","Edit":"Redigera","Open":"Öppna","Save":"Spara","Step":"Steg","Search":"Sök","Import":"Importera","Print":"Skriv ut","Information":"Information"}')},"6ce2":function(e){e.exports=JSON.parse('{"Import":"Import","import_running":"Import läuft, bitte warten!","Import_finished":"Import fertig","View_Recipes":"Rezepte Ansehen","Information":"Information","all_fields_optional":"Alle Felder sind optional und können leer gelassen werden.","convert_internal":"Zu internem Rezept wandeln","Log_Recipe_Cooking":"Kochen protokollieren","External_Recipe_Image":"Externes Rezept Bild","Add_to_Book":"Zu Buch hinzufügen","Add_to_Shopping":"Zu Einkaufsliste hinzufügen","Add_to_Plan":"Zu Plan hinzufügen","Step_start_time":"Schritt Startzeit","Select_Book":"Buch wählen","Recipe_Image":"Rezept Bild","Log_Cooking":"Kochen protokollieren","Proteins":"Proteine","Fats":"Fette","Carbohydrates":"Kohlenhydrate","Calories":"Kalorien","Nutrition":"Nährwerte"}')},"7c15":function(e,t,i){"use strict";i.d(t,"c",(function(){return s})),i.d(t,"d",(function(){return o})),i.d(t,"b",(function(){return c})),i.d(t,"a",(function(){return l}));var n=i("bc3a"),a=i.n(n),r=i("fa7d");function s(e){var t=Object(r["g"])("api:recipe-detail",e);return void 0!==window.SHARE_UID&&(t+="?share="+window.SHARE_UID),a.a.get(t).then((function(e){return e.data})).catch((function(e){d(e,"There was an error loading a resource!","danger")}))}function o(e){return a.a.post(Object(r["g"])("api:cooklog-list"),e).then((function(e){Object(r["f"])("Saved","Cook Log entry saved!","success")})).catch((function(e){d(e,"There was an error creating a resource!","danger")}))}function c(e){return a.a.get(Object(r["g"])("api:recipebook-list")+"?query="+e).then((function(e){return e.data})).catch((function(e){}))}function l(e){return a.a.post(Object(r["g"])("api:recipebookentry-list"),e).then((function(e){Object(r["f"])("Saved","Recipe Book entry saved!","success")})).catch((function(e){d(e,"There was an error creating a resource!","danger")}))}function d(e,t){if("response"in e){console.log(e.response);var i="statusText"in e.response?e.response.statusText:Object(r["e"])("Error");t+="\n\n"+JSON.stringify(e.response.data),Object(r["f"])(i,t,"danger")}else Object(r["f"])("Error",t,"danger"),console.log(e)}a.a.defaults.xsrfCookieName="csrftoken",a.a.defaults.xsrfHeaderName="X-CSRFTOKEN"},"81d5":function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return e.recipe.keywords.length>0?i("div",e._l(e.recipe.keywords,(function(t){return i("small",{key:t.id,staticStyle:{padding:"2px"}},[i("b-badge",{attrs:{pill:"",variant:"light"}},[e._v(e._s(t.label))])],1)})),0):e._e()},a=[],r={name:"Keywords",props:{recipe:Object}},s=r,o=i("2877"),c=Object(o["a"])(s,n,a,!1,null,null,null);t["a"]=c.exports},9225:function(e,t,i){"use strict";i("159b"),i("d3b7"),i("ddb0"),i("466d"),i("ac1f");var n=i("a026"),a=i("a925");function r(){var e=i("49f8"),t={};return e.keys().forEach((function(i){var n=i.match(/([A-Za-z0-9-_]+)\./i);if(n&&n.length>1){var a=n[1];t[a]=e(i)}})),t}n["default"].use(a["a"]),t["a"]=new a["a"]({locale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_LOCALE||"en",fallbackLocale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_FALLBACK_LOCALE||"en",messages:r()})},a625:function(e){e.exports=JSON.parse('{"import_running":"Er wordt geïmporteerd, even geduld!","all_fields_optional":"Alle velden zijn optioneel en kunnen leeg gelaten worden.","convert_internal":"Zet om naar intern recept","Log_Recipe_Cooking":"Log Bereiding","External_Recipe_Image":"Externe Afbeelding Recept","Add_to_Book":"Voeg toe aan Boek","Add_to_Shopping":"Voeg toe aan Boodschappenlijst","Add_to_Plan":"Voeg toe aan Plan","Step_start_time":"Starttijd stap","Select_Book":"Selecteer Boek","Recipe_Image":"Afbeelding Recept","Import_finished":"Importeren gereed","View_Recipes":"Bekijk Recepten","Log_Cooking":"Log Bereiding","Proteins":"Eiwitten","Fats":"Vetten","Carbohydrates":"Koolhydraten","Calories":"Calorieën","Nutrition":"Voedingswaarde","Date":"Datum","Share":"Deel","Export":"Exporteren","Rating":"Beoordeling","Close":"Sluiten","Add":"Voeg toe","Ingredients":"Ingrediënten","min":"min","Servings":"Porties","Waiting":"Wachten","Preparation":"Bereiding","Edit":"Bewerken","Open":"Open","Save":"Opslaan","Step":"Stap","Search":"Zoeken","Import":"Importeer","Print":"Afdrukken","Information":"Informatie","Keywords":"Etiketten","Books":"Boeken","show_only_internal":"Toon alleen interne recepten","New_Recipe":"Nieuw Recept","Url_Import":"Importeer URL","Reset_Search":"Zoeken resetten","or":"of","and":"en"}')},d76c:function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},a=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"row"},[i("div",{staticClass:"col",staticStyle:{"text-align":"center"}},[i("i",{staticClass:"fas fa-spinner fa-spin fa-10x"})])])}],r={name:"LoadingSpinner",props:{recipe:Object}},s=r,o=i("2877"),c=Object(o["a"])(s,n,a,!1,null,null,null);t["a"]=c.exports},edd4:function(e){e.exports=JSON.parse('{"import_running":"Import running, please wait!","all_fields_optional":"All fields are optional and can be left empty.","convert_internal":"Convert to internal recipe","show_only_internal":"Show only internal recipes","Log_Recipe_Cooking":"Log Recipe Cooking","External_Recipe_Image":"External Recipe Image","Add_to_Book":"Add to Book","Add_to_Shopping":"Add to Shopping","Add_to_Plan":"Add to Plan","Step_start_time":"Step start time","Select_Book":"Select Book","Recipe_Image":"Recipe Image","Import_finished":"Import finished","View_Recipes":"View Recipes","Log_Cooking":"Log Cooking","New_Recipe":"New Recipe","Url_Import":"Url Import","Reset_Search":"Reset Search","Recently_Viewed":"Recently Viewed","Keywords":"Keywords","Books":"Books","Proteins":"Proteins","Fats":"Fats","Carbohydrates":"Carbohydrates","Calories":"Calories","Nutrition":"Nutrition","Date":"Date","Share":"Share","Export":"Export","Rating":"Rating","Close":"Close","Add":"Add","Ingredients":"Ingredients","min":"min","Servings":"Servings","Waiting":"Waiting","Preparation":"Preparation","External":"External","Edit":"Edit","Open":"Open","Save":"Save","Step":"Step","Search":"Search","Import":"Import","Print":"Print","or":"or","and":"and","Information":"Information"}')},fa7d:function(e,t,i){"use strict";i.d(t,"c",(function(){return r})),i.d(t,"f",(function(){return s})),i.d(t,"a",(function(){return o})),i.d(t,"e",(function(){return c})),i.d(t,"b",(function(){return l})),i.d(t,"g",(function(){return d})),i.d(t,"d",(function(){return f}));i("99af");var n=i("59e4");function a(e,t,i){var n=Math.floor(e),a=1,r=n+1,s=1;if(e!==n)while(a<=t&&s<=t){var o=(n+r)/(a+s);if(e===o){a+s<=t?(a+=s,n+=r,s=t+1):a>s?s=t+1:a=t+1;break}et&&(a=s,n=r),!i)return[0,n,a];var c=Math.floor(n/a);return[c,n-c*a,a]}var r={methods:{makeToast:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return s(e,t,i)}}};function s(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=new n["a"];a.$bvToast.toast(t,{title:e,variant:i,toaster:"b-toaster-top-center",solid:!0})}var o={methods:{_:function(e){return c(e)}}};function c(e){return window.gettext(e)}var l={methods:{resolveDjangoUrl:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return d(e,t)}}};function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!==t?window.Urls[e](t):window.Urls[e]()}function p(e){return window.USER_PREF[e]}function f(e,t){if(p("use_fractions")){var i="",n=a(e*t,9,!0);return n[0]>0&&(i+=n[0]),n[1]>0&&(i+=" ".concat(n[1],"").concat(n[2],"")),i}return u(e*t)}function u(e){var t=p("user_fractions")?p("user_fractions"):2;return+(Math.round(e+"e+".concat(t))+"e-".concat(t))}},fc0d:function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("div",{staticClass:"dropdown"},[e._m(0),i("div",{staticClass:"dropdown-menu dropdown-menu-right",attrs:{"aria-labelledby":"dropdownMenuLink"}},[i("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("edit_recipe",e.recipe.id)}},[i("i",{staticClass:"fas fa-pencil-alt fa-fw"}),e._v(" "+e._s(e.$t("Edit")))]),e.recipe.internal?e._e():i("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("edit_convert_recipe",e.recipe.id)}},[i("i",{staticClass:"fas fa-exchange-alt fa-fw"}),e._v(" "+e._s(e.$t("convert_internal")))]),i("button",{staticClass:"dropdown-item",on:{click:function(t){return e.$bvModal.show("id_modal_add_book")}}},[i("i",{staticClass:"fas fa-bookmark fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Book"))+" ")]),e.recipe.internal?i("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("view_shopping")+"?r=["+e.recipe.id+","+e.servings_value+"]",target:"_blank",rel:"noopener noreferrer"}},[i("i",{staticClass:"fas fa-shopping-cart fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Shopping"))+" ")]):e._e(),i("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("new_meal_plan")+"?recipe="+e.recipe.id,target:"_blank",rel:"noopener noreferrer"}},[i("i",{staticClass:"fas fa-calendar fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Plan"))+" ")]),i("button",{staticClass:"dropdown-item",on:{click:function(t){return e.$bvModal.show("id_modal_cook_log")}}},[i("i",{staticClass:"fas fa-clipboard-list fa-fw"}),e._v(" "+e._s(e.$t("Log_Cooking"))+" ")]),i("button",{staticClass:"dropdown-item",attrs:{onclick:"window.print()"}},[i("i",{staticClass:"fas fa-print fa-fw"}),e._v(" "+e._s(e.$t("Print"))+" ")]),i("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("view_export")+"?r="+e.recipe.id,target:"_blank",rel:"noopener noreferrer"}},[i("i",{staticClass:"fas fa-file-export fa-fw"}),e._v(" "+e._s(e.$t("Export")))]),e.recipe.internal?i("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("new_share_link",e.recipe.id),target:"_blank",rel:"noopener noreferrer"}},[i("i",{staticClass:"fas fa-share-alt fa-fw"}),e._v(" "+e._s(e.$t("Share")))]):e._e()])]),i("cook-log",{attrs:{recipe:e.recipe}})],1)},a=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("a",{staticClass:"btn shadow-none",attrs:{href:"#",role:"button",id:"dropdownMenuLink","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[i("i",{staticClass:"fas fa-ellipsis-v"})])}],r=(i("a9e3"),i("fa7d")),s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("b-modal",{staticClass:"modal",attrs:{id:"id_modal_cook_log",title:e.$t("Log_Recipe_Cooking"),"ok-title":e.$t("Save"),"cancel-title":e.$t("Close")},on:{ok:function(t){return e.logCook()}}},[i("p",[e._v(e._s(e.$t("all_fields_optional")))]),i("form",[i("label",{attrs:{for:"id_log_servings"}},[e._v(e._s(e.$t("Servings")))]),i("input",{directives:[{name:"model",rawName:"v-model",value:e.logObject.servings,expression:"logObject.servings"}],staticClass:"form-control",attrs:{type:"number",id:"id_log_servings"},domProps:{value:e.logObject.servings},on:{input:function(t){t.target.composing||e.$set(e.logObject,"servings",t.target.value)}}}),i("label",{staticStyle:{"margin-top":"2vh"}},[e._v(e._s(e.$t("Rating"))+" - "),i("span",{attrs:{id:"id_rating_show"}},[e._v(e._s(e.logObject.rating)+"/5")])]),i("b-form-rating",{model:{value:e.logObject.rating,callback:function(t){e.$set(e.logObject,"rating",t)},expression:"logObject.rating"}}),i("label",{staticStyle:{"margin-top":"2vh"},attrs:{for:"id_date"}},[e._v(e._s(e.$t("Date")))]),i("input",{directives:[{name:"model",rawName:"v-model",value:e.logObject.created_at,expression:"logObject.created_at"}],staticClass:"form-control",attrs:{type:"datetime-local",id:"id_date"},domProps:{value:e.logObject.created_at},on:{input:function(t){t.target.composing||e.$set(e.logObject,"created_at",t.target.value)}}})],1)])],1)},o=[],c=i("c1df"),l=i.n(c),d=i("a026"),p=i("5f5b"),f=i("7c15");d["default"].prototype.moment=l.a,d["default"].use(p["a"]);var u={name:"CookLog",props:{recipe:Object},data:function(){return{logObject:{recipe:this.recipe.id,servings:0,rating:0,created_at:l()().format("yyyy-MM-DDTHH:mm")}}},methods:{logCook:function(){Object(f["d"])(this.logObject)}}},m=u,_=i("2877"),g=Object(_["a"])(m,s,o,!1,null,null,null),v=g.exports,b={name:"RecipeContextMenu",mixins:[r["b"]],components:{CookLog:v},data:function(){return{servings_value:0}},props:{recipe:Object,servings:{type:Number,default:-1}},mounted:function(){this.servings_value=-1===this.servings?this.recipe.servings:this.servings}},h=b,j=Object(_["a"])(h,n,a,!1,null,null,null);t["a"]=j.exports}}); \ No newline at end of file diff --git a/node_modules/.yarn-integrity b/node_modules/.yarn-integrity new file mode 100644 index 00000000..93c98326 --- /dev/null +++ b/node_modules/.yarn-integrity @@ -0,0 +1,16 @@ +{ + "systemParams": "win32-x64-83", + "modulesFolders": [ + "node_modules" + ], + "flags": [], + "linkedModules": [], + "topLevelPatterns": [ + "vue-cookies@^1.7.4" + ], + "lockfileEntries": { + "vue-cookies@^1.7.4": "https://registry.yarnpkg.com/vue-cookies/-/vue-cookies-1.7.4.tgz#d241d0a0431da0795837651d10b4d73e7c8d3e8d" + }, + "files": [], + "artifacts": {} +} \ No newline at end of file diff --git a/node_modules/vue-cookies/LICENSE b/node_modules/vue-cookies/LICENSE new file mode 100644 index 00000000..a8fc8514 --- /dev/null +++ b/node_modules/vue-cookies/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/vue-cookies/README.md b/node_modules/vue-cookies/README.md new file mode 100644 index 00000000..fc52b78e --- /dev/null +++ b/node_modules/vue-cookies/README.md @@ -0,0 +1,223 @@ +# vue-cookies + +A simple Vue.js plugin for handling browser cookies + +## Installation + +### Browser +``` + + +``` +### Package Managers +``` +npm install vue-cookies --save + +// require +var Vue = require('vue') +Vue.use(require('vue-cookies')) + +// es2015 module +import Vue from 'vue' +import VueCookies from 'vue-cookies' +Vue.use(VueCookies) + +// set default config +Vue.$cookies.config('7d') + +// set global cookie +Vue.$cookies.set('theme','default'); +Vue.$cookies.set('hover-time','1s'); +``` + +## Api + +syntax format: **[this | Vue].$cookies.[method]** + +* Set global config +``` +$cookies.config(expireTimes[,path[, domain[, secure[, sameSite]]]) // default: expireTimes = 1d, path = '/', domain = '', secure = '', sameSite = 'Lax' +``` + +* Set a cookie +``` +$cookies.set(keyName, value[, expireTimes[, path[, domain[, secure[, sameSite]]]]]) //return this +``` +* Get a cookie +``` +$cookies.get(keyName) // return value +``` +* Remove a cookie +``` +$cookies.remove(keyName [, path [, domain]]) // return this +``` +* Exist a `cookie name` +``` +$cookies.isKey(keyName) // return false or true +``` +* Get All `cookie name` +``` +$cookies.keys() // return a array +``` + +## Example Usage + +#### set global config +``` +// 30 day after, expire +Vue.$cookies.config('30d') + +// set secure, only https works +Vue.$cookies.config('7d','','',true) + +// 2019-03-13 expire +this.$cookies.config(new Date(2019,03,13).toUTCString()) + +// 30 day after, expire, '' current path , browser default +this.$cookies.config(60 * 60 * 24 * 30,''); + +``` + +#### support json object +``` +var user = { id:1, name:'Journal',session:'25j_7Sl6xDq2Kc3ym0fmrSSk2xV2XkUkX' }; +this.$cookies.set('user',user); +// print user name +console.log(this.$cookies.get('user').name) +``` + +#### set expire times +**Suppose the current time is : Sat, 11 Mar 2017 12:25:57 GMT** + +**Following equivalence: 1 day after, expire** + +**Support chaining sets together** +``` javascript + // default expire time: 1 day +this.$cookies.set("user_session","25j_7Sl6xDq2Kc3ym0fmrSSk2xV2XkUkX") + // number + d , ignore case + .set("user_session","25j_7Sl6xDq2Kc3ym0fmrSSk2xV2XkUkX","1d") + .set("user_session","25j_7Sl6xDq2Kc3ym0fmrSSk2xV2XkUkX","1D") + // Base of second + .set("user_session","25j_7Sl6xDq2Kc3ym0fmrSSk2xV2XkUkX",60 * 60 * 24) + // input a Date, + 1day + .set("user_session","25j_7Sl6xDq2Kc3ym0fmrSSk2xV2XkUkX", new Date(2017, 03, 12)) + // input a date string, + 1day + .set("user_session","25j_7Sl6xDq2Kc3ym0fmrSSk2xV2XkUkX", "Sat, 13 Mar 2017 12:25:57 GMT") +``` +#### set expire times, input number type + +``` +this.$cookies.set("default_unit_second","input_value",1); // 1 second after, expire +this.$cookies.set("default_unit_second","input_value",60 + 30); // 1 minute 30 second after, expire +this.$cookies.set("default_unit_second","input_value",60 * 60 * 12); // 12 hour after, expire +this.$cookies.set("default_unit_second","input_value",60 * 60 * 24 * 30); // 1 month after, expire +``` + +#### set expire times - end of browser session + +``` +this.$cookies.set("default_unit_second","input_value",0); // end of session - use 0 or "0"! +``` + + +#### set expire times , input string type + +| Unit | full name | +| ----------- | ----------- | +| y | year | +| m | month | +| d | day | +| h | hour | +| min | minute | +| s | second | + +**Unit Names Ignore Case** + +**not support the combination** + +**not support the double value** + +```javascript +this.$cookies.set("token","GH1.1.1689020474.1484362313","60s"); // 60 second after, expire +this.$cookies.set("token","GH1.1.1689020474.1484362313","30MIN"); // 30 minute after, expire, ignore case +this.$cookies.set("token","GH1.1.1689020474.1484362313","24d"); // 24 day after, expire +this.$cookies.set("token","GH1.1.1689020474.1484362313","4m"); // 4 month after, expire +this.$cookies.set("token","GH1.1.1689020474.1484362313","16h"); // 16 hour after, expire +this.$cookies.set("token","GH1.1.1689020474.1484362313","3y"); // 3 year after, expire + +// input date string +this.$cookies.set('token',"GH1.1.1689020474.1484362313", new Date(2017,3,13).toUTCString()); +this.$cookies.set("token","GH1.1.1689020474.1484362313", "Sat, 13 Mar 2017 12:25:57 GMT "); +``` + +#### set expire support date +``` +var date = new Date; +date.setDate(date.getDate() + 1); +this.$cookies.set("token","GH1.1.1689020474.1484362313", date); +``` + +#### set never expire +``` +this.$cookies.set("token","GH1.1.1689020474.1484362313", Infinity); // never expire +// never expire , only -1,Other negative Numbers are invalid +this.$cookies.set("token","GH1.1.1689020474.1484362313", -1); +``` + +#### remove cookie +``` +this.$cookies.set("token",value); // domain.com and *.doamin.com are readable +this.$cookies.remove("token"); // remove token of domain.com and *.doamin.com + +this.$cookies.set("token", value, null, null, "domain.com"); // only domain.com are readable +this.$cookies.remove("token", null, "domain.com"); // remove token of domain.com +``` + +#### set other arguments +``` +// set path +this.$cookies.set("use_path_argument","value","1d","/app"); + +// set domain +this.$cookies.set("use_path_argument","value",null, null, "domain.com"); // default 1 day after,expire + +// set secure +this.$cookies.set("use_path_argument","value",null, null, null,true); + +// set sameSite - should be one of `None`, `Strict` or `Lax`. Read more https://web.dev/samesite-cookies-explained/ +this.$cookies.set("use_path_argument","value",null, null, null, null, "Lax"); +``` + +#### other operation +``` +// check a cookie exist +this.$cookies.isKey("token") + +// get a cookie +this.$cookies.get("token"); + +// remove a cookie +this.$cookies.remove("token"); + +// get all cookie key names, line shows +this.$cookies.keys().join("\n"); + +// remove all cookie +this.$cookies.keys().forEach(cookie => this.$cookies.remove(cookie)) + +// vue-cookies global +[this | Vue].$cookies.[method] + +``` + + +## Warning + +**$cookies key names Cannot be set to ['expires','max-age','path','domain','secure','SameSite']** + + +## License + +[MIT](http://opensource.org/licenses/MIT) +Copyright (c) 2016-present, cmp-cc diff --git a/node_modules/vue-cookies/package.json b/node_modules/vue-cookies/package.json new file mode 100644 index 00000000..2843b6f9 --- /dev/null +++ b/node_modules/vue-cookies/package.json @@ -0,0 +1,29 @@ +{ + "name": "vue-cookies", + "version": "1.7.4", + "description": "A simple Vue.js plugin for handling browser cookies", + "main": "vue-cookies.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/cmp-cc/vue-cookies.git" + }, + "keywords":[ + "javascript", + "vue", + "cookie", + "cookies", + "vue-cookies", + "browser", + "session" + ], + "author": "cmp-cc", + "license": "MIT", + "bugs": { + "url": "https://github.com/cmp-cc/vue-cookies/issues" + }, + "homepage": "https://github.com/cmp-cc/vue-cookies#readme", + "typings": "types/index.d.ts" +} diff --git a/node_modules/vue-cookies/sample/welcome.html b/node_modules/vue-cookies/sample/welcome.html new file mode 100644 index 00000000..ae969d18 --- /dev/null +++ b/node_modules/vue-cookies/sample/welcome.html @@ -0,0 +1,51 @@ + + + + + + + Welcome Username + + +
+ +

+ Please enter your name : +

+

+ Welcome again : {{ welcomeValue }} + + {{deleteUserState}} +

+ +
+ + + \ No newline at end of file diff --git a/node_modules/vue-cookies/types/index.d.ts b/node_modules/vue-cookies/types/index.d.ts new file mode 100644 index 00000000..4f185580 --- /dev/null +++ b/node_modules/vue-cookies/types/index.d.ts @@ -0,0 +1,44 @@ +import _Vue from 'vue'; +import './vue'; + +export declare function install(Vue: typeof _Vue): void; + +export interface VueCookies { + /** + * Set global config + */ + config(expireTimes: string | number | Date, path?: string, domain?: string, secure?: boolean, sameSite?: string): void; + + /** + * Set a cookie + */ + set(keyName: string, value: any, expireTimes?: string | number | Date, + path?: string, domain?: string, secure?: boolean, sameSite?: string): this; + + /** + * Get a cookie + */ + get(keyName: string): any; + + /** + * Remove a cookie + */ + remove(keyName: string, path?: string, domain?: string): this; + + /** + * Exist a cookie name + */ + isKey(keyName: string): boolean; + + /** + * Get All cookie name + */ + keys(): string[]; +} + +declare const _default : { + VueCookies: VueCookies; + install: typeof install; +}; + +export default _default; diff --git a/node_modules/vue-cookies/types/vue.d.ts b/node_modules/vue-cookies/types/vue.d.ts new file mode 100644 index 00000000..576bc348 --- /dev/null +++ b/node_modules/vue-cookies/types/vue.d.ts @@ -0,0 +1,11 @@ +import { VueCookies } from "./index"; + +declare module "vue/types/vue" { + interface Vue { + $cookies: VueCookies; + } + + interface VueConstructor { + $cookies: VueCookies; + } +} diff --git a/node_modules/vue-cookies/vue-cookies.js b/node_modules/vue-cookies/vue-cookies.js new file mode 100644 index 00000000..b013475f --- /dev/null +++ b/node_modules/vue-cookies/vue-cookies.js @@ -0,0 +1,146 @@ +/** + * Vue Cookies v1.7.4 + * https://github.com/cmp-cc/vue-cookies + * + * Copyright 2016, cmp-cc + * Released under the MIT license + */ + +(function () { + + var defaultConfig = { + expires: '1d', + path: '; path=/', + domain: '', + secure: '', + sameSite: '; SameSite=Lax' + }; + + var VueCookies = { + // install of Vue + install: function (Vue) { + Vue.prototype.$cookies = this; + Vue.$cookies = this; + }, + config: function (expireTimes, path, domain, secure, sameSite) { + defaultConfig.expires = expireTimes ? expireTimes : '1d'; + defaultConfig.path = path ? '; path=' + path : '; path=/'; + defaultConfig.domain = domain ? '; domain=' + domain : ''; + defaultConfig.secure = secure ? '; Secure' : ''; + defaultConfig.sameSite = sameSite ? '; SameSite=' + sameSite : '; SameSite=Lax'; + }, + get: function (key) { + var value = decodeURIComponent(document.cookie.replace(new RegExp('(?:(?:^|.*;)\\s*' + encodeURIComponent(key).replace(/[\-\.\+\*]/g, '\\$&') + '\\s*\\=\\s*([^;]*).*$)|^.*$'), '$1')) || null; + + if (value && value.substring(0, 1) === '{' && value.substring(value.length - 1, value.length) === '}') { + try { + value = JSON.parse(value); + } catch (e) { + return value; + } + } + return value; + }, + set: function (key, value, expireTimes, path, domain, secure, sameSite) { + if (!key) { + throw new Error('Cookie name is not find in first argument.'); + } else if (/^(?:expires|max\-age|path|domain|secure|SameSite)$/i.test(key)) { + throw new Error('Cookie key name illegality, Cannot be set to ["expires","max-age","path","domain","secure","SameSite"]\t current key name: ' + key); + } + // support json object + if (value && value.constructor === Object) { + value = JSON.stringify(value); + } + var _expires = ''; + expireTimes = expireTimes == undefined ? defaultConfig.expires : expireTimes; + if (expireTimes && expireTimes != 0) { + switch (expireTimes.constructor) { + case Number: + if (expireTimes === Infinity || expireTimes === -1) _expires = '; expires=Fri, 31 Dec 9999 23:59:59 GMT'; + else _expires = '; max-age=' + expireTimes; + break; + case String: + if (/^(?:\d+(y|m|d|h|min|s))$/i.test(expireTimes)) { + // get capture number group + var _expireTime = expireTimes.replace(/^(\d+)(?:y|m|d|h|min|s)$/i, '$1'); + // get capture type group , to lower case + switch (expireTimes.replace(/^(?:\d+)(y|m|d|h|min|s)$/i, '$1').toLowerCase()) { + // Frequency sorting + case 'm': + _expires = '; max-age=' + +_expireTime * 2592000; + break; // 60 * 60 * 24 * 30 + case 'd': + _expires = '; max-age=' + +_expireTime * 86400; + break; // 60 * 60 * 24 + case 'h': + _expires = '; max-age=' + +_expireTime * 3600; + break; // 60 * 60 + case 'min': + _expires = '; max-age=' + +_expireTime * 60; + break; // 60 + case 's': + _expires = '; max-age=' + _expireTime; + break; + case 'y': + _expires = '; max-age=' + +_expireTime * 31104000; + break; // 60 * 60 * 24 * 30 * 12 + default: + new Error('unknown exception of "set operation"'); + } + } else { + _expires = '; expires=' + expireTimes; + } + break; + case Date: + _expires = '; expires=' + expireTimes.toUTCString(); + break; + } + } + document.cookie = + encodeURIComponent(key) + '=' + encodeURIComponent(value) + + _expires + + (domain ? '; domain=' + domain : defaultConfig.domain) + + (path ? '; path=' + path : defaultConfig.path) + + (secure == undefined ? defaultConfig.secure : secure ? '; Secure' : '') + + (sameSite == undefined ? defaultConfig.sameSite : (sameSite ? '; SameSite=' + sameSite : '')); + return this; + }, + remove: function (key, path, domain) { + if (!key || !this.isKey(key)) { + return false; + } + document.cookie = encodeURIComponent(key) + + '=; expires=Thu, 01 Jan 1970 00:00:00 GMT' + + (domain ? '; domain=' + domain : defaultConfig.domain) + + (path ? '; path=' + path : defaultConfig.path) + + '; SameSite=Lax'; + return this; + }, + isKey: function (key) { + return (new RegExp('(?:^|;\\s*)' + encodeURIComponent(key).replace(/[\-\.\+\*]/g, '\\$&') + '\\s*\\=')).test(document.cookie); + }, + keys: function () { + if (!document.cookie) return []; + var _keys = document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g, '').split(/\s*(?:\=[^;]*)?;\s*/); + for (var _index = 0; _index < _keys.length; _index++) { + _keys[_index] = decodeURIComponent(_keys[_index]); + } + return _keys; + } + }; + + if (typeof exports == 'object') { + module.exports = VueCookies; + } else if (typeof define == 'function' && define.amd) { + define([], function () { + return VueCookies; + }); + } else if (window.Vue) { + Vue.use(VueCookies); + } + // vue-cookies can exist independently,no dependencies library + if (typeof window !== 'undefined') { + window.$cookies = VueCookies; + } + +})(); diff --git a/package.json b/package.json new file mode 100644 index 00000000..1596c7f1 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "vue-cookies": "^1.7.4" + } +} diff --git a/vue/src/apps/RecipeSearchView/RecipeSearchView.vue b/vue/src/apps/RecipeSearchView/RecipeSearchView.vue index 2484444b..caed2a3b 100644 --- a/vue/src/apps/RecipeSearchView/RecipeSearchView.vue +++ b/vue/src/apps/RecipeSearchView/RecipeSearchView.vue @@ -17,14 +17,14 @@ v-bind:placeholder="$t('Search')"> + class="fas fa-caret-down" v-if="!settings.advanced_search_visible"> - +
@@ -66,9 +66,10 @@ - - {{ $t('or') }} + {{ $t('or') }} {{ $t('and') }} @@ -88,9 +89,10 @@ v-bind:placeholder="$t('Ingredients')"> - - {{ $t('or') }} + {{ $t('or') }} {{ $t('and') }} @@ -112,9 +114,10 @@ - - {{ $t('or') }} + {{ $t('or') }} {{ $t('and') }} @@ -141,12 +144,14 @@ - +
@@ -182,6 +187,10 @@ import {BootstrapVue} from 'bootstrap-vue' import 'bootstrap-vue/dist/bootstrap-vue.css' import moment from 'moment' +import VueCookies from 'vue-cookies' + +Vue.use(VueCookies) + import {ResolveUrlMixin} from "@/utils/utils"; import LoadingSpinner from "@/components/LoadingSpinner"; @@ -208,11 +217,12 @@ export default { search_foods: [], search_books: [], - search_keywords_or: true, - search_foods_or: true, - search_books_or: true, - - advanced_search_visible: true, + settings: { + search_keywords_or: true, + search_foods_or: true, + search_books_or: true, + advanced_search_visible: false, + }, pagination_count: 0, pagination_page: 1, @@ -220,10 +230,24 @@ export default { }, mounted() { + if (this.$cookies.isKey('search_settings')) { + console.log('loaded cookie settings') + this.settings = this.$cookies.get("search_settings") + } + this.refreshData() this.loadSpecialData() }, + watch: { + settings: { + handler(val) { + console.log('saved cookie settings', val) + this.$cookies.set("search_settings", this.settings, -1) + }, + deep: true + } + }, methods: { refreshData: function () { let apiClient = new ApiApiFactory() @@ -241,9 +265,9 @@ export default { return A["id"]; }), - keywords_or: this.search_keywords_or, - foods_or: this.search_foods_or, - books_or: this.search_books_or, + keywords_or: this.settings.search_keywords_or, + foods_or: this.settings.search_foods_or, + books_or: this.settings.search_books_or, internal: this.search_internal, page: this.pagination_page, diff --git a/vue/src/components/RecipeCard.vue b/vue/src/components/RecipeCard.vue index ab213828..8fae064e 100644 --- a/vue/src/components/RecipeCard.vue +++ b/vue/src/components/RecipeCard.vue @@ -23,6 +23,7 @@ diff --git a/vue/src/locales/en.json b/vue/src/locales/en.json index 8e8974ae..54f31d6e 100644 --- a/vue/src/locales/en.json +++ b/vue/src/locales/en.json @@ -3,14 +3,12 @@ "all_fields_optional": "All fields are optional and can be left empty.", "convert_internal": "Convert to internal recipe", "show_only_internal": "Show only internal recipes", - "Log_Recipe_Cooking": "Log Recipe Cooking", "External_Recipe_Image": "External Recipe Image", "Add_to_Book": "Add to Book", "Add_to_Shopping": "Add to Shopping", "Add_to_Plan": "Add to Plan", "Step_start_time": "Step start time", - "Select_Book": "Select Book", "Recipe_Image": "Recipe Image", "Import_finished": "Import finished", @@ -20,7 +18,6 @@ "Url_Import": "Url Import", "Reset_Search": "Reset Search", "Recently_Viewed": "Recently Viewed", - "Keywords": "Keywords", "Books": "Books", "Proteins": "Proteins", @@ -39,6 +36,7 @@ "Servings": "Servings", "Waiting": "Waiting", "Preparation": "Preparation", + "External": "External", "Edit": "Edit", "Open": "Open", "Save": "Save", diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 00000000..811e3f94 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,8 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +vue-cookies@^1.7.4: + version "1.7.4" + resolved "https://registry.yarnpkg.com/vue-cookies/-/vue-cookies-1.7.4.tgz#d241d0a0431da0795837651d10b4d73e7c8d3e8d" + integrity sha512-mOS5Btr8V9zvAtkmQ7/TfqJIropOx7etDAgBywPCmHjvfJl2gFbH2XgoMghleLoyyMTi5eaJss0mPN7arMoslA==