Skip to main content

A generic tabbed view for plone content types.

Project description

Introduction

This package provides a generic view with multiple tabs for plone. It provides a generic base tab for listing contents in a table, based on ftw.table.

Features

  • Generic tabbed view

  • Tabs are registered through FTI actions

  • Base view for listing tabs

  • Listing tabs are filterable

  • Perform configurable actions on listed items

  • ftw.table’s Ext JS support works also in listing tables

  • Fallback tables

  • Drag’n drop multiple file upload functionality (using quickupload plugin)

Installation

Default table implementation

  • Add ftw.tabbedview to your buildout (or as dependency to a custom egg):

[buildout]
parts =
    instance
    ...

[instance]
...
eggs +=
    Plone
    ftw.tabbedview
  • Install default profile in portal_setup.

Ext JS table implementation

  • Add ftw.tabbedview to your buildout (or as dependency to a custom egg), using the extjs extras require:

[buildout]
parts =
    instance
    ...

[instance]
...
eggs +=
    Plone
    ftw.tabbedview[extjs]
  • Install extjs profile in portal_setup.

Quickupload plugin implementation

The quickupload plugin integrates the collective.quickupload packages in to the tabbedview.

  • Add ftw.tabbedview to your buildout (or as dependency to a custom egg), using the quickupload extras require:

[buildout]
parts =
    instance
    ...

[instance]
...
eggs +=
    Plone
    ftw.tabbedview[quickupload]
  • Install quickupload profile in portal_setup.

  • For activating the quickupload plugin on a context, make sure the context provides the ITabbedviewUploadable Interface.

Usage

We use the package example.conference``_ as example for showing how to use ``ftw.tabbedview.

  • Use the @@tabbed_view on any container.

  • Define actions on the content type FTI (Example: profiles/default/types/example.conference.program.xml):

    <?xml version="1.0"?>
    <object name="example.conference.program" meta_type="Dexterity FTI"
            i18n:domain="example.conference" xmlns:i18n="http://xml.zope.org/namespaces/i18n">
    
      <property name="default_view">tabbed_view</property>
      <property name="view_methods">
          <element value="tabbed_view"/>
      </property>
    
      <action title="Sessions" action_id="sessions" category="tabbedview-tabs"
              condition_expr="" url_expr="string:${object_url}?view=sessions"
              visible="True">
          <permission value="View"/>
      </action>
    
    </object>
  • Create the “tab” view (Example: browser/tabs.py):

    >>> from ftw.tabbedview.browser.listing import CatalogListingView
    >>> from ftw.table import helper
    >>> from example.conference import _
    >>>
    >>> class SessionsTab(CatalogListingView):
    ...     """A tabbed-view tab listing sessions on a program.
    ...     """
    ...
    ...     types = ['example.conference.session']
    ...     sort_on = 'sortable_title'
    ...
    ...     show_selects = False
    ...
    ...     columns = (
    ...         {'column': 'Title',
    ...          'sort_index': 'sortable_title',
    ...          'column_title': _(u'Title'),
    ...          'helper': helper.linked},
    ...
    ...         {'column': 'Track',
    ...          'column_title': _(u"Track")},
    ...         )
  • Register the view using ZCML, be sure to name it tabbedview_view-${action id} (Example: browser/configure.zcml):

    <configure
        xmlns="http://namespaces.zope.org/zope"
        xmlns:browser="http://namespaces.zope.org/browser">
    
        <browser:page
            for="example.conference.program.IProgram"
            name="tabbedview_view-sessions"
            class=".tabs.SessionsTab"
            permission="zope2.View"
            />
    
    </configure>

Alternative listing sources

It is possible to use alternative sources for listing tabs. The tables are generated using ftw.table and the tab is a ftw.table.interfaces.ITableSourceConfig, which allows ftw.table to find an appropriate source. Subclassing ITableSourceConfig and registering a custom ITableSource multi adapter makes it possible to use alternative data sources such as sqlalchemy or structured python data (local roles for instance). Take a look at the ftw.table documentation for more details.

Screenshots

Screenshot of a example tabbed view using the default table implementation:

https://github.com/4teamwork/ftw.tabbedview/raw/master/docs/screenshot1.png

Screenshot of the same listing using the extjs table implementation:

https://github.com/4teamwork/ftw.tabbedview/raw/master/docs/screenshot2.png

Caching

ftw.tabbedview provides a plone.app.caching etag adapter named tabbedview. This etag can be used in the caching configuration in order to make the cache flush when changing the default tab.

In order to enable this, you need to add it to your caching configuration. Depending on how you want to set up caching in your project, you may want to add the etag to your rulesets. You can do that in a registry.xml:

<?xml version="1.0"?>
<registry>

    <record name="plone.app.caching.weakCaching.plone.content.itemView.etags">
        <value purge="False">
            <element>tabbedview</element>
        </value>
    </record>

    <record name="plone.app.caching.weakCaching.plone.content.folderView.etags">
        <value purge="False">
            <element>tabbedview</element>
        </value>
    </record>

</registry>

Licensing

This package is released under GPL Version 2. Be aware, that when using the package with the extjs extras, it will install Ext JS, which has different license policies. See http://www.sencha.com/products/extjs/license/ for details.

Changelog

3.8.2 (2017-06-27)

  • Fix: no longer render the viewname as html on the fallback view. [mathias.leimgruber]

3.8.1 (2017-04-24)

  • Refactor DefaultGridStateStorageKeyGenerator to improve overridable in more specific implemnetations. [elioschmutz]

3.8.0 (2017-03-22)

  • Append action object name/id to CSS classes in folder action menus. [Rotonen]

3.7.2 (2017-03-13)

  • Fix cachekey / defaulttab generation for anonymous users. [jone]

3.7.1 (2017-03-13)

  • Fix error when calculating etag value on non-tabbedview. [jone]

3.7.0 (2017-03-02)

  • Add plone.app.caching etag value adapter containing the users default tab. In order to benefit from that, you need to update your caching configuration. See the readme for instructions. [jone]

3.6.2 (2017-03-02)

  • Fix default tab for HTTPS. [mbaechtold]

3.6.1 (2017-03-01)

  • Fix default tab for HTTPS. [jone]

3.6.0 (2016-12-06)

  • Change markup of batching so it can be styled more easily. [mbaechtold]

  • Template API breakage - renamed slot ‘content-title’ to ‘tabbedview-content-title’ [Rotonen]

  • Minor Chameleon compatibility fixes. [Rotonen]

3.5.4 (2016-10-18)

  • Fix tabbedview history. [Kevin Bieri]

3.5.3 (2016-09-27)

  • Fix NameError in tabebdview macros. [jone]

3.5.2 (2016-09-26)

  • Chameleon support: make macros access lazy. [jone]

  • Check for searchbox value when a tabbedview page gets reloaded. [phgross]

3.5.1 (2016-08-23)

  • Extract tabbedview’s allowed attributes in to an interface. [phgross]

  • Move uploadbox above tabbedview menu [Kevin Bieri]

  • Change Regex in parse_param. Only match decimal characters, since parseFloat may return wrong results when confronted with an int. [tschanzt]

3.5.0 (2016-03-07)

  • Drop support for Plone 4.1.x. [deiferni]

  • Respect permissions defined on tabs during tab-lookup. Replaces adapter lookup with traversal to make sure that permissions defined on a tab are respected. [deiferni]

  • Handle when the client gets a response from different source than a tabbed-view. By default show a message that the tab could not be loaded successfully. This can be customized by registering a different event handler. [deiferni]

3.4.3 (2016-02-15)

  • Prevent reload loop when requesting non-existing tab. [jone]

3.4.2 (2015-09-01)

  • Add fallback in tabbedview initalization, when passed index of oneBeforeClick event is incorrect. [phgross]

  • Fix javascript error in IE10 when no default index is defined. [Kevin Bieri]

3.4.1 (2015-08-03)

  • Remove whitespace around content title. [deiferni]

3.4.0 (2015-05-26)

  • Move tabbedview specific styles from plonetheme.onegov to this package. [lknoepfel]

  • Fixed initial tab marker (default-tab). [phgross]

3.3.13 (2014-08-28)

  • Add before-tab slot. [mathias.leimgruber]

3.3.12 (2014-08-07)

  • JS: Use base URL to build absolute URL for set_default_tab. [lgraf]

3.3.11 (2014-05-28)

  • Enable D’n’D upload on tabbedview for IE > 9. [mathias.leimgruber]

3.3.10 (2014-05-26)

  • Made TabbedView title customizable by a custom tabbedview template. [phgross]

  • Replaced old spinner image. [Julian Infanger]

  • Use bind() instead of on() to restore jQuery < 1.7 compatibility. [lgraf]

3.3.9 (2014-03-28)

  • Fix bug sometimes the default-tab setting did not work. [jone]

  • Fixed not closed script tags. [lknoepfel]

  • Load extjs related JS resurces only on tabbed.pt, thus we save 700KB of JS on not tabbed views. [mathias.leimgruber]

3.3.8 (2013-11-28)

  • Replaced unicode char for tabbedview menu header. Use icon instead, because the unicode char didn’t work on IE. [Julian Infanger]

3.3.7 (2013-08-26)

  • Move table_options initalization from __call__ to __init__ in listing.py. Otherwise the update method does not work without calling the view first. [mathias.leimgruber]

  • Fix deprecated quickupload interface import. [jone]

3.3.6 (2013-07-18)

  • Filter field: add placeholder. [jone]

  • Fixed markup in tabbedview buttons and added a class to identify buttons. [Julian Infanger]

  • Mark tabbedview header with disabledSearchBox class if the searchbox is disabled. [Julian Infanger]

3.3.5 (2013-04-17)

  • Use removeAttr (jQuery 1.7.x). [mathias.leimgruber]

  • Fix reset table configuration action. [mathias.leimgruber]

  • Use Batch.fromPagenumber. [mathias.leimgruber]

3.3.4 (2013-01-25)

  • Add INoExtJS marker interface disabling extjs when provided by the tabbview and the tab [mathias.leimgruber]

3.3.3 (2013-01-21)

  • Add default dynamic batching form to batching template. #11 [jone]

  • Fix javascript order in ExtJS profile. [jone]

  • Fix IE7 element positioning issue by force repainting. [jone]

  • Do not hide the right portlet column. [Julian Infanger]

  • Fix failing test introduced by the “anonymous access” change. Also test extjs configuration specifically anonymous. [jone]

3.3.2 (2012-10-26)

  • Basic support for using the tabbed view anonymously. ExtJS is not supported and automatically disabled for anonymous users. [jone]

  • Adjust javscripts: Use $ instead of deprecated jq. [phgross]

  • Added condition for not showing uploadbox if text is dragged on the website. [Julian Infanger, jone]

  • Use first tabbedview by default when accessing tabbed view anonymously. [jone]

3.3.1 (2012-10-16)

  • Cleanup readme [mathias.leimgruber]

3.3 (2012-10-16)

  • Load upload function only on tabbedview. [mathias.leimgruber]

  • Tabbedview: do not flush all parameters when re-sorting, but only the relevant ones. This allows to keep additional parameters (e.g. filters) while sorting. [jone]

  • Reset view_name param before changing a tab. [mathias.leimgruber]

  • Added min_height to tabbedview-body. Grey-out the tabbedview-body while loading a new tab. [Julian Infanger]

  • Fix default tab key storage, so that it includes the user id. [jone]

  • Adjust french translation. [philippegross]

  • Add English translations. [jone]

  • Add functionality for setting the default tab of a tabbed view. [jone]

  • Change dictstorage to adapt IBrowserView instead of IListingView. [jone]

  • Add a per-tab menu for actions such as resetting the extjs table state. [jone]

  • Filtering: do not reload when moving cursor in the filter box. [jone]

  • Keep height while loading tab. This reduces content height flickering. [jone]

  • Quickupload: Limit simultaneous uploads to 1 (sequential) to avoid DB conflicts [lgraf]

  • Prevent default in js-action for ViewChooser-links. [Julian Infanger]

  • Fix batching expression for compatibility with plone4.2rc2 and newer. [jone]

  • Fixed definition of ITabbedView.quickupload_addable_types schema.List fields always need a value_type [lukasg]

3.2.6 (2012-05-24)

  • Make quickupload work bhind a proxy (url in value of hidden field will no be rewritten.) [mathias.leimgruber]

3.2.5 (2012-05-24)

  • Fix upload js for IE8. [mathias.leimgruber]

3.2.4 (2012-05-22)

  • Bugfix: fix sorting in grid state when it is wrong. [jone]

3.2.3 (2012-05-09)

  • Use same markup in batching like plone. [Julian Infanger]

  • Add meta:provides ftw.tabbedview3 for zcml:conditions. [jone]

  • Setting ‘X-Theme-Disabled’ header in ListingView response for HTML fragment [lgraf]

  • Added ‘ajax_load’ parameter to listing request. [lgraf]

  • Setting correct Content-Type header for JSON response from ListingView. [lgraf]

3.2.2 (2012-04-23)

  • Added CSS classes to brackets, which indicates the current page in batching.pt [mathias.leimgruber]

3.2.1 (2012-04-05)

  • Replace some $ by jq in tabbedview.js. [mathias.leimgruber]

3.2 (2012-04-02)

  • Bugfix in check for quickupload is available. [mathias.leimgruber]

  • Added Quickupload plugin, wich provides drag’n drop multiple fileupload functionality. [phgross]

3.1.5 (2012-03-28)

  • Enable extjs in portal_registry with extjs GS profile. [jone]

3.1.4 (2012-03-19)

  • Removed integrated tooltips. If you still wand tooltips, use ftw.tooltip [mathias.leimgruber]

3.1.3 (2012-03-12)

  • Disable tabbedview_search instead of hiding. [Julian Infanger]

  • Add new spinner, update spinner position and add helper functions. [jone]

3.1.2 (2012-03-05)

  • Switch tab after loading contents of new tab, add “loading_tab” class while loading. [jone]

  • Filtering listings: do not flush all params but flush pagenumber only. [jone]

  • Hide label of “Filter” box, but keep it for accessibility rasons. [jone]

  • Make search function more robust, so that it is possible to have a non-listing view, switchin to a listing view when a search term is entered. [jone]

  • Fix bug in listing menu generator. [jone]

  • Add a default “reset table configuration” folder_contents action (which is only visible on tabbedview tabs). [jone]

3.1.1 (2012-02-28)

  • Adjust MANIFEST.in: add include for rst files (reamde.rst). [phgross]

3.1 (2012-02-27)

  • Added some French translations [ttschanz]

  • Fix submenu click event binding. Dont use live(click). [mathias.leimgruber]

  • Implemented show_menu condition. [mathias.leimgruber]

  • Add form authenticator to listing forms. [jone]

  • Fix bug where the persistent ext-js grid state when trying to acces the sort information. The sort information may not be there in some cases. [jone]

  • Remove old i18n directory. #3 [jone]

  • Make both JS implementation (default and extjs) work on same branch:

    • Better use of ftwtable jquery plugin in tabbed view.

    • Register a default tabbedview dictstorage, stored on the plone site.

    • Fix markup for extjs implementation.

    • Implement selecting and menu support for default implementation.

    • Respect extjs-config in registry for deciding if the extjs JS should be loaded.

    • Remove non-ftw.tabbedview translations added from custom projects.

    • Various cleanup and minor bug fixes.

    [jone]

3.0 (2011-11-17)

  • Moved hidden input element into tabbedview_form so it always gets submitted. [lgraf]

  • Implements a dynamic batchbox for batched listing views, which allows to change the batchsize (hits per site) dynamically. [phgross]

  • Automaticly reset batching while filtering (with the textfilter) [phgross]

  • Made it possible to set a empty dict as gridstate configuration [phgross]

  • Add possibility to call javascript functions from tabbeview-menu actions. By default every tabbedview_menu link just submit the form. Used for the reset_tableconfiguration action. [phgross]

3.0b9 (2011-10-04)

  • added morelink (show all link) support, for overview listings with boxes. Every show all link loads now autmaticly the corresponding tab. [phgross]

3.0b8 (2011-107-12)

  • fixed select_all method (works now also with direct call) [phgross]

  • removed half-implemented variable batching_enabled fixed select_all function [phgross]

3.0b7

  • removed some translations which don’t belong here [ttschanz]

3.0b6

  • slightly changed html structure to make it easier to style [fsprenger]

3.0b5

  • Fixed translation files [jbaumann]

3.0b4

  • Show amount of matching in “select-all” link. [jbaumann]

3.0b3

  • Enable batching when grouping is enabled. This solves performance issues on heavy tables. [jbaumann]

  • Fixed bug where grouping in the state broke the table. [jbaumann]

3.0b2

  • Read sort_on attribute from grid storage [jbaumann]

3.0b1

  • Implemented grid state storage stuff with ftw.dictstorage [jbaumann]

  • Implemented server side grouping of listing tables [jbaumann]

  • added action permission check [mathias.leimgruber]

2.1

  • tagged from master instead of plone4 compatibility branch Your should realy use this one [mathias.leimgruber]

1.0c2

  • Changed the minimum pagesize to 1. A small pagesize is necessary for easy testing. [jbaumann]

  • Fixed select-all: It does now select all items in the tab, not only the visibles. Fixed also ordering and duplicity. [jbaumann]

  • Using jqueryui is now optional. Use the “jqueryui” extras_require for enabling UI. [jbaumann]

  • rebuild tabbedview, so that in only done the tabbedview js stuff, when the tabbedview is displayed

  • Added maintainer properly in setup.py [jbaumann]

1.0c1

  • Remove toLoverCase since its not really needed and error-prone [vbaumann]

1.0a5

  • timesheet-tabbedview: added some translations [phgross]

1.0a4

  • Translations [fsprenger]

  • added translations [phgross]

1.0a3

  • Filter boxes Functionality (with a accordian view) [phgross]

  • Auto Filter boxes Functionality (with a accordian view) [phgross]

  • Auto Count Functionality [phgross]

  • Corrected the select all action [phgross]

  • Added sort functionality for the SolrListingView [phgross]

  • Translation for tab’s titles added [jbaumann]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ftw.tabbedview-3.8.2.tar.gz (148.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page