first commit

This commit is contained in:
2026-01-16 22:20:18 +03:00
commit 5d437e5e28
56 changed files with 4463 additions and 0 deletions

View File

@@ -0,0 +1,199 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}Bitcoin Monitor{% endblock %}</title>
<style>
/* Gruvbox color scheme matching dashboard */
:root {
--bg-primary: #282828;
--bg-secondary: #3c3836;
--bg-tertiary: #504945;
--text-primary: #ebdbb2;
--text-secondary: #d5c4a1;
--accent-red: #cc241d;
--accent-yellow: #d79921;
--accent-blue: #458588;
--accent-green: #98971a;
--accent-purple: #b16286;
}
body {
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace, Arial, sans-serif;
line-height: 1.6;
color: #333333;
max-width: 600px;
margin: 0 auto;
padding: 20px;
background: #f5f5f5;
}
.email-container {
background: white;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.email-header {
background: var(--bg-primary);
color: var(--text-primary);
padding: 25px;
text-align: center;
}
.email-header h1 {
margin: 0;
font-size: 24px;
font-weight: bold;
}
.email-header .subtitle {
color: var(--text-secondary);
margin-top: 8px;
font-size: 14px;
}
.email-body {
padding: 25px;
}
.alert-banner {
padding: 15px;
border-radius: 8px;
margin-bottom: 25px;
font-weight: bold;
text-align: center;
}
.alert-dip { background: #f8d7da; color: #721c24; border-left: 5px solid var(--accent-red); }
.alert-peak { background: #fff3cd; color: #856404; border-left: 5px solid var(--accent-yellow); }
.alert-system { background: #cce5ff; color: #004085; border-left: 5px solid var(--accent-blue); }
.alert-digest { background: #d4edda; color: #155724; border-left: 5px solid var(--accent-green); }
.metric-card {
background: #f8f9fa;
border-radius: 8px;
padding: 20px;
margin-bottom: 20px;
border-left: 4px solid var(--accent-purple);
}
.metric-value {
font-size: 28px;
font-weight: bold;
color: var(--accent-purple);
margin: 10px 0;
}
.metric-label {
color: #6c757d;
font-size: 14px;
text-transform: uppercase;
letter-spacing: 1px;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 15px;
margin: 25px 0;
}
.stat-item {
text-align: center;
padding: 15px;
background: #e9ecef;
border-radius: 6px;
}
.stat-value {
font-size: 20px;
font-weight: bold;
color: var(--bg-primary);
}
.stat-label {
font-size: 12px;
color: #6c757d;
margin-top: 5px;
}
.action-button {
display: inline-block;
background: var(--accent-blue);
color: white;
padding: 12px 24px;
text-decoration: none;
border-radius: 6px;
font-weight: bold;
margin: 15px 0;
}
.recommendation {
background: #e8f4fd;
border-left: 4px solid var(--accent-blue);
padding: 15px;
margin: 20px 0;
border-radius: 0 6px 6px 0;
}
.footer {
background: var(--bg-secondary);
color: var(--text-secondary);
padding: 20px;
text-align: center;
font-size: 12px;
line-height: 1.5;
}
.footer a {
color: var(--accent-purple);
text-decoration: none;
}
.unsubscribe-link {
color: #6c757d !important;
font-size: 11px;
margin-top: 10px;
display: inline-block;
}
@media (max-width: 600px) {
body { padding: 10px; }
.email-body { padding: 15px; }
.stats-grid { grid-template-columns: 1fr; }
.metric-value { font-size: 24px; }
}
</style>
</head>
<body>
<div class="email-container">
<div class="email-header">
<h1>₿ Bitcoin Monitor</h1>
<div class="subtitle">Real-time Bitcoin Price Monitoring</div>
</div>
<div class="email-body">
{% block content %}{% endblock %}
</div>
<div class="footer">
<p>This email was sent by Bitcoin Monitor System.</p>
<p>
<a href="{{ dashboard_url }}">View Dashboard</a> |
<a href="{{ admin_url }}">Admin Panel</a>
</p>
<p>
<a href="{{ unsubscribe_url }}" class="unsubscribe-link">
Unsubscribe or manage preferences
</a>
</p>
<p style="margin-top: 15px; color: #999; font-size: 11px;">
Bitcoin Monitor &copy; {% now "Y" %} • Automated notifications
</p>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,100 @@
{% extends "emails/base.html" %}
{% block title %}Daily Digest - Bitcoin Monitor{% endblock %}
{% block content %}
<div class="alert-banner alert-digest">
📊 DAILY DIGEST: {{ date|date:"F d, Y" }}
</div>
<div style="text-align: center; margin-bottom: 30px;">
<h2 style="color: #343a40; margin-bottom: 5px;">24-Hour Summary</h2>
<p style="color: #6c757d; margin-top: 0;">{{ summary_period }}</p>
</div>
<div class="metric-card">
<div class="metric-label">Market Status</div>
<div class="metric-value" style="color:
{% if market_status == 'dip' %}#dc3545
{% elif market_status == 'peak' %}#ffc107
{% else %}#28a745{% endif %};">
{{ market_status|upper }}
</div>
<div style="color: #6c757d; font-size: 14px;">
{% if market_status == 'dip' %}Price below yearly average
{% elif market_status == 'peak' %}Price above yearly average
{% else %}Price within normal range{% endif %}
</div>
</div>
<div class="stats-grid">
<div class="stat-item">
<div class="stat-value">${{ current_price|floatformat:2 }}</div>
<div class="stat-label">Current Price</div>
</div>
<div class="stat-item">
<div class="stat-value">${{ daily_high|floatformat:2 }}</div>
<div class="stat-label">24h High</div>
</div>
<div class="stat-item">
<div class="stat-value">${{ daily_low|floatformat:2 }}</div>
<div class="stat-label">24h Low</div>
</div>
<div class="stat-item">
<div class="stat-value">{{ daily_change|floatformat:1 }}%</div>
<div class="stat-label">24h Change</div>
</div>
</div>
<div style="margin: 30px 0;">
<h3 style="color: #343a40; margin-bottom: 15px;">📈 Market Activity</h3>
<div style="background: #f8f9fa; padding: 15px; border-radius: 6px; margin-bottom: 15px;">
<div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
<span style="color: #6c757d;">Events Today:</span>
<span style="font-weight: bold;">{{ events_count }}</span>
</div>
<div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
<span style="color: #6c757d;">Price Fetches:</span>
<span style="font-weight: bold;">{{ price_fetches }}</span>
</div>
<div style="display: flex; justify-content: space-between;">
<span style="color: #6c757d;">System Uptime:</span>
<span style="font-weight: bold;">{{ uptime_percentage|floatformat:1 }}%</span>
</div>
</div>
{% if events_today %}
<div style="background: #e8f4fd; padding: 15px; border-radius: 6px; margin-top: 15px;">
<h4 style="margin-top: 0; color: #004085;">⚠️ Events Today</h4>
<ul style="margin-bottom: 0; padding-left: 20px;">
{% for event in events_today %}
<li>
<strong>{{ event.type|title }}</strong> at
${{ event.price|floatformat:2 }} ({{ event.time|time:"H:i" }})
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
{% if market_insight %}
<div class="recommendation">
<h4 style="margin-top: 0; color: #004085;">📋 Market Insight</h4>
<p style="margin-bottom: 0;">{{ market_insight }}</p>
</div>
{% endif %}
<div style="margin-top: 30px; padding: 15px; background: #f8f9fa; border-radius: 8px; text-align: center;">
<p style="margin: 0; color: #6c757d;">
Next digest: Tomorrow at 08:00 UTC
</p>
</div>
<div style="text-align: center; margin: 30px 0;">
<a href="{{ dashboard_url }}" class="action-button">
View Full Dashboard
</a>
</div>
{% endblock %}

View File

@@ -0,0 +1,83 @@
{% extends "emails/base.html" %}
{% block title %}{{ alert_type }} Alert - Bitcoin Monitor{% endblock %}
{% block content %}
<div class="alert-banner alert-{{ alert_type }}">
{% if alert_type == 'dip' %}
🚨 DIP DETECTED: Price is {{ percent_change|floatformat:1 }}% below average
{% elif alert_type == 'peak' %}
⚡ PEAK DETECTED: Price is {{ percent_change|floatformat:1 }}% above average
{% else %}
MARKET EVENT DETECTED
{% endif %}
</div>
<div class="metric-card">
<div class="metric-label">Current Bitcoin Price</div>
<div class="metric-value">${{ current_price|floatformat:2 }}</div>
<div style="color: #6c757d; font-size: 14px;">
{% if alert_type == 'dip' %}📉 Below threshold{% else %}📈 Above threshold{% endif %}
</div>
</div>
<div class="stats-grid">
<div class="stat-item">
<div class="stat-value">{{ threshold_percent }}%</div>
<div class="stat-label">Threshold</div>
</div>
<div class="stat-item">
<div class="stat-value">${{ yearly_average|floatformat:2 }}</div>
<div class="stat-label">Yearly Average</div>
</div>
<div class="stat-item">
<div class="stat-value">${{ lower_threshold|floatformat:2 }}</div>
<div class="stat-label">Lower Bound</div>
</div>
<div class="stat-item">
<div class="stat-value">${{ upper_threshold|floatformat:2 }}</div>
<div class="stat-label">Upper Bound</div>
</div>
</div>
<div style="margin: 25px 0; padding: 20px; background: #f8f9fa; border-radius: 8px;">
<h3 style="margin-top: 0; color: #343a40;">Event Details</h3>
<table style="width: 100%; border-collapse: collapse;">
<tr>
<td style="padding: 8px 0; border-bottom: 1px solid #dee2e6; color: #6c757d;">Event Type:</td>
<td style="padding: 8px 0; border-bottom: 1px solid #dee2e6; font-weight: bold; text-align: right;">
{{ alert_type|upper }}
</td>
</tr>
<tr>
<td style="padding: 8px 0; border-bottom: 1px solid #dee2e6; color: #6c757d;">Detected At:</td>
<td style="padding: 8px 0; border-bottom: 1px solid #dee2e6; text-align: right;">
{{ detected_at|date:"M d, Y H:i" }} UTC
</td>
</tr>
<tr>
<td style="padding: 8px 0; border-bottom: 1px solid #dee2e6; color: #6c757d;">Price Deviation:</td>
<td style="padding: 8px 0; border-bottom: 1px solid #dee2e6; text-align: right; font-weight: bold;">
{{ percent_change|floatformat:1 }}%
</td>
</tr>
<tr>
<td style="padding: 8px 0; color: #6c757d;">Previous Status:</td>
<td style="padding: 8px 0; text-align: right;">{{ previous_status|default:"N/A"|title }}</td>
</tr>
</table>
</div>
{% if recommendation %}
<div class="recommendation">
<h4 style="margin-top: 0; color: #004085;">💡 Recommendation</h4>
<p style="margin-bottom: 0;">{{ recommendation }}</p>
</div>
{% endif %}
<div style="text-align: center; margin: 30px 0;">
<a href="{{ dashboard_url }}" class="action-button">
View Live Dashboard
</a>
</div>
{% endblock %}

View File

@@ -0,0 +1,52 @@
{% extends "emails/base.html" %}
{% block title %}System Alert - Bitcoin Monitor{% endblock %}
{% block content %}
<div class="alert-banner alert-system">
⚠️ SYSTEM ALERT: {{ alert_title }}
</div>
<div style="margin: 25px 0;">
<h3 style="color: #343a40; margin-top: 0;">Issue Details</h3>
<div style="background: #f8f9fa; padding: 15px; border-radius: 6px; border-left: 4px solid #dc3545;">
<p style="margin: 0; white-space: pre-wrap; font-family: monospace; font-size: 13px;">
{{ alert_message }}
</p>
</div>
</div>
<div class="stats-grid">
<div class="stat-item">
<div class="stat-value">{{ affected_component }}</div>
<div class="stat-label">Affected Component</div>
</div>
<div class="stat-item">
<div class="stat-value">{{ severity|upper }}</div>
<div class="stat-label">Severity</div>
</div>
<div class="stat-item">
<div class="stat-value">{{ occurred_at|date:"H:i" }}</div>
<div class="stat-label">Time (UTC)</div>
</div>
<div class="stat-item">
<div class="stat-value">{{ error_code|default:"N/A" }}</div>
<div class="stat-label">Error Code</div>
</div>
</div>
<div style="margin: 25px 0; padding: 20px; background: #fff3cd; border-radius: 8px; border-left: 4px solid #ffc107;">
<h4 style="margin-top: 0; color: #856404;">🛠️ Troubleshooting Steps</h4>
<ul style="margin-bottom: 0; padding-left: 20px;">
{% for step in troubleshooting_steps %}
<li>{{ step }}</li>
{% endfor %}
</ul>
</div>
<div style="text-align: center; margin: 30px 0;">
<a href="{{ admin_url }}" class="action-button" style="background: #6c757d;">
Go to Admin Panel
</a>
</div>
{% endblock %}