Added route to view test
This commit is contained in:
parent
a51c8aa8a4
commit
cf7623fbb9
@ -6,7 +6,7 @@ import (
|
|||||||
|
|
||||||
type Test struct {
|
type Test struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
DateTag string
|
Title string
|
||||||
|
|
||||||
// belongs to hardware
|
// belongs to hardware
|
||||||
HardwareID int
|
HardwareID int
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{{ template "header" . }}
|
{{ template "header" . }}
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<h2>{{ .test.Name }}</h2>
|
<h2>{{ .test.Title }}</h2>
|
||||||
|
|
||||||
<p>{{ .test.Description }}</p>
|
<p>{{ .test.Description }}</p>
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ func TestGetView(c flamego.Context, t template.Template, data template.Data) {
|
|||||||
models.DB.Find(&test, testID)
|
models.DB.Find(&test, testID)
|
||||||
data["test"] = test
|
data["test"] = test
|
||||||
|
|
||||||
data["title"] = test.Name
|
data["title"] = test.Title
|
||||||
t.HTML(http.StatusOK, "test/view")
|
t.HTML(http.StatusOK, "test/view")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user