blog page and blog details page updated

This commit is contained in:
Alaguraj0361 2026-02-26 21:00:37 +05:30
parent 816847c2d7
commit 651135e449
11 changed files with 317 additions and 77 deletions

View File

@ -94,17 +94,22 @@
/* Form Inputs */
.form-control:focus {
border-color: #d6111e !important;
box-shadow: 0 0 0 3px rgba(214, 17, 30, 0.2) !important;
background: rgba(255, 255, 255, 0.1) !important;
border-color: #FECD4F !important;
box-shadow: 0 0 0 3px rgba(254, 205, 79, 0.2) !important;
background: #ffffff !important;
}
.o_login_form_container label {
color: rgba(255, 255, 255, 0.8) !important;
color: #ffffff !important;
margin-bottom: 8px;
font-weight: 500;
}
.o_login_form_container a,
.o_login_form_container .btn-link {
color: #ffffff !important;
}
.form-control {
background: rgba(255, 255, 255, 0.05) !important;
border: 1px solid rgba(255, 255, 255, 0.1) !important;
@ -252,3 +257,7 @@ body.o_custom_login_body .o_login_main_wrapper {
z-index: 2;
max-width: 400px;
}
.oe_website_login_container label,
.oe_website_login_container a {
color: #ffffff !important;
}

View File

@ -11,6 +11,8 @@
'views/about_page.xml', # About Page
'views/contact_page.xml',# Contact Page
'views/faq_page.xml', # FAQ Page
'views/blog_page.xml', # Blog Page
'views/blog_detail_page.xml', # Blog Detail Page
'views/shop_page.xml', # Shop Page
'views/product_details_page.xml', # Customized Product Details Page
'views/product_views.xml', # Product Form custom fields

View File

@ -56,3 +56,37 @@ class ContactController(http.Controller):
pass
return request.render('dine360_theme_chennora.contact_thank_you')
class BlogController(http.Controller):
@http.route(['/blog'], type='http', auth='public', website=True)
def blog_list(self, **post):
blog_posts = request.env['chennora.blog.post'].sudo().search([('active', '=', True)])
return request.render('dine360_theme_chennora.blog_page', {
'blog_posts': blog_posts,
})
@http.route(['/blog/<string:slug>'], type='http', auth='public', website=True)
def blog_detail(self, slug, **post):
blog_post = request.env['chennora.blog.post'].sudo().search([('slug', '=', slug), ('active', '=', True)], limit=1)
if not blog_post:
return request.not_found()
recent_posts = request.env['chennora.blog.post'].sudo().search([('active', '=', True), ('id', '!=', blog_post.id)], limit=3)
# Get dynamic categories and counts
all_posts = request.env['chennora.blog.post'].sudo().search([('active', '=', True)])
categories = {}
for p in all_posts:
if p.category:
categories[p.category] = categories.get(p.category, 0) + 1
return request.render('dine360_theme_chennora.blog_detail_layout', {
'blog_title': blog_post.title,
'blog_img': blog_post.image,
'blog_date': blog_post.date.strftime('%B %d, %Y') if blog_post.date else '',
'blog_category': blog_post.category,
'blog_content': blog_post.content,
'recent_posts': recent_posts,
'categories': categories,
})

View File

@ -18,5 +18,13 @@
<field name="name">FAQ</field>
<field name="website_indexed" eval="True"/>
</record>
<record id="blog_page_chennora" model="website.page">
<field name="url">/blog</field>
<field name="is_published">True</field>
<field name="view_id" ref="dine360_theme_chennora.blog_page"/>
<field name="name">Blog</field>
<field name="website_indexed" eval="True"/>
</record>
</data>
</odoo>

View File

@ -1,2 +1,3 @@
# -*- coding: utf-8 -*-
from . import product_template
from . import blog_post

View File

@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
from odoo import models, fields, api
from datetime import datetime
class ChennoraBlogPost(models.Model):
_name = 'chennora.blog.post'
_description = 'Chennora Blog Post'
_order = 'date desc, id desc'
title = fields.Char(string='Title', required=True)
slug = fields.Char(string='URL Slug', required=True, help="Used in the URL e.g. 'my-first-post'")
category = fields.Char(string='Category', default='Restaurant Spotlight')
excerpt = fields.Text(string='Excerpt', help="Short summary for the blog card")
content = fields.Html(string='Content', sanitize=True)
image = fields.Char(string='Image URL', default='/dine360_theme_chennora/static/src/img/blog-1.png')
date = fields.Date(string='Publish Date', default=fields.Date.context_today)
active = fields.Boolean(default=True)
# Computed fields for the blog card date badge
day = fields.Char(compute='_compute_date_parts', store=True)
month = fields.Char(compute='_compute_date_parts', store=True)
_sql_constraints = [
('slug_unique', 'unique(slug)', 'The slug must be unique!')
]
@api.depends('date')
def _compute_date_parts(self):
for record in self:
if record.date:
dt = fields.Date.from_string(record.date)
record.day = dt.strftime('%d')
record.month = dt.strftime('%b').upper()
else:
record.day = ''
record.month = ''

View File

@ -1031,8 +1031,6 @@ section h2.display-4 {
&:hover {
transform: translateY(-10px);
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
background-color: #04121D;
color: white;
.blog-img-wrapper {
img {
@ -1040,31 +1038,13 @@ section h2.display-4 {
}
.date-badge {
border: 2px dashed #FECD4F;
background: #2BB1A5 !important;
span:first-child {
color: white !important;
}
span:last-child {
color: #04121D !important;
}
border: 2px dashed #2BB1A5;
}
}
.blog-body {
h4 {
color: white;
}
.blog-excerpt {
color: rgba(255, 255, 255, 0.7);
}
.category-line {
background: white;
color: #04121D;
color: #2BB1A5;
}
}
}

View File

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Base Blog Detail Layout -->
<template id="blog_detail_layout" name="Blog Detail Layout">
<t t-call="website.layout">
<div id="wrap" class="oe_structure">
<!-- Page Banner -->
<section class="s_page_title o_colored_level" style="background-color: #04121D; background-image: url('/dine360_theme_chennora/static/src/img/about-banner-new.png'); background-size: cover; background-position: center; padding: 100px 0; position: relative; overflow: hidden;">
<div class="o_we_bg_filter bg-black-50"/>
<div class="container text-center text-white position-relative" style="z-index: 2;">
<h1 class="display-3 fw-bold mb-3" style="letter-spacing: 1px;"><t t-esc="blog_title or 'Blog Detail'"/></h1>
<nav aria-label="breadcrumb" class="d-flex justify-content-center">
<ol class="breadcrumb mb-0" style="background: transparent; font-size: 14px; text-transform: uppercase; font-weight: 600;">
<li class="breadcrumb-item"><a href="/" class="text-white text-decoration-none" style="opacity: 0.8;">Home</a></li>
<li class="breadcrumb-item"><a href="/blog" class="text-white text-decoration-none" style="opacity: 0.8;">Blog</a></li>
<li class="breadcrumb-item active" style="color: #FECD4F;" aria-current="page"><t t-esc="blog_title or 'Detail'"/></li>
</ol>
</nav>
</div>
</section>
<!-- Blog Detail Section -->
<section class="s_blog_detail_section pt96 pb96 o_colored_level" style="background-color: #F9F6F0;">
<div class="container">
<div class="row">
<!-- Main Content Area -->
<div class="col-lg-8 mb-5 mb-lg-0">
<div class="blog-detail-content bg-white p-4 p-md-5 shadow-sm rounded">
<!-- Featured Image -->
<div class="blog-featured-img mb-4 overflow-hidden rounded">
<img t-att-src="blog_img or '/dine360_theme_chennora/static/src/img/blog-1.png'" class="img-fluid w-100" t-att-alt="blog_title"/>
</div>
<!-- Meta Info -->
<div class="d-flex align-items-center mb-4 gap-3 text-muted" style="font-size: 14px;">
<div class="d-flex align-items-center">
<i class="fa fa-calendar me-2 text-primary"></i> <t t-esc="blog_date or 'Jan 29, 2026'"/>
</div>
<div class="d-flex align-items-center">
<i class="fa fa-tag me-2 text-primary"></i> <t t-esc="blog_category or 'Restaurant'"/>
</div>
<div class="d-flex align-items-center">
<i class="fa fa-user me-2 text-primary"></i> Admin
</div>
</div>
<!-- Title -->
<h2 class="display-5 fw-bold mb-4" style="color: #04121D; line-height: 1.2;"><t t-esc="blog_title"/></h2>
<!-- Content -->
<div class="blog-text" style="font-size: 16px; line-height: 1.8; color: #555;">
<t t-out="blog_content"/>
</div>
<!-- Share Links -->
<div class="mt-5 pt-4 border-top d-flex align-items-center justify-content-between flex-wrap gap-3">
<div class="fw-bold">Share this post:</div>
<div class="d-flex gap-2">
<a href="#" class="btn btn-sm btn-outline-dark rounded-circle" style="width: 35px; height: 35px; display: flex; align-items: center; justify-content: center;"><i class="fa fa-facebook"></i></a>
<a href="#" class="btn btn-sm btn-outline-dark rounded-circle" style="width: 35px; height: 35px; display: flex; align-items: center; justify-content: center;"><i class="fa fa-twitter"></i></a>
<a href="#" class="btn btn-sm btn-outline-dark rounded-circle" style="width: 35px; height: 35px; display: flex; align-items: center; justify-content: center;"><i class="fa fa-linkedin"></i></a>
<a href="#" class="btn btn-sm btn-outline-dark rounded-circle" style="width: 35px; height: 35px; display: flex; align-items: center; justify-content: center;"><i class="fa fa-whatsapp"></i></a>
</div>
</div>
</div>
</div>
<!-- Sidebar -->
<div class="col-lg-4 ps-lg-5">
<!-- Search Widget -->
<div class="sidebar-widget mb-5">
<h4 class="fw-bold mb-4" style="position: relative; padding-bottom: 10px;">Search <span style="position: absolute; bottom: 0; left: 0; width: 40px; height: 3px; background: #2BB1A5;"></span></h4>
<div class="input-group">
<input type="text" class="form-control" placeholder="Search blogs..."/>
<button class="btn btn-primary" type="button"><i class="fa fa-search"></i></button>
</div>
</div>
<!-- Recent Posts Widget -->
<div class="sidebar-widget mb-5">
<h4 class="fw-bold mb-4" style="position: relative; padding-bottom: 10px;">Recent Posts <span style="position: absolute; bottom: 0; left: 0; width: 40px; height: 3px; background: #2BB1A5;"></span></h4>
<div class="recent-posts">
<t t-foreach="recent_posts" t-as="recent">
<div class="d-flex gap-3 mb-4">
<img t-att-src="recent.image" style="width: 80px; height: 80px; object-fit: cover; border-radius: 8px;" t-att-alt="recent.title"/>
<div>
<h6 class="fw-bold mb-1"><a t-attf-href="/blog/#{recent.slug}" class="text-dark text-decoration-none" t-esc="recent.title"/></h6>
<small class="text-muted" t-esc="recent.date.strftime('%b %d, %Y') if recent.date else ''"/>
</div>
</div>
</t>
</div>
</div>
<!-- Categories -->
<div class="sidebar-widget mb-5">
<h4 class="fw-bold mb-4" style="position: relative; padding-bottom: 10px;">Categories <span style="position: absolute; bottom: 0; left: 0; width: 40px; height: 3px; background: #2BB1A5;"></span></h4>
<ul class="list-unstyled">
<t t-foreach="categories" t-as="cat">
<li class="mb-2 d-flex justify-content-between">
<a href="#" class="text-dark text-decoration-none" t-esc="cat"/>
<span class="badge rounded-pill bg-light text-dark" t-esc="categories[cat]"/>
</li>
</t>
</ul>
</div>
</div>
</div>
</div>
</section>
</div>
</t>
</template>
</data>
</odoo>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="blog_page" name="Blog Page">
<t t-call="website.layout">
<div id="wrap" class="oe_structure">
<!-- Page Banner -->
<section class="s_page_title o_colored_level" style="background-color: #04121D; background-image: url('/dine360_theme_chennora/static/src/img/about-banner-new.png'); background-size: cover; background-position: center; padding: 100px 0; position: relative; overflow: hidden;">
<div class="o_we_bg_filter bg-black-50"/>
<div class="container text-center text-white position-relative" style="z-index: 2;">
<h1 class="display-3 fw-bold mb-3" style="letter-spacing: 1px;">BLOG</h1>
<nav aria-label="breadcrumb" class="d-flex justify-content-center">
<ol class="breadcrumb mb-0" style="background: transparent; font-size: 14px; text-transform: uppercase; font-weight: 600;">
<li class="breadcrumb-item"><a href="/" class="text-white text-decoration-none" style="opacity: 0.8;">Home</a></li>
<li class="breadcrumb-item active" style="color: #FECD4F;" aria-current="page">Blog</li>
</ol>
</nav>
</div>
</section>
<!-- Blog Listing Section -->
<section class="s_blog_premium o_colored_level pt96 pb96" style="background-color: #F9F6F0;">
<div class="container">
<!-- Header -->
<div class="row mb-5">
<div class="col-12 text-center">
<h6 class="d-flex align-items-center justify-content-center mb-3" style="color: #2BB1A5; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;">
<img src="/dine360_theme_chennora/static/src/img/subtitle-icon.png" style="width: 25px; margin-right: 10px;" alt=""/>
BLOG
<img src="/dine360_theme_chennora/static/src/img/subtitle-icon.png" style="width: 25px; margin-left: 10px;" alt=""/>
</h6>
<h2 class="display-4 fw-bold" style="color: #04121D;">News &amp; Articles</h2>
</div>
</div>
<div class="row g-4 d-flex align-items-stretch">
<t t-foreach="blog_posts" t-as="blog">
<div class="col-lg-4">
<div class="blog-card">
<div class="blog-img-wrapper">
<img t-att-src="blog.image" t-att-alt="blog.title"/>
<div class="date-badge">
<span t-esc="blog.day"/>
<span t-esc="blog.month"/>
</div>
</div>
<div class="blog-body">
<span class="category-line" t-esc="'Category: ' + blog.category"/>
<h4><a t-attf-href="/blog/#{blog.slug}" class="text-decoration-none" style="color: inherit;" t-esc="blog.title"/></h4>
<p class="blog-excerpt" t-esc="blog.excerpt"/>
<a t-attf-href="/blog/#{blog.slug}" class="btn-link text-decoration-none fw-bold mt-2 d-inline-block" style="color: #2BB1A5; font-size: 14px;">Read More</a>
</div>
</div>
</div>
</t>
</div>
</div>
</section>
</div>
</t>
</template>
</data>
</odoo>

View File

@ -538,6 +538,7 @@
</section>
<!-- Premium Blog Section -->
<section class="s_blog_premium o_colored_level pt80 pb80" data-snippet="s_blog_premium" data-name="Premium Blog">
<t t-set="latest_blogs" t-value="request.env['chennora.blog.post'].sudo().search([('active', '=', True)], limit=3)"/>
<!-- Floating Accent -->
<img src="/dine360_theme_chennora/static/src/img/french-fries-accent.png" class="fries-accent d-none d-lg-block" alt=""/>
@ -555,59 +556,25 @@
</div>
<div class="row g-4 d-flex align-items-stretch">
<!-- Blog Post 1 -->
<t t-foreach="latest_blogs" t-as="blog">
<div class="col-lg-4">
<div class="blog-card">
<div class="blog-img-wrapper">
<img src="/dine360_theme_chennora/static/src/img/blog-1.png" alt="Blog 1"/>
<img t-att-src="blog.image" t-att-alt="blog.title"/>
<div class="date-badge">
<span>29</span>
<span>JAN</span>
<span t-esc="blog.day"/>
<span t-esc="blog.month"/>
</div>
</div>
<div class="blog-body">
<span class="category-line">Category: Restaurant Spotlight</span>
<h4>Looking For Indian Food Near Castlemore? Here's Wh...</h4>
<p class="blog-excerpt">Searching for Indian food near Castlemore? Discover why Chennora Brampton is a top choice for flavour, comfort, and conv...</p>
</div>
</div>
</div>
<!-- Blog Post 2 -->
<div class="col-lg-4">
<div class="blog-card">
<div class="blog-img-wrapper">
<img src="/dine360_theme_chennora/static/src/img/blog-2.png" alt="Blog 2"/>
<div class="date-badge">
<span>28</span>
<span>JAN</span>
</div>
</div>
<div class="blog-body">
<span class="category-line">Category: Restaurant Spotlight</span>
<h4>Chennora Brampton: A Modern Indian Kitchen Bar Red...</h4>
<p class="blog-excerpt">Explore how Chennora Brampton blends traditional Indian flavours with a modern kitchen bar experience near McVean Dr, Br...</p>
</div>
</div>
</div>
<!-- Blog Post 3 -->
<div class="col-lg-4">
<div class="blog-card">
<div class="blog-img-wrapper">
<img src="/dine360_theme_chennora/static/src/img/blog-3.png" alt="Blog 3"/>
<div class="date-badge">
<span>24</span>
<span>JAN</span>
</div>
</div>
<div class="blog-body">
<span class="category-line">Category: Family Dining</span>
<h4>Chennora Brampton is perfect for family dinners</h4>
<p class="blog-excerpt">Discover why Chennora Brampton is perfect for family dinners and group outings with family-friendly atmosphere, shareabl...</p>
<span class="category-line" t-esc="'Category: ' + blog.category"/>
<h4><a t-attf-href="/blog/#{blog.slug}" class="text-decoration-none" style="color: inherit;" t-esc="blog.title"/></h4>
<p class="blog-excerpt" t-esc="blog.excerpt"/>
<a t-attf-href="/blog/#{blog.slug}" class="btn-link text-decoration-none fw-bold mt-2 d-inline-block" style="color: #2BB1A5; font-size: 14px;">Read More</a>
</div>
</div>
</div>
</t>
</div>
<!-- Bottom Button -->

20
blog_posts_sample.json Normal file
View File

@ -0,0 +1,20 @@
[
{
"title": "Looking For Indian Food Near Castlemore?",
"slug": "indian-food-castlemore",
"category": "Restaurant Spotlight",
"excerpt": "Searching for Indian food near Castlemore? Discover why Chennora is the best.",
"image": "/dine360_theme_chennora/static/src/img/blog-1.png",
"date": "2026-02-29",
"content": "Searching for Indian food near Castlemore? Whether you're a local resident or just passing through the area, finding a restaurant that perfectly balances traditional flavors with a welcoming atmosphere can be a challenge. That's where Chennora Brampton comes in. At Chennora, we don't believe in cutting corners. Our chefs use traditional recipes and the finest spices imported directly from India to ensure every bite takes you back to the streets of Chennai."
},
{
"title": "Modern Indian Kitchen Bar",
"slug": "modern-indian-kitchen-bar",
"category": "Restaurant Spotlight",
"excerpt": "Explore the vibrant Kitchen Bar experience at Chennora Brampton.",
"image": "/dine360_theme_chennora/static/src/img/blog-2.png",
"date": "2026-02-28",
"content": "<h4>Authentic Flavors</h4><p>The culinary landscape of Brampton is changing, and Chennora is at the forefront of this revolution. We've combined the soulful flavors of a traditional Indian kitchen with the vibrant energy of a modern bar to create a unique Kitchen Bar concept.</p>"
}
]