Add width/height attributes to the default logo.

This commit is contained in:
Max Goodman
2011-09-23 00:35:46 -07:00
parent e20fdfb06e
commit 310d276469
2 changed files with 11 additions and 4 deletions

View File

@@ -34,14 +34,21 @@
<div id="header-bottom-${'right' if c.lang_rtl else 'left'}">
<%
header_title = c.site.header_title
d = DefaultSR()
if c.site.header and c.allow_styles:
header_img = c.site.header
else:
d = DefaultSR()
header_img = d.header
header_title = d.header_title
if header_img == d.header:
header_img_width, header_img_height = 120, 40
else:
header_img_width, header_img_height = None, None
%>
${img_link(c.site.name, s3_https_if_secure(header_img), '/', _id = "header-img-a", img_id = 'header-img', title = header_title)}
${img_link(c.site.name, s3_https_if_secure(header_img), '/',
_id = "header-img-a", img_id = 'header-img', title = header_title,
width = header_img_width, height = header_img_height)}
##keeps the height of the header from varying when there isnt any content
&nbsp;

View File

@@ -98,7 +98,7 @@ ${first_defined(kw[1:])}
</script>
</%def>
<%def name="img_link(link_text, img, path, _id='', target='', img_id = None, **kw)">
<%def name="img_link(link_text, img, path, _id='', target='', img_id = None, width = None, height = None, **kw)">
<%
if (not target or target == '_parent') and c.cname:
target = '_top'
@@ -109,7 +109,7 @@ ${first_defined(kw[1:])}
kw['target'] = target
%>
<%call expr="_a(href=path, _id=_id, **kw)">
<img ${("id='%s'" % img_id) if img_id else ''} src="${img}" alt="${link_text}"/>
<img src="${img}" ${tags(id = img_id, width = width, height = height)} alt="${link_text}" />
</%call>
</%def>