feat: Add tools curl page

This commit is contained in:
2025-10-26 18:19:49 +11:00
parent e175f68d25
commit abcaa9283d
3 changed files with 21 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
from flask import render_template from flask import render_template
from tools import error_response, getAddress from tools import error_response, getAddress, get_tools_data
import os import os
from functools import lru_cache from functools import lru_cache
import requests import requests
@@ -101,8 +101,6 @@ def curl_response(request):
coins=coinList coins=coinList
), 200, {'Content-Type': 'text/plain; charset=utf-8'} ), 200, {'Content-Type': 'text/plain; charset=utf-8'}
# For other donation pages, fall back to ascii if it exists # For other donation pages, fall back to ascii if it exists
if path.startswith("donate/"): if path.startswith("donate/"):
coin = path.split("/")[1] coin = path.split("/")[1]
@@ -110,6 +108,10 @@ def curl_response(request):
if address != "": if address != "":
return render_template("donate_coin.ascii",header=get_header(),coin=coin.upper(),address=address), 200, {'Content-Type': 'text/plain; charset=utf-8'} return render_template("donate_coin.ascii",header=get_header(),coin=coin.upper(),address=address), 200, {'Content-Type': 'text/plain; charset=utf-8'}
if path == "tools":
tools = get_tools_data()
return render_template("tools.ascii",header=get_header(),tools=tools), 200, {'Content-Type': 'text/plain; charset=utf-8'}
if os.path.exists(f"templates/{path}.ascii"): if os.path.exists(f"templates/{path}.ascii"):
return render_template(f"{path}.ascii",header=get_header()), 200, {'Content-Type': 'text/plain; charset=utf-8'} return render_template(f"{path}.ascii",header=get_header()), 200, {'Content-Type': 'text/plain; charset=utf-8'}

View File

@@ -685,6 +685,8 @@ def resume_pdf():
@app.route("/tools") @app.route("/tools")
def tools(): def tools():
if isCurl(request):
return curl_response(request)
return render_template("tools.html", tools=get_tools_data()) return render_template("tools.html", tools=get_tools_data())
# endregion # endregion

13
templates/tools.ascii Normal file
View File

@@ -0,0 +1,13 @@
{{header}}
───────────────────────────────────────────────
 Tools 
────────────
Here are some of the tools I use regularly — most of them are open source! 🛠️
{% for tool in tools %}
{{tool.name}}
{{tool.description}}
Website: {{tool.url}}
{% if tool.demo_url %}Demo: {{tool.demo_url}}{% endif %}
{% endfor %}