{% extends is_mobile ? "::base_m.html.twig" : "::base.html.twig" %}

{% block title %}{% if edit %}Редактирование публикации{% else %}Новая публикация{% endif %}{% endblock %}
{% block breadcrumbs %}{% if breadcrumbs %}{{ breadcrumbs|raw }}{% endif %}{% endblock %}

{% block css %}
    <link rel="stylesheet" type="text/css" href="{{ asset('bundles/utilites/css/bbcode.css') }}" />
{% endblock %}
{% block js %}
    {{ include('::bbcode-options-js.html.twig') }}
    <script type="text/javascript" src="{{ asset('bundles/utilites/js/bbcode.js') }}"></script>
{% endblock %}

{% block body %}
{% form_theme form 'NeagMainBundle:Form:fields.html.twig' %}
<style>
.markItUp  {
    width: 700px;
}
#form-blog #form_title,
#form-blog #form_annotation,
#form-blog #form_imageTitle {
    width: 400px;
}
#form-blog label {
    width: 250px;
}
#form-blog .form-help {
    margin-left: 270px;
}
#form-blog .form-submit {
    margin-left: 270px;
}
#form-blog #form_persons,
#form-blog #form_tags {
    height: 100px;
}
#form-blog-image {
    clear: both;
    float: left;
    margin-right: 10px;
    margin-bottom: 10px;
}
/*
#form-blog-image-comment label {
    float: none;
    clear: both;
    font-weight: normal;    
}
*/
#form-blog-image-remove label {
    float: none;    
    font-weight: normal;
}
</style>

<form class="form" id="form-blog" action="{{ action }}" method="post" {{ form_enctype(form) }}>

    {% if image_src %} 
    <div id="form-blog-image">    
        <img src="{{ asset(image_src) }}" width="{{image_width}}" height="{{image_height}}" border="0" />
    </div>
    <div id="form-blog-image-comment">
        Текущее изображение
    </div>
    <div id="form-blog-image-remove">
        <input type="checkbox" name="remove_image" value="remove_image" /> Удалить
    </div>
    <hr style="clear: both;" /> 
    {% endif %}

    {{ form_widget(form) }}

    {% if not edit %}
    <input type="submit" name="submit" value="Создать новую публикацию" class="form-submit" />
    {% else %}
    <input type="submit" name="submit" value="Внести изменения" class="form-submit" />
    {% endif %}
</form>

<script type="text/javascript">

$(document).ready(function() {    
});
</script>
{% endblock %}
