Flexbox + show referral

This commit is contained in:
rxdn 2021-02-07 19:56:53 +00:00
parent bdea08d078
commit d8c8bb5081
10 changed files with 214 additions and 142 deletions

View File

@ -21,5 +21,7 @@ func IndexHandler(ctx *gin.Context) {
"name": store.Get("name").(string), "name": store.Get("name").(string),
"baseurl": config.Conf.Server.BaseUrl, "baseurl": config.Conf.Server.BaseUrl,
"avatar": store.Get("avatar").(string), "avatar": store.Get("avatar").(string),
"referralShow": config.Conf.Referral.Show,
"referralLink": config.Conf.Referral.Link,
}) })
} }

View File

@ -38,5 +38,7 @@ func WhitelabelHandler(ctx *gin.Context) {
"name": store.Get("name").(string), "name": store.Get("name").(string),
"baseurl": config.Conf.Server.BaseUrl, "baseurl": config.Conf.Server.BaseUrl,
"avatar": store.Get("avatar").(string), "avatar": store.Get("avatar").(string),
"referralShow": config.Conf.Referral.Show,
"referralLink": config.Conf.Referral.Link,
}) })
} }

View File

@ -18,6 +18,7 @@ type (
Bot Bot Bot Bot
Redis Redis Redis Redis
Cache Cache Cache Cache
Referral Referral
} }
Server struct { Server struct {
@ -68,6 +69,11 @@ type (
Cache struct { Cache struct {
Uri string Uri string
} }
Referral struct {
Show bool
Link string
}
) )
var ( var (
@ -113,6 +119,7 @@ func fromEnvvar() {
oauthId, _ := strconv.ParseUint(os.Getenv("OAUTH_ID"), 10, 64) oauthId, _ := strconv.ParseUint(os.Getenv("OAUTH_ID"), 10, 64)
redisPort, _ := strconv.Atoi(os.Getenv("REDIS_PORT")) redisPort, _ := strconv.Atoi(os.Getenv("REDIS_PORT"))
redisThreads, _ := strconv.Atoi(os.Getenv("REDIS_THREADS")) redisThreads, _ := strconv.Atoi(os.Getenv("REDIS_THREADS"))
showReferral, _ := strconv.ParseBool(os.Getenv("REFERRAL_SHOW"))
Conf = Config{ Conf = Config{
Admins: admins, Admins: admins,
@ -156,5 +163,9 @@ func fromEnvvar() {
Cache: Cache{ Cache: Cache{
Uri: os.Getenv("CACHE_URI"), Uri: os.Getenv("CACHE_URI"),
}, },
Referral: Referral{
Show: showReferral,
Link: os.Getenv("REFERRAL_LINK"),
},
} }
} }

View File

@ -22,3 +22,5 @@
- REDIS_PASSWORD - REDIS_PASSWORD
- REDIS_THREADS - REDIS_THREADS
- CACHE_URI - CACHE_URI
- REFERRAL_SHOW
- REFERRAL_LINK

View File

@ -26,16 +26,55 @@ html > ::-webkit-scrollbar {
display: none; display: none;
} }
.sidebar { .csidebar {
display: inline-flex; display: flex;
flex-direction: column;
height: 100%; height: 100%;
width: 16.6%; width: 16.6%;
background-color: #4C566A; background-color: #272727;
float: left; float: left;
background-size: cover; background-size: cover;
overflow-x: hidden !important; overflow-x: hidden !important;
} }
.sidebar-element {
display: flex;
align-items: center;
flex-basis: 100%;
width: 100%;
cursor: pointer;
padding: 5px 0 5px 0;
}
.sidebar-element:hover {
background-color: #121212;
transition: background-color 0.5s ease;
}
#referral-image {
max-height: 70px;
max-width: 90%;
}
.sidebar-element > a {
display: flex;
align-items: center;
width: 100%;
color: white !important;
font-size: 18px;
margin-left: 2%;
}
.sidebar-text {
margin-left: 4%;
display: flex;
align-items: center;
}
#sidebar-nav {
flex: 1;
}
.sidebar-bottom { .sidebar-bottom {
position: absolute !important; position: absolute !important;
width: 100%; width: 100%;
@ -45,6 +84,20 @@ html > ::-webkit-scrollbar {
color: white !important; color: white !important;
} }
.super-container {
display: flex;
}
.content {
width: 100%;
}
.content-container {
display: flex;
width: 100%;
margin: 4%;
}
.filterCard { .filterCard {
cursor: pointer; cursor: pointer;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

View File

@ -1,33 +1,40 @@
{{define "sidebar"}} {{define "sidebar"}}
<div class="sidebar" id="sidebar-gradient"> <div class="csidebar" id="sidebar-gradient">
<div class="sidebar-wrapper"> <div class="sidebar-container" id="sidebar-nav">
<ul class="nav"> <div class="sidebar-element">
<li class="nav-item sidebar-bottom">
<a href="/"> <a href="/">
<i class="fas fa-server"></i> <i class="fas fa-server"></i>
<p>Servers</p> <span class="sidebar-text">Servers</span>
</a> </a>
</li> </div>
<li class="nav-item sidebar-bottom" style="top: 60px"> <div class="sidebar-element">
<a href="/whitelabel"> <a href="/whitelabel">
<i class="fas fa-robot"></i> <i class="fas fa-robot"></i>
<p>Whitelabel</p> <span class="sidebar-text">Whitelabel</span>
</a> </a>
</li> </div>
<li class="nav-item sidebar-bottom" style="bottom: 60px"> {{if .referralShow}}
<div class="sidebar-element">
<a href="{{.referralLink}}" style="justify-content: center; padding: 10px 0 10px 0 !important; margin: 0 !important;">
<img src="/assets/img/referral.png" alt="Referral" id="referral-image" />
</a>
</div>
{{end}}
</div>
<div class="sidebar-container" style="margin-bottom: 2%">
<div class="sidebar-element">
<a href="/logout" onclick="clearLocalStorage();"> <a href="/logout" onclick="clearLocalStorage();">
<i class="fas fa-sign-out-alt"></i> <i class="sidebar-icon fas fa-sign-out-alt"></i>
<p>Logout</p> <span class="sidebar-text">Logout</span>
</a> </a>
</li> </div>
<li class="nav-item sidebar-bottom" style="bottom: 10px"> <div class="sidebar-element">
<a href="#"> <a>
<i id="avatar-sidebar"></i> <i id="avatar-sidebar"></i>
<p>{{.name}}</p> <span class="sidebar-text">{{.name}}</span>
</a> </a>
</li> </div>
</ul>
</div> </div>
</div> </div>
{{end}} {{end}}

View File

@ -6,13 +6,14 @@
<body> <body>
<div class="wrapper"> <div class="wrapper">
{{template "sidebar" .}} {{template "sidebar" .}}
{{template "sidebar" .}} <div class="super-container">
<div class="main-panel">
{{template "loadingscreen" .}} {{template "loadingscreen" .}}
<script src="/assets/js/modalbackdrop.js"></script> <script src="/assets/js/modalbackdrop.js"></script>
{{template "notifymodal" .}} {{template "notifymodal" .}}
<div class="content-container">
{{template "content" .}} {{template "content" .}}
</div> </div>
</div> </div>
</div>
</body> </body>
</html> </html>

View File

@ -1,8 +1,5 @@
{{define "content"}} {{define "content"}}
<div class="content"> <div class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h4 class="card-title">Servers</h4> <h4 class="card-title">Servers</h4>
@ -25,9 +22,6 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div>
<script> <script>
async function getPermissionLevel(guildId) { async function getPermissionLevel(guildId) {