{% extends "MapbenderManagerBundle::manager.html.twig" %}

{% block title %}{{ application.title }}{% endblock %}

{% block css %}
    {{parent()}}
    <link rel="stylesheet" href="{{ asset('components/codemirror/lib/codemirror.css') }}"/>
    <link rel="stylesheet" href="{{ asset('components/codemirror/theme/neo.css') }}"/>
{% endblock %}

{% block js %}
  {{parent()}}
  <script type="text/javascript" src="{{ asset('components/codemirror/lib/codemirror.js') }}"></script>
  <script type="text/javascript" src="{{ asset('components/codemirror/mode/yaml/yaml.js') }}"></script>
  <script type="text/javascript" src="{{ asset('components/codemirror/mode/css/css.js') }}"></script>
  <script type="text/javascript" src="{{ asset('components/codemirror/keymap/sublime.js') }}"></script>
  <script type="text/javascript" src="{{ asset('components/codemirror/addon/selection/active-line.js') }}"></script>

  <script type="text/javascript" src="{{ asset('bundles/mapbendermanager/js/application-edit.js') }}"></script>
{% endblock %}

{% block manager_content %}
  <a class="iconView iconBig right" target="_blank" href="{{ path('mapbender_core_application_application', {'slug': application.slug}) }}" title="{{ 'mb.manager.admin.application.view' | trans }}"></a>
    {{ form_start(form, {"attr": {"novalidate": "novalidate"}}) }}
    <div id="applicationTabContainer" class="tabContainer applicationTabContainer">
      <ul class="tabs">
        <li id="tabBaseData" class="tab active">{{"mb.manager.admin.application.edit.base_data" | trans }}</li>
        <li id="tabLayout" class="tab">{{"mb.manager.admin.application.layouts" | trans }}</li>
        <li id="tabLayers" class="tab">{{"mb.manager.admin.application.layersets" | trans }}</li>
        <li id="tabCustomCss" class="tab">{{"mb.manager.admin.application.custom_css" | trans }}</li>
        <li id="tabSecurity" class="tab">{{"mb.manager.admin.application.security.title" | trans }}</li>
      </ul>
      <div id="containerBaseData" class="container active containerBaseData row no-gutters">

        <div class="col-xs-8">{% include 'MapbenderManagerBundle:Application:form-basic.html.twig' %}</div>
        <div class="col-xs-4">
            <div class="screenshot_img{{ screenshot is empty ? ' default' }}">
                <div class="cell_edit">
                    <div class="delete button critical hidden">X</div>
                    <img alt="Load" data-load=true class="screenshot" src="{{ screenshot }}" />
                    <i class="iconAppDefault"></i>
                </div>
            </div>
        </div>
      </div>
      <div id="containerLayout" class="container">
        {% include 'MapbenderManagerBundle:Application:form-elements.html.twig' %}
      </div>
      <div id="containerLayers" class="container">
        {% include 'MapbenderManagerBundle:Application:form-layersets.html.twig' %}
      </div>
      <div id="containerCustomCss" class="container containerCustomCss">
        {% include 'MapbenderManagerBundle:Application:form-css.html.twig' %}
      </div>
      <div id="containerSecurity" class="container containerSecurity">
        {% block securityTab %}
          {% include 'MapbenderManagerBundle:Application:form-security.html.twig' %}
        {% endblock %}
      </div>
    </div>
    <div class="clearContainer"></div>
    <div class="button-group">
        <input type="submit" value="{{ 'mb.manager.admin.application.save' | trans }}" class="button"/>
        <a href="{{ path('mapbender_manager_application_index') }}" class="button critical">{{ 'mb.manager.admin.application.cancel' | trans}}</a>
    </div>
    {{ form_row(form._token) }}
    {{ form_end(form, {"render_rest": false}) }}
{% endblock %}
