Show CDS State

This commit is contained in:
2025-05-23 21:18:05 +02:00
parent bc79e0ac2c
commit d332e83f29
3 changed files with 22 additions and 1 deletions

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
}
})
})
}
})