Skip to content

Commit

Permalink
Merge pull request #12 from GrandLTU/template-include-naming
Browse files Browse the repository at this point in the history
Change template naming to allow overriding
  • Loading branch information
GrandLTU authored Dec 5, 2019
2 parents e8dd088 + 54f29f2 commit 9d397ca
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/Controller/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ public function __construct(EngineInterface $templating)

public function indexAction(): Response
{
return $this->templating->renderResponse('PlatformAdminBundle:Dashboard:index.html.twig');
return $this->templating->renderResponse('@PlatformAdmin/Dashboard/index.html.twig');
}
}
4 changes: 2 additions & 2 deletions src/Resources/config/routing/admin_user.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ admin_platform_admin_user:
alias: sylius.admin_user
section: admin
path: users
templates: PlatformAdminBundle:Crud
templates: "@PlatformAdmin\\Crud"
except: ['show']
redirect: index
grid: admin_platform_admin_user
Expand All @@ -15,7 +15,7 @@ admin_platform_admin_user:
all:
subheader: sylius.ui.manage_users_able_to_access_administration_panel
templates:
form: PlatformAdminBundle:AdminUser:_form.html.twig
form: "@PlatformAdmin/AdminUser/_form.html.twig"
index:
icon: lock
type: sylius.resource
4 changes: 2 additions & 2 deletions src/Resources/config/routing/locale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ admin_platform_locale:
resource: |
alias: sylius.locale
section: admin
templates: PlatformAdminBundle:Crud
templates: "@PlatformAdmin\\Crud"
except: ['show', 'delete']
redirect: index
grid: admin_platform_locale
Expand All @@ -11,7 +11,7 @@ admin_platform_locale:
all:
subheader: sylius.ui.manage_languages_available_in_the_store
templates:
form: PlatformAdminBundle:Locale:_form.html.twig
form: "@PlatformAdmin/Locale/_form.html.twig"
index:
icon: translate
type: sylius.resource
4 changes: 2 additions & 2 deletions src/Resources/config/routing/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ admin_platform_admin_login:
defaults:
_controller: sylius.controller.security:loginAction
_sylius:
template: PlatformAdminBundle:Security:login.html.twig
template: '@PlatformAdmin/Security/login.html.twig'
permission: true

admin_platform_admin_login_check:
Expand All @@ -15,4 +15,4 @@ admin_platform_admin_login_check:

admin_platform_admin_logout:
path: /logout
methods: [GET]
methods: [GET]
2 changes: 1 addition & 1 deletion src/Resources/views/Crud/Create/_header.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% import 'SyliusUiBundle:Macro:headers.html.twig' as headers %}
{% import '@SyliusUi/Macro/headers.html.twig' as headers %}

<div class="ui stackable two column grid">
<div class="column">
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/views/Crud/Update/_header.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% import 'SyliusUiBundle:Macro:headers.html.twig' as headers %}
{% import '@SyliusUi/Macro/headers.html.twig' as headers %}

<div class="ui stackable two column grid">
<div class="column">
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/views/Crud/create.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{% block title %}{{ parent() }} {{ header|trans }}{% endblock %}

{% form_theme form 'SyliusUiBundle:Form:theme.html.twig' %}
{% form_theme form '@SyliusUi/Form/theme.html.twig' %}

{% block content %}
{% include '@PlatformAdmin/Crud/Create/_header.html.twig' %}
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/views/Crud/update.html.twig
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{% extends '@PlatformAdmin/layout.html.twig' %}

{% import 'SyliusUiBundle:Macro:buttons.html.twig' as buttons %}
{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %}

{% set header = configuration.vars.header|default(metadata.applicationName~'.ui.edit_'~metadata.name) %}

{% block title %}{{ parent() }} {{ header|trans }}{% endblock %}

{% form_theme form 'SyliusUiBundle:Form:theme.html.twig' %}
{% form_theme form '@SyliusUi/Form/theme.html.twig' %}

{% block content %}
{% include '@PlatformAdmin/Crud/Update/_header.html.twig' %}
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/views/Dashboard/_header.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% import 'SyliusUiBundle:Macro:headers.html.twig' as headers %}
{% import '@SyliusUi/Macro/headers.html.twig' as headers %}

<div class="ui stackable grid">
<div class="twelve wide column">
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/views/layout.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends 'SyliusUiBundle:Layout:sidebar.html.twig' %}
{% extends '@SyliusUi/Layout/sidebar.html.twig' %}

{% block title %}Admin platform | {% endblock %}

Expand All @@ -15,7 +15,7 @@

{% block sidebar %}
<a class="item" href="{{ path('admin_platform_admin_dashboard_index') }}"><b>Admin platform</b></a>
{{ knp_menu_render('admin_platform.menu.main', {'template': 'SyliusUiBundle:Menu:sidebar.html.twig', 'currentClass': 'active'}) }}
{{ knp_menu_render('admin_platform.menu.main', {'template': '@SyliusUi/Menu/sidebar.html.twig', 'currentClass': 'active'}) }}
{% endblock %}

{% block footer %}
Expand Down

0 comments on commit 9d397ca

Please sign in to comment.