mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
🎨 Clean code
This commit is contained in:
parent
bf1834fa61
commit
cd10fcf8f0
2 changed files with 78 additions and 74 deletions
|
|
@ -894,7 +894,10 @@ func renderTemplateCol(ial map[string]string, flashcard *Flashcard, rowValues []
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, rowValue := range rowValues {
|
for _, rowValue := range rowValues {
|
||||||
if 0 < len(rowValue.Values) {
|
if 1 > len(rowValue.Values) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
v := rowValue.Values[0]
|
v := rowValue.Values[0]
|
||||||
if av.KeyTypeNumber == v.Type {
|
if av.KeyTypeNumber == v.Type {
|
||||||
if nil != v.Number && v.Number.IsNotEmpty {
|
if nil != v.Number && v.Number.IsNotEmpty {
|
||||||
|
|
@ -939,7 +942,6 @@ func renderTemplateCol(ial map[string]string, flashcard *Flashcard, rowValues []
|
||||||
dataModel[rowValue.Key.Name] = v.String(true)
|
dataModel[rowValue.Key.Name] = v.String(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if err := tpl.Execute(buf, dataModel); nil != err {
|
if err := tpl.Execute(buf, dataModel); nil != err {
|
||||||
logging.LogWarnf("execute template [%s] failed: %s", tplContent, err)
|
logging.LogWarnf("execute template [%s] failed: %s", tplContent, err)
|
||||||
|
|
|
||||||
|
|
@ -1039,7 +1039,10 @@ func renderTemplateCol(ial map[string]string, rowValues []*av.KeyValues, tplCont
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, rowValue := range rowValues {
|
for _, rowValue := range rowValues {
|
||||||
if 0 < len(rowValue.Values) {
|
if 1 > len(rowValue.Values) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
v := rowValue.Values[0]
|
v := rowValue.Values[0]
|
||||||
if av.KeyTypeNumber == v.Type {
|
if av.KeyTypeNumber == v.Type {
|
||||||
if nil != v.Number && v.Number.IsNotEmpty {
|
if nil != v.Number && v.Number.IsNotEmpty {
|
||||||
|
|
@ -1084,7 +1087,6 @@ func renderTemplateCol(ial map[string]string, rowValues []*av.KeyValues, tplCont
|
||||||
dataModel[rowValue.Key.Name] = v.String(true)
|
dataModel[rowValue.Key.Name] = v.String(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if err := tpl.Execute(buf, dataModel); nil != err {
|
if err := tpl.Execute(buf, dataModel); nil != err {
|
||||||
logging.LogWarnf("execute template [%s] failed: %s", tplContent, err)
|
logging.LogWarnf("execute template [%s] failed: %s", tplContent, err)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue