Edição - 28/07/2015 às 08:30
alterar.html.twig
{% extends 'AppBundle:util:form_cad.html.twig' %}
{% block javascript %}
{% javascripts '@AppBundle/Resources/public/js/AcessControl/cadastro.js' output='js/usuario/cadastro.js' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
<script type="text/javascript">
window.perfil = {
{% for nome, id in perfis %}
{{ nome }}: '{{ id }}',
{% endfor %}
};
</script>
{% endblock %}
form_cad.html.twig
{% extends 'AppBundle::base.html.twig' %}
{% form_theme form 'AppBundle:util:form.template.html.twig' %}
{% import "AppBundle:util:macro_form.html.twig" as macro %}
{% block conteudo %}
{% spaceless %}
<div class="col-md-12 col-lg-12">
<div class="col-md-12 col-lg-10 col-lg-offset-1">
<div class="panel panel-primary box-shadow-filter">
<div class="panel-heading">
<h3 class="panel-title text-center">{{ title }}</h3>
</div>
<div class="panel-body" id="formulario-cadastro">
{% block panel_body %}
{{ form_start(form) }}
{{ form_widget(form) }}
{{ form_end(form) }}
{% endblock %}
</div>
</div>
</div>
</div>
{% endspaceless %}
{% endblock %}
base.html.twig
{% spaceless %}
<!doctype html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}"/>
<title>{% block title %} {{ project_name }} {% endblock %}</title>
{% stylesheets 'bundles/app/css/bootstrap.min.css'
'@AppBundle/Resources/public/css/jquery-ui/jquery-ui.min.css'
'@AppBundle/Resources/public/css/jquery-ui/jquery-ui.theme.min.css'
'bundles/app/css/bootstrap-theme.min.css'
'@AppBundle/Resources/public/css/layout.css'
'@AppBundle/Resources/public/css/sweetalert.min.css'filter='cssrewrite' output='css/main.css' %}
<link rel="stylesheet" href="{{ asset_url }}"/>
{% endstylesheets %}
{% block stylesheets %}{% endblock %}
{% javascripts
'@AppBundle/Resources/public/js/plugin/jquery-1.11.2.min.js'
'@AppBundle/Resources/public/js/plugin/bootstrap.min.js'
'@AppBundle/Resources/public/js/plugin/jquery-ui.min.js'
'@AppBundle/Resources/public/js/plugin/jquery-mask.min.js'
'@AppBundle/Resources/public/js/plugin/sweetalert.min.js'
'@AppBundle/Resources/public/js/plugin/jquery.dataTables.min.js'
'@AppBundle/Resources/public/js/util/modal.js'
'@AppBundle/Resources/public/js/util/setup.js'
'@AppBundle/Resources/public/js/util/util.js'
'@AppBundle/Resources/public/js/util/processo.js'
'@AppBundle/Resources/public/js/*.js'output='js/main.js' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
{% block javascript %}{% endblock %}
</head>
<body>
{% block navbar %}
{% block navbar_main %}
<div class="navbar-main">
<div class="col-md-2 text-center logo-top">
{% block image_top %}
<a href="{{ path('homeListar') }}">
<img src="{{ asset('bundles/app/images/logo_cliente_azul.gif') }}"/>
</a>
{% endblock %}
</div>
<div class="col-md-3 text-center project-name">
{% block project_name_top %}
{{ project_name }}
{% endblock %}
</div>
<div class="col-md-1 pull-right"></div>
<div class="col-md-3 hidden-xs hidden-sm pull-right">
{% block user_top %}
{% if app.user is not null %}
<div class="divFotoUsuarioLogado">
{% set nome = app.user.nomUsuario|split(' ') %}
<img class="img-circle" src="http://URL-REMOVIDA/foto/{{ app.user.username }}.jpg"
title="" alt="" width="40" height="40"/>
</div>
<div class="divNomeUsuarioLogado">
Olá,<br/>
<span class="text-uppercase">{{ nome[0] }}</span>
</div>
{% endif %}
{% endblock %}
</div>
</div>
{% endblock %}
{% block navbar_menu %}
{{ render(controller('AppBundle:Menu/Menu:accessMenu')) }}
{% endblock %}
{% endblock %}
<div class="container-fluid">
<div class="row">
{% include 'AppBundle:util:session-alert.html.twig' %}
{% block modal %}
{{ include("AppBundle:util:modal-alert.html.twig") }}
{% endblock %}
{% block conteudo %}
{% endblock %}
</div>
</div>
</body>
</html>
{% endspaceless %}