Hey folks, I want to color my card based on the attributes of the model that
card is for. Unfortunately, I can't seem to figure out a DRY way to do it.
here's what I'm currently doing:
<def tag="card" for="Milestone">
<if test="&this.late">
<card class="milestone late" param="default" id="&this.id" merge>
<header:>
<h4 param="heading"><a><name/></a></h4>
</header:>
<body:>
<section>
Due: <this.target-date/><br/>
<if test="&this.completion_date">Complete:
<this.completion-date/><br/></if>
Belongs to: <a if="&this.user" with="&this.user"><name/></a> <a
with="&this.group"><name/></a>
</section>
<section>
<remote-method-button method="mark_done" update="&this.id"/>
</section>
</body>
</card>
</if>
<else>
<card class="milestone" param="default" merge>
<header:>
<h4 param="heading"><a><name/></a></h4>
</header:>
<body:>
Due: <this.target-date/><br/>
Belongs to: <a if="&this.user" with="&this.user"><name/></a> <a
with="&this.group"><name/></a>
</body>
</card>
</else>
</def>
I'm probably not getting something, but it seems pretty contradictory to
have to have a copy of the whole card for each style I want to apply...
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.