footer update and announcement dynamic data update
This commit is contained in:
parent
f189dc7b59
commit
90e9d210a6
Binary file not shown.
@ -109,6 +109,33 @@ class EducationDashboardController(http.Controller):
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# ── Announcements ─────────────────────────────────────────────────────
|
||||
announcements_data = []
|
||||
try:
|
||||
announcements = env['education.announcement'].search(
|
||||
[('active', '=', True)],
|
||||
order='date_published desc', limit=4
|
||||
)
|
||||
for ann in announcements:
|
||||
import re
|
||||
subtitle = re.sub('<[^>]+>', '', ann.content or '')[:60]
|
||||
type_colors = {
|
||||
'notice': ('#fee2e2', '#b91c1c'),
|
||||
'circular': ('#e0f2fe', '#0369a1'),
|
||||
'event': ('#fef9c3', '#a16207')
|
||||
}
|
||||
bg_color, text_color = type_colors.get(ann.announcement_type, ('#d1fae5', '#065f46'))
|
||||
ann_type = dict(ann._fields['announcement_type'].selection).get(ann.announcement_type) if ann.announcement_type else 'Notice'
|
||||
announcements_data.append({
|
||||
'title': ann.title,
|
||||
'subtitle': subtitle + ('...' if len(subtitle) == 60 else ''),
|
||||
'type': ann_type,
|
||||
'bg_color': bg_color,
|
||||
'text_color': text_color,
|
||||
})
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# ── User / date context ───────────────────────────────────────────────
|
||||
user_name = env.user.name
|
||||
today_str = datetime.date.today().strftime('%A, %b %d, %Y')
|
||||
@ -149,6 +176,7 @@ class EducationDashboardController(http.Controller):
|
||||
# operational
|
||||
'upcoming_exams': upcoming_exams,
|
||||
'recent_activities': recent_activities,
|
||||
'announcements': announcements_data,
|
||||
# context
|
||||
'user_name': user_name,
|
||||
'today': today_str,
|
||||
|
||||
@ -243,7 +243,7 @@ class EducationDashboard extends Component {
|
||||
openCreateCourse() {
|
||||
this.actionService.doAction({
|
||||
name: "Courses", type: "ir.actions.act_window",
|
||||
res_model: "education.course",
|
||||
res_model: "education.lms.course",
|
||||
views: [[false, "list"], [false, "form"]], target: "current"
|
||||
});
|
||||
}
|
||||
@ -267,7 +267,7 @@ class EducationDashboard extends Component {
|
||||
openFees() {
|
||||
this.actionService.doAction({
|
||||
name: "Fee Payments", type: "ir.actions.act_window",
|
||||
res_model: "education.fee.payment",
|
||||
res_model: "education.student.payment",
|
||||
views: [[false, "list"], [false, "form"]], target: "current"
|
||||
});
|
||||
}
|
||||
|
||||
@ -239,38 +239,24 @@
|
||||
</div>
|
||||
<span style="font-size:0.72rem;color:#1f8f8f;font-weight:600;cursor:pointer;">View All</span>
|
||||
</div>
|
||||
<t t-if="(state.kpis.announcements || []).length">
|
||||
<t t-foreach="state.kpis.announcements" t-as="ann" t-key="ann_index">
|
||||
<div class="edu-ann-row">
|
||||
<span class="edu-pill" style="background:#fee2e2;color:#b91c1c;margin-top:1px;">Important</span>
|
||||
<span class="edu-pill" t-attf-style="background:{{ann.bg_color}};color:{{ann.text_color}};margin-top:1px;"><t t-esc="ann.type"/></span>
|
||||
<div style="flex:1;min-width:0;">
|
||||
<div style="font-size:0.8rem;font-weight:600;color:#0f172a;margin-bottom:1px;">Exam Schedule Released</div>
|
||||
<div style="font-size:0.7rem;color:#94a3b8;">Mid-term schedule has been published.</div>
|
||||
<div style="font-size:0.8rem;font-weight:600;color:#0f172a;margin-bottom:1px;"><t t-esc="ann.title"/></div>
|
||||
<div style="font-size:0.7rem;color:#94a3b8;"><t t-esc="ann.subtitle"/></div>
|
||||
</div>
|
||||
<i class="fa fa-chevron-right" style="color:#cbd5e1;font-size:0.65rem;align-self:center;flex-shrink:0;"/>
|
||||
</div>
|
||||
<div class="edu-ann-row">
|
||||
<span class="edu-pill" style="background:#e0f2fe;color:#0369a1;margin-top:1px;">General</span>
|
||||
<div style="flex:1;min-width:0;">
|
||||
<div style="font-size:0.8rem;font-weight:600;color:#0f172a;margin-bottom:1px;">Library Hours Extended</div>
|
||||
<div style="font-size:0.7rem;color:#94a3b8;">Open till 8 PM this week.</div>
|
||||
</div>
|
||||
<i class="fa fa-chevron-right" style="color:#cbd5e1;font-size:0.65rem;align-self:center;flex-shrink:0;"/>
|
||||
</div>
|
||||
<div class="edu-ann-row">
|
||||
<span class="edu-pill" style="background:#d1fae5;color:#065f46;margin-top:1px;">Academic</span>
|
||||
<div style="flex:1;min-width:0;">
|
||||
<div style="font-size:0.8rem;font-weight:600;color:#0f172a;margin-bottom:1px;">Course Registration Open</div>
|
||||
<div style="font-size:0.7rem;color:#94a3b8;">Elective course registration is now open.</div>
|
||||
</div>
|
||||
<i class="fa fa-chevron-right" style="color:#cbd5e1;font-size:0.65rem;align-self:center;flex-shrink:0;"/>
|
||||
</div>
|
||||
<div class="edu-ann-row">
|
||||
<span class="edu-pill" style="background:#fef9c3;color:#a16207;margin-top:1px;">Event</span>
|
||||
<div style="flex:1;min-width:0;">
|
||||
<div style="font-size:0.8rem;font-weight:600;color:#0f172a;margin-bottom:1px;">Annual Tech Fest</div>
|
||||
<div style="font-size:0.7rem;color:#94a3b8;">Scheduled for next month.</div>
|
||||
</div>
|
||||
<i class="fa fa-chevron-right" style="color:#cbd5e1;font-size:0.65rem;align-self:center;flex-shrink:0;"/>
|
||||
</t>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<div style="text-align:center;padding:28px 0;color:#94a3b8;">
|
||||
<i class="fa fa-bullhorn" style="font-size:2rem;display:block;margin-bottom:8px;"/>
|
||||
<div style="font-size:0.8rem;">No recent announcements</div>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -822,9 +822,9 @@
|
||||
|
||||
<!-- Bottom Footer Area -->
|
||||
<div style="height: 60px; background: #ffffff; border-top: 1px solid rgba(31, 143, 143, 0.1); display: flex; align-items: center; justify-content: space-between; padding: 0 40px; font-size: 0.9rem; color: #718096; font-weight: 600;">
|
||||
<span>© 2026 My Company. All rights reserved.</span>
|
||||
<span>Powered by <span style="color: #714B67; font-weight: 700;">odoo</span></span>
|
||||
</div>
|
||||
<span>© 2026 Metatron EduPortal. All rights reserved.</span>
|
||||
<span>Powered by <a href="https://metatroncubesolutions.com/" style="color: #144d4d; font-weight: 700; text-decoration: none;">Metatroncube</a></span>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
@ -962,9 +962,9 @@
|
||||
|
||||
<!-- Bottom Footer Area -->
|
||||
<div style="height: 60px; background: #ffffff; border-top: 1px solid rgba(31, 143, 143, 0.1); display: flex; align-items: center; justify-content: space-between; padding: 0 40px; font-size: 0.9rem; color: #718096; font-weight: 600;">
|
||||
<span>© 2026 My Company. All rights reserved.</span>
|
||||
<span>Powered by <span style="color: #714B67; font-weight: 700;">odoo</span></span>
|
||||
</div>
|
||||
<span>© 2026 Metatron EduPortal. All rights reserved.</span>
|
||||
<span>Powered by <a href="https://metatroncubesolutions.com/" style="color: #144d4d; font-weight: 700; text-decoration: none;">Metatroncube</a></span>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
@ -1144,9 +1144,9 @@
|
||||
|
||||
<!-- Bottom Footer Area -->
|
||||
<div style="height: 60px; background: #ffffff; border-top: 1px solid rgba(31, 143, 143, 0.1); display: flex; align-items: center; justify-content: space-between; padding: 0 40px; font-size: 0.9rem; color: #718096; font-weight: 600;">
|
||||
<span>© 2026 My Company. All rights reserved.</span>
|
||||
<span>Powered by <span style="color: #714B67; font-weight: 700;">odoo</span></span>
|
||||
</div>
|
||||
<span>© 2026 Metatron EduPortal. All rights reserved.</span>
|
||||
<span>Powered by <a href="https://metatroncubesolutions.com/" style="color: #144d4d; font-weight: 700; text-decoration: none;">Metatroncube</a></span>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
</odoo>
|
||||
|
||||
@ -319,10 +319,10 @@
|
||||
</div>
|
||||
|
||||
<!-- Bottom Page Footer -->
|
||||
<div class="text-center mt-4" style="font-size: 0.85rem; color: #718096; font-weight: 600;">
|
||||
<div>Powered by <span style="color: #1f8f8f; font-weight: 800;">Odoo</span> Education Portal</div>
|
||||
<div>© 2026 My Company. All rights reserved.</div>
|
||||
</div>
|
||||
<div style="height: 60px; background: #ffffff; border-top: 1px solid rgba(31, 143, 143, 0.1); display: flex; align-items: center; justify-content: space-between; padding: 0 40px; font-size: 0.9rem; color: #718096; font-weight: 600;">
|
||||
<span>© 2026 Metatron EduPortal. All rights reserved.</span>
|
||||
<span>Powered by <a href="https://metatroncubesolutions.com/" style="color: #144d4d; font-weight: 700; text-decoration: none;">Metatroncube</a></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -1173,9 +1173,9 @@
|
||||
|
||||
<!-- Bottom Footer Area -->
|
||||
<div style="height: 60px; background: #ffffff; border-top: 1px solid rgba(31, 143, 143, 0.1); display: flex; align-items: center; justify-content: space-between; padding: 0 40px; font-size: 0.9rem; color: #718096; font-weight: 600;">
|
||||
<span>© 2026 My Company. All rights reserved.</span>
|
||||
<span>Powered by <span style="color: #714B67; font-weight: 700;">odoo</span></span>
|
||||
</div>
|
||||
<span>© 2026 Metatron EduPortal. All rights reserved.</span>
|
||||
<span>Powered by <a href="https://metatroncubesolutions.com/" style="color: #144d4d; font-weight: 700; text-decoration: none;">Metatroncube</a></span>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
@ -1971,9 +1971,9 @@
|
||||
|
||||
<!-- Bottom Footer Area -->
|
||||
<div style="height: 60px; background: #ffffff; border-top: 1px solid rgba(31, 143, 143, 0.1); display: flex; align-items: center; justify-content: space-between; padding: 0 40px; font-size: 0.9rem; color: #718096; font-weight: 600;">
|
||||
<span>© 2026 My Company. All rights reserved.</span>
|
||||
<span>Powered by <span style="color: #714B67; font-weight: 700;">odoo</span></span>
|
||||
</div>
|
||||
<span>© 2026 Metatron EduPortal. All rights reserved.</span>
|
||||
<span>Powered by <a href="https://metatroncubesolutions.com/" style="color: #144d4d; font-weight: 700; text-decoration: none;">Metatroncube</a></span>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
@ -2864,9 +2864,9 @@
|
||||
|
||||
<!-- Bottom Footer Area -->
|
||||
<div style="height: 60px; background: #ffffff; border-top: 1px solid rgba(31, 143, 143, 0.1); display: flex; align-items: center; justify-content: space-between; padding: 0 40px; font-size: 0.9rem; color: #718096; font-weight: 600;">
|
||||
<span>© 2026 My Company. All rights reserved.</span>
|
||||
<span>Powered by <span style="color: #714B67; font-weight: 700;">odoo</span></span>
|
||||
</div>
|
||||
<span>© 2026 Metatron EduPortal. All rights reserved.</span>
|
||||
<span>Powered by <a href="https://metatroncubesolutions.com/" style="color: #144d4d; font-weight: 700; text-decoration: none;">Metatroncube</a></span>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
@ -3591,9 +3591,9 @@
|
||||
|
||||
<!-- Bottom Footer Area -->
|
||||
<div style="height: 60px; background: #ffffff; border-top: 1px solid rgba(31, 143, 143, 0.1); display: flex; align-items: center; justify-content: space-between; padding: 0 40px; font-size: 0.9rem; color: #718096; font-weight: 600;">
|
||||
<span>© 2026 My Company. All rights reserved.</span>
|
||||
<span>Powered by <span style="color: #714B67; font-weight: 700;">odoo</span></span>
|
||||
</div>
|
||||
<span>© 2026 Metatron EduPortal. All rights reserved.</span>
|
||||
<span>Powered by <a href="https://metatroncubesolutions.com/" style="color: #144d4d; font-weight: 700; text-decoration: none;">Metatroncube</a></span>
|
||||
</div>
|
||||
|
||||
<!-- Frontend Logic to show selected file name -->
|
||||
<script type="text/javascript">
|
||||
@ -4242,9 +4242,9 @@
|
||||
|
||||
<!-- Bottom Footer Area -->
|
||||
<div style="height: 60px; background: #ffffff; border-top: 1px solid rgba(31, 143, 143, 0.1); display: flex; align-items: center; justify-content: space-between; padding: 0 40px; font-size: 0.9rem; color: #718096; font-weight: 600;">
|
||||
<span>© 2026 My Company. All rights reserved.</span>
|
||||
<span>Powered by <span style="color: #714B67; font-weight: 700;">odoo</span></span>
|
||||
</div>
|
||||
<span>© 2026 Metatron EduPortal. All rights reserved.</span>
|
||||
<span>Powered by <a href="https://metatroncubesolutions.com/" style="color: #144d4d; font-weight: 700; text-decoration: none;">Metatroncube</a></span>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
<template id="portal_student_exam_details" name="Student Exam Details">
|
||||
@ -5061,9 +5061,9 @@
|
||||
|
||||
<!-- Bottom Footer Area -->
|
||||
<div style="height: 60px; background: #ffffff; border-top: 1px solid rgba(31, 143, 143, 0.1); display: flex; align-items: center; justify-content: space-between; padding: 0 40px; font-size: 0.9rem; color: #718096; font-weight: 600;">
|
||||
<span>© 2026 My Company. All rights reserved.</span>
|
||||
<span>Powered by <span style="color: #714B67; font-weight: 700;">odoo</span></span>
|
||||
</div>
|
||||
<span>© 2026 Metatron EduPortal. All rights reserved.</span>
|
||||
<span>Powered by <a href="https://metatroncubesolutions.com/" style="color: #144d4d; font-weight: 700; text-decoration: none;">Metatroncube</a></span>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
|
||||
@ -721,8 +721,8 @@
|
||||
|
||||
<!-- Bottom Footer Area -->
|
||||
<div style="height: 60px; background: #ffffff; border-top: 1px solid rgba(31, 143, 143, 0.1); display: flex; align-items: center; justify-content: space-between; padding: 0 40px; font-size: 0.9rem; color: #718096; font-weight: 600;">
|
||||
<span>© 2026 My Company. All rights reserved.</span>
|
||||
<span>Powered by <span style="color: #714B67; font-weight: 700;">odoo</span></span>
|
||||
</div>
|
||||
<span>© 2026 Metatron EduPortal. All rights reserved.</span>
|
||||
<span>Powered by <a href="https://metatroncubesolutions.com/" style="color: #144d4d; font-weight: 700; text-decoration: none;">Metatroncube</a></span>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user