Skip to content

Commit e3980d1

Browse files
feat(web): ui stuff
1 parent afcfcd7 commit e3980d1

16 files changed

+199
-25
lines changed

web/components/help_dialog.templ

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package components
2+
3+
import "github.com/ItsNotGoodName/smtpbridge/web/icons"
4+
5+
type HelpDialogProps struct {
6+
ID string
7+
Size string
8+
}
9+
10+
func (h HelpDialogProps) ShowModal() templ.ComponentScript {
11+
return templ.ComponentScript{Call: h.ID + ".showModal()"}
12+
}
13+
14+
templ HelpDialog(props HelpDialogProps) {
15+
<button onClick={ props.ShowModal() } class="hover:bg-base-200 rounded-full p-1">
16+
@icons.QuestionMark(props.Size)
17+
</button>
18+
<dialog id={ props.ID } class="modal">
19+
<div class="modal-box">
20+
<h3 class="font-bold text-lg">Help</h3>
21+
{ children... }
22+
</div>
23+
<form method="dialog" class="modal-backdrop" hx-disable>
24+
<button>close</button>
25+
</form>
26+
</dialog>
27+
}
28+

web/components/help_dialog_templ.go

+100
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/icons/icons.templ

+5
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,8 @@ templ Alert(class any) {
122122
templ Filter(class any) {
123123
<svg class={ class, "fill-current" } xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 18H14V16H10V18ZM3 6V8H21V6H3ZM6 13H18V11H6V13Z"></path></svg>
124124
}
125+
126+
// https://remixicon.com/icon/question-mark
127+
templ QuestionMark(class any) {
128+
<svg class={ class, "fill-current" } xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 19C12.8284 19 13.5 19.6716 13.5 20.5C13.5 21.3284 12.8284 22 12 22C11.1716 22 10.5 21.3284 10.5 20.5C10.5 19.6716 11.1716 19 12 19ZM12 2C15.3137 2 18 4.68629 18 8C18 10.1646 17.2474 11.2907 15.3259 12.9231C13.3986 14.5604 13 15.2969 13 17H11C11 14.526 11.787 13.3052 14.031 11.3989C15.5479 10.1102 16 9.43374 16 8C16 5.79086 14.2091 4 12 4C9.79086 4 8 5.79086 8 8V9H6V8C6 4.68629 8.68629 2 12 2Z"></path></svg>
129+
}

web/icons/icons_templ.go

+39
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/pages/attachment.templ

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ templ attachmentListView(m meta.Meta, props attachmentListViewProps) {
2626
</div>
2727
<div class="flex flex-col gap-4 p-4">
2828
<div class="join flex items-center justify-end" data-loading-states>
29-
<button title="Delete Orphans" class="btn-sm btn btn-info join-item" hx-post={ routes.AttachmentTrim().URLQueryString(helpers.Query(props.Query)) } data-loading-disable>
29+
<button title="Remove Orphan Attachments" class="btn-sm btn btn-info join-item" hx-post={ routes.AttachmentTrim().URLQueryString(helpers.Query(props.Query)) } data-loading-disable>
3030
<span data-loading-class="loading loading-spinner loading-sm">
3131
@icons.Recycle("w-5 h-5")
3232
</span>

web/pages/attachment_templ.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/pages/endpoint.templ

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ templ endpointListView(m meta.Meta, props endpointListViewProps) {
2323
</div>
2424
<div class="flex flex-col gap-4 p-4">
2525
<div class="join flex items-center justify-end">
26-
<a title="Add" class="btn btn-sm btn-success" href={ routes.EndpointCreate().URL() }>
26+
<a title="Create Endpoint" class="btn btn-sm btn-success" href={ routes.EndpointCreate().URL() }>
2727
@icons.Add("w-5 h-5")
2828
</a>
2929
</div>

web/pages/endpoint_templ.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/pages/envelope.templ

+5-5
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ templ envelopeListView(m meta.Meta, props envelopeListViewProps) {
112112
<label class="label cursor-pointer">
113113
<span class="label-text">Subject</span>
114114
<input type="hidden" value="0" name="-search-subject" />
115-
<input name="search-subject" type="checkbox" class="checkbox" checked?={ props.EnvelopeRequestRequest.SearchSubject } />
115+
<input name="search-subject" type="checkbox" class="checkbox checkbox-sm" checked?={ props.EnvelopeRequestRequest.SearchSubject } />
116116
</label>
117117
</div>
118118
</li>
@@ -121,21 +121,21 @@ templ envelopeListView(m meta.Meta, props envelopeListViewProps) {
121121
<label class="label cursor-pointer">
122122
<span class="label-text">Text</span>
123123
<input type="hidden" value="0" name="-search-text" />
124-
<input name="search-text" type="checkbox" class="checkbox" checked?={ props.EnvelopeRequestRequest.SearchText } />
124+
<input name="search-text" type="checkbox" class="checkbox checkbox-sm" checked?={ props.EnvelopeRequestRequest.SearchText } />
125125
</label>
126126
</div>
127127
</li>
128128
</ul>
129129
</div>
130130
<input name="search" type="text" placeholder="Search" class="input input-sm input-bordered join-item w-full max-w-xs" value={ props.EnvelopeRequestRequest.Search } />
131-
<button title="Search" type="submit" class="btn btn-sm btn-primary join-item">@icons.Search("w-5 h-5")</button>
131+
<button title="Search Envelopes" type="submit" class="btn btn-sm btn-primary join-item">@icons.Search("w-5 h-5")</button>
132132
</div>
133133
</form>
134134
<div class="join flex items-center justify-end" data-loading-states>
135-
<a title="Add" class="btn btn-sm join-item btn-success" href={ routes.EnvelopeCreate().URL() } data-loading-states>
135+
<a title="Create Envelope" class="btn btn-sm join-item btn-success" href={ routes.EnvelopeCreate().URL() } data-loading-states>
136136
@icons.Add("w-5 h-5")
137137
</a>
138-
<button title="Delete All" class="btn btn-sm btn-error join-item" hx-delete={ routes.EnvelopeList().URLString() } hx-confirm="Are you sure you wish to delete all envelopes?" data-loading-disable>
138+
<button title="Delete All Envelopes" class="btn btn-sm btn-error join-item" hx-delete={ routes.EnvelopeList().URLString() } hx-confirm="Are you sure you wish to delete all envelopes?" data-loading-disable>
139139
<span data-loading-class="loading loading-spinner loading-sm">
140140
@icons.Trash("w-5 h-5")
141141
</span>

web/pages/envelope_templ.go

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/pages/index.templ

+7-5
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ templ indexView(m meta.Meta, props indexViewProps) {
3737
<div class="border-base-200 rounded border">
3838
<div class="border-base-200 flex items-center justify-between gap-4 border-b p-4" >
3939
<h1 class="text-xl font-bold">Retention Policy</h1>
40-
<button class="btn btn-xs" hx-post={ routes.RetentionPolicyRun().URLString() }>
41-
<span data-loading-class="loading loading-spinner loading-xs">
42-
Run
43-
</span>
44-
</button>
40+
<div class="flex items-center gap-2">
41+
<button class="btn btn-xs" hx-post={ routes.RetentionPolicyRun().URLString() }>
42+
<span data-loading-class="loading loading-spinner loading-xs">
43+
Run
44+
</span>
45+
</button>
46+
</div>
4547
</div>
4648
<div class="overflow-x-auto">
4749
<table class="table">

web/pages/index_templ.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/pages/rule.templ

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ templ ruleListView(m meta.Meta, props ruleListViewProps) {
2323
</div>
2424
<div class="flex flex-col gap-4 p-4">
2525
<div class="join flex items-center justify-end">
26-
<a title="Add" class="btn btn-sm btn-success" href={ routes.RuleCreate().URL() }>
26+
<a title="Create Rule" class="btn btn-sm btn-success" href={ routes.RuleCreate().URL() }>
2727
@icons.Add("w-5 h-5")
2828
</a>
2929
</div>

web/pages/rule_templ.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/pages/trace.templ

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ templ traceListView(m meta.Meta, props traceListViewProps) {
2727
</div>
2828
<div class="flex flex-col gap-4 p-4">
2929
<div class="join flex items-center justify-end" data-loading-states>
30-
<button title="Delete All" class="btn btn-sm btn-error" hx-delete={ routes.TraceList().URLString() } hx-confirm="Are you sure you wish to delete all traces?" data-loading-disable>
30+
<button title="Delete All Traces" class="btn btn-sm btn-error" hx-delete={ routes.TraceList().URLString() } hx-confirm="Are you sure you wish to delete all traces?" data-loading-disable>
3131
<span data-loading-class="loading loading-spinner loading-sm">
3232
@icons.Trash("w-5 h-5")
3333
</span>

web/pages/trace_templ.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)