Skip to content

Commit

Permalink
Fix when buttons appear
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Mar 28, 2024
1 parent 7894ba3 commit b0cf993
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release Notes for Campaign

## 2.13.2 - Unreleased

### Fixed

- Fixed the buttons to create new campaign types and mailing list types appearing when allow admin changes was disabled or the user did not have the necessary permissions.

## 2.13.1 - 2024-03-26

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "putyourlightson/craft-campaign",
"description": "Send and manage email campaigns, contacts and mailing lists.",
"version": "2.13.1",
"version": "2.13.2",
"type": "craft-plugin",
"homepage": "https://putyourlightson.com/plugins/campaign",
"license": "proprietary",
Expand Down
14 changes: 8 additions & 6 deletions src/templates/campaigns/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@
]) %}

{% block content %}
{% if allCampaignTypes|length == 0 %}
{% if allCampaignTypes|length >= 0 %}
<div class="zilch">
<p>{{ 'No campaign types exist.'|t('campaign') }}</p>
<div style="font-size: initial;">
<a href="{{ url('campaign/settings/campaigntypes/new') }}" class="btn submit add icon">
{{ 'New campaign type'|t('campaign') }}
</a>
</div>
{% if craft.app.config.general.allowAdminChanges and currentUser.can('campaign:settings') %}
<div style="font-size: initial;">
<a href="{{ url('campaign/settings/campaigntypes/new') }}" class="btn submit add icon">
{{ 'New campaign type'|t('campaign') }}
</a>
</div>
{% endif %}
</div>
{% else %}
{{ parent() }}
Expand Down
12 changes: 7 additions & 5 deletions src/templates/mailinglists/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
{% if allMailingListTypes|length == 0 %}
<div class="zilch">
<p>{{ 'No mailing list types exist.'|t('campaign') }}</p>
<div style="font-size: initial;">
<a href="{{ url('campaign/settings/mailinglisttypes/new') }}" class="btn submit add icon">
{{ 'New mailing list type'|t('campaign') }}
</a>
</div>
{% if craft.app.config.general.allowAdminChanges and currentUser.can('campaign:settings') %}
<div style="font-size: initial;">
<a href="{{ url('campaign/settings/mailinglisttypes/new') }}" class="btn submit add icon">
{{ 'New mailing list type'|t('campaign') }}
</a>
</div>
{% endif %}
</div>
{% else %}
{{ parent() }}
Expand Down

0 comments on commit b0cf993

Please sign in to comment.