Files
2026-09-18 13:55:25 +07:00

142 lines
6.4 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- Public share layout: web.layout + frontend assets (clean-room) -->
<template id="nxz_document_public_layout" name="Document Hub Public Share Layout">
<t t-call="web.layout">
<t t-set="head">
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<t t-call-assets="web.assets_frontend" t-js="false"/>
<t t-call-assets="nextzen_document.public_page_assets"/>
<style>html, body { overflow: auto; }</style>
<t t-out="head or None"/>
</t>
<t t-set="body_classname" t-value="'o_nxz_share_body o_home_menu_background'"/>
<div id="wrap" class="o_nxz_share_wrap">
<header>
<a href="/web" class="o_nxz_share_brand" title="NextZen">
<t t-if="res_company and res_company.logo">
<span class="o_nxz_share_logo" t-field="res_company.logo" t-options="{'widget': 'image'}" t-att-alt="res_company.name"/>
</t>
<t t-else="">
<span>NEXTZEN</span>
</t>
</a>
<div>
<t t-if="not request.env.user._is_public()">
<a t-attf-href="/web/session/logout?redirect=#{request.httprequest.path}"
class="btn btn-sm btn-light border">Logout</a>
</t>
<t t-else="">
<a t-attf-href="/web/login?redirect=#{request.httprequest.path}"
class="btn btn-sm btn-light border">Login</a>
</t>
</div>
</header>
<main>
<t t-out="0"/>
</main>
<footer>
Document Hub
</footer>
</div>
</t>
</template>
<template id="nxz_document_share_unavailable" name="Document Hub Share Unavailable">
<t t-call="nextzen_document.nxz_document_public_layout">
<div class="o_nxz_share_message">
<h1 class="h3 mb-3">This document does not exist or is not publicly available.</h1>
<p class="mb-0">Please login or contact the person that shared this link for more information.</p>
</div>
</t>
</template>
<template id="nxz_document_share_page" name="Document Hub Share Page">
<t t-call="nextzen_document.nxz_document_public_layout">
<div class="o_nxz_share_card">
<div class="o_nxz_share_icon">
<span class="fa-stack fa-3x">
<i class="fa fa-circle-thin fa-stack-2x"/>
<i class="fa fa-arrow-down fa-stack-1x"/>
</span>
</div>
<div class="o_nxz_share_name" t-att-title="doc.name" t-esc="doc.name"/>
<div class="o_nxz_share_meta">
Size: <t t-esc="file_size_label"/>
</div>
<div class="o_nxz_share_actions">
<a t-att-href="download_url"
class="btn btn-primary"
title="Download file">
<i class="fa fa-download fa-fw"/> Download file
</a>
<a t-if="can_preview"
t-att-href="preview_url"
target="_blank"
class="btn btn-primary"
title="Preview file">
<i class="fa fa-eye"/> Preview file
</a>
<t t-if="can_upload">
<button type="button"
class="btn btn-secondary"
onclick="document.getElementById('o_nxz_share_upload').click()">
<i class="fa fa-upload"/> Replace file
</button>
<form t-att-action="'/nxz/document/%s/upload' % token"
method="post"
enctype="multipart/form-data"
class="d-none">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<input id="o_nxz_share_upload"
type="file"
name="ufile"
onchange="this.form.submit()"/>
</form>
</t>
</div>
</div>
</t>
</template>
<template id="mail_template_document_share">
<div>
<p>
<t t-out="user.name or ''"/> shared this document with you
<t t-if="record.name">: <strong t-out="record.name"/></t>.
</p>
<div t-if="message" style="color:#777; margin-top:12px;" t-out="message"/>
<p style="margin-top:16px;">
<a t-att-href="portal_url"
style="background:#714B67;color:#fff;padding:8px 16px;text-decoration:none;border-radius:4px;">
Open document
</a>
</p>
</div>
</template>
<record id="mail_template_nxz_document_share_invite" model="mail.template">
<field name="name">Document Hub: Share Invite</field>
<field name="model_id" ref="model_nxz_document_file"/>
<field name="subject">Document shared with you: {{ object.name }}</field>
<field name="email_from">{{ (object.company_id.email_formatted or user.email_formatted) }}</field>
<field name="body_html" type="html">
<div>
<p>Hello,</p>
<p>
{{ object.owner_id.name }} shared the document
<strong>{{ object.name }}</strong> with you.
</p>
<p>
<a href="{{ object.get_base_url() }}/my/nxz/documents/{{ object.id }}"
style="background:#714B67;color:#fff;padding:8px 16px;text-decoration:none;border-radius:4px;">
Open document
</a>
</p>
<p>If you do not have an account yet, check your inbox for a portal invitation.</p>
</div>
</field>
</record>
</odoo>