diff --git a/public/js/components/DashboardWidget/News.js b/public/js/components/DashboardWidget/News.js index 6813601ff..1196a04b0 100755 --- a/public/js/components/DashboardWidget/News.js +++ b/public/js/components/DashboardWidget/News.js @@ -3,67 +3,77 @@ import BsModal from '../Bootstrap/Modal'; const MAX_LOADED_NEWS = 10; export default { - name: 'WidgetsNews', - components: { BsModal }, - data: () => ({ - allNewsList: [], - singleNews: {} - }), - mixins: [ - AbstractWidget - ], - computed: { + name: "WidgetsNews", + components: { BsModal }, + data: () => ({ + allNewsList: [], + singleNews: {}, + }), + mixins: [AbstractWidget], + computed: { + newsList() { + //Return news amount depending on widget width and size + let quantity = this.width; - + if (this.width === 1) { + quantity = this.height === 1 ? 4 : 10; + } - newsList(){ - //Return news amount depending on widget width and size - let quantity = this.width; - - if (this.width === 1) { - quantity = this.height === 1 ? 4 : 10; - } - - return this.allNewsList.slice(0, quantity); - }, - placeHolderImgURL: function() { - return FHC_JS_DATA_STORAGE_OBJECT.app_root + 'skin/images/fh_technikum_wien_illustration_klein.png'; - } - }, - created(){ - this.$fhcApi.factory.cms.news(MAX_LOADED_NEWS) - .then(res => { this.allNewsList = res.data }) - .catch(err => { console.error('ERROR: ', err.response.data) }); - - - this.$emit('setConfig', false); - }, - methods: { - - contentURI: function(content_id){ - return FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/CisVue/Cms/content/' + content_id; + return this.allNewsList.slice(0, quantity); }, - allNewsURI: function(){ - return FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/CisVue/Cms/news'; + placeHolderImgURL: function () { + return ( + FHC_JS_DATA_STORAGE_OBJECT.app_root + + "skin/images/fh_technikum_wien_illustration_klein.png" + ); }, - setSingleNews(singleNews){ - this.singleNews = singleNews; - this.$refs.newsModal.show(); - } - }, - template: /*html*/`
`, +}; diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 8dc1d163f..7c80bbe56 100755 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -27489,7 +27489,68 @@ array( 'insertvon' => 'system' ) ) - ) + ), + // NEWS PHRASEN --------------------------------------------------------------------------- + array( + 'app' => 'core', + 'category' => 'news', + 'phrase' => 'allNews', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Alle News', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'All News', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'news', + 'phrase' => 'topNews', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Top Nachrichten', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Top News', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'news', + 'phrase' => 'noSubject', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Kein Betreff vorhanden', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'No Subject available', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), );