跳转到主要内容

Imio历史

项目描述

https://github.com/IMIO/imio.history/actions/workflows/main.yml/badge.svg?branch=master https://coveralls.io/repos/IMIO/imio.history/badge.svg PyPI badge

imio.history

使用表格管理对象历史,并在必要时突出显示历史链接

目标是能够管理内容上的多个历史记录以满足不同的需求,并一起显示它们,合并到同一个视图中。

实现IImioHistory接口的适配器

为此,我们必须确保历史记录使用相同的结构。我们基于workflow_history进行工作,尽管自定义历史记录可能需要额外的键。

workflow_history可能看起来像

{'my_custom_workflow': (
    {'action': None, 'review_state': 'private', 'actor': 'user_id1',
    'comments': '', 'time': DateTime('2018/03/27 09:51:55.303708 GMT+2')},
    {'action': 'publish', 'review_state': 'published',
    'comments': '', 'actor': 'user_id1', 'time': DateTime('2018/03/29 15:35:24.646745 GMT+2')},
    {'action': 'retract', 'review_state': 'private',
    'comments': 'My comments', 'actor': 'admin', 'time': DateTime('2018/03/29 15:35:27.246169 GMT+2')})}

通过实现IImioHistory接口的命名适配器提供历史记录。

默认情况下,提供了对workflow_history (ImioWfHistoryAdapter) 和修订历史记录 (ImioRevisionHistoryAdapter) 的适配器。

@@historyview

@@historyview将以表格的形式显示历史记录,每个信息都在一列中:操作、作者、日期/时间、评论。

您在视图的histories_to_handle属性中定义了应该显示哪些历史记录(命名适配器)。

由于使用相同的结构,所有历史记录都按时间键排序。

翻译

此产品已被翻译成

  • 法语。

  • 西班牙语。

您可以为我们提供任何缺失的消息或其他新语言的贡献,加入我们,在 PloneGov iMiO 团队,在 Transifex.net 服务中与全球 Plone 翻译者社区一起。

贡献者

变更日志

1.36 (2024-09-25)

  • utils.get_all_history_attr 添加到 safe_utils 中。[gbastien]

1.35 (2024-06-07)

  • 将事件评论的翻译移动到子方法 IHContentHistoryView._translate_comments 中,以便更容易覆盖。[gbastien]

1.34 (2024-04-10)

  • utils.getPreviousEvent 适配以添加参数 history_name='workflow'。[gbastien]

  • 修复了 @@contenthistory 视图中 HISTORY_COMMENT_NOT_VIEWABLE 的显示,显示为文本,显示 HTML 代码。[gbastien]

1.33 (2023-12-11)

  • 添加了 utils.add_event_to_wf_history 以将事件插入到元素的 workflow_history 中。[gbastien]

1.32 (2023-11-27)

  • IHDocumentBylineViewlet 中,如果 show_historyFalse,则不显示创建者,因为创建者是历史的一部分。[gbastien]

  • @@historyview 中,在“历史”标题下显示 @@header 视图,默认情况下将显示上下文的 prettylink,这在从包含大量元素的仪表板显示历史时很有用。添加了对 imio.prettylink 的直接依赖。[gbastien]

1.31 (2023-10-27)

  • utils.getLastAction 添加了参数 ignore_previous_event_actions=[],这样在查找历史中的最后操作时,它将检查之前的事件操作,并在它是要忽略的操作时继续。[gbastien]

1.30 (2023-09-21)

  • 添加了 utils.get_event_by_time,它将根据给定的浮点事件时间返回一个历史事件。[gbastien]

  • 正式化了对 EventPreviewView.may_view_historized_data 的使用。[gbastien]

1.29 (2023-06-27)

  • 通过传递原始 mimetype='text/plain' 来使 IHContentHistoryView.renderComments 更健壮,以避免 portal_transforms 自动检测它,这可能导致错误的检测。[gbastien]

1.28 (2023-02-27)

  • @@contenthistory 视图中添加了在评论下显示事件预览的可能性。[gbastien]

  • 使 highlight_last_comment 功能更通用,它之前只用于 WF 历史,但现在任何历史都可以设置 highlight_last_comment=True。[gbastien]

1.27 (2022-06-14)

  • 添加了 safe_utils.py,它将只包含安全工具。[gbastien]

1.26 (2022-03-08)

  • 修复了 @@historyview 中演员全名的显示。[gbastien]

1.25 (2022-03-07)

  • 优化了 @@contenthistory 视图。[gbastien]

1.24 (2022-02-25)

  • content_history 模板中,只修复日期列宽度,对于其他列,让浏览器优化它。[gbastien]

1.23 (2021-04-21)

  • 添加 Transifex.net 服务集成以管理翻译过程。[macagua]

  • 添加西班牙语翻译。[macagua]

1.22 (2021-03-04)

  • utils.getLastAction 中参数 checkMayViewEvent=FalsecheckMayViewComment=False 的默认值更改为 False,这样,即使当前用户可能没有,我们也能获取到最后操作,并且速度更快。这修复了在 ImioWfHistoryAdapter.historyLastEventHasComments 被多次调用时出现的性能问题。[gbastien]

  • utils.getLastAction 中,参数 action 可以为 before_last,并且如果存在,将返回上一个操作。[gbastien]

1.21 (2020-10-26)

  • 添加了辅助函数 utils.get_all_history_attr 以获取给定 attr_namehistory 中的每个出现。例如,这将返回来自 workflow 历史中的每个 review_state。[gbastien]

1.20 (2020-10-01)

  • utils.getLastWFAction 添加了参数 checkMayViewEvent=FalsecheckMayViewComment=False,这样,即使当前用户可能没有,我们也能获取到最后 WF 操作,并且速度更快。[gbastien]

1.19 (2019-10-01)

  • 允许从受限制的 Python(TAL 表达式)访问模块 utils。[gbastien]

1.18 (2019-01-11)

  • 由于 ImioWfHistoryAdapter.ignorableHistoryComments 应返回一个 unicode 列表,我们在 ImioWfHistoryAdapter.historyLastEventHasComments 中强制执行 unicode 比较,这样我们就可以避免在 Zope 日志中发出警告。[gbastien]

  • 对导入进行 isort。[gbastien]

  • 添加了辅助函数 utils.getLastWFAction,它实际上是使用 IImioHistory 'workflow' 适配器的 utils.getLastAction 的快捷方式。[gbastien]

1.17 (2018-03-19)

  • 分解 show_history 功能。现在该方法定义在 IHContentHistoryView 上,并由 IHDocumentBylineViewlet.show_history@@historyview 使用。这样,我们确保如果链接在视图中未显示,则在用户手动在浏览器中输入视图名称时,@@historyview 中不会显示历史记录。[gbastien]

1.16 (2018-02-22)

  • BaseImioHistoryAdapter.get_history_dataBaseImioHistoryAdapter.getHistory 上使用 @memoize 以避免在适配器未更改时重新计算。这对于 highlight_history_link 功能很有用。[gbastien]

  • utils.getLastAction 现在接收一个 IImioHistory 适配器作为第一个参数,而不是 obj 和适配器名称。[gbastien]

1.15 (2018-02-09)

  • 添加了属性 ImioWfHistoryAdapter.include_previous_review_state,默认值为 False。如果设置为 True,则返回的历史记录将包括 previous_review_state。[gbastien]

1.14 (2018-01-23)

  • 重构了代码,使其易于处理无历史记录的情况。[gbastien]

  • 如果 obj 没有工作流,不要调用工作流历史特定方法。[gbastien]

  • IHContentHistoryView.renderComments 现在接收整个事件作为参数,而不仅仅是评论,因此它将事件的不同值作为映射传递给翻译方法,以便在翻译评论中使用。[gbastien]

  • 添加了 IHContentHistoryView.renderCustomJS,以便在加载 @@historyview 时注入自定义 JS,特别是因为它作为覆盖加载。[gbastien]

  • 添加了辅助函数 utils.add_event_to_history,该函数将事件添加到历史记录中,同时遵守所需的最小数据。[gbastien]

  • 添加了 BaseImioHistoryAdapter.mayViewEvent 方法,当参数 checkMayViewEvent=True 时使用,它默认返回 True,但被设计为可覆盖的,如果返回 False,则整个事件不会在 @@historyview 中显示。[gbastien]

1.13 (2017-12-07)

  • utils.getLastAction 中,如果历史记录为空,不要中断,并添加了测试。[gbastien]

1.12 (2017-11-30)

  • 定义一个 BaseImioHistoryAdapter 作为新历史适配器的基础。checkMayView=True 现在是 getHistory 的默认参数。[gbastien]

  • 目前,特别限制在 @@historyview 中显示的历史记录为 workflowrevision。[gbastien]

  • 添加了方法 utils.getLastAction,它返回给定名称的给定历史记录的最后操作的元数据。[gbastien]

1.11 (2017-06-23)

  • 将历史记录单词高亮显示调整为更大和下划线,以便更容易查看。[gbastien]

1.10 (2017-06-14)

  • ImioWfHistoryAdapter.historyLastEventHasComments 中,使用参数 ‘for_last_event=True’ 调用 ImioWfHistoryAdapter.getHistory,以便 getHistory 知道它只查询相关最后事件,并且在覆盖时,覆盖它的包可以避免不必要的处理。[gbastien]

  • 移除 unittest2。[gbastien]

1.9 (2016-10-12)

  • 如果 transitionName 包含特殊字符,不要在 IHContentHistoryView.getTransitionTitle 中中断。[gbastien]

1.8 (2015-10-06)

  • 确保通过使用 portal_transforms 将其转换为 ‘text/html’ 在显示之前正确显示评论,使用 PageTemplate 的 ‘structure’。[gbastien]

1.7 (2015-09-28)

  • 在未使用时删除修订列。[DieKatze]

  • 在 ImioRevisionHistoryAdapter.getHistory 中,通过实现一个 ‘mayViewRevision’ 方法考虑参数 ‘checkMayView’,以便在必要时可以限制对特定修订的访问。[gbastien]

1.6 (2015-09-10)

  • 添加了 @@history-version-preview 视图,默认情况下在 content_history 中调用,但它不渲染任何内容。它被设计为注册相关的内容类型,以便可以直接在历史弹出窗口中显示版本化对象的预览。[gbastien]

1.5 (2015-07-14)

  • 添加了修订历史管理。[cedricmessiant]

1.4 (2015-04-15)

  • 添加了辅助方法 ‘utils.getPreviousEvent’,它将接收一个事件作为参数,如果找到,则返回 workflow_history 中的先前事件。[gbastien]

1.3 (2015-04-15)

  • 不要在 ImioHistoryAdapter.getHistory 中反转工作流历史,因为它用于显示目的,在 IHContentHistoryView.getHistory 中进行此操作。[gbastien]

  • 已向ImioHistoryAdapter.getHistory添加参数‘checkMayView’,以便在获取workflow_history时启用/禁用mayViewComment检查[gbastien]

1.2 (2015-04-01)

  • 在getHistory中采取防御性措施,如果未使用工作流程或元素没有workflow_history属性,则不失败[gbastien]

1.1 (2015-03-31)

  • 注册翻译[gbastien]

1.0 (2015-03-30)

  • 初始发布

项目详情


下载文件

下载您平台所需的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源代码分布

imio.history-1.36.tar.gz (38.4 kB 查看散列值)

上传时间 源代码

由以下组织支持