集合和文件夹的时间线视图(使用verite timelinejs)。

collective.timelines的Python项目详细描述


简介

这个包集成了Verite TimelineJS 应用于plone。提供美丽的、可定制的时间轴视图 用于文件夹和集合。

它为文件夹和新样式和旧样式添加视图timeline-view。 (attopic)集合(attopic)。

此外,它还添加了设置时间线日期的灵活行为。 应用于所有原型的内容和架构扩展程序 内容(使用普通日期字段的atevent除外)。

如果内容具有remoteurl(即和atlink),则该链接将是 用于生成页面的缩略图。特殊处理是 内置YouTube、Twitter、Wikipedia和Flickr链接 其他人。否则,页面url用于生成缩略图。

定制

原型和灵巧内容的默认适配器应该 处理大多数用例。但是,您可以自定义时间线 通过将适配器注册到 ITimelineContent和/或ITimelineSupplement接口。

例如,如果我想更改ifoo内容类型的资产url 我只需将以下内容添加到Grokked包中:

from five import grok
from collective.timelines.interfaces import ITimelineSupplement

class FooTimelineSupplement(grok.Adapter):
    grok.name('foo')
    grok.context(IFoo)
    grok.provides(ITimelineSupplement)

    def update(self, data):
        data['asset']['media'] = self.context.my_url
        return data

有一个时间线补充的例子在 映射支持模块,它使用来自Products.Mapsenabled的元数据 在时间线中显示地图的内容。

重写日期计算以使用自定义日期,或 完全更改基础数据,可以重写ITimelinecontent 适配器:

from five import grok
from DateTime import DateTime
from collective.timelines.interfaces import ITimelineContent
from collective.timelines.dexterity_content import TimeLineContent

class FooTimelineContent(TimelineContent):
    grok.provides(ITimelineContent)
    grok.context(IFoo)

    def date(self):
        date = self.context.my_date
        return DateTime(date.year, date.month, date.day)

    def data(self):
        # Calculate custom dictionary for timeline date entry

中有一个自定义ITimelineContent数据提供程序的示例 at_内容模块,通过自动 使用开始和结束日期。

更改日志

1.0dev(未发布)

  • 初始版本

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
添加组件后,java JTable为空   java将json发送到php并插入mysql,但返回null   java Spring引导JNDI CommonJ资源   从不同PC创建和合并后的Java servlet问题   java如何在使用findelements时从xpath获取文本   java使用spring boot使用gmail smtp发送电子邮件   java在不使用pojo、bean或getter和setter的情况下获取Json标题的Json数组   Java中的OpenFile对话框将null作为响应   JavaBuilder模式。扩展接口   java中无需替换的数据结构选取   java如何评价Encog中的预测神经网络   java如何在安卓中使用实际的HttpURLConnection进行单元测试?   java使用XML配置禁用WebSocket中的CSRF保护   java如何通过hibernate从多表查询中获取数据?   mysql如何在java中获取更新的行Id   java AEM/CQ组件单一组件/有限组件   java FFmpeg Javacv延迟问题   显示整数数组的java不起作用