Metadata-Version: 1.0
Name: collective.z3cform.widgets
Version: 1.0a2
Summary: A widget package for Dexterity projects.
Home-page: https://github.com/collective/collective.z3cform.widgets
Author: Gonzalo Almeida
Author-email: flecox@ravvit.net
License: GPL
Description: **************************
        collective.z3cform.widgets
        **************************
        
        .. contents:: Table of Contents
        
        Overview
        --------
        
        A widget package for Dexterity projects.
        
        collective.z3cform.widgets provides the following widgets:
        
        **TasksWidget**
            Adds a list of options; degrades to <textarea> if JavaScript is not
            enabled.
        
            This widget uses the `jQuery TaskPlease`_ plugin.
        
        **TokenInputWidget**
            TokenInputWidget allows your users to select multiple items from a
            predefined list, using autocompletion as they type to find each item. You
            may have seen a similar type of text entry when filling in the recipients
            field sending messages on `Facebook`_. This widget will degrade to
            <textarea> if JavaScript is not enabled.
        
            .. image:: https://github.com/collective/collective.z3cform.widgets/raw/master/tokeninputwidget.png
                :align: center
                :height: 110px
                :width: 600px
        
            This widget uses the `jQuery Tokeninput`_ plugin.
        
        **RelatedContentWidget**
            A widget to add a dynamic list of objects. This works as a widget for
            related items field so it must be used like this.
        
        Future widgets
        --------------
        
        The following widgets will be available in this package in the near future:
        
        * widget to select an option from a list; this widget will degrade to <select>
          if JavaScript is not enabled.
        
        * widget to select multiple options from a list; this widget will degrade to
          <select> if JavaScript is not enabled.
        
        This widgets will probably use the `Chosen`_ plugin.
        
        Browsers supported
        ------------------
        
        All modern browsers should be supported (Mozilla Firefox 3.0+, Google Chrome
        7.0+, Apple Safari 4.0+, Opera 10.0+ and Microsoft Internet Explorer 9.0+).
        
        .. _`jQuery TaskPlease`: https://github.com/Quimera/tasksplease
        .. _`jQuery Tokeninput`: http://loopj.com/jquery-tokeninput/
        .. _`Chosen`: http://harvesthq.github.com/chosen/
        .. _`Facebook`: http://www.facebook.com/
        
        
        Installation
        ------------
        
        To enable this product in a buildout-based installation:
        
        1. Edit your buildout.cfg and add ``collective.z3cform.widgets`` to the list
           of eggs to install::
        
            [buildout]
            ...
            eggs =
                collective.z3cform.widgets
        
        2. You may need to extend a Dexterity known good set (KGS) to make sure that
           you get the right versions of the packages that make up Dexterity::
        
            [buildout]
            ...
            extends =
                http://good-py.appspot.com/release/dexterity/1.2.1
        
        After updating the configuration you need to run ''bin/buildout'', which will
        take care of updating your system.
        
        Don't panic
        -----------
        
        New fields
        ^^^^^^^^^^
        
        **TasksWidget**
            To use this widget we must use a List field or a Tuple field with the
            value_type as an schema.TextLine() like this::
        
                form.widget(subjects = KeywordsFieldWidget)
                options = schema.Tuple(
                    title=_(u"Options"),
                    value_type=schema.TextLine(),
                    missing_value=(,),
                    )
        
        **TokenInputWidget**
            To use this Widget we must use a List field or a Tuple field with the
            value_type as a schema.TextLine() like this::
        
                form.widget(options=TokenInputWidget)
                subjects = schema.List(
                    title=_(u"Categories"),
                    value_type=schema.TextLine(),
                    default=[],
                    )
        
        **RelatedContentWidget**
        
            The parameters passed to the ObjPathSourceBinder class are used to filter
            the search of elements to relate to.. if none parameter are passed, a tree
            structure is shown in the widget::
        
                form.widget(relatedItems=RelatedContentFieldWidget)
                relatedItems = RelationList(
                    title=_(u"Related Items"),
                    default=[],
                    value_type=RelationChoice(title=u"Related",
                        source=ObjPathSourceBinder(portal_type='Document')),
                    )
        
        Override existing fields
        ^^^^^^^^^^^^^^^^^^^^^^^^
        
        To override an existing field put the following code in the __init__.py of
        your package.
        
        **TasksWidget**
            TBA
        
        **TokenInputWidget**
        
                from plone.autoform.interfaces import WIDGETS_KEY
                from plone.directives.form.schema import TEMP_KEY
                from plone.app.dexterity.behaviors.metadata import ICategorization
                from zope import schema as _schema
        
                _directives_values = ICategorization.queryTaggedValue(TEMP_KEY)
                _directives_values.setdefault(WIDGETS_KEY, {})
                widget = 'collective.z3cform.widgets.token_input_widget.TokenInputWidget'
                _directives_values[WIDGETS_KEY]['subjects'] = widget
                _schema.getFields(ICategorization)['subjects'].index_name = 'Categories'
        
        **RelatedContentWidget**
            TBA
        
        
        Contributors
        ------------
        
        * Franco Pellegrini
        * Gonzalo Almeida
        * Silvestre Huens
        * Héctor Velarde
        * Cleber J Santos
        
        Development sponsored by Open Multimedia.
        
        
        Changelog
        ---------
        
        1.0a2 (2012-05-18)
        ^^^^^^^^^^^^^^^^^^
        
        - Updated package documentation. [hvelarde]
        
        - Changing the name of KeywordWidget to a better name TokenInputWidget.
          [flecox]
        
        - Now you can add a token just by pressing Enter. [flecox]
        
        
        1.0a1 (2012-05-04)
        ^^^^^^^^^^^^^^^^^^
        
        - Initial release.
        
        
Keywords: plone z3c widgets dexterity
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Framework :: Plone
Classifier: Framework :: Plone :: 4.1
Classifier: Framework :: Plone :: 4.2
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: JavaScript
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.6
Classifier: Topic :: Office/Business :: News/Diary
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: User Interfaces
