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):
|
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')
|
addon_path = modules.get_module_path('dine360_theme_chennora')
|
||||||
json_path = os.path.join(addon_path, 'data', 'blogs.json')
|
json_path = os.path.join(addon_path, 'data', 'blogs.json')
|
||||||
|
|
||||||
if os.path.exists(json_path):
|
if os.path.exists(json_path):
|
||||||
try:
|
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)
|
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:
|
except Exception:
|
||||||
return []
|
return []
|
||||||
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 {
|
span {
|
||||||
background: black;
|
background-color: white !important;
|
||||||
color: white;
|
color: #2BB1A5 !important;
|
||||||
width: 24px;
|
|
||||||
height: 24px;
|
i {
|
||||||
display: flex;
|
color: #2BB1A5 !important;
|
||||||
align-items: center;
|
}
|
||||||
justify-content: center;
|
|
||||||
border-radius: 2px;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user