This commit gives the read access to public users to published articles (website_published = True). Task-2674460 Part-of: odoo/odoo#82315 Co-authored-by: Damien Abeloos <abd@odoo.com> Co-authored-by: Julien Banken <jbn@odoo.com> Co-authored-by: David Beguin <dbe@odoo.com> Co-authored-by: Fabio Barbero <faba@odoo.com> Co-authored-by: Thibault Delavallee <tde@odoo.com> Co-authored-by: Aurelien Warnong <awa@odoo.com>
103 lines
5.9 KiB
XML
103 lines
5.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<data>
|
|
<!-- Article layout -->
|
|
<template id="knowledge.layout" name="knowledge Layout" inherit_id="web.frontend_layout" primary="True">
|
|
<xpath expr="//header" position="before">
|
|
<t t-set="no_header" t-value="True"/>
|
|
<t t-set="no_footer" t-value="True"/>
|
|
</xpath>
|
|
</template>
|
|
|
|
<template id="knowledge_article_view_frontend" name="Knowledge Portal">
|
|
<t t-call="knowledge.layout">
|
|
<div class="container-fluid h-100 o_knowledge_form_view" t-att-data-article-id="article.id if article else False">
|
|
<div class="row h-100">
|
|
<div t-att-class="'p-0 overflow-auto' + (' col-sm-2' if show_sidebar else ' d-none')">
|
|
<div t-att-class="'o_knowledge_aside border-bottom border-right flex-column h-100 w-100' + (' d-flex' if show_sidebar else ' d-none')">
|
|
<div class="p-3">
|
|
<input type="text" class="form-control knowledge_search_bar" placeholder="Search an Article..."/>
|
|
</div>
|
|
<!-- File explorer -->
|
|
<div class="flex-grow-1 position-relative">
|
|
<div class="o_scroll_view px-3">
|
|
<div class="o_knowledge_tree" t-att-data-portal-readonly-mode="portal_readonly_mode">
|
|
<div class="p-5 text-center">
|
|
<i class="fa fa-circle-o-notch fa-2x fa-spin" title="loader" role="img"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div t-att-class="('col-sm-10' if show_sidebar else 'col-sm-12') + ' p-0 overflow-auto'">
|
|
<div class="d-flex flex-column h-100">
|
|
<!-- Article header -->
|
|
<div class="o_knowledge_header d-sm-flex flex-row justify-content-between border-bottom">
|
|
<div class="d-flex align-items-center p-3" t-if="not article">
|
|
<h3>Error</h3>
|
|
</div>
|
|
<div class="d-flex align-items-center p-3" t-else="">
|
|
<!-- Title -->
|
|
<span t-out="article.name" />
|
|
<a href="#" class="o_favorites_toggle_button pl-1" t-att-data-article-id="article.id">
|
|
<i t-if="article.is_user_favorite" class="fa fa-star" />
|
|
<i t-else="" class="fa fa-star-o" />
|
|
</a>
|
|
</div>
|
|
<!-- Log In -->
|
|
<t t-call="portal.placeholder_user_sign_in">
|
|
<t t-set="_item_class" t-valuef="d-flex align-items-center p-2"/>
|
|
<t t-set="_link_class" t-valuef="nav-link font-weight-bold"/>
|
|
</t>
|
|
<t t-call="portal.user_dropdown">
|
|
<t t-set="_user_name" t-value="True"/>
|
|
<t t-set="_item_class" t-valuef="d-flex align-items-center p-2"/>
|
|
<t t-set="_link_class" t-valuef="nav-link font-weight-bold"/>
|
|
</t>
|
|
</div>
|
|
<div class="p-3 text-center" t-if="not article">
|
|
<p class="o_view_nocontent_empty_folder">
|
|
<h2>Not found</h2>
|
|
<br />
|
|
<p>The requested article does not exist or you do not have access to it.</p>
|
|
</p>
|
|
</div>
|
|
<div class="flex-grow-1 position-relative" t-else="">
|
|
<div class="o_scroll_view">
|
|
<!-- Article Cover -->
|
|
<div t-if="article.cover" class="o_knowledge_cover_image">
|
|
<img t-attf-src="data:image/png;base64,{{ article.cover }}" />
|
|
</div>
|
|
<!-- Article Icon -->
|
|
<div t-if="article.icon" t-attf-class="o_knowledge_icon px-3 #{'o_full_width' if article.full_width else ''}">
|
|
<t t-out="article.icon" />
|
|
</div>
|
|
<!-- Article Body -->
|
|
<div t-attf-class="o_knowledge_article px-3 #{'o_full_width' if article.full_width else ''}">
|
|
<t t-out="article.body" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</template>
|
|
|
|
<template id="knowledge_article_tree_frontend" name="Frontend Article Tree">
|
|
<t t-call="knowledge.knowledge_article_tree_favorites" />
|
|
<t t-set="visible_articles" t-value="(workspace_articles | shared_articles)"/>
|
|
<section t-if="visible_articles">
|
|
<div class="h4 mb-0">Shared with you</div>
|
|
<ul class="o_tree o_tree_workspace m-0 px-0 py-2">
|
|
<t t-call="knowledge.articles_template">
|
|
<t t-set="articles" t-value="visible_articles"/>
|
|
</t>
|
|
</ul>
|
|
</section>
|
|
</template>
|
|
</data>
|
|
</odoo>
|