基于fullcalendar的日历视图
项目描述
介绍
ftw.calendar 是一个基于 fullcalendar (http://arshaw.com/fullcalendar) 的日历视图。
特性
通用:ftw.calendar 不关心事件对象,它只需要一个集合,其中的结果大脑具有开始和结束属性。如果日历视图位于其他内容类型而非集合,它将显示此上下文下的所有事件(在 portal_calendar 中定义的类型)。
轻量级:唯一的要求(当然除了 plone)是 simplejson。可选地,如果您想启用事件调整大小和拖放功能,您可以安装 jquery.ui,但这不是必需的。
国际化:目前 ftw.calendar 可在德语、英语和捷克语中使用。欢迎添加更多翻译。
集成:ftw.calendar 关心您的日历设置。一周的第一天被尊重并相应显示。
灵活:日历源实现为一个适配器。覆盖它以修改标题或添加CSS类。
使用
将 ftw.calendar 添加到您的 buildout 配置中
[instance] eggs += ftw.calendar
安装通用导入配置文件。
使用 ftwcalendar_view 作为任何集合的新默认视图。新 Plone 网站中的默认事件集合应该可以很好地工作,但您可能需要删除日期标准,因为 fullcalendar 需要根据所选月份设置它们。
日历源
为了便于定制,我建议扩展默认日历源实现并覆盖三个定义的函数之一。
这是一个来自 ftw.meeting 的示例
from ftw.calendar.browser.calendarupdateview import CalendarJSONSource class MeetingCalendarJSONSource(CalendarJSONSource): def generate_source_dict_from_brain(self, brain): output = super(MeetingCalendarJSONSource, self).generate_source_dict_from_brain(brain) if brain.Type == 'Meeting' and \ self.memberid in brain.getAttendeesOrUsers: output['className'] += ' attendee' return output
configure.zcml:
<configure zcml:condition="installed ftw.calendar"> <adapter for="* ftw.meeting.interfaces.IMeetingLayer" name="ftw_calendar_source" provides="ftw.calendar.browser.interfaces.IFtwCalendarJSONSourceProvider" factory=".calendarsource.MeetingCalendarJSONSource" /> </configure>
日历事件创建者
可以通过在日历小部件上点击日期/时间来创建日历条目。由于 ftw.calendar 不知道特定项目中使用的是哪种事件类型,它必须由使用 ftw.calendar 的产品定义。没有默认实现!除非您在自己的产品中实现它,否则它将不起作用。
这是通过适配器完成的。这是一个来自 ftw.contentpage 的示例
from ftw.calendar.browser.interfaces import IFtwCalendarEventCreator from plone import api from zope.interface import implements class CalendarEventPageCreator(object): implements(IFtwCalendarEventCreator) def __init__(self, context, request): self.context = context self.request = request def getEventType(self): return "EventPage" def createEvent(self, title, start_date): return api.content.create(container=self.context, type="EventPage", title=title, startDate=start_date, endDate=start_date)
configure.zcml
<adapter for="* *" provides="ftw.calendar.browser.interfaces.IFtwCalendarEventCreator" factory=".adapters.CalendarEventPageCreator" />
故障排除
通常在安装并尝试日历视图后,会出现javascript错误。通常这些错误是由于javascript缓存引起的,可以通过在js_registry中启用javascript调试来轻松解决。
致谢
非常感谢Adam Shaw为jq.fullcalendar所做的贡献。
兼容性
与Plone 4.3,5.1兼容。
链接
版权
本软件包由4teamwork拥有版权。
ftw.calendar遵从GNU通用公共许可证,版本2。
变更日志
3.1.2 (2019-09-12)
为fullcalendar js中的minification错误添加缺少的Upgradestep [Nachtalb]
3.1.1 (2018-12-12)
修复fullcalendar js中的双重minification错误 [Nachtalb]
放弃对Plone 4.2的支持 [Nachtalb]
添加5.1兼容性说明 [Nachtalb]
3.1.0 (2018-06-19)
添加对Plone 5.1的支持 [cguardia, jone]
删除对ftw.testing[splinter]的依赖(已在ftw.testing中删除)。 [lgraf]
3.0.0 (2017-01-24)
放弃对Plone 4.1的支持。 [lknoepfel]
添加通过在日历上单击日期添加事件的功能。没有默认实现。产品必须为其事件类型实现它。 [lknoepfel]
检查事件上的编辑权限以启用拖放。 [lknoepfel]
修复了日期范围未应用的问题。 [lknoepfel]
2.1.2 (2016-11-17)
修复jQuery / Diazo问题:设置正确的响应头。 [jone]
为menuitem添加了德语翻译。 [lknoepfel]
2.1.1 (2015-10-23)
为新式Plone集合启用日历视图。 [mbaechtold]
2.1.0 (2015-04-30)
将日历源重构为适配器。 [lknoepfel]
改善标题和列标题中显示的日期的日期格式。 [mbaechtold]
2.0.0 (2013-11-04)
添加测试设置和一个基本测试。 [mathias.leimgruber]
Plone 4.3兼容性。 [mathias.leimgruber]
软件包清理(Readme.rst/History.txt/setup.py/.gitignore/license)。 [mathias.leimgruber]
以ISO8601格式传递日期到javascript,以便正确处理时区。 [davisagli]
1.15 (2012-01-27)
使日历与其他上下文一起工作,而不仅仅是集合。 [Julian Infanger]
为配置javascript设置mimetype头,使其与Diazo主题一起工作。 [22.06.2011, yomatters]
1.14
为ftwcalendar_view添加了类,因此可以在该类上注册视图小部件。 [22.06.2011, jinfanger]
添加了法语翻译。感谢Francois Hurter。 [22.03.2011, fsprenger]
确保链接颜色不会被sunburst样式覆盖 [20.06.2011, fsprenger]
1.13
修复GS结构(Types -> types和topic.xml -> Topic.xml并添加types.xml) [07.03.2011, mathias.leimgruber]
修复README.txt [thomasdesvenain]
1.12
更改德语语言的默认时间格式(显示H:mm)。 [14.02.2011, mathias.leimgruber]
对context.aq_inner调用queryCatalog以支持正确的ATRelativePathCriterion。 [14.02.2011, mathias.leimgruber]
在calendarupdateview上应用PEP8。 [14.02.2011, mathias.leimgruber]
1.11
更新fullcalendar到版本1.4.10。fullcalendar的变更日志可以在此处找到:http://arshaw.com/js/fullcalendar/changelog.txt [fsprenger]
修复配置中的js错误 [fsprenger]
使用zcml.condition修复与Plone 3的兼容性 [fsprenger]
确保一周的第一天选项使用Plone日历控制面板中的设置。 [yomatters]
在安装配置文件中更新产品描述。 [yomatters]
更改设置以使用Plone的正常i18n机制。 [yomatters]
改进了Plone 4上的Sunburst的默认样式。 [yomatters]
将拖放和调整大小参数作为JSON发送,以兼容jQuery 1.4。 [yomatters]
1.10
解决了先前版本中隐藏的osx文件问题 [fsprenger]
不要在JSRegistry中压缩fullcallendar.min.js [naro]
1.9
更新fullcalendar到版本1.4.8 [fsprenger]
1.8
添加了捷克语翻译 [naro]
添加了menuItem声明,以提供美观且可翻译的显示菜单项 [naro]
修复了zcml声明(添加了层) [naro]
添加了.po文件 [naro]
1.7
更新了用于公开发布的文档 [fsprenger]
1.6
将fullcalendar更新到版本1.4.6
1.5
如果当前语言没有翻译,则配置英语作为后备语言
添加了自定义CSS文件以覆盖fullcalendar.css中定义的样式
突出显示当前用户自己的事件
使用members.css中定义的样式来标记事件的状态
添加了对全天事件的全部支持
1.4
在日视图和周视图中启用了拖放功能
在日视图和周视图中启用了调整大小功能
1.3
移除了对jQuery插件集成的支持(原计划用于plone 2.5)
修复了查询中的错误,现在正确显示跨越几个月的事件
1.2
修复了时间格式并设置星期一开始为开始日期
1.1
移除了对不存在文件的引用
1.0
初始发布
项目详情
ftw.calendar-3.1.2.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | ec573c5a4d8f1e0eb16fe620e8a691cf910a3a6bff00f6f2cc0870769ccedfe5 |
|
MD5 | 7e4d615be8d29239e5b75125c20aec0b |
|
BLAKE2b-256 | ad0d9edf07d73a3f298acd2af916c662d2eede5cefdfec32f2d9248fabe3441f |