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