forked from phc/website
Pulizia di vecchio codice e qualche miglioria
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
|
||||
# Server config
|
||||
MODE=development
|
||||
HOST=localhost:8000
|
||||
|
||||
# Separate services
|
||||
GIT_URL=https://git.example.org
|
||||
FORUM_URL=https://forum.example.org
|
||||
|
||||
# Other
|
||||
EMAIL=mail@example.org
|
||||
|
||||
+12
-1
@@ -110,6 +110,12 @@ nav .nav-logo {
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--bg-darker-2);
|
||||
box-shadow: var(--shadow-1);
|
||||
|
||||
transition: transform 150ms ease-in-out;
|
||||
}
|
||||
|
||||
nav .nav-logo:hover {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
nav .nav-logo img {
|
||||
@@ -180,6 +186,11 @@ nav .nav-main .nav-item.dropdown {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
nav .nav-main .nav-item.dropdown .nav-items .nav-item:last-child {
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
nav .nav-main .nav-item.dropdown .name {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@@ -209,7 +220,6 @@ nav .nav-main .nav-item.dropdown .nav-items {
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--bg-darker-2);
|
||||
box-shadow: var(--shadow-1);
|
||||
|
||||
}
|
||||
/*
|
||||
nav .nav-main .nav-item.dropdown .nav-items::before {
|
||||
@@ -330,6 +340,7 @@ p {
|
||||
|
||||
a {
|
||||
color: var(--accent-1-fg);
|
||||
font-weight: var(--font-weight-medium);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
+13
-15
@@ -14,13 +14,16 @@ var Host string
|
||||
|
||||
var GitUrl string
|
||||
var ForumUrl string
|
||||
var Email string
|
||||
|
||||
func stringOrDefault(value, defaultValue string) string {
|
||||
func loadEnv(target *string, name, defaultValue string) {
|
||||
value := os.Getenv(name)
|
||||
if len(strings.TrimSpace(value)) == 0 {
|
||||
return defaultValue
|
||||
*target = defaultValue
|
||||
} else {
|
||||
*target = value
|
||||
}
|
||||
|
||||
return value
|
||||
log.Printf("%s = %v", name, *target)
|
||||
}
|
||||
|
||||
func Load() {
|
||||
@@ -28,17 +31,11 @@ func Load() {
|
||||
|
||||
log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
|
||||
|
||||
Mode = stringOrDefault(os.Getenv("MODE"), "production")
|
||||
log.Printf("MODE = %v", Mode)
|
||||
|
||||
Host = stringOrDefault(os.Getenv("HOST"), "localhost:8080")
|
||||
log.Printf("HOST = %v", Host)
|
||||
|
||||
GitUrl = stringOrDefault(os.Getenv("GIT_URL"), "https://git.phc.dm.unipi.it")
|
||||
log.Printf("GIT_URL = %v", GitUrl)
|
||||
|
||||
ForumUrl = stringOrDefault(os.Getenv("FORUM_URL"), "https://forum.phc.dm.unipi.it")
|
||||
log.Printf("FORUM_URL = %v", ForumUrl)
|
||||
loadEnv(&Mode, "MODE", "production")
|
||||
loadEnv(&Host, "HOST", "localhost:8080")
|
||||
loadEnv(&GitUrl, "GIT_URL", "https://git.example.org")
|
||||
loadEnv(&ForumUrl, "FORUM_URL", "https://forum.example.org")
|
||||
loadEnv(&Email, "EMAIL", "mail@example.org")
|
||||
}
|
||||
|
||||
func Object() util.H {
|
||||
@@ -47,5 +44,6 @@ func Object() util.H {
|
||||
"Host": Host,
|
||||
"GitUrl": GitUrl,
|
||||
"ForumUrl": ForumUrl,
|
||||
"Email": Email,
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -135,7 +135,7 @@
|
||||
|
||||
<footer>
|
||||
<div class="footer-item">
|
||||
macchinisti@poisson.phc.dm.xxxxx.xx
|
||||
{{ .Config.Email }}
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
+2
-7
@@ -5,20 +5,16 @@
|
||||
{{define "body"}}
|
||||
|
||||
<form action="/login" method="post">
|
||||
|
||||
<h2>
|
||||
<img class="icons8" src="https://img.icons8.com/ios-filled/50/000000/lock.png"/>
|
||||
<i class="fas fa-sign-in-alt"></i>
|
||||
Accedi
|
||||
</h2>
|
||||
|
||||
<p>
|
||||
Inserisci le tue credenziali di Poisson per accedere.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Per il recupero credenziali vieni direttamente al PHC per parlarne con calma o inviaci una mail.
|
||||
Per il recupero credenziali vieni direttamente al PHC a parlarne con calma con noi altrimenti puoi inviaci una email all'indirizzo <a href="mailto:{{ .Config.Email }}">{{ .Config.Email }}</a>.
|
||||
</p>
|
||||
|
||||
<div class="row">
|
||||
<label for="login-username">Username:</label>
|
||||
<input type="text" name="username" id="login-username">
|
||||
@@ -32,7 +28,6 @@
|
||||
<input type="submit" value="Accedi">
|
||||
<!-- <div class="hfill"></div> -->
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
{{end}}
|
||||
+6
-39
@@ -5,18 +5,17 @@
|
||||
{{define "body"}}
|
||||
<section>
|
||||
<h2>
|
||||
<img class="icons8" src="https://img.icons8.com/ios-filled/50/000000/find-user-male.png" />
|
||||
<i class="fas fa-users"></i>
|
||||
Utenti
|
||||
</h2>
|
||||
|
||||
<p>
|
||||
Questa è la lista di tutti gli utenti con un account su Poisson. Scrivi nome, cognome o username di un utente
|
||||
per filtrare la lista in tempo reale.
|
||||
<!-- TODO: Codice temporaneo -->
|
||||
<p style="text-align: center;">
|
||||
Questa è la lista di tutti gli utenti con un account su Poisson. Scrivi nome, cognome o username di un utente per filtrare la lista in tempo reale.
|
||||
</p>
|
||||
|
||||
<div class="search">
|
||||
<input type="text" id="search-field" placeholder="Cerca...">
|
||||
<img class="icons8" src="https://img.icons8.com/ios-filled/50/000000/search.png" />
|
||||
<i class="fas fa-search"></i>
|
||||
</div>
|
||||
|
||||
<div class="user-list">
|
||||
@@ -24,39 +23,7 @@
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', ({ }) => {
|
||||
const $userList = document.querySelector('.user-list');
|
||||
const $user = document.createElement('div');
|
||||
$user.innerHTML = `
|
||||
<div class="user">
|
||||
<div class="contact">
|
||||
<h3 class="fullname"></h3>
|
||||
<h4 class="username"></h4>
|
||||
</div>
|
||||
<div class="links">
|
||||
<a href="#">
|
||||
<img class="icons8" src="https://img.icons8.com/ios-filled/50/000000/web.png" />
|
||||
</a>
|
||||
<a href="#">
|
||||
<img class="icons8" src="https://img.icons8.com/ios-filled/50/000000/git.png" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
// Per mostrare che la pagina regge molti utenti senza laggare troppo
|
||||
Array(1400).fill(0).map(({ }, i) => {
|
||||
setTimeout(() => {
|
||||
// Pare che questa riga sia la più dispendiosa
|
||||
const $newUser = $user.cloneNode(true);
|
||||
|
||||
$newUser.querySelector('.fullname').innerHTML = `Persona ${i + 1}`;
|
||||
$newUser.querySelector('.username').innerHTML = `persona${i + 1}`;
|
||||
|
||||
$userList.appendChild($newUser.firstElementChild);
|
||||
}, 0)
|
||||
});
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user