Skip to content
Snippets Groups Projects
Commit 9dbcba7470b1 authored by Aurelien Campeas's avatar Aurelien Campeas
Browse files

merge

No related branches found
No related tags found
No related merge requests found
......@@ -3,3 +3,5 @@
a5a9ba8bcb655e6351b4297c17e3b5dd0370067b cubicweb-card-version-0.2.0
1a1b1e16374bb9cc442241da3e615b5c2e3475db cubicweb-card-debian-version-0.2.0-1
c8d7a3b0392576175ef71e712f0d90827afe4083 oldstable
3fc8680feb42a167012b58ebd6261ebed81227a6 cubicweb-card-version-0.3.0
1fa6b4bf44d7df3611a86baba9a2a27f94f65c65 cubicweb-card-debian-version-0.3.0-1
README 0 → 100644
This cube models cards that are like wiki pages.
`Card` entities have a title, an abstract and some textual content as text, rest
or html.
......@@ -4,7 +4,7 @@
modname = 'card'
distname = 'cubicweb-card'
numversion = (0, 2, 0)
numversion = (0, 3, 0)
version = '.'.join(str(num) for num in numversion)
license = 'LGPL'
......@@ -8,7 +8,6 @@
version = '.'.join(str(num) for num in numversion)
license = 'LGPL'
author = 'LOGILAB S.A. (Paris, FRANCE)'
author_email = 'contact@logilab.fr'
web = 'http://www.cubicweb.org/project/%s' % distname
......@@ -12,5 +11,4 @@
author = 'LOGILAB S.A. (Paris, FRANCE)'
author_email = 'contact@logilab.fr'
web = 'http://www.cubicweb.org/project/%s' % distname
description = 'card/wiki component for the CubicWeb framework'
......@@ -16,7 +14,4 @@
description = 'card/wiki component for the CubicWeb framework'
__depends__ = {'cubicweb': '>= 3.8.0'}
classifiers = [
'Environment :: Web Environment',
'Framework :: CubicWeb',
......@@ -24,8 +19,12 @@
'Programming Language :: JavaScript',
]
__depends__ = {'cubicweb': '>= 3.9.0'}
__recommends__ = {'cubicweb-preview': None}
# packaging ###
from os import listdir as _listdir
from os.path import join, isdir
from glob import glob
......@@ -27,8 +26,10 @@
from os import listdir as _listdir
from os.path import join, isdir
from glob import glob
THIS_CUBE_DIR = join('share', 'cubicweb', 'cubes', modname)
def listdir(dirpath):
return [join(dirpath, fname) for fname in _listdir(dirpath)
if fname[0] != '.' and not fname.endswith('.pyc')
......@@ -32,8 +33,6 @@
def listdir(dirpath):
return [join(dirpath, fname) for fname in _listdir(dirpath)
if fname[0] != '.' and not fname.endswith('.pyc')
and not fname.endswith('~')]
CUBES_DIR = join('share', 'cubicweb', 'cubes')
THIS_CUBE_DIR = join(CUBES_DIR, 'card')
and not fname.endswith('~')
and not isdir(join(dirpath, fname))]
......@@ -39,15 +38,11 @@
try:
data_files = [
# common files
[THIS_CUBE_DIR, [fname for fname in glob('*.py') if fname != 'setup.py']],
]
# check for possible extended cube layout
for dirname in ('entities', 'views', 'sobjects', 'hooks', 'schema', 'data', 'i18n', 'migration'):
if isdir(dirname):
data_files.append([join(THIS_CUBE_DIR, dirname), listdir(dirname)])
# Note: here, you'll need to add subdirectories if you want
# them to be included in the debian package
except OSError:
# we are in an installed directory
pass
data_files = [
# common files
[THIS_CUBE_DIR, [fname for fname in glob('*.py') if fname != 'setup.py']],
]
# check for possible extended cube layout
for dirname in ('entities', 'views', 'sobjects', 'hooks', 'schema', 'data', 'i18n', 'migration', 'wdoc'):
if isdir(dirname):
data_files.append([join(THIS_CUBE_DIR, dirname), listdir(dirname)])
# Note: here, you'll need to add subdirectories if you want
# them to be included in the debian package
cubicweb-card (0.3.0-1) unstable; urgency=low
* new upstream release
-- Sylvain Thénault <sylvain.thenault@logilab.fr> Mon, 11 Oct 2010 15:05:42 +0200
cubicweb-card (0.2.0-1) unstable; urgency=low
* new upstream release
......
......@@ -8,7 +8,8 @@
Package: cubicweb-card
Architecture: all
Depends: cubicweb-common (>= 3.8.0), python-docutils
Depends: cubicweb-common (>= 3.9.0), python-docutils
Recommends: cubicweb-preview
Description: card component for the CubicWeb framework
This CubicWeb component models cards that are like wiki pages.
Cards have a title, an abstract and some textual content as text, rest or html.
......
......@@ -6,8 +6,8 @@
"""
__docformat__ = "restructuredtext en"
from cubicweb.selectors import implements
from cubicweb.selectors import is_instance
from cubicweb.sobjects.notification import ContentAddedView
class CardAddedView(ContentAddedView):
"""get notified from new cards"""
......@@ -10,6 +10,6 @@
from cubicweb.sobjects.notification import ContentAddedView
class CardAddedView(ContentAddedView):
"""get notified from new cards"""
__select__ = implements('Card')
__select__ = is_instance('Card')
content_attr = 'synopsis'
#!/usr/bin/env python
# pylint: disable-msg=W0404,W0622,W0704,W0613,W0152
# pylint: disable=W0404,W0622,W0704,W0613
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
......@@ -142,8 +142,6 @@
# install-layout option was introduced in 2.5.3-1~exp1
elif sys.version_info < (2, 5, 4) and '--install-layout=deb' in sys.argv:
sys.argv.remove('--install-layout=deb')
kwargs['package_dir'] = {modname : '.'}
packages = [modname] + get_packages(os.getcwd(), modname)
if USE_SETUPTOOLS and install_requires:
kwargs['install_requires'] = install_requires
kwargs['dependency_links'] = dependency_links
......@@ -147,7 +145,6 @@
if USE_SETUPTOOLS and install_requires:
kwargs['install_requires'] = install_requires
kwargs['dependency_links'] = dependency_links
kwargs['packages'] = packages
return setup(name = distname,
version = version,
license = license,
......
......@@ -11,5 +11,5 @@
def test_notifications(self):
cw_card = self.request().create_entity('Card', title=u'sample card', synopsis=u'this is a sample card')
self.assertEquals(len(MAILBOX), 0)
self.assertEqual(len(MAILBOX), 0)
self.commit()
......@@ -15,6 +15,6 @@
self.commit()
self.assertEquals(len(MAILBOX), 1)
self.assertEquals(re.sub('#\d+', '#EID', MAILBOX[0].subject),
self.assertEqual(len(MAILBOX), 1)
self.assertEqual(re.sub('#\d+', '#EID', MAILBOX[0].subject),
'New Card #EID (admin)')
......@@ -24,8 +24,8 @@
return self.execute('CWUser X WHERE X login "admin"').get_entity(0, 0)
def test_card_role_create(self):
self.assertEquals(rest_publish(self.context(), ':card:`index`'),
self.assertEqual(rest_publish(self.context(), ':card:`index`'),
'<p><a class="reference" href="http://testing.fr/cubicweb/view?etype=Card&amp;wikiid=index&amp;vid=creation">index</a></p>\n')
def test_card_role_link(self):
self.request().create_entity('Card', wikiid=u'index', title=u'Site index page', synopsis=u'yo')
......@@ -28,8 +28,8 @@
'<p><a class="reference" href="http://testing.fr/cubicweb/view?etype=Card&amp;wikiid=index&amp;vid=creation">index</a></p>\n')
def test_card_role_link(self):
self.request().create_entity('Card', wikiid=u'index', title=u'Site index page', synopsis=u'yo')
self.assertEquals(rest_publish(self.context(), ':card:`index`'),
self.assertEqual(rest_publish(self.context(), ':card:`index`'),
'<p><a class="reference" href="http://testing.fr/cubicweb/card/index">index</a></p>\n')
if __name__ == '__main__':
......
......@@ -9,8 +9,6 @@
__docformat__ = "restructuredtext en"
_ = unicode
from logilab.mtconverter import html_escape
from cubicweb.selectors import implements
from cubicweb.selectors import is_instance
from cubicweb.web import uicfg
from cubicweb.web.views import primary
......@@ -15,8 +13,9 @@
from cubicweb.web import uicfg
from cubicweb.web.views import primary
from cubicweb.web.views.autoform import AutomaticEntityForm
uicfg.primaryview_section.tag_attribute(('Card', 'title'), 'hidden')
uicfg.primaryview_section.tag_attribute(('Card', 'synopsis'), 'hidden')
uicfg.primaryview_section.tag_attribute(('Card', 'wikiid'), 'hidden')
class CardPrimaryView(primary.PrimaryView):
......@@ -17,10 +16,10 @@
uicfg.primaryview_section.tag_attribute(('Card', 'title'), 'hidden')
uicfg.primaryview_section.tag_attribute(('Card', 'synopsis'), 'hidden')
uicfg.primaryview_section.tag_attribute(('Card', 'wikiid'), 'hidden')
class CardPrimaryView(primary.PrimaryView):
__select__ = implements('Card')
__select__ = is_instance('Card')
show_attr_label = False
def summary(self, entity):
......@@ -38,3 +37,20 @@
def render_entity_metadata(self, entity):
pass
def content_navigation_components(self, context):
pass
def registration_callback(vreg):
vreg.register(CardPrimaryView)
vreg.register(CardInlinedView)
if 'preview' in vreg.config.cubes():
from cubes.preview.views.forms import PreviewFormMixin
class PreviewAutomaticEntityForm(PreviewFormMixin, AutomaticEntityForm):
preview_mode = 'inline'
__select__ = AutomaticEntityForm.__select__ & is_instance('Card')
vreg.register(PreviewAutomaticEntityForm)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment