214 lines
12 KiB
XML
214 lines
12 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<!-- Basic Catalog Page -->
|
|
<template id="rental_catalog_template" name="Rental Catalog">
|
|
<t t-call="website.layout">
|
|
<div id="wrap" class="container py-4">
|
|
<h1 class="mb-4">Event Rentals</h1>
|
|
<div class="row">
|
|
<!-- Categories sidebar -->
|
|
<div class="col-md-3 mb-4">
|
|
<div class="card p-3">
|
|
<h5>Categories</h5>
|
|
<div class="list-group">
|
|
<a t-att-href="'/rentals' + (search and ('?search=' + search) or '')"
|
|
t-att-class="'list-group-item list-group-item-action ' + (not current_category and 'active' or '')">
|
|
All
|
|
</a>
|
|
<t t-foreach="categories" t-as="cat">
|
|
<a t-att-href="'/rentals?category=' + str(cat.id) + (search and ('&search=' + search) or '')"
|
|
t-att-class="'list-group-item list-group-item-action ' + (current_category == cat.id and 'active' or '')">
|
|
<span t-field="cat.name"/>
|
|
</a>
|
|
</t>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- Product list -->
|
|
<div class="col-md-9">
|
|
<div class="mb-4">
|
|
<form action="/rentals" method="get" class="input-group">
|
|
<input type="hidden" name="category" t-att-value="current_category" t-if="current_category"/>
|
|
<input type="text" name="search" class="form-control" placeholder="Search rental items..." t-att-value="search"/>
|
|
<div class="input-group-append">
|
|
<button type="submit" class="btn btn-primary">Search</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="row" t-if="products">
|
|
<t t-foreach="products" t-as="product">
|
|
<div class="col-md-4 col-sm-6 mb-4">
|
|
<div class="card h-100">
|
|
<div style="height: 150px; background: #eee; text-align: center; line-height: 150px;">
|
|
<img t-if="product.image_1920" t-att-src="image_data_uri(product.image_1920)" class="img-fluid h-100" style="object-fit: cover;"/>
|
|
<span t-else="" class="text-muted">No Image</span>
|
|
</div>
|
|
<div class="card-body d-flex flex-column">
|
|
<h5 class="card-title" t-field="product.name"/>
|
|
<p class="card-text text-muted flex-grow-1" t-field="product.description_sale"/>
|
|
<div class="d-flex justify-content-between align-items-center mt-3">
|
|
<span class="font-weight-bold" t-field="product.rental_price_per_day" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
|
<a t-att-href="'/rentals/%s' % slug(product)" class="btn btn-sm btn-outline-primary">Details</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</template>
|
|
|
|
<!-- Basic Product Detail Page -->
|
|
<template id="rental_product_detail_template" name="Rental Product Detail">
|
|
<t t-call="website.layout">
|
|
<div id="wrap" class="container py-4">
|
|
<div class="row">
|
|
<div class="col-md-6 mb-4">
|
|
<div style="height: 350px; background: #eee; text-align: center; line-height: 350px;">
|
|
<img t-if="product.image_1920" t-att-src="image_data_uri(product.image_1920)" class="img-fluid h-100" style="object-fit: cover;"/>
|
|
<span t-else="" class="text-muted">No Image</span>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<h1 t-field="product.name"/>
|
|
<h4 class="text-primary my-3" t-field="product.rental_price_per_day" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
|
|
<p t-field="product.description_sale"/>
|
|
<a t-att-href="'/rental/request?product_id=%s' % product.product_variant_id.id" class="btn btn-primary btn-lg btn-block mt-4">
|
|
Request Booking
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div class="mt-4" t-if="product.rental_terms">
|
|
<h3>Terms & Conditions</h3>
|
|
<div t-field="product.rental_terms"/>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</template>
|
|
|
|
<!-- Basic Request Form Template -->
|
|
<template id="rental_request_form_template" name="Request Rental Form">
|
|
<t t-call="website.layout">
|
|
<div id="wrap" class="container py-4">
|
|
<h2 class="mb-4">Request Rental Form</h2>
|
|
<div class="alert alert-danger" role="alert" t-if="error_message">
|
|
<t t-out="error_message"/>
|
|
</div>
|
|
<form action="/rental/request" method="post" enctype="multipart/form-data">
|
|
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
|
|
|
|
<h4>Customer Information</h4>
|
|
<div class="row">
|
|
<div class="form-group col-md-6">
|
|
<label for="customer_name">Name</label>
|
|
<input type="text" name="customer_name" id="customer_name" class="form-control" required="1" t-att-value="post.get('customer_name', '')"/>
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label for="customer_email">Email</label>
|
|
<input type="email" name="customer_email" id="customer_email" class="form-control" required="1" t-att-value="post.get('customer_email', '')"/>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="form-group col-md-6">
|
|
<label for="customer_phone">Phone</label>
|
|
<input type="tel" name="customer_phone" id="customer_phone" class="form-control" required="1" t-att-value="post.get('customer_phone', '')"/>
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label for="company_name">Company Name</label>
|
|
<input type="text" name="company_name" id="company_name" class="form-control" t-att-value="post.get('company_name', '')"/>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="customer_address">Address</label>
|
|
<textarea name="customer_address" id="customer_address" class="form-control"><t t-out="post.get('customer_address', '')"/></textarea>
|
|
</div>
|
|
|
|
<h4 class="mt-4">Event Details</h4>
|
|
<div class="row">
|
|
<div class="form-group col-md-6">
|
|
<label for="start_date">Start Date & Time</label>
|
|
<input type="datetime-local" name="start_date" id="start_date" class="form-control" required="1" t-att-value="post.get('start_date', '')"/>
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label for="end_date">End Date & Time</label>
|
|
<input type="datetime-local" name="end_date" id="end_date" class="form-control" required="1" t-att-value="post.get('end_date', '')"/>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="form-group col-md-6">
|
|
<label for="location">Location</label>
|
|
<input type="text" name="location" id="location" class="form-control" required="1" t-att-value="post.get('location', '')"/>
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label for="event_type">Event Type</label>
|
|
<select name="event_type" id="event_type" class="form-control">
|
|
<option value="wedding">Wedding</option>
|
|
<option value="birthday">Birthday</option>
|
|
<option value="corporate">Corporate Event</option>
|
|
<option value="stage">Stage Setup</option>
|
|
<option value="other">Other</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<h4 class="mt-4">Rental Product</h4>
|
|
<div class="row">
|
|
<div class="form-group col-md-8">
|
|
<label for="product_id">Product</label>
|
|
<select name="product_id" id="product_id" class="form-control">
|
|
<t t-foreach="all_products" t-as="prod">
|
|
<option t-att-value="prod.id" t-att-selected="selected_product and selected_product.id == prod.id">
|
|
<t t-out="prod.display_name"/>
|
|
</option>
|
|
</t>
|
|
</select>
|
|
</div>
|
|
<div class="form-group col-md-4">
|
|
<label for="quantity">Quantity</label>
|
|
<input type="number" name="quantity" id="quantity" class="form-control" min="1" value="1" required="1"/>
|
|
</div>
|
|
</div>
|
|
|
|
<h4 class="mt-4">Documents</h4>
|
|
<div class="row">
|
|
<div class="form-group col-md-6">
|
|
<label for="doc_type">ID Proof Type</label>
|
|
<select name="doc_type" id="doc_type" class="form-control">
|
|
<option value="aadhaar">Aadhaar Card</option>
|
|
<option value="driving_license">Driving License</option>
|
|
<option value="passport">Passport</option>
|
|
<option value="voter_id">Voter ID</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group col-md-6">
|
|
<label for="id_proof">Upload ID Proof</label>
|
|
<input type="file" name="id_proof" id="id_proof" class="form-control-file" accept=".pdf,.jpg,.jpeg,.png" required="1"/>
|
|
</div>
|
|
</div>
|
|
|
|
<button type="submit" class="btn btn-primary btn-block btn-lg mt-4">Submit</button>
|
|
</form>
|
|
</div>
|
|
</t>
|
|
</template>
|
|
|
|
<!-- Basic Success Page -->
|
|
<template id="rental_request_success_template" name="Rental Request Success">
|
|
<t t-call="website.layout">
|
|
<div id="wrap" class="container py-5 text-center">
|
|
<h2 class="text-success">Request Submitted</h2>
|
|
<p class="lead">Your request has been successfully submitted for review.</p>
|
|
<div class="alert alert-secondary d-inline-block">
|
|
Reference: <strong t-out="name"/>
|
|
</div>
|
|
<div class="mt-4">
|
|
<a href="/rentals" class="btn btn-primary">Back to Catalog</a>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</template>
|
|
</odoo>
|