feat: URL routing skeleton and base template
This commit is contained in:
parent
a6c3c683d4
commit
81bb780ab5
4 changed files with 43 additions and 2 deletions
|
|
@ -15,8 +15,11 @@ Including another URLconf
|
||||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||||
"""
|
"""
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import path
|
from django.urls import path, include
|
||||||
|
from django.conf import settings
|
||||||
|
from django.conf.urls.static import static
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
]
|
path('', include('plants.urls')),
|
||||||
|
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
|
|
|
||||||
35
plants/templates/plants/base.html
Normal file
35
plants/templates/plants/base.html
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
||||||
|
<title>{% block title %}PlantDB{% endblock %}</title>
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
|
||||||
|
<script src="https://unpkg.com/htmx.org@1.9.12" defer></script>
|
||||||
|
<style>
|
||||||
|
body { padding-bottom: 1rem; }
|
||||||
|
.plant-hero { width: 100%; height: 220px; object-fit: cover; }
|
||||||
|
.plant-hero-placeholder { width: 100%; height: 220px; background: #d8f3dc; display: flex; align-items: center; justify-content: center; color: #52b788; font-size: 3rem; }
|
||||||
|
.care-chip { display: inline-block; padding: .2rem .55rem; border-radius: 1rem; font-size: .8rem; margin: .15rem; }
|
||||||
|
.pruning-strip { border-left: 4px solid #ffc107; background: #fff9c4; padding: .5rem .75rem; border-radius: 0 .375rem .375rem 0; }
|
||||||
|
.pruning-strip.overdue { border-color: #dc3545; background: #fff5f5; }
|
||||||
|
.month-checkboxes .form-check { display: inline-flex; margin-right: .5rem; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<nav class="navbar navbar-dark px-3" style="background-color: #2d6a4f;">
|
||||||
|
<a class="navbar-brand fw-bold" href="{% url 'dashboard' %}">🌿 PlantDB</a>
|
||||||
|
<div class="d-flex gap-2">
|
||||||
|
<a href="{% url 'plant_list' %}" class="btn btn-sm btn-outline-light">Plants</a>
|
||||||
|
<a href="{% url 'pruning_calendar' %}" class="btn btn-sm btn-outline-light">✂️</a>
|
||||||
|
<a href="{% url 'plant_add' %}" class="btn btn-sm btn-light fw-bold">+</a>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div class="container-fluid px-3 pt-3">
|
||||||
|
{% block content %}{% endblock %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
3
plants/urls.py
Normal file
3
plants/urls.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
from django.urls import path
|
||||||
|
|
||||||
|
urlpatterns = []
|
||||||
0
plants/views/__init__.py
Normal file
0
plants/views/__init__.py
Normal file
Loading…
Add table
Reference in a new issue