diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..c6a6fff7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# https://editorconfig.org + +root = true + +[*.{js,py,html}] +charset = utf-8 +insert_final_newline = true +# end_of_line = lf + +[*.py] +indent_style = space +indent_size = 4 + +[*.{js,html}] +indent_style = space +indent_size = 2 diff --git a/app/classes/web/panel_handler.py b/app/classes/web/panel_handler.py index 8a6abe67..f97f7611 100644 --- a/app/classes/web/panel_handler.py +++ b/app/classes/web/panel_handler.py @@ -264,13 +264,25 @@ class PanelHandler(BaseHandler): template = "public/error.html" elif page == 'credits': - with open(helper.credits_cache, encoding='utf-8') as republic_credits_will_do: - credits_dict: dict = json.load(republic_credits_will_do) + with open(helper.credits_cache, encoding='utf-8') as credits_default_local: + try: + remote = requests.get('https://craftycontrol.com/credits', allow_redirects=True) + credits_dict: dict = remote.json() + if not credits_dict["staff"]: + logger.error("Issue with upstream Staff, using local.") + credits_dict: dict = json.load(credits_default_local) + except: + logger.error("Request to credits bucket failed, using local.") + credits_dict: dict = json.load(credits_default_local) + timestamp = credits_dict["lastUpdate"] / 1000.0 page_data["patrons"] = credits_dict["patrons"] page_data["staff"] = credits_dict["staff"] page_data["translations"] = credits_dict["translations"] - page_data["lastUpdate"] = str(datetime.datetime.fromtimestamp(timestamp).strftime('%Y-%m-%d %H:%M:%S')) + if timestamp == 0: + page_data["lastUpdate"] = '😿' + else: + page_data["lastUpdate"] = str(datetime.datetime.fromtimestamp(timestamp).strftime('%Y-%m-%d %H:%M:%S')) template = "panel/credits.html" elif page == 'contribute': diff --git a/app/config/credits.json b/app/config/credits.json index 3f5540a4..1b2888aa 100644 --- a/app/config/credits.json +++ b/app/config/credits.json @@ -1,311 +1,132 @@ { "staff": { - "development": [ - { - "name": "Phil Tarrant", - "title": "Creator", - "loc": "Southeast, USA", - "tags": [ - "Staff", - [ - "Developer", - "https://gitlab.com/Ptarrant1" - ], - "Creator" - ], - "blurb": "For best results, apply a thin layer of Phillip to code, cyber security, and parenthood for maximum effectiveness. Phillip often spends too much time with his chickens.", - "pic": "/static/assets/images/credits/ptarrant.png" - }, - { - "name": "Pita Bread", - "title": "Leadership Team", - "loc": "Midwest, USA", - "tags": [ - "Staff", - [ - "Developer", - "https://gitlab.com/craftbreadth" - ], - "Community Leader" - ], - "blurb": "Baked goods enthusiast who dabbles in Linux and sets up networks for fun. Can be found writing long-winded emails, debugging strange wifi issues, or taking care of his extensive houseplant collection.", - "pic": "/static/assets/images/credits/pita.png" - }, - { - "name": "macgeek", - "title": "Leadership Team", - "loc": "Midwest, USA", - "tags": [ - "Staff", - [ - "Developer", - "https://gitlab.com/computergeek125" - ], - "Project Manager" - ], - "blurb": "Sysadmin for work and sysadmin for fun (avid homelabber). He enjoys a good tech tangent and gaming.", - "pic": "/static/assets/images/credits/macgeek.png" - }, - { - "name": "parzivaldewey", - "title": null, - "loc": "East Coast, USA", - "tags": [ - "Staff", - [ - "Developer", - "https://gitlab.com/amcmanu3" - ], - "Support Manager" - ], - "blurb": "His interests include Linux, gaming, and helping others. When he's able to unplug he enjoys biking, hiking, and playing soccer.", - "pic": "/static/assets/images/credits/parzivaldewey.png" - }, - { - "name": "Xithical", - "title": null, - "loc": "Midwest, USA", - "tags": [ - "Staff", - [ - "Developer", - "https://gitlab.com/xithical" - ], - null - ], - "blurb": "Having sold his soul to the IT administration gods many eons ago, you can usually find him working, going home to do work, or continuing to work in the support Discord.", - "pic": "/static/assets/images/credits/xithical.png" - }, - { - "name": "MC Gaming", - "title": null, - "loc": "Central, UK", - "tags": [ - "Staff", - [ - "Developer", - "https://gitlab.com/MCgamin1738" - ], - null - ], - "blurb": "His interests include learning, Linux, and programming. He loves pentesting apps and gaming.", - "pic": "/static/assets/images/credits/mcgaming.png" - }, - { - "name": "Silversthorn", - "title": null, - "loc": "Provence, FR", - "tags": [ - "Staff", - [ - "Developer", - "https://gitlab.com/Silversthorn" - ], - null - ], - "blurb": "Developer at work and at home, testing his own code is a pain, so his coding precept is \"Testing is Doubting\"", - "pic": "/static/assets/images/credits/silversthorn.png" - }, - { - "name": "ThatOneLukas", - "title": null, - "loc": "Helsinki, FI", - "tags": [ - "Staff", - [ - "Developer", - "https://gitlab.com/LukasDoesDev" - ], - null - ], - "blurb": "Lukas enjoys bashing his head at the table while his code does not work", - "pic": "/static/assets/images/credits/lukas.png" - }, - { - "name": "Zedifus", - "title": null, - "loc": "Scotland, UK", - "tags": [ - "Staff", - [ - "Developer", - "https://gitlab.com/Zedifus" - ], - "DevOps" - ], - "blurb": "A Streamer, who is currently working in the insurance industry, self-teaching software development & DevOps, with the hopes of a career change! Enjoys playing games and has a sassy cat called Eve.", - "pic": "/static/assets/images/credits/zedifus.jpg" - } - ], - "support": [ - { - "name": "iSilverfyre", - "title": null, - "loc": null, - "tags": [ - "Staff", - "Wiki", - null - ], - "blurb": "Silver enjoys helping others with their computer needs, writing documentation, and loving her cat.", - "pic": "/static/assets/images/credits/isilverfyre.png" - }, - { - "name": "Quentin", - "title": null, - "loc": null, - "tags": [ - "Staff", - [ - "Developer", - "https://gitlab.com/qub3d" - ], - "Wiki" - ], - "blurb": "Hosts Minecraft servers for his weird friends, works for an IoT company as his dayjob. The 's' in IoT stands for 'secure'.", - "pic": "/static/assets/images/credits/qub3d.png" - } - ], - "retired": [ - { - "name": "Kev Dagoat", - "title": "Head of Development", - "loc": "East Coast, AU", - "tags": [ - "Staff", - [ - "Developer", - "https://gitlab.com/kevdagoat" - ], - "HOD" - ], - "blurb": "His interests include Linux, programming, and goats of course. He enjoys building APIs, K8s, and geeking over video cards.", - "pic": "/static/assets/images/credits/kevdagoat.jpeg" - }, - { - "name": "Manu", - "title": null, - "loc": "Eastern, CA", - "tags": [ - "Staff", - "Developer", - "Project Manager" - ], - "blurb": "His interests include learning, Linux, and programming. He enjoys speaking French, doing 6 things at once, and testing software.", - "pic": "/static/assets/images/credits/manu.png" - }, - { - "name": "UltraBlack", - "title": null, - "loc": "Bavaria, DE", - "tags": [ - "Staff", - null, - "Idea Manager" - ], - "blurb": "Hi, my name is Tim, and I'm a huge fan of linux. I'm often gaming and occasionally coding.", - "pic": "/static/assets/images/credits/ultrablack.png" - } - ] + "development": [ + { + "name": "Pita Bread", + "title": "CEO", + "loc": "Midwest, USA", + "tags": [ "Staff", [ "Developer", "https://gitlab.com/craftbreadth" ], "Crafty Leadership" ], + "blurb": "Baked goods enthusiast who dabbles in Linux and sets up networks for fun. Can be found writing long-winded emails, debugging strange wifi issues, or taking care of his extensive houseplant collection.", + "pic": "/static/assets/images/credits/pita.png" + }, + { + "name": "Xithical", + "title": "CFO/COO", + "loc": "Midwest, USA", + "tags": [ "Staff", [ "Developer", "https://gitlab.com/xithical" ], "Crafty Leadership" ], + "blurb": "Having sold his soul to the IT administration gods many eons ago, you can usually find him working, going home to do work, or continuing to work in the support Discord.", + "pic": "/static/assets/images/credits/xithical.png" + }, + { + "name": "Phil Tarrant", + "title": "Creator", + "loc": "Southeast, USA", + "tags": [ "Staff", [ "Developer", "https://gitlab.com/Ptarrant1" ], "Crafty Advisor" ], + "blurb": "For best results, apply a thin layer of Phillip to code, cyber security, and parenthood for maximum effectiveness. Phillip often spends too much time with his chickens.", + "pic": "/static/assets/images/credits/ptarrant.png" + }, + { + "name": "macgeek", + "title": "Lead Software Engineer", + "loc": "Midwest, USA", + "tags": [ "Staff", [ "Developer", "https://gitlab.com/computergeek125" ], "Crafty Advisor" ], + "blurb": "Sysadmin for work and sysadmin for fun (avid homelabber). He enjoys a good tech tangent and gaming.", + "pic": "/static/assets/images/credits/macgeek.png" + }, + { + "name": "parzivaldewey", + "title": "Support Manager", + "loc": "East Coast, USA", + "tags": [ "Staff", [ "Developer", "https://gitlab.com/amcmanu3" ], "Support Manager" ], + "blurb": "His interests include Linux, gaming, and helping others. When he's able to unplug he enjoys biking, hiking, and playing soccer.", + "pic": "/static/assets/images/credits/parzivaldewey.png" + }, + { + "name": "Silversthorn", + "title": "Software Engineer", + "loc": "Provence, FR", + "tags": [ "Staff", [ "Developer", "https://gitlab.com/Silversthorn" ], null ], + "blurb": "Developer at work and at home, testing his own code is a pain, so his coding precept is \"Testing is Doubting\"", + "pic": "/static/assets/images/credits/silversthorn.png" + }, + { + "name": "ThatOneLukas", + "title": "Software Engineer", + "loc": "Helsinki, FI", + "tags": [ "Staff", [ "Developer", "https://gitlab.com/LukasDoesDev" ], null ], + "blurb": "Arch Linux enthusiast who likes 80s/90s music, Rust (The programming language) and light distros like Arch Linux btw. Dislikes C, C++, Go, and Microsoft. Also doesn't like Finnish weather that freezes molten snow to (deadly) ice.", + "pic": "/static/assets/images/credits/lukas.png" + }, + { + "name": "Zedifus", + "title": "DevOps Engineer", + "loc": "Scotland, UK", + "tags": [ "Staff", [ "Developer", "https://gitlab.com/Zedifus" ], "DevOps" ], + "blurb": "A Streamer, who is currently working in the insurance industry, self-teaching software development & DevOps, with the hopes of a career change! Enjoys playing games and has a sassy cat called Eve.", + "pic": "/static/assets/images/credits/zedifus.jpg" + } + ], + "support": [ + { + "name": "iSilverfyre", + "title": "Community Manager", + "loc": "South Central, US", + "tags": [ "Staff", null, "Wiki" ], + "blurb": "Silver enjoys helping others with their computer needs, writing documentation, and loving her cat.", + "pic": "/static/assets/images/credits/isilverfyre.png" + }, + { + "name": "Quentin", + "title": "Document Curator", + "loc": null, + "tags": [ "Staff", [ "Developer", "https://gitlab.com/qub3d" ], "Wiki" ], + "blurb": "Hosts Minecraft servers for his weird friends, works for an IoT company as his dayjob. The 's' in IoT stands for 'secure'.", + "pic": "/static/assets/images/credits/qub3d.png" + } + ], + "retired": [ + { + "name": "Kev Dagoat", + "title": "Head of Development", + "loc": "East Coast, AU", + "tags": [ "Staff", [ "Developer", "https://gitlab.com/kevdagoat" ], "HOD" ], + "blurb": "His interests include Linux, programming, and goats of course. He enjoys building APIs, K8s, and geeking over video cards.", + "pic": "/static/assets/images/credits/kevdagoat.jpeg" + }, + { + "name": "Manu", + "title": null, + "loc": "Eastern, CA", + "tags": [ "Staff", "Developer", "Project Manager" ], + "blurb": "His interests include learning, Linux, and programming. He enjoys speaking French, doing 6 things at once, and testing software.", + "pic": "/static/assets/images/credits/manu.png" + }, + { + "name": "UltraBlack", + "title": null, + "loc": "Bavaria, DE", + "tags": [ "Staff", null, "Idea Manager" ], + "blurb": "Hi, my name is Tim, and I'm a huge fan of linux. I'm often gaming and occasionally coding.", + "pic": "/static/assets/images/credits/ultrablack.png" + }, + { + "name": "MC Gaming", + "title": null, + "loc": "Central, UK", + "tags": [ "Staff", [ "Developer", "https://gitlab.com/MCgamin1738" ], null ], + "blurb": "His interests include learning, Linux, and programming. He loves pentesting apps and gaming.", + "pic": "/static/assets/images/credits/mcgaming.png" + } + ] }, "translations": { - "ptarrant": [ - "Sarcasm", - "Wit" - ], - "Lukas": [ - "Finnish" - ], - "Manu": [ - "French" - ], - "Silversthorn": [ - "French" - ], - "UltraBlack": [ - "German" - ], - "Zedifus": [ - "LOLCAT (Kingdum ov Katz)" - ] + "Data Unavailable": ["🌎🪣🔗👎😭"] }, "patrons": [ { - "name": "Richard B", - "level": "Crafty Sustainer" - }, - { - "name": "JOHN C", - "level": "Crafty Advocate" - }, - { - "name": "iSilverfyre", - "level": "Crafty Sustainer" - }, - { - "name": "Dean R", - "level": "Crafty Sustainer" - }, - { - "name": "scott m", - "level": "Crafty Sustainer" - }, - { - "name": "Lino", - "level": "Crafty Sustainer" - }, - { - "name": "PeterPorker3", - "level": "Crafty Supporter" - }, - { - "name": "Ewari", - "level": "Crafty Supporter" - }, - { - "name": "Thyodas", - "level": "Crafty Sustainer" - }, - { - "name": "AngryPanda", - "level": "Crafty Sustainer" - }, - { - "name": "Chris T", - "level": "Crafty Sustainer" - }, - { - "name": "Adam B", - "level": "Crafty Sustainer" - }, - { - "name": "Eric G", - "level": "Crafty Sustainer" - }, - { - "name": "Chris B", - "level": "Crafty Sustainer" - }, - { - "name": "Emmet d", - "level": "Crafty Sustainer" - }, - { - "name": "Steven T", - "level": "Crafty Sustainer" - }, - { - "name": "Row H", - "level": "Crafty Supporter" - }, - { - "name": "vorboid", - "level": "Crafty Supporter" - }, - { - "name": "Justman", - "level": "Crafty Sustainer" + "name": "Data Unavailable 🌎🪣🔗👎😭", + "level": "" } ], - "lastUpdate": 1637635758855 + "lastUpdate": 0 } diff --git a/app/frontend/static/assets/js/shared/misc.js b/app/frontend/static/assets/js/shared/misc.js index 5d05697f..f39bf482 100755 --- a/app/frontend/static/assets/js/shared/misc.js +++ b/app/frontend/static/assets/js/shared/misc.js @@ -207,6 +207,10 @@ if ($('canvas').length) { body.toggleClass('sidebar-hidden'); } else { body.toggleClass('sidebar-icon-only'); + const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0); + if (vw >= 1200) { + localStorage.setItem('crafty-sidebar-expanded', !body.hasClass('sidebar-icon-only')); + } } }); @@ -231,4 +235,4 @@ if ($('canvas').length) { $(this).not(".brand-logo").attr('toggle-status', 'closed'); } }); -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/app/frontend/templates/base.html b/app/frontend/templates/base.html index b70091b4..05c8e457 100644 --- a/app/frontend/templates/base.html +++ b/app/frontend/templates/base.html @@ -47,8 +47,17 @@ logo