
-begin 
  -params[:cat] = params[:cat] || 3
  -@militer_cat = MiliterCat.find(params[:cat])

  %a{:id => "documents"}
  .militer_index
    .main_container
      %h3 Documents
  
      -MiliterCat.where(:parent_id => nil).order("position").all.each do |militer_cat|
        -if I18n.locale == :fr
          -name =militer_cat.name
        -else
          -name = militer_cat.english_name
          
        =link_to raw(name), "?cat=#{militer_cat.id}#documents", :class => ("active" if @militer_cat and militer_cat.id == @militer_cat.id), :data => {:id => militer_cat.id}

  .militer


    -ig = 0
    -@militer_cat.children.order("position").each do |militer_cat|
      -ig += 1

      %h3
        .right
          %span.plus{:style => ("display:none;" if ig == 1)} +
          %span.moins{:style => ("display:block;" if ig == 1)}= "-"
        =militer_cat.name
      .militer_content{:style => ("display:block;" if ig == 1)}
        -i = 0
        .row
          -militer_cat.data_files.where(:lang_site_id => @lang.id).order("militer_position DESC, created_at DESC").each do |data_file|
            -i += 1

            =render data_file

            -if i== 2
              -i = 0
              =raw "</div><div class='clear'></div><div class='row'>"
          .clear

    .clear

    -i = 0
    .row
    -@militer_cat.data_files.where(:lang_site_id => @lang.id).order("militer_position DESC, created_at DESC").each do |data_file|
      -i += 1

      =render data_file

      -if i== 2
        -i = 0
        =raw "</div><div class='clear'></div><div class='row'>"
    .clear


    %br
    %br
    %br

    :coffeescript
      $(".militer h3").click ->
        $(this).next(".militer_content").toggle()
        $(this).find(".plus").toggle()
        $(this).find(".moins").toggle()

-rescue
  =""

