Skip to content

Commit 0d5b499

Browse files
author
SM_SAYEED
committed
hiomepage issue 2
1 parent 52f45f3 commit 0d5b499

File tree

1 file changed

+4
-48
lines changed

1 file changed

+4
-48
lines changed

app.py

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -274,59 +274,15 @@ def _list_user_tables():
274274
@app.route("/", methods=["GET"])
275275
@app.route("/home", methods=["GET"])
276276
def public_home():
277-
tables = _list_user_tables()
278-
return render_template("public_home.html", tables=tables)
277+
#tables = _list_user_tables()
278+
return render_template("landing.html")
279279

280280
#########################################################
281281

282282
@app.route("/materials", methods=["GET"])
283283
def materials_portal():
284-
root = app.config.get("UPLOAD_FOLDER", UPLOAD_FOLDER)
285-
props = []
286-
try:
287-
for d in os.listdir(root):
288-
pdir = os.path.join(root, d)
289-
if not os.path.isdir(pdir):
290-
continue
291-
# Only show properties that have at least one allowed file in dataset/ or results/
292-
has_any = False
293-
for tab in ("dataset", "results"):
294-
sub = os.path.join(pdir, tab)
295-
if not os.path.isdir(sub):
296-
continue
297-
for _r, _ds, files in os.walk(sub):
298-
if any(
299-
(f.rsplit(".", 1)[-1].lower() in (ALLOWED_DATASET_EXTENSIONS | ALLOWED_RESULTS_EXTENSIONS))
300-
for f in files
301-
):
302-
has_any = True
303-
break
304-
if has_any:
305-
break
306-
if has_any:
307-
props.append(d)
308-
except Exception as e:
309-
app.logger.warning("materials_portal: %s", e)
310-
311-
props.sort()
312-
items = []
313-
for p in props:
314-
pretty = p.replace("_", " ").title()
315-
items.append(
316-
f"<li><b>{pretty}</b> — "
317-
f"<a href='/materials/{p}/dataset'>Dataset</a> · "
318-
f"<a href='/materials/{p}/results'>Results</a></li>"
319-
)
320-
321-
html = (
322-
"<!doctype html><meta charset='utf-8'>"
323-
"<title>Materials</title>"
324-
"<style>body{font-family:system-ui,Segoe UI,Roboto,Arial,sans-serif;max-width:760px;margin:2rem auto;padding:0 1rem;line-height:1.5}</style>"
325-
"<h1>Materials</h1>"
326-
"<ul>" + "".join(items) + "</ul>"
327-
"<p><a href='/'>← Back to home</a></p>"
328-
)
329-
return html, 200, {"Content-Type": "text/html; charset=utf-8"}
284+
# Uses your templates/materials_portal.html
285+
return render_template("materials_portal.html")
330286

331287
#########################################################
332288

0 commit comments

Comments
 (0)