refactor: rename malago to mal
This commit is contained in:
2
Makefile
2
Makefile
@@ -10,7 +10,7 @@ test:
|
||||
go test ./...
|
||||
|
||||
migrate:
|
||||
sqlite3 malago.db < migrations/001_init.sql
|
||||
sqlite3 mal.db < migrations/001_init.sql
|
||||
|
||||
sqlc:
|
||||
sqlc generate
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
|
||||
"malago/internal/database"
|
||||
"malago/internal/features/auth"
|
||||
"mal/internal/database"
|
||||
"mal/internal/features/auth"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -27,7 +27,7 @@ func main() {
|
||||
|
||||
dbFile := os.Getenv("DATABASE_FILE")
|
||||
if dbFile == "" {
|
||||
dbFile = "malago.db"
|
||||
dbFile = "mal.db"
|
||||
}
|
||||
|
||||
db, err := sql.Open("sqlite3", dbFile)
|
||||
|
||||
@@ -8,17 +8,17 @@ import (
|
||||
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
|
||||
"malago/internal/database"
|
||||
"malago/internal/features/auth"
|
||||
"malago/internal/jikan"
|
||||
"malago/internal/server"
|
||||
"mal/internal/database"
|
||||
"mal/internal/features/auth"
|
||||
"mal/internal/jikan"
|
||||
"mal/internal/server"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
dbFile := os.Getenv("DATABASE_FILE")
|
||||
if dbFile == "" {
|
||||
dbFile = "malago.db"
|
||||
dbFile = "mal.db"
|
||||
}
|
||||
|
||||
db, err := sql.Open("sqlite3", dbFile)
|
||||
|
||||
@@ -6,9 +6,9 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"malago/internal/database"
|
||||
"malago/internal/shared/middleware"
|
||||
"malago/internal/templates"
|
||||
"mal/internal/database"
|
||||
"mal/internal/shared/middleware"
|
||||
"mal/internal/templates"
|
||||
)
|
||||
|
||||
type Handler struct {
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"malago/internal/database"
|
||||
"malago/internal/jikan"
|
||||
"mal/internal/database"
|
||||
"mal/internal/jikan"
|
||||
)
|
||||
|
||||
type Service struct {
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"github.com/google/uuid"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
|
||||
"malago/internal/database"
|
||||
"mal/internal/database"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -3,7 +3,7 @@ package auth
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"malago/internal/templates"
|
||||
"mal/internal/templates"
|
||||
)
|
||||
|
||||
type Handler struct {
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"malago/internal/database"
|
||||
"malago/internal/shared/middleware"
|
||||
"malago/internal/templates"
|
||||
"mal/internal/database"
|
||||
"mal/internal/shared/middleware"
|
||||
"mal/internal/templates"
|
||||
)
|
||||
|
||||
type Handler struct {
|
||||
@@ -198,7 +198,7 @@ func (h *Handler) HandleExportWatchlist(w http.ResponseWriter, r *http.Request)
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.Header().Set("Content-Disposition", "attachment; filename=malago-watchlist.json")
|
||||
w.Header().Set("Content-Disposition", "attachment; filename=mal-watchlist.json")
|
||||
json.NewEncoder(w).Encode(export)
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
||||
"malago/internal/database"
|
||||
"mal/internal/database"
|
||||
)
|
||||
|
||||
type Service struct {
|
||||
|
||||
@@ -3,12 +3,12 @@ package server
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"malago/internal/database"
|
||||
"malago/internal/features/anime"
|
||||
"malago/internal/features/auth"
|
||||
"malago/internal/features/watchlist"
|
||||
"malago/internal/jikan"
|
||||
"malago/internal/shared/middleware"
|
||||
"mal/internal/database"
|
||||
"mal/internal/features/anime"
|
||||
"mal/internal/features/auth"
|
||||
"mal/internal/features/watchlist"
|
||||
"mal/internal/jikan"
|
||||
"mal/internal/shared/middleware"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"malago/internal/database"
|
||||
"malago/internal/features/auth"
|
||||
"mal/internal/database"
|
||||
"mal/internal/features/auth"
|
||||
)
|
||||
|
||||
type contextKey string
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package templates
|
||||
|
||||
import "malago/internal/jikan"
|
||||
import "mal/internal/jikan"
|
||||
import "fmt"
|
||||
import "strings"
|
||||
|
||||
templ AnimeDetails(anime jikan.Anime, currentStatus string) {
|
||||
@Layout("malago - " + anime.DisplayTitle()) {
|
||||
@Layout("mal - " + anime.DisplayTitle()) {
|
||||
<div class="anime-page">
|
||||
<div class="anime-main">
|
||||
<div class="anime-hero">
|
||||
|
||||
@@ -8,7 +8,7 @@ package templates
|
||||
import "github.com/a-h/templ"
|
||||
import templruntime "github.com/a-h/templ/runtime"
|
||||
|
||||
import "malago/internal/jikan"
|
||||
import "mal/internal/jikan"
|
||||
import "fmt"
|
||||
import "strings"
|
||||
|
||||
@@ -599,7 +599,7 @@ func AnimeDetails(anime jikan.Anime, currentStatus string) templ.Component {
|
||||
}
|
||||
return nil
|
||||
})
|
||||
templ_7745c5c3_Err = Layout("malago - "+anime.DisplayTitle()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = Layout("mal - "+anime.DisplayTitle()).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package templates
|
||||
|
||||
import "malago/internal/jikan"
|
||||
import "mal/internal/jikan"
|
||||
import "fmt"
|
||||
|
||||
templ Catalog() {
|
||||
@Layout("malago - catalog") {
|
||||
@Layout("mal - catalog") {
|
||||
<div class="catalog-grid" id="catalog-content">
|
||||
<div hx-get="/api/catalog?page=1" hx-trigger="load" hx-swap="outerHTML" style="grid-column: 1 / -1;">
|
||||
<div class="loading-indicator">
|
||||
|
||||
@@ -8,7 +8,7 @@ package templates
|
||||
import "github.com/a-h/templ"
|
||||
import templruntime "github.com/a-h/templ/runtime"
|
||||
|
||||
import "malago/internal/jikan"
|
||||
import "mal/internal/jikan"
|
||||
import "fmt"
|
||||
|
||||
func Catalog() templ.Component {
|
||||
@@ -50,7 +50,7 @@ func Catalog() templ.Component {
|
||||
}
|
||||
return nil
|
||||
})
|
||||
templ_7745c5c3_Err = Layout("malago - catalog").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = Layout("mal - catalog").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package templates
|
||||
|
||||
import (
|
||||
"malago/internal/jikan"
|
||||
"mal/internal/jikan"
|
||||
"fmt"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
templ Search(q string) {
|
||||
@Layout("malago - search") {
|
||||
@Layout("mal - search") {
|
||||
if q != "" {
|
||||
<div class="loading-indicator htmx-indicator" id="loading">
|
||||
<div class="loading-dot"></div>
|
||||
|
||||
@@ -10,7 +10,7 @@ import templruntime "github.com/a-h/templ/runtime"
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"malago/internal/jikan"
|
||||
"mal/internal/jikan"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
@@ -73,7 +73,7 @@ func Search(q string) templ.Component {
|
||||
}
|
||||
return nil
|
||||
})
|
||||
templ_7745c5c3_Err = Layout("malago - search").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = Layout("mal - search").Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ templ Layout(title string) {
|
||||
<header>
|
||||
<div class="header-top">
|
||||
<div class="header-left">
|
||||
<a href="/" class="logo">/malago</a>
|
||||
<a href="/" class="logo">/mal</a>
|
||||
<div class="nav">
|
||||
<a href="/">catalog</a>
|
||||
<a href="/watchlist">watchlist</a>
|
||||
|
||||
@@ -42,7 +42,7 @@ func Layout(title string) templ.Component {
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</title><link rel=\"stylesheet\" href=\"/static/css/style.css\"><script src=\"https://unpkg.com/htmx.org@1.9.11\"></script></head><body><header><div class=\"header-top\"><div class=\"header-left\"><a href=\"/\" class=\"logo\">/malago</a><div class=\"nav\"><a href=\"/\">catalog</a> <a href=\"/watchlist\">watchlist</a></div></div><div class=\"header-search-wrapper\"><form action=\"/search\" method=\"GET\" class=\"header-search\"><input type=\"text\" id=\"search-input\" name=\"q\" class=\"search-input\" placeholder=\"search anime...\" autocomplete=\"off\"><div id=\"search-dropdown\" class=\"search-dropdown\"></div></form></div></div></header><main>")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</title><link rel=\"stylesheet\" href=\"/static/css/style.css\"><script src=\"https://unpkg.com/htmx.org@1.9.11\"></script></head><body><header><div class=\"header-top\"><div class=\"header-left\"><a href=\"/\" class=\"logo\">/mal</a><div class=\"nav\"><a href=\"/\">catalog</a> <a href=\"/watchlist\">watchlist</a></div></div><div class=\"header-search-wrapper\"><form action=\"/search\" method=\"GET\" class=\"header-search\"><input type=\"text\" id=\"search-input\" name=\"q\" class=\"search-input\" placeholder=\"search anime...\" autocomplete=\"off\"><div id=\"search-dropdown\" class=\"search-dropdown\"></div></form></div></div></header><main>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package templates
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"malago/internal/database"
|
||||
"mal/internal/database"
|
||||
)
|
||||
|
||||
templ Watchlist(entries []database.GetUserWatchListRow, layout string, currentStatus string, sortBy string, sortOrder string) {
|
||||
|
||||
@@ -10,7 +10,7 @@ import templruntime "github.com/a-h/templ/runtime"
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"malago/internal/database"
|
||||
"mal/internal/database"
|
||||
)
|
||||
|
||||
func Watchlist(entries []database.GetUserWatchListRow, layout string, currentStatus string, sortBy string, sortOrder string) templ.Component {
|
||||
|
||||
Reference in New Issue
Block a user