restructure html templates
This commit is contained in:
@@ -31,13 +31,11 @@ func (s *SoftwareUpdaterTIC80Service) Update(name string) error {
|
||||
fmt.Printf("TIC80 Updater: Starting update for name: %s\n", name)
|
||||
contentsPath, _ := os.LookupEnv("GAMES_DIR")
|
||||
|
||||
// Case 1: HTML content (name.html.zip)
|
||||
if err := s.handleHTMLContent(name, contentsPath); err == nil {
|
||||
fmt.Printf("TIC80 Updater: Successfully processed HTML content: %s\n", name)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Case 2: TIC-80 Lua cartridge (name.lua and name.tic)
|
||||
if err := s.handleLuaCartridge(name, contentsPath); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ func (c *PlayController) Play(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
tmpl, err := template_utils.GetTemplate("play", "http/views/layouts/main.html", "http/views/play.html")
|
||||
tmpl, err := template_utils.GetTemplate("play_controller_play", "http/views/shared/layout.html", "http/views/play/play.html")
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
|
||||
@@ -24,7 +24,7 @@ func (c *SoftwareController) index(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
tmpl, err := template_utils.GetTemplate("index", "http/views/layouts/main.html", "http/views/index.html")
|
||||
tmpl, err := template_utils.GetTemplate("software_index", "http/views/shared/layout.html", "http/views/software/index.html")
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
@@ -45,7 +45,7 @@ func (c *SoftwareController) releases(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
tmpl, err := template_utils.GetTemplate("releases", "http/views/layouts/main.html", "http/views/releases.html")
|
||||
tmpl, err := template_utils.GetTemplate("software_releases", "http/views/shared/layout.html", "http/views/software/releases.html")
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
|
||||
<p style="margin-top: 20px"><a href="/" class="btn btn-primary">Back to Softwares</a></p>
|
||||
|
||||
{{end}}
|
||||
{{end}}
|
||||
@@ -25,4 +25,4 @@
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
@@ -39,8 +39,6 @@ func NewDBMockSuite() *DBMockSuite {
|
||||
panic("GORM open error")
|
||||
}
|
||||
|
||||
// gormdb.AutoMigrate()
|
||||
|
||||
return &DBMockSuite{
|
||||
DB: gormdb,
|
||||
Mock: mock,
|
||||
|
||||
Reference in New Issue
Block a user