<div class="rainlab-forum">
    {% if channel %}
        <p>&larr; <a href="{{ forumLink.channel|page({ slug: channel.slug }) }}">Back to {{ channel.title }}</a></p>
    {% endif %}

    {% if topic %}

        <h4>{{ topic.subject }}</h4>

        {% if member.is_moderator %}
            {{ form_open({ request: 'onMoveTopic' }) }}
                Move to:
                <select name="channel">
                    {% for channel in __SELF__.channels %}
                        <option value="{{ channel.id }}">{{ channel.title }}</option>
                    {% endfor %}
                </select>
                <button type="submit">Move</button>
            {{ form_close() }}
        {% endif %}

        {% partial __SELF__ ~ "::posts" %}
        {% partial __SELF__ ~ "::pagination" %}

        <h4>Reply to this discussion</h4>
        {% if member %}
            {% partial __SELF__ ~ "::postform" %}
        {% else %}
            <p>You should be logged in before you can post.</p>
        {% endif %}

    {% elseif channel %}

        <h4>Create a new discussion topic</h4>
        {% partial __SELF__ ~ "::createform" %}

    {% else %}

        <p>Topic not found</p>

    {% endif %}
</div>
<div class="rainlab-forum">
    {% if channel %}
        <p>&larr; <a href="{{ forumLink.channel|page({ slug: channel.slug }) }}">Back to {{ channel.title }}</a></p>
    {% endif %}

    {% if topic %}

        <h4>{{ topic.subject }}</h4>

        {% partial __SELF__ ~ "::controlpanel" %}

        {% partial __SELF__ ~ "::posts" %}

        {% partial __SELF__ ~ "::pagination" %}

        <h4>Reply to this discussion</h4>
        {% if member %}
            {% partial __SELF__ ~ "::postform" %}
        {% else %}
            <p>You should be logged in before you can post.</p>
        {% endif %}

    {% elseif channel %}

        <h4>Create a new discussion topic</h4>
        {% partial __SELF__ ~ "::createform" %}

    {% else %}

        <p>Topic not found</p>

    {% endif %}
</div>
Move control panel to its own partial
Move control panel to its own partial
