<!DOCTYPE html>
<html lang="pt-br">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="Content-Language" content="pt-br">
        <title>{{ @app.title }}{{ isset(@page.title) ? ' :: '.@page.title : '' }}{{ isset(@page.description) ? ' - ' . @page.description : '' }}</title>
        <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
        <link href="{{ @BASE }}/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <!-- Ionicons -->
        {*<link href="//code.ionicframework.com/ionicons/1.5.2/css/ionicons.min.css" rel="stylesheet" type="text/css" />*}
        <!-- Theme style -->
        <link href="{{ @BASE }}/assets/css/AdminLTE.css" rel="stylesheet" type="text/css" />

        <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
          <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
        <![endif]-->
        <style>
        td[onclick]:hover {
            cursor: pointer;
        }
        </style>

        <repeat group="{{ @meta.styles.raw }}" value="{{ @content }}">
            <style>{{ \Template::Instance()->resolve(@content) }}</style>
        </repeat>
    </head>
    <body class="skin-{{ isset(@settings.admin.skin) ? @settings.admin.skin : 'blue' }} {{ isset(@settings.admin.layout) ? @settings.admin.layout : '' }}">
        <!-- header logo: style can be found in header.less -->
        <header class="header">
            <a href="{{ @BASE }}{{ 'admin_dashboard'|alias }}" class="logo{{ @settings.admin.color ? ' bg-'.@settings.admin.color : '' }}">
                <!-- Add the class icon to your logo image or logo icon to add the margining -->
                {{ @app.title }}
            </a>
            <!-- Header Navbar: style can be found in header.less -->
            <nav class="navbar navbar-static-top{{ @settings.admin.color ? ' bg-'.@settings.admin.color : '' }}" role="navigation">
                <!-- Sidebar toggle button-->
                <a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button">
                    <span class="sr-only">Alternar navegação</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <div class="navbar-right">
                    <ul class="nav navbar-nav">
                        <place name="navbar" />
                        {*
                        <!-- Messages: style can be found in dropdown.less-->
                        <li class="dropdown messages-menu">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <i class="glyphicon glyphicon-envelope"></i>
                                <span class="label label-success">4</span>
                            </a>
                            <ul class="dropdown-menu">
                                <li class="header">You have 4 messages</li>
                                <li>
                                    <!-- inner menu: contains the actual data -->
                                    <ul class="menu">
                                        <li><!-- start message -->
                                            <a href="#">
                                                <div class="pull-left">
                                                    <img src="{{ @BASE }}/assets/img/avatar3.png" class="img-circle" alt="User Image"/>
                                                </div>
                                                <h4>
                                                    Support Team
                                                    <small><i class="glyphicon glyphicon-clock-o"></i> 5 mins</small>
                                                </h4>
                                                <p>Why not buy a new awesome theme?</p>
                                            </a>
                                        </li><!-- end message -->
                                        <li>
                                            <a href="#">
                                                <div class="pull-left">
                                                    <img src="{{ @BASE }}/assets/img/avatar2.png" class="img-circle" alt="user image"/>
                                                </div>
                                                <h4>
                                                    AdminLTE Design Team
                                                    <small><i class="glyphicon glyphicon-clock-o"></i> 2 hours</small>
                                                </h4>
                                                <p>Why not buy a new awesome theme?</p>
                                            </a>
                                        </li>
                                        <li>
                                            <a href="#">
                                                <div class="pull-left">
                                                    <img src="{{ @BASE }}/assets/img/avatar.png" class="img-circle" alt="user image"/>
                                                </div>
                                                <h4>
                                                    Developers
                                                    <small><i class="glyphicon glyphicon-clock-o"></i> Today</small>
                                                </h4>
                                                <p>Why not buy a new awesome theme?</p>
                                            </a>
                                        </li>
                                        <li>
                                            <a href="#">
                                                <div class="pull-left">
                                                    <img src="{{ @BASE }}/assets/img/avatar2.png" class="img-circle" alt="user image"/>
                                                </div>
                                                <h4>
                                                    Sales Department
                                                    <small><i class="glyphicon glyphicon-clock-o"></i> Yesterday</small>
                                                </h4>
                                                <p>Why not buy a new awesome theme?</p>
                                            </a>
                                        </li>
                                        <li>
                                            <a href="#">
                                                <div class="pull-left">
                                                    <img src="{{ @BASE }}/assets/img/avatar.png" class="img-circle" alt="user image"/>
                                                </div>
                                                <h4>
                                                    Reviewers
                                                    <small><i class="glyphicon glyphicon-clock-o"></i> 2 days</small>
                                                </h4>
                                                <p>Why not buy a new awesome theme?</p>
                                            </a>
                                        </li>
                                    </ul>
                                </li>
                                <li class="footer"><a href="#">See All Messages</a></li>
                            </ul>
                        </li>
                        *}{*
                        <!-- Notifications: style can be found in dropdown.less -->
                        <check if="{{ 'softsat.process.processo_list' | role }}">
                        <li class="dropdown notifications-menu">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <i class="glyphicon glyphicon-warning"></i>
                                <span class="label label-warning">5</span>
                            </a>
                            <ul class="dropdown-menu">
                                <li class="header">Avisos</li>
                                <li>
                                    <!-- inner menu: contains the actual data -->
                                    <ul class="menu">
                                        <li>
                                            <a href="#">
                                                <i class="ion ion-ios7-people info"></i> 5 new members joined today
                                            </a>
                                        </li>
                                        <li>
                                            <a href="#">
                                                <i class="glyphicon glyphicon-warning danger"></i> Very long description here that may not fit into the page and may cause design problems
                                            </a>
                                        </li>
                                        <li>
                                            <a href="#">
                                                <i class="glyphicon glyphicon-knight warning"></i> 5 new members joined
                                            </a>
                                        </li>

                                        <li>
                                            <a href="#">
                                                <i class="ion ion-ios7-cart success"></i> 25 sales made
                                            </a>
                                        </li>
                                        <li>
                                            <a href="#">
                                                <i class="ion ion-ios7-person danger"></i> You changed your username
                                            </a>
                                        </li>
                                    </ul>
                                </li>
                                <li class="footer"><a href="{{ 'softsat_process_processo_list'|alias }}">Ver todos os processos</a></li>
                            </ul>
                        </li>
                        </check>*}
                        {*
                        <!-- Tasks: style can be found in dropdown.less -->
                        <li class="dropdown tasks-menu">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <i class="glyphicon glyphicon-tasks"></i>
                                <span class="label label-danger">9</span>
                            </a>
                            <ul class="dropdown-menu">
                                <li class="header">Processos em andamento</li>
                                <li>
                                    <!-- inner menu: contains the actual data -->
                                    <ul class="menu">
                                        <li><!-- Task item -->
                                            <a href="#">
                                                <h3>
                                                    Design some buttons
                                                    <small class="pull-right">20%</small>
                                                </h3>
                                                <div class="progress xs">
                                                    <div class="progress-bar progress-bar-aqua" style="width: 20%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
                                                        <span class="sr-only">20% Complete</span>
                                                    </div>
                                                </div>
                                            </a>
                                        </li><!-- end task item -->
                                        <li><!-- Task item -->
                                            <a href="#">
                                                <h3>
                                                    Create a nice theme
                                                    <small class="pull-right">40%</small>
                                                </h3>
                                                <div class="progress xs">
                                                    <div class="progress-bar progress-bar-green" style="width: 40%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
                                                        <span class="sr-only">40% Complete</span>
                                                    </div>
                                                </div>
                                            </a>
                                        </li><!-- end task item -->
                                        <li><!-- Task item -->
                                            <a href="#">
                                                <h3>
                                                    Some task I need to do
                                                    <small class="pull-right">60%</small>
                                                </h3>
                                                <div class="progress xs">
                                                    <div class="progress-bar progress-bar-red" style="width: 60%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
                                                        <span class="sr-only">60% Complete</span>
                                                    </div>
                                                </div>
                                            </a>
                                        </li><!-- end task item -->
                                        <li><!-- Task item -->
                                            <a href="#">
                                                <h3>
                                                    Make beautiful transitions
                                                    <small class="pull-right">80%</small>
                                                </h3>
                                                <div class="progress xs">
                                                    <div class="progress-bar progress-bar-yellow" style="width: 80%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
                                                        <span class="sr-only">80% Complete</span>
                                                    </div>
                                                </div>
                                            </a>
                                        </li><!-- end task item -->
                                    </ul>
                                </li>
                                <li class="footer"><a href="{{ 'softsat_process_processo_list'|alias }}">Ver todos os processos</a></li>
                            </ul>
                        </li>
                        *}
                        <!-- User Account: style can be found in dropdown.less -->
                        <li class="dropdown user user-menu">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <i class="glyphicon glyphicon-user"></i>
                                <span>{{ @admin.firstname }} <i class="caret"></i></span>
                            </a>
                            <ul class="dropdown-menu">
                                <!-- User image -->
                                <li class="user-header bg-{{ @settings.admin.color ? @settings.admin.color : (@settings.admin.skin == 'black' ? @settings.admin.skin : 'light-blue') }}">
                                    <img src="{{ @BASE }}{{ @admin.photo ? '/'.@UPLOADS.@admin.photo : '/assets/img/avatar5.png' }}" class="img-circle" alt="Imagem do Usuário" />
                                    <p>
                                        {{ @admin.firstname }} - {{ ucfirst(@admin.group.description) }}
                                        <small>Membro desde {{ date('M, Y', strtotime(@admin.created_on)) }}</small>
                                    </p>
                                </li>
                                <!-- Menu Body -->
                                <li class="user-body">
                                    <div class="col-xs-4 text-center">
                                <check if="{{ 'hwapx.admin.settings' | role }}">
                                        <a href="{{ @BASE }}{{ 'admin_settings'|alias }}">Configurações</a>
                                </check>
                                    </div>
                                    <div class="col-xs-4 text-center">
                                        <!--<a href="#">Followers</a>-->
                                    </div>
                                    <div class="col-xs-4 text-center">
                                <check if="{{ 'hwapx.logs.logs' | role }}">
                                        <a href="{{ @BASE }}{{ 'admin_logs'|alias }}">Logs</a>
                                </check>
                                    </div>
                                </li>
                                <!-- Menu Footer-->
                                <li class="user-footer">
                                    <div class="pull-left">
                                        <a href="{{ @BASE }}{{ 'admin_user_edit', 'id='.@SESSION.admin.id | alias }}" class="btn btn-default btn-flat"><span class="glyphicon glyphicon-user"></span> &nbsp;Perfil</a>
                                    </div>
                                    <div class="pull-right">
                                        <a href="{{ @BASE }}{{ 'admin_logout'|alias }}" class="btn btn-default btn-flat"><span class="glyphicon glyphicon-log-out"></span> &nbsp;Sair</a>
                                    </div>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </nav>
        </header>
        <div class="wrapper row-offcanvas row-offcanvas-left">
            <!-- Left side column. contains the logo and sidebar -->
            <aside class="left-side sidebar-offcanvas{{ @settings.admin.sidebar_color ? ' bg-'.@settings.admin.sidebar_color : '' }}">
                <!-- sidebar: style can be found in sidebar.less -->
                <section class="sidebar">
                    <!-- Sidebar user panel -->
                    <div class="user-panel">
                        <div class="pull-left image">
                            <img src="{{ @BASE }}{{ @admin.photo ? '/'.@UPLOADS.@admin.photo : '/assets/img/avatar5.png' }}" class="img-circle" alt="Imagem do Usuário" />
                        </div>
                        <div class="pull-left info">
                            <p>Olá {{ @admin.firstname }}</p>
                            <a href="javascript:void(0);">
                                <span class="glyphicon glyphicon-tower"></span> {{ @admin.group.description }}
                            </a>
                        </div>
                    </div>
                    {*
                    <!-- search form -->
                    <form action="#" method="get" class="sidebar-form">
                        <div class="input-group">
                            <input type="text" name="q" class="form-control" placeholder="Localizar..."/>
                            <span class="input-group-btn">
                                <button type='submit' name='seach' id='search-btn' class="btn btn-flat"><i class="glyphicon glyphicon-search"></i></button>
                            </span>
                        </div>
                    </form>
                    <!-- /.search form -->
                    *}
                    <!-- sidebar menu: : style can be found in sidebar.less -->
                    <ul class="sidebar-menu">
                        <repeat group="{{ @_sidebar }}" key="{{ @slug }}" value="{{ @data }}">
                            <check if="{{ @data.role | role }}">
                                {~ 
                                    @_has_childs = false;
                                    @_child_selected = false;
                                    foreach (@data as @key => @link):
                                        if((int)@key === @key && \Hwapx\Core\Library\ModuleManager::instance()->hasRole(@link.role)):
                                            @_has_childs = true;
                                            if(isset(@link.route) && (strpos(@URI, @BASE.\Base::instance()->alias(@link.route)) === 0)):
                                                @_child_selected = true;
                                                break;
                                            endif;
                                        endif;
                                    endforeach;
                                    @_uri = @BASE.\Base::instance()->alias(@data.route);
                                    @_selected = isset(@data.route) && (@_uri === '/' ? @_uri === @URI : strpos(@URI, @_uri) === 0) ? true  : false;
                                    @_showitem = @_has_childs || isset(@data.route);
                                 ~}
                                <check if="{{ @_showitem }}">
                                <li class="{{ @_has_childs ? 'treeview' : ''}}{{ @_child_selected || @_selected ? ' active' : '' }}">
                                    <a href="{{ isset(@data.route) ? @_uri : 'javascript:void(0);' }}">
                                        {{ isset(@data.icon) ? '<i class="glyphicon glyphicon-'.@data.icon.'"></i>' : '' }}
                                        <span>{{ @data.label }}</span>
                                        <check if="{{ isset(@data.tip) }}">
                                            <small class="badge pull-right {{ isset(@data.tip.color) ? 'bg-'.@data.tip.color : '' }}">{{ isset(@data.tip.label) ? @data.tip.label : @data.tip }}</small>
                                        </check>
                                        <check if="{{ @_has_childs }}">
                                            <i class="glyphicon glyphicon-angle-{{ @_child_selected ? 'down' : 'left' }} pull-right"></i>
                                        </check>
                                    </a>
                                    <check if="{{ @_has_childs }}">
                                        <ul class="treeview-menu{{ @settings.admin.sidebar_color ? ' bg-'.str_replace('-gradient', '', @settings.admin.sidebar_color) : '' }}">
                                            <repeat group="{{ @data }}" key="{{ @key }}" value="{{ @link_data }}">
                                                <check if="{{ ((int)@key === @key) && \Hwapx\Core\Library\ModuleManager::instance()->hasRole(@link_data.role) }}">
                                                    {~ @_uri = isset(@link_data.route) ? @BASE.\Base::instance()->alias(@link_data.route) : null ~}
                                                    <li class="{{ @_uri && (strpos(@URI, @_uri) === 0) ? 'active' : '' }}">
                                                        <a href="{{ isset(@link_data.route) ? @_uri : 'javascript:void(0);' }}">
                                                            <i class="glyphicon glyphicon-{{ isset(@link_data.icon) ? @link_data.icon : 'angle-double-right' }}"></i>
                                                            {{ isset(@link_data.label) ? @link_data.label : @link_data }}

                                                            <check if="{{ isset(@link_data.tip) }}">
                                                                <small class="badge pull-right {{ isset(@link_data.tip.color) ? 'bg-'.@link_data.tip.color : '' }}">{{ isset(@link_data.tip.label) ? @link_data.tip.label : @link_data.tip }}</small>
                                                            </check>
                                                        </a>
                                                    </li>
                                                </check>
                                            </repeat>
                                        </ul>
                                    </check>
                                </li>
                                </check>
                            </check>
                        </repeat>
                        <!--
                        <li>
                            <a href="../../index.html">
                                <i class="glyphicon glyphicon-dashboard"></i> <span>Dashboard</span>
                            </a>
                        </li>
                        <li>
                            <a href="../widgets.html">
                                <i class="glyphicon glyphicon-th"></i> <span>Widgets</span> <small class="badge pull-right bg-green">new</small>
                            </a>
                        </li>
                        <li class="treeview">
                            <a href="#">
                                <i class="glyphicon glyphicon-bar-chart-o"></i>
                                <span>Charts</span>
                                <i class="glyphicon glyphicon-angle-left pull-right"></i>
                            </a>
                            <ul class="treeview-menu">
                                <li><a href="../charts/morris.html"><i class="glyphicon glyphicon-angle-double-right"></i> Morris</a></li>
                                <li><a href="../charts/flot.html"><i class="glyphicon glyphicon-angle-double-right"></i> Flot</a></li>
                                <li><a href="../charts/inline.html"><i class="glyphicon glyphicon-angle-double-right"></i> Inline charts</a></li>
                            </ul>
                        </li>
                        <li class="treeview">
                            <a href="#">
                                <i class="glyphicon glyphicon-laptop"></i>
                                <span>UI Elements</span>
                                <i class="glyphicon glyphicon-angle-left pull-right"></i>
                            </a>
                            <ul class="treeview-menu">
                                <li><a href="../UI/general.html"><i class="glyphicon glyphicon-angle-double-right"></i> General</a></li>
                                <li><a href="../UI/icons.html"><i class="glyphicon glyphicon-angle-double-right"></i> Icons</a></li>
                                <li><a href="../UI/buttons.html"><i class="glyphicon glyphicon-angle-double-right"></i> Buttons</a></li>
                                <li><a href="../UI/sliders.html"><i class="glyphicon glyphicon-angle-double-right"></i> Sliders</a></li>
                                <li><a href="../UI/timeline.html"><i class="glyphicon glyphicon-angle-double-right"></i> Timeline</a></li>
                            </ul>
                        </li>
                        <li class="treeview active">
                            <a href="#">
                                <i class="glyphicon glyphicon-edit"></i> <span>Forms</span>
                                <i class="glyphicon glyphicon-angle-left pull-right"></i>
                            </a>
                            <ul class="treeview-menu">
                                <li class="active"><a href="general.html"><i class="glyphicon glyphicon-angle-double-right"></i> General Elements</a></li>
                                <li><a href="advanced.html"><i class="glyphicon glyphicon-angle-double-right"></i> Advanced Elements</a></li>
                                <li><a href="editors.html"><i class="glyphicon glyphicon-angle-double-right"></i> Editors</a></li>
                            </ul>
                        </li>
                        <li class="treeview">
                            <a href="#">
                                <i class="glyphicon glyphicon-table"></i> <span>Tables</span>
                                <i class="glyphicon glyphicon-angle-left pull-right"></i>
                            </a>
                            <ul class="treeview-menu">
                                <li><a href="../tables/simple.html"><i class="glyphicon glyphicon-angle-double-right"></i> Simple tables</a></li>
                                <li><a href="../tables/data.html"><i class="glyphicon glyphicon-angle-double-right"></i> Data tables</a></li>
                            </ul>
                        </li>
                        <li>
                            <a href="../calendar.html">
                                <i class="glyphicon glyphicon-calendar"></i> <span>Calendar</span>
                                <small class="badge pull-right bg-red">3</small>
                            </a>
                        </li>
                        <li>
                            <a href="../mailbox.html">
                                <i class="glyphicon glyphicon-envelope"></i> <span>Mailbox</span>
                                <small class="badge pull-right bg-yellow">12</small>
                            </a>
                        </li>
                        <li class="treeview">
                            <a href="#">
                                <i class="glyphicon glyphicon-folder"></i> <span>Examples</span>
                                <i class="glyphicon glyphicon-angle-left pull-right"></i>
                            </a>
                            <ul class="treeview-menu">
                                <li><a href="../examples/invoice.html"><i class="glyphicon glyphicon-angle-double-right"></i> Invoice</a></li>
                                <li><a href="../examples/login.html"><i class="glyphicon glyphicon-angle-double-right"></i> Login</a></li>
                                <li><a href="../examples/register.html"><i class="glyphicon glyphicon-angle-double-right"></i> Register</a></li>
                                <li><a href="../examples/lockscreen.html"><i class="glyphicon glyphicon-angle-double-right"></i> Lockscreen</a></li>
                                <li><a href="../examples/404.html"><i class="glyphicon glyphicon-angle-double-right"></i> 404 Error</a></li>
                                <li><a href="../examples/500.html"><i class="glyphicon glyphicon-angle-double-right"></i> 500 Error</a></li>
                                <li><a href="../examples/blank.html"><i class="glyphicon glyphicon-angle-double-right"></i> Blank Page</a></li>
                            </ul>
                        </li>-->
                    </ul>
                </section>
                <!-- /.sidebar -->
            </aside>

            <!-- Right side column. Contains the navbar and content of the page -->
            <aside class="right-side">
                <!-- Content Header (Page header) -->
                <section class="content-header">
                    <h1>
                        {{ isset(@page.title) ? @page.title : '' }}
                        <small>{{ isset(@page.description) ? @page.description : '' }}</small>
                    </h1>
                    <ol class="breadcrumb">
                        <li><a href="{{ @BASE }}{{ 'admin_dashboard'|alias }}"><i class="glyphicon glyphicon-dashboard"></i> Dashboard</a></li>
                    <check if="{{ !empty(@breadcrumbs) }}">
                        <true>
                            <repeat group="{{ @breadcrumbs }}" key="{{ @route }}" value="{{ @desc }}"  counter="{{ @counter }}">
                                <check if="{{ !is_numeric(@route) }}">
                                    <true>
                                        <li><a href="{{ @BASE }}{{ @route|alias }}">{{ @desc }}</a></li>
                                    </true>
                                    <false>
                                        <li class="active">{{ @desc }}</li>
                                    </false>
                                </check>
                            </repeat>
                        </true>
                        <false>
                            <li class="active">{{ @page.title }}</li>
                        </false>
                    </check>
                    </ol>
                </section>

                <!-- Main content -->
                <section class="content">
                    <div class="row">
                        <div class="col-md-12">
                            <include href="hwapx/admin/admin/partials/flash.html" />
                        </div>
                    </div>