{% set layout = "ClarolineCoreBundle:Workspace:layout.html.twig" %}

{% if isDesktop() %}
    {% set layout = "ClarolineCoreBundle:Desktop:layout.html.twig" %}
{% endif %}

{% extends layout %}

{% block title %}{{ 'search' | trans({}, 'platform') ~ ' (' ~ _resource.getResourceNode().getName() ~ ')' ~ ' - ' ~ parent() | striptags | raw  }}{% endblock %}

{% block resourceBreadcrumb %}
    <li><a href="{{ path('claro_forum_categories', { 'forum': category.getForum().getId() }) }}">{{ _resource.getResourceNode().getName() }}</a></li>
    <li><a href="{{ path('claro_forum_subjects', { 'category': category.getId() }) }}">{{ _resource.getResourceNode().getName() }}</a></li>
    <li class="active">{{ 'new_subject'|trans({}, 'forum') }}</li>
{% endblock %}

{% block section_content %}
    <div class="panel-heading">
        <h3 class="panel-title">{{ _resource.getResourceNode().getName() }} ({{ 'new_subject'|trans({}, 'forum') }})</h3>
    </div>
    {% form_theme form 'ClarolineCoreBundle::form_theme.html.twig' %}
    <form novalidate="novalidate" action="{{ _path('claro_forum_create_subject', {'category': category.getId()}) }}" method="post" {{ form_enctype(form) }} id="subject_form">
        <div class="panel-body">
           {{ form_errors(form.title) }}
           {{ form_row(form.title) }}
           {{ form_errors(form.message.content) }}
           {{ form_row(form.message.content) }}
           {{ form_rest(form) }}
        </div>
        <div class="panel-footer">
            <button type="submit" class="btn btn-primary">{{ 'ok'|trans({}, 'platform') }}</button>
            <a class="btn btn-default" href="{{ _path('claro_forum_subjects', { 'category': category.getId() }) }}">{{ 'cancel' | trans({}, 'platform') }}</a>
        </div>
    </form>
{% endblock %}
