This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Help us improve Python packaging - Donate today!
Project Description

Introduction

With ftw.mobile you can implement mobile buttons, which shows a list of options on click. The package needs ftw.theming, which provides the basic styles.

Plus it provides a mobile navigation, which is also displayed as a mobile button, but nbehaves completely different.

Installation

  • Add the package to your buildout configuration:
[instance]
eggs +=
    ...
    ftw.mobile

Dependencies

Warning: This package installs ftw.gopip, replacing the getObjPositionInParent catalog index with a FieldIndex. The reason is that ftw.mobile needs to do large catalog queries sorted by getObjPositionInParent, which is too slow in standard Plone. See the ftw.gopip readme for further details.

Usage

Two default buttons are registered by default.

  • User Menu
  • Navigation

Basically the buttons are rendered in a viewlet, which is visible at an certain viewport size.

Register new button

Minimal example:

from ftw.mobile.buttons import BaseButton


class UserButton(BaseButton):

    def label(self):
        return u"User menu"

    def position(self):
        return 1000

    def data(self):
        """json data to display"""
        context_state = getMultiAdapter((self.context, self.request),
                                        name=u'plone_context_state')

        user_actions = context_state.actions('user')

        def link_data(item):
            return {'url': item.get('url'),
                    'label': item.get('title')}
        return map(link_data, user_actions)

You need to define at least the label, the position and the data for a working mobile button.

Keep in mind, that the data method needs to return valid json data structure:

[
    {
        "url": "$LINK_URL",
        "label": "$LINK_LABEL"
    },
    {
        "url": "$LINK_URL",
         "label": "$LINK_LABEL"
    }
]

The user button has the postion 1000 and is rendered most right position and the navigation has the position 100, which is on the most left side.

The navigation button is somehow special across his complexity. The navigation button is not considered a simple button ;-)

Details Navigation Button

The mobilenavigation adds two additional wrappers arround all children of the body on pageload.

Development

Python:

  1. Fork this repo
  2. Clone your fork
  3. Shell: ln -s development.cfg buidlout.cfg
  4. Shell: python boostrap.py
  5. Shell: bin/buildout

Run bin/test to test your changes.

Or start an instance by running bin/instance fg.

Changelog

1.6.6 (2017-02-16)

  • Fix mobile menu transition on IE>=9. [Kevin Bieri]

1.6.5 (2017-01-18)

  • Set the children_loaded flag on prepended nodes too. [mathias.leimgruber]
  • Append current context path to prepend_unauthorized_parents, because the current obj may be excluded from nav. [mathias.leimgruber]

1.6.4 (2016-12-01)

  • Do not detach script tags of type x-handlebars-template. jQuery is not able to re-attach them. [mathias.leimgruber]

1.6.3 (2016-11-25)

  • Close the mobile-navigation when the screen size changes from mobile to desktop while the navigation is open. [raphael-s]

1.6.2 (2016-11-09)

  • Actually mark external links with a “external-link” class in navtree. [mathias.leimgruber]

1.6.1 (2016-11-08)

  • Toggle aria-hidden attribute on mobile navigation elements [raphael-s]

1.6.0 (2016-11-07)

  • Add various JavaScript events for convenience. [jone]

1.5.1 (2016-10-20)

  • Hide current path on root when showing one level. [jone]
  • Fix invalid markup in template, causing broken markup with chameleon. [jone]

1.5.0 (2016-10-17)

  • Mobile buttons: add settings “show_tabs” and “show_two_levels_on_root”. [jone]
  • Pass the url of the navigation root to the handlebars template. [mbaechtold]
  • Use helper text for screenreaders also as title attribute on the link itself. [mathias.leimgruber]
  • Implement plone translations for handlebars templates. [mathias.leimgruber]
  • Do not render handlebars templates with PageTemplate engine. [mathias.leimgruber]
  • Add “navActiveNode” class to the node which is currently loaded. [jone]
  • Add separate “current node” item in addition to “parent node”. [jone]
  • Leaf nodes: open parent navigation. [jone]
  • Prevent inline javascript from evaluating twice. [Kevin Bieri]

1.4.0 (2016-09-26)

  • Install ftw.gopip for better performance. [jone]
  • Mark leaf nodes and remove link to children. [jone]

1.3.0 (2016-09-20)

  • Add support for plone.app.multilingual [Kevin Bieri]

1.2.0 (2016-09-09)

  • Open the target behind a top level node not having children after having clicked it. [jone, mbaechtold]
  • Scroll back to the top level node after having clicked it. [jone]

1.1.0 (2016-09-09)

  • Fix crash when parent is excluded from navigation by also including parents when excluded from navigation. [jone]
  • Make it possible to close the menu when clicking somewhere outside of the menu [Kevin Bieri]

1.0.2 (2016-08-08)

  • Fix hightlighting more than one top level tab [Kevin]
  • Translate user menu actions. [jone]
  • Fix issues when the user has no permission to view a parent. [jone]

1.0.1 (2016-07-18)

  • Pevent scrolling when navigation is open [Kevin Bieri]
  • Use zindex system from ftw.theming to fix dropdown menues [Kevin Bieri]

1.0.0a3 (2016-07-11)

  • Introduce transitionend marker on root element. [Kevin Bieri]

1.0.0a2 (2016-07-06)

  • Fix offcanvas navigation on iOS devices. Rework revealing offcanvas navigation using two additional wrappers. Refactor styling. [Kevin Bieri]

1.0.0a1 (2016-07-06)

  • Init release
Release History

Release History

1.6.6

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.6.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.6.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.6.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.6.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.6.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.6.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.5.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.5.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.4.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.3.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0a3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0a2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0a1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
ftw.mobile-1.6.6.tar.gz (51.6 kB) Copy SHA256 Checksum SHA256 Source Feb 16, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting