Skip to content

Commit

Permalink
Added message closed but open for admin / editor / moderator
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoJokhan committed Feb 13, 2023
1 parent db4147b commit c193031
Show file tree
Hide file tree
Showing 2 changed files with 7 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.isClosedButRoleAllowes= 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,10 @@

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

{% if data.activeResource and data.widget.isClosedButRoleAllowes %}
<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 c193031

@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-show-message-close-arguments-but-open-because-of-role-c193031

Please sign in to comment.