Skip to content

Commit

Permalink
QWeb report: survey_component
Browse files Browse the repository at this point in the history
  • Loading branch information
bobslee committed Aug 22, 2021
1 parent 306c5b0 commit 5cecb14
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
4 changes: 4 additions & 0 deletions formio_report_qweb/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 4.4

- New component: `survey`

## 4.3

- (Fix) add group access to Print reports wizard.
Expand Down
2 changes: 1 addition & 1 deletion formio_report_qweb/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
'name': 'Forms | QWeb Reports',
'summary': 'Generate (PDF) reports for every Form',
'version': '4.3',
'version': '4.4',
'author': 'Nova Code',
'website': 'https://www.novacode.nl',
'live_test_url': 'https://demo13.novacode.nl',
Expand Down
35 changes: 35 additions & 0 deletions formio_report_qweb/report/report_formio_form_components.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ See LICENSE file for full copyright and licensing details.
<t t-elif="component.type == 'day'">
<t t-call="formio_report_qweb.day_component"/>
</t>
<t t-elif="component.type == 'survey'">
<t t-call="formio_report_qweb.survey_component"/>
</t>
<t t-elif="component.type == 'signature'">
<t t-call="formio_report_qweb.signature_component"/>
</t>
Expand Down Expand Up @@ -212,6 +215,38 @@ See LICENSE file for full copyright and licensing details.
</div>
</template>

<template id="survey_component">
<div class="mw-100 mb-3 formio_survey_component">
<table class="table table-bordered table-sm">
<tbody>
<tr>
<td/>
<t t-foreach="component.values_labels" t-as="label">
<td class="text-center font-weight-bold">
<span t-esc="label"/>
</td>
</t>
</tr>
<t t-foreach="component.grid" t-as="question">
<tr>
<td><span class="ml-2" t-esc="question['question_label']"/></td>
<t t-foreach="question['values']" t-as="q_val">
<td class="text-center">
<t t-if="q_val['checked']">
<input type="radio" checked="checked"/>
</t>
<t t-else="">
<input type="radio"/>
</t>
</td>
</t>
</tr>
</t>
</tbody>
</table>
</div>
</template>

<template id="day_component">
<div class="mw-100 mb-3 formio_day_component">
<div class="label mb-2"><t t-call="formio_report_qweb.component_label"/></div>
Expand Down

0 comments on commit 5cecb14

Please sign in to comment.