mirror of
https://github.com/OCA/knowledge.git
synced 2025-12-20 12:22:18 -06:00
[ADD] document_page from odoo/7.0
This commit is contained in:
committed by
Dũng (Trần Đình)
parent
767259fa73
commit
1561edddb8
4
document_page/web/__init__.py
Normal file
4
document_page/web/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import widgets
|
||||
import controllers
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
3
document_page/web/controllers/__init__.py
Normal file
3
document_page/web/controllers/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
import wiki
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
65
document_page/web/controllers/wiki.py
Normal file
65
document_page/web/controllers/wiki.py
Normal file
@@ -0,0 +1,65 @@
|
||||
###############################################################################
|
||||
#
|
||||
# Copyright (C) 2007-TODAY Tiny ERP Pvt Ltd. All Rights Reserved.
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Developed by Tiny (http://openerp.com) and Axelor (http://axelor.com).
|
||||
#
|
||||
# The OpenERP web client is distributed under the "OpenERP Public License".
|
||||
# It's based on Mozilla Public License Version (MPL) 1.1 with following
|
||||
# restrictions:
|
||||
#
|
||||
# - All names, links and logos of Tiny, OpenERP and Axelor must be
|
||||
# kept as in original distribution without any changes in all software
|
||||
# screens, especially in start-up page and the software header, even if
|
||||
# the application source code has been changed or updated or code has been
|
||||
# added.
|
||||
#
|
||||
# - All distributions of the software must keep source code with OEPL.
|
||||
#
|
||||
# - All integrations to any other software must keep source code with OEPL.
|
||||
#
|
||||
# If you need commercial licence to remove this kind of restriction please
|
||||
# contact us.
|
||||
#
|
||||
# You can see the MPL licence at: http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
#
|
||||
###############################################################################
|
||||
import base64
|
||||
|
||||
import cherrypy
|
||||
|
||||
import openobject
|
||||
from openobject.tools import expose
|
||||
|
||||
from openerp.controllers import SecuredController
|
||||
|
||||
|
||||
class WikiView(SecuredController):
|
||||
_cp_path = "/wiki/wiki"
|
||||
|
||||
def get_attachment(self, **kwargs):
|
||||
attachments = openobject.rpc.RPCProxy('ir.attachment')
|
||||
file_name = kwargs.get('file').replace("'", '').strip()
|
||||
id = kwargs.get('id').strip()
|
||||
|
||||
ids = attachments.search([('datas_fname', '=', file_name),
|
||||
('res_model', '=', 'wiki.wiki'),
|
||||
('res_id', '=', id)])
|
||||
|
||||
res = attachments.read(ids, ['datas'])[0].get('datas')
|
||||
return res, file_name
|
||||
|
||||
@expose(content_type='application/octet')
|
||||
def getImage(self, *kw, **kws):
|
||||
res, _ = self.get_attachment(**kws)
|
||||
return base64.decodestring(res)
|
||||
|
||||
@expose(content_type='application/octet')
|
||||
def getfile(self, *kw, **kws):
|
||||
res, file_name = self.get_attachment(**kws)
|
||||
cherrypy.response.headers['Content-Disposition'] = 'filename="%s"' % (file_name,)
|
||||
return base64.decodestring(res)
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
22
document_page/web/locales/bg.po
Normal file
22
document_page/web/locales/bg.po
Normal file
@@ -0,0 +1,22 @@
|
||||
# Bulgarian translation for openobject-addons
|
||||
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
|
||||
"PO-Revision-Date: 2011-02-11 01:13+0000\n"
|
||||
"Last-Translator: Dimitar Markov <Unknown>\n"
|
||||
"Language-Team: Bulgarian <bg@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2011-02-12 06:06+0000\n"
|
||||
"X-Generator: Launchpad (build 12351)\n"
|
||||
|
||||
#: widgets/wikimarkup/__init__.py:1981
|
||||
msgid "Table of Contents"
|
||||
msgstr "Съдържание"
|
||||
22
document_page/web/locales/ca.po
Normal file
22
document_page/web/locales/ca.po
Normal file
@@ -0,0 +1,22 @@
|
||||
# Catalan translation for openobject-addons
|
||||
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
|
||||
"PO-Revision-Date: 2011-03-12 20:33+0000\n"
|
||||
"Last-Translator: mgaja (GrupoIsep.com) <Unknown>\n"
|
||||
"Language-Team: Catalan <ca@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2011-03-13 06:16+0000\n"
|
||||
"X-Generator: Launchpad (build 12559)\n"
|
||||
|
||||
#: widgets/wikimarkup/__init__.py:1981
|
||||
msgid "Table of Contents"
|
||||
msgstr "Índex"
|
||||
22
document_page/web/locales/da.po
Normal file
22
document_page/web/locales/da.po
Normal file
@@ -0,0 +1,22 @@
|
||||
# Danish translation for openobject-addons
|
||||
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
|
||||
"PO-Revision-Date: 2011-04-29 12:05+0000\n"
|
||||
"Last-Translator: Hans Henrik Gabelgaard <Unknown>\n"
|
||||
"Language-Team: Danish <da@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2011-04-30 06:08+0000\n"
|
||||
"X-Generator: Launchpad (build 12758)\n"
|
||||
|
||||
#: widgets/wikimarkup/__init__.py:1981
|
||||
msgid "Table of Contents"
|
||||
msgstr "Indholdsfortegnelse"
|
||||
22
document_page/web/locales/de.po
Normal file
22
document_page/web/locales/de.po
Normal file
@@ -0,0 +1,22 @@
|
||||
# German translation for openobject-addons
|
||||
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
|
||||
"PO-Revision-Date: 2011-02-11 11:54+0000\n"
|
||||
"Last-Translator: Ferdinand @ Camptocamp <Unknown>\n"
|
||||
"Language-Team: German <de@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2011-02-12 06:06+0000\n"
|
||||
"X-Generator: Launchpad (build 12351)\n"
|
||||
|
||||
#: widgets/wikimarkup/__init__.py:1981
|
||||
msgid "Table of Contents"
|
||||
msgstr "Inhaltsverzeichnis"
|
||||
20
document_page/web/locales/de_DE/LC_MESSAGES/javascript.po
Normal file
20
document_page/web/locales/de_DE/LC_MESSAGES/javascript.po
Normal file
@@ -0,0 +1,20 @@
|
||||
# German (Germany) translations for PROJECT.
|
||||
# Copyright (C) 2009 ORGANIZATION
|
||||
# This file is distributed under the same license as the PROJECT project.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2009-11-18 17:21+0530\n"
|
||||
"PO-Revision-Date: 2010-08-02 17:53+0530\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: de_DE <LL@li.org>\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel None\n"
|
||||
|
||||
24
document_page/web/locales/de_DE/LC_MESSAGES/messages.po
Normal file
24
document_page/web/locales/de_DE/LC_MESSAGES/messages.po
Normal file
@@ -0,0 +1,24 @@
|
||||
# German (Germany) translations for PROJECT.
|
||||
# Copyright (C) 2009 ORGANIZATION
|
||||
# This file is distributed under the same license as the PROJECT project.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2009-11-18 17:21+0530\n"
|
||||
"PO-Revision-Date: 2010-08-02 17:53+0530\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: de_DE <LL@li.org>\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel None\n"
|
||||
|
||||
#: widgets/wikimarkup/__init__.py:1981
|
||||
msgid "Table of Contents"
|
||||
msgstr ""
|
||||
|
||||
23
document_page/web/locales/es_CR.po
Normal file
23
document_page/web/locales/es_CR.po
Normal file
@@ -0,0 +1,23 @@
|
||||
# Translations template for PROJECT.
|
||||
# Copyright (C) 2010 ORGANIZATION
|
||||
# This file is distributed under the same license as the PROJECT project.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
|
||||
"PO-Revision-Date: 2012-02-08 03:00-0600\n"
|
||||
"Last-Translator: Carlos Vásquez - CLEARCORP <carlos.vasquez@clearcorp.co.cr>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel None\n"
|
||||
|
||||
#: widgets/wikimarkup/__init__.py:1981
|
||||
msgid "Table of Contents"
|
||||
msgstr ""
|
||||
|
||||
20
document_page/web/locales/es_ES/LC_MESSAGES/javascript.po
Normal file
20
document_page/web/locales/es_ES/LC_MESSAGES/javascript.po
Normal file
@@ -0,0 +1,20 @@
|
||||
# Spanish (Spain) translations for PROJECT.
|
||||
# Copyright (C) 2009 ORGANIZATION
|
||||
# This file is distributed under the same license as the PROJECT project.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2009-11-18 17:21+0530\n"
|
||||
"PO-Revision-Date: 2010-08-02 17:53+0530\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: es_ES <LL@li.org>\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel None\n"
|
||||
|
||||
24
document_page/web/locales/es_ES/LC_MESSAGES/messages.po
Normal file
24
document_page/web/locales/es_ES/LC_MESSAGES/messages.po
Normal file
@@ -0,0 +1,24 @@
|
||||
# Spanish (Spain) translations for PROJECT.
|
||||
# Copyright (C) 2009 ORGANIZATION
|
||||
# This file is distributed under the same license as the PROJECT project.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2009-11-18 17:21+0530\n"
|
||||
"PO-Revision-Date: 2010-08-02 17:53+0530\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: es_ES <LL@li.org>\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel None\n"
|
||||
|
||||
#: widgets/wikimarkup/__init__.py:1981
|
||||
msgid "Table of Contents"
|
||||
msgstr ""
|
||||
|
||||
22
document_page/web/locales/es_PY.po
Normal file
22
document_page/web/locales/es_PY.po
Normal file
@@ -0,0 +1,22 @@
|
||||
# Spanish (Paraguay) translation for openobject-addons
|
||||
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
|
||||
"PO-Revision-Date: 2011-03-21 16:31+0000\n"
|
||||
"Last-Translator: fadel <Unknown>\n"
|
||||
"Language-Team: Spanish (Paraguay) <es_PY@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2011-03-22 06:23+0000\n"
|
||||
"X-Generator: Launchpad (build 12559)\n"
|
||||
|
||||
#: widgets/wikimarkup/__init__.py:1981
|
||||
msgid "Table of Contents"
|
||||
msgstr "Tabla de Contenido"
|
||||
22
document_page/web/locales/fr.po
Normal file
22
document_page/web/locales/fr.po
Normal file
@@ -0,0 +1,22 @@
|
||||
# French translation for openobject-addons
|
||||
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
|
||||
"PO-Revision-Date: 2011-02-11 20:16+0000\n"
|
||||
"Last-Translator: lolivier <olivier.lenoir@free.fr>\n"
|
||||
"Language-Team: French <fr@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2011-02-12 06:06+0000\n"
|
||||
"X-Generator: Launchpad (build 12351)\n"
|
||||
|
||||
#: widgets/wikimarkup/__init__.py:1981
|
||||
msgid "Table of Contents"
|
||||
msgstr "Table des matières"
|
||||
20
document_page/web/locales/fr_FR/LC_MESSAGES/javascript.po
Normal file
20
document_page/web/locales/fr_FR/LC_MESSAGES/javascript.po
Normal file
@@ -0,0 +1,20 @@
|
||||
# French (France) translations for PROJECT.
|
||||
# Copyright (C) 2009 ORGANIZATION
|
||||
# This file is distributed under the same license as the PROJECT project.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2009-11-18 17:21+0530\n"
|
||||
"PO-Revision-Date: 2010-08-02 17:53+0530\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: fr_FR <LL@li.org>\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel None\n"
|
||||
|
||||
24
document_page/web/locales/fr_FR/LC_MESSAGES/messages.po
Normal file
24
document_page/web/locales/fr_FR/LC_MESSAGES/messages.po
Normal file
@@ -0,0 +1,24 @@
|
||||
# French (France) translations for PROJECT.
|
||||
# Copyright (C) 2009 ORGANIZATION
|
||||
# This file is distributed under the same license as the PROJECT project.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2009.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2009-11-18 17:21+0530\n"
|
||||
"PO-Revision-Date: 2010-08-02 17:53+0530\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: fr_FR <LL@li.org>\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel None\n"
|
||||
|
||||
#: widgets/wikimarkup/__init__.py:1981
|
||||
msgid "Table of Contents"
|
||||
msgstr ""
|
||||
|
||||
22
document_page/web/locales/gl.po
Normal file
22
document_page/web/locales/gl.po
Normal file
@@ -0,0 +1,22 @@
|
||||
# Galician translation for openobject-addons
|
||||
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
|
||||
"PO-Revision-Date: 2011-03-02 23:19+0000\n"
|
||||
"Last-Translator: Santi (Pexego) <santiago@pexego.es>\n"
|
||||
"Language-Team: Galician <gl@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2011-03-03 06:01+0000\n"
|
||||
"X-Generator: Launchpad (build 12351)\n"
|
||||
|
||||
#: widgets/wikimarkup/__init__.py:1981
|
||||
msgid "Table of Contents"
|
||||
msgstr "Índice"
|
||||
19
document_page/web/locales/javascript.pot
Normal file
19
document_page/web/locales/javascript.pot
Normal file
@@ -0,0 +1,19 @@
|
||||
# Translations template for PROJECT.
|
||||
# Copyright (C) 2010 ORGANIZATION
|
||||
# This file is distributed under the same license as the PROJECT project.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel None\n"
|
||||
|
||||
23
document_page/web/locales/messages.pot
Normal file
23
document_page/web/locales/messages.pot
Normal file
@@ -0,0 +1,23 @@
|
||||
# Translations template for PROJECT.
|
||||
# Copyright (C) 2010 ORGANIZATION
|
||||
# This file is distributed under the same license as the PROJECT project.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Generated-By: Babel None\n"
|
||||
|
||||
#: widgets/wikimarkup/__init__.py:1981
|
||||
msgid "Table of Contents"
|
||||
msgstr ""
|
||||
|
||||
22
document_page/web/locales/ru.po
Normal file
22
document_page/web/locales/ru.po
Normal file
@@ -0,0 +1,22 @@
|
||||
# Russian translation for openobject-addons
|
||||
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
|
||||
"PO-Revision-Date: 2011-03-16 00:17+0000\n"
|
||||
"Last-Translator: Stanislav Hanzhin <Unknown>\n"
|
||||
"Language-Team: Russian <ru@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2011-03-17 06:12+0000\n"
|
||||
"X-Generator: Launchpad (build 12559)\n"
|
||||
|
||||
#: widgets/wikimarkup/__init__.py:1981
|
||||
msgid "Table of Contents"
|
||||
msgstr "Содержание"
|
||||
22
document_page/web/locales/sk.po
Normal file
22
document_page/web/locales/sk.po
Normal file
@@ -0,0 +1,22 @@
|
||||
# Slovak translation for openobject-addons
|
||||
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
|
||||
"PO-Revision-Date: 2011-02-21 13:05+0000\n"
|
||||
"Last-Translator: Radoslav Sloboda <rado.sloboda@gmail.com>\n"
|
||||
"Language-Team: Slovak <sk@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2011-02-22 14:27+0000\n"
|
||||
"X-Generator: Launchpad (build 12351)\n"
|
||||
|
||||
#: widgets/wikimarkup/__init__.py:1981
|
||||
msgid "Table of Contents"
|
||||
msgstr "Obsah"
|
||||
22
document_page/web/locales/tr.po
Normal file
22
document_page/web/locales/tr.po
Normal file
@@ -0,0 +1,22 @@
|
||||
# Turkish translation for openobject-addons
|
||||
# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011
|
||||
# This file is distributed under the same license as the openobject-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2011.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: openobject-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2010-08-02 17:52+0530\n"
|
||||
"PO-Revision-Date: 2011-02-08 21:20+0000\n"
|
||||
"Last-Translator: Ahmet Altınışık <Unknown>\n"
|
||||
"Language-Team: Turkish <tr@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2011-02-09 06:02+0000\n"
|
||||
"X-Generator: Launchpad (build 12177)\n"
|
||||
|
||||
#: widgets/wikimarkup/__init__.py:1981
|
||||
msgid "Table of Contents"
|
||||
msgstr "İçindekiler"
|
||||
32
document_page/web/static/css/wiki.css
Normal file
32
document_page/web/static/css/wiki.css
Normal file
@@ -0,0 +1,32 @@
|
||||
.wikiwidget #toc {
|
||||
border:1px solid #aaaaaa;
|
||||
background-color:#f9f9f9;
|
||||
padding:5px;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
color: black;
|
||||
background: none;
|
||||
font-weight: normal;
|
||||
margin: 0;
|
||||
padding-top: .5em;
|
||||
padding-bottom: .17em;
|
||||
border-bottom: 1px solid #aaa;
|
||||
}
|
||||
h1 { font-size: 188%; }
|
||||
h2 { font-size: 150%; }
|
||||
h3, h4, h5, h6 {
|
||||
border-bottom: none;
|
||||
}
|
||||
h3 { font-size: 132%; }
|
||||
h4 { font-size: 116%; }
|
||||
h5 { font-size: 100%; }
|
||||
h6 { font-size: 80%; }
|
||||
|
||||
pre {
|
||||
background-color:#F9F9F9;
|
||||
border:1px dashed #2F6FAB;
|
||||
color:black;
|
||||
line-height:1.1em;
|
||||
padding:1em;
|
||||
}
|
||||
3
document_page/web/widgets/__init__.py
Normal file
3
document_page/web/widgets/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from wiki import WikiWidget
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
3
document_page/web/widgets/rss/__init__.py
Normal file
3
document_page/web/widgets/rss/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
import feedparser
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
2860
document_page/web/widgets/rss/feedparser.py
Executable file
2860
document_page/web/widgets/rss/feedparser.py
Executable file
File diff suppressed because it is too large
Load Diff
23
document_page/web/widgets/templates/wiki.mako
Normal file
23
document_page/web/widgets/templates/wiki.mako
Normal file
@@ -0,0 +1,23 @@
|
||||
% if editable and not inline:
|
||||
<textarea rows="10" id="${name}" name="${name}" class="${css_class}"
|
||||
${py.attrs(attrs, kind=kind)} style="width: 99%;">${value}</textarea>
|
||||
<script type="text/javascript">
|
||||
if (!window.browser.isWebKit) {
|
||||
new openerp.ui.TextArea('${name}');
|
||||
}
|
||||
</script>
|
||||
% endif
|
||||
|
||||
% if editable and inline:
|
||||
<input type="text" id="${name}" name="${name}" class="${css_class}"
|
||||
${py.attrs(attrs, kind=kind, value=value)}/>
|
||||
% endif
|
||||
|
||||
% if editable and error:
|
||||
<span class="fielderror">${error}</span>
|
||||
% endif
|
||||
|
||||
% if not editable and value:
|
||||
<div kind="${kind}" id="${name}" class="${css_class}">${data|n}</div>
|
||||
% endif
|
||||
|
||||
224
document_page/web/widgets/wiki.py
Normal file
224
document_page/web/widgets/wiki.py
Normal file
@@ -0,0 +1,224 @@
|
||||
###############################################################################
|
||||
#
|
||||
# Copyright (C) 2007-TODAY Tiny ERP Pvt Ltd. All Rights Reserved.
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Developed by Tiny (http://openerp.com) and Axelor (http://axelor.com).
|
||||
#
|
||||
# The OpenERP web client is distributed under the "OpenERP Public License".
|
||||
# It's based on Mozilla Public License Version (MPL) 1.1 with following
|
||||
# restrictions:
|
||||
#
|
||||
# - All names, links and logos of Tiny, OpenERP and Axelor must be
|
||||
# kept as in original distribution without any changes in all software
|
||||
# screens, especially in start-up page and the software header, even if
|
||||
# the application source code has been changed or updated or code has been
|
||||
# added.
|
||||
#
|
||||
# - All distributions of the software must keep source code with OEPL.
|
||||
#
|
||||
# - All integrations to any other software must keep source code with OEPL.
|
||||
#
|
||||
# If you need commercial licence to remove this kind of restriction please
|
||||
# contact us.
|
||||
#
|
||||
# You can see the MPL licence at: http://www.mozilla.org/MPL/MPL-1.1.html
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
import re
|
||||
|
||||
import cherrypy
|
||||
import wikimarkup
|
||||
|
||||
from openobject import rpc
|
||||
from openobject.widgets import CSSLink
|
||||
|
||||
|
||||
from openerp.widgets import register_widget
|
||||
from openerp.widgets.form import Text
|
||||
|
||||
|
||||
_image = re.compile(r'img:(.*)\.(.*)', re.UNICODE)
|
||||
_rss = re.compile(r'rss:(.*)\.(.*)', re.UNICODE)
|
||||
_attach = re.compile(r'attach:(.*)\.(.*)', re.UNICODE)
|
||||
_internalLinks = re.compile(r'\[\[.*\]\]', re.UNICODE)
|
||||
_edit = re.compile(r'edit:(.*)\|(.*)', re.UNICODE)
|
||||
_view = re.compile(r'view:(.*)\|(.*)', re.UNICODE)
|
||||
|
||||
class WikiParser(wikimarkup.Parser):
|
||||
|
||||
def parse(self, text, id):
|
||||
text = text.replace(' ', 'n-b-s-p')
|
||||
text = text.replace('&', 'n-a-m-p')
|
||||
text = text.replace('&','&')
|
||||
text = text.replace('n-b-s-p', ' ')
|
||||
text = text.replace('n-a-m-p', '&')
|
||||
text = text.replace('<code>', '<pre>')
|
||||
text = text.replace('</code>', '</pre>')
|
||||
|
||||
text = wikimarkup.to_unicode(text)
|
||||
text = self.strip(text)
|
||||
|
||||
text = super(WikiParser, self).parse(text)
|
||||
text = self.addImage(text, id)
|
||||
text = self.attachDoc(text, id)
|
||||
text = self.recordLink(text)
|
||||
text = self.viewRecordLink(text)
|
||||
text = self.addInternalLinks(text)
|
||||
#TODO : already implemented but we will implement it later after releasing the 5.0
|
||||
#text = self.addRss(text, id)
|
||||
return text
|
||||
|
||||
def viewRecordLink(self, text):
|
||||
def record(path):
|
||||
record = path.group().replace('view:','').split("|")
|
||||
model = record[0]
|
||||
text = record[1].replace('\r','').strip()
|
||||
label = "View Record"
|
||||
if len(record) > 2:
|
||||
label = record[2]
|
||||
proxy = rpc.RPCProxy(model)
|
||||
ids = proxy.name_search(text, [], 'ilike', {})
|
||||
if len(ids):
|
||||
id = ids[0][0]
|
||||
else:
|
||||
try:
|
||||
id = int(text)
|
||||
except:
|
||||
id = 0
|
||||
return "[[/openerp/form/view?model=%s&id=%d | %s]]" % (model, id, label)
|
||||
|
||||
bits = _view.sub(record, text)
|
||||
return bits
|
||||
|
||||
def addRss(self, text, id):
|
||||
def addrss(path):
|
||||
rssurl = path.group().replace('rss:','')
|
||||
import rss.feedparser as feedparser
|
||||
data = feedparser.parse(rssurl)
|
||||
values = "<h2>%s</h2><br/>" % (data.feed.title)
|
||||
values += "%s<br/>" % (data.channel.description)
|
||||
for entry in data['entries']:
|
||||
values += "<h3><a href='%s'> %s </a></h3><br/>" % (entry.link, entry.title)
|
||||
values += "%s <br/>" % (entry.summary)
|
||||
|
||||
return values
|
||||
|
||||
bits = _rss.sub(addrss, text)
|
||||
return bits
|
||||
|
||||
def attachDoc(self, text, id):
|
||||
def document(path):
|
||||
file = path.group().replace('attach:','')
|
||||
if file.startswith('http') or file.startswith('ftp'):
|
||||
return "<a href='%s'>Download File</a>" % (file)
|
||||
else:
|
||||
proxy = rpc.RPCProxy('ir.attachment')
|
||||
ids = proxy.search([('datas_fname','=',file.strip()), ('res_model','=','wiki.wiki'), ('res_id','=',id)])
|
||||
if len(ids) > 0:
|
||||
return "<a href='/widget_wiki/wiki/getfile?file=%s&id=%d'>%s</a>" % (file, id, file)
|
||||
else:
|
||||
return """<a onclick="openobject.tools.openWindow(openobject.http.getURL('/openerp/attachment', {model: 'wiki.wiki', id: %d}),
|
||||
{name : 'Wiki Attachments'})">Attach : %s </a>""" % (id, file)
|
||||
bits = _attach.sub(document, text)
|
||||
return bits
|
||||
|
||||
def addImage(self, text, id):
|
||||
def image(path):
|
||||
file = path.group().replace('img:','')
|
||||
if file.startswith('http') or file.startswith('ftp'):
|
||||
return "<img src='%s'/>" % (file)
|
||||
else:
|
||||
proxy = rpc.RPCProxy('ir.attachment')
|
||||
ids = proxy.search([('datas_fname','=',file.strip()), ('res_model','=','wiki.wiki'), ('res_id','=',id)])
|
||||
if len(ids) > 0:
|
||||
return "<img src='/widget_wiki/wiki/getImage?file=%s&id=%d'/>" % (file, id)
|
||||
else:
|
||||
return """<a onclick="openobject.tools.openWindow(openobject.http.getURL('/openerp/attachment', {model: 'wiki.wiki', id: %d}),
|
||||
{name : 'Wiki Attachments'})">Attach : %s </a>""" % (id, file)
|
||||
#"[[/attachment/?model=wiki.wiki&id=%d | Attach:%s]]" % (id, file)
|
||||
bits = _image.sub(image, text)
|
||||
return bits
|
||||
|
||||
def recordLink(self, text):
|
||||
def record(path):
|
||||
record = path.group().replace('edit:','').split("|")
|
||||
model = record[0]
|
||||
text = record[1].replace('\r','').strip()
|
||||
label = "Edit Record"
|
||||
if len(record) > 2:
|
||||
label = record[2]
|
||||
proxy = rpc.RPCProxy(model)
|
||||
ids = proxy.name_search(text, [], '=', {})
|
||||
if len(ids):
|
||||
id = ids[0][0]
|
||||
else:
|
||||
try:
|
||||
id = int(text)
|
||||
except:
|
||||
id = 0
|
||||
return "[[/openerp/form/edit?model=%s&id=%d | %s]]" % (model, id, label)
|
||||
|
||||
bits = _edit.sub(record, text)
|
||||
return bits
|
||||
|
||||
def addInternalLinks(self, text):
|
||||
proxy = rpc.RPCProxy('wiki.wiki')
|
||||
|
||||
def link(path):
|
||||
link = path.group().replace('[','').replace('[','').replace(']','').replace(']','').split("|")
|
||||
name_to_search = link[0].strip()
|
||||
mids = proxy.search([('name','ilike', name_to_search)])
|
||||
link_str = ""
|
||||
if mids:
|
||||
if len(link) == 2:
|
||||
link_str = "<a href='/openerp/form/view?model=wiki.wiki&id=%s'>%s</a>" % (mids[0], link[1])
|
||||
elif len(link) == 1:
|
||||
link_str = "<a href='/openerp/form/view?model=wiki.wiki&id=%s'>%s</a>" % (mids[0], link[0])
|
||||
else:
|
||||
if len(link) == 2:
|
||||
link_str = "<a href='%s'>%s</a>" % (link[0], link[1])
|
||||
elif len(link) == 1:
|
||||
link_str = "<a href='/openerp/form/edit?model=wiki.wiki&id=False'>%s</a>" % (link[0])
|
||||
|
||||
return link_str
|
||||
|
||||
bits = _internalLinks.sub(link, text)
|
||||
return bits
|
||||
|
||||
def wiki2html(text, showToc, id):
|
||||
p = WikiParser(show_toc=showToc)
|
||||
return p.parse(text, id)
|
||||
|
||||
class WikiWidget(Text):
|
||||
template = "/wiki/widgets/templates/wiki.mako"
|
||||
|
||||
params = ["data"]
|
||||
|
||||
css = [CSSLink("wiki", "css/wiki.css")]
|
||||
|
||||
data = None
|
||||
|
||||
def set_value(self, value):
|
||||
super(WikiWidget, self).set_value(value)
|
||||
|
||||
if value:
|
||||
toc = True
|
||||
id = False
|
||||
if hasattr(cherrypy.request, 'terp_record'):
|
||||
params = cherrypy.request.terp_params
|
||||
if params._terp_model == 'wiki.wiki':
|
||||
proxy = rpc.RPCProxy('wiki.wiki')
|
||||
toc = proxy.read([params.id], ['toc'])[0]['toc']
|
||||
id = params.id
|
||||
|
||||
text = value+'\n\n'
|
||||
html = wiki2html(text, toc, id)
|
||||
|
||||
self.data = html
|
||||
|
||||
register_widget(WikiWidget, ["text_wiki"])
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
2146
document_page/web/widgets/wikimarkup/__init__.py
Normal file
2146
document_page/web/widgets/wikimarkup/__init__.py
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user