<div class="owm_forum_page owm_forum_group">
    <div class="owm_std_margin_bottom">
        <div class="owm_nav_cap owm_nav_cap_left_cont owm_nav_cap_right_cont owm_bg_color_3 owm_border clearfix">
            {if $canEdit}
                <a id="owm_forum_new_topic_link" href="#" class="owm_nav_left_item_add owm_float_right"></a>
            {elseif $promotion.status == 'promoted'}
                <a id="owm_forum_new_topic_link" href="javascript://" class="owm_nav_left_item_add owm_float_right" onclick="OWM.error('{$promotion.msg|escape:quotes}');"></a>
            {/if}
            <div class="owm_float_left">
                <a class="owm_nav_cap_left" href="{url_for_route for="section-default:[sectionId=>`$group->sectionId`]"}"></a>
            </div>
            <h3>{$group->name}</h3>
        </div>
        {component class="FORUM_MCMP_ForumSearch" scope="group" id="{$group->id}"}

        {if $stickyTopics || $regularTopics}
            <div id="forum-topics-wrapper">
                {include file="./group_index_ajax.html"}
            </div>
            <div class="owm_preloader owm_std_margin_bottom" id="forum_preloader" style="display:none;"></div>
            {script}
                // pagination
                $(document).ready(function ()
                {
                    var mobilePagination = new ForumPagination({
                        "paginateUrl" : "{url_for_route for="group-default:[groupId=>`$group->id`]"}",
                        "paginateWrapper" : $("#forum-topics-wrapper"),
                        "preloader" : $("#forum_preloader")
                    });
                });
            {/script}
        {else}
            {text key='forum+no_topic'}
        {/if}
    </div>
</div>

{if $canEdit}
    {script}
        $("#owm_forum_new_topic_link").bind("click", function(e){
            e.preventDefault();

            // show the topic form
            OWM.ajaxFloatBox("FORUM_MCMP_ForumAddTopic", [{ "groupId" : {$group->id} }], {
                "title" : "{text key='forum+create_new_topic'}"
            });
        });
    {/script}
{/if}