Skip to content

Commit

Permalink
Resource overview will become master detail if displayModeColumns is …
Browse files Browse the repository at this point in the history
…set to true
  • Loading branch information
LorenzoJokhan committed Sep 4, 2023
1 parent f1ea11b commit 4e3e860
Show file tree
Hide file tree
Showing 11 changed files with 114 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = (self, options) => {
{
name: 'displaySettings',
label: 'Display settings',
fields: ['displayTitle', 'displayRanking', 'displayLabel', 'displaySummary', 'displayDescription', 'displayVoteProgressBar', 'displayVoteForCount', 'displayVoteAgainstCount', 'displayArgumentsCount', 'displayTheme', 'displayArea', 'showVoteCounter', 'displayShareButtons', 'displayEditLinkForModerator', 'editUrl', 'displayVoteCaption', 'voteCaption']
fields: ['displayTitle', 'displayRanking', 'displayLabel', 'displaySummary', 'displayDescription', 'displayVoteProgressBar', 'displayVoteForCount', 'displayVoteAgainstCount', 'displayArgumentsCount', 'displayTheme', 'displayArea', 'showVoteCounter', 'displayShareButtons', 'displayEditLinkForModerator', 'editUrl', 'displayVoteCaption', 'voteCaption', 'displayModeColumns']
},
{
name: 'gridder',
Expand Down
15 changes: 15 additions & 0 deletions packages/cms/lib/modules/resource-overview-widgets/lib/fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,21 @@ module.exports = [
}
],
},
{
name: 'displayModeColumns',
label: 'Display the filters and ideas next to eachother (tags will become checkboxes)',
type: 'boolean',
choices: [
{
label: 'Yes',
value: true
},
{
label: 'No',
value: false,
}
],
},
{
name: 'displaySorting',
label: 'Display sorting',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
.ideasList.columns {
display: flex;
flex-direction: row;
justify-content: space-between;
gap: 8px;

#ideas {
flex-grow: 1;
}

.resource-filter-row{
width: 100%;
display: block;
div {
margin-bottom: 8px;
width: 100% !important;
display: block;

* {
width: 100% !important;
}
}
}


}



.search-wrapper {
width: 100%;
position: relative;
Expand Down Expand Up @@ -105,6 +134,10 @@ input.search {
justify-content: start;
flex-wrap: wrap;
gap: 8px;

&.columned {
flex-direction: column;
}
}
.mobile-tag-group a, .tag-group a {
color: #000;
Expand Down Expand Up @@ -155,6 +188,23 @@ input.search {
}
}
}

.mobile-tag-group .tag-checkbox, .tag-group .tag-checkbox {
display: inline-block;
padding: 8px 8px;
border: 2px solid #164995;

&.selected {
background: #164995;
color: white;
}
}

.tag-checkbox + p {
display: inline-block;
vertical-align: middle;
}

.mobile-tag-group-title, .tag-group-title {
margin: 8px 0px;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{% if data.widget.displayAreaFilter %}
<div>
<label for="resource-overview-area" class="sr-only">Selecteer een gebied: </label>
<select id="resource-overview-area" class="default-select openstad-ajax-refresh-input" name="area" data-reset-pagination="1">
<option value="">Alle gebieden</option>
{% for area in data.widget.areas %}
<option value="{{area.value}}" {% if area.value === data.query.area %} selected {% endif %}>{{area.value}}</option>
{% endfor %}
</select>
</div>
{% endif %}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{% if data.widget.displaySorting %}
<div class="sort-wrapper">

<label for="resource-sort-filter" class="sr-only">Sorteren op: </label>
<select class="default-select ideas-sort-select openstad-ajax-refresh-input" id="resource-sort-filter" name="sort" data-reset-pagination="1">
{% for selectedSorting in data.widget.selectedSorting %}
Expand All @@ -7,4 +9,5 @@
</option>
{% endfor %}
</select>
</div>
{% endif %}
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{% for key, tagList in data.widget.groupedOpenstadTags %}
<div id="tag-group-container-{{ 'tags' if key === 'undefined' else key }}" class="tag-group-container">
<p class="{{ tagGroupPrefix }}tag-group-title">{{ "Overig" if key === 'undefined' or key === 'null' else key }}</p>
<div id="{{ tagGroupPrefix }}tag-group-{{ 'tags' if key === 'undefined' else key }}" class="{{ tagGroupPrefix }}tag-group">
{% include 'includes/controls/tag-includes/tag-buttons.njk' %}
<div id="{{ tagGroupPrefix }}tag-group-{{ 'tags' if key === 'undefined' else key }}" class="{{ tagGroupPrefix }}tag-group {{ 'columned' if data.widget.displayModeColumns else '' }}">

{% if data.widget.displayModeColumns%}
{% include 'includes/controls/tag-includes/tag-checkboxes.njk' %}
{% else %}
{% include 'includes/controls/tag-includes/tag-buttons.njk' %}
{% endif%}
</div>
</div>
{% endfor %}
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<div id="{{ tagGroupPrefix }}tag-group-none }}" class="{{ tagGroupPrefix }}tag-group">
<div id="{{ tagGroupPrefix }}tag-group-none }}" class="{{ tagGroupPrefix }}tag-group {{ 'columned' if data.widget.displayModeColumns else '' }}">

{% for key, tagList in data.widget.groupedOpenstadTags %}
{% include 'includes/controls/tag-includes/tag-buttons.njk' %}
{% if data.widget.displayModeColumns%}
{% include 'includes/controls/tag-includes/tag-checkboxes.njk' %}
{% else %}
{% include 'includes/controls/tag-includes/tag-buttons. njk' %}
{% endif%}
{% endfor %}
</div>
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<div id="{{ tagGroupPrefix }}tag-group-{{ data.widget.tagType }}" class="{{ tagGroupPrefix }}tag-group">
<div id="{{ tagGroupPrefix }}tag-group-{{ data.widget.tagType }}" class="{{ tagGroupPrefix }}tag-group {{ 'columned' if data.widget.displayModeColumns else '' }}">
{% for tagList in [data.widget.groupedOpenstadTags[data.widget.tagType]] %}
{% include 'includes/controls/tag-includes/tag-buttons.njk' %}

{% if data.widget.displayModeColumns%}
{% include 'includes/controls/tag-includes/tag-checkboxes.njk' %}
{% else %}
{% include 'includes/controls/tag-includes/tag-buttons. njk' %}
{% endif%}

{% endfor %}
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% for tag in tagList %}
{% if data.widget.isTagSelected(tag, data.query) %}
<div class="tag-checkbox-container">
<a href="{{ data.widget.formatTagRemoveUrl(tag, data.query) }}" class="openstad-ajax-refresh-link" data-reset-pagination="1" data-reset-hash="1">
<div class="tag-checkbox selected"></div>
<p>{{ tag.name }}</p>
</a>
</div>
{% else %}
<div class="tag-checkbox-container">
<a href="{{ data.widget.formatTagSelectUrl(tag, data.query) }}" class="openstad-ajax-refresh-link" data-reset-pagination="1" data-reset-hash="1">
<div class="tag-checkbox"></div>
<p>{{ tag.name }}</p>
</a>
</div>
{% endif %}
{% endfor %}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{% if data.widget.displayThemeFilter %}
<div>
<label for="resource-theme-filter" class="sr-only">Selecteer een thema: </label>
<select class="default-select openstad-ajax-refresh-input" id="resource-theme-filter" name="theme" data-reset-pagination="1">
<option value="">Alle thema's</option>
{% for theme in data.widget.themes %}
<option value="{{theme.value}}" {% if theme.value === data.query.theme %} selected {% endif %}>{{theme.value}}</option>
{% endfor %}
</select>
</div>
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{% if data.widget.voting %}
{{ voteCreator.showVoteCreator(false, data.widget.ideas, data) }}
{% endif %}

<div class="ideasList" >
<div class="ideasList {{'columns' if data.widget.displayModeColumns}}" >
{% include 'includes/filters.html' %}

{% if data.widget.formattedResultCountText %}
Expand Down

1 comment on commit 4e3e860

@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-tag-group-styling-4e3e860

Please sign in to comment.