Skip to content

Commit

Permalink
improved spacing of objectItems list, object selection, locked icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr. Frank Hoffmann authored and dwt committed Jun 12, 2018
1 parent 7941e51 commit f000b75
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/App/dtml/manage_tabs.dtml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<i class="&dtml-zmi_icon;" title="&dtml-meta_type;"></i>
<strong>&dtml-title;</strong>
<dtml-if wl_isLocked>
<span class="badge badge-warning">Locked</span>
<span class="badge badge-warning" title="Locked"><i class="fa fa-lock"></i></span>
</dtml-if wl_isLocked>
</span>
<dtml-else>
Expand Down
8 changes: 8 additions & 0 deletions src/OFS/ObjectManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,14 @@ def computeSize(self, ob):
pass
return ''

security.declareProtected(access_contents_information, 'last_modified')
def last_modified(self, ob):
try:
return DateTime(ob._p_mtime).strftime("%Y-%m-%d %H:%M")
except:
pass
return ''


# Don't InitializeClass, there is a specific __class_init__ on ObjectManager
# InitializeClass(ObjectManager)
Expand Down
2 changes: 1 addition & 1 deletion src/OFS/dtml/documentEdit.dtml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ the <em>browse</em> button to select a local file to upload.
<div class="zmi-controls">
<dtml-if wl_isLocked>
<input class="btn btn-primary disabled" type="submit" name="submit" value="Save Changes" disabled="disabled" />
<span class="badge badge-warning">Locked</span>
<span class="badge badge-warning" title="Locked"><i class="fa fa-lock"></i></span>
<dtml-else>
<input class="btn btn-primary" type="submit" name="submit" value="Save Changes" />
</dtml-if>
Expand Down
17 changes: 9 additions & 8 deletions src/OFS/dtml/fileEdit.dtml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ text type and small enough to be edited in a text area.
</dtml-if>
</dtml-let>

<div class="controls">
<div class="zmi-controls">
<dtml-if wl_isLocked>
<em>Locked</em>
<input class="btn btn-primary disabled" type="submit" name="manage_edit:method" value="Save Changes" disabled="disabled" />
<span class="badge badge-warning" title="Locked"><i class="fa fa-lock"></i></span>
<dtml-else>
<input class="btn btn-primary" type="submit" name="manage_edit:method"
value="Save Changes">
<input class="btn btn-primary" type="submit" name="manage_edit:method" value="Save Changes" />
</dtml-if>
</div>

Expand All @@ -78,14 +78,15 @@ text type and small enough to be edited in a text area.
</div>
</div>

<div class="controls">
<div class="zmi-controls">
<dtml-if wl_isLocked>
<em>Locked</em>
<input class="btn btn-primary disabled" type="submit" name="manage_upload:method" value="Upload" disabled="disabled" />
<span class="badge badge-warning" title="Locked"><i class="fa fa-lock"></i></span>
<dtml-else>
<input class="btn btn-primary" type="submit" name="manage_upload:method"
value="Upload">
<input class="btn btn-primary" type="submit" name="manage_upload:method" value="Upload" />
</dtml-if>
</div>

</form>

</main>
Expand Down
2 changes: 1 addition & 1 deletion src/OFS/dtml/findForm.dtml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
</dtml-if>


<ul class="zmi-find-results list-group">
<ul class="zmi-find-results list-group mb-5">
<dtml-in results size="batch_size" start="query_start" sort_expr="skey" reverse_expr="rkey">
<li class="list-group-item">
<a href="&dtml.url_quote-sequence-key;/manage_workspace">&dtml-sequence-key;
Expand Down
58 changes: 43 additions & 15 deletions src/OFS/zpt/main.zpt
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,33 @@
<input type="checkbox" id="checkAll"
onclick="(function() {
var checkboxes = document.getElementsByClassName('checkbox-list-item');
// Toggle Highlighting CSS-Class
if ( document.getElementById('checkAll').checked ) {
$('table.objectItems tbody tr').addClass('checked');
} else {
$('table.objectItems tbody tr').removeClass('checked');
};
// Set Checkbox like checkAll-Box
for (i = 0; i < checkboxes.length; i++){
checkboxes[i].checked = document.getElementById('checkAll').checked;
}})()">
</th>
<th scope="col" class="zmi-object-type">Type</th>
<th scope="col" class="zmi-object-id">Id</th>
<th scope="col" class="zmi-object-title hidden-xs">Title</th>
<th scope="col" class="zmi-object-id" title="Name and (Title)">Name</th>
<th scope="col" class="zmi-object-size text-right hidden-xs">Size</th>
<th scope="col" class="zmi-object-date text-right hidden-xs">Last Modified</th>
</tr>
</thead>
<tbody>
<tr tal:repeat="id ids">
<tal:ob define="ob python:here.get(id)">
<td class="zmi-object-check text-right"
onclick="$(this).children('input').trigger('click')">
onclick="$(this).children('input').trigger('click');">
<input type="checkbox"
class="checkbox-list-item"
name="ids:list"
tal:attributes="value id"
onclick="event.stopPropagation()"
onclick="event.stopPropagation();$(this).parent().parent().toggleClass('checked');"
/>
</td>
<td class="zmi-object-type"
Expand All @@ -74,21 +81,24 @@
</i>
</td>
<td class="zmi-object-id">
<a tal:attributes="href string:${id}/manage_workspace"
tal:content="id">Id</a>
<span class="badge badge-warning"
tal:condition="ob/wl_isLocked | nothing">
Locked
<a tal:attributes="href string:${id}/manage_workspace">
<span tal:replace="id">Id</span>
<span class="badge badge-warning" title="Locked"
tal:condition="ob/wl_isLocked | nothing">
<i class="fa fa-lock"></i>
</span>
<span class="zmi-object-title hidden-xs"
tal:condition="ob/title|nothing">
&nbsp;(<span tal:replace="ob/title"></span>)
</span>
</a>
</td>
<td class="zmi-object-title hidden-xs">
<a tal:condition="ob/title|nothing"
tal:attributes="href string:${id}/manage_workspace"
tal:content="ob/title">Title</a>
</td>
<td class="text-right zmi-object hidden-xs"
<td class="text-right zmi-object-size hidden-xs"
tal:content="python:here.computeSize(ob)">
</td>
<td class="text-right zmi-object-date hidden-xs pl-3"
tal:content="python:here.last_modified(ob)">
</td>
</tal:ob>
</tr>
</tbody>
Expand Down Expand Up @@ -153,4 +163,22 @@
</tal:empty>
</form>
</main>


<script type="text/javascript">
<!--
$(function() {
$('td.zmi-object-type i').tooltip({'placement':'top'});

$('#tablefilter').keyup( function (e) {
var tablefilter = $(this).val();
console.log('You pressed ' + tablefilter);
$('table').find("tr.list-item").hide();
$('table').find("tr.list-item td.main-title a:contains(" + tablefilter+ ")").closest('tr.list-item').show();
});
$(document).keypress(function() {$('#tablefilter').focus()})
});
//-->
</script>

<tal:footer replace="structure here/manage_page_footer" />

0 comments on commit f000b75

Please sign in to comment.