2024-07-13 10:38:40 -07:00
|
|
|
package articles
|
|
|
|
|
|
|
|
import (
|
|
|
|
"git.jamestombleson.com/jtom38/newsbot-portal/components/bulma"
|
|
|
|
"git.jamestombleson.com/jtom38/newsbot-portal/internal/models"
|
|
|
|
"git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
|
|
|
|
)
|
|
|
|
|
|
|
|
templ ListArticlesTable(model models.ListArticlesViewModel) {
|
2024-07-14 09:07:16 -07:00
|
|
|
@layout.WithTemplate(model.HeaderMetaTags) {
|
2024-07-13 10:38:40 -07:00
|
|
|
@bulma.Table() {
|
|
|
|
@bulma.TableHeader() {
|
|
|
|
@bulma.TableRow() {
|
|
|
|
@bulma.TableHeaderData("Title")
|
|
|
|
@bulma.TableHeaderData("Source")
|
2024-07-14 09:07:16 -07:00
|
|
|
@bulma.TableHeaderDataToolTip("Pub", "Date Published")
|
2024-07-13 10:38:40 -07:00
|
|
|
@bulma.TableHeaderData("View")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for _, item := range model.Items {
|
|
|
|
@bulma.TableRow() {
|
|
|
|
@bulma.TableData(item.Article.Title)
|
|
|
|
@bulma.TableData(item.Source.DisplayName)
|
2024-07-14 09:07:16 -07:00
|
|
|
@bulma.TableData(item.Article.PubDate.String())
|
2024-07-13 10:38:40 -07:00
|
|
|
@bulma.TableDataChildren() {
|
|
|
|
@bulma.Button() {
|
|
|
|
@bulma.ANewTab(item.Article.Url, "View")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|