Skip to content

Commit

Permalink
fix dumb template mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
markski1 committed May 10, 2024
1 parent 4a18aec commit 2eaab04
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/routes/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from core import actions
from core.session import attempt_login, Session
from core.config import cache_folder, use_b2_storage
from core.config import cache_folder, use_b2_storage, url_path
from core.stats import get_total_hits, start_date, get_all_file_hits

panel_bp = Blueprint("panel", __name__, url_prefix="/panel")
Expand Down Expand Up @@ -93,7 +93,7 @@ def file_upload():
return render_template(
'result.html',
result_title="File uploaded",
result_outcome=f"The file has been uploaded: `{ret}`"
result_outcome=f"The file has been uploaded: `{url_path}{ret}`"
)
else:
return render_template(
Expand Down
6 changes: 3 additions & 3 deletions src/webpanel/templates/result.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{% extends "layout.html" %}
{% block title %}{result_title}{% endblock %}
{% block title %}{{ result_title }}{% endblock %}

{% block main %}

<h3>Admin panel</h3>
<p>{result_title}</p>
<p>{{ result_title }}</p>

<p>{result_outcome}</p>
<p>{{ result_outcome }}</p>

<hr>

Expand Down
8 changes: 4 additions & 4 deletions src/webpanel/templates/upload.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<h3>Admin panel</h3>
<p>Upload file</p>

<form action="panel/file-upload" method="POST">
<label>File name: <input type="text" name="file-name" placeholder="Leave empty to randomly generate. Do not include extension."></label>
<label>File: <input type="file" id="file" name="fileupload"></label>
<input type="submit" value="Upload">
<form action="/panel/file-upload" method="POST" enctype="multipart/form-data">
<label>File name: <input type="text" name="file-name" placeholder="Leave empty to randomly generate. Do not include extension."></label><br>
<label>File: <input type="file" id="fileupload" name="fileupload"></label><br>
<input type="submit" value="Upload"><br>
</form>

<hr>
Expand Down

0 comments on commit 2eaab04

Please sign in to comment.