odoo/addons/website_sale_digital/views/website_sale_digital.xml

79 lines
3.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="product_attachments" name="Product Attachments" inherit_id="website_sale.confirmation">
<xpath expr="//div[@class='oe_website_sale_tx_status']" position="after">
<!-- TODO: if not confirmed: "available soon" -->
<div> Your product will soon be available for download.</div>
<div style="margin-left: 50px;">
<a href="/website_sale_digital/downloads">
<button class="btn btn-primary btn-sm">
<i class="fa fa-arrow-right"></i> Go to the Downloads page
</button>
</a>
</div>
</xpath>
</template>
<template id="downloads" name="Downloads">
<title>Odoo - Downloads</title>
<t t-call="website.layout">
<div id="wrap">
<div class="oe_structure">
<h1 class="text-center">
Odoo Downloads
</h1>
<h2 class="text-center text-muted">
Download your purchased products
</h2>
</div>
<div class="container mt32 mb32">
<t t-if="products">
<t t-call="website_sale_digital.products_attachments"/>
</t>
<t t-if="not products">
<h4 class="text-muted text-center mt64 mb64">
You have no digital purchase to download, <br/>or your payment has yet to be confirmed.
</h4>
</t>
</div>
</div>
</t>
</template>
<template id="products_attachments" name="Display Products Attachments">
<t t-foreach="products" t-as="p">
<div class="media row">
<div class="col-md-1 mt8" style="text-align:center">
<a href="#"> <!-- TODO: Link to product -->
<img t-att-src="'/website/image?model=product.product&amp;field=image&amp;id='+str(p)" style="max-width: 64px; max-height: 64px;"/>
</a>
</div>
<div class="media-body col-md-10">
<!-- <h4 class="media-heading">Media heading</h4> -->
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><t t-esc="names[p]"/></h3> <!-- TODO: Link to product -->
</div>
<t t-foreach="attachments[p]" t-as="a">
<div class="panel-body">
<t t-esc="a['name']"/>
<span class="pull-right">
<!-- <small><t class="text-muted" t-esc="a['create_date'].split(' ')[0]"/></small> -->
<a t-att-href="'/shop/attachment?attachment_id=%i' % a['id']">
<button class="btn btn-primary btn-xs" type="button" >
Download
</button>
</a>
</span>
</div>
</t>
</div>
</div>
</div>
</t>
</template>
</data>
</openerp>