Show CDS State

This commit is contained in:
snoutie committed 2025-05-23 21:18:05 +02:00
1 parent bc79e0ac2c
commit d332e83f29
3 files changed
+22 -1

No files matched your search

+17
View File
@@ -9,6 +9,7 @@ import (
"code.achtarmig.org/pas/ui/element"
"code.achtarmig.org/pas/ui/element/boxedlist"
"code.achtarmig.org/pas/ui/element/boxedlist/expander"
"code.achtarmig.org/pas/ui/element/input"
"code.achtarmig.org/pas/ui/element/option"
"code.achtarmig.org/pas/ui/element/placeholder"
"code.achtarmig.org/pas/ui/element/view"
@@ -30,6 +31,22 @@ func results(v *view.Element, m *model.ResultsModel) element.ElementInterface {
http.Redirect(w, r, "/cds?q="+url.QueryEscape(result.TechnicalName.String()), http.StatusSeeOther)
return errors.New("redirect")
}
p.HasSuffix = true
input.New(p, "ReleaseState_"+result.TechnicalName.String(), input.TypeText, func(p *input.Element) {
p.Shape = option.ShapePill
p.MaxWidth = 6
p.Disabled = true
p.Justify = option.JustifyCenter
p.SetData(result.StateTitle.String())
if result.State == "RELEASED" {
p.DisplayStyle = option.DisplayStyleSuccess
} else {
p.DisplayStyle = option.DisplayStyleError
}
})
})
}
})