<% if field.field_type == "Resource" %>
    <div class="por_teachers" style="display:<%= field.hide == 0 ? 'block' : 'none' %>;">
      <h2 class="por_h2_index clear"><%= field.name %><%= link_to "更多>", org_subfield_files_path(field), :target => "_blank", :class => "f12 fontGrey2 fr" %></h2>
      <div>
        <ul class="por_teachers_li">
          <% get_attach_org2(field).each do |attach| %>
              <li >
                <%= link_to image_tag(url_to_avatar(attach.author),:width => "43", :height => "43", :class => "por_teachers_img fl mr15"), user_path(attach.author), :target => "_blank", :class => "fl" %>
                <!--<a href="javascript:void(0);" target="_blank" class="fl"><img src="/images/org_custom/homepageImage.jpg" width="43" height="43" alt="" class="por_teachers_img fl mr15"/></a>-->
                <div class="por_teachers_txt fl mt5">
                  <%= link_to attach.author, user_path(attach.author), :class => " por_teachers_name link-black fl", :target => "_blank"  %>
                  <p class="por_teachers_p fr">
                    <%= link_to truncate(attach.filename,length: 20, omission: '...'),
                             download_named_attachment_path(attach.id, attach.filename),
                             :title => attach.filename+"\n"+attach.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %>
                  </p>
                  <div class="cl"></div>
                  <p class="por_teachers_span ">
                    <span class="mr10">类型：<span><%= attach.tag_list[0] %></span></span>
                    <span class="mr10">下载：<span><%= attach.downloads %></span></span>
                    <span class="mr10">引用：<span><%= attach.quotes.nil? ? 0 : attach.quotes %></span></span>
                  </p>
                </div>
                <div class="cl"></div>
              </li>
          <% end %>
        </ul>
      </div>
    </div>
<% elsif field.field_type == "Comptec" || field.field_type == "Compstu" %>
    <div class="por_teachers" style="display:<%= field.hide == 0 ? 'block' : 'none' %>;">
      <ul id="por_teachers_nav">
        <li id="por_teachers_nav_1" class="por_teachers_hover" onclick="HoverLi(1);">
          <a href="javascript:void(0);" class="por_teachers_type">名师风采</a>
        </li>
        <!--<a href="javascript:void(0);" target="_blank" class="f12 fontGrey2 fr mt5">更多></a>-->
        <div class="cl"></div>
      </ul>
      <div id="por_teachers_content_1">
        <ul class="por_teachers_li">
          <% excellent_teachers.each do |teacher| %>
              <li >
                <%= link_to image_tag(url_to_avatar(teacher), :width => "43", :height => "43", :class => "por_teachers_img fl mr15"), user_path(teacher), :alt => "用户头像", :target => '_blank', :class => "fl" %>
                <div class="por_teachers_txt fl mt5">
                  <%=link_to teacher.try(:realname) ? teacher.try(:realname) :teacher.try(:login), user_path(teacher), :class => "por_teachers_name link-black fl", :target => '_blank' %>
                  <p class="por_teachers_p fr" title="<%= teacher.my_workplace %>"><%= teacher.my_workplace %></p>
                  <div class="cl"></div>
                  <p class="por_teachers_span ">
                    <% unless teacher.my_blogs_count == 0 %>
                        <span class=" mr10">博客 <%= teacher.my_blogs_count %></span>
                    <% end %>
                    <% unless teacher.courses.count == 0 %>
                        <span class="mr10">课程 <%= teacher.courses.count %></span>
                    <% end %>
                    <% unless teacher.my_students == 0 %>
                        <span class="mr10">学生 <%= teacher.my_students %></span>
                    <% end %>
                  </p>
                </div>
                <div class="cl"></div>
              </li>
          <% end %>
        </ul>
      </div>
    </div>

    <script>
        //名师列表
        function g(o){return document.getElementById(o);}
        function HoverLi(n){
            for(var i=1;i<=2;i++){
                g('por_teachers_nav_'+i).className='por_teachers_nomal';
                g('por_teachers_content_'+i).className='undis';
            }
            g('por_teachers_content_'+n).className='dis';
            g('por_teachers_nav_'+n).className='por_teachers_hover';
        }
    </script>
<% end %>
