playing with more components
This commit is contained in:
parent
d1f72aa0f1
commit
b6a6bb0043
@ -1,10 +1,19 @@
|
||||
package sources
|
||||
|
||||
import "git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
|
||||
import "git.jamestombleson.com/jtom38/newsbot-portal/internal/models"
|
||||
import (
|
||||
"git.jamestombleson.com/jtom38/newsbot-portal/internal/models"
|
||||
"git.jamestombleson.com/jtom38/newsbot-portal/internal/views/bulma"
|
||||
"git.jamestombleson.com/jtom38/newsbot-portal/internal/views/bulma/form"
|
||||
"git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
|
||||
)
|
||||
|
||||
templ Add(model models.AddSourcePayloadModel) {
|
||||
@layout.WithTemplate() {
|
||||
<form hx-post="/sources/add"></form>
|
||||
<h2>New Source</h2>
|
||||
<p>At this time only direct RSS links are allowed to be provided</p>
|
||||
@form.New("/sources/add") {
|
||||
@form.Input("", "url", "text")
|
||||
@form.Submit("Submit", bulma.ColorPrimary)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,17 @@
|
||||
package sources
|
||||
|
||||
import "git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
|
||||
import "git.jamestombleson.com/jtom38/newsbot-portal/internal/models"
|
||||
import (
|
||||
"git.jamestombleson.com/jtom38/newsbot-portal/internal/models"
|
||||
"git.jamestombleson.com/jtom38/newsbot-portal/internal/views/bulma"
|
||||
"git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
|
||||
)
|
||||
|
||||
templ ListAll(model models.ListAllSourcesViewModel) {
|
||||
@layout.WithTemplate() {
|
||||
for _, item := range model.Items {
|
||||
<a href={ templ.SafeURL(item.Url) } target="_blank" rel="noopener noreferrer">{ item.DisplayName } - { item.Source } </a>
|
||||
@bulma.Button(bulma.ColorPrimary, false, false) {
|
||||
@bulma.ANewTab(item.Url, item.DisplayName)
|
||||
}
|
||||
<br/>
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user