From f4176ebcdabea93dcd05f32a32ddc281d60e3092 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Tue, 25 Jun 2024 14:18:11 +0200 Subject: [PATCH] adds the content of the news to the dashboard items and makes them scrollable through css classes --- .../controllers/api/frontend/v1/Cms.php | 1 + public/css/components/dashboard.css | 2 ++ public/css/components/dashboard/news.css | 24 +++++++++++++ public/js/components/DashboardWidget/News.js | 36 +++++++++++++++---- 4 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 public/css/components/dashboard/news.css diff --git a/application/controllers/api/frontend/v1/Cms.php b/application/controllers/api/frontend/v1/Cms.php index 07a705e49..7aad344d6 100644 --- a/application/controllers/api/frontend/v1/Cms.php +++ b/application/controllers/api/frontend/v1/Cms.php @@ -118,6 +118,7 @@ class Cms extends FHCAPI_Controller $this->load->model('content/news_model', 'NewsModel'); $news_content_ids = $this->NewsModel->getNewsContentIDs($limit); + $this->addMeta("content_ids",$news_content_ids); $news_content = array(); if(isError($news_content_ids)) diff --git a/public/css/components/dashboard.css b/public/css/components/dashboard.css index 9da199442..67dd9cf3f 100755 --- a/public/css/components/dashboard.css +++ b/public/css/components/dashboard.css @@ -1,4 +1,6 @@ @import './calendar.css'; +@import './dashboard/news.css'; + .empty-tile-hover { height: 100%; width: 100%; diff --git a/public/css/components/dashboard/news.css b/public/css/components/dashboard/news.css new file mode 100644 index 000000000..93718b819 --- /dev/null +++ b/public/css/components/dashboard/news.css @@ -0,0 +1,24 @@ +/* .widgets-news .card-header { + flex-direction: column; + align-items: flex-start !important; + +} */ + +:root{ + --news-widget-height: 1; +} + +.widgets-news .news-content > div, +.widgets-news .news-content .row:nth-child(1), +.widgets-news .news-content .news-list, +.widgets-news .news-content .news-list-item, +.widgets-news .news-content .card-body +{ + height: 100%; +} + +.widgets-news .card-body{ + + /*max-height: calc(var(--news-widget-height)*var(--fhc-dg-row-height)); */ + overflow:scroll; +} \ No newline at end of file diff --git a/public/js/components/DashboardWidget/News.js b/public/js/components/DashboardWidget/News.js index 8cdacd66f..f597fea10 100755 --- a/public/js/components/DashboardWidget/News.js +++ b/public/js/components/DashboardWidget/News.js @@ -36,6 +36,23 @@ export default { this.$emit('setConfig', false); }, + mounted(){ + + this.$nextTick(() =>{ + + console.log(this.$refs.htmlContent,"this is the html content"); + /* //console.log(this.$refs.htmlContent,"this is the refs content"); + let newsItems = document.getElementsByClassName("news-list"); + console.log(newsItems,"i am printing something"); + for(let item of newsItems){ + //console.log(item,"this is the item"); + item.style.maxHeight = "100px"; + item.style.overflow = "scroll"; + } */ + }); + + + }, methods: { setSingleNews(singleNews){ this.singleNews = singleNews; @@ -43,6 +60,7 @@ export default { } }, template: /*html*/`
+
Top News
@@ -60,31 +78,37 @@ export default {
-
+
-
+
+
-
+
- + +
+