Fix missing foil count in web view
This commit is contained in:
parent
4d0e75d806
commit
541a4bbd19
@ -3,6 +3,7 @@ package serra
|
||||
import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
"text/template"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/spf13/cobra"
|
||||
@ -16,6 +17,10 @@ func init() {
|
||||
rootCmd.AddCommand(webCmd)
|
||||
}
|
||||
|
||||
func add(a, b int64) int64 {
|
||||
return a + b
|
||||
}
|
||||
|
||||
var webCmd = &cobra.Command{
|
||||
Aliases: []string{"a"},
|
||||
Use: "web",
|
||||
@ -38,6 +43,9 @@ type Query struct {
|
||||
|
||||
func startWeb() error {
|
||||
router := gin.Default()
|
||||
router.SetFuncMap(template.FuncMap{
|
||||
"add": add,
|
||||
})
|
||||
router.LoadHTMLGlob("templates/*.tmpl")
|
||||
router.Static("/assets", "./assets")
|
||||
|
||||
|
||||
@ -168,7 +168,7 @@
|
||||
<tbody>
|
||||
{{range .cards}}
|
||||
<tr>
|
||||
<td>{{.SerraCount}}</td>
|
||||
<td>{{ add .SerraCount .SerraCountFoil }}</td>
|
||||
<td>
|
||||
<div class="cardpreview"><strong>{{.Name }}</strong>
|
||||
<span class="cardpreviewtext">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user