Skip to content

Commit

Permalink
Merge pull request #49 from plone/table_for_historyview
Browse files Browse the repository at this point in the history
Moved historyRecords in @@HistoryView into a table
  • Loading branch information
agitator committed Jul 17, 2015
2 parents f8c1209 + 06a7f43 commit de71c9d
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 44 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Changelog
2.5.8 (unreleased)
------------------

- Moved historyRecords in @@historyview into a table
[agitator]

- Combine viewlets used in the IToolbar viewlet manager, merge, reorder
items so they make more sense
[vangheem]
Expand Down
114 changes: 70 additions & 44 deletions plone/app/layout/viewlets/content_history.pt
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,93 @@
tal:define="history view/fullHistory;"
tal:omit-tag="">
<div tal:condition="not: history">—</div>
<ol id="history-list" tal:condition="history">
<li tal:repeat="item history" class="historyRecord">

<table class="listing" id="history-list" tal:condition="history"
summary="Content listing"
i18n:attributes="summary summary_content_listing;">
<tbody>
<tr class="odd">
<th class="nosort"
i18n:translate="">What</th>
<th class="nosort"
i18n:translate="">View</th>
<th class="nosort" colspan="2"
i18n:translate="">Compare</th>
<th class="nosort"
i18n:translate="">Revert</th>
</tr>
<tr tal:repeat="item history" class="historyRecord">
<tal:historyItem
define="rhComments item/comments|nothing;
actor item/actor;
actor_name python:actor and actor.get('fullname','username') or item['actorid'];
actor_home item/actor_home;
action item/transition_title;
action_id python:item['action'] or item['review_state'];
effective item/effective_date|nothing;
effectiveDate python:effective and view.toLocalizedTime(item['effective_date'],long_format=True);
isVersion python:item['type']=='versioning'">
<span class="historyByLine">
<tal:action i18n:translate="history_action">
<span class="historyAction" tal:content="action" i18n:translate="" i18n:name="action"
define="rhComments item/comments|nothing;
actor item/actor;
actor_name python:actor and actor.get('fullname','username') or item['actorid'];
actor_home item/actor_home;
action item/transition_title;
action_id python:item['action'] or item['review_state'];
effective item/effective_date|nothing;
effectiveDate python:effective and view.toLocalizedTime(item['effective_date'],long_format=True);
isVersion python:item['type']=='versioning'">
<td>
<span class="historyByLine">
<tal:action i18n:translate="history_action">
<span class="historyAction" tal:content="action" i18n:translate="" i18n:name="action"
tal:attributes="class string:historyAction state-${action_id}"/>
<tal:actor i18n:name="actor">
<tal:actor i18n:name="actor">
<a href=""
tal:condition="actor_home"
tal:attributes="href actor_home"
tal:content="actor_name"> runyaga </a>
<span tal:condition="not: actor_home"
tal:replace="actor_name"/>
</tal:actor>
on
<span i18n:translate="" i18n:name="time" tal:content="python:view.toLocalizedTime(item['time'],long_format=True)" class="pat-moment" data-pat-moment="format:relative;"/>
</tal:action>
<tal:effective tal:condition="effective|nothing">
(<span i18n:translate="label_publishing_effective" tal:omit-tag="">effective</span>:
<span tal:content="python:item['effective']" class="pat-moment" data-pat-moment="format:relative;" />)
</tal:effective>

</span>
</tal:actor>
on
<span i18n:translate="" i18n:name="time" tal:content="python:view.toLocalizedTime(item['time'],long_format=True)" class="pat-moment" data-pat-moment="format:relative;"/>
</tal:action>
<tal:effective tal:condition="effective|nothing">
(<span i18n:translate="label_publishing_effective" tal:omit-tag="">effective</span>:
<span tal:content="python:item['effective']" class="pat-moment" data-pat-moment="format:relative;" />)
</tal:effective>

<span class="historyLinks" tal:condition="isVersion">
<a class="context" href=""
tal:attributes="href item/preview_url"
i18n:translate="title_view_revision">View</a>
<a class="standalone" href="" tal:attributes="href item/diff_current_url"
tal:condition="exists:item/diff_current_url"
i18n:translate="title_compare_revision">Compare to current</a>
</span>
<a class="historyComparePrevious standalone" tal:condition="exists:item/diff_previous_url"
</span>
<p i18n:translate="" tal:content="rhComments" tal:condition="rhComments" class="historyComment discreet" />
</td>
<td>
<span class="historyLinks" tal:condition="isVersion">
<a class="context" href=""
tal:attributes="href item/preview_url"
i18n:translate="title_view_revision">View</a>
</span>
</td>
<td>
<span class="historyLinks" tal:condition="isVersion">
<a class="standalone" href="" tal:attributes="href item/diff_current_url"
tal:condition="exists:item/diff_current_url">
<span>&#x2912; <span i18n:translate="title_compare_revision">Compare to current</span></span>
</a>
</span>
</td>
<td>
<a class="historyComparePrevious standalone" tal:condition="exists:item/diff_previous_url"
tal:attributes="href item/diff_previous_url"
title="Compare with previous revision"
i18n:attributes="title title_compare_previous_revision">
<span>&#x021C5; <span i18n:translate="label_compare" tal:omit-tag="">Compare</span></span>
</a>
<span class="historyTools" tal:condition="isVersion">
<span>&#x2193; <span i18n:translate="label_compare" tal:omit-tag="">Compare</span></span>
</a>
</td>
<td>
<span class="historyTools" tal:condition="isVersion">
<form action="" method="post" tal:condition="item/revert_url" tal:attributes="action item/revert_url">
<input type="hidden" name="version_id" value="" tal:attributes="value item/version_id" />
<input class="destructive" type="submit" i18n:attributes="value title_revert_revision"
tal:condition="exists:item/diff_current_url"
value="Revert to this revision" />
</form>
</span>
<p i18n:translate="" tal:content="rhComments" tal:condition="rhComments" class="historyComment discreet" />

</span>
</td>
</tal:historyItem>
</tr>
</tbody>
</table>

</tal:historyItem>
</li>
</ol>
</div>

0 comments on commit de71c9d

Please sign in to comment.