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
··· 93 93 {{ define "emails" }} 94 94 <h2 class="text-sm font-bold py-2 px-6 uppercase dark:text-gray-300">email addresses</h2> 95 95 <section class="rounded bg-white dark:bg-gray-800 drop-shadow-sm px-6 py-4 mb-6 w-full lg:w-fit"> 96 - <form 97 - hx-post="/settings/email/preference" 98 - hx-swap="none" 99 - hx-indicator="#email-preference-spinner" 100 - > 101 - <select 102 - name="preference" 103 - class="p-1 border border-gray-200 bg-white dark:bg-gray-700 dark:text-white dark:border-gray-600" 104 - > 105 - <option value="enable" {{ if .EmailNotifPreference.IsEnabled }}selected{{ end }}>Enable Email Notifications</option> 106 - <option value="mention" {{ if .EmailNotifPreference.IsMention }}selected{{ end }}>Only on Mentions</option> 107 - <option value="disable" {{ if .EmailNotifPreference.IsDisabled }}selected{{ end }}>Disable Email Notifications</option> 108 - </select> 109 - <button type="submit" class="btn text-base"> 110 - <span>Save Preference</span> 111 - <span id="email-preference-spinner" class="group"> 112 - {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 113 - </span> 114 - </button> 115 - </form> 116 96 <p class="mb-8 dark:text-gray-300">Commits authored using emails listed here will be associated with your Tangled profile.</p> 117 97 <div id="email-list" class="flex flex-col gap-6 mb-8"> 118 98 {{ 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
··· 11 11 </div> 12 12 <div class="col-span-1 md:col-span-3 flex flex-col gap-6"> 13 13 {{ template "emailSettings" . }} 14 + {{ template "emailList" . }} 14 15 </div> 15 16 </section> 16 17 </div> 17 18 {{ end }} 18 19 19 20 {{ define "emailSettings" }} 21 + <form 22 + hx-post="/settings/email/preference" 23 + hx-swap="none" 24 + hx-indicator="#email-preference-spinner" 25 + class="grid grid-cols-1 md:grid-cols-3 gap-4" 26 + > 27 + <div class="col-span-1 md:col-span-2"> 28 + <h2 class="text-sm pb-2 uppercase font-bold">Email Notifications</h2> 29 + </div> 30 + <select 31 + name="preference" 32 + class="p-1 border border-gray-200 bg-white dark:bg-gray-700 dark:text-white dark:border-gray-600" 33 + > 34 + <option value="enable" {{ if .NotifPreference.IsEnabled }}selected{{ end }}>Enable</option> 35 + <option value="mention" {{ if .NotifPreference.IsMention }}selected{{ end }}>Only on Mentions</option> 36 + <option value="disable" {{ if .NotifPreference.IsDisabled }}selected{{ end }}>Disable</option> 37 + </select> 38 + <div class="md:col-start-2 col-span-2 flex justify-end"> 39 + <button type="submit" class="btn text-base"> 40 + <span>Save Preference</span> 41 + <span id="email-preference-spinner" class="group"> 42 + {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 43 + </span> 44 + </button> 45 + </div> 46 + </form> 47 + {{ end }} 48 + 49 + {{ define "emailList" }} 20 50 <div class="grid grid-cols-1 md:grid-cols-3 gap-4 items-center"> 21 51 <div class="col-span-1 md:col-span-2"> 22 52 <h2 class="text-sm pb-2 uppercase font-bold">Email Addresses</h2> ··· 91 121 <div id="settings-emails-error" class="text-red-500 dark:text-red-400"></div> 92 122 <div id="settings-emails-success" class="text-green-500 dark:text-green-400"></div> 93 123 </form> 94 - {{ end }} 124 + {{ end }}