diff --git a/addons/dine360_theme_chennora/models/website.py b/addons/dine360_theme_chennora/models/website.py index f6f173d..11e025b 100644 --- a/addons/dine360_theme_chennora/models/website.py +++ b/addons/dine360_theme_chennora/models/website.py @@ -13,15 +13,17 @@ class Website(models.Model): ) def get_recent_blogs(self, limit=3): - """Reads blog posts from blogs.json and returns a slice.""" + """Reads blog posts from blogs.json and returns the latest slice.""" addon_path = modules.get_module_path('dine360_theme_chennora') json_path = os.path.join(addon_path, 'data', 'blogs.json') if os.path.exists(json_path): try: - with open(json_path, 'r', encoding='utf-8') as f: + with open(json_path, 'r', encoding='utf-8-sig') as f: blogs = json.load(f) - return blogs[:limit] + if isinstance(blogs, list): + return blogs[::-1][:limit] + return blogs[:limit] if isinstance(blogs, list) else [] except Exception: return [] return [] diff --git a/addons/dine360_theme_chennora/static/src/scss/theme.scss b/addons/dine360_theme_chennora/static/src/scss/theme.scss index cf2a5ff..e1ab421 100644 --- a/addons/dine360_theme_chennora/static/src/scss/theme.scss +++ b/addons/dine360_theme_chennora/static/src/scss/theme.scss @@ -977,29 +977,52 @@ section h2.display-4 { } } - .know-more-btn { - background-color: #FECD4F; - color: #04121D; - font-weight: 700; - padding: 12px 30px; - border-radius: 4px; - text-transform: uppercase; - display: inline-flex; - align-items: center; - gap: 10px; - margin-top: 30px; - text-decoration: none; +} +// Global button class for multiple sections +.know-more-btn { + background-color: #FECD4F; + color: #04121D !important; + font-weight: 700; + padding: 12px 30px; + border-radius: 4px; + text-transform: uppercase; + display: inline-flex; + align-items: center; + gap: 10px; + margin-top: 30px; + text-decoration: none; + transition: all 0.3s ease; + + span { + background: black; + color: white !important; + width: 24px; + height: 24px; + display: flex; + align-items: center; + justify-content: center; + border-radius: 2px; + font-size: 12px; + transition: all 0.3s ease; + + i { + color: white !important; + } + } + + &:hover { + background-color: #2BB1A5 !important; + color: white !important; + transform: translateY(-3px); + span { - background: black; - color: white; - width: 24px; - height: 24px; - display: flex; - align-items: center; - justify-content: center; - border-radius: 2px; - font-size: 12px; + background-color: white !important; + color: #2BB1A5 !important; + + i { + color: #2BB1A5 !important; + } } } }