<%= "<div id=\"#{opts[:div_id]}\">".html_safe if opts[:div_id] %>
  
<div class="forum-topics">
  <div id="back-list">
    <%= link_to( t('dc_forum.forums_list'), {path: params[:path]} ) %> / 
    <%= link_to( forum.name, {path: params[:path], forum: forum.id} ) %> 
  </div>
  
  <div id="dc-forum-menu">
    <div class="dc-link">
      <%= link_to( 'Nazaj', {path: params[:path], forum: forum.id}, class: 'dc-animate' ) %>
    </div>
    <div class="dc-link">
      <%= link_to( t('dc_forum.new_reply'), { table: 'dc_reply', form_name: 'reply', 
                   controller: :cmsedit, action: 'new',
                   p_doc_id: topic.id, p_doc_class: topic.class.to_s }, 
                   target: 'iframe_edit', class: 'dc-animate', ref: 'nofollow') %>
    </div>
    <div class="dc-link">
      <%= link_to( t('dc_forum.new_topic'), 
          {controller: 'cmsedit', table: 'dc_forum_topic', form_name: 'dc_forum_topic', 
          action: 'new', forum: forum._id}, target: 'iframe_edit', class: 'dc-animate', ref: 'nofollow') %>
    </div>
    <div style="text-align: right; width: 100%;"><%= paginate replies %></div>    
  </div>
  
  <h2><%= forum.name %></h2>

  <div class="topic-top"><h3><%= topic.subject %></h3>
    <%= t('dc_forum.created_by') %>: <%= topic.created_by_name %> <%= dc_pretty_date(topic.created_at) %>
  </div>
  <div class="topic-body"><%= topic.body.html_safe %></div>
  
  <div class="news-replies">
    <h4>Odgovori</h4>
    <%= render partial: 'dc_replay/reply', formats: [:html], 
               locals: { replies: replies, parent_doc: topic } %>
  </div> 
</div>
 
<iframe id="iframe_edit" name="iframe_edit" scrolling="no"></iframe>
<%= "</div>".html_safe if opts[:div_id] %>