refactor
This commit is contained in:
parent
175a42f58c
commit
9c1aa2939e
@ -1,15 +1,15 @@
|
|||||||
package home
|
package home
|
||||||
|
|
||||||
import "git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
|
import "git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
|
||||||
|
import "git.jamestombleson.com/jtom38/newsbot-portal/components/bulma"
|
||||||
|
|
||||||
templ About() {
|
templ About() {
|
||||||
@layout.WithTemplate(){
|
@layout.WithTemplate(){
|
||||||
<h1 class="title"> About this project</h1>
|
@bulma.Title("About this project")
|
||||||
|
@bulma.Block() {
|
||||||
<section class="section">
|
|
||||||
Newsbot started a small project to send out notifications to discord servers.
|
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.
|
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.
|
That feature still exists because I think that keeping a communitiy aware and engaged is important and not everyone follows the same news.
|
||||||
</section>
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,32 +1,27 @@
|
|||||||
package home
|
package home
|
||||||
|
|
||||||
import "git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
|
import (
|
||||||
import "git.jamestombleson.com/jtom38/newsbot-portal/components/bulma"
|
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() {
|
templ Index() {
|
||||||
@layout.WithTemplate() {
|
@layout.WithTemplate() {
|
||||||
@bulma.Hero("Welcome to Newsbot!", "Your new home for your news.")
|
@bl.Hero("Welcome to Newsbot!", "Your new home for your news.")
|
||||||
|
@b.Block() {
|
||||||
<section class="section">
|
News bot is a self hostable solution to aggregating your news.
|
||||||
<p>
|
You can run `Newsbot` as an API or interact with it with this site.
|
||||||
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)
|
||||||
</p>
|
@b.Block() {
|
||||||
</section>
|
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.
|
||||||
<div class="block">
|
It still has those roots but now its starting to scale up to a full Aggregation platform.
|
||||||
<h2 class="title">Why Newsbot</h2>
|
}
|
||||||
I started to build this tool to help me avoid sitting on the big platform websites.
|
@b.Block() {
|
||||||
I wanted a tool that would work for me, not them.
|
This project is a passion project of mine as I
|
||||||
|
}
|
||||||
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.
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<p>
|
|
||||||
This project is a passion project of mine as I
|
|
||||||
</p>
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,25 +2,28 @@ package sources
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"git.jamestombleson.com/jtom38/newsbot-portal/components/bulma"
|
"git.jamestombleson.com/jtom38/newsbot-portal/components/bulma"
|
||||||
"git.jamestombleson.com/jtom38/newsbot-portal/components/bulma/form"
|
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/models"
|
||||||
"git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
|
"git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
p = form.NewParam{
|
p = bf.NewParam{
|
||||||
HxPost: "/sources/add",
|
HxPost: "/sources/add",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
templ Add(model models.AddSourcePayloadModel) {
|
templ Add(model models.AddSourcePayloadModel) {
|
||||||
@layout.WithTemplate() {
|
@layout.WithTemplate() {
|
||||||
@bulma.H2("New Source", false)
|
@bl.Hero("New Source", "")
|
||||||
<p>At this time only direct RSS links are allowed to be provided.</p>
|
@bulma.Block() {
|
||||||
@form.New(p) {
|
At this time only direct RSS links are allowed to be provided.
|
||||||
@form.TextInput("", "name", form.InputTypeText, "Name of the site")
|
}
|
||||||
@form.TextInput("", "url", form.InputTypeText, "RSS URL")
|
@bf.New(p) {
|
||||||
@form.Submit("Submit", bulma.ColorPrimary)
|
@bf.TextInput("name", bf.InputTypeText, "Name of the site")
|
||||||
|
@bf.TextInput("url", bf.InputTypeText, "RSS URL")
|
||||||
|
@bf.Submit("Submit", bulma.ColorPrimary)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ package sources
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"git.jamestombleson.com/jtom38/newsbot-portal/components/bulma"
|
"git.jamestombleson.com/jtom38/newsbot-portal/components/bulma"
|
||||||
templhtml "git.jamestombleson.com/jtom38/newsbot-portal/components/templ-html"
|
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/models"
|
||||||
"git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
|
"git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
|
||||||
)
|
)
|
||||||
@ -10,10 +10,10 @@ import (
|
|||||||
templ ListAll(model models.ListAllSourcesViewModel) {
|
templ ListAll(model models.ListAllSourcesViewModel) {
|
||||||
@layout.WithTemplate() {
|
@layout.WithTemplate() {
|
||||||
@bulma.Button() {
|
@bulma.Button() {
|
||||||
@templhtml.ALink("/sources/add", "New Source")
|
@bh.ALink("/sources/add", "New Source")
|
||||||
}
|
}
|
||||||
@templhtml.Br()
|
@bh.Br()
|
||||||
@templhtml.Br()
|
@bh.Br()
|
||||||
for _, item := range model.Items {
|
for _, item := range model.Items {
|
||||||
@bulma.ButtonColor(bulma.ColorPrimary) {
|
@bulma.ButtonColor(bulma.ColorPrimary) {
|
||||||
@bulma.ANewTab(item.Url, item.DisplayName)
|
@bulma.ANewTab(item.Url, item.DisplayName)
|
||||||
|
@ -17,13 +17,13 @@ templ LoginNew() {
|
|||||||
@form.Field() {
|
@form.Field() {
|
||||||
@form.Label("Username")
|
@form.Label("Username")
|
||||||
@form.Control() {
|
@form.Control() {
|
||||||
@form.TextInput("", "username", "text", "email address")
|
@form.TextInput("username", "text", "email address")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@form.Field() {
|
@form.Field() {
|
||||||
@form.Label("Password")
|
@form.Label("Password")
|
||||||
@form.Control() {
|
@form.Control() {
|
||||||
@form.TextInput("", "password", form.InputTypePassword, "")
|
@form.TextInput("password", form.InputTypePassword, "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@form.Submit("Submit", "is-primary")
|
@form.Submit("Submit", "is-primary")
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package users
|
package users
|
||||||
|
|
||||||
import "git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
|
import "git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
|
||||||
import "git.jamestombleson.com/jtom38/newsbot-portal/components/bulma"
|
import bl "git.jamestombleson.com/jtom38/newsbot-portal/components/bulma/layout"
|
||||||
|
|
||||||
templ Logout() {
|
templ Logout() {
|
||||||
@layout.WithTemplate(){
|
@layout.WithTemplate(){
|
||||||
@bulma.Hero("You are out of here!", "Please login again when you are ready.")
|
@bl.Hero("You are out of here!", "Please login again when you are ready.")
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,17 +2,18 @@ package users
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"git.jamestombleson.com/jtom38/newsbot-portal/components/bulma"
|
"git.jamestombleson.com/jtom38/newsbot-portal/components/bulma"
|
||||||
templhtml "git.jamestombleson.com/jtom38/newsbot-portal/components/templ-html"
|
bh "git.jamestombleson.com/jtom38/newsbot-portal/components/bulma/html"
|
||||||
|
bl "git.jamestombleson.com/jtom38/newsbot-portal/components/bulma/layout"
|
||||||
"git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
|
"git.jamestombleson.com/jtom38/newsbot-portal/internal/views/layout"
|
||||||
)
|
)
|
||||||
|
|
||||||
templ Profile() {
|
templ Profile() {
|
||||||
@layout.WithTemplate() {
|
@layout.WithTemplate() {
|
||||||
@bulma.Hero("Profile", "Here you can update your profile 😀")
|
@bl.Hero("Profile", "Here you can update your profile 😀")
|
||||||
|
|
||||||
@bulma.H2("Sessions", false)
|
@bulma.H2("Sessions", false)
|
||||||
@bulma.Button() {
|
@bulma.Button() {
|
||||||
@templhtml.ALink("/users/forcelogout", "Terminate all active sessions")
|
@bh.ALink("/users/forcelogout", "Terminate all active sessions")
|
||||||
}
|
}
|
||||||
@bulma.Subitle("This will force you to login again as the application will give you a new session value.")
|
@bulma.Subitle("This will force you to login again as the application will give you a new session value.")
|
||||||
}
|
}
|
||||||
|
@ -11,13 +11,13 @@ templ SignUp() {
|
|||||||
@form.Field(){
|
@form.Field(){
|
||||||
@form.Label("Username")
|
@form.Label("Username")
|
||||||
@form.Control() {
|
@form.Control() {
|
||||||
@form.TextInput("", "username", form.InputTypeText, "username or email address")
|
@form.TextInput("username", form.InputTypeText, "username or email address")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@form.Field() {
|
@form.Field() {
|
||||||
@form.Label("Password")
|
@form.Label("Password")
|
||||||
@form.Control() {
|
@form.Control() {
|
||||||
@form.TextInput("", "password", form.InputTypePassword, "Nice strong password, like Ox!")
|
@form.TextInput("password", form.InputTypePassword, "Nice strong password, like Ox!")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@form.Submit("Submit", "")
|
@form.Submit("Submit", "")
|
||||||
|
Loading…
Reference in New Issue
Block a user