05/24 Enhance functionalities 2
This commit is contained in:
@@ -20,6 +20,18 @@
|
||||
<div class="kpi-value">{{ stats.total_sites }}</div>
|
||||
<div class="kpi-label">Total Sites</div>
|
||||
</div>
|
||||
<div class="kpi-card {{ 'kpi-warning' if stats.open_bids else '' }}">
|
||||
<div class="kpi-value">{{ stats.open_bids }}</div>
|
||||
<div class="kpi-label">Open Bids</div>
|
||||
</div>
|
||||
<div class="kpi-card {{ 'kpi-danger' if stats.bids_due_soon else '' }}">
|
||||
<div class="kpi-value">{{ stats.bids_due_soon }}</div>
|
||||
<div class="kpi-label">Due This Week</div>
|
||||
</div>
|
||||
<div class="kpi-card">
|
||||
<div class="kpi-value">{{ stats.ai_analyses_30d }}</div>
|
||||
<div class="kpi-label">AI Analyses (30d)</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Missed shifts alert -->
|
||||
|
||||
@@ -42,6 +42,12 @@
|
||||
<label class="form-label">SMTP Password</label>
|
||||
<input class="form-control" type="password" name="email_smtp_password" placeholder="(unchanged)">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">From Address</label>
|
||||
<input class="form-control" type="email" name="email_smtp_from"
|
||||
value="{{ email.get('email.smtp_from','') }}"
|
||||
placeholder="noreply@yourdomain.com">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Recipients (comma-separated)</label>
|
||||
<input class="form-control" name="email_recipients" value="{{ email.get('email.recipients','') }}">
|
||||
|
||||
@@ -3,7 +3,18 @@
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<h1 class="page-title">Website Link Management</h1>
|
||||
<button class="btn btn-primary" onclick="openModal('modal-create-site')">+ Add Website</button>
|
||||
<div style="display:flex;gap:.5rem;align-items:center">
|
||||
<div class="search-wrap" style="max-width:220px">
|
||||
<span class="search-icon">🔍</span>
|
||||
<input type="text" id="site-search" placeholder="Search name or URL…" autocomplete="off">
|
||||
</div>
|
||||
<select id="site-type-filter" class="form-control" style="width:auto">
|
||||
<option value="">All types</option>
|
||||
<option value="daily">Daily</option>
|
||||
<option value="weekly">Weekly</option>
|
||||
</select>
|
||||
<button class="btn btn-primary" onclick="openModal('modal-create-site')">+ Add Website</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
@@ -13,7 +24,9 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for w in websites %}
|
||||
<tr class="{{ 'row-weekly' if w.check_type == 'weekly' else '' }}">
|
||||
<tr class="{{ 'row-weekly' if w.check_type == 'weekly' else '' }} site-row"
|
||||
data-name="{{ w.name | lower }}" data-url="{{ w.url | lower }}"
|
||||
data-type="{{ w.check_type }}">
|
||||
<td>{{ w.id }}</td>
|
||||
<td><strong>{{ w.name }}</strong></td>
|
||||
<td><span class="badge badge-{{ 'warn' if w.check_type == 'weekly' else 'neutral' }}">{{ w.check_type }}</span></td>
|
||||
@@ -172,5 +185,21 @@ function addCredRow(btn) {
|
||||
}
|
||||
function removeRow(btn) { btn.closest('.cred-row').remove(); }
|
||||
function esc(s) { return (s||'').replace(/&/g,'&').replace(/"/g,'"').replace(/</g,'<'); }
|
||||
|
||||
(function() {
|
||||
var searchEl = document.getElementById('site-search');
|
||||
var typeEl = document.getElementById('site-type-filter');
|
||||
function filterSites() {
|
||||
var q = searchEl.value.trim().toLowerCase();
|
||||
var type = typeEl.value;
|
||||
document.querySelectorAll('.site-row').forEach(function(row) {
|
||||
var nameMatch = !q || row.dataset.name.includes(q) || row.dataset.url.includes(q);
|
||||
var typeMatch = !type || row.dataset.type === type;
|
||||
row.style.display = (nameMatch && typeMatch) ? '' : 'none';
|
||||
});
|
||||
}
|
||||
searchEl.addEventListener('input', filterSites);
|
||||
typeEl.addEventListener('change', filterSites);
|
||||
})();
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
<div class="user-name">{{ current_user.full_name or current_user.username }}</div>
|
||||
<div class="user-role">{{ current_user.role | capitalize }}</div>
|
||||
</div>
|
||||
<a href="{{ url_for('auth.profile') }}" class="sidebar-btn btn-ghost">👤 My Profile</a>
|
||||
<a href="{{ url_for('auth.change_password_view') }}" class="sidebar-btn btn-ghost">🔑 Change Password</a>
|
||||
<a href="{{ url_for('auth.logout') }}" class="sidebar-btn btn-danger">⇠ Sign Out</a>
|
||||
{% endif %}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}My Profile — Website Checker{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<h1 class="page-title">My Profile</h1>
|
||||
</div>
|
||||
|
||||
<div style="max-width:480px">
|
||||
<div class="card">
|
||||
<div class="card-header"><span class="card-title">Account Details</span></div>
|
||||
<form method="post" action="{{ url_for('auth.profile') }}">
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Username</label>
|
||||
<input class="form-control" value="{{ session['user']['username'] }}" disabled>
|
||||
<small class="text-muted">Username cannot be changed. Contact an admin if needed.</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Full Name</label>
|
||||
<input class="form-control" name="full_name"
|
||||
value="{{ session['user']['full_name'] or '' }}"
|
||||
placeholder="Your full name">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Email Address</label>
|
||||
<input class="form-control" type="email" name="email"
|
||||
value="{{ session['user']['email'] or '' }}"
|
||||
placeholder="your@email.com">
|
||||
<small class="text-muted">Used for password resets and notifications.</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="{{ url_for('auth.change_password_view') }}" class="btn btn-ghost">🔑 Change Password</a>
|
||||
<button type="submit" class="btn btn-primary">Save Changes</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user