dependency cleanup
This commit is contained in:
2
cookbook/static/js/Sortable.min.js
vendored
Normal file
2
cookbook/static/js/Sortable.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
cookbook/static/js/js.cookie.min.js
vendored
Normal file
1
cookbook/static/js/js.cookie.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
!function(e){var n;if("function"==typeof define&&define.amd&&(define(e),n=!0),"object"==typeof exports&&(module.exports=e(),n=!0),!n){var t=window.Cookies,o=window.Cookies=e();o.noConflict=function(){return window.Cookies=t,o}}}(function(){function f(){for(var e=0,n={};e<arguments.length;e++){var t=arguments[e];for(var o in t)n[o]=t[o]}return n}function a(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function e(u){function c(){}function t(e,n,t){if("undefined"!=typeof document){"number"==typeof(t=f({path:"/"},c.defaults,t)).expires&&(t.expires=new Date(1*new Date+864e5*t.expires)),t.expires=t.expires?t.expires.toUTCString():"";try{var o=JSON.stringify(n);/^[\{\[]/.test(o)&&(n=o)}catch(e){}n=u.write?u.write(n,e):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var r="";for(var i in t)t[i]&&(r+="; "+i,!0!==t[i]&&(r+="="+t[i].split(";")[0]));return document.cookie=e+"="+n+r}}function n(e,n){if("undefined"!=typeof document){for(var t={},o=document.cookie?document.cookie.split("; "):[],r=0;r<o.length;r++){var i=o[r].split("="),c=i.slice(1).join("=");n||'"'!==c.charAt(0)||(c=c.slice(1,-1));try{var f=a(i[0]);if(c=(u.read||u)(c,f)||a(c),n)try{c=JSON.parse(c)}catch(e){}if(t[f]=c,e===f)break}catch(e){}}return e?t[e]:t}}return c.set=t,c.get=function(e){return n(e,!1)},c.getJSON=function(e){return n(e,!0)},c.remove=function(e,n){t(e,"",f(n,{expires:-1}))},c.defaults={},c.withConverter=e,c}(function(){})});
|
1
cookbook/static/js/js.cookie.min.js.map
Normal file
1
cookbook/static/js/js.cookie.min.js.map
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"version":3,"sources":["js.cookie.js"],"names":["factory","registeredInModuleLoader","define","amd","exports","module","OldCookies","window","Cookies","api","noConflict","extend","i","result","arguments","length","attributes","key","decode","s","replace","decodeURIComponent","init","converter","set","value","document","path","defaults","expires","Date","toUTCString","JSON","stringify","test","e","write","encodeURIComponent","String","escape","stringifiedAttributes","attributeName","split","cookie","get","json","jar","cookies","parts","slice","join","charAt","name","read","parse","getJSON","remove","withConverter"],"mappings":"CAOE,SAAUA,GACX,IAAIC,EASJ,GARsB,mBAAXC,QAAyBA,OAAOC,MAC1CD,OAAOF,GACPC,GAA2B,GAEL,iBAAZG,UACVC,OAAOD,QAAUJ,IACjBC,GAA2B,IAEvBA,EAA0B,CAC9B,IAAIK,EAAaC,OAAOC,QACpBC,EAAMF,OAAOC,QAAUR,IAC3BS,EAAIC,WAAa,WAEhB,OADAH,OAAOC,QAAUF,EACVG,IAfT,CAkBC,WACD,SAASE,IAGR,IAFA,IAAIC,EAAI,EACJC,EAAS,GACND,EAAIE,UAAUC,OAAQH,IAAK,CACjC,IAAII,EAAaF,UAAWF,GAC5B,IAAK,IAAIK,KAAOD,EACfH,EAAOI,GAAOD,EAAWC,GAG3B,OAAOJ,EAGR,SAASK,EAAQC,GAChB,OAAOA,EAAEC,QAAQ,mBAAoBC,oBA0HtC,OAvHA,SAASC,EAAMC,GACd,SAASd,KAET,SAASe,EAAKP,EAAKQ,EAAOT,GACzB,GAAwB,oBAAbU,SAAX,CAQkC,iBAJlCV,EAAaL,EAAO,CACnBgB,KAAM,KACJlB,EAAImB,SAAUZ,IAEKa,UACrBb,EAAWa,QAAU,IAAIC,KAAkB,EAAb,IAAIA,KAAkC,MAArBd,EAAWa,UAI3Db,EAAWa,QAAUb,EAAWa,QAAUb,E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AAI8C,QAAU,SAAUtC,GACvB,OAAO2B,EAAI3B,GAAK,IAEjBR,EAAI+C,OAAS,SAAUvC,EAAKD,GAC3BQ,EAAIP,EAAK,GAAIN,EAAOK,EAAY,CAC/Ba,SAAU,MAIZpB,EAAImB,SAAW,GAEfnB,EAAIgD,cAAgBnC,EAEbb,EAGDa,CAAK"}
|
3
cookbook/static/js/vue-draggable.min.js
vendored
3
cookbook/static/js/vue-draggable.min.js
vendored
File diff suppressed because one or more lines are too long
11965
cookbook/static/js/vue.js
Normal file
11965
cookbook/static/js/vue.js
Normal file
File diff suppressed because it is too large
Load Diff
11961
cookbook/static/js/vue.min.js
vendored
11961
cookbook/static/js/vue.min.js
vendored
File diff suppressed because one or more lines are too long
2
cookbook/static/js/vuedraggable.umd.min.js
vendored
Normal file
2
cookbook/static/js/vuedraggable.umd.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
cookbook/static/js/vuedraggable.umd.min.js.map
Normal file
1
cookbook/static/js/vuedraggable.umd.min.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -5,19 +5,20 @@
|
|||||||
{% block title %}{% trans 'Meal-Plan' %}{% endblock %}
|
{% block title %}{% trans 'Meal-Plan' %}{% endblock %}
|
||||||
|
|
||||||
{% block extra_head %}
|
{% block extra_head %}
|
||||||
{{ form.media }}
|
|
||||||
<script src="{% static 'js/vue.min.js' %}"></script>
|
{% if DEBUG %}
|
||||||
|
<script src="{% static 'js/vue.js' %}"></script>
|
||||||
|
{% else %}
|
||||||
|
<script src="{% static 'js/vue.min.js' %}"></script>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<script src="{% static 'js/vue-resource.js' %}"></script>
|
<script src="{% static 'js/vue-resource.js' %}"></script>
|
||||||
<script src="{% static 'js/moment-with-locales.min.js' %}"></script>
|
<script src="{% static 'js/moment-with-locales.min.js' %}"></script>
|
||||||
|
|
||||||
<!-- TODO remove external loading -->
|
<script src="{% static 'js/Sortable.min.js' %}"></script>
|
||||||
<!-- CDNJS :: Sortable (https://cdnjs.com/) -->
|
<script src="{% static 'js/vuedraggable.umd.min.js' %}"></script>
|
||||||
<script src="//cdn.jsdelivr.net/npm/sortablejs@1.8.4/Sortable.min.js"></script>
|
|
||||||
<!-- CDNJS :: Vue.Draggable (https://cdnjs.com/) -->
|
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/Vue.Draggable/2.20.0/vuedraggable.umd.min.js"></script>
|
|
||||||
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-cookie/2.2.1/js.cookie.js"
|
<script src="{% static 'js/js.cookie.min.js' %}"></script>
|
||||||
integrity="sha256-P8jY+MCe6X2cjNSmF4rQvZIanL5VwUUT4MBnOMncjRU=" crossorigin="anonymous"></script>
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
@ -138,30 +138,7 @@ def get_days_from_week(start, end):
|
|||||||
|
|
||||||
@group_required('user')
|
@group_required('user')
|
||||||
def meal_plan(request):
|
def meal_plan(request):
|
||||||
js_week = datetime.now().strftime("%Y-W%V")
|
return render(request, 'meal_plan.html', {'DEBUG': settings.DEBUG})
|
||||||
if request.method == "POST":
|
|
||||||
js_week = request.POST['week']
|
|
||||||
|
|
||||||
year, week = js_week.split('-')
|
|
||||||
first_day, last_day = get_start_end_from_week(year, week.replace('W', ''))
|
|
||||||
|
|
||||||
surrounding_weeks = {'next': (last_day + timedelta(3)).strftime("%Y-W%V"), 'prev': (first_day - timedelta(3)).strftime("%Y-W%V")}
|
|
||||||
|
|
||||||
days = get_days_from_week(first_day, last_day)
|
|
||||||
days_dict = {}
|
|
||||||
for d in days:
|
|
||||||
days_dict[d] = []
|
|
||||||
|
|
||||||
plan = {}
|
|
||||||
for t in MealType.objects.all():
|
|
||||||
plan[t.name] = {'type_name': t.name, 'days': copy.deepcopy(days_dict)}
|
|
||||||
|
|
||||||
for d in days:
|
|
||||||
plan_day = MealPlan.objects.filter(date=d).filter(Q(created_by=request.user) | Q(shared=request.user)).distinct().all()
|
|
||||||
for p in plan_day:
|
|
||||||
plan[str(p.meal_type)]['days'][d].append(p)
|
|
||||||
|
|
||||||
return render(request, 'meal_plan.html', {'js_week': js_week, 'plan': plan, 'days': days, 'surrounding_weeks': surrounding_weeks})
|
|
||||||
|
|
||||||
|
|
||||||
@group_required('user')
|
@group_required('user')
|
||||||
|
Reference in New Issue
Block a user