Mercurial > hg > MPIWGWeb
changeset 84:faaded775a8a
styles for feature and feature archive.
author | casties |
---|---|
date | Mon, 13 May 2013 22:16:04 +0200 |
parents | ff0657e34ab4 |
children | 271cf05a8648 |
files | MPIWGFeature.py MPIWGRoot.py css/mpiwg.css zpt/feature/feature_template.zpt |
diffstat | 4 files changed, 168 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/MPIWGFeature.py Mon May 13 18:06:11 2013 +0200 +++ b/MPIWGFeature.py Mon May 13 22:16:04 2013 +0200 @@ -27,8 +27,10 @@ {'label':'Configure', 'action':'changeForm'}, ) + # templates changeWeightForm = PageTemplateFile('zpt/feature/manage_change_weight', globals()) changeForm = PageTemplateFile('zpt/feature/manage_config', globals()) + feature_main = PageTemplateFile('zpt/feature/feature_template', globals()) def __init__(self, id, title=None, weight=0, date=None, title_en=None, title_de=None, author=None, author_id=None): self.id = str(id) @@ -189,7 +191,7 @@ img = getattr(self, 'img-thumb.jpg') return img - def getThumbImgUrl(self): + def getThumbUrl(self): """returns the URL of the image object for the sidebar thumbnail""" img = getattr(self, 'img-thumb.jpg') return img.absolute_url()
--- a/MPIWGRoot.py Mon May 13 18:06:11 2013 +0200 +++ b/MPIWGRoot.py Mon May 13 22:16:04 2013 +0200 @@ -168,6 +168,29 @@ return items + def getFeatureAuthorMap(self): + """Return a map of authors of features. + + Returns a dict with author names and a list of feature numbers. + """ + features = self.getFeatures() + authors = {} + # build dict of unique authors and features + fno = 0 + for f in features: + author = f.getAuthor() + fno += 1 + if author: + for a in author.split(';'): + a = a.strip() + if a in authors: + authors[a].append(fno) + else: + authors[a] = [fno] + + return authors + + def getDepartments(self): """returns a list of the Departments""" dir = getattr(self, 'departments', None)
--- a/css/mpiwg.css Mon May 13 18:06:11 2013 +0200 +++ b/css/mpiwg.css Mon May 13 22:16:04 2013 +0200 @@ -876,6 +876,7 @@ } ul.items .type { + /* font-size: 11px; */ color: #696968; } @@ -960,34 +961,80 @@ /* - * figures (in project descriptions) + * figures (in project descriptions and features) */ -div.figure { +div.figure, +div.image_small { float: left; - width: 220px; + width: 230px; padding: 0.5em 1em 0 0; } -div.figure div.image img { - width: 220px; +div.image_small.right { + float: right; + padding: 0.5em 0 0 1em; } -div.figure div.figcaption { +div.figure div.image img, +div.image_small img { + width: 230px; +} +div.figure div.figcaption, +div.banner_large div.caption, +div.image_small div.caption { font-size: 10px; + line-height: 1.5; color: #9f917a; margin-top: 0.5em; } +div.banner_large img { + width: 460px; +} /* - * project description + * project description and feature */ h3.authors { margin-top: 0.5em; } +p.maintext_authors { + font-size: 14px; + color: #3b4186; +} + div.description { margin-top: 0.5em; line-height: 1.5; } +/* + * feature story archive + */ +ul.items.features li { + padding: 0 0 0.5em 0; + border-bottom: 1px solid #dccbae; +} +ul.items.features .thumb { + float:left; + padding: 8px 10px 0 0; +} +ul.items.features .thumb img { + width: 55px; + height: 34px; +} +ul.items.features .feature_number { + font-family: Georgia, Times, serif; + font-size: 24px; + color: #696968; +} +ul.items.features .date { + font-size: 11px; + color: #696968; +} +ul.items.features h1 { + font-size: 12px; + font-weight: bold; + margin: 0; +} /* * sidebar */ @@ -1053,6 +1100,33 @@ } /* + * special sideblocks + */ +div.sideblock .item.link, +div.sideblock .item.internal { + background: url(../images/internal.png) 0 11px no-repeat; + padding-left: 10px; +} + +div.sideblock .item.external { + background: url(../images/external.png) 0 11px no-repeat; + padding-left: 13px; +} + +div.sideblock .item.download { + background: url(../images/download.png) 0 8px no-repeat; + padding-left: 15px; +} + +div.sideblock .item.thumb img { + width: 55px; + height: 34px; +} +div.sideblock .item.thumb .text { + padding-left: 0.5em; +} + +/* * footer */ #footer {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zpt/feature/feature_template.zpt Mon May 13 22:16:04 2013 +0200 @@ -0,0 +1,61 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<metal:block metal:define-macro="page"> + <html xmlns="http://www.w3.org/1999/xhtml" metal:use-macro="here/main_template/macros/page"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +</head> +<body> + <div class="center" metal:fill-slot="center"> + <metal:block metal:define-slot="feature"> + (the latest feature should be here) + </metal:block> + </div> + <!-- center --> + + <div class="sidebar" metal:fill-slot="sidebar"> + + <tal:block metal:define-slot="sideblock" /> + + <div class="sideblock"> + <h2>Research Topics Archive</h2> + + <div class="item noline" tal:condition="python:lang!='de'"> + <b>In this archive</b> you can find present and past research topics. + </div> + <div class="item noline" tal:condition="python:lang=='de'"> + <b>In diesem Archiv</b> finden Sie aktuelle und frühere Forschungsthemen. + </div> + + <tal:block define="features python:here.getFeatures()"> + <tal:block define="dummy python:features.reverse()"> + <!-- workaround for inverting the order of the elements --> + + <div class="item thumb" tal:repeat="feature python:features"> + <div class="row" tal:define="url python:feature.getUrl(baseUrl='%s/%s/features'%(root,secmap['news']))"> + <div class="col thumb"> + <a tal:attributes="href url"> + <img tal:attributes="src feature/getThumbUrl" /> + </a> + </div> + <div class="col text"> + <a tal:attributes="href url"> + <b>Feature <span tal:replace="python: len(features)-features.index(feature)" />:</b> + </a> + <span tal:content="feature/getFullTitle"/> + </div> + </div> + </div> + + </tal:block> + </tal:block> + + </div> + <!-- /sideblock --> + + + </div> + <!-- sidebar --> +</body> + </html> +</metal:block> \ No newline at end of file