@@ -11,6 +11,7 @@ import (
11
11
" github.com/ItsNotGoodName/smtpbridge/internal/models"
12
12
" github.com/ItsNotGoodName/smtpbridge/web/helpers"
13
13
" github.com/ItsNotGoodName/smtpbridge/web/icons"
14
+ " strings"
14
15
)
15
16
16
17
type envelopeViewProps struct {
@@ -94,14 +95,41 @@ templ envelopeListView(m meta.Meta, props envelopeListViewProps) {
94
95
</div >
95
96
<div class =" flex flex-col gap-4 p-4" >
96
97
<div class =" flex flex-col-reverse justify-between gap-4 sm:flex-row" >
97
- <form class =" join flex" action ={ routes.EnvelopeList ().URLString () }>
98
+ <form class =" flex gap-2 " action ={ routes.EnvelopeList ().URLString () }>
98
99
for k := range props.Query {
99
- if k != " search" {
100
+ if !strings. HasPrefix (k, " search" ) {
100
101
<input type =" hidden" name ={ k } value ={ props.Query .Get (k) } />
101
102
}
102
103
}
103
- <input name =" search" type =" text" placeholder =" Search" class =" input input-sm input-bordered join-item w-full max-w-xs" value ={ props.EnvelopeRequestRequest .Search } />
104
- <button title =" Search" type =" submit" class =" btn btn-sm btn-primary join-item" >@ icons.Search (" w-5 h-5" )</button>
104
+ <div class =" join" >
105
+ <div class =" dropdown join-item" >
106
+ <label tabindex =" 0" class =" btn btn-sm join-item" >
107
+ @ icons.Filter (" w-5 h-5" )
108
+ </label >
109
+ <ul tabindex =" 0" class =" dropdown-content bg-base-100 rounded-box z-[1] w-52 p-2 shadow-lg" >
110
+ <li >
111
+ <div class =" form-control" >
112
+ <label class =" label cursor-pointer" >
113
+ <span class =" label-text" >Subject</span >
114
+ <input type =" hidden" value =" 0" name =" -search-subject" />
115
+ <input name =" search-subject" type =" checkbox" class =" checkbox" checked ?={ props.EnvelopeRequestRequest .SearchSubject } />
116
+ </label >
117
+ </div >
118
+ </li >
119
+ <li >
120
+ <div class =" form-control" >
121
+ <label class =" label cursor-pointer" >
122
+ <span class =" label-text" >Text</span >
123
+ <input type =" hidden" value =" 0" name =" -search-text" />
124
+ <input name =" search-text" type =" checkbox" class =" checkbox" checked ?={ props.EnvelopeRequestRequest .SearchText } />
125
+ </label >
126
+ </div >
127
+ </li >
128
+ </ul >
129
+ </div >
130
+ <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>
132
+ </div >
105
133
</form >
106
134
<div class =" join flex items-center justify-end" data-loading-states >
107
135
<a title =" Add" class =" btn btn-sm join-item btn-success" href ={ routes.EnvelopeCreate ().URL () } data-loading-states >
0 commit comments