mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 09:52:22 +00:00
update(Cms.js/News.js/PhrasenPlugin): removes the reload option, because the content can be newly fetched based on the currently active language
This commit is contained in:
@@ -12,12 +12,13 @@ export default {
|
||||
},
|
||||
|
||||
//api function used for the news View that renders the html
|
||||
getNews(page = 1, page_size = 10) {
|
||||
getNews(page = 1, page_size = 10, sprache) {
|
||||
return this.$fhcApi.get(
|
||||
"/api/frontend/v1/Cms/getNews",
|
||||
{
|
||||
page,
|
||||
page_size,
|
||||
sprache,
|
||||
},
|
||||
);
|
||||
},
|
||||
|
||||
@@ -39,6 +39,6 @@ const app = Vue.createApp({
|
||||
setScrollbarWidth();
|
||||
|
||||
app.use(primevue.config.default, { zIndex: { overlay: 9999 } });
|
||||
app.use(Phrasen, {reload: true});
|
||||
app.use(Phrasen);
|
||||
app.mount("#cms");
|
||||
//#cms [data-confirm], #cms [data-href]
|
||||
@@ -89,5 +89,5 @@ const app = Vue.createApp({
|
||||
|
||||
setScrollbarWidth();
|
||||
|
||||
app.use(Phrasen, {reload: true});
|
||||
app.use(Phrasen);
|
||||
app.mount('#content');
|
||||
|
||||
@@ -11,4 +11,4 @@ const app = Vue.createApp({
|
||||
|
||||
setScrollbarWidth();
|
||||
|
||||
app.use(Phrasen, {reload: true}).mount('#content');
|
||||
app.use(Phrasen).mount('#content');
|
||||
@@ -161,5 +161,5 @@ const app = Vue.createApp({
|
||||
</fhc-calendar>
|
||||
`
|
||||
});
|
||||
app.use(Phrasen, {reload: true});
|
||||
app.use(Phrasen);
|
||||
app.mount('#content');
|
||||
@@ -21,5 +21,5 @@ const app = Vue.createApp({
|
||||
}
|
||||
});
|
||||
app
|
||||
.use(Phrasen, {reload: true})
|
||||
.use(Phrasen)
|
||||
.mount('#wrapper');
|
||||
@@ -12,10 +12,6 @@ export default {
|
||||
type: [String, Number],
|
||||
default: null,
|
||||
},
|
||||
sprache: {
|
||||
type: [String, Number],
|
||||
default: null,
|
||||
},
|
||||
sichtbar: {
|
||||
type: [String, Number],
|
||||
default: null,
|
||||
@@ -32,7 +28,16 @@ export default {
|
||||
content: null,
|
||||
};
|
||||
},
|
||||
watch:{
|
||||
sprache: function(sprache){
|
||||
this.fetchContent();
|
||||
console.log(sprache);
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
sprache(){
|
||||
return this.$p.user_language.value;
|
||||
},
|
||||
computeContentType: function () {
|
||||
switch (this.content_type) {
|
||||
case "raum_contentmittitel":
|
||||
@@ -43,14 +48,16 @@ export default {
|
||||
;
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.$fhcApi.factory.cms.content(this.content_id, this.version, this.sprache, this.sichtbar).then(res => {
|
||||
this.content = res.data.content;
|
||||
this.content_type = res.data.type;
|
||||
});
|
||||
methods:{
|
||||
fetchContent(){
|
||||
return this.$fhcApi.factory.cms.content(this.content_id, this.version, this.sprache, this.sichtbar).then(res => {
|
||||
this.content = res.data.content;
|
||||
this.content_type = res.data.type;
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
created() {
|
||||
this.fetchContent();
|
||||
},
|
||||
template: /*html*/ `
|
||||
<!-- div that contains the content -->
|
||||
|
||||
@@ -11,9 +11,28 @@ export default {
|
||||
content: null,
|
||||
maxPageCount: 0,
|
||||
page_size: 10,
|
||||
page:1,
|
||||
};
|
||||
},
|
||||
watch:{
|
||||
'$p.user_language.value':function(sprache){
|
||||
this.fetchNews();
|
||||
console.log("ere")
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
sprache: function(){
|
||||
return this.$p.user_language.value;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
fetchNews: function(){
|
||||
return this.$fhcApi.factory.cms.getNews(this.page, this.page_size, this.sprache)
|
||||
.then(res => res.data)
|
||||
.then(result => {
|
||||
this.content = result;
|
||||
});
|
||||
},
|
||||
loadNewPageContent: function (data) {
|
||||
this.$fhcApi.factory.cms.getNews(data.page, data.rows)
|
||||
.then(res => res.data)
|
||||
@@ -24,11 +43,7 @@ export default {
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.$fhcApi.factory.cms.getNews(1, this.page_size)
|
||||
.then(res => res.data)
|
||||
.then(result => {
|
||||
this.content = result;
|
||||
});
|
||||
this.fetchNews();
|
||||
|
||||
this.$fhcApi.factory.cms.getNewsRowCount()
|
||||
.then(res => res.data)
|
||||
@@ -39,7 +54,7 @@ export default {
|
||||
template: /*html*/ `
|
||||
<h2 >News</h2>
|
||||
<hr/>
|
||||
<pagination v-show="content?true:false" :page_size="page_size" @page="loadNewPageContent" :maxPageCount="maxPageCount">
|
||||
<pagination v-show="content?true:false" :page_size="page_size" @page="page=$event.page; loadNewPageContent($event)" :maxPageCount="maxPageCount">
|
||||
</pagination>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
|
||||
Reference in New Issue
Block a user