basics for profile page
This commit is contained in:
32
cookbook/templates/profile.html
Normal file
32
cookbook/templates/profile.html
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
{% load render_bundle from webpack_loader %}
|
||||||
|
{% load static %}
|
||||||
|
{% load i18n %}
|
||||||
|
{% load l10n %}
|
||||||
|
|
||||||
|
{% block title %}{% trans 'Profile' %}{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<div id="app" >
|
||||||
|
<profile-view></profile-view>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
{% block script %}
|
||||||
|
{% if debug %}
|
||||||
|
<script src="{% url 'js_reverse' %}"></script>
|
||||||
|
{% else %}
|
||||||
|
<script src="{% static 'django_js_reverse/reverse.js' %}"></script>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<script type="application/javascript">
|
||||||
|
|
||||||
|
window.CUSTOM_LOCALE = '{{ request.LANGUAGE_CODE }}'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{% render_bundle 'profile_view' %}
|
||||||
|
{% endblock %}
|
@ -59,6 +59,7 @@ def search(request):
|
|||||||
else:
|
else:
|
||||||
return HttpResponseRedirect(reverse('account_login') + '?next=' + request.path)
|
return HttpResponseRedirect(reverse('account_login') + '?next=' + request.path)
|
||||||
|
|
||||||
|
|
||||||
def no_groups(request):
|
def no_groups(request):
|
||||||
return render(request, 'no_groups_info.html')
|
return render(request, 'no_groups_info.html')
|
||||||
|
|
||||||
@ -175,9 +176,10 @@ def meal_plan(request):
|
|||||||
def supermarket(request):
|
def supermarket(request):
|
||||||
return render(request, 'supermarket.html', {})
|
return render(request, 'supermarket.html', {})
|
||||||
|
|
||||||
|
|
||||||
@group_required('user')
|
@group_required('user')
|
||||||
def view_profile(request, user_id):
|
def view_profile(request, user_id):
|
||||||
return render(request, 'supermarket.html', {})
|
return render(request, 'profile.html', {})
|
||||||
|
|
||||||
|
|
||||||
@group_required('user')
|
@group_required('user')
|
||||||
|
45
vue/src/apps/ProfileView/ProfileView.vue
Normal file
45
vue/src/apps/ProfileView/ProfileView.vue
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<template>
|
||||||
|
<div id="app" class="col-12 col-xl-8 col-lg-10 offset-xl-2 offset-lg-1 offset">
|
||||||
|
<div class="col-12 col-xl-8 col-lg-10 offset-xl-2 offset-lg-1">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Vue from "vue"
|
||||||
|
import { BootstrapVue } from "bootstrap-vue"
|
||||||
|
|
||||||
|
import "bootstrap-vue/dist/bootstrap-vue.css"
|
||||||
|
import { ApiApiFactory } from "@/utils/openapi/api"
|
||||||
|
import CookbookSlider from "@/components/CookbookSlider"
|
||||||
|
import LoadingSpinner from "@/components/LoadingSpinner"
|
||||||
|
import { StandardToasts, ApiMixin } from "@/utils/utils"
|
||||||
|
|
||||||
|
Vue.use(BootstrapVue)
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "ProfileView",
|
||||||
|
mixins: [ApiMixin],
|
||||||
|
components: { },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
this.$i18n.locale = window.CUSTOM_LOCALE
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
18
vue/src/apps/ProfileView/main.js
Normal file
18
vue/src/apps/ProfileView/main.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import App from './ProfileView.vue'
|
||||||
|
import i18n from '@/i18n'
|
||||||
|
|
||||||
|
Vue.config.productionTip = false
|
||||||
|
|
||||||
|
// TODO move this and other default stuff to centralized JS file (verify nothing breaks)
|
||||||
|
let publicPath = localStorage.STATIC_URL + 'vue/'
|
||||||
|
if (process.env.NODE_ENV === 'development') {
|
||||||
|
publicPath = 'http://localhost:8080/'
|
||||||
|
}
|
||||||
|
export default __webpack_public_path__ = publicPath // eslint-disable-line
|
||||||
|
|
||||||
|
|
||||||
|
new Vue({
|
||||||
|
i18n,
|
||||||
|
render: h => h(App),
|
||||||
|
}).$mount('#app')
|
@ -61,6 +61,10 @@ const pages = {
|
|||||||
entry: "./src/apps/SpaceManageView/main.js",
|
entry: "./src/apps/SpaceManageView/main.js",
|
||||||
chunks: ["chunk-vendors"],
|
chunks: ["chunk-vendors"],
|
||||||
},
|
},
|
||||||
|
profile_view: {
|
||||||
|
entry: "./src/apps/ProfileView/main.js",
|
||||||
|
chunks: ["chunk-vendors"],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
Reference in New Issue
Block a user