forked from alaguraj/odoo-testing-addons
latest blogs & articles section updated
This commit is contained in:
parent
2e1b4358b1
commit
c256d16032
@ -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 []
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user