src/pyams_zodbbrowser/zmi/templates/zodbhistory.pt
changeset 0 a02202f95e2c
child 9 084d3778c025
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_zodbbrowser/zmi/templates/zodbhistory.pt	Wed Mar 11 12:27:00 2015 +0100
@@ -0,0 +1,78 @@
+<div class="zodbbrowser"
+	 data-ams-plugins="zodbbrowser"
+	 data-ams-plugin-zodbbrowser-src="/--static--/pyams_zodbbrowser/js/zodbbrowser.js"
+	 data-ams-plugin-zodbbrowser-css="/--static--/pyams_zodbbrowser/css/zodbbrowser.css">
+	<div class="heading">
+		<h1 id="path">
+			ZODB transactions
+		</h1>
+
+		<h1 id="goto" style="display:none">
+			<input type="hidden" id="api" name="api" value="#zodbbrowser_path_to_oid" />
+			<input type="text" class="goto" id="gotoInput" name="goto" />
+		</h1>
+		<span id="pathError" style="display:none"></span>
+	</div>
+
+	<div class="history">
+		<div tal:condition="python: view.page > 0">
+			<h4 class="paging transaction" tal:define="prev_page python:view.page - 1">
+				<a class="title" tal:attributes="href string:#zodbbrowser_history?page=${prev_page}">Newer</a>
+			</h4>
+		</div>
+		<div tal:condition="python: view.page == 0"
+				tal:attributes="class python:'tid' in request.params and 'none' or 'latest'">
+			<h4 class="transaction">
+				<a class="title" href="#zodbbrowser_history">Latest</a>
+			</h4>
+		</div>
+		<div class="transaction" tal:repeat="history view.listHistory()"
+				tal:attributes="class python:history['current']
+				and 'transaction current' or 'transaction'">
+			<h4 class="transaction" tal:attributes="id string:tid${history.utid}">
+				<a class="title" tal:attributes="href history.href">
+					#<span tal:replace="history.index" />:
+					<span class="timestamp" tal:content="string:${history.utc_timestamp}" title="UTC" />
+					<span class="user" tal:content="history.user_id"
+							tal:attributes="title string:user from site ${history.user_location}" />
+					<span class="location" tal:content="history.location|nothing"
+				  			tal:attributes="title string:request type ${history.request_type|nothing}" />
+					<span class="description" tal:content="history.description" />
+				</a>
+			</h4>
+
+			<div class="diff">
+				<h5 class="expander">
+					<img src="/--static--/pyams_zodbbrowser/img/collapse.png"
+						 alt="collapse"
+							tal:condition="not:history.hidden"
+							/><img src="/--static--/pyams_zodbbrowser/img/expand.png"
+								   alt="expand"
+						tal:condition="history.hidden"
+						/>&nbsp;<span tal:replace="history.summary">N objects saved</span>
+				</h5>
+
+				<div class="collapsible"
+						tal:attributes="style python: history['hidden'] and 'display: none' or None">
+					<ol>
+						<li tal:repeat="obj history.objects">
+							<a tal:attributes="href obj.url" tal:content="obj.path">/(path)</a>
+							<span tal:replace="obj.class_repr" />
+							<a tal:attributes="href obj.url" tal:content="structure obj.repr">(obj)</a>
+						</li>
+					</ol>
+				</div>
+			</div>
+		</div>
+		<div tal:condition="python: view.page < view.last_page">
+			<h4 class="paging transaction" tal:define="next_page python:view.page + 1">
+				<a class="title" tal:attributes="href string:#zodbbrowser_history?page=${next_page}">Older</a>
+			</h4>
+		</div>
+	</div>
+
+</div>
+<img id="collapseImg" style="display:none" alt=""
+     src="/--static--/pyams_zodbbrowser/img/collapse.png" />
+<img id="expandImg" style="display:none" alt=""
+     src="/--static--/pyams_zodbbrowser/img/expand.png" />