Skip to content

Commit

Permalink
specify if theme labels should be shown
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoJokhan committed Feb 14, 2023
1 parent 12059ec commit c20aa08
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
18 changes: 17 additions & 1 deletion packages/cms/lib/modules/resource-form-widgets/lib/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const fields = [
{
value: 'tags',
label: "Tags (currently only works for ideas)",
showFields: ['fieldKey', 'fieldRequired', 'theme', 'fieldMin', 'fieldMax']
showFields: ['fieldKey', 'fieldRequired', 'theme', 'showThemeNames', 'fieldMin', 'fieldMax']
},
{
value: 'raw',
Expand Down Expand Up @@ -301,6 +301,22 @@ const fields = [
label: 'Themes, Optionally specify the single theme (one word) by which to fetch the tags.',
type: 'string'
},
{
name: 'showThemeNames',
label: 'When the above option is empty, select if the corresponding themes should be shown or not',
type: 'boolean',
choices: [
{
label: 'Yes',
value: true,
},
{
label: 'No',
value: false,
}
],
def: true
},
{
name: 'notExtraDataKey',
label: 'Save field in root if data object and not in extraData, will only work if column exists in database)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
{% for key, tagList in data.groupedOpenstadTags %}
{% set outer_loop = loop %}

{% if field.showThemeNames %}
{% if outer_loop.length > 1 and key !== 'undefined' %}
<p>{{key}}</p>
<p>{{key}}</p>
{% endif %}

{% if outer_loop.length > 1 and key == 'undefined' %}
<p>Overig</p>
{% endif %}
{% endif %}

{% for tag in tagList %}
<div class="checkbox">
Expand Down

1 comment on commit c20aa08

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Published new image: openstad/frontend:feature-group-tags-like-mzm-c20aa08

Please sign in to comment.