-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from maximehuran/feature/show-page-button
Add button to go to page in admin
- Loading branch information
Showing
5 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div class="ui right floated buttons"> | ||
{% include '@MonsieurBizSyliusCmsPagePlugin/Admin/Page/_showInShopButton.html.twig' %} | ||
</div> |
37 changes: 37 additions & 0 deletions
37
src/Resources/views/Admin/Page/_showInShopButton.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{% set enabledChannels = resource.channels|filter(channel => channel.enabled == true) %} | ||
|
||
{% if sylius_bundle_loaded_checker('SyliusShopBundle') %} | ||
{% if not resource.enabled or enabledChannels|length < 1 %} | ||
<a class="ui labeled icon button disabled" href="#"> | ||
<i class="angle right icon"></i> | ||
{{ 'monsieurbiz_cms_page.ui.show_page_in_shop_page'|trans }} | ||
</a> | ||
{% elseif enabledChannels|length > 1 %} | ||
<div class="ui floating dropdown labeled icon button"> | ||
<i class="share alternate icon"></i> | ||
<span class="text"> | ||
{{ 'monsieurbiz_cms_page.ui.show_page_in_shop_page'|trans }} | ||
</span> | ||
<div class="menu"> | ||
<div class="scrolling menu"> | ||
{% for channel in enabledChannels %} | ||
{% set url = channel.hostname is not null ? 'http://' ~ channel.hostname ~ path('monsieurbiz_cms_page_show', {'slug': resource.slug, '_locale': channel.defaultLocale.code}) : url('monsieurbiz_cms_page_show', {'slug': resource.slug, '_locale': channel.defaultLocale.code}) %} | ||
<a href="{{ url|raw }}" class="item" target="_blank"> | ||
<i class="angle right icon"></i> | ||
{{ 'monsieurbiz_cms_page.ui.show_in'|trans }} | ||
{{ channel.name }} ({{ channel.code }}) | ||
</a> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</div> | ||
{% else %} | ||
{% for channel in enabledChannels %} | ||
{% set url = channel.hostname is not null ? 'http://' ~ channel.hostname ~ path('monsieurbiz_cms_page_show', {'slug': resource.slug, '_locale': channel.defaultLocale.code}) : url('monsieurbiz_cms_page_show', {'slug': resource.slug, '_locale': channel.defaultLocale.code}) %} | ||
<a class="ui labeled icon button" href="{{ url|raw }}" target="_blank"> | ||
<i class="angle right icon"></i> | ||
{{ 'monsieurbiz_cms_page.ui.show_page_in_shop_page'|trans }} | ||
</a> | ||
{% endfor %} | ||
{% endif %} | ||
{% endif %} |