On Sun, 2005-06-05 at 11:52 -0700, Diwaker Gupta wrote:
> > I added the real txt-link into trunk. Thx for the report.
> 
> > Muchas gracias
> 
> de nada :)
> 
> Couple of suggestions:
> 
> o keep the contracts consistent. For instance, the div tag in pdf-link
> has an id of 'pdf', while the one in txt-link has a _class_ of
> 'podlink'
> 

You are absolutely right with the above said.

You and I started more or less at the same time in not using <div/>'s at
all in our contracts (last-published.ft and last-published-net.ft).

Here we used e.g. last-published-net.ft:
<xsl:template name="last-published-net-body">
 <xsl:variable name="date"
select="document('http://xobjex.com/service/date.xsl')/date"/>
  <xsl:variable name="dt" select="$date/utc/@rfc-822"/>
  <i18n:text >Last Published:</i18n:text>&#160; <xsl:value-of
select="$dt"/>
</xsl:template>

Which returns a string. This string then can be styled by the designer
because we said: designer != contract author

The designer is using forrest:view to create a style-container (hook)
and place the contract(s) into them. 
<forrest:hook name="last-published-tagline">
 <forrest:contract name="last-published-net"/>
</forrest:hook>

Which will then be transformed (with my locales) to:
<div id="last-published-tagline">
 �ltimo publicado:&nbsp;Sun 05 Jun 2005 11:00:54 PM CEST
</div>

In short:
<forrest:hook/> = <div/>
<forrest:contract/> = string | markup

Then the designer needs to add the new css definitions for
#last-published-tagline to the skin.css and the site has the new
design. 

To focus on returning only a string where possible makes the contract
usable in a wider range of formats and gives the designer better control
over the design.

> o since we expect only one pdf-link and txt-link per page, I suggest
> removing the class attribute from txt-link and simply giving it an id
> of 'txt-link' (and change id in pdf-link to 'pdf-link')
> 
> o whats with the class 'dida' in those contracts? :)
> 

I agree it is better to return pure content from the contracts and drop
the default divs, that are now in the contracts.

NOW:
<xsl:template name="txt-link-body">
 <div class="podlink" title="Plain Text Documentation">
   <a href="{$filename-noext}.txt" class="dida"> <img class="skin" 
            src="{$skin-img-dir}/txtdoc.png" alt="TXT - icon" /><br/>
TXT</a>
 </div>
</xsl:template>

Better:
<xsl:template name="txt-link-body">
 <a href="{$filename-noext}.txt" class="format" title="Plain Text
Documentation"> <img class="skin" 
            src="{$skin-img-dir}/txtdoc.png" alt="TXT - icon" /><br/>
TXT</a>
</xsl:template>

dida - I do not no. It is there since pelt. ;-) I would suggest "format"
to indicate that is a link to another format of the current document.

WDYT about dropping the divs in contracts where possible?

> Great work!
> 

Cheers and thanks to you.

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)

Reply via email to