Ticket #3823 (closed Bug: fixed)
document_actions need to be more flexible
| Reported by: | spliter | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.1 |
| Component: | Templates/CSS | Version: | |
| Severity: | Keywords: | ||
| Cc: |
Description
Dimensions of the images in document_atcions are hardcoded in document_actions, so designer needs to alter that template if he uses images with the dimensions that differ. I suggest to replace the code (document_actions):
<img i18n:attributes="title" src="" alt="" title=""
height="16" width="16" tal:condition="icon" tal:attributes="src string:$portal_url/$icon;
title title; alt title" />
with the following:
<img i18n:attributes="title" src="" alt="" title=""
height="16" width="16" tal:condition="icon" tal:define="iconImage python:portal.restrictedTraverse(icon)" tal:attributes="src string:$portal_url/$icon;
title title; alt title; height iconImage/height; width iconImage/width" />

I've moved the height/width specification to cSS. This way you can customise the CSS if you need to. If you want *different* sizes of each image, you'll still have to customise the template, but that's a marginal enough usecase to warrant it. The advocated approach requires a restrictedTraverse() for each image, which is unnecessarily slow for something that'll say 16x16 in > 90% of the use cases anyway.
Martin