socialforge/app/views/organizations/_org_container.html.erb

39 lines
1.7 KiB
Plaintext
Raw Normal View History

<% containers.each do |container| %>
<div class="teacher-list-row">
<div>
<div class="teacher-avatar">
<%= link_to image_tag(url_to_avatar(container), :width => "90", :height => "90"), container.class == Course ? course_path(container) : project_path(container) %>
</div>
<div class="fl">
<div class="ml25 mb20"><span class="teacher-name"><%=link_to container.name, container.class == Course ? course_path(container) : project_path(container) %></span></div>
<div class="teacher-social-block">
<div class="block-num"><%= container.members.count %></div>
<div class="block-title">成员</div>
</div>
<div class="block-slice"></div>
<div class="teacher-social-block">
<div class="block-num"><%= container.attachments.count %></div>
<div class="block-title">资源</div>
</div>
</div>
<a href="javascript:void(0);" class="fr teacher-select" onclick="admin_hide_org($(this),'<%= container.id %>');" id="hide_<%= container.id %>">
<%= (container.class == Course ? container.is_excellent == 0 : container.hot ==0) ? "设为热门" : "取消设置" %></a>
</div>
<div class="cl"></div>
</div>
<% end %>
<script>
function hide(content, id){
if (content.text() == '设为热门')
$.ajax({
url: "/organizations/set_excellent_teacher?user=" + id + "&type=student",
type: "post"
});
else
$.ajax({
url: "/organizations/reset_excellent_teacher?user=" + id + "&type=student",
type: "post"
});
}
</script>