Skip to content

Commit 65f8f09

Browse files
committedSep 14, 2023
fix(web): multiple ui issues
1 parent 3b6f257 commit 65f8f09

8 files changed

+147
-94
lines changed
 

‎web/components/layout.templ

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@ import (
99
templ LayoutDefault(m meta.Meta) {
1010
<div class="drawer lg:drawer-open">
1111
<input id="my-drawer-2" type="checkbox" class="drawer-toggle"/>
12-
<div class="drawer-content">
13-
<div class="max-w-[100vw]">
12+
<div class="drawer-content overflow-x-auto">
1413
@Header(m)
1514
<div class="min-h-screen">
1615
{ children... }
1716
</div>
1817
@Footer()
1918
</div>
20-
</div>
2119
<div class="drawer-side z-20">
2220
<label for="my-drawer-2" class="drawer-overlay"></label>
2321
<ul class="menu bg-base-200 text-base-content h-full w-60 p-4">

‎web/components/layout_templ.go

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

‎web/components/rule_form.templ

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ templ RuleFormUpdate(props RuleFormUpdateProps) {
111111
if props.Rule.Internal {
112112
<div class="alert alert-warning">
113113
@icons.Alert("h-6 w-6")
114-
<span>Cannot be edited because it is an internal rule.</span>
114+
<span>Rule cannot be edited because it is internal.</span>
115115
</div>
116116
}
117117
<button disabled?={ props.Rule.Internal } type="submit" class="btn btn-primary btn-block">Update Rule</button>

‎web/components/rule_form_templ.go

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

‎web/components/table_order_th.templ

+6-4
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ func tableOrderTHAscending(enable, ascending bool) string {
2323
templ TableOrderTH(props TableOrderTHProps) {
2424
<a class="w-full flex gap-2 items-center" href={ routes.EnvelopeList().URLQuery(helpers.Query(props.Query, "order", props.Field, "ascending", tableOrderTHAscending(props.Order == props.Field, props.Ascending))) }>
2525
{ children... }
26-
if props.Order == props.Field {
27-
if props.Ascending {
26+
if props.Ascending {
27+
<div class={ templ.KV("opacity-0", props.Order != props.Field) }>
2828
@icons.ArrowUpS("h-4 w-4")
29-
} else {
29+
</div>
30+
} else {
31+
<div class={ templ.KV("opacity-0", props.Order != props.Field) }>
3032
@icons.ArrowDownS("h-4 w-4")
31-
}
33+
</div>
3234
}
3335
</a>
3436
}

‎web/components/table_order_th_templ.go

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

‎web/pages/envelope.templ

+43-39
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ templ envelopeView(m meta.Meta, props envelopeViewProps) {
4040
</tr>
4141
<tr>
4242
<th class="w-0 whitespace-nowrap">To</th>
43-
<td>
43+
<td class="flex items-center gap-2">
4444
for _, to := range props.Envelope.Message.To {
4545
<span class="badge">
4646
{ to }
@@ -62,7 +62,7 @@ templ envelopeView(m meta.Meta, props envelopeViewProps) {
6262
<div class="flex flex-col gap-4 p-4">
6363
<form class="join" hx-post={ routes.EnvelopeEndpointSend(props.Envelope.Message.ID).URLString() } hx-target="next div" hx-swap="outerHTML">
6464
<select name="endpoint" id="endpoint" class="select select-bordered select-sm join-item w-full">
65-
<option disabled selected>Endpoint</option>
65+
<option disabled selected>Select Endpoint</option>
6666
for _, end := range props.Endpoints {
6767
<option value={ strconv.FormatInt(end.ID, 10) }>{ end.Name }</option>
6868
}
@@ -115,11 +115,12 @@ templ envelopeListView(m meta.Meta, props envelopeListViewProps) {
115115
Ascending: props.EnvelopeRequestRequest.Ascending,
116116
})
117117
</div>
118-
<div class="bordery overflow-x-auto">
119-
<table class="table-pin-cols table">
118+
<div class="overflow-x-auto">
119+
<table class="table table-pin-cols">
120120
<thead>
121121
<tr>
122-
<th>
122+
<th></th>
123+
<td>
123124
@c.TableOrderTH(c.TableOrderTHProps{
124125
Query : props.Query,
125126
Ascending : props.EnvelopeRequestRequest.Ascending,
@@ -128,8 +129,8 @@ templ envelopeListView(m meta.Meta, props envelopeListViewProps) {
128129
}) {
129130
Created At
130131
}
131-
</th>
132-
<th>
132+
</td>
133+
<td>
133134
@c.TableOrderTH(c.TableOrderTHProps{
134135
Query : props.Query,
135136
Ascending : props.EnvelopeRequestRequest.Ascending,
@@ -138,8 +139,8 @@ templ envelopeListView(m meta.Meta, props envelopeListViewProps) {
138139
}) {
139140
From
140141
}
141-
</th>
142-
<th>
142+
</td>
143+
<td>
143144
@c.TableOrderTH(c.TableOrderTHProps{
144145
Query : props.Query,
145146
Ascending : props.EnvelopeRequestRequest.Ascending,
@@ -148,43 +149,46 @@ templ envelopeListView(m meta.Meta, props envelopeListViewProps) {
148149
}) {
149150
Subject
150151
}
151-
</th>
152+
</td>
152153
<th></th>
153154
</tr>
154155
</thead>
155156
<tbody>
156157
for _, env := range props.EnvelopeRequestResult.Envelopes {
157-
<tr>
158-
<td class="w-0 whitespace-nowrap">
159-
<div class="tooltip tooltip-right" data-tip={ helpers.TimeHumanize(env.Message.CreatedAt.Time()) }>
158+
<tr>
159+
<th class="w-0 whitespace-nowrap z-10">
160+
{ strconv.FormatInt(env.Message.ID, 10) }
161+
</th>
162+
<td class="w-0 whitespace-nowrap">
163+
<div class="tooltip tooltip-right" data-tip={ helpers.TimeHumanize(env.Message.CreatedAt.Time()) }>
164+
<a href={ routes.Envelope(env.Message.ID).URL() }>
165+
@c.FormatDate(m, time.Time(env.Message.CreatedAt))
166+
</a>
167+
</div>
168+
</td>
169+
<td class="w-0 whitespace-nowrap">
160170
<a href={ routes.Envelope(env.Message.ID).URL() }>
161-
@c.FormatDate(m, time.Time(env.Message.CreatedAt))
171+
{ env.Message.From }
162172
</a>
163-
</div>
164-
</td>
165-
<td class="w-0 whitespace-nowrap">
166-
<a href={ routes.Envelope(env.Message.ID).URL() }>
167-
{ env.Message.From }
168-
</a>
169-
</td>
170-
<td class="whitespace-nowrap">
171-
<a href={ routes.Envelope(env.Message.ID).URL() }>
172-
{ env.Message.Subject }
173-
</a>
174-
</td>
175-
<td class="w-0 whitespace-nowrap">
176-
if len(env.Attachments) != 0 {
177-
<a href={ routes.Envelope(env.Message.ID).URLQuery("tab=" + routes.EnvelopeTabAttachments.String()) } class="tooltip tooltip-left fill-current flex items-center" data-tip={ strconv.Itoa(len(env.Attachments)) + " Attachment(s)" }>
178-
@icons.Attachment("h-4 w-4")
179-
</a>
180-
}
181-
</td>
182-
<th class="w-0 whitespace-nowrap">
183-
<button class="btn btn-error btn-xs join-item" hx-delete={ routes.Envelope(env.Message.ID).URLString() } hx-target="closest tr" hx-confirm="Are you sure you wish to delete this envelope?" >
184-
@icons.Trash("h-4 w-4")
185-
</button>
186-
</th>
187-
</tr>
173+
</td>
174+
<td class="whitespace-nowrap">
175+
<a href={ routes.Envelope(env.Message.ID).URL() }>
176+
{ env.Message.Subject }
177+
</a>
178+
</td>
179+
<th class="w-0 whitespace-nowrap">
180+
<div class="flex flex-row justify-end gap-2">
181+
if len(env.Attachments) != 0 {
182+
<a href={ routes.Envelope(env.Message.ID).URLQuery("tab=" + routes.EnvelopeTabAttachments.String()) } class="tooltip tooltip-left fill-current flex items-center" data-tip={ strconv.Itoa(len(env.Attachments)) + " Attachment(s)" }>
183+
@icons.Attachment("h-4 w-4")
184+
</a>
185+
}
186+
<button class="btn btn-error btn-xs join-item" hx-delete={ routes.Envelope(env.Message.ID).URLString() } hx-target="closest tr" hx-confirm="Are you sure you wish to delete this envelope?" >
187+
@icons.Trash("h-4 w-4")
188+
</button>
189+
</div>
190+
</th>
191+
</tr>
188192
}
189193
</tbody>
190194
</table>

‎web/pages/envelope_templ.go

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

0 commit comments

Comments
 (0)
Please sign in to comment.