Skip to content

Commit

Permalink
Merge pull request #385 from openstad/feature/show-message-close-argu…
Browse files Browse the repository at this point in the history
…ments-but-open-because-of-role

Added message closed but open for admin / editor / moderator
  • Loading branch information
LorenzoJokhan committed Feb 13, 2023
2 parents db4147b + b6f468f commit cb95a7c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/cms/lib/modules/arguments-block-widgets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ module.exports = {
const superLoad = self.load;
self.load = function(req, widgets, next) {
widgets.forEach((widget) => {
const data = req.data;

let config = createConfig({
widget: widget,
data: req.data,
data,
});
widget.config = config;
widget.divId = widget.config.divId;
widget.isClosedButRoleAllows = config.isClosed && (data.isAdmin || data.isEditor || data.isModerator);
});

return superLoad(req, widgets, next);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@

<div id="{{data.widget.containerId}}" class="osc-component" style="width: 100%; height: 100%;">

{% if data.activeResource and data.widget.isClosedButRoleAllows %}
<p>Reageren is gesloten, maar je kunt nog reageren vanwege je rol als {{ data.openstadUser.role }}</p>


{% endif %}
{% if data.activeResource and data.activeResource.publishDate %}
<div class="{{data.widget.divId}}" style="width: 100%; height: 100%;"></div>
{% elif (data.isAdmin or data.isEditor or data.isModerator) and data.activeResourceType !== 'idea'%}
Expand Down

1 comment on commit cb95a7c

@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:development-cb95a7c

Please sign in to comment.