feat: move Notifications to its own settings sub-page
Adds GET /settings/notifications (dedicated page with channel form + two test buttons) and updates POST /settings/notifications to render that page. Settings page now shows a compact link card instead of the full form. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -264,6 +264,7 @@
|
||||
<a href="{{ back_href }}" class="nav-link">← Chat</a>
|
||||
<a href="{{ help_href }}" class="nav-link">Help</a>
|
||||
<a href="/settings" class="nav-link active">Settings</a>
|
||||
<a href="/settings/notifications" class="nav-link">Notifications</a>
|
||||
<span class="nav-spacer"></span>
|
||||
<a href="/logout" class="nav-link nav-logout">Sign out</a>
|
||||
</nav>
|
||||
@@ -348,50 +349,14 @@
|
||||
<div class="section">
|
||||
<h2>Notifications</h2>
|
||||
<p style="font-size:0.8rem; color:var(--pg-muted); margin-bottom:0.85rem; line-height:1.55;">
|
||||
Choose how Inara reaches out proactively — cron jobs, briefs, and future alerts.
|
||||
Email defaults to your login address when no override is set.
|
||||
Configure how Inara reaches out proactively — reminders, cron jobs, and memory digests.
|
||||
</p>
|
||||
<form method="POST" action="/settings/notifications">
|
||||
<div class="field">
|
||||
<label for="notification_channel">Notification channel</label>
|
||||
<select id="notification_channel" name="notification_channel"
|
||||
data-value="{{ notify_channel }}"
|
||||
style="width:100%; padding:0.65rem 0.85rem; background:var(--pg-bg);
|
||||
border:1px solid var(--pg-border); border-radius:6px;
|
||||
color:var(--pg-text); font-size:0.95rem; outline:none;
|
||||
transition:border-color 0.15s;">
|
||||
<option value="">None (disabled)</option>
|
||||
<option value="web_push">Browser Push Notification</option>
|
||||
<option value="email">Email</option>
|
||||
<option value="nextcloud">Nextcloud Talk</option>
|
||||
<option value="google_chat">Google Chat</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="notification_email">Email override
|
||||
<span style="color:var(--pg-dim); font-weight:400;">(optional)</span>
|
||||
</label>
|
||||
<input type="email" id="notification_email" name="notification_email"
|
||||
value="{{ notify_email_override }}"
|
||||
placeholder="Leave blank to use login email"
|
||||
autocomplete="off">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="nc_notification_room">Nextcloud Talk room token</label>
|
||||
<input type="text" id="nc_notification_room" name="nc_notification_room"
|
||||
value="{{ nc_notify_room }}"
|
||||
placeholder="Token from the Talk room URL"
|
||||
autocomplete="off" spellcheck="false">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="gc_outbound_webhook">Google Chat webhook URL</label>
|
||||
<input type="url" id="gc_outbound_webhook" name="gc_outbound_webhook"
|
||||
value="{{ gc_webhook }}"
|
||||
placeholder="https://chat.googleapis.com/v1/spaces/…"
|
||||
autocomplete="off" spellcheck="false">
|
||||
</div>
|
||||
<button type="submit">Save notification settings</button>
|
||||
</form>
|
||||
<a href="/settings/notifications"
|
||||
style="display:inline-block; padding:0.55rem 1rem; background:#7c3aed; border-radius:6px;
|
||||
color:#fff; font-size:0.88rem; font-weight:600; text-decoration:none;
|
||||
transition:background 0.15s;">
|
||||
Notification settings →
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Tool Permissions -->
|
||||
@@ -537,12 +502,6 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Restore notification channel dropdown from injected value
|
||||
(function() {
|
||||
const sel = document.getElementById('notification_channel');
|
||||
if (sel) sel.value = sel.dataset.value || '';
|
||||
})();
|
||||
|
||||
// Password confirmation check
|
||||
document.getElementById('password-form').addEventListener('submit', e => {
|
||||
const np = document.getElementById('new_password').value;
|
||||
|
||||
Reference in New Issue
Block a user