Skip to main content

jQuery Fullcalendar integration for cone.app

Project description

cone.calendar

This package provides a calendar integration in to cone.app. It utilizes jQuery Fullcalendar (https://github.com/fullcalendar/fullcalendar).

Currently, tag 3.1.0 is included. See (https://github.com/fullcalendar/fullcalendar/releases).

Calendar Widget

The calendar widget integration is done via cone.calendar.browser.CalendarTile which is registered by name calendar.

The overall calendar configuration is done via model properties.

from cone.app.model import BaseNode
from cone.app.model import Properties

class MyCalendar(BaseNode):

    @property
    def properties(self):
        props = Properties()
        props.default_content_tile = 'calendar'
        props.calendar_header = {
            'left': 'month,agendaWeek,agendaDay',
            'center': 'title',
            'right': 'today prev,next'
        }
        return props

For a full list of available calendar options read cone.calendar.browser.CalendarTile documentation.

Calendar Events

In order to display events in the calendar, one or more event data sources must be provided.

Concrete event data implementation must derive from cone.calendar.browser.CalendarEvents and provide events function.

The default event data source is expected as JSON view registered by name calendar_events for a dedictaed model context.

from cone.calendar.browser import CalendarEvents
from datetime import datetime
from pyramid.view import view_config
import uuid

@view_config(
    name='calendar_events',
    context=MyCalendar,
    accept='application/json',
    renderer='json',
    permission='view')
class MyEvents(CalendarEvents):

    def events(self, start, end):
        events = [{
            'id': uuid.uuid4(),
            'title': 'Title',
            'start': datetime(2020, 4, 29, 17, 40),
            'end': datetime(2020, 4, 29, 18, 0),
        }]
        return events

For a full list of available event options read cone.calendar.browser.CalendarEvents documentation.

Multiple event data sources are defined via model properties.

class MyCalendar(BaseNode):

    @property
    def properties(self):
        props = Properties()
        props.calendar_sources = [{
            'events': 'event_data_1',
            'color': 'green'
        }, {
            'events': 'event_data_2',
            'color': 'red'
        }]
        return props

For a full list of available event source options read cone.calendar.browser.CalendarTile documentation.

Locales

The calendar locale can be set via calendar_locale on model properties.

class MyCalendar(BaseNode):

    @property
    def properties(self):
        props = Properties()
        props.calendar_locale = 'de'
        return props

Default calendar locale is en. The desired locales must be delivered to the browser in order to work correctly. Locales to deliver are defined in the application ini config as comma separated list of locale names.

cone.calendar.locales = de,fr

For a complete list of available locales see browser/static/fullcalendar/locales folder of this package.

Contributors

  • Robert Niederreiter

  • Johannes Raggam

Changes

0.1 (2020-05-30)

  • Initial. [rnix, thet]

License

Copyright (c) 2017-2020, BlueDynamics Alliance, Austria All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  • Neither the name of the BlueDynamics Alliance nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY BlueDynamics Alliance AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BlueDynamics Alliance BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

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

cone.calendar-0.1.tar.gz (592.0 kB view details)

Uploaded Source

File details

Details for the file cone.calendar-0.1.tar.gz.

File metadata

  • Download URL: cone.calendar-0.1.tar.gz
  • Upload date:
  • Size: 592.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.3

File hashes

Hashes for cone.calendar-0.1.tar.gz
Algorithm Hash digest
SHA256 59bac59ddcce30186980f55877d43c01a36d06349fa17f8748945e22c8f7d914
MD5 8d8a9a741a0dcaf25ec34abe1b5bddb4
BLAKE2b-256 10439771967c6c47369c1685ffc905edbbf842b8f2f52f1a9358bcd4c9eefe24

See more details on using hashes here.

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