+}
\ No newline at end of file
diff --git a/components/bulma/button.templ b/components/bulma/button.templ
new file mode 100644
index 0000000..5385978
--- /dev/null
+++ b/components/bulma/button.templ
@@ -0,0 +1,30 @@
+package bulma
+
+// This creates a button that accepts children under it.
+templ Button() {
+
+}
+
+// Used to create a button and lets you define the color.
+// Accepts children.
+templ ButtonColor(color string) {
+
+}
+
+templ ButtonNewTab(url, text string) {
+
+}
+
+templ ALink(url, title string) {
+ { title }
+}
+
+templ ANewTab(url, text string) {
+ { text }
+}
diff --git a/internal/views/bulma/card.templ b/components/bulma/card.templ
similarity index 100%
rename from internal/views/bulma/card.templ
rename to components/bulma/card.templ
diff --git a/components/bulma/example/example.templ b/components/bulma/example/example.templ
new file mode 100644
index 0000000..8940fe2
--- /dev/null
+++ b/components/bulma/example/example.templ
@@ -0,0 +1,19 @@
+package example
+
+import "git.jamestombleson.com/jtom38/newsbot-portal/components/bulma"
+import "git.jamestombleson.com/jtom38/newsbot-portal/components/bulma/html"
+import "git.jamestombleson.com/jtom38/newsbot-portal/components/bulma/layout"
+
+templ example() {
+ @html.Doctype()
+ @html.New("en"){
+ @html.NewHeader(){
+ @bulma.UseBulmaCdn()
+ }
+ @html.NewBody() {
+ @layout.Container(bulma.BreakpointDefault) {
+ { children... }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/components/bulma/example/layout.templ b/components/bulma/example/layout.templ
new file mode 100644
index 0000000..f7ec372
--- /dev/null
+++ b/components/bulma/example/layout.templ
@@ -0,0 +1 @@
+package example
diff --git a/components/bulma/form/control.templ b/components/bulma/form/control.templ
new file mode 100644
index 0000000..d5183b2
--- /dev/null
+++ b/components/bulma/form/control.templ
@@ -0,0 +1,8 @@
+package form
+
+// Div container to add a input field to.
+templ Control() {
+
+ { children... }
+
+}
\ No newline at end of file
diff --git a/components/bulma/form/field.templ b/components/bulma/form/field.templ
new file mode 100644
index 0000000..ad7b0c3
--- /dev/null
+++ b/components/bulma/form/field.templ
@@ -0,0 +1,8 @@
+package form
+
+// This creates a field that you can add a Label, Control or Input object.
+templ Field() {
+
+ { children... }
+
+}
\ No newline at end of file
diff --git a/components/bulma/form/input.templ b/components/bulma/form/input.templ
new file mode 100644
index 0000000..12a45bc
--- /dev/null
+++ b/components/bulma/form/input.templ
@@ -0,0 +1,19 @@
+package form
+
+templ TextInput(id, fieldType, placeholder string) {
+
+}
+
+templ TextInputColor(color, id, fieldType, placeholder string) {
+ if color == "" {
+
+ } else {
+
+ }
+}
+
+templ Checkbox(text, id string) {
+
+}
diff --git a/components/bulma/form/label.templ b/components/bulma/form/label.templ
new file mode 100644
index 0000000..66deea3
--- /dev/null
+++ b/components/bulma/form/label.templ
@@ -0,0 +1,6 @@
+package form
+
+// This will create a small bit of text to add context to the form.
+templ Label(text string) {
+
+}
\ No newline at end of file
diff --git a/components/bulma/form/new.templ b/components/bulma/form/new.templ
new file mode 100644
index 0000000..8f5029e
--- /dev/null
+++ b/components/bulma/form/new.templ
@@ -0,0 +1,13 @@
+package form
+
+type NewParam struct {
+ HxPost string
+}
+
+templ New(param NewParam) {
+ if param.HxPost != "" {
+
+ }
+}
diff --git a/components/bulma/form/select.templ b/components/bulma/form/select.templ
new file mode 100644
index 0000000..8adffdc
--- /dev/null
+++ b/components/bulma/form/select.templ
@@ -0,0 +1,33 @@
+package form
+
+templ SelectOne(color string, isRound bool) {
+ if isRound {
+
+
+}
\ No newline at end of file
diff --git a/components/bulma/layout/section.templ b/components/bulma/layout/section.templ
new file mode 100644
index 0000000..4775db4
--- /dev/null
+++ b/components/bulma/layout/section.templ
@@ -0,0 +1,9 @@
+package bulma
+
+// Creates a object thats good to break up a page of content.
+templ Section(title, subtitle string) {
+
+
{ title }
+
{ subtitle }
+
+}
diff --git a/components/bulma/notification.templ b/components/bulma/notification.templ
new file mode 100644
index 0000000..13f34a8
--- /dev/null
+++ b/components/bulma/notification.templ
@@ -0,0 +1,7 @@
+package bulma
+
+templ Notification(message, color string) {
+
+ { message }
+
+}
diff --git a/components/bulma/script.templ b/components/bulma/script.templ
new file mode 100644
index 0000000..8c72096
--- /dev/null
+++ b/components/bulma/script.templ
@@ -0,0 +1,5 @@
+package bulma
+
+templ UseBulmaCdn() {
+
+}
\ No newline at end of file
diff --git a/components/bulma/table.templ b/components/bulma/table.templ
new file mode 100644
index 0000000..2356404
--- /dev/null
+++ b/components/bulma/table.templ
@@ -0,0 +1,37 @@
+package bulma
+
+// Creates a
that accepts children
+templ Table(){
+
+ { children... }
+
+}
+
+// Creates a that accepts children.
+templ TableHeader() {
+ { children... }
+}
+
+// Creates a that accepts children.
+templ TableRow() {
+
{ children... }
+}
+
+// Creates a
and writes the given value
+templ TableHeaderData(value string) {
+
{ value }
+}
+
+// Creates a
that allows you to also add a tooltip value
+templ TableHeaderDataToolTip(value, tooltip string) {
+
{ value }
+}
+
+// Creates a
that accepts children.
+templ TableDataChildren() {
+
{ children... }
+}
+
+templ TableData(value string) {
+
{ value }
+}
\ No newline at end of file
diff --git a/components/bulma/tags.templ b/components/bulma/tags.templ
new file mode 100644
index 0000000..12b6735
--- /dev/null
+++ b/components/bulma/tags.templ
@@ -0,0 +1,13 @@
+package bulma
+
+templ Tag(message string) {
+ { message }
+}
+
+templ TagColor(message, color string) {
+ { message }
+}
+
+templ TagColorSize(message, color, size string) {
+ { message }
+}
diff --git a/components/bulma/title.templ b/components/bulma/title.templ
new file mode 100644
index 0000000..2f95eba
--- /dev/null
+++ b/components/bulma/title.templ
@@ -0,0 +1,49 @@
+package bulma
+
+templ Title(message string) {
+
-
-
+ @bulma.Title("About this project")
+ @bulma.Block() {
Newsbot started a small project to send out notifications to discord servers.
I wanted to be able to keep the small communitiy aware of new posts about a game we all played.
That feature still exists because I think that keeping a communitiy aware and engaged is important and not everyone follows the same news.
-
+ }
}
}
\ No newline at end of file
diff --git a/internal/views/home/index.templ b/internal/views/home/index.templ
index b90be24..c614456 100644
--- a/internal/views/home/index.templ
+++ b/internal/views/home/index.templ
@@ -1,32 +1,27 @@
package home
-import "git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
-import "git.jamestombleson.com/jtom38/newsbot-portal/internal/views/bulma"
+import (
+ b "git.jamestombleson.com/jtom38/newsbot-portal/components/bulma"
+ bl "git.jamestombleson.com/jtom38/newsbot-portal/components/bulma/layout"
+ "git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
+)
templ Index() {
@layout.WithTemplate() {
- @bulma.Hero("Welcome to Newsbot!", "Your new home for your news.")
-
-
-
- News bot is a self hostable solution to aggregating your news.
- You can run `Newsbot` as an API or interact with it with this site.
-
-
-
-
-
-
Why Newsbot
- I started to build this tool to help me avoid sitting on the big platform websites.
- I wanted a tool that would work for me, not them.
-
- This tool started as a notification system that would let me redirect RSS posts over to Discord servers.
- It still has those roots but now its starting to scale up to a full Aggregation platform.
-
-
-
- This project is a passion project of mine as I
-
-
+ @bl.Hero("Welcome to Newsbot!", "Your new home for your news.")
+ @b.Block() {
+ News bot is a self hostable solution to aggregating your news.
+ You can run `Newsbot` as an API or interact with it with this site.
+ }
+ @b.H2("Why Newsbot", false)
+ @b.Block() {
+ I started to build this tool to help me avoid sitting on the big platform websites.
+ I wanted a tool that would work for me, not them.
+ This tool started as a notification system that would let me redirect RSS posts over to Discord servers.
+ It still has those roots but now its starting to scale up to a full Aggregation platform.
+ }
+ @b.Block() {
+ This project is a passion project of mine as I
+ }
}
}
diff --git a/internal/views/layout/header.templ b/internal/views/layout/header.templ
index 942e76f..0da3df2 100644
--- a/internal/views/layout/header.templ
+++ b/internal/views/layout/header.templ
@@ -1,7 +1,9 @@
package layout
+import "git.jamestombleson.com/jtom38/newsbot-portal/components/bulma"
+
templ header() {
-
+ @bulma.UseBulmaCdn()
diff --git a/internal/views/sources/add.templ b/internal/views/sources/add.templ
index a61a503..cf49057 100644
--- a/internal/views/sources/add.templ
+++ b/internal/views/sources/add.templ
@@ -1,10 +1,29 @@
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/components/bulma"
+ bf "git.jamestombleson.com/jtom38/newsbot-portal/components/bulma/form"
+ bl "git.jamestombleson.com/jtom38/newsbot-portal/components/bulma/layout"
+ "git.jamestombleson.com/jtom38/newsbot-portal/internal/models"
+ "git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
+)
+
+var (
+ p = bf.NewParam{
+ HxPost: "/sources/add",
+ }
+)
templ Add(model models.AddSourcePayloadModel) {
@layout.WithTemplate() {
-
+ @bl.Hero("New Source", "")
+ @bulma.Block() {
+ At this time only direct RSS links are allowed to be provided.
+ }
+ @bf.New(p) {
+ @bf.TextInput("name", bf.InputTypeText, "Name of the site")
+ @bf.TextInput("url", bf.InputTypeText, "RSS URL")
+ @bf.Submit("Submit", bulma.ColorPrimary)
+ }
}
}
diff --git a/internal/views/sources/addAfter.templ b/internal/views/sources/addAfter.templ
new file mode 100644
index 0000000..c0d9046
--- /dev/null
+++ b/internal/views/sources/addAfter.templ
@@ -0,0 +1,11 @@
+package sources
+
+import "git.jamestombleson.com/jtom38/newsbot-portal/components/bulma"
+
+templ AddAfter(message string, isError bool) {
+ if isError {
+ @bulma.Notification(message, bulma.ColorError)
+ } else {
+ @bulma.Notification("The requested source was added to the server", bulma.ColorSuccess)
+ }
+}
\ No newline at end of file
diff --git a/internal/views/sources/listAll.templ b/internal/views/sources/listAll.templ
index f1872a5..24f0fbd 100644
--- a/internal/views/sources/listAll.templ
+++ b/internal/views/sources/listAll.templ
@@ -1,12 +1,23 @@
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/components/bulma"
+ bh "git.jamestombleson.com/jtom38/newsbot-portal/components/bulma/html"
+ "git.jamestombleson.com/jtom38/newsbot-portal/internal/models"
+ "git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
+)
templ ListAll(model models.ListAllSourcesViewModel) {
@layout.WithTemplate() {
+ @bulma.Button() {
+ @bh.ALink("/sources/add", "New Source")
+ }
+ @bh.Br()
+ @bh.Br()
for _, item := range model.Items {
- { item.DisplayName } - { item.Source }
+ @bulma.ButtonColor(bulma.ColorPrimary) {
+ @bulma.ANewTab(item.Url, item.DisplayName)
+ }
}
}
diff --git a/internal/views/users/afterLogin.templ b/internal/views/users/afterLogin.templ
index 213f221..1c0a0e1 100644
--- a/internal/views/users/afterLogin.templ
+++ b/internal/views/users/afterLogin.templ
@@ -1,17 +1,16 @@
package users
-import "git.jamestombleson.com/jtom38/newsbot-portal/internal/models"
+import (
+ "git.jamestombleson.com/jtom38/newsbot-portal/components/bulma"
+ "git.jamestombleson.com/jtom38/newsbot-portal/internal/models"
+)
// This is returned after the user logs into the application.
// It just returns a partial view because it will overlap with the existing template.
templ AfterLogin(vm models.AfterLoginViewModel) {
if vm.Success {
-
+ @bulma.Notification(vm.Message, bulma.ColorError)
}
}
diff --git a/internal/views/users/afterSignUp.templ b/internal/views/users/afterSignUp.templ
index dfe3fd5..699dbf6 100644
--- a/internal/views/users/afterSignUp.templ
+++ b/internal/views/users/afterSignUp.templ
@@ -1,15 +1,13 @@
package users
+import "git.jamestombleson.com/jtom38/newsbot-portal/components/bulma"
+
// This is returned after the user creates an account.
// It just returns a partial view because it will overlap with the existing template.
templ AfterSignUp(message string, success bool) {
if success {
-