loops/knowledge/survey/view_macros.pt

108 lines
3.8 KiB
XML

<!-- ZPT macros for loops.knowledge.survey views -->
<html i18n:domain="loops">
<metal:block define-macro="survey"
tal:define="feedback item/results;
errors item/errors">
<metal:title use-macro="item/conceptMacros/concepttitle_only" />
<tal:description condition="not:feedback">
<metal:title use-macro="item/conceptMacros/conceptdescription" />
</tal:description>
<div tal:condition="feedback">
<h3 i18n:translate="">Feedback</h3>
<div tal:define="header item/adapted/feedbackHeader"
tal:condition="header"
tal:content="structure python:
item.renderText(header, 'text/restructured')" />
<table class="listing">
<tr>
<th i18n:translate="">Category</th>
<th tal:repeat="col item/feedbackColumns"
i18n:translate=""
tal:attributes="class python:
col['name'] != 'text' and 'center' or None"
tal:content="col/label" />
</tr>
<tr style="vertical-align: top"
tal:repeat="fbitem feedback">
<td style="vertical-align: top"
tal:content="fbitem/category" />
<tal:cols repeat="col item/feedbackColumns">
<td style="vertical-align: top"
tal:define="name col/name"
tal:attributes="class python:name != 'text' and 'center' or None"
tal:content="fbitem/?name" />
</tal:cols>
</tr>
</table>
<div class="button" id="show_questionnaire">
<a href="" onclick="back(); return false"
i18n:translate="">
Back to Questionnaire</a>
<br />
</div>
<div tal:define="footer item/adapted/feedbackFooter"
tal:condition="footer"
tal:content="structure python:
item.renderText(footer, 'text/restructured')" />
</div>
<div id="questionnaire"
tal:condition="not:feedback">
<h3 i18n:translate="">Questionnaire</h3>
<div class="error"
tal:condition="errors">
<div tal:repeat="error errors">
<span i18n:translate=""
tal:content="error" />
</div>
</div>
<form method="post">
<table class="listing">
<tal:group repeat="group item/groups">
<tr>
<td>&nbsp;</td>
<td tal:repeat="opt item/answerOptions">&nbsp;</td></tr>
<tr class="vpad">
<td tal:define="infoText group/infoText">
<b i18n:translate=""
tal:content="group/title" />
<div class="infotext"
tal:condition="infoText">
<span tal:content="structure infoText" />
</div>
</td>
<td tal:repeat="opt item/answerOptions"
style="text-align: center"
i18n:translate=""
tal:content="opt/label" />
</tr>
<tr class="vpad"
tal:repeat="question group/questions">
<td tal:content="question/text" />
<td style="white-space: nowrap; text-align: center"
tal:repeat="value python:item.getValues(question)">
<input type="radio"
i18n:attributes="title"
tal:attributes="
name string:question_${question/uid};
value value/value;
checked value/checked;
title value/title" />
</td>
</tr>
</tal:group>
</table>
<input type="submit" name="submit" value="Evaluate Questionnaire"
i18n:attributes="value" />
<input type="button" name="reset_responses" value="Reset Responses Entered"
i18n:attributes="value"
onclick="setRadioButtons('none'); return false" />
</form>
</div>
</metal:block>
</html>