From 95ee573dc547dcb31bc9ae79d7ad663c6370f1b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 19 Feb 2024 13:07:45 +0100 Subject: [PATCH] rationalize the newsitem widgets --- .../HomepageWidget/DashboardWidgets/News.vue | 2 - .../DashboardWidgets/NewsItem.vue | 46 +++---------------- 2 files changed, 7 insertions(+), 41 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/News.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/News.vue index ee794c63f..74620c5bb 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/News.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/News.vue @@ -38,8 +38,6 @@ ul { } h1 { - font: 600 2rem/1 'Oswald', sans-serif; - text-transform: uppercase; text-align: center; } diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/NewsItem.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/NewsItem.vue index 8bca4c8d3..0d0f8604d 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/NewsItem.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/NewsItem.vue @@ -1,10 +1,12 @@ @@ -30,8 +32,8 @@ import { marked } from 'marked'; import DOMPurify from 'dompurify'; import { DateTime, NewsItemType } from "../../../types"; import type { PropType } from 'vue' -import { defineProps, ref } from "vue"; -import {ISOToDatetime} from 'ChillMainAssets/chill/js/date'; +import { ref } from "vue"; +import {ISOToDatetime} from '../../../chill/js/date'; const props = defineProps({ @@ -74,17 +76,13 @@ const shouldTruncate = (content: string): boolean => { }; const truncateContent = (content: string): string => { - console.log('max length', props.maxLength) - console.log('content', content) let truncatedContent = content.slice(0, props.maxLength); - console.log('truncated content', truncatedContent) let linkDepth = 0; let linkStartIndex = -1; const lines = content.split('\n'); // Truncate if amount of lines are too many if (lines.length > props.maxLines && content.length < props.maxLength) { - console.log('how many lines', lines.length) const truncatedContent = lines.slice(0, props.maxLines).join('\n').trim(); return truncatedContent + '...'; } @@ -117,8 +115,6 @@ const truncateContent = (content: string): string => { truncatedContent = truncatedContent.slice(0, linkStartIndex) + `(${url})`; } - console.log('truncated content later on', truncatedContent) - truncatedContent += '...'; return truncatedContent; @@ -162,36 +158,8 @@ h2 { position: relative; } -button { - cursor: pointer; - color: #fff; - border: none; - padding: 5px 10px; -} - -.read-more { - cursor: pointer; - position: absolute; - bottom: -2px; - right: 10px; -} - -.news-date { - font-style: italic; -} - .news-title { font-weight: bold; - text-transform: uppercase; -} - -time { - font-size: .8rem; - font-style: italic; - border-bottom: 1px dotted #333; - padding-bottom: .4rem; - margin-bottom: .5rem; - display: block; }