mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-11-10 08:57:25 +01:00
Format message.tmpl
This commit is contained in:
parent
1761754865
commit
3c26deda30
@ -304,7 +304,7 @@ func HandleSearchBar(rw http.ResponseWriter, r *http.Request, buildInfo web.Buil
|
||||
}
|
||||
}
|
||||
default:
|
||||
web.RenderTemplate(rw, r, "message.tmpl", &web.Page{Title: "Warning", MsgType: "alert-warning", Message: fmt.Sprintf("Unknown search term %s", strings.Trim(splitSearch[0], " ")), User: *user, Roles: availableRoles, Build: buildInfo})
|
||||
web.RenderTemplate(rw, r, "message.tmpl", &web.Page{Title: "Warning", MsgType: "alert-warning", Message: fmt.Sprintf("Unknown search type: %s", strings.Trim(splitSearch[0], " ")), User: *user, Roles: availableRoles, Build: buildInfo})
|
||||
}
|
||||
} else if len(splitSearch) == 1 {
|
||||
|
||||
|
@ -1,11 +1,42 @@
|
||||
|
||||
{{define "content"}}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h2>{{.Title}}</h2>
|
||||
<div class="alert {{.MsgType}}" role="alert">
|
||||
{{.Message}}
|
||||
<div class="col messageCol">
|
||||
<div class="alert messageCard {{.MsgType}}" role="alert">
|
||||
{{if eq .MsgType "alert-info"}}
|
||||
<i class="bi-info-circle-fill messageIcon"></i>
|
||||
<b>{{.Message}}</b>
|
||||
{{else if eq .MsgType "alert-warning"}}
|
||||
<i class="bi-question-circle-fill messageIcon"></i>
|
||||
<b>{{.Message}}</b>
|
||||
{{else if eq .MsgType "alert-danger"}}
|
||||
<i class="bi-exclamation-circle-fill messageIcon"></i>
|
||||
<b>{{.Message}}</b>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{define "stylesheets"}}
|
||||
<style>
|
||||
.messageCol {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.messageCard {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 50%;
|
||||
padding-top: 2rem;
|
||||
padding-bottom: 2rem;
|
||||
}
|
||||
|
||||
.messageIcon {
|
||||
font-size: 2rem;
|
||||
margin-right:1rem;
|
||||
}
|
||||
</style>
|
||||
{{end}}
|
Loading…
Reference in New Issue
Block a user