Skip to content

Commit

Permalink
Update to metamodel v15, release 2.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MarekSuchanek committed Nov 5, 2024
1 parent e5d09be commit 67e0f1e
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ This document template for DSW is available as open-source via GitHub Repository

## Changelog

### Unreleased
### 2.13.0

- Adjusted to template metamodel version 15 (released in DSW 4.12.0)
- Fixed experts
- Improved reply to value questions
- Improved resource pages
Expand Down
15 changes: 15 additions & 0 deletions src/default.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,19 @@
</p>
</div>
{%- endmacro -%}
{%- macro renderAnswerFile(question, reply, path, humanIdentifier) -%}
<div class="answer-block answer-select" id="{{path}}" data-path="{{path}}" data-type="answer">
<p class="answer">
{% if reply.file %}
<svg aria-hidden="true" data-prefix="fas" data-icon="check" class="svg-inline--fa fa-check fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"></path></svg>
<span><a href="{{ reply.file.download_url }}" target="_blank">{{ reply.file.name }}</a> ({{ reply.file.size|bytesize_format }})</span>
{% else %}
<svg aria-hidden="true" data-prefix="fas" data-icon="times" class="svg-inline--fa fa-times fa-w-11" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><path fill="currentColor" d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"></path></svg>
<span>The file has been deleted</span>
{% endif %}
</p>
</div>
{%- endmacro -%}
{# ------------------------------------------------------------------------------------ #}
{# QUESTION MACROS #}
{# ------------------------------------------------------------------------------------ #}
Expand Down Expand Up @@ -196,6 +209,8 @@
{{ renderAnswerChoiceList(question, reply, path, humanIdentifier) }}
{% elif question is of_type("ItemSelectQuestion") and reply is of_type("ItemSelectReply") %}
{{ renderAnswerItemSelect(question, reply, path, humanIdentifier) }}
{% elif question is of_type("FileQuestion") and reply is of_type("FileReply") %}
{{ renderAnswerFile(question, reply, path, humanIdentifier) }}
{% endif %}
{% else %}
<div class="answer-block not-answered">
Expand Down
9 changes: 9 additions & 0 deletions src/default.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@
{%- macro renderAnswerItemSelect(question, reply, path, humanIdentifier) -%}
✔️ {{ reply.item_title }}
{%- endmacro -%}
{%- macro renderAnswerFile(question, reply, path, humanIdentifier) -%}
{% if reply.file %}
✔️ [{{ reply.file.name }}]({{ reply.file.download_url }}) ({{ reply.file.size|bytesize_format }})</p>
{% else %}
❌ The file has been deleted
{% endif %}
{%- endmacro -%}
{#- ------------------------------------------------------------------------------------ -#}
{#- QUESTION MACROS -#}
{#- ------------------------------------------------------------------------------------ -#}
Expand All @@ -132,6 +139,8 @@
{{ renderAnswerChoiceList(question, reply, path, humanIdentifier) }}
{% elif question is of_type("ItemSelectQuestion") and reply is of_type("ItemSelectReply") %}
{{ renderAnswerItemSelect(question, reply, path, humanIdentifier) }}
{% elif question is of_type("FileQuestion") and reply is of_type("FileReply") %}
{{ renderAnswerFile(question, reply, path, humanIdentifier) }}
{%- endif -%}
{%- else %}
❗ *This question has not been answered yet!*
Expand Down
11 changes: 11 additions & 0 deletions src/default.tex.j2
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@
\item[\CheckmarkBold] {{ reply.item_title }}
\end{itemize}
{%- endmacro -%}
{%- macro renderAnswerFile(question, reply, path, humanIdentifier) -%}
\begin{itemize}
{% if reply.file %}
\item[\CheckmarkBold] \href{{ "{" }}{{ reply.file.download_url }}{{ "}" }}{{ "{" }}{{ reply.file.name }}{{ "}" }} ({{ reply.file.size|bytesize_format }})
{% else %}
\item[\XSolidBrush] \textit{The file has been deleted}
{% endif %}
\end{itemize}
{%- endmacro -%}
{#- ------------------------------------------------------------------------------------ -#}
{#- QUESTION REPLY MACROS -#}
{#- ------------------------------------------------------------------------------------ -#}
Expand All @@ -104,6 +113,8 @@
{{ renderAnswerChoiceList(question, reply, path, humanIdentifier) }}
{% elif question is of_type("ItemSelectQuestion") and reply is of_type("ItemSelectReply") %}
{{ renderAnswerItemSelect(question, reply, path, humanIdentifier) }}
{% elif question is of_type("FileQuestion") and reply is of_type("FileReply") %}
{{ renderAnswerFile(question, reply, path, humanIdentifier) }}
{%- endif -%}
{% else %}
\begin{itemize}
Expand Down
11 changes: 11 additions & 0 deletions src/for-word.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,15 @@
<p>✔️ {{ reply.item_title }}</p>
</div>
{%- endmacro -%}
{%- macro renderAnswerFile(question, reply, path, humanIdentifier) -%}
<div>
{% if reply.file %}
<p>✔️ <a href="{{ reply.file.download_url }}" target="_blank">{{ reply.file.name }}</a> ({{ reply.file.size|bytesize_format }})</p>
{% else %}
<p>❌ The file has been deleted</p>
{% endif %}
</div>
{%- endmacro -%}
{# ------------------------------------------------------------------------------------ #}
{# QUESTION MACROS #}
{# ------------------------------------------------------------------------------------ #}
Expand All @@ -179,6 +188,8 @@
{{ renderAnswerChoiceList(question, reply, path, humanIdentifier) }}
{% elif question is of_type("ItemSelectQuestion") and reply is of_type("ItemSelectReply") %}
{{ renderAnswerItemSelect(question, reply, path, humanIdentifier) }}
{% elif question is of_type("FileQuestion") and reply is of_type("FileReply") %}
{{ renderAnswerFile(question, reply, path, humanIdentifier) }}
{% endif %}
{% else %}
<p>❗ <i>This question has not been answered yet!</i></p>
Expand Down
4 changes: 2 additions & 2 deletions template.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"organizationId": "dsw",
"templateId": "questionnaire-report",
"version": "2.12.0",
"version": "2.13.0",
"name": "Questionnaire Report",
"description": "Exported questions and answers from a questionnaire",
"metamodelVersion": 14,
"metamodelVersion": 15,
"license": "Apache-2.0",
"allowedPackages": [
{
Expand Down

0 comments on commit 67e0f1e

Please sign in to comment.