Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

TasksWidget was renamed to EnhancedTextLinesFieldWidget and package d…

…ocumentation was updated; this fixes #7
  • Loading branch information...
commit caeb852069e021350838115addf46d7f9f18b14d 1 parent 96b11e3
@hvelarde hvelarde authored
View
32 README.txt
@@ -4,16 +4,22 @@ collective.z3cform.widgets
.. contents:: Table of Contents
-Overview
---------
+Life, the Universe, and Everything
+----------------------------------
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.
+**EnhancedTextLinesFieldWidget**
+ This widget is an ajaxified version of the TextLinesFieldWidget that
+ allows creation, sort, update and deletion of text lines; degrades to
+ <textarea> if JavaScript is not enabled.
+
+ .. image:: https://github.com/collective/collective.z3cform.widgets/raw/master/enhancedtextlines.png
+ :align: center
+ :height: 143px
+ :width: 600px
This widget uses the `jQuery TaskPlease`_ plugin.
@@ -24,7 +30,7 @@ collective.z3cform.widgets provides the following widgets:
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/tokeninputfieldwidget.png
+ .. image:: https://github.com/collective/collective.z3cform.widgets/raw/master/tokeninput.png
:align: center
:height: 110px
:width: 600px
@@ -36,26 +42,32 @@ collective.z3cform.widgets provides the following widgets:
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>
+- 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
+- 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+).
+Mostly Harmless
+---------------
+
+Have an idea? Found a bug? Let us know by `opening a support ticket`_.
+
.. _`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/
+.. _`opening a support ticket`: https://github.com/collective/collective.z3cform.widgets/issues
View
19 docs/CREDITS.txt
@@ -1,11 +1,14 @@
-Contributors
-------------
-
-* Franco Pellegrini
-* Gonzalo Almeida
-* Silvestre Huens
-* Héctor Velarde
-* Cleber J Santos
+Share and Enjoy
+---------------
+
+collective.z3cform.widgets would not have been possible without the
+contribution of the following people:
+
+- Franco Pellegrini
+- Gonzalo Almeida
+- Silvestre Huens
+- Héctor Velarde
+- Cleber J Santos
Development sponsored by Open Multimedia.
View
10 docs/HISTORY.txt
@@ -1,10 +1,17 @@
Changelog
---------
+Because you have to know where your towel is.
+
1.0a3 (unreleased)
^^^^^^^^^^^^^^^^^^
-- Changing the name of RelatedContentWidget to a "better" name MultiContentSearchFieldWidget.
+- Updated package documentation. [hvelarde]
+
+- TasksWidget was renamed to EnhancedTextLinesFieldWidget (fixes `#7`_).
+ [hvelarde]
+
+- Changing the name of RelatedContentWidget to MultiContentSearchFieldWidget.
[flecox]
@@ -24,3 +31,4 @@ Changelog
- Initial release.
+.. _`#7`: https://github.com/collective/collective.z3cform.widgets/issues/7
View
6 docs/INSTALL.txt
@@ -22,13 +22,13 @@ To enable this product in a buildout-based installation:
After updating the configuration you need to run ''bin/buildout'', which will
take care of updating your system.
-Don't panic
+Don't Panic
-----------
New fields
^^^^^^^^^^
-**TasksWidget**
+**EnhancedTextLinesFieldWidget**
To use this widget we must use a List field or a Tuple field with the
value_type as an schema.TextLine() like this::
@@ -67,7 +67,7 @@ New fields
Override existing fields
^^^^^^^^^^^^^^^^^^^^^^^^
-**TasksWidget**
+**EnhancedTextLinesFieldWidget**
TBA
**TokenInputFieldWidget**
View
BIN  enhancedtextlines.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
30 src/collective/z3cform/widgets/tasks_widget.py → src/collective/z3cform/widgets/enhancedtextlines.py
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
import zope.component
import zope.interface
import zope.schema
@@ -5,20 +7,21 @@
from z3c.form import interfaces
from z3c.form import widget
from z3c.form.browser import textarea
-from z3c.form.converter import BaseDataConverter
from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
-from collective.z3cform.widgets.interfaces import ITasksWidget
+from collective.z3cform.widgets.interfaces import IEnhancedTextLinesFieldWidget
+
-class TasksWidget(textarea.TextAreaWidget):
- """Widget for adding new keywords and autocomplete with the ones in the
- system."""
- zope.interface.implementsOnly(ITasksWidget)
+class EnhancedTextLinesFieldWidget(textarea.TextAreaWidget):
+ """ Widget for adding new keywords and autocomplete with the ones in the
+ system.
+ """
+ zope.interface.implementsOnly(IEnhancedTextLinesFieldWidget)
klass = u"keyword-widget"
- display_template = ViewPageTemplateFile('tasks_display.pt')
- input_template = ViewPageTemplateFile('tasks_input.pt')
-
+ display_template = ViewPageTemplateFile('enhancedtextlines_display.pt')
+ input_template = ViewPageTemplateFile('enhancedtextlines_input.pt')
+
# JavaScript template
js_template = """\
(function($) {
@@ -30,15 +33,12 @@ class TasksWidget(textarea.TextAreaWidget):
edit_task:'Edit task'
}
$('#%(id)s').tasksplease();
-
});
})(jQuery);
"""
def js(self):
-
return self.js_template % dict(id=self.id)
-
def render(self):
if self.mode == interfaces.DISPLAY_MODE:
@@ -46,7 +46,9 @@ def render(self):
else:
return self.input_template(self)
+
@zope.interface.implementer(interfaces.IFieldWidget)
def TasksFieldWidget(field, request):
- """IFieldWidget factory for TasksWidget."""
- return widget.FieldWidget(field, TasksWidget(request))
+ """ IFieldWidget factory for EnhancedTextLinesFieldWidget.
+ """
+ return widget.FieldWidget(field, EnhancedTextLinesFieldWidget(request))
View
0  src/collective/z3cform/widgets/tasks_display.pt → ...tive/z3cform/widgets/enhancedtextlines_display.pt
File renamed without changes
View
0  src/collective/z3cform/widgets/tasks_input.pt → ...ective/z3cform/widgets/enhancedtextlines_input.pt
File renamed without changes
View
2  src/collective/z3cform/widgets/interfaces.py
@@ -6,5 +6,5 @@ class ITokenInputWidget(interfaces.ITextLinesWidget):
from z3c.form import interfaces
-class ITasksWidget(interfaces.ITextLinesWidget):
+class IEnhancedTextLinesFieldWidget(interfaces.ITextLinesWidget):
"""Text lines widget."""
View
0  tokeninputfieldwidget.png → tokeninput.png
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.