Files
work_cation/views/showCards.go
T

27 lines
779 B
Go

package views
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/container"
"work_cation/global"
"work_cation/models"
"work_cation/repo"
"work_cation/views/showView"
)
func myCardsViews(w fyne.Window) fyne.CanvasObject {
var items []fyne.CanvasObject
for _, baseCard := range repo.BaseCard.FindAll(global.DB) {
switch baseCard.ToolType {
case models.ToolTypeErlang:
erlangCard := repo.ErlangCardRepo.Find(global.DB, baseCard.UUID)
items = append(items, showView.ErlangCardView(w, &erlangCard))
case models.ToolTypeExecFiles:
var baseCardCopy = baseCard
items = append(items, showView.ExecFileCardView(w, &baseCardCopy))
}
}
return container.NewBorder(nil, nil, nil, nil, container.NewScroll(
container.NewGridWrap(fyne.NewSize(200, 200), items...)))
}