first commit

This commit is contained in:
usernames122
2025-08-10 23:42:02 +02:00
commit 877a246134
24 changed files with 957 additions and 0 deletions

31
templates/base.html Normal file
View File

@@ -0,0 +1,31 @@
<!-- base.html -->
<!DOCTYPE html>
<html>
<head>
<title>{% block title %}My Site{% endblock %}</title>
<link rel="stylesheet" href="/static/main.css">
</head>
<body>
{% include 'topbar.html' %}
<!-- Flashed messages -->
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<div class="flashed-messages">
{% for category, message in messages %}
<div class="alert alert-{{ category }}">{{ message }}</div>
{% endfor %}
</div>
{% endif %}
{% endwith %}
<!-- This block is the “Outlet” equivalent -->
<main>
{% block content %}
<!-- Child templates will fill this -->
{% endblock %}
</main>
</body>
</html>

View File

@@ -0,0 +1,22 @@
{% extends "base.html" %}
{% block title %}Create Finding{% endblock %}
{% block content %}
<h2>Create a New Finding</h2>
<form method="post" action="{{ url_for('findings.create_finding') }}">
<div class="form-group">
<label for="path">Path (on laminax.org, optional if lorekey is provided)</label>
<input id="path" name="path" class="form-control" type="text" value="{{ path or '' }}">
<small class="form-text text-muted">Example: some/path/here</small>
</div>
<div class="form-group">
<label for="lorekey">Lorekey</label>
<input id="lorekey" name="lorekey" class="form-control" type="text" value="{{ lorekey or '' }}">
</div>
<button type="submit" class="btn btn-primary">Create Finding</button>
</form>
{% endblock %}

View File

@@ -0,0 +1,14 @@
{% extends "base.html" %}
{% block title %}Finding: {{ finding.title }}{% endblock %}
{% block content %}
<h2>{{ finding.title }}</h2>
<p><strong>Path:</strong> <a href="{{ finding.path }}">{{ finding.path }}</a></p>
<p><strong>Found by:</strong> {{ user.username }}</p>
<p><strong>Found on:</strong> {{ finding.find_time.strftime('%Y-%m-%d %H:%M') }}</p>
<hr>
<h3>Content Preview</h3>
<pre>{{ finding.content_preview or 'No preview available.' }}</pre>
{% endblock %}

0
templates/findings.html Normal file
View File

18
templates/home.html Normal file
View File

@@ -0,0 +1,18 @@
<!-- home.html -->
{% extends "base.html" %}
{% block title %}Home - LAMINAX.ORG ARG findings{% endblock %}
{% block content %}
<h1>Welcome to ARG findings!</h1>
<p>This site is dedicated to sharing the ARG findings at <a href="https://laminax.org">laminax.org</a></p>
<!--Render latest users-->
<div class="latest-users">
<h2>Latest Users</h2>
<ul>
{% for user in users %}
<li>{{ user.username }}</li>
{% endfor %}
</ul>
</div>
{% endblock %}

View File

@@ -0,0 +1,21 @@
{% extends "base.html" %}
{% block title %}Latest Findings{% endblock %}
{% block content %}
<h2>Latest Findings</h2>
{% if findings %}
<ul>
{% for f in findings %}
<li>
<a href="{{ url_for('findings.finding_detail', finding_id=f.id) }}">{{ f.title }}</a>
by {{ user_map[f.found_by].username if f.found_by in user_map else 'Unknown' }}
— {{ f.find_time.strftime('%Y-%m-%d %H:%M') }}
</li>
{% endfor %}
</ul>
{% else %}
<p>No findings yet.</p>
{% endif %}
{% endblock %}

41
templates/login.html Normal file
View File

@@ -0,0 +1,41 @@
{% extends "base.html" %}
{% block title %}Login{% endblock %}
{% block content %}
<div class="wrapper" style="max-width:360px; padding:20px; margin:auto;">
<h2>Login</h2>
<p>Please fill in your credentials to login.</p>
{% if login_err %}
<div class="alert alert-danger">{{ login_err }}</div>
{% endif %}
<form method="post" action="{{ url_for('login.login') }}">
<div class="form-group">
<label>Username</label>
<input type="text" name="username"
class="form-control {% if username_err %}is-invalid{% endif %}"
value="{{ username }}">
{% if username_err %}
<div class="invalid-feedback">{{ username_err }}</div>
{% endif %}
</div>
<div class="form-group">
<label>Password</label>
<input type="password" name="password"
class="form-control {% if password_err %}is-invalid{% endif %}">
{% if password_err %}
<div class="invalid-feedback">{{ password_err }}</div>
{% endif %}
</div>
<div class="form-group">
<input type="submit" class="btn btn-primary" value="Login">
</div>
<p>Don't have an account? <a href="{{ url_for('register.register') }}">Sign up now</a>.</p>
</form>
</div>
{% endblock %}

23
templates/profile.html Normal file
View File

@@ -0,0 +1,23 @@
{% extends "base.html" %}
{% block title %}My Findings{% endblock %}
{% block content %}
<h2>My Findings</h2>
<p>Welcome, {{ user.username }}!</p>
{% if findings %}
<ul>
{% for finding in findings %}
<li>
<strong>{{ finding.title }}</strong>
Path: <a href="/findings/{{ finding.id }}">{{ finding.path }}</a>
Found on: {{ finding.find_time.strftime('%Y-%m-%d %H:%M') }}
</li>
{% endfor %}
</ul>
{% else %}
<p>You have no findings yet.</p>
{% endif %}
{% endblock %}

49
templates/register.html Normal file
View File

@@ -0,0 +1,49 @@
{% extends "base.html" %}
{% block title %}Sign Up{% endblock %}
{% block content %}
<div class="wrapper" style="max-width:360px; padding:20px; margin:auto;">
<h2>Sign Up</h2>
<p>Please fill this form to create an account.</p>
<form method="post" action="{{ url_for('register.register') }}">
<div class="form-group">
<label>Username</label>
<input type="text" name="username"
class="form-control {% if username_err %}is-invalid{% endif %}"
value="{{ username }}">
{% if username_err %}
<div class="invalid-feedback">{{ username_err }}</div>
{% endif %}
</div>
<div class="form-group">
<label>Password</label>
<input type="password" name="password"
class="form-control {% if password_err %}is-invalid{% endif %}"
value="{{ password }}">
{% if password_err %}
<div class="invalid-feedback">{{ password_err }}</div>
{% endif %}
</div>
<div class="form-group">
<label>Confirm Password</label>
<input type="password" name="confirm_password"
class="form-control {% if confirm_password_err %}is-invalid{% endif %}"
value="{{ confirm_password }}">
{% if confirm_password_err %}
<div class="invalid-feedback">{{ confirm_password_err }}</div>
{% endif %}
</div>
<div class="form-group">
<input type="submit" class="btn btn-primary" value="Submit">
<input type="reset" class="btn btn-secondary ml-2" value="Reset">
</div>
<p>Already have an account? <a href="{{ url_for('login.login') }}">Login here</a>.</p>
</form>
</div>
{% endblock %}

15
templates/topbar.html Normal file
View File

@@ -0,0 +1,15 @@
<div class="topnav">
<a class="active" href="/">Home</a>
<a href="{{ url_for('findings.latest_findings') }}">Latest findings</a>
<a href="https://laminax.co">Main site</a>
<!-- Additional links for login/register if not logged in, else show user profile and logout -->
{% if session.get('loggedin') %}
<a href="{{ url_for('logout.logout') }}">Log out</a>
<a href="{{ url_for('profile.my_findings') }}">My Findings</a>
<a href="{{ url_for('findings.create_finding') }}">Add Finding</a>
<a href="/profile/get/{{ session.get('id') }}">My Profile</a>
{% else %}
<a href="{{ url_for('login.login') }}">Login</a>
<a href="{{ url_for('register.register') }}">Register</a>
{% endif %}
</div>

View File

@@ -0,0 +1,22 @@
{% extends "base.html" %}
{% block title %}My Findings{% endblock %}
{% block content %}
<h1>{{ user.username }}'s profile:</h1>
<p>Their Findings</p>
{% if findings %}
<ul>
{% for finding in findings %}
<li>
<strong>{{ finding.title }}</strong>
Path: <a href="/findings/{{ finding.id }}">{{ finding.path }}</a>
Found on: {{ finding.find_time.strftime('%Y-%m-%d %H:%M') }}
</li>
{% endfor %}
</ul>
{% else %}
<p>You have no findings yet.</p>
{% endif %}
{% endblock %}