From b6a6bb0043b74cbeee6badcf8e5361a285a7a1cc Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Tue, 9 Jul 2024 08:33:15 -0700 Subject: [PATCH] playing with more components --- internal/views/sources/add.templ | 15 ++++++++++++--- internal/views/sources/listAll.templ | 11 ++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/internal/views/sources/add.templ b/internal/views/sources/add.templ index a61a503..bdd3cda 100644 --- a/internal/views/sources/add.templ +++ b/internal/views/sources/add.templ @@ -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() { -
+

New Source

+

At this time only direct RSS links are allowed to be provided

+ @form.New("/sources/add") { + @form.Input("", "url", "text") + @form.Submit("Submit", bulma.ColorPrimary) + } } } diff --git a/internal/views/sources/listAll.templ b/internal/views/sources/listAll.templ index f1872a5..6f2379b 100644 --- a/internal/views/sources/listAll.templ +++ b/internal/views/sources/listAll.templ @@ -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 { - { item.DisplayName } - { item.Source } + @bulma.Button(bulma.ColorPrimary, false, false) { + @bulma.ANewTab(item.Url, item.DisplayName) + }
} }