cone.app的jQuery Fullcalendar集成
项目描述
此软件包为cone.app提供日历集成。它使用jQuery Fullcalendar (https://github.com/fullcalendar/fullcalendar)。
目前包含标签3.1.0。请参阅 (https://github.com/fullcalendar/fullcalendar/releases)。
日历小部件
日历小部件集成是通过名为 calendar 的 cone.calendar.browser.CalendarTile 实现的。
整体日历配置是通过模型属性完成的。
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
有关可用的日历选项的完整列表,请参阅 cone.calendar.browser.CalendarTile 文档。
日历事件
为了在日历中显示事件,必须提供一个或多个事件数据源。
具体的事件数据实现必须从 cone.calendar.browser.CalendarEvents 派生,并提供 events 函数。
默认事件数据源是预期作为名为 calendar_events 的JSON视图注册的,用于特定的模型上下文。
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
有关可用的事件选项的完整列表,请参阅 cone.calendar.browser.CalendarEvents 文档。
通过模型属性定义了多个事件数据源。
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
有关可用的事件源选项的完整列表,请参阅 cone.calendar.browser.CalendarTile 文档。
地区
可以通过模型属性上的 calendar_locale 设置日历地区。
class MyCalendar(BaseNode):
@property
def properties(self):
props = Properties()
props.calendar_locale = 'de'
return props
默认日历区域设置为en。为了正确工作,必须将所需的区域发送到浏览器。要发送的区域在应用程序的ini配置中定义为以逗号分隔的区域名称列表。
cone.calendar.locales = de,fr
有关可用区域的完整列表,请参阅本包的browser/static/fullcalendar/locales文件夹。
贡献者
Robert Niederreiter
Johannes Raggam
变更
0.3 (2022-10-06)
现代化JavaScript。[rnix]
0.2 (2020-07-09)
将show_contextmenu添加到CalendarTile。默认为False。[rnix]
在处理JavaScript中的操作下拉菜单时,也要检查操作长度。[rnix]
0.1 (2020-05-30)
初始。[rnix, thet]
许可
版权所有(c)2017-2021,BlueDynamics Alliance,奥地利 版权所有(c)2021,Cone贡献者 保留所有权利。
重新分配和使用源代码和二进制形式,无论是否修改,只要满足以下条件,都是允许的
源代码重新分配必须保留上述版权声明、本条件列表和以下免责声明。
二进制形式的重新分配必须在文档和/或其他提供的材料中重新生产上述版权声明、本条件列表和以下免责声明。
本软件由版权所有者和贡献者提供“按原样”及任何明示或暗示的保证,包括但不限于适销性和适用于特定目的的暗示保证均予以否认。在任何情况下,版权所有者或贡献者不应对任何直接、间接、偶然、特殊、示范性或后果性损害(包括但不限于替代商品或服务的采购;使用、数据或利润的损失;或业务中断)承担责任,无论何种原因造成以及基于何种责任理论(合同、严格责任或侵权,包括疏忽或不计),即使被告知本软件使用可能产生此类损害。
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装软件包的更多信息。
源代码分发
构建分发
cone.calendar-0.3.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 4bd26d1444658db94dcf10b7da8f7b3555398689305b0a2a3492c210aa458220 |
|
MD5 | 359dab4691658923ee9a1f61aa630d8c |
|
BLAKE2b-256 | 4cbe5aceaba1d422cc09c1a4ba4421458817893b22c22f3e68e4a1ab4d31ee77 |