Skip to content

Commit

Permalink
IBX-3320: Unified content versions edit button logic (#2058)
Browse files Browse the repository at this point in the history
  • Loading branch information
barw4 committed Aug 23, 2022
1 parent ef94ad3 commit 1e0ce8c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
</svg>
</a>
{% elseif is_draft %}
{% set edit_draft_disabled = (version.author and version.author.id != ez_admin_ui_config.user.user.id) %}
<button
data-content-draft-edit-url="{{ edit_url }}"
data-version-has-conflict-url="{{ path('ezplatform.version.has_no_conflict', {
Expand All @@ -93,7 +94,8 @@
}) }}"
data-content-id="{{ version.contentInfo.id }}"
data-language-code="{{ version.initialLanguageCode }}"
class="btn btn-icon mx-2 ez-btn--content-draft-edit"
class="btn btn-icon mx-2 ez-btn--content-draft-edit {% if edit_draft_disabled %}ez-btn--prevented{% endif %}"
{% if edit_draft_disabled %}disabled{% endif %}
title="{{ 'tab.versions.table.action.draft.edit'|trans|desc('Edit draft') }}">
<svg class="ez-icon ez-icon--secondary ez-icon-edit">
<use xlink:href="{{ ez_icon_path('edit') }}"></use>
Expand Down

0 comments on commit 1e0ce8c

Please sign in to comment.