Staff, patreon, and translations all proceedurally generate now

This commit is contained in:
computergeek125 2021-03-13 11:07:04 -06:00
parent b957d73acb
commit c65b4a267e
6 changed files with 136 additions and 353 deletions

View File

@ -43,6 +43,7 @@ class Helpers:
self.ensure_dir_exists(os.path.join(self.root_dir, 'app', 'config', 'db'))
self.db_path = os.path.join(self.root_dir, 'app', 'config', 'db', 'crafty.sqlite')
self.serverjar_cache = os.path.join(self.config_dir, 'serverjars.json')
self.credits_cache = os.path.join(self.config_dir, 'credits.json')
self.passhasher = PasswordHasher()
self.exiting = False

View File

@ -61,6 +61,11 @@ class PanelHandler(BaseHandler):
template = "public/error.html"
elif page == 'credits':
with open(helper.credits_cache) as republic_credits_will_do:
credits = json.load(republic_credits_will_do)
page_data["patreons"] = credits["patreons"]
page_data["staff"] = credits["staff"]
page_data["translations"] = credits["translations"]
template = "panel/credits.html"
elif page == 'contribute':
@ -324,7 +329,7 @@ class PanelHandler(BaseHandler):
user_data = json.loads(self.get_secure_cookie("user_data"))
exec_user = db_helper.get_user(user_data['user_id'])
if not exec_user.superuser:
if not exec_user['superuser']:
self.redirect("/panel/error?error=Unauthorized access: not superuser")
return False
elif server_id is None:
@ -569,4 +574,4 @@ class PanelHandler(BaseHandler):
"Edited role {} (RID:{}) with servers {}".format(role_name, role_id, servers),
server_id=0,
source_ip=self.get_remote_ip())
self.redirect("/panel/panel_config")
self.redirect("/panel/panel_config")

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -27,9 +27,74 @@
<div class="col-md-12 grid-margin">
<div class="card">
<div class="card-body">
<div class="card-header header-sm d-flex justify-content-between align-items-center">
<h4 class="card-title"><i class="far fa-code"></i> &nbsp;Development Team</h4>
</div>
<div class="row">
{% for person in data['staff']['development'] %}
<div class="col-md-6 mb-5">
<div class="card rounded shadow-none">
<div class="card-body">
<div class="row">
<div class="col-md-4">
<div class="user-avatar mb-auto">
<img src="{{ person['pic'] }}"
alt="profile image" class="profile-img img-lg rounded-circle">
</div>
<div class="wrapper">
<div class="wrapper d-flex align-items-center">
<h4 class="mb-0 font-weight-medium">{{ person['name'] }}</h4>
</div>
<div class="wrapper d-flex align-items-center font-weight-medium text-muted">
<i class="mdi mdi-map-marker-outline mr-2"></i>
<p class="mb-0 text-muted">{{ person['loc'] }}</p>
</div>
</div>
</div>
<div class="col-md-8">
<div class="wrapper d-flex align-items-start">
{% if person['tags'][0] %}
<span class="btn btn-sm btn-info mr-2">{{ person['tags'][0] }}</span>
{% end %}
{% if person['tags'][1] %}
<span class="btn btn-sm btn-primary mr-2">{{ person['tags'][1] }}</span>
{% end %}
{% if person['tags'][2] %}
{% if type(person['tags'][2]) is list %}
<a href="{{ person['tags'][2][1] }}" class="btn btn-sm btn-inverse-success mr-2">{{ person['tags'][2][0] }}</a>
{% else %}
<span class="btn btn-sm btn-inverse-success mr-2">{{ person['tags'][2] }}</span>
{% end %}
{% end %}
</div>
<div class="wrapper d-flex align-items-start pt-3">
{% if person['title'] %}
Crafty's {{ person['title'] }}<br /><br />
{% end %}
{{ person['blurb'] }}
</div>
</div>
</div>
</div>
</div>
</div>
{% end %}
</div> <!-- end of user row -->
<div class="card-header header-sm d-flex justify-content-between align-items-center">
<h4 class="card-title"><i class="fa fa-book"></i> &nbsp;Support and Documentation Team</h4>
</div>
<div class="row">
{% for person in data['staff']['support'] %}
<div class="col-md-6 mb-5">
<div class="card rounded shadow-none">
<div class="card-body">
@ -38,74 +103,44 @@
<div class="col-md-4">
<div class="user-avatar mb-auto">
<img src="/static/assets/images/credits/ptarrant_cropped.png"
<img src="{{ person['pic'] }}"
alt="profile image" class="profile-img img-lg rounded-circle">
</div>
<div class="wrapper">
<div class="wrapper d-flex align-items-center">
<h4 class="mb-0 font-weight-medium">Phillip Tarrant</h4>
<h4 class="mb-0 font-weight-medium">{{ person['name'] }}</h4>
</div>
<div class="wrapper d-flex align-items-center font-weight-medium text-muted">
<i class="mdi mdi-map-marker-outline mr-2"></i>
<p class="mb-0 text-muted">Atlanta, GA</p>
<p class="mb-0 text-muted">{{ person['loc'] }}</p>
</div>
</div>
</div>
<div class="col-md-8">
<div class="wrapper d-flex align-items-start">
<span class="btn btn-sm btn-info mr-2">Staff</span>
<span class="btn btn-sm btn-primary mr-2">Developer</span>
<a href="https://en.wikipedia.org/wiki/Benevolent_dictator_for_life" class="btn btn-sm btn-inverse-success mr-2">BDFL</a>
{% if person['tags'][0] %}
<span class="btn btn-sm btn-info mr-2">{{ person['tags'][0] }}</span>
{% end %}
{% if person['tags'][1] %}
<span class="btn btn-sm btn-primary mr-2">{{ person['tags'][1] }}</span>
{% end %}
{% if person['tags'][2] %}
{% if type(person['tags'][2]) is list %}
<a href="{{ person['tags'][2][1] }}" class="btn btn-sm btn-inverse-success mr-2">{{ person['tags'][2][0] }}</a>
{% else %}
<span class="btn btn-sm btn-inverse-success mr-2">{{ person['tags'][2] }}</span>
{% end %}
{% end %}
</div>
<div class="wrapper d-flex align-items-start pt-3">
Crafty's Benevolent Dictator for Life.<br /><br />
His interests include Linux, cybersecurity, hacking, and gaming.
He enjoys downtime with the family, and playing with his chickens.
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6 mb-5">
<div class="card rounded shadow-none">
<div class="card-body">
<div class="row">
<div class="col-md-4">
<div class="user-avatar mb-auto">
<img src="/static/assets/images/credits/pita_cropped.png"
alt="profile image" class="profile-img img-lg rounded-circle">
</div>
<div class="wrapper">
<div class="wrapper d-flex align-items-center">
<h4 class="mb-0 font-weight-medium">Pita Bread</h4>
</div>
<div class="wrapper d-flex align-items-center font-weight-medium text-muted">
<i class="mdi mdi-map-marker-outline mr-2"></i>
<p class="mb-0 text-muted">Midwest, USA</p>
</div>
</div>
</div>
<div class="col-md-8">
<div class="wrapper d-flex align-items-start">
<span class="btn btn-sm btn-info mr-2">Staff</span>
<span class="btn btn-sm btn-inverse-success mr-2">Community Leader</span>
</div>
<div class="wrapper d-flex align-items-start pt-3">
His interests include bread, Linux, and networking.
He enjoys pumpkins, organizing, and long-winded emails, but hates wifi.
{% if person['title'] %}
Crafty's {{ person['title'] }}<br /><br />
{% end %}
{{ person['blurb'] }}
</div>
</div>
</div>
@ -113,99 +148,17 @@
</div>
</div>
</div>
{% end %}
</div> <!-- end user row-->
<div class="row">
<div class="col-md-6 mb-5">
<div class="card rounded shadow-none">
<div class="card-body">
<div class="row">
<div class="col-md-4">
<div class="user-avatar mb-auto">
<img src="/static/assets/images/credits/kevdagoat.jpeg"
alt="profile image" class="profile-img img-lg rounded-circle">
</div>
<div class="wrapper">
<div class="wrapper d-flex align-items-center">
<h4 class="mb-0 font-weight-medium">Kev Dagoat</h4>
</div>
<div class="wrapper d-flex align-items-center font-weight-medium text-muted">
<i class="mdi mdi-map-marker-outline mr-2"></i>
<p class="mb-0 text-muted">East Coast, AU</p>
</div>
</div>
</div>
<div class="col-md-8">
<div class="wrapper d-flex align-items-start">
<span class="btn btn-sm btn-info mr-2">Staff</span>
<span class="btn btn-sm btn-primary mr-2">Developer</span>
<span class="btn btn-sm btn-inverse-success mr-2">HOD</span>
</div>
<div class="wrapper d-flex align-items-start pt-3">
Crafty's Head Of Development<br /><br />
His interests include Linux, programming, and goats of course.
He enjoys building APIs, K8s, and Geeking over video cards.
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6 mb-5">
<div class="card rounded shadow-none">
<div class="card-body">
<div class="row">
<div class="col-md-4">
<div class="user-avatar mb-auto">
<img src="/static/assets/images/credits/mcgaming.png"
alt="profile image" class="profile-img img-lg rounded-circle">
</div>
<div class="wrapper">
<div class="wrapper d-flex align-items-center">
<h4 class="mb-0 font-weight-medium">MC Gaming</h4>
</div>
<div class="wrapper d-flex align-items-center font-weight-medium text-muted">
<i class="mdi mdi-map-marker-outline mr-2"></i>
<p class="mb-0 text-muted">Central, UK</p>
</div>
</div>
</div>
<div class="col-md-8">
<div class="wrapper d-flex align-items-start">
<span class="btn btn-sm btn-info mr-2">Staff</span>
<span class="btn btn-sm btn-primary mr-2">Developer</span>
</div>
<div class="wrapper d-flex align-items-start pt-3">
His interests include learning, Linux, programming.
He loves pentesting apps and gaming.
</div>
</div>
</div>
</div>
</div>
</div>
</div> <!-- end user row-->
<div class="card-header header-sm d-flex justify-content-between align-items-center">
<h4 class="card-title"><i class="far fa-server"></i> &nbsp;Retired Staff</h4>
</div>
<div class="row">
{% for person in data['staff']['retired'] %}
<div class="col-md-6 mb-5">
<div class="card rounded shadow-none">
<div class="card-body">
@ -214,200 +167,44 @@
<div class="col-md-4">
<div class="user-avatar mb-auto">
<img src="/static/assets/images/credits/andrew_cropped.png"
<img src="{{ person['pic'] }}"
alt="profile image" class="profile-img img-lg rounded-circle">
</div>
<div class="wrapper">
<div class="wrapper d-flex align-items-center">
<h4 class="mb-0 font-weight-medium">Andrew Redacted</h4>
<h4 class="mb-0 font-weight-medium">{{ person['name'] }}</h4>
</div>
<div class="wrapper d-flex align-items-center font-weight-medium text-muted">
<i class="mdi mdi-map-marker-outline mr-2"></i>
<p class="mb-0 text-muted">East Coast, USA</p>
<p class="mb-0 text-muted">{{ person['loc'] }}</p>
</div>
</div>
</div>
<div class="col-md-8">
<div class="wrapper d-flex align-items-start">
<span class="btn btn-sm btn-info mr-2">Staff</span>
<span class="btn btn-sm btn-inverse-success mr-2">Support Manager</span>
{% if person['tags'][0] %}
<span class="btn btn-sm btn-info mr-2">{{ person['tags'][0] }}</span>
{% end %}
{% if person['tags'][1] %}
<span class="btn btn-sm btn-primary mr-2">{{ person['tags'][1] }}</span>
{% end %}
{% if person['tags'][2] %}
{% if type(person['tags'][2]) is list %}
<a href="{{ person['tags'][2][1] }}" class="btn btn-sm btn-inverse-success mr-2">{{ person['tags'][2][0] }}</a>
{% else %}
<span class="btn btn-sm btn-inverse-success mr-2">{{ person['tags'][2] }}</span>
{% end %}
{% end %}
</div>
<div class="wrapper d-flex align-items-start pt-3">
His interests include Linux, gaming, and helping others. When he's able to
unplug he enjoys biking, hiking, and playing soccer.
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6 mb-5">
<div class="card rounded shadow-none">
<div class="card-body">
<div class="row">
<div class="col-md-4">
<div class="user-avatar mb-auto">
<img src="/static/assets/images/credits/manu_cropped.png"
alt="profile image" class="profile-img img-lg rounded-circle">
</div>
<div class="wrapper">
<div class="wrapper d-flex align-items-center">
<h4 class="mb-0 font-weight-medium">Manu Redacted</h4>
</div>
<div class="wrapper d-flex align-items-center font-weight-medium text-muted">
<i class="mdi mdi-map-marker-outline mr-2"></i>
<p class="mb-0 text-muted">Eastern, CA</p>
</div>
</div>
</div>
<div class="col-md-8">
<div class="wrapper d-flex align-items-start">
<span class="btn btn-sm btn-info mr-2">Staff</span>
<span class="btn btn-sm btn-primary mr-2">Developer</span>
<span class="btn btn-sm btn-inverse-success mr-2">Project Manager</span>
</div>
<div class="wrapper d-flex align-items-start pt-3">
His interests include learning, Linux, and programming.
He enjoys speaking French, doing 6 things at once, and testing software.
</div>
</div>
</div>
</div>
</div>
</div>
</div> <!-- end user row-->
<div class="row">
<div class="col-md-6 mb-5">
<div class="card rounded shadow-none">
<div class="card-body">
<div class="row">
<div class="col-md-4">
<div class="user-avatar mb-auto">
<img src="/static/assets/images/credits/ultrablack_cropped.png"
alt="profile image" class="profile-img img-lg rounded-circle">
</div>
<div class="wrapper">
<div class="wrapper d-flex align-items-center">
<h4 class="mb-0 font-weight-medium">UltraBlack</h4>
</div>
<div class="wrapper d-flex align-items-center font-weight-medium text-muted">
<i class="mdi mdi-map-marker-outline mr-2"></i>
<p class="mb-0 text-muted">Bavaria, DE</p>
</div>
</div>
</div>
<div class="col-md-8">
<div class="wrapper d-flex align-items-start">
<span class="btn btn-sm btn-info mr-2">Staff</span>
<span class="btn btn-sm btn-inverse-success mr-2">Idea Manager</span>
</div>
<div class="wrapper d-flex align-items-start pt-3">
Hi, my name is Tim, and I'm a huge fan of linux.
I'm often gaming and occasionally coding.
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6 mb-5">
<div class="card rounded shadow-none">
<div class="card-body">
<div class="row">
<div class="col-md-4">
<div class="user-avatar mb-auto">
<img src="/static/assets/images/credits/macgeek_cropped.png"
alt="profile image" class="profile-img img-lg rounded-circle">
</div>
<div class="wrapper">
<div class="wrapper d-flex align-items-center">
<h4 class="mb-0 font-weight-medium">Mac Geek</h4>
</div>
<div class="wrapper d-flex align-items-center font-weight-medium text-muted">
<i class="mdi mdi-map-marker-outline mr-2"></i>
<p class="mb-0 text-muted">Eastern, USA</p>
</div>
</div>
</div>
<div class="col-md-8">
<div class="wrapper d-flex align-items-start">
<span class="btn btn-sm btn-info mr-2">Staff</span>
<span class="btn btn-sm btn-primary mr-2">Developer</span>
<span class="btn btn-sm btn-inverse-success mr-2">Support Manager</span>
</div>
<div class="wrapper d-flex align-items-start pt-3">
His interests include all things programming, and Pokemon.
He enjoys a good tech tangent, gaming, and playing on his phone.
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6 mb-5">
<div class="card rounded shadow-none">
<div class="card-body">
<div class="row">
<div class="col-md-4">
<div class="user-avatar mb-auto">
<img src="/static/assets/images/credits/lukas_cropped.png"
alt="profile image" class="profile-img img-lg rounded-circle">
</div>
<div class="wrapper">
<div class="wrapper d-flex align-items-center">
<h4 class="mb-0 font-weight-medium">ThatOneLukas</h4>
</div>
<div class="wrapper d-flex align-items-center font-weight-medium text-muted">
<i class="mdi mdi-map-marker-outline mr-2"></i>
<p class="mb-0 text-muted">Helsinki, FI</p>
</div>
</div>
</div>
<div class="col-md-8">
<div class="wrapper d-flex align-items-start">
<span class="btn btn-sm btn-info mr-2">Staff</span>
<span class="btn btn-sm btn-primary mr-2">Developer</span>
</div>
<div class="wrapper d-flex align-items-start pt-3">
His interests include programming, gaming, and electronics.
He likes gaming, programming, messing around with electronics, and time with his family.
{% if person['title'] %}
Crafty's {{ person['title'] }}<br /><br />
{% end %}
{{ person['blurb'] }}
</div>
</div>
</div>
@ -415,9 +212,9 @@
</div>
</div>
</div>
{% end %}
</div> <!-- end user row-->
</div>
</div>
</div>
@ -438,31 +235,22 @@
</tr>
</thead>
<tbody>
{% for pat in data["patreons"] %}
<tr>
<td>Richard B</td>
<td>{{ pat["name"] }}</td>
<td>
{% if pat["level"] == "substainer" %}
<span class="btn btn-sm btn-info mr-2">Substainer</span>
</td>
</tr>
<tr>
<td>John C</td>
<td>
{% elif pat["level"] == "advocate" %}
<span class="btn btn-sm btn-primary mr-2">Advocate</span>
{% elif pat["level"] == "supporter" %}
<span class="btn btn-sm btn-inverse-success mr-2">Supporter</span>
{% else %}
<span class="btn btn-sm btn-secondary mr-2">Other</span>
{% end %}
</td>
</tr>
<tr>
<td>Nicolas T</td>
<td>
<span class="btn btn-sm btn-info mr-2">Substainer</span>
</td>
</tr>
<tr>
<td>Lightkeeper</td>
<td>
<span class="btn btn-sm btn-info mr-2">Substainer</span>
</td>
</tr>
{% end %}
</tbody>
</table>
@ -483,27 +271,16 @@
</tr>
</thead>
<tbody>
{% for person in data['translations'] %}
<tr>
<td>Ultrablack</td>
<td>{{ person }}</td>
<td>
<span class="btn btn-sm btn-inverse-success mr-2">German</span>
{% for language in data['translations'][person] %}
<span class="btn btn-sm btn-inverse-success mr-2">{{ language }}</span>
{% end %}
</td>
</tr>
<tr>
<td>Manu</td>
<td>
<span class="btn btn-sm btn-inverse-success mr-2">French</span>
</td>
</tr>
<tr>
<td>ptarrant</td>
<td>
<span class="btn btn-sm btn-inverse-success mr-2">Sarcasm</span>
</td>
</tr>
{% end %}
</tbody>
</table>
</div>