|
|
@@ -1,56 +1,168 @@
|
|
1
|
1
|
{% extends 'public_frontend/base.html' %}
|
|
|
2
|
+{% load static %}
|
|
2
|
3
|
{% block title %}Home{% endblock %}
|
|
|
4
|
+
|
|
3
|
5
|
{% block content %}
|
|
4
|
|
-<div class="grid gap-8">
|
|
5
|
|
- <section class="bg-white rounded shadow p-6">
|
|
6
|
|
- <h2 class="text-xl font-semibold mb-2">Welcome{% if org %} to {{ org.name }}{% endif %}</h2>
|
|
7
|
|
- <p class="text-gray-600">We help you manage recycling operations: pickups, weighing, invoices, and public listings.</p>
|
|
8
|
|
- <div class="mt-4 flex gap-3">
|
|
9
|
|
- <a href="{% url 'public_frontend:pickup_request' %}" class="btn-primary">Request Pickup</a>
|
|
10
|
|
- <a href="{% url 'public_frontend:listings_list' %}" class="btn-outline">Browse Listings</a>
|
|
|
6
|
+<div class="grid gap-12 md:gap-16">
|
|
|
7
|
+ {# Hero Section #}
|
|
|
8
|
+ <section id="hero" class="bg-white rounded-lg shadow-md p-6 md:p-8 text-center">
|
|
|
9
|
+ <h1 class="text-3xl md:text-4xl font-bold mb-2">Streamline Your Factory's Recycling</h1>
|
|
|
10
|
+ <p class="text-gray-600 max-w-2xl mx-auto mb-6">We partner with businesses like yours to manage scrap materials efficiently. Browse listings, request a pickup, and turn your waste into a resource.</p>
|
|
|
11
|
+ <div class="flex gap-3 justify-center">
|
|
|
12
|
+ <a href="#pickup-request" class="btn-primary">Request a Pickup</a>
|
|
|
13
|
+ <a href="#listings" class="btn-outline">Browse Listings</a>
|
|
11
|
14
|
</div>
|
|
12
|
15
|
</section>
|
|
13
|
16
|
|
|
14
|
|
- <section class="bg-white rounded shadow p-6">
|
|
|
17
|
+ {# Services Section #}
|
|
|
18
|
+ {% if services %}
|
|
|
19
|
+ <section id="services">
|
|
15
|
20
|
<div class="flex items-center justify-between mb-3">
|
|
16
|
|
- <h3 class="font-semibold">Latest Blog</h3>
|
|
17
|
|
- <a href="{% url 'public_frontend:blog_list' %}" class="text-blue-700 hover:underline">View all</a>
|
|
|
21
|
+ <h2 class="text-2xl font-semibold">Our Services</h2>
|
|
18
|
22
|
</div>
|
|
19
|
|
- <div class="grid md:grid-cols-3 gap-4">
|
|
20
|
|
- {% for p in posts %}
|
|
21
|
|
- <a href="{% url 'public_frontend:blog_detail' p.slug %}" class="block p-4 border rounded hover:bg-gray-50">
|
|
22
|
|
- <div class="text-sm text-gray-500">{{ p.published_at|date:'M j, Y' }}</div>
|
|
23
|
|
- <div class="font-medium">{{ p.title }}</div>
|
|
24
|
|
- <div class="text-sm text-gray-600 line-clamp-2">{{ p.excerpt|default:p.content|striptags|truncatechars:120 }}</div>
|
|
|
23
|
+ <div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4">
|
|
|
24
|
+ {% for s in services %}
|
|
|
25
|
+ <a href="{% url 'public_frontend:service_detail' s.pk %}" class="block p-4 bg-white rounded-lg shadow-md hover:bg-gray-50 transition flex items-start gap-4">
|
|
|
26
|
+ <img src="{% static 'service_icons/' %}{{ s.image_name }}" alt="{{ s.title }} icon" class="w-12 h-12 object-contain"/>
|
|
|
27
|
+ <div>
|
|
|
28
|
+ <div class="font-medium">{{ s.title }}</div>
|
|
|
29
|
+ <div class="text-sm text-gray-600">{{ s.description }}</div>
|
|
|
30
|
+ </div>
|
|
25
|
31
|
</a>
|
|
26
|
|
- {% empty %}
|
|
27
|
|
- <div class="text-gray-500">No posts yet.</div>
|
|
28
|
32
|
{% endfor %}
|
|
29
|
33
|
</div>
|
|
30
|
34
|
</section>
|
|
|
35
|
+ {% endif %}
|
|
31
|
36
|
|
|
32
|
|
- <section class="bg-white rounded shadow p-6">
|
|
|
37
|
+ {# Materials Section #}
|
|
|
38
|
+ <section id="materials">
|
|
33
|
39
|
<div class="flex items-center justify-between mb-3">
|
|
34
|
|
- <h3 class="font-semibold">Open Listings</h3>
|
|
35
|
|
- <a href="{% url 'public_frontend:listings_list' %}" class="text-blue-700 hover:underline">Browse</a>
|
|
|
40
|
+ <h2 class="text-2xl font-semibold">Materials We Accept</h2>
|
|
|
41
|
+ <a href="{% url 'public_frontend:materials_list' %}" class="text-blue-700 hover:underline">View all</a>
|
|
|
42
|
+ </div>
|
|
|
43
|
+ <div class="bg-white rounded-lg shadow-md p-4">
|
|
|
44
|
+ <div class="grid grid-cols-2 md:grid-cols-4 gap-4">
|
|
|
45
|
+ {% for m in materials %}
|
|
|
46
|
+ <div class="p-2 text-center">
|
|
|
47
|
+ <p class="font-medium">{{ m.name }}</p>
|
|
|
48
|
+ <p class="text-sm text-gray-500">{{ m.category.name }}</p>
|
|
|
49
|
+ </div>
|
|
|
50
|
+ {% empty %}
|
|
|
51
|
+ <p class="text-gray-500 col-span-full">No materials published.</p>
|
|
|
52
|
+ {% endfor %}
|
|
|
53
|
+ </div>
|
|
|
54
|
+ </div>
|
|
|
55
|
+ </section>
|
|
|
56
|
+
|
|
|
57
|
+ {# Open Listings Section #}
|
|
|
58
|
+ <section id="listings">
|
|
|
59
|
+ <div class="flex items-center justify-between mb-3">
|
|
|
60
|
+ <h2 class="text-2xl font-semibold">Open Listings</h2>
|
|
|
61
|
+ <a href="{% url 'public_frontend:listings_list' %}" class="text-blue-700 hover:underline">Browse all</a>
|
|
36
|
62
|
</div>
|
|
37
|
63
|
<div class="grid md:grid-cols-3 gap-4">
|
|
38
|
64
|
{% for l in listings %}
|
|
39
|
|
- <a href="{% url 'public_frontend:listing_detail' l.id %}" class="block p-4 border rounded hover:bg-gray-50">
|
|
|
65
|
+ <a href="{% url 'public_frontend:listing_detail' l.id %}" class="block p-4 border rounded bg-white hover:bg-gray-50 transition">
|
|
40
|
66
|
<div class="text-sm text-gray-500">Ends {{ l.ends_at|default:'—' }}</div>
|
|
41
|
67
|
<div class="font-medium">{{ l.title }}</div>
|
|
42
|
68
|
<div class="text-sm text-gray-600 line-clamp-2">{{ l.description|truncatechars:120 }}</div>
|
|
43
|
69
|
</a>
|
|
44
|
70
|
{% empty %}
|
|
45
|
|
- <div class="text-gray-500">No public listings.</div>
|
|
|
71
|
+ <div class="text-gray-500 p-4 bg-white rounded-lg shadow-md col-span-full">No public listings at the moment.</div>
|
|
|
72
|
+ {% endfor %}
|
|
|
73
|
+ </div>
|
|
|
74
|
+ </section>
|
|
|
75
|
+
|
|
|
76
|
+ {# Pickup Request Section #}
|
|
|
77
|
+ <section id="pickup-request">
|
|
|
78
|
+ <h2 class="text-2xl font-semibold mb-3">Request a Pickup</h2>
|
|
|
79
|
+ <form method="post" action="{% url 'public_frontend:pickup_request' %}" class="bg-white rounded-lg shadow-md p-4 grid gap-4">
|
|
|
80
|
+ {% csrf_token %}
|
|
|
81
|
+ <div>
|
|
|
82
|
+ <label class="block text-sm font-medium mb-1">Name</label>
|
|
|
83
|
+ <input type="text" name="name" value="{{ pickup_form.name.value|default:'' }}" required class="w-full border rounded px-3 py-2">
|
|
|
84
|
+ </div>
|
|
|
85
|
+ <div class="grid md:grid-cols-2 gap-4">
|
|
|
86
|
+ <div>
|
|
|
87
|
+ <label class="block text-sm font-medium mb-1">Email</label>
|
|
|
88
|
+ <input type="email" name="email" value="{{ pickup_form.email.value|default:'' }}" class="w-full border rounded px-3 py-2">
|
|
|
89
|
+ </div>
|
|
|
90
|
+ <div>
|
|
|
91
|
+ <label class="block text-sm font-medium mb-1">Phone</label>
|
|
|
92
|
+ <input type="text" name="phone" value="{{ pickup_form.phone.value|default:'' }}" class="w-full border rounded px-3 py-2">
|
|
|
93
|
+ </div>
|
|
|
94
|
+ </div>
|
|
|
95
|
+ <div>
|
|
|
96
|
+ <label class="block text-sm font-medium mb-1">Pickup Address</label>
|
|
|
97
|
+ <textarea name="address" required class="w-full border rounded px-3 py-2" rows="3">{{ pickup_form.address.value|default:'' }}</textarea>
|
|
|
98
|
+ </div>
|
|
|
99
|
+ <div>
|
|
|
100
|
+ <label class="block text-sm font-medium mb-1">Materials / Notes</label>
|
|
|
101
|
+ <textarea name="materials" class="w-full border rounded px-3 py-2" rows="4">{{ pickup_form.materials.value|default:'' }}</textarea>
|
|
|
102
|
+ </div>
|
|
|
103
|
+ <div>
|
|
|
104
|
+ <button class="btn-primary" type="submit">Submit Request</button>
|
|
|
105
|
+ </div>
|
|
|
106
|
+ </form>
|
|
|
107
|
+ </section>
|
|
|
108
|
+
|
|
|
109
|
+ {# Blog Section #}
|
|
|
110
|
+ <section id="blog">
|
|
|
111
|
+ <div class="flex items-center justify-between mb-3">
|
|
|
112
|
+ <h2 class="text-2xl font-semibold">Industry Insights</h2>
|
|
|
113
|
+ <a href="{% url 'public_frontend:blog_list' %}" class="text-blue-700 hover:underline">View all</a>
|
|
|
114
|
+ </div>
|
|
|
115
|
+ <div class="grid md:grid-cols-3 gap-4">
|
|
|
116
|
+ {% for p in posts %}
|
|
|
117
|
+ <a href="{% url 'public_frontend:blog_detail' p.slug %}" class="block p-4 border rounded bg-white hover:bg-gray-50 transition">
|
|
|
118
|
+ <div class="text-sm text-gray-500">{{ p.published_at|date:'M j, Y' }}</div>
|
|
|
119
|
+ <div class="font-medium">{{ p.title }}</div>
|
|
|
120
|
+ <div class="text-sm text-gray-600 line-clamp-2">{{ p.excerpt|default:p.content|striptags|truncatechars:120 }}</div>
|
|
|
121
|
+ </a>
|
|
|
122
|
+ {% empty %}
|
|
|
123
|
+ <div class="text-gray-500 p-4 bg-white rounded-lg shadow-md col-span-full">No posts yet.</div>
|
|
46
|
124
|
{% endfor %}
|
|
47
|
125
|
</div>
|
|
48
|
126
|
</section>
|
|
|
127
|
+
|
|
|
128
|
+ {# Contact Section #}
|
|
|
129
|
+ <section id="contact">
|
|
|
130
|
+ <h2 class="text-2xl font-semibold mb-3">Contact Us</h2>
|
|
|
131
|
+ <form method="post" action="{% url 'public_frontend:contact' %}" class="bg-white rounded-lg shadow-md p-4 grid gap-4">
|
|
|
132
|
+ {% csrf_token %}
|
|
|
133
|
+ <div class="grid md:grid-cols-2 gap-4">
|
|
|
134
|
+ <div>
|
|
|
135
|
+ <label class="block text-sm font-medium mb-1">Name</label>
|
|
|
136
|
+ <input type="text" name="name" value="{{ contact_form.name.value|default:'' }}" required class="w-full border rounded px-3 py-2">
|
|
|
137
|
+ </div>
|
|
|
138
|
+ <div>
|
|
|
139
|
+ <label class="block text-sm font-medium mb-1">Email</label>
|
|
|
140
|
+ <input type="email" name="email" value="{{ contact_form.email.value|default:'' }}" required class="w-full border rounded px-3 py-2">
|
|
|
141
|
+ </div>
|
|
|
142
|
+ </div>
|
|
|
143
|
+ <div>
|
|
|
144
|
+ <label class="block text-sm font-medium mb-1">Subject</label>
|
|
|
145
|
+ <input type="text" name="subject" value="{{ contact_form.subject.value|default:'' }}" class="w-full border rounded px-3 py-2">
|
|
|
146
|
+ </div>
|
|
|
147
|
+ <div>
|
|
|
148
|
+ <label class="block text-sm font-medium mb-1">Message</label>
|
|
|
149
|
+ <textarea name="message" rows="5" class="w-full border rounded px-3 py-2">{{ contact_form.message.value|default:'' }}</textarea>
|
|
|
150
|
+ </div>
|
|
|
151
|
+ <div>
|
|
|
152
|
+ <button class="btn-primary" type="submit">Send Message</button>
|
|
|
153
|
+ </div>
|
|
|
154
|
+ </form>
|
|
|
155
|
+ </section>
|
|
49
|
156
|
</div>
|
|
50
|
157
|
|
|
51
|
158
|
<style>
|
|
52
|
|
-.btn-primary{background:#1d4ed8;color:white;padding:.5rem .75rem;border-radius:.375rem}
|
|
53
|
|
-.btn-outline{border:1px solid #cbd5e1;padding:.5rem .75rem;border-radius:.375rem}
|
|
|
159
|
+ html {
|
|
|
160
|
+ scroll-behavior: smooth;
|
|
|
161
|
+ }
|
|
|
162
|
+ .btn-primary { background:#1d4ed8; color:white; padding:.625rem 1rem; border-radius:.375rem; font-weight:500; transition: background-color 0.2s; }
|
|
|
163
|
+ .btn-primary:hover { background:#1e40af; }
|
|
|
164
|
+ .btn-outline { border:1px solid #cbd5e1; padding:.625rem 1rem; border-radius:.375rem; font-weight:500; transition: background-color 0.2s, border-color 0.2s; }
|
|
|
165
|
+ .btn-outline:hover { background-color: #f8fafc; border-color: #94a3b8; }
|
|
|
166
|
+ section { scroll-margin-top: 80px; } /* Offset for fixed header */
|
|
54
|
167
|
</style>
|
|
55
|
168
|
{% endblock %}
|
|
56
|
|
-
|