Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AdminListBundle] Re-use the default title logic for adminlists instead of duplicating it #334

Merged
merged 1 commit into from
Apr 15, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,51 +1,38 @@
{% extends 'KunstmaanAdminBundle:Default:layout.html.twig' %}
{% form_theme form 'KunstmaanAdminBundle:Form:fields.html.twig' %}

{% block header %}{% endblock %}

{% block content %}
<form action="{{ path(app.request.attributes.get('_route'), my_router_params()) }}" method="post" {{ form_enctype(form) }} novalidate="novalidate">

<!-- Header -->
<header class="app__content__header">
<div class="row">
{% if adminmenu.current %}
<div class="col-sm-6 col-md-8">
<h1 class="app__content__header__title">
{{ adminmenu.current.label | trans }} {% block page_header_addition %}{% endblock %}
</h1>
</div>
{% endif %}
<div class="col-sm-6 col-md-4">
<!-- Main-actions -->
<div class="js-auto-collapse-buttons page-main-actions page-main-actions--no-tabs page-main-actions--inside-extra-actions-header">
<div class="btn-group">
{% block actions %}
<button type="submit" class="btn btn-primary btn--raise-on-hover">
{{ 'Save' | trans }}
</button>
<a href="{{ path(adminlistconfigurator.getIndexUrl()["path"], adminlistconfigurator.getIndexUrl()["params"]) }}" class="btn btn-default btn--raise-on-hover">
{{ 'form.cancel' | trans }}
</a>
{% block extra_actions_header %}
<div class="col-sm-6 col-md-4">
<!-- Main-actions -->
<div class="js-auto-collapse-buttons page-main-actions page-main-actions--no-tabs page-main-actions--inside-extra-actions-header">
<div class="btn-group">
{% block actions %}
<button type="submit" class="btn btn-primary btn--raise-on-hover">
{{ 'Save' | trans }}
</button>
<a href="{{ path(adminlistconfigurator.getIndexUrl()["path"], adminlistconfigurator.getIndexUrl()["params"]) }}" class="btn btn-default btn--raise-on-hover">
{{ 'form.cancel' | trans }}
</a>

{% if adminlistconfigurator.hasItemActions() %}
{% for itemAction in adminlistconfigurator.getItemActions() %}
<a class="btn btn-default btn--raise-on-hover" href="{{ path(itemAction.getUrlFor(entity)["path"], itemAction.getUrlFor(entity)[("params")] ) }}">
{% if itemAction.getIconFor(entity) is not null %}
<img src="{{ asset(itemAction.getIconFor(entity)) }}" alt="{{ itemAction.getLabelFor(entity) }}">
{% else %}
{{ itemAction.getLabelFor(entity) }}
{% endif %}
</a>
{% endfor %}
{% if adminlistconfigurator.hasItemActions() %}
{% for itemAction in adminlistconfigurator.getItemActions() %}
<a class="btn btn-default btn--raise-on-hover" href="{{ path(itemAction.getUrlFor(entity)["path"], itemAction.getUrlFor(entity)[("params")] ) }}">
{% if itemAction.getIconFor(entity) is not null %}
<img src="{{ asset(itemAction.getIconFor(entity)) }}" alt="{{ itemAction.getLabelFor(entity) }}">
{% else %}
{{ itemAction.getLabelFor(entity) }}
{% endif %}
{% endblock %}
</div>
</div>
</div>
</a>
{% endfor %}
{% endif %}
{% endblock %}
</div>
</header>
</div>
</div>
{% endblock %}

{% block content %}
<form action="{{ path(app.request.attributes.get('_route'), my_router_params()) }}" method="post" {{ form_enctype(form) }} novalidate="novalidate">
<!-- Scroll-actions -->
<div class="page-main-actions page-main-actions--top" id="page-main-actions-top">
<div class="btn-group">
Expand Down