src/pyams_zodbbrowser/zmi/templates/zodbinfo.pt
changeset 0 a02202f95e2c
child 9 084d3778c025
equal deleted inserted replaced
-1:000000000000 0:a02202f95e2c
       
     1 <div class="zodbbrowser"
       
     2 	 data-ams-plugins="zodbbrowser"
       
     3 	 data-ams-plugin-zodbbrowser-src="/--static--/pyams_zodbbrowser/js/zodbbrowser.js"
       
     4 	 data-ams-plugin-zodbbrowser-css="/--static--/pyams_zodbbrowser/css/zodbbrowser.css"
       
     5 	 data-ams-plugin-zodbbrowser-callback="PyAMS_zodbbrowser.init">
       
     6 	<div class="heading">
       
     7 		<h1 id="path">
       
     8 			<span class="breadcrumbs" tal:content="structure view.getBreadcrumbsHTML()" />
       
     9 		</h1>
       
    10 
       
    11 		<h1 id="goto" style="display:none">
       
    12 			<input type="text" class="goto" id="gotoInput" name="goto"
       
    13 					tal:attributes="value view.getPath()"/>
       
    14 		</h1>
       
    15 		<span id="pathError" style="display:none"></span>
       
    16 		<span class="pickleSize"> <span tal:replace="view.getPickleSize()" /> bytes pickled</span>
       
    17 
       
    18 		<h2 class="type" tal:content="view.getObjectType()" />
       
    19 
       
    20 		<div class="tid-info" tal:condition="not:view.latest">
       
    21 			at <a tal:attributes="href string:#zodbbrowser_history?tid=${view.getStateTid()}"
       
    22 				tal:content="view.getStateTidNice()"></a>
       
    23 			<tal:span tal:content="string:(last change before or at ${view.getRequestedTidNice()})"/>
       
    24 		</div>
       
    25 	</div>
       
    26 
       
    27 	<div class="attributes"
       
    28 			tal:define="attributes view.listAttributes();
       
    29 					error view.state.getError()"
       
    30 			tal:condition="python:attributes is not None or error">
       
    31 		<h3 class="expander">
       
    32 			<img src="/--static--/pyams_zodbbrowser/img/collapse.png"
       
    33 				 alt="collapse" />&nbsp;Attributes
       
    34 		</h3>
       
    35 
       
    36 		<div class="collapsible">
       
    37 			<tal:block tal:condition="error">
       
    38 				<div class="error" tal:condition="error">
       
    39 					Could not load the object:
       
    40 					<span tal:replace="error" />
       
    41 				</div>
       
    42 			</tal:block>
       
    43 			<tal:block tal:condition="not:attributes">
       
    44 				<span tal:condition="not:error" class="empty">There are none.</span>
       
    45 			</tal:block>
       
    46 			<tal:block tal:condition="attributes">
       
    47 				<tal:block tal:repeat="attr attributes">
       
    48 					<input type="checkbox" class="filter" checked="checked"
       
    49 						   onchange="PyAMS_zodbbrowser.filterHistory()"
       
    50 							tal:attributes="name string:${attr.name}"/>
       
    51 					<span class="attr">
       
    52 						<strong tal:content="attr.name" />:
       
    53 						<tal:block replace="structure attr.rendered_value()" />
       
    54 					</span>
       
    55 					<br />
       
    56 				</tal:block>
       
    57 				<div class="buttons">
       
    58 					<a class="jsbutton" href="javascript:PyAMS_zodbbrowser.filterAll()"
       
    59 							>show all</a>
       
    60 					<a class="jsbutton" href="javascript:PyAMS_zodbbrowser.filterNone()"
       
    61 							>hide all</a>
       
    62 				</div>
       
    63 			</tal:block>
       
    64 		</div>
       
    65 	</div>
       
    66 
       
    67 	<div class="items"
       
    68 			tal:define="items view.listItems()"
       
    69 			tal:condition="python:items is not None">
       
    70 		<h3 class="expander">
       
    71 			<img src="/--static--/pyams_zodbbrowser/img/collapse.png"
       
    72 				 alt="collapse" />&nbsp;Items (<span tal:replace="python: len(items)"></span>)
       
    73 		</h3>
       
    74 
       
    75 		<div class="collapsible">
       
    76 			<tal:block tal:condition="not:items">
       
    77 				<span class="empty">There are none.</span>
       
    78 			</tal:block>
       
    79 			<tal:block tal:repeat="item items">
       
    80 				<strong tal:content="item.name" />:
       
    81 				<tal:block replace="structure item.rendered_value()" />
       
    82 				<br />
       
    83 			</tal:block>
       
    84 		</div>
       
    85 	</div>
       
    86 
       
    87 	<div class="history"
       
    88 			tal:define="history view.listHistory()"
       
    89 			tal:condition="history">
       
    90 		<h3 class="expander">
       
    91 			<img src="/--static--/pyams_zodbbrowser/img/collapse.png"
       
    92 				 alt="collapse" />&nbsp;History
       
    93 		</h3>
       
    94 
       
    95 		<div class="collapsible">
       
    96 			<div tal:attributes="class python:view.getRequestedTid() and 'none' or 'latest'">
       
    97 				<h4 class="transaction">
       
    98 					<a class="title" tal:attributes="href string:#zodbbrowser?oid=${view.getObjectIdHex()}"
       
    99 							>Latest</a>
       
   100 				</h4>
       
   101 			</div>
       
   102 			<div class="transaction" tal:repeat="history history"
       
   103 					tal:attributes="class python:(history['current'] or repeat['history'].start() and not view.getRequestedTid())
       
   104 					and 'transaction current' or 'transaction'">
       
   105 				<h4 class="transaction" tal:attributes="id string:tid${history.utid}">
       
   106 					<a class="subtitle"
       
   107 							tal:attributes="href string:#zodbbrowser_history?tid=${history.utid}">view transaction
       
   108 						record</a>
       
   109 					<a class="title" tal:attributes="href history.href">
       
   110 						#<span tal:replace="history.index" />:
       
   111 						<span class="timestamp" tal:content="string:${history.utc_timestamp}" title="UTC" />
       
   112             <span class="user" tal:content="history.user_id"
       
   113 					tal:attributes="title string:user from site ${history.user_location}" />
       
   114             <span class="location" tal:content="history.location|nothing"
       
   115 					tal:attributes="title string:request type ${history.request_type|nothing}" />
       
   116 						<span class="description" tal:content="history.description" />
       
   117 					</a>
       
   118 				</h4>
       
   119 
       
   120 				<div class="toolbox" tal:condition="python: not repeat['history'].start() and not view.readonly">
       
   121 					<form action="zodbbrowser" class="rollback" method="post" data-async>
       
   122 						<input type="hidden" name="oid" tal:attributes="value view.getObjectId()" />
       
   123 						<input type="hidden" name="tid" tal:attributes="value view.getRequestedTid()" />
       
   124 						<input type="hidden" name="rtid" tal:attributes="value history.utid" />
       
   125 						<input type="hidden" name="confirmed" value="0" />
       
   126 						<input type="hidden" name="ROLLBACK" value="" />
       
   127 						<input type="submit" class="rollbackbtn" value="Revert to this state" />
       
   128 					</form>
       
   129 				</div>
       
   130 				<div class="error" tal:condition="history.error">
       
   131 					Could not load historical state:
       
   132 					<span tal:replace="history.error" />
       
   133 				</div>
       
   134 				<div class="diff" tal:replace="structure history.diff">
       
   135 				</div>
       
   136 			</div>
       
   137 		</div>
       
   138 	</div>
       
   139 </div>
       
   140 <img id="collapseImg" style="display:none" alt=""
       
   141      src="/--static--/pyams_zodbbrowser/img/collapse.png" />
       
   142 <img id="expandImg" style="display:none" alt=""
       
   143      src="/--static--/pyams_zodbbrowser/img/expand.png" />