mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-16 12:12:57 -06:00
[ADD] document_page_portal
This commit is contained in:
parent
e0c5c83d1f
commit
0f883d8bac
105
document_page_portal/README.rst
Normal file
105
document_page_portal/README.rst
Normal file
@ -0,0 +1,105 @@
|
||||
====================
|
||||
Document Page Portal
|
||||
====================
|
||||
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
|
||||
:target: https://odoo-community.org/page/development-status
|
||||
:alt: Alpha
|
||||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github
|
||||
:target: https://github.com/OCA/knowledge/tree/12.0/document_page_portal
|
||||
:alt: OCA/knowledge
|
||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||
:target: https://translation.odoo-community.org/projects/knowledge-12-0/knowledge-12-0-document_page_portal
|
||||
:alt: Translate me on Weblate
|
||||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
|
||||
:target: https://runbot.odoo-community.org/runbot/118/12.0
|
||||
:alt: Try me on Runbot
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|
||||
This module allows documents to be made available on the portal.
|
||||
|
||||
.. IMPORTANT::
|
||||
This is an alpha version, the data model and design can change at any time without warning.
|
||||
Only for development or testing purpose, do not use in production.
|
||||
`More details on development status <https://odoo-community.org/page/development-status>`_
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
No configuration required.
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
* Add a user as a follower of the document or configure the document as public so that it is visible through the user portal.
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/knowledge/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/OCA/knowledge/issues/new?body=module:%20document_page_portal%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Authors
|
||||
~~~~~~~
|
||||
|
||||
* Escodoo
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* `Escodoo <https://www.escodoo.com.br>`_:
|
||||
|
||||
* Marcel Savegnago <marcel.savegnago@escodoo.com.br>
|
||||
|
||||
Other credits
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
The development of this module has been financially supported by:
|
||||
|
||||
* Escodoo <https://www.escodoo.com.br>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
This module is maintained by the OCA.
|
||||
|
||||
.. image:: https://odoo-community.org/logo.png
|
||||
:alt: Odoo Community Association
|
||||
:target: https://odoo-community.org
|
||||
|
||||
OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.
|
||||
|
||||
.. |maintainer-marcelsavegnago| image:: https://github.com/marcelsavegnago.png?size=40px
|
||||
:target: https://github.com/marcelsavegnago
|
||||
:alt: marcelsavegnago
|
||||
|
||||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|
||||
|
||||
|maintainer-marcelsavegnago|
|
||||
|
||||
This module is part of the `OCA/knowledge <https://github.com/OCA/knowledge/tree/12.0/document_page_portal>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
2
document_page_portal/__init__.py
Normal file
2
document_page_portal/__init__.py
Normal file
@ -0,0 +1,2 @@
|
||||
from . import controllers
|
||||
from . import models
|
28
document_page_portal/__manifest__.py
Normal file
28
document_page_portal/__manifest__.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Copyright (C) 2020 - TODAY, Marcel Savegnago - Escodoo).
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
{
|
||||
'name': 'Document Page Portal',
|
||||
'summary': """
|
||||
This module enables document page portal""",
|
||||
'version': '12.0.1.0.0',
|
||||
'category': 'Knowledge Management',
|
||||
'author': 'Escodoo, Odoo Community Association (OCA)',
|
||||
'maintainers': ['marcelsavegnago'],
|
||||
'images': ['static/description/banner.png'],
|
||||
'website': 'https://github.com/OCA/knowledge',
|
||||
'license': 'AGPL-3',
|
||||
'depends': [
|
||||
'base',
|
||||
'portal',
|
||||
'document_page'
|
||||
],
|
||||
'data': [
|
||||
'views/assets.xml',
|
||||
'views/document_page.xml',
|
||||
'security/document_page_portal_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'views/document_page_portal_templates.xml',
|
||||
],
|
||||
}
|
1
document_page_portal/controllers/__init__.py
Normal file
1
document_page_portal/controllers/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from . import portal
|
118
document_page_portal/controllers/portal.py
Normal file
118
document_page_portal/controllers/portal.py
Normal file
@ -0,0 +1,118 @@
|
||||
# Copyright (C) 2020 - TODAY, Marcel Savegnago - Escodoo).
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
from odoo import http
|
||||
from odoo.exceptions import AccessError, MissingError
|
||||
from odoo.http import request
|
||||
from odoo.tools.translate import _
|
||||
from odoo.addons.portal.controllers.portal import pager as portal_pager, CustomerPortal
|
||||
from odoo.osv.expression import OR
|
||||
|
||||
|
||||
class CustomerPortal(CustomerPortal):
|
||||
|
||||
def _prepare_portal_layout_values(self):
|
||||
values = super(CustomerPortal, self)._prepare_portal_layout_values()
|
||||
values['document_page_count'] = request.env[
|
||||
'document.page'].search_count([('type', '=', 'content')])
|
||||
return values
|
||||
|
||||
def _document_page_get_page_view_values(self, document_page,
|
||||
access_token, **kwargs):
|
||||
values = {
|
||||
'page_name': 'document_page',
|
||||
'document_page': document_page,
|
||||
}
|
||||
return self._get_page_view_values(
|
||||
document_page, access_token, values,
|
||||
'my_document_pages_history', False, **kwargs)
|
||||
|
||||
@http.route(
|
||||
['/my/knowledge/documents/', '/my/knowledge/documents/page/<int:page>'],
|
||||
type='http', auth="user", website=True)
|
||||
def portal_my_knowledge_document_pages(self, page=1, date_begin=None,
|
||||
date_end=None, sortby=None,
|
||||
search=None, search_in='content', **kw):
|
||||
values = self._prepare_portal_layout_values()
|
||||
domain = [('type', '=', 'content')]
|
||||
|
||||
searchbar_sortings = {
|
||||
'date': {'label': _('Newest'), 'order': 'create_date desc'},
|
||||
'name': {'label': _('Name'), 'order': 'name'},
|
||||
'parent': {'label': _('Category'), 'order': 'parent_id'},
|
||||
}
|
||||
searchbar_inputs = {
|
||||
'content': {'input': 'content', 'label': _(
|
||||
'Search <span class="nolabel"> (in Content)</span>')},
|
||||
'all': {'input': 'all', 'label': _('Search in All')},
|
||||
}
|
||||
|
||||
# default sort by value
|
||||
if not sortby:
|
||||
sortby = 'date'
|
||||
order = searchbar_sortings[sortby]['order']
|
||||
|
||||
# archive groups - Default Group By 'create_date'
|
||||
archive_groups = self._get_archive_groups('document.page', domain)
|
||||
if date_begin and date_end:
|
||||
domain += [
|
||||
('create_date', '>', date_begin),
|
||||
('create_date', '<=', date_end),
|
||||
]
|
||||
|
||||
# search
|
||||
if search and search_in:
|
||||
search_domain = []
|
||||
if search_in in ('content', 'all'):
|
||||
search_domain = OR([search_domain, [
|
||||
'|', ('name', 'ilike', search), ('content', 'ilike', search)]])
|
||||
domain += search_domain
|
||||
|
||||
# pager
|
||||
document_pages_count = request.env['document.page'].search_count(domain)
|
||||
pager = portal_pager(
|
||||
url="/my/knowledge/documents",
|
||||
url_args={'date_begin': date_begin, 'date_end': date_end, 'sortby': sortby},
|
||||
total=document_pages_count,
|
||||
page=page,
|
||||
step=self._items_per_page
|
||||
)
|
||||
|
||||
document_pages = request.env['document.page'].search(
|
||||
domain, order=order, limit=self._items_per_page, offset=pager['offset'])
|
||||
request.session['my_document_pages_history'] = document_pages.ids[:100]
|
||||
|
||||
values.update({
|
||||
'date': date_begin,
|
||||
'document_pages': document_pages,
|
||||
'page_name': 'document_page',
|
||||
'default_url': '/my/knowledge/s',
|
||||
'pager': pager,
|
||||
'archive_groups': archive_groups,
|
||||
'searchbar_sortings': searchbar_sortings,
|
||||
'searchbar_inputs': searchbar_inputs,
|
||||
'sortby': sortby,
|
||||
'search_in': search_in,
|
||||
'search': search,
|
||||
})
|
||||
return request.render(
|
||||
"document_page_portal.portal_my_knowledge_document_pages", values)
|
||||
|
||||
@http.route([
|
||||
"/knowledge/document/<int:document_page_id>",
|
||||
"/knowledge/document/<int:document_page_id>/<token>",
|
||||
'/my/knowledge/document/<int:document_page_id>'
|
||||
], type='http', auth="public", website=True)
|
||||
def document_pages_followup(self, document_page_id=None,
|
||||
access_token=None, **kw):
|
||||
try:
|
||||
document_page_sudo = self._document_check_access(
|
||||
'document.page', document_page_id, access_token)
|
||||
except (AccessError, MissingError):
|
||||
return request.redirect('/my')
|
||||
|
||||
values = self._document_page_get_page_view_values(
|
||||
document_page_sudo, access_token, **kw)
|
||||
return request.render(
|
||||
"document_page_portal.document_pages_followup", values)
|
81
document_page_portal/i18n/document_page_portal.pot
Normal file
81
document_page_portal/i18n/document_page_portal.pot
Normal file
@ -0,0 +1,81 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * document_page_portal
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-02-15 05:49+0000\n"
|
||||
"PO-Revision-Date: 2020-02-15 05:49+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: document_page_portal
|
||||
#: model_terms:ir.ui.view,arch_db:document_page_portal.document_pages_followup
|
||||
msgid "<em class=\"text-muted\"><small>No content</small></em>"
|
||||
msgstr ""
|
||||
|
||||
#. module: document_page_portal
|
||||
#: model_terms:ir.ui.view,arch_db:document_page_portal.document_pages_followup
|
||||
msgid "<small class=\"text-right\">Category:</small>"
|
||||
msgstr ""
|
||||
|
||||
#. module: document_page_portal
|
||||
#: code:addons/document_page_portal/controllers/portal.py:36
|
||||
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_knowledge_document_pages
|
||||
#, python-format
|
||||
msgid "Category"
|
||||
msgstr ""
|
||||
|
||||
#. module: document_page_portal
|
||||
#: model_terms:ir.ui.view,arch_db:document_page_portal.document_pages_followup
|
||||
msgid "Current Category of this document"
|
||||
msgstr ""
|
||||
|
||||
#. module: document_page_portal
|
||||
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_home_Knowledge_document_page
|
||||
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_home_menu_Knowledge
|
||||
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_knowledge_document_pages
|
||||
msgid "Documents"
|
||||
msgstr ""
|
||||
|
||||
#. module: document_page_portal
|
||||
#: code:addons/document_page_portal/controllers/portal.py:35
|
||||
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_knowledge_document_pages
|
||||
#, python-format
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: document_page_portal
|
||||
#: code:addons/document_page_portal/controllers/portal.py:34
|
||||
#, python-format
|
||||
msgid "Newest"
|
||||
msgstr ""
|
||||
|
||||
#. module: document_page_portal
|
||||
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_knowledge_document_pages
|
||||
msgid "Ref"
|
||||
msgstr ""
|
||||
|
||||
#. module: document_page_portal
|
||||
#: code:addons/document_page_portal/controllers/portal.py:39
|
||||
#, python-format
|
||||
msgid "Search <span class=\"nolabel\"> (in Content)</span>"
|
||||
msgstr ""
|
||||
|
||||
#. module: document_page_portal
|
||||
#: code:addons/document_page_portal/controllers/portal.py:40
|
||||
#, python-format
|
||||
msgid "Search in All"
|
||||
msgstr ""
|
||||
|
||||
#. module: document_page_portal
|
||||
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_knowledge_document_pages
|
||||
msgid "There are currently no Document for your account."
|
||||
msgstr ""
|
||||
|
72
document_page_portal/i18n/pt_BR.po
Normal file
72
document_page_portal/i18n/pt_BR.po
Normal file
@ -0,0 +1,72 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * document_page_portal
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-11-27 14:08+0000\n"
|
||||
"PO-Revision-Date: 2019-11-27 11:11-0300\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
"X-Generator: Poedit 2.2.4\n"
|
||||
"Last-Translator: \n"
|
||||
"Language: pt_BR\n"
|
||||
|
||||
#. module: document_page_portal
|
||||
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_document_page_page
|
||||
msgid ""
|
||||
"<br/>\n"
|
||||
" <b>Category:</b>"
|
||||
msgstr ""
|
||||
"<br/>\n"
|
||||
" <b>Categoria:</b>"
|
||||
|
||||
#. module: document_page_portal
|
||||
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_document_page_page
|
||||
msgid ""
|
||||
"<br/>\n"
|
||||
" <strong>Date:</strong>"
|
||||
msgstr ""
|
||||
"<br/>\n"
|
||||
" <strong>Data:</strong>"
|
||||
|
||||
#. module: document_page_portal
|
||||
#: code:addons/document_page_portal/controllers/portal.py:55
|
||||
#, python-format
|
||||
msgid "All"
|
||||
msgstr "Todos"
|
||||
|
||||
#. module: document_page_portal
|
||||
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_documents
|
||||
msgid "Category"
|
||||
msgstr "Categoria"
|
||||
|
||||
#. module: document_page_portal
|
||||
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_layout
|
||||
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_documents
|
||||
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_home
|
||||
msgid "Documents"
|
||||
msgstr "Documentos"
|
||||
|
||||
#. module: document_page_portal
|
||||
#: code:addons/document_page_portal/controllers/portal.py:53
|
||||
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_documents
|
||||
#, python-format
|
||||
msgid "Name"
|
||||
msgstr "Nome"
|
||||
|
||||
#. module: document_page_portal
|
||||
#: code:addons/document_page_portal/controllers/portal.py:52
|
||||
#, python-format
|
||||
msgid "Newest"
|
||||
msgstr "Mais Recentes"
|
||||
|
||||
#. module: document_page_portal
|
||||
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_documents
|
||||
msgid "There are no documents in your account."
|
||||
msgstr "Não há documentos em sua conta."
|
1
document_page_portal/models/__init__.py
Normal file
1
document_page_portal/models/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from . import document_page
|
14
document_page_portal/models/document_page.py
Normal file
14
document_page_portal/models/document_page.py
Normal file
@ -0,0 +1,14 @@
|
||||
# Copyright 2020 - TODAY, Marcel Savegnago - Escodoo
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class DocumentPage(models.Model):
|
||||
|
||||
_inherit = 'document.page'
|
||||
|
||||
is_public = fields.Boolean(
|
||||
'Public Page',
|
||||
help='If true it allows any user of the portal to have '
|
||||
'access to this document.')
|
1
document_page_portal/readme/CONFIGURE.rst
Normal file
1
document_page_portal/readme/CONFIGURE.rst
Normal file
@ -0,0 +1 @@
|
||||
No configuration required.
|
3
document_page_portal/readme/CONTRIBUTORS.rst
Normal file
3
document_page_portal/readme/CONTRIBUTORS.rst
Normal file
@ -0,0 +1,3 @@
|
||||
* `Escodoo <https://www.escodoo.com.br>`_:
|
||||
|
||||
* Marcel Savegnago <marcel.savegnago@escodoo.com.br>
|
3
document_page_portal/readme/CREDITS.rst
Normal file
3
document_page_portal/readme/CREDITS.rst
Normal file
@ -0,0 +1,3 @@
|
||||
The development of this module has been financially supported by:
|
||||
|
||||
* Escodoo <https://www.escodoo.com.br>
|
1
document_page_portal/readme/DESCRIPTION.rst
Normal file
1
document_page_portal/readme/DESCRIPTION.rst
Normal file
@ -0,0 +1 @@
|
||||
This module allows documents to be made available on the portal.
|
1
document_page_portal/readme/USAGE.rst
Normal file
1
document_page_portal/readme/USAGE.rst
Normal file
@ -0,0 +1 @@
|
||||
* Add a user as a follower of the document or configure the document as public so that it is visible through the user portal.
|
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<record model="ir.rule" id="knowledge_user_document_page_rule">
|
||||
<field name="name">Documents: knowledge user: see all</field>
|
||||
<field name="model_id" ref="document_page.model_document_page" />
|
||||
<field name="domain_force">[(1, '=', 1)]</field>
|
||||
<field name="groups" eval="[(4,ref('knowledge.group_document_user'))]" />
|
||||
</record>
|
||||
<record model="ir.rule" id="knowledge_portal_document_page_rule">
|
||||
<field name="name">Documents: portal users: portal or following</field>
|
||||
<field name="model_id" ref="document_page.model_document_page" />
|
||||
<field name="domain_force">
|
||||
[
|
||||
'|', '|', ('type', '!=', 'content'), ('is_public', '=', True),
|
||||
('message_partner_ids', 'child_of', [user.partner_id.commercial_partner_id.id])
|
||||
]
|
||||
</field>
|
||||
<field name="groups" eval="[(4, ref('base.group_portal')),(4, ref('base.group_user'))]" />
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
3
document_page_portal/security/ir.model.access.csv
Normal file
3
document_page_portal/security/ir.model.access.csv
Normal file
@ -0,0 +1,3 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
document_page_portal,document.page portal,document_page.model_document_page,base.group_portal,1,0,0,0
|
||||
document_page_portal_user,document.page portal user,document_page.model_document_page,base.group_user,1,0,0,0
|
|
BIN
document_page_portal/static/description/banner.png
Normal file
BIN
document_page_portal/static/description/banner.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.6 KiB |
BIN
document_page_portal/static/description/icon.png
Normal file
BIN
document_page_portal/static/description/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
450
document_page_portal/static/description/index.html
Normal file
450
document_page_portal/static/description/index.html
Normal file
@ -0,0 +1,450 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.16: http://docutils.sourceforge.net/" />
|
||||
<title>Document Page Portal</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
|
||||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
/* used to remove borders from tables and images */
|
||||
.borderless, table.borderless td, table.borderless th {
|
||||
border: 0 }
|
||||
|
||||
table.borderless td, table.borderless th {
|
||||
/* Override padding for "table.docutils td" with "! important".
|
||||
The right padding separates the table cells. */
|
||||
padding: 0 0.5em 0 0 ! important }
|
||||
|
||||
.first {
|
||||
/* Override more specific margin styles with "! important". */
|
||||
margin-top: 0 ! important }
|
||||
|
||||
.last, .with-subtitle {
|
||||
margin-bottom: 0 ! important }
|
||||
|
||||
.hidden {
|
||||
display: none }
|
||||
|
||||
.subscript {
|
||||
vertical-align: sub;
|
||||
font-size: smaller }
|
||||
|
||||
.superscript {
|
||||
vertical-align: super;
|
||||
font-size: smaller }
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none ;
|
||||
color: black }
|
||||
|
||||
blockquote.epigraph {
|
||||
margin: 2em 5em ; }
|
||||
|
||||
dl.docutils dd {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
||||
dl.docutils dt {
|
||||
font-weight: bold }
|
||||
*/
|
||||
|
||||
div.abstract {
|
||||
margin: 2em 5em }
|
||||
|
||||
div.abstract p.topic-title {
|
||||
font-weight: bold ;
|
||||
text-align: center }
|
||||
|
||||
div.admonition, div.attention, div.caution, div.danger, div.error,
|
||||
div.hint, div.important, div.note, div.tip, div.warning {
|
||||
margin: 2em ;
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.admonition p.admonition-title, div.hint p.admonition-title,
|
||||
div.important p.admonition-title, div.note p.admonition-title,
|
||||
div.tip p.admonition-title {
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||
div.danger p.admonition-title, div.error p.admonition-title,
|
||||
div.warning p.admonition-title, .code .error {
|
||||
color: red ;
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
/* Uncomment (and remove this text!) to get reduced vertical space in
|
||||
compound paragraphs.
|
||||
div.compound .compound-first, div.compound .compound-middle {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
div.compound .compound-last, div.compound .compound-middle {
|
||||
margin-top: 0.5em }
|
||||
*/
|
||||
|
||||
div.dedication {
|
||||
margin: 2em 5em ;
|
||||
text-align: center ;
|
||||
font-style: italic }
|
||||
|
||||
div.dedication p.topic-title {
|
||||
font-weight: bold ;
|
||||
font-style: normal }
|
||||
|
||||
div.figure {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
div.footer, div.header {
|
||||
clear: both;
|
||||
font-size: smaller }
|
||||
|
||||
div.line-block {
|
||||
display: block ;
|
||||
margin-top: 1em ;
|
||||
margin-bottom: 1em }
|
||||
|
||||
div.line-block div.line-block {
|
||||
margin-top: 0 ;
|
||||
margin-bottom: 0 ;
|
||||
margin-left: 1.5em }
|
||||
|
||||
div.sidebar {
|
||||
margin: 0 0 0.5em 1em ;
|
||||
border: medium outset ;
|
||||
padding: 1em ;
|
||||
background-color: #ffffee ;
|
||||
width: 40% ;
|
||||
float: right ;
|
||||
clear: right }
|
||||
|
||||
div.sidebar p.rubric {
|
||||
font-family: sans-serif ;
|
||||
font-size: medium }
|
||||
|
||||
div.system-messages {
|
||||
margin: 5em }
|
||||
|
||||
div.system-messages h1 {
|
||||
color: red }
|
||||
|
||||
div.system-message {
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.system-message p.system-message-title {
|
||||
color: red ;
|
||||
font-weight: bold }
|
||||
|
||||
div.topic {
|
||||
margin: 2em }
|
||||
|
||||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
||||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
||||
margin-top: 0.4em }
|
||||
|
||||
h1.title {
|
||||
text-align: center }
|
||||
|
||||
h2.subtitle {
|
||||
text-align: center }
|
||||
|
||||
hr.docutils {
|
||||
width: 75% }
|
||||
|
||||
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
||||
clear: left ;
|
||||
float: left ;
|
||||
margin-right: 1em }
|
||||
|
||||
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
||||
clear: right ;
|
||||
float: right ;
|
||||
margin-left: 1em }
|
||||
|
||||
img.align-center, .figure.align-center, object.align-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.align-center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left }
|
||||
|
||||
.align-center {
|
||||
clear: both ;
|
||||
text-align: center }
|
||||
|
||||
.align-right {
|
||||
text-align: right }
|
||||
|
||||
/* reset inner alignment in figures */
|
||||
div.align-right {
|
||||
text-align: inherit }
|
||||
|
||||
/* div.align-center * { */
|
||||
/* text-align: left } */
|
||||
|
||||
.align-top {
|
||||
vertical-align: top }
|
||||
|
||||
.align-middle {
|
||||
vertical-align: middle }
|
||||
|
||||
.align-bottom {
|
||||
vertical-align: bottom }
|
||||
|
||||
ol.simple, ul.simple {
|
||||
margin-bottom: 1em }
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal }
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha }
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha }
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman }
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman }
|
||||
|
||||
p.attribution {
|
||||
text-align: right ;
|
||||
margin-left: 50% }
|
||||
|
||||
p.caption {
|
||||
font-style: italic }
|
||||
|
||||
p.credits {
|
||||
font-style: italic ;
|
||||
font-size: smaller }
|
||||
|
||||
p.label {
|
||||
white-space: nowrap }
|
||||
|
||||
p.rubric {
|
||||
font-weight: bold ;
|
||||
font-size: larger ;
|
||||
color: maroon ;
|
||||
text-align: center }
|
||||
|
||||
p.sidebar-title {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold ;
|
||||
font-size: larger }
|
||||
|
||||
p.sidebar-subtitle {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold }
|
||||
|
||||
pre.address {
|
||||
margin-bottom: 0 ;
|
||||
margin-top: 0 ;
|
||||
font: inherit }
|
||||
|
||||
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: grey; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
||||
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
||||
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
||||
pre.code .inserted, code .inserted { background-color: #A3D289}
|
||||
|
||||
span.classifier {
|
||||
font-family: sans-serif ;
|
||||
font-style: oblique }
|
||||
|
||||
span.classifier-delimiter {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
span.interpreted {
|
||||
font-family: sans-serif }
|
||||
|
||||
span.option {
|
||||
white-space: nowrap }
|
||||
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
/* font-size relative to parent (h1..h6 element) */
|
||||
font-size: 80% }
|
||||
|
||||
table.citation {
|
||||
border-left: solid 1px gray;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docinfo {
|
||||
margin: 2em 4em }
|
||||
|
||||
table.docutils {
|
||||
margin-top: 0.5em ;
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
table.footnote {
|
||||
border-left: solid 1px black;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docutils td, table.docutils th,
|
||||
table.docinfo td, table.docinfo th {
|
||||
padding-left: 0.5em ;
|
||||
padding-right: 0.5em ;
|
||||
vertical-align: top }
|
||||
|
||||
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
||||
font-weight: bold ;
|
||||
text-align: left ;
|
||||
white-space: nowrap ;
|
||||
padding-left: 0 }
|
||||
|
||||
/* "booktabs" style (no vertical lines) */
|
||||
table.docutils.booktabs {
|
||||
border: 0px;
|
||||
border-top: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.docutils.booktabs * {
|
||||
border: 0px;
|
||||
}
|
||||
table.docutils.booktabs th {
|
||||
border-bottom: thin solid;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
||||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
||||
font-size: 100% }
|
||||
|
||||
ul.auto-toc {
|
||||
list-style-type: none }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="document-page-portal">
|
||||
<h1 class="title">Document Page Portal</h1>
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/knowledge/tree/12.0/document_page_portal"><img alt="OCA/knowledge" src="https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/knowledge-12-0/knowledge-12-0-document_page_portal"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/118/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p>This module allows documents to be made available on the portal.</p>
|
||||
<div class="admonition important">
|
||||
<p class="first admonition-title">Important</p>
|
||||
<p class="last">This is an alpha version, the data model and design can change at any time without warning.
|
||||
Only for development or testing purpose, do not use in production.
|
||||
<a class="reference external" href="https://odoo-community.org/page/development-status">More details on development status</a></p>
|
||||
</div>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#configuration" id="id1">Configuration</a></li>
|
||||
<li><a class="reference internal" href="#usage" id="id2">Usage</a></li>
|
||||
<li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="id4">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="id5">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="id6">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#other-credits" id="id7">Other credits</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id8">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="configuration">
|
||||
<h1><a class="toc-backref" href="#id1">Configuration</a></h1>
|
||||
<p>No configuration required.</p>
|
||||
</div>
|
||||
<div class="section" id="usage">
|
||||
<h1><a class="toc-backref" href="#id2">Usage</a></h1>
|
||||
<ul class="simple">
|
||||
<li>Add a user as a follower of the document or configure the document as public so that it is visible through the user portal.</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/knowledge/issues">GitHub Issues</a>.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/OCA/knowledge/issues/new?body=module:%20document_page_portal%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#id4">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#id5">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Escodoo</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id6">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li><a class="reference external" href="https://www.escodoo.com.br">Escodoo</a>:<ul>
|
||||
<li>Marcel Savegnago <<a class="reference external" href="mailto:marcel.savegnago@escodoo.com.br">marcel.savegnago@escodoo.com.br</a>></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="other-credits">
|
||||
<h2><a class="toc-backref" href="#id7">Other credits</a></h2>
|
||||
<p>The development of this module has been financially supported by:</p>
|
||||
<ul class="simple">
|
||||
<li>Escodoo <<a class="reference external" href="https://www.escodoo.com.br">https://www.escodoo.com.br</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#id8">Maintainers</a></h2>
|
||||
<p>This module is maintained by the OCA.</p>
|
||||
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
|
||||
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.</p>
|
||||
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
|
||||
<p><a class="reference external" href="https://github.com/marcelsavegnago"><img alt="marcelsavegnago" src="https://github.com/marcelsavegnago.png?size=40px" /></a></p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/knowledge/tree/12.0/document_page_portal">OCA/knowledge</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,37 @@
|
||||
odoo.define('document_page_portal.tour', function (require) {
|
||||
'use strict';
|
||||
|
||||
var tour = require("web_tour.tour");
|
||||
|
||||
tour.register('document_page_portal_tour', {
|
||||
test: true,
|
||||
url: '/my',
|
||||
},
|
||||
[
|
||||
{
|
||||
content: "Check document_page_portal is loaded",
|
||||
trigger: 'a[href*="/my/knowledge/documents"]:contains("Knowledge Documents"):first',
|
||||
},
|
||||
{
|
||||
content: "Check public document_page is loaded",
|
||||
trigger: 'a[href*="/knowledge/document/"]:contains("Test Public Page 1"):first',
|
||||
},
|
||||
]);
|
||||
|
||||
tour.register('document_page_portal_search_tour', {
|
||||
test: true,
|
||||
url: '/my/knowledge/documents',
|
||||
},
|
||||
[
|
||||
{
|
||||
content: "Search",
|
||||
trigger: "input[name='search']",
|
||||
run: "text Test",
|
||||
},
|
||||
{
|
||||
content: "Click Search.",
|
||||
extra_trigger: "#wrap:not(:has(input[name=search]:propValue('')))",
|
||||
trigger: '.search-submit',
|
||||
},
|
||||
]);
|
||||
});
|
1
document_page_portal/tests/__init__.py
Normal file
1
document_page_portal/tests/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from . import test_document_page_portal
|
33
document_page_portal/tests/test_document_page_portal.py
Normal file
33
document_page_portal/tests/test_document_page_portal.py
Normal file
@ -0,0 +1,33 @@
|
||||
# Copyright 2020 - TODAY, Marcel Savegnago - Escodoo
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl
|
||||
|
||||
import odoo.tests
|
||||
|
||||
|
||||
@odoo.tests.tagged('post_install', '-at_install')
|
||||
class TestUi(odoo.tests.HttpCase):
|
||||
def test_01_document_page_portal_tour(self):
|
||||
# Create a public document
|
||||
self.env['document.page'].create({
|
||||
'name': 'Test Public Page 1',
|
||||
'content': 'Test content',
|
||||
'is_public': True,
|
||||
})
|
||||
|
||||
self.phantom_js(
|
||||
"/",
|
||||
"odoo.__DEBUG__.services['web_tour.tour']"
|
||||
".run('document_page_portal_tour')",
|
||||
"odoo.__DEBUG__.services['web_tour.tour']"
|
||||
".tours.document_page_portal_tour.ready",
|
||||
login="portal"
|
||||
)
|
||||
|
||||
self.phantom_js(
|
||||
"/",
|
||||
"odoo.__DEBUG__.services['web_tour.tour']"
|
||||
".run('document_page_portal_search_tour')",
|
||||
"odoo.__DEBUG__.services['web_tour.tour']"
|
||||
".tours.document_page_portal_search_tour.ready",
|
||||
login="portal"
|
||||
)
|
12
document_page_portal/views/assets.xml
Normal file
12
document_page_portal/views/assets.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?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">
|
||||
<xpath expr="//script[last()]" position="after">
|
||||
<script type="text/javascript" src="/document_page_portal/static/src/js/document_page_portal_tour.js"></script>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</odoo>
|
19
document_page_portal/views/document_page.xml
Normal file
19
document_page_portal/views/document_page.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?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="arch" type="xml">
|
||||
<field name="parent_id" position="after">
|
||||
<field name="is_public" groups="document_page.group_document_manager"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
102
document_page_portal/views/document_page_portal_templates.xml
Normal file
102
document_page_portal/views/document_page_portal_templates.xml
Normal file
@ -0,0 +1,102 @@
|
||||
<?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">
|
||||
<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>
|
||||
<t t-else="">Knowledge Documents</t>
|
||||
</li>
|
||||
<li t-if="document_page" class="breadcrumb-item active">
|
||||
#<span t-field="document_page.id" />
|
||||
</li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<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>
|
||||
<t t-set="url" t-value="'/my/knowledge/documents'" />
|
||||
<t t-set="count" t-value="document_page_count" />
|
||||
</t>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="portal_my_knowledge_document_pages" name="Knowledge Document">
|
||||
<t t-call="portal.portal_layout">
|
||||
<t t-set="breadcrumbs_searchbar" t-value="True" />
|
||||
|
||||
<t t-call="portal.portal_searchbar">
|
||||
<t t-set="title">Knowledge Documents</t>
|
||||
</t>
|
||||
<div t-if="not document_pages" class="alert alert-info">
|
||||
There are currently no Knowledge Document for your account.
|
||||
</div>
|
||||
<t t-if="document_pages" t-call="portal.portal_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-right">Ref</th>
|
||||
<th class="w-100">Name</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>
|
||||
<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>
|
||||
</tr>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="document_pages_followup" name="Knowledge Documents Followup">
|
||||
<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-call="portal.portal_back_in_edit_mode">
|
||||
<t t-set="backend_url" t-value="'/web#return_label=Website&model=document.page&id=%s&view_type=form' % (document_page.id)" />
|
||||
</t>
|
||||
</t>
|
||||
|
||||
<t t-call="portal.portal_record_layout">
|
||||
<t t-set="card_header">
|
||||
<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>
|
||||
</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" />
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
<t t-set="card_body">
|
||||
<div class="row mb-4">
|
||||
<h1 class="col-lg-12">
|
||||
<span t-field="document_page.name"/>
|
||||
</h1>
|
||||
<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>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
</template>
|
||||
|
||||
</data>
|
||||
</odoo>
|
Loading…
Reference in New Issue
Block a user