[IMP] document_page_portal: black, isort, prettier

This commit is contained in:
Marcel Savegnago
2021-02-28 17:26:09 -03:00
parent eae641107f
commit b7f4fa7ebc
12 changed files with 245 additions and 151 deletions

View File

@@ -1,11 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2020 - TODAY, Marcel Savegnago - Escodoo
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<template id="assets_frontend" inherit_id="web.assets_frontend" name="Portal Assets" priority="15">
<template
id="assets_frontend"
inherit_id="web.assets_frontend"
name="Portal Assets"
priority="15"
>
<xpath expr="//script[last()]" position="after">
<script type="text/javascript" src="/document_page_portal/static/src/js/document_page_portal_tour.js"></script>
<script
type="text/javascript"
src="/document_page_portal/static/src/js/document_page_portal_tour.js"
/>
</xpath>
</template>

View File

@@ -1,16 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2020 - TODAY, Marcel Savegnago - Escodoo
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<record model="ir.ui.view" id="document_page_form_view">
<field name="name">document.page.form (in document_page_portal)</field>
<field name="model">document.page</field>
<field name="inherit_id" ref="document_page.view_wiki_form"/>
<field name="inherit_id" ref="document_page.view_wiki_form" />
<field name="arch" type="xml">
<field name="parent_id" position="after">
<field name="is_public" groups="document_page.group_document_manager"/>
<field name="is_public" groups="document_page.group_document_manager" />
</field>
</field>
</record>

View File

@@ -1,11 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data noupdate="0">
<template id="portal_my_home_menu_Knowledge" name="Portal layout : Knowledge document_pages menu entries" inherit_id="portal.portal_breadcrumbs" priority="50">
<template
id="portal_my_home_menu_Knowledge"
name="Portal layout : Knowledge document_pages menu entries"
inherit_id="portal.portal_breadcrumbs"
priority="50"
>
<xpath expr="//ol[hasclass('o_portal_submenu')]" position="inside">
<li t-if="page_name == 'document_page' or document_page" t-attf-class="breadcrumb-item #{'active ' if not document_page else ''}">
<a t-if="document_page" t-attf-href="/my/knowledge/documents?{{ keep_query() }}">Knowledge Documents</a>
<li
t-if="page_name == 'document_page' or document_page"
t-attf-class="breadcrumb-item #{'active ' if not document_page else ''}"
>
<a
t-if="document_page"
t-attf-href="/my/knowledge/documents?{{ keep_query() }}"
>Knowledge Documents</a>
<t t-else="">Knowledge Documents</t>
</li>
<li t-if="document_page" class="breadcrumb-item active">
@@ -14,7 +25,12 @@
</xpath>
</template>
<template id="portal_my_home_Knowledge_document_page" name="Portal My Home : Knowledge Documents" inherit_id="portal.portal_my_home" priority="50">
<template
id="portal_my_home_Knowledge_document_page"
name="Portal My Home : Knowledge Documents"
inherit_id="portal.portal_my_home"
priority="50"
>
<xpath expr="//div[hasclass('o_portal_docs')]" position="inside">
<t t-if="document_page_count" t-call="portal.portal_docs_entry">
<t t-set="title">Knowledge Documents</t>
@@ -39,18 +55,25 @@
<tr>
<th class="text-right">Ref</th>
<th class="w-100">Name</th>
<th/>
<th />
<th class="text-center">Category</th>
</tr>
</thead>
<t t-foreach="document_pages" t-as="document_page">
<tr>
<td class="text-right"><a t-attf-href="/knowledge/document/#{document_page.id}"><small>#</small><t t-esc="document_page.id"/></a></td>
<td class="text-right"><a
t-attf-href="/knowledge/document/#{document_page.id}"
><small>#</small><t t-esc="document_page.id" /></a></td>
<td>
<a t-attf-href="/knowledge/document/#{document_page.id}"><span t-field="document_page.name" /></a>
<a
t-attf-href="/knowledge/document/#{document_page.id}"
><span t-field="document_page.name" /></a>
</td>
<td/>
<td class="text-center"><span class="badge badge-pill badge-info" t-field="document_page.parent_id.name" /></td>
<td />
<td class="text-center"><span
class="badge badge-pill badge-info"
t-field="document_page.parent_id.name"
/></td>
</tr>
</t>
</t>
@@ -61,9 +84,15 @@
<t t-call="portal.portal_layout">
<t t-set="wrapwrap_classes" t-value="'o_portal_bg_dark'" />
<t t-set="o_portal_fullwidth_alert" groups="knowledge.group_document_user">
<t
t-set="o_portal_fullwidth_alert"
groups="knowledge.group_document_user"
>
<t t-call="portal.portal_back_in_edit_mode">
<t t-set="backend_url" t-value="'/web#return_label=Website&amp;model=document.page&amp;id=%s&amp;view_type=form' % (document_page.id)" />
<t
t-set="backend_url"
t-value="'/web#return_label=Website&amp;model=document.page&amp;id=%s&amp;view_type=form' % (document_page.id)"
/>
</t>
</t>
@@ -72,22 +101,32 @@
<div class="row no-gutters">
<div class="col-md">
<h5 class="mb-1 mb-md-0">
<span t-field="document_page.name"/>
<small class="text-muted"> (#<span t-field="document_page.id"/>)</small>
<span t-field="document_page.name" />
<small class="text-muted"> (#<span
t-field="document_page.id"
/>)</small>
</h5>
</div>
<div class="col-md text-md-right">
<small class="text-right">Category:</small>
<span t-field="document_page.parent_id.name" class=" badge badge-pill badge-info" title="Current Category of this document" />
<span
t-field="document_page.parent_id.name"
class=" badge badge-pill badge-info"
title="Current Category of this document"
/>
</div>
</div>
</t>
<t t-set="card_body">
<div class="row mb-4">
<h1 class="col-lg-12">
<span t-field="document_page.name"/>
<span t-field="document_page.name" />
</h1>
<div t-if="document_page.content" class="col-lg-12" t-raw="document_page.content" />
<div
t-if="document_page.content"
class="col-lg-12"
t-raw="document_page.content"
/>
<div t-else="" class="col-lg-10">
<em class="text-muted"><small>No content</small></em>
</div>