More files
This commit is contained in:
@ -1 +0,0 @@
|
||||
# core_ui media patch
|
15
plugins/core_ui/routes.py
Normal file
15
plugins/core_ui/routes.py
Normal file
@ -0,0 +1,15 @@
|
||||
from flask import Blueprint, render_template
|
||||
from flask_login import login_required, current_user
|
||||
|
||||
bp = Blueprint('core_ui', __name__, template_folder='templates')
|
||||
|
||||
@bp.route('/')
|
||||
def home():
|
||||
return render_template('core_ui/home.html')
|
||||
|
||||
@bp.route('/admin')
|
||||
@login_required
|
||||
def admin_dashboard():
|
||||
if current_user.role != 'admin':
|
||||
return "Access denied", 403
|
||||
return render_template('core_ui/admin_dashboard.html')
|
11
plugins/core_ui/templates/core_ui/admin_dashboard.html
Normal file
11
plugins/core_ui/templates/core_ui/admin_dashboard.html
Normal file
@ -0,0 +1,11 @@
|
||||
{% extends 'core_ui/base.html' %}
|
||||
{% block title %}Admin Dashboard | Nature In Pots{% endblock %}
|
||||
{% block content %}
|
||||
<h1 class="mb-4 text-danger">Admin Dashboard</h1>
|
||||
<p class="lead">Manage submissions, users, and plugin controls here.</p>
|
||||
<ul>
|
||||
<li><a href="#">View Unapproved Submissions</a></li>
|
||||
<li><a href="#">Manage Users</a></li>
|
||||
<li><a href="#">Export Data</a></li>
|
||||
</ul>
|
||||
{% endblock %}
|
69
plugins/core_ui/templates/core_ui/base.html
Normal file
69
plugins/core_ui/templates/core_ui/base.html
Normal file
@ -0,0 +1,69 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %}Nature In Pots Community{% endblock %}</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<style>
|
||||
body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
}
|
||||
main {
|
||||
flex: 1;
|
||||
}
|
||||
footer {
|
||||
background-color: #f8f9fa;
|
||||
padding: 1rem 0;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light mb-4">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="{{ url_for('core_ui.home') }}">Nature In Pots</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav me-auto">
|
||||
<li class="nav-item"><a class="nav-link" href="{{ url_for('core_ui.home') }}">Home</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{ url_for('plant.index') }}">Plants</a></li>
|
||||
{% if current_user.is_authenticated and current_user.role == 'admin' %}
|
||||
<li class="nav-item"><a class="nav-link text-danger" href="{{ url_for('core_ui.admin_dashboard') }}">Admin Dashboard</a></li>
|
||||
{% endif %}
|
||||
{% block plugin_links %}{% endblock %}
|
||||
</ul>
|
||||
<ul class="navbar-nav align-items-center">
|
||||
{% if current_user.is_authenticated %}
|
||||
<li class="nav-item ms-3">
|
||||
<a class="nav-link" href="{{ url_for('auth.logout') }}">Logout</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item ms-3"><a class="nav-link" href="{{ url_for('auth.login') }}">Login</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="{{ url_for('auth.register') }}">Register</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<main class="container">
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
<div class="alert alert-warning">
|
||||
{% for message in messages %}
|
||||
<div>{{ message }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
<footer>
|
||||
© {{ current_year | default(2025) }} Nature In Pots Community. All rights reserved.
|
||||
</footer>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
6
plugins/core_ui/templates/core_ui/home.html
Normal file
6
plugins/core_ui/templates/core_ui/home.html
Normal file
@ -0,0 +1,6 @@
|
||||
{% extends 'core_ui/base.html' %}
|
||||
{% block title %}Home | Nature In Pots{% endblock %}
|
||||
{% block content %}
|
||||
<h1 class="mb-4">Welcome to Nature In Pots 🌿</h1>
|
||||
<p>This is the community hub for plant tracking, propagation history, and price sharing.</p>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user