simplify css

This commit is contained in:
Izalia Mae 2024-03-04 02:19:26 -05:00
parent 33102f9e4e
commit 4cbf83a7b7
20 changed files with 81 additions and 224 deletions

View file

@ -145,7 +145,6 @@ class WatchHandler(PatternMatchingEventHandler):
if event.event_type not in ['modified', 'created', 'deleted']: if event.event_type not in ['modified', 'created', 'deleted']:
return return
print(event.src_path)
self.run_proc(restart = True) self.run_proc(restart = True)

View file

@ -11,7 +11,7 @@
%title << {{config.name}}: {{page}} %title << {{config.name}}: {{page}}
%meta(charset="UTF-8") %meta(charset="UTF-8")
%meta(name="viewport" content="width=device-width, initial-scale=1") %meta(name="viewport" content="width=device-width, initial-scale=1")
%link(rel="stylesheet" type="text/css" href="/style.css?page={{page}}") %link(rel="stylesheet" type="text/css" href="/style.css")
-block head -block head
%body %body
@ -51,7 +51,7 @@
-if message -if message
.message.section -> =message .message.section -> =message
#content #content(class="page-{{page.lower().replace(' ', '_')}}")
-block content -block content
#footer.section #footer.section

View file

@ -2,7 +2,7 @@
-set page="Config" -set page="Config"
-block content -block content
%form.section(action="/admin/config" method="POST") %form.section(action="/admin/config" method="POST")
#config-options .grid-2col
%label(for="name") << Name %label(for="name") << Name
%input(id = "name" name="name" placeholder="Relay Name" value="{{config.name or ''}}") %input(id = "name" name="name" placeholder="Relay Name" value="{{config.name or ''}}")

View file

@ -4,7 +4,7 @@
%details.section %details.section
%summary << Ban Domain %summary << Ban Domain
%form(action="/admin/domain_bans" method="POST") %form(action="/admin/domain_bans" method="POST")
#add-domain #add-item
%label(for="domain") << Domain %label(for="domain") << Domain
%input(type="domain" id="domain" name="domain" placeholder="Domain") %input(type="domain" id="domain" name="domain" placeholder="Domain")
@ -16,7 +16,7 @@
%input(type="submit" value="Ban Domain") %input(type="submit" value="Ban Domain")
#domains.section #data-table.section
%table %table
%thead %thead
%tr %tr
@ -31,7 +31,7 @@
%details %details
%summary -> =ban.domain %summary -> =ban.domain
%form(action="/admin/domain_bans" method="POST") %form(action="/admin/domain_bans" method="POST")
.items .grid-2col
.reason << Reason .reason << Reason
%textarea.reason(id="reason" name="reason") << {{ban.reason or ""}} %textarea.reason(id="reason" name="reason") << {{ban.reason or ""}}

View file

@ -4,7 +4,7 @@
%details.section %details.section
%summary << Add Instance %summary << Add Instance
%form(target="/admin/instances" method="POST") %form(target="/admin/instances" method="POST")
#add-instance #add-item
%label(for="domain") << Domain %label(for="domain") << Domain
%input(type="domain" id="domain" name="domain" placeholder="Domain") %input(type="domain" id="domain" name="domain" placeholder="Domain")
@ -19,7 +19,7 @@
%input(type="submit" value="Add Instance") %input(type="submit" value="Add Instance")
#instances.section #data-table.section
%table %table
%thead %thead
%tr %tr

View file

@ -4,7 +4,7 @@
%details.section %details.section
%summary << Ban Software %summary << Ban Software
%form(action="/admin/software_bans" method="POST") %form(action="/admin/software_bans" method="POST")
#add-software #add-item
%label(for="name") << Name %label(for="name") << Name
%input(id="name" name="name" placeholder="Name") %input(id="name" name="name" placeholder="Name")
@ -16,7 +16,7 @@
%input(type="submit" value="Ban Software") %input(type="submit" value="Ban Software")
#software.section #data-table.section
%table %table
%thead %thead
%tr %tr
@ -31,7 +31,7 @@
%details %details
%summary -> =ban.name %summary -> =ban.name
%form(action="/admin/software_bans" method="POST") %form(action="/admin/software_bans" method="POST")
.items .grid-2col
.reason << Reason .reason << Reason
%textarea.reason(id="reason" name="reason") << {{ban.reason or ""}} %textarea.reason(id="reason" name="reason") << {{ban.reason or ""}}

View file

@ -4,7 +4,7 @@
%details.section %details.section
%summary << Add User %summary << Add User
%form(target="/admin/users", method="POST") %form(target="/admin/users", method="POST")
#add-user #add-item
%label(for="username") << Username %label(for="username") << Username
%input(id="username" name="username" placeholder="Username") %input(id="username" name="username" placeholder="Username")
@ -19,7 +19,7 @@
%input(type="submit" value="Add User") %input(type="submit" value="Add User")
#users.section #data-table.section
%table %table
%thead %thead
%tr %tr

View file

@ -4,13 +4,13 @@
%details.section %details.section
%summary << Add Domain %summary << Add Domain
%form(target="/admin/whitelist" method="POST") %form(target="/admin/whitelist" method="POST")
#add-domain #add-item
%label(for="domain") << Domain %label(for="domain") << Domain
%input(type="domain" id="domain" name="domain" placeholder="Domain") %input(type="domain" id="domain" name="domain" placeholder="Domain")
%input(type="submit" value="Add Domain") %input(type="submit" value="Add Domain")
#whitelist.section #data-table.section
%table %table
%thead %thead
%tr %tr

View file

@ -19,7 +19,7 @@
Note: The whitelist is enabled on this instance. Ask the admin to add your instance Note: The whitelist is enabled on this instance. Ask the admin to add your instance
before joining. before joining.
#instances.section #data-table.section
%table %table
%thead %thead
%tr %tr
@ -29,5 +29,8 @@
%tbody %tbody
-for instance in instances -for instance in instances
%tr %tr
%td.instance -> %a(href="https://{{instance.domain}}/" target="_new") -> =instance.domain %td.instance -> %a(href="https://{{instance.domain}}/" target="_new")
%td.date -> =instance.created.strftime("%Y-%m-%d") =instance.domain
%td.date
=instance.created.strftime("%Y-%m-%d")

View file

@ -2,8 +2,11 @@
-set page="Login" -set page="Login"
-block content -block content
%form.section(action="/login" method="post") %form.section(action="/login" method="post")
.grid-2col
%label(for="username") << Username %label(for="username") << Username
%input(id="username" name="username" placeholder="Username" value="{{username or ''}}") %input(id="username" name="username" placeholder="Username" value="{{username or ''}}")
%label(for="password") << Password %label(for="password") << Password
%input(id="password" name="password" placeholder="Password" type="password") %input(id="password" name="password" placeholder="Password" type="password")
%input(type="submit" value="Login") %input(type="submit" value="Login")

View file

@ -15,13 +15,6 @@
--spacing: 10px; --spacing: 10px;
} }
body {
color: var(--text);
background-color: #222;
margin: var(--spacing);
font-family: sans serif;
}
a { a {
color: var(--primary); color: var(--primary);
text-decoration: none; text-decoration: none;
@ -32,10 +25,26 @@ a:hover {
text-decoration: underline; text-decoration: underline;
} }
body {
color: var(--text);
background-color: #222;
margin: var(--spacing);
font-family: sans serif;
}
details *:nth-child(2) {
margin-top: 5px;
}
details summary { details summary {
cursor: pointer; cursor: pointer;
} }
form input[type="submit"] {
display: block;
margin: 0 auto;
}
p { p {
line-height: 1em; line-height: 1em;
margin: 0px; margin: 0px;
@ -90,6 +99,10 @@ table tbody td {
background-color: var(--table-background); background-color: var(--table-background);
} }
textarea {
height: calc(5em);
}
#container { #container {
width: 1024px; width: 1024px;
margin: 0px auto; margin: 0px auto;
@ -190,6 +203,23 @@ table tbody td {
text-align: right text-align: right
} }
#add-item {
display: grid;
grid-template-columns: max-content auto;
grid-gap: var(--spacing);
margin-top: var(--spacing);
margin-bottom: var(--spacing);
align-items: center;
}
#data-table td:first-child {
width: 100%;
}
#data-table .date {
width: max-content;
text-align: right;
}
.button { .button {
background-color: var(--primary); background-color: var(--primary);
@ -219,6 +249,15 @@ table tbody td {
border: 1px solid var(--error-border) !important; border: 1px solid var(--error-border) !important;
} }
.grid-2col {
display: grid;
grid-template-columns: max-content auto;
grid-gap: var(--spacing);
margin-bottom: var(--spacing);
align-items: center;
}
.message { .message {
color: var(--message-text) !important; color: var(--message-text) !important;
background-color: var(--message-background) !important; background-color: var(--message-background) !important;
@ -241,9 +280,10 @@ table tbody td {
} }
{% if page %} /* config */
{% include "style/" + page.lower().replace(" ", "_") + ".css" %} #content.page-config input[type="checkbox"] {
{% endif %} justify-self: left;
}
@media (max-width: 1026px) { @media (max-width: 1026px) {
@ -273,7 +313,8 @@ table tbody td {
} }
.section { .section {
border-width: 0px; border-left-width: 0px;
border-right-width: 0px;
border-radius: 0px; border-radius: 0px;
} }
} }

View file

@ -1,20 +0,0 @@
#config-options {
display: grid;
grid-template-columns: max-content auto;
grid-gap: var(--spacing);
margin-bottom: var(--spacing);
align-items: center;
}
form input[type="submit"] {
display: block;
margin: 0 auto;
}
form input[type="checkbox"] {
justify-self: left;
}
textarea {
height: 4em;
}

View file

@ -1,32 +0,0 @@
form input[type="submit"] {
display: block;
margin: 0 auto;
}
textarea {
height: calc(5em);
}
table .items {
display: grid;
grid-template-columns: max-content auto;
grid-gap: var(--spacing);
margin-top: var(--spacing);
}
#domains .domain {
width: 100%;
}
#domains .date {
width: max-content;
text-align: right;
}
#add-domain {
display: grid;
grid-template-columns: max-content auto;
grid-gap: var(--spacing);
margin-top: var(--spacing);
margin-bottom: var(--spacing);
}

View file

@ -1,16 +0,0 @@
#instances table {
width: 100%;
}
#instances .instance {
width: 100%;
}
#instances .date {
width: max-content;
text-align: right;
}
#instances thead td {
text-align: center !important;
}

View file

@ -1,25 +0,0 @@
form input[type="submit"] {
display: block;
margin: 0 auto;
}
#instances .instance {
width: 100%;
}
#instances .software {
text-align: center;
}
#instances .date {
width: max-content;
text-align: right;
}
#add-instance {
display: grid;
grid-template-columns: max-content auto;
grid-gap: var(--spacing);
margin-top: var(--spacing);
margin-bottom: var(--spacing);
}

View file

@ -1,18 +0,0 @@
label, input {
margin: 0 auto;
display: block;
}
label, input:not([type="submit"]) {
width: 50%;
}
input:not([type="submit"]) {
margin-bottom: var(--spacing);
}
@media (max-width: 1026px) {
label, input:not([type="submit"]) {
width: 75%;
}
}

View file

@ -1,32 +0,0 @@
form input[type="submit"] {
display: block;
margin: 0 auto;
}
textarea {
height: calc(5em);
}
table .items {
display: grid;
grid-template-columns: max-content auto;
grid-gap: var(--spacing);
margin-top: var(--spacing);
}
#software .name{
width: 100%;
}
#software .date {
width: max-content;
text-align: right;
}
#add-software {
display: grid;
grid-template-columns: max-content auto;
grid-gap: var(--spacing);
margin-top: var(--spacing);
margin-bottom: var(--spacing);
}

View file

@ -1,25 +0,0 @@
form input[type="submit"] {
display: block;
margin: 0 auto;
}
#users .username {
width: 100%;
}
#users .handle {
text-align: center;
}
#users .date {
width: max-content;
text-align: right;
}
#add-user {
display: grid;
grid-template-columns: max-content auto;
grid-gap: var(--spacing);
margin-top: var(--spacing);
margin-bottom: var(--spacing);
}

View file

@ -1,21 +0,0 @@
form input[type="submit"] {
display: block;
margin: 0 auto;
}
#whitelist .domain{
width: 100%;
}
#whitelist .date {
width: max-content;
text-align: right;
}
#add-domain {
display: grid;
grid-template-columns: max-content auto;
grid-gap: var(--spacing);
margin-top: var(--spacing);
margin-bottom: var(--spacing);
}

View file

@ -440,5 +440,5 @@ class AdminConfig(View):
@register_route('/style.css') @register_route('/style.css')
class StyleCss(View): class StyleCss(View):
async def get(self, request: Request) -> Response: async def get(self, request: Request) -> Response:
data = self.template.render('style.css', self, page = request.query.getone('page', "")) data = self.template.render('style.css', self)
return Response.new(data, ctype = 'css') return Response.new(data, ctype = 'css')