Mock 1
This commit is contained in:
parent
182e3dfe52
commit
3e74a9de32
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,3 +1,17 @@
|
||||
from django.contrib import admin
|
||||
from .models import MemberOfParliament, TradeDisclosure, Watchlist
|
||||
|
||||
# Register your models here.
|
||||
@admin.register(MemberOfParliament)
|
||||
class MemberOfParliamentAdmin(admin.ModelAdmin):
|
||||
list_display = ('name', 'party', 'constituency', 'province')
|
||||
search_fields = ('name', 'party', 'constituency')
|
||||
|
||||
@admin.register(TradeDisclosure)
|
||||
class TradeDisclosureAdmin(admin.ModelAdmin):
|
||||
list_display = ('mp', 'ticker', 'trade_type', 'amount_range', 'disclosure_date')
|
||||
list_filter = ('trade_type', 'disclosure_date', 'mp__party')
|
||||
search_fields = ('ticker', 'company_name', 'mp__name')
|
||||
|
||||
@admin.register(Watchlist)
|
||||
class WatchlistAdmin(admin.ModelAdmin):
|
||||
list_display = ('user', 'mp', 'ticker', 'created_at')
|
||||
54
core/migrations/0001_initial.py
Normal file
54
core/migrations/0001_initial.py
Normal file
@ -0,0 +1,54 @@
|
||||
# Generated by Django 5.2.7 on 2026-02-04 15:06
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='MemberOfParliament',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255)),
|
||||
('party', models.CharField(max_length=100)),
|
||||
('constituency', models.CharField(max_length=255)),
|
||||
('province', models.CharField(max_length=100)),
|
||||
('image_url', models.URLField(blank=True, null=True)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='TradeDisclosure',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('ticker', models.CharField(max_length=20)),
|
||||
('company_name', models.CharField(max_length=255)),
|
||||
('trade_type', models.CharField(choices=[('BUY', 'Buy'), ('SELL', 'Sell'), ('HOLD', 'Hold')], max_length=10)),
|
||||
('amount_range', models.CharField(max_length=100)),
|
||||
('disclosure_date', models.DateField()),
|
||||
('transaction_date', models.DateField(blank=True, null=True)),
|
||||
('mp', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='trades', to='core.memberofparliament')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Watchlist',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('ticker', models.CharField(blank=True, max_length=20, null=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('mp', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='core.memberofparliament')),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='watchlist', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
'unique_together': {('user', 'mp', 'ticker')},
|
||||
},
|
||||
),
|
||||
]
|
||||
BIN
core/migrations/__pycache__/0001_initial.cpython-311.pyc
Normal file
BIN
core/migrations/__pycache__/0001_initial.cpython-311.pyc
Normal file
Binary file not shown.
@ -1,3 +1,39 @@
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
# Create your models here.
|
||||
class MemberOfParliament(models.Model):
|
||||
name = models.CharField(max_length=255)
|
||||
party = models.CharField(max_length=100)
|
||||
constituency = models.CharField(max_length=255)
|
||||
province = models.CharField(max_length=100)
|
||||
image_url = models.URLField(blank=True, null=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
class TradeDisclosure(models.Model):
|
||||
TRADE_TYPES = (
|
||||
('BUY', 'Buy'),
|
||||
('SELL', 'Sell'),
|
||||
('HOLD', 'Hold'),
|
||||
)
|
||||
|
||||
mp = models.ForeignKey(MemberOfParliament, on_delete=models.CASCADE, related_name='trades')
|
||||
ticker = models.CharField(max_length=20)
|
||||
company_name = models.CharField(max_length=255)
|
||||
trade_type = models.CharField(max_length=10, choices=TRADE_TYPES)
|
||||
amount_range = models.CharField(max_length=100) # e.g. "$15,001 - $50,000"
|
||||
disclosure_date = models.DateField()
|
||||
transaction_date = models.DateField(null=True, blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.mp.name} - {self.ticker} ({self.trade_type})"
|
||||
|
||||
class Watchlist(models.Model):
|
||||
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='watchlist')
|
||||
mp = models.ForeignKey(MemberOfParliament, on_delete=models.CASCADE, blank=True, null=True)
|
||||
ticker = models.CharField(max_length=20, blank=True, null=True)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
class Meta:
|
||||
unique_together = ('user', 'mp', 'ticker')
|
||||
@ -1,25 +1,124 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}Knowledge Base{% endblock %}</title>
|
||||
{% if project_description %}
|
||||
<meta name="description" content="{{ project_description }}">
|
||||
<meta property="og:description" content="{{ project_description }}">
|
||||
<meta property="twitter:description" content="{{ project_description }}">
|
||||
{% endif %}
|
||||
{% if project_image_url %}
|
||||
<meta property="og:image" content="{{ project_image_url }}">
|
||||
<meta property="twitter:image" content="{{ project_image_url }}">
|
||||
{% endif %}
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}{{ project_name }}{% endblock %}</title>
|
||||
{% if project_description %}<meta name="description" content="{{ project_description }}">{% endif %}
|
||||
|
||||
<!-- Bootstrap 5 CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<!-- Google Fonts -->
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Lexend:wght@400;600;700&display=swap" rel="stylesheet">
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
|
||||
{% load static %}
|
||||
<link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
|
||||
<link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ current_time.timestamp }}">
|
||||
|
||||
<style>
|
||||
:root {
|
||||
--bg-dark: #0a0b0d;
|
||||
--card-bg: #1e2126;
|
||||
--accent-green: #00ffad;
|
||||
--accent-red: #ff4d4d;
|
||||
--text-main: #ffffff;
|
||||
--text-muted: #94a3b8;
|
||||
--border-color: #2d333b;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: var(--bg-dark);
|
||||
color: var(--text-main);
|
||||
font-family: 'Inter', sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, .navbar-brand {
|
||||
font-family: 'Lexend', sans-serif;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
background-color: rgba(10, 11, 13, 0.8);
|
||||
backdrop-filter: blur(10px);
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
padding: 1rem 2rem;
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
font-weight: 700;
|
||||
font-size: 1.5rem;
|
||||
color: var(--accent-green) !important;
|
||||
}
|
||||
|
||||
.nav-link {
|
||||
color: var(--text-muted) !important;
|
||||
font-weight: 500;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
.nav-link:hover, .nav-link.active {
|
||||
color: var(--text-main) !important;
|
||||
}
|
||||
|
||||
.btn-primary-custom {
|
||||
background-color: var(--accent-green);
|
||||
color: var(--bg-dark);
|
||||
font-weight: 600;
|
||||
border: none;
|
||||
padding: 0.5rem 1.5rem;
|
||||
border-radius: 8px;
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.btn-primary-custom:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 15px rgba(0, 255, 173, 0.3);
|
||||
background-color: #00e69b;
|
||||
}
|
||||
</style>
|
||||
{% block head %}{% endblock %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{% block content %}{% endblock %}
|
||||
</body>
|
||||
<nav class="navbar navbar-expand-lg sticky-top">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="/">
|
||||
<i class="fa-solid fa-chart-line me-2"></i>MP TRADE TRACKER
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav me-auto">
|
||||
<li class="nav-item"><a class="nav-link active" href="/">Dashboard</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="#">MPs</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="#">Tickers</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="/admin/">Admin</a></li>
|
||||
</ul>
|
||||
<div class="d-flex align-items-center">
|
||||
{% if user.is_authenticated %}
|
||||
<span class="text-muted me-3">Hello, {{ user.username }}</span>
|
||||
<a href="#" class="btn btn-outline-light btn-sm me-2">Logout</a>
|
||||
{% else %}
|
||||
<a href="#" class="nav-link me-3">Login</a>
|
||||
<a href="#" class="btn btn-primary-custom">Get Started</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
|
||||
<footer class="py-4 mt-5 border-top border-secondary">
|
||||
<div class="container text-center">
|
||||
<p class="text-muted small mb-0">© 2024 Canada MP Trade Tracker. For reconnaissance purposes only.</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,145 +1,190 @@
|
||||
{% extends "base.html" %}
|
||||
{% extends 'base.html' %}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}{{ project_name }}{% endblock %}
|
||||
|
||||
{% block head %}
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--bg-color-start: #6a11cb;
|
||||
--bg-color-end: #2575fc;
|
||||
--text-color: #ffffff;
|
||||
--card-bg-color: rgba(255, 255, 255, 0.01);
|
||||
--card-border-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Inter', sans-serif;
|
||||
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
||||
color: var(--text-color);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
body::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'><path d='M-10 10L110 10M10 -10L10 110' stroke-width='1' stroke='rgba(255,255,255,0.05)'/></svg>");
|
||||
animation: bg-pan 20s linear infinite;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
@keyframes bg-pan {
|
||||
0% {
|
||||
background-position: 0% 0%;
|
||||
}
|
||||
|
||||
100% {
|
||||
background-position: 100% 100%;
|
||||
}
|
||||
}
|
||||
|
||||
main {
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--card-bg-color);
|
||||
border: 1px solid var(--card-border-color);
|
||||
border-radius: 16px;
|
||||
padding: 2.5rem 2rem;
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: clamp(2.2rem, 3vw + 1.2rem, 3.2rem);
|
||||
font-weight: 700;
|
||||
margin: 0 0 1.2rem;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0.5rem 0;
|
||||
font-size: 1.1rem;
|
||||
opacity: 0.92;
|
||||
}
|
||||
|
||||
.loader {
|
||||
margin: 1.5rem auto;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
border: 4px solid rgba(255, 255, 255, 0.25);
|
||||
border-top-color: #fff;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.runtime code {
|
||||
background: rgba(0, 0, 0, 0.25);
|
||||
padding: 0.15rem 0.45rem;
|
||||
border-radius: 4px;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
}
|
||||
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
border: 0;
|
||||
}
|
||||
|
||||
footer {
|
||||
position: absolute;
|
||||
bottom: 1rem;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 0.85rem;
|
||||
opacity: 0.75;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
{% block title %}Dashboard | {{ project_name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<main>
|
||||
<div class="card">
|
||||
<h1>Analyzing your requirements and generating your app…</h1>
|
||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||
<span class="sr-only">Loading…</span>
|
||||
<div class="container py-5">
|
||||
<!-- Hero / Market Overview -->
|
||||
<div class="row mb-5">
|
||||
<div class="col-lg-8">
|
||||
<h1 class="display-5 fw-bold mb-3">Track Parliament's Portfolio</h1>
|
||||
<p class="lead text-muted">Real-time reconnaissance of investment disclosures by Canadian Members of Parliament. See what they know, when they know it.</p>
|
||||
</div>
|
||||
<p class="hint">AppWizzy AI is collecting your requirements and applying the first changes.</p>
|
||||
<p class="hint">This page will refresh automatically as the plan is implemented.</p>
|
||||
<p class="runtime">
|
||||
Runtime: Django <code>{{ django_version }}</code> · Python <code>{{ python_version }}</code>
|
||||
— UTC <code>{{ current_time|date:"Y-m-d H:i:s" }}</code>
|
||||
</p>
|
||||
<div class="col-lg-4 d-flex align-items-center justify-content-lg-end">
|
||||
<div class="stats-card p-4 rounded-4 w-100">
|
||||
<div class="d-flex justify-content-between mb-2">
|
||||
<span class="text-muted">Total Disclosures (30d)</span>
|
||||
<span class="text-success fw-bold">+12%</span>
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
Page updated: {{ current_time|date:"Y-m-d H:i:s" }} (UTC)
|
||||
</footer>
|
||||
<h2 class="mb-0">1,284</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row g-4">
|
||||
<!-- Live Trade Feed -->
|
||||
<div class="col-lg-8">
|
||||
<div class="card bg-card border-0 rounded-4 p-4">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h3 class="h5 mb-0">Live Disclosure Feed</h3>
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-dark btn-sm dropdown-toggle" type="button" data-bs-toggle="dropdown">
|
||||
All Parties
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-dark">
|
||||
<li><a class="dropdown-item" href="#">Liberal</a></li>
|
||||
<li><a class="dropdown-item" href="#">Conservative</a></li>
|
||||
<li><a class="dropdown-item" href="#">NDP</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-dark table-hover align-middle custom-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-muted fw-normal">MP</th>
|
||||
<th class="text-muted fw-normal">Ticker</th>
|
||||
<th class="text-muted fw-normal">Type</th>
|
||||
<th class="text-muted fw-normal">Amount</th>
|
||||
<th class="text-muted fw-normal">Date</th>
|
||||
<th class="text-end"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for trade in trades %}
|
||||
<tr>
|
||||
<td>
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="avatar me-3">{{ trade.mp.name|slice:":1" }}</div>
|
||||
<div>
|
||||
<div class="fw-bold">{{ trade.mp.name }}</div>
|
||||
<div class="small text-muted">{{ trade.mp.party }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="fw-bold">{{ trade.ticker }}</div>
|
||||
<div class="small text-muted">{{ trade.company_name }}</div>
|
||||
</td>
|
||||
<td>
|
||||
{% if trade.trade_type == 'BUY' %}
|
||||
<span class="badge bg-success-subtle text-success border border-success px-3 py-2">BUY</span>
|
||||
{% else %}
|
||||
<span class="badge bg-danger-subtle text-danger border border-danger px-3 py-2">SELL</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ trade.amount_range }}</td>
|
||||
<td>{{ trade.disclosure_date|date:"M d, Y" }}</td>
|
||||
<td class="text-end">
|
||||
<button class="btn btn-outline-light btn-sm rounded-pill px-3">Follow</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td colspan="6" class="text-center py-5 text-muted">No disclosures found yet.</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sidebar: Trending / Watchlist -->
|
||||
<div class="col-lg-4">
|
||||
<div class="card bg-card border-0 rounded-4 p-4 mb-4">
|
||||
<h3 class="h5 mb-4">Trending Assets</h3>
|
||||
<div class="list-group list-group-flush bg-transparent">
|
||||
<div class="list-group-item bg-transparent border-secondary border-opacity-25 px-0 py-3 d-flex justify-content-between align-items-center">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="ticker-icon bg-blue me-3">S</div>
|
||||
<div>
|
||||
<div class="fw-bold">SHOP</div>
|
||||
<div class="small text-muted">Shopify Inc.</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<div class="fw-bold">8 Trades</div>
|
||||
<div class="small text-success">+4.2%</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-group-item bg-transparent border-secondary border-opacity-25 px-0 py-3 d-flex justify-content-between align-items-center">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="ticker-icon bg-success me-3">T</div>
|
||||
<div>
|
||||
<div class="fw-bold">TD</div>
|
||||
<div class="small text-muted">TD Bank</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<div class="fw-bold">5 Trades</div>
|
||||
<div class="small text-danger">-1.5%</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-dark w-100 mt-3 rounded-3">View All Markets</button>
|
||||
</div>
|
||||
|
||||
<div class="card bg-primary-custom border-0 rounded-4 p-4 text-dark shadow-lg">
|
||||
<h3 class="h5 mb-3 fw-bold">Start Your Portfolio</h3>
|
||||
<p class="small mb-4 opacity-75">Connect your account to set alerts and follow specific MPs or tickers.</p>
|
||||
<button class="btn btn-dark w-100 rounded-3 fw-bold">Create Free Account</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.bg-card {
|
||||
background-color: var(--card-bg) !important;
|
||||
}
|
||||
.stats-card {
|
||||
background: linear-gradient(135deg, #1e2126 0%, #0a0b0d 100%);
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
.bg-primary-custom {
|
||||
background-color: var(--accent-green) !important;
|
||||
}
|
||||
.custom-table {
|
||||
border-collapse: separate;
|
||||
border-spacing: 0 10px;
|
||||
}
|
||||
.custom-table tr {
|
||||
background-color: rgba(255, 255, 255, 0.02);
|
||||
transition: background-color 0.2s ease;
|
||||
}
|
||||
.custom-table tr:hover {
|
||||
background-color: rgba(255, 255, 255, 0.05) !important;
|
||||
}
|
||||
.custom-table td, .custom-table th {
|
||||
border: none;
|
||||
padding: 1.25rem 1rem;
|
||||
}
|
||||
.avatar {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background-color: var(--border-color);
|
||||
color: var(--accent-green);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
font-weight: 700;
|
||||
font-family: 'Lexend', sans-serif;
|
||||
}
|
||||
.ticker-icon {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: 700;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
.bg-blue { background-color: #3b82f6; }
|
||||
.bg-success { background-color: #10b981; }
|
||||
</style>
|
||||
{% endblock %}
|
||||
@ -1,25 +1,48 @@
|
||||
import os
|
||||
import platform
|
||||
|
||||
from django import get_version as django_version
|
||||
from datetime import date, timedelta
|
||||
from django.shortcuts import render
|
||||
from django.utils import timezone
|
||||
|
||||
from .models import MemberOfParliament, TradeDisclosure
|
||||
|
||||
def home(request):
|
||||
"""Render the landing screen with loader and environment details."""
|
||||
host_name = request.get_host().lower()
|
||||
agent_brand = "AppWizzy" if host_name == "appwizzy.com" else "Flatlogic"
|
||||
now = timezone.now()
|
||||
"""Render the landing screen with MP trades and environment details."""
|
||||
|
||||
# Seed data if empty
|
||||
if not MemberOfParliament.objects.exists():
|
||||
mps = [
|
||||
{"name": "Justin Trudeau", "party": "Liberal", "constituency": "Papineau", "province": "Quebec"},
|
||||
{"name": "Pierre Poilievre", "party": "Conservative", "constituency": "Carleton", "province": "Ontario"},
|
||||
{"name": "Jagmeet Singh", "party": "NDP", "constituency": "Burnaby South", "province": "British Columbia"},
|
||||
{"name": "Chrystia Freeland", "party": "Liberal", "constituency": "University—Rosedale", "province": "Ontario"},
|
||||
]
|
||||
for mp_data in mps:
|
||||
MemberOfParliament.objects.get_or_create(**mp_data)
|
||||
|
||||
mp_jt = MemberOfParliament.objects.get(name="Justin Trudeau")
|
||||
mp_pp = MemberOfParliament.objects.get(name="Pierre Poilievre")
|
||||
|
||||
TradeDisclosure.objects.get_or_create(
|
||||
mp=mp_jt, ticker="AAPL", company_name="Apple Inc.",
|
||||
trade_type="BUY", amount_range="$15,001 - $50,000",
|
||||
disclosure_date=date.today() - timedelta(days=2)
|
||||
)
|
||||
TradeDisclosure.objects.get_or_create(
|
||||
mp=mp_pp, ticker="SHOP", company_name="Shopify Inc.",
|
||||
trade_type="SELL", amount_range="$50,001 - $100,000",
|
||||
disclosure_date=date.today() - timedelta(days=5)
|
||||
)
|
||||
TradeDisclosure.objects.get_or_create(
|
||||
mp=mp_jt, ticker="TSLA", company_name="Tesla, Inc.",
|
||||
trade_type="BUY", amount_range="$1,000 - $15,000",
|
||||
disclosure_date=date.today() - timedelta(days=10)
|
||||
)
|
||||
|
||||
trades = TradeDisclosure.objects.select_related('mp').order_by('-disclosure_date')[:10]
|
||||
|
||||
context = {
|
||||
"project_name": "New Style",
|
||||
"agent_brand": agent_brand,
|
||||
"django_version": django_version(),
|
||||
"python_version": platform.python_version(),
|
||||
"current_time": now,
|
||||
"host_name": host_name,
|
||||
"project_description": os.getenv("PROJECT_DESCRIPTION", ""),
|
||||
"project_image_url": os.getenv("PROJECT_IMAGE_URL", ""),
|
||||
"project_name": "Canada MP Trade Tracker",
|
||||
"trades": trades,
|
||||
"current_time": timezone.now(),
|
||||
}
|
||||
return render(request, "core/index.html", context)
|
||||
@ -1,4 +1,59 @@
|
||||
/* Custom styles for the application */
|
||||
body {
|
||||
font-family: system-ui, -apple-system, sans-serif;
|
||||
/* Dark Mode Finance Theme Overrides */
|
||||
|
||||
:root {
|
||||
--bg-dark: #0a0b0d;
|
||||
--card-bg: #1e2126;
|
||||
--accent-green: #00ffad;
|
||||
--accent-red: #ff4d4d;
|
||||
--text-main: #ffffff;
|
||||
--text-muted: #94a3b8;
|
||||
--border-color: #2d333b;
|
||||
}
|
||||
|
||||
/* Custom Scrollbar */
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: var(--bg-dark);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #2d333b;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #3d444d;
|
||||
}
|
||||
|
||||
/* Table Transitions */
|
||||
.table-hover tbody tr:hover {
|
||||
color: var(--text-main);
|
||||
}
|
||||
|
||||
.badge {
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.5px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
/* Glassmorphism utility */
|
||||
.glass {
|
||||
background: rgba(30, 33, 38, 0.7);
|
||||
backdrop-filter: blur(8px);
|
||||
-webkit-backdrop-filter: blur(8px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
/* Button polishing */
|
||||
.btn-outline-light {
|
||||
border-color: var(--border-color);
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.btn-outline-light:hover {
|
||||
background-color: var(--border-color);
|
||||
color: var(--text-main);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user