back interdiff of round #6 and #5

appview: introduce email notifications for @ mentions on issue/pr comments #393

closed
opened by boltless.me targeting master from boltless.me/core: feat/mentions

Stacked on top of #392

Yes, I know we have stacked PRs, but I want to explicitly separate two sets of commits and review both on different places

This is MVC implementation of email notification.

Still lot of parts are missing, but this is a PR with most basic features.

files
appview
ERROR
appview/pages/markup/markdown.go

Failed to calculate interdiff for this file.

ERROR
appview/pages/markup/markdown_at_extension.go

Failed to calculate interdiff for this file.

ERROR
appview/issues/issues.go

Failed to calculate interdiff for this file.

ERROR
appview/email/email.go

Failed to calculate interdiff for this file.

ERROR
appview/signup/signup.go

Failed to calculate interdiff for this file.

REBASED
appview/state/state.go

This patch was likely rebased, as context lines do not match.

ERROR
appview/db/db.go

Failed to calculate interdiff for this file.

ERROR
appview/db/email.go

Failed to calculate interdiff for this file.

REBASED
appview/db/profile.go

This patch was likely rebased, as context lines do not match.

ERROR
appview/pages/pages.go

Failed to calculate interdiff for this file.

REVERTED
appview/pages/templates/settings.html
···
{{ define "emails" }}
<h2 class="text-sm font-bold py-2 px-6 uppercase dark:text-gray-300">email addresses</h2>
<section class="rounded bg-white dark:bg-gray-800 drop-shadow-sm px-6 py-4 mb-6 w-full lg:w-fit">
-
<form
-
hx-post="/settings/email/preference"
-
hx-swap="none"
-
hx-indicator="#email-preference-spinner"
-
>
-
<select
-
name="preference"
-
class="p-1 border border-gray-200 bg-white dark:bg-gray-700 dark:text-white dark:border-gray-600"
-
>
-
<option value="enable" {{ if .EmailNotifPreference.IsEnabled }}selected{{ end }}>Enable Email Notifications</option>
-
<option value="mention" {{ if .EmailNotifPreference.IsMention }}selected{{ end }}>Only on Mentions</option>
-
<option value="disable" {{ if .EmailNotifPreference.IsDisabled }}selected{{ end }}>Disable Email Notifications</option>
-
</select>
-
<button type="submit" class="btn text-base">
-
<span>Save Preference</span>
-
<span id="email-preference-spinner" class="group">
-
{{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }}
-
</span>
-
</button>
-
</form>
<p class="mb-8 dark:text-gray-300">Commits authored using emails listed here will be associated with your Tangled profile.</p>
<div id="email-list" class="flex flex-col gap-6 mb-8">
{{ range $index, $email := .Emails }}
ERROR
appview/email/notifier.go

Failed to calculate interdiff for this file.

REBASED
appview/pulls/pulls.go

This patch was likely rebased, as context lines do not match.

NEW
appview/pages/templates/user/settings/emails.html
···
</div>
<div class="col-span-1 md:col-span-3 flex flex-col gap-6">
{{ template "emailSettings" . }}
+
{{ template "emailList" . }}
</div>
</section>
</div>
{{ end }}
{{ define "emailSettings" }}
+
<form
+
hx-post="/settings/email/preference"
+
hx-swap="none"
+
hx-indicator="#email-preference-spinner"
+
class="grid grid-cols-1 md:grid-cols-3 gap-4"
+
>
+
<div class="col-span-1 md:col-span-2">
+
<h2 class="text-sm pb-2 uppercase font-bold">Email Notifications</h2>
+
</div>
+
<select
+
name="preference"
+
class="p-1 border border-gray-200 bg-white dark:bg-gray-700 dark:text-white dark:border-gray-600"
+
>
+
<option value="enable" {{ if .NotifPreference.IsEnabled }}selected{{ end }}>Enable</option>
+
<option value="mention" {{ if .NotifPreference.IsMention }}selected{{ end }}>Only on Mentions</option>
+
<option value="disable" {{ if .NotifPreference.IsDisabled }}selected{{ end }}>Disable</option>
+
</select>
+
<div class="md:col-start-2 col-span-2 flex justify-end">
+
<button type="submit" class="btn text-base">
+
<span>Save Preference</span>
+
<span id="email-preference-spinner" class="group">
+
{{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }}
+
</span>
+
</button>
+
</div>
+
</form>
+
{{ end }}
+
+
{{ define "emailList" }}
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 items-center">
<div class="col-span-1 md:col-span-2">
<h2 class="text-sm pb-2 uppercase font-bold">Email Addresses</h2>
···
<div id="settings-emails-error" class="text-red-500 dark:text-red-400"></div>
<div id="settings-emails-success" class="text-green-500 dark:text-green-400"></div>
</form>
-
{{ end }}
+
{{ end }}