debugs the previous commit <.<

This commit is contained in:
Michael Beck 2025-04-11 15:57:01 +02:00
parent 60cc378f05
commit 0e4f79c885
11 changed files with 20 additions and 20 deletions

View File

@ -6,14 +6,14 @@ bp = Blueprint("main", __name__)
@bp.route("/") @bp.route("/")
def index(): def index():
return render_template("index.html.jina") return render_template("index.html.jinja")
@bp.route("/logs") @bp.route("/logs")
def logs(): def logs():
return render_template("logs.html.jina", app_title="PaperScraper") return render_template("logs.html.jinja", app_title="PaperScraper")
@bp.route("/about") @bp.route("/about")
def about(): def about():
return render_template("about.html.jina", app_title="PaperScraper") return render_template("about.html.jinja", app_title="PaperScraper")

View File

@ -72,7 +72,7 @@ def list_papers():
status_counts = {status: count for status, count in status_counts} status_counts = {status: count for status, count in status_counts}
return render_template( return render_template(
"papers.html.jina", "papers.html.jinja",
papers=pagination.items, papers=pagination.items,
pagination=pagination, pagination=pagination,
total_papers=total_papers, total_papers=total_papers,
@ -137,4 +137,4 @@ def export_papers():
@bp.route("/<int:paper_id>/detail") @bp.route("/<int:paper_id>/detail")
def paper_detail(paper_id): def paper_detail(paper_id):
paper = PaperMetadata.query.get_or_404(paper_id) paper = PaperMetadata.query.get_or_404(paper_id)
return render_template("partials/paper_detail_modal.html.jina", paper=paper) return render_template("partials/paper_detail_modal.html.jinja", paper=paper)

View File

@ -72,7 +72,7 @@ def schedule():
} }
volume = VolumeConfig.query.first() volume = VolumeConfig.query.first()
return render_template( return render_template(
"schedule.html.jina", "schedule.html.jinja",
schedule=schedule, schedule=schedule,
volume=volume.volume if volume else 0, volume=volume.volume if volume else 0,
app_title="PaperScraper", app_title="PaperScraper",

View File

@ -32,19 +32,19 @@ def upload():
duplicate_strategy = request.form.get("duplicate_strategy", "skip") duplicate_strategy = request.form.get("duplicate_strategy", "skip")
if not file: if not file:
return render_template("upload.html.jina", error="No file selected.") return render_template("upload.html.jinja", error="No file selected.")
try: try:
stream = codecs.iterdecode(file.stream, "utf-8") stream = codecs.iterdecode(file.stream, "utf-8")
content = "".join(stream) content = "".join(stream)
df = pd.read_csv(StringIO(content), delimiter=delimiter) df = pd.read_csv(StringIO(content), delimiter=delimiter)
except Exception as e: except Exception as e:
return render_template("upload.html.jina", error=f"Failed to read CSV file: {e}") return render_template("upload.html.jinja", error=f"Failed to read CSV file: {e}")
missing = REQUIRED_COLUMNS - set(df.columns) missing = REQUIRED_COLUMNS - set(df.columns)
if missing: if missing:
return render_template( return render_template(
"upload.html.jina", error=f"Missing required columns: {', '.join(missing)}" "upload.html.jinja", error=f"Missing required columns: {', '.join(missing)}"
) )
# Optional: parse 'published_online' to date # Optional: parse 'published_online' to date
@ -126,7 +126,7 @@ def upload():
except Exception as e: except Exception as e:
db.session.rollback() db.session.rollback()
return render_template( return render_template(
"upload.html.jina", error=f"Failed to save data to database: {e}" "upload.html.jinja", error=f"Failed to save data to database: {e}"
) )
# Prepare error samples for display # Prepare error samples for display
@ -145,13 +145,13 @@ def upload():
session["error_data"] = error_csv.getvalue() session["error_data"] = error_csv.getvalue()
return render_template( return render_template(
"upload.html.jina", "upload.html.jinja",
success=f"File processed! Added: {added_count}, Updated: {updated_count}, Skipped: {skipped_count}, Errors: {error_count}", success=f"File processed! Added: {added_count}, Updated: {updated_count}, Skipped: {skipped_count}, Errors: {error_count}",
error_message=error_message, error_message=error_message,
error_samples=error_samples error_samples=error_samples
) )
return render_template("upload.html.jina") return render_template("upload.html.jinja")
@bp.route("/download_error_log") @bp.route("/download_error_log")

View File

@ -1,4 +1,4 @@
{% extends "base.html" %} {% block content %} {% extends "base.html.jinja" %} {% block content %}
<h1 class="mb-4">📘 About This App</h1> <h1 class="mb-4">📘 About This App</h1>
<p class="lead"> <p class="lead">

View File

@ -13,9 +13,9 @@
</head> </head>
<body> <body>
{% include "nav.html" %} {% include "nav.html.jinja" %}
<main class="container my-5">{% block content %}{% endblock content %}</main> <main class="container my-5">{% block content %}{% endblock content %}</main>
{% include "footer.html" %} {% include "footer.html.jinja" %}
</body> </body>
</html> </html>

View File

@ -1,4 +1,4 @@
{% extends "base.html" %} {% extends "base.html.jinja" %}
{% block content %} {% block content %}
<div class="container text-center"> <div class="container text-center">

View File

@ -1,4 +1,4 @@
{% extends "base.html" %} {% extends "base.html.jinja" %}
{% block content %} {% block content %}
<h1>Activity Logs</h1> <h1>Activity Logs</h1>

View File

@ -1,4 +1,4 @@
{% extends "base.html" %} {% extends "base.html.jinja" %}
{% block title %}Papers{% endblock title %} {% block title %}Papers{% endblock title %}
{% block content %} {% block content %}

View File

@ -1,4 +1,4 @@
{% extends "base.html" %} {% block content %} {% extends "base.html.jinja" %} {% block content %}
<style> <style>
.timeline { .timeline {
display: flex; display: flex;

View File

@ -1,4 +1,4 @@
{% extends "base.html" %} {% block content %} {% extends "base.html.jinja" %} {% block content %}
<h1>Welcome to SciPaperLoader</h1> <h1>Welcome to SciPaperLoader</h1>
{% if success %} {% if success %}