bharath/webapp/src/views/pages/search.ejs
Vivek ed320e82c1 feat: add 35+ features - i18n, voice input, gamification, driver tools, marketplace
- Multi-language support (English, Hindi, Tamil, Telugu) with icon-based UI
- Voice input (Web Speech API) for low-literacy users
- Driver tools: Ledger, Trip Planner, Return Load, Safety, Maintenance, FASTag
- Marketplace: WhatsApp share, Rate Intelligence, Classifieds, Fleet
- Engagement: Gamification (XP/Levels), Challenges, Leaderboard, Referrals, Feed
- Business: Invoice (GST+UPI), Reports+CSV, Notifications, Documents, Bank
- Games: Rate Guesser, Route Quiz
- SEO: Sitemap, public load share pages with OG tags
- India utilities: vehicle validation, UPI links, toll/fuel calculator
- 29 routes, 54 templates, 4 languages, 3 migration files
2026-05-31 09:19:16 +00:00

24 lines
2.2 KiB
Text

<% var title = 'Search'; %>
<%- include('../partials/header') %>
<div class="tricolor-strip"><div class="tricolor-saffron"></div><div class="tricolor-white"></div><div class="tricolor-green"></div></div>
<section class="section" style="padding-top:var(--space-lg)">
<div class="container">
<h2 style="font-size:1.3rem;margin-bottom:var(--space-md)">🔍 Search</h2>
<form method="GET" action="/search" style="margin-bottom:var(--space-md)">
<div style="display:grid;grid-template-columns:1fr auto;gap:var(--space-sm)">
<input type="text" name="q" class="form-input" placeholder="Search loads, users, ads..." value="<%= q %>" autofocus>
<button type="submit" class="btn btn-primary">🔍</button>
</div>
</form>
<% if (q) { %>
<% if (results.loads.length) { %><h3 style="font-size:1rem;margin:var(--space-md) 0 var(--space-sm)">📋 Loads (<%= results.loads.length %>)</h3>
<% results.loads.forEach(l => { %><a href="/loadboard/<%= l.id %>" class="card" style="display:block;padding:10px;margin-bottom:6px;text-decoration:none;color:inherit"><strong><%= l.origin_city %> → <%= l.destination_city %></strong> <% if(l.budget){%>| ₹<%= l.budget.toLocaleString('en-IN') %><%}%></a><% }) } %>
<% if (results.users.length) { %><h3 style="font-size:1rem;margin:var(--space-md) 0 var(--space-sm)">👤 Users (<%= results.users.length %>)</h3>
<% results.users.forEach(u => { %><div class="card" style="padding:10px;margin-bottom:6px"><strong><%= u.name || u.username %></strong> <span class="badge"><%= u.role %></span></div><% }) } %>
<% if (results.classifieds.length) { %><h3 style="font-size:1rem;margin:var(--space-md) 0 var(--space-sm)">🛒 Classifieds (<%= results.classifieds.length %>)</h3>
<% results.classifieds.forEach(c => { %><div class="card" style="padding:10px;margin-bottom:6px"><strong><%= c.title %></strong> | ₹<%= (c.price||0).toLocaleString('en-IN') %></div><% }) } %>
<% if (!results.loads.length && !results.users.length && !results.classifieds.length) { %><div class="card text-center" style="padding:var(--space-xl)"><p>No results for "<%= q %>"</p></div><% } %>
<% } %>
</div>
</section>
<%- include('../partials/footer') %>