Compare commits
3 Commits
fbfee0edaa
...
470624552d
Author | SHA1 | Date | |
---|---|---|---|
470624552d | |||
02181e53e1 | |||
002800d381 |
@ -1,5 +1,10 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"slices"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type AppLink struct {
|
||||
Title string
|
||||
Url string
|
||||
@ -8,24 +13,34 @@ type AppLink struct {
|
||||
}
|
||||
|
||||
func getAppLinks(tier, baseUri string) []AppLink {
|
||||
var output []AppLink
|
||||
|
||||
//Get Links Based on Tier
|
||||
if tier == "enterprise" {
|
||||
return getEnterpriseLinks(baseUri)
|
||||
output = getEnterpriseLinks(baseUri)
|
||||
} else if tier == "creator" {
|
||||
return getCreatorLinks(baseUri)
|
||||
output = getCreatorLinks(baseUri)
|
||||
} else if tier == "teams" {
|
||||
return getTeamsLinks(baseUri)
|
||||
output = getTeamsLinks(baseUri)
|
||||
} else {
|
||||
output = getStarterLinks(baseUri)
|
||||
}
|
||||
|
||||
return getStarterLinks(baseUri)
|
||||
//Sort in alphabetical order
|
||||
slices.SortFunc(output, func(a, b AppLink) int {
|
||||
return strings.Compare(a.Title, b.Title)
|
||||
})
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
func getStarterLinks(baseUri string) []AppLink {
|
||||
return []AppLink {
|
||||
{
|
||||
Title: "User Management",
|
||||
Description: "Create users and manage their access",
|
||||
Description: "Create and Manage Users",
|
||||
Image: "/static/img/users.png",
|
||||
Url: "https://panel." + baseUri,
|
||||
Url: "https://panel." + baseUri + "/log_in/",
|
||||
},
|
||||
{
|
||||
Title: "Nextcloud",
|
||||
@ -60,7 +75,7 @@ func getCreatorLinks(baseUri string) []AppLink {
|
||||
Title: "Wordpress",
|
||||
Description: "Your website",
|
||||
Image: "/static/img/wordpress.png",
|
||||
Url: "https://" + baseUri,
|
||||
Url: "https://" + baseUri + "/wp-admin",
|
||||
},
|
||||
}
|
||||
|
||||
@ -122,7 +137,7 @@ func getEnterpriseLinks(baseUri string) []AppLink {
|
||||
Title: "Castopod",
|
||||
Description: "Podcast Distribution",
|
||||
Image: "/static/img/castopod.png",
|
||||
Url: "https://castopod." + baseUri,
|
||||
Url: "https://castopod." + baseUri + "/cp-auth/login",
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -5,8 +5,10 @@ import (
|
||||
)
|
||||
|
||||
func (app *application) home(writer http.ResponseWriter, request *http.Request) {
|
||||
appLinks := getAppLinks(app.tier, app.host)
|
||||
|
||||
data := templateData{
|
||||
AppLinks: getAppLinks(app.tier, app.host),
|
||||
AppLinks: appLinks,
|
||||
Tier: app.tier,
|
||||
BaseUri: app.host,
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
{{template "main" .}}
|
||||
</main>
|
||||
<footer class="footer main-grid">
|
||||
<img class="footer__kitty" src="/static/img/kitty.png" alt="">
|
||||
<p class="footer__excerpt">Powered by <a href="https://www.federated.computer">Federated Computer</a></p>
|
||||
</footer>
|
||||
</body>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<div class="app-links-container">
|
||||
<!-- LOOP HERE -->
|
||||
{{range .AppLinks}}
|
||||
<a href="{{.Url}}" class="app-link-card-link">
|
||||
<a href="{{.Url}}" class="app-link-card-link" target="_blank">
|
||||
<div class="app-link-card">
|
||||
<img src="{{.Image}}" alt="" class="app-link-card__image">
|
||||
<h3 class="app-link-card__title">{{.Title}}</h3>
|
||||
|
@ -150,6 +150,8 @@ h1 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.footer__excerpt {
|
||||
.footer__excerpt,
|
||||
.footer__kitty {
|
||||
grid-column: 2/3;
|
||||
justify-self: center;
|
||||
}
|
BIN
ui/static/img/kitty.png
Normal file
BIN
ui/static/img/kitty.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
Loading…
Reference in New Issue
Block a user