Compare commits
1
Commits
main
...
feat-admin
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d358825da7 |
@@ -0,0 +1,123 @@
|
|||||||
|
---
|
||||||
|
import Header from '@/components/Header.astro'
|
||||||
|
import BaseLayout from '@/layouts/BaseLayout.astro'
|
||||||
|
---
|
||||||
|
|
||||||
|
<BaseLayout title="Admin | PHC" pageTags={'admin'}>
|
||||||
|
<Header />
|
||||||
|
<div class="layout-admin">
|
||||||
|
<div class="sidebar">
|
||||||
|
<nav>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a href="/admin">
|
||||||
|
<span class="material-symbols-outlined">dashboard</span>
|
||||||
|
Dashboard
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="/admin/utenti">
|
||||||
|
<span class="material-symbols-outlined">group</span>
|
||||||
|
Utenti
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="/admin/appunti">
|
||||||
|
<span class="material-symbols-outlined">book_2</span>
|
||||||
|
Appunti
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="/admin/database">
|
||||||
|
<span class="material-symbols-outlined">database</span>
|
||||||
|
Database
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
<div class="admin-dashboard-grid max-width-content">
|
||||||
|
<div class="card">
|
||||||
|
<div class="title">
|
||||||
|
<a href="/admin/utenti">Utenti</a>
|
||||||
|
</div>
|
||||||
|
<div class="text">Statistiche degli utenti di Poisson e PHC</div>
|
||||||
|
<div class="boxes">
|
||||||
|
<div class="box">
|
||||||
|
<div class="title">Utenti Poisson</div>
|
||||||
|
<div class="material-symbols-outlined extra-large">group</div>
|
||||||
|
<div class="description">1356</div>
|
||||||
|
</div>
|
||||||
|
<div class="box">
|
||||||
|
<div class="title">Utenti PHC</div>
|
||||||
|
<div class="material-symbols-outlined extra-large">group</div>
|
||||||
|
<div class="description">345</div>
|
||||||
|
</div>
|
||||||
|
<div class="box">
|
||||||
|
<div class="title">Utenti con account collegato</div>
|
||||||
|
<div class="material-symbols-outlined extra-large">group</div>
|
||||||
|
<div class="description">56</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card">
|
||||||
|
<div class="title">
|
||||||
|
<a href="/admin/appunti">Appunti</a>
|
||||||
|
</div>
|
||||||
|
<div class="text">Statistiche degli Appunti</div>
|
||||||
|
<div class="boxes">
|
||||||
|
<div class="box">
|
||||||
|
<div class="title">Appunti Caricati</div>
|
||||||
|
<div class="material-symbols-outlined extra-large">book_2</div>
|
||||||
|
<div class="description">567</div>
|
||||||
|
</div>
|
||||||
|
<div class="box">
|
||||||
|
<div class="title">Appunti Pubblicati</div>
|
||||||
|
<div class="material-symbols-outlined extra-large">book_2</div>
|
||||||
|
<div class="description">345</div>
|
||||||
|
</div>
|
||||||
|
<div class="box">
|
||||||
|
<div class="title">In attesa di revisione</div>
|
||||||
|
<div class="material-symbols-outlined extra-large">book_2</div>
|
||||||
|
<div class="description">234</div>
|
||||||
|
</div>
|
||||||
|
<div class="box">
|
||||||
|
<div class="title">Spazio Usato (di Minio)</div>
|
||||||
|
<div class="material-symbols-outlined extra-large">storage</div>
|
||||||
|
<div class="description">34.5 GB</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card">
|
||||||
|
<div class="title">
|
||||||
|
<a href="/admin/database">Database</a>
|
||||||
|
</div>
|
||||||
|
<div class="text">Statistiche del Database</div>
|
||||||
|
<div class="boxes">
|
||||||
|
<div class="box">
|
||||||
|
<div class="title">Record nel database</div>
|
||||||
|
<div class="material-symbols-outlined extra-large">database</div>
|
||||||
|
<div class="description">3456</div>
|
||||||
|
</div>
|
||||||
|
<div class="box">
|
||||||
|
<div class="title">Record modificati</div>
|
||||||
|
<div class="material-symbols-outlined extra-large">database</div>
|
||||||
|
<div class="description">234</div>
|
||||||
|
</div>
|
||||||
|
<div class="box">
|
||||||
|
<div class="title">Record eliminati</div>
|
||||||
|
<div class="material-symbols-outlined extra-large">database</div>
|
||||||
|
<div class="description">56</div>
|
||||||
|
</div>
|
||||||
|
<div class="box">
|
||||||
|
<div class="title">Spazio utilizzato</div>
|
||||||
|
<div class="material-symbols-outlined extra-large">storage</div>
|
||||||
|
<div class="description">39.5 MB</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</BaseLayout>
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
---
|
||||||
|
import Header from '@/components/Header.astro'
|
||||||
|
import BaseLayout from '@/layouts/BaseLayout.astro'
|
||||||
|
---
|
||||||
|
|
||||||
|
<BaseLayout title="Utenti | Admin | PHC" pageTags={'admin'}>
|
||||||
|
<Header />
|
||||||
|
<div class="layout-admin">
|
||||||
|
<div class="sidebar">
|
||||||
|
<nav>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<a href="/admin">
|
||||||
|
<span class="material-symbols-outlined">dashboard</span>
|
||||||
|
Dashboard
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="/admin/utenti">
|
||||||
|
<span class="material-symbols-outlined">group</span>
|
||||||
|
Utenti
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="/admin/appunti">
|
||||||
|
<span class="material-symbols-outlined">book_2</span>
|
||||||
|
Appunti
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="/admin/database">
|
||||||
|
<span class="material-symbols-outlined">database</span>
|
||||||
|
Database
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
<div class="admin-table max-width-content">
|
||||||
|
<div class="table-header">
|
||||||
|
<div class="table-title">
|
||||||
|
<span class="material-symbols-outlined">group</span>
|
||||||
|
Utenti
|
||||||
|
</div>
|
||||||
|
<div class="table-actions">
|
||||||
|
<a href="/admin/utenti/aggiungi" class="button">Aggiungi</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="table-filter stack-h">
|
||||||
|
<input type="text" class="fill-w shrink" placeholder="Cerca utente" />
|
||||||
|
<button class="icon">
|
||||||
|
<div class="material-symbols-outlined">search</div>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="table-body">
|
||||||
|
<div class="table-row header">
|
||||||
|
<div class="table-cell">Nome</div>
|
||||||
|
<div class="table-cell">Cognome</div>
|
||||||
|
<div class="table-cell">Email</div>
|
||||||
|
<div class="table-cell">Ruolo</div>
|
||||||
|
<div class="table-cell">Azioni</div>
|
||||||
|
</div>
|
||||||
|
{
|
||||||
|
Array.from({ length: 50 }).map(() => (
|
||||||
|
<Fragment>
|
||||||
|
<div class="table-row">
|
||||||
|
<div class="table-cell">Mario</div>
|
||||||
|
<div class="table-cell">Rossi</div>
|
||||||
|
<div class="table-cell">mario@rossi.com</div>
|
||||||
|
<div class="table-cell">studente</div>
|
||||||
|
<div class="table-cell">
|
||||||
|
<a href="/admin/utenti/modifica" class="button icon">
|
||||||
|
<div class="material-symbols-outlined">edit</div>
|
||||||
|
</a>
|
||||||
|
<a href="/admin/utenti/elimina" class="button icon">
|
||||||
|
<div class="material-symbols-outlined">delete</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Fragment>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</BaseLayout>
|
||||||
@@ -26,6 +26,10 @@
|
|||||||
font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
|
font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
|
||||||
|
|
||||||
max-width: 32px;
|
max-width: 32px;
|
||||||
|
|
||||||
|
&.extra-large {
|
||||||
|
font-size: 48px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
@@ -818,4 +822,210 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.layout-admin {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: minmax(12rem, auto) 1fr;
|
||||||
|
|
||||||
|
background: #f8f8f8;
|
||||||
|
|
||||||
|
> .sidebar {
|
||||||
|
display: grid;
|
||||||
|
gap: 1rem;
|
||||||
|
padding: 1rem;
|
||||||
|
padding-right: calc(1rem + 2px);
|
||||||
|
|
||||||
|
background: #e0e0e0;
|
||||||
|
border-right: 2px solid var(--palette-black);
|
||||||
|
|
||||||
|
> nav {
|
||||||
|
> ul {
|
||||||
|
display: grid;
|
||||||
|
gap: 1rem;
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
list-style: none;
|
||||||
|
|
||||||
|
align-content: start;
|
||||||
|
|
||||||
|
> li {
|
||||||
|
> a {
|
||||||
|
display: grid;
|
||||||
|
grid-auto-flow: column;
|
||||||
|
justify-content: start;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
gap: 0.25rem;
|
||||||
|
padding: 0.25rem;
|
||||||
|
|
||||||
|
color: #222;
|
||||||
|
background: #b0b0b0;
|
||||||
|
font-family: 'Iosevka', monospace;
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
@include neo-brutalist-card(2px, 2px);
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #c0c0c0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
> .content {
|
||||||
|
padding: 3rem 0;
|
||||||
|
|
||||||
|
display: grid;
|
||||||
|
align-content: start;
|
||||||
|
justify-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-dashboard-grid {
|
||||||
|
display: grid;
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(auto, 31rem));
|
||||||
|
grid-auto-rows: auto;
|
||||||
|
|
||||||
|
place-content: center;
|
||||||
|
|
||||||
|
gap: 2rem;
|
||||||
|
|
||||||
|
--card-base: #ffb6a0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-table {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
@include neo-brutalist-card;
|
||||||
|
|
||||||
|
display: grid;
|
||||||
|
grid-template-rows: auto auto;
|
||||||
|
|
||||||
|
padding: 1rem;
|
||||||
|
gap: 1rem;
|
||||||
|
|
||||||
|
background: #b6ffa0;
|
||||||
|
|
||||||
|
font-size: 16px;
|
||||||
|
|
||||||
|
.table-header {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr auto;
|
||||||
|
|
||||||
|
.table-title {
|
||||||
|
display: grid;
|
||||||
|
grid-auto-flow: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: start;
|
||||||
|
|
||||||
|
gap: 0.5rem;
|
||||||
|
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 32px;
|
||||||
|
|
||||||
|
> * {
|
||||||
|
font-size: 32px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-body {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(5, auto);
|
||||||
|
grid-auto-rows: auto;
|
||||||
|
|
||||||
|
grid-auto-flow: row;
|
||||||
|
|
||||||
|
@include neo-brutalist-card;
|
||||||
|
|
||||||
|
background: #a0ffb6;
|
||||||
|
|
||||||
|
.table-row {
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: subgrid;
|
||||||
|
|
||||||
|
&:not(:last-child) {
|
||||||
|
border-bottom: 2px solid #0009;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.header {
|
||||||
|
font-weight: 600;
|
||||||
|
|
||||||
|
.table-cell {
|
||||||
|
background: #5ec576;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-cell {
|
||||||
|
display: grid;
|
||||||
|
align-items: center;
|
||||||
|
grid-auto-flow: column;
|
||||||
|
justify-content: start;
|
||||||
|
|
||||||
|
gap: 0.5rem;
|
||||||
|
|
||||||
|
padding: 0.25rem;
|
||||||
|
|
||||||
|
&:not(:last-child) {
|
||||||
|
border-right: 2px solid #0009;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
.table-cell:first-child {
|
||||||
|
border-top-left-radius: 0.25rem;
|
||||||
|
}
|
||||||
|
.table-cell:last-child {
|
||||||
|
border-top-right-radius: 0.25rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxes {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
|
||||||
|
grid-template-rows: auto 1fr auto;
|
||||||
|
|
||||||
|
gap: 0.25rem 0.5rem;
|
||||||
|
|
||||||
|
user-select: none;
|
||||||
|
|
||||||
|
.title,
|
||||||
|
.description {
|
||||||
|
font-family: 'Iosevka', monospace;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 16px;
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .box {
|
||||||
|
display: grid;
|
||||||
|
|
||||||
|
grid-column: span 1;
|
||||||
|
grid-row: 1 / -1;
|
||||||
|
|
||||||
|
grid-template-rows: subgrid;
|
||||||
|
|
||||||
|
place-items: center;
|
||||||
|
|
||||||
|
background: #0002;
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
|
||||||
|
padding: 0.5rem;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #0003;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ $screen-desktop-min: 1024px;
|
|||||||
|
|
||||||
:root {
|
:root {
|
||||||
--palette-black: #222;
|
--palette-black: #222;
|
||||||
|
|
||||||
--border-large: 4px solid var(--palette-black);
|
--border-large: 4px solid var(--palette-black);
|
||||||
|
|
||||||
--header-bg: #fff;
|
--header-bg: #fff;
|
||||||
|
|||||||
@@ -15,3 +15,69 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.stack-v {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
&.fit > * {
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.center {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
> * {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > .fill {
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > .shrink {
|
||||||
|
flex-shrink: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.stack-h {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
|
||||||
|
&.fit > * {
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.center {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
> * {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > .fill {
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > .shrink {
|
||||||
|
flex-shrink: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.fill-w {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fill-h {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.max-width-content {
|
||||||
|
max-width: 64rem;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user