You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pgfqe6ch8/app/views/users/show.js.erb

37 lines
1.6 KiB

6 years ago
<% if @type %>
<% unless params[:order] %>
$(".user-nav-item li").removeClass("active");
$(".white-panel li").removeClass("active");
$("#<%= @type %>").addClass("active");
<% case @type %>
<% when "a_course", "p_course", "l_course" %>
$("#user_course").addClass("active");
<% when "a_shixun", "p_shixun", "l_shixun" %>
$("#user_shixun").addClass("active");
<% when "a_path", "p_path", "l_path" %>
$("#user_path").addClass("active");
<% when "a_project", "p_project", "l_project" %>
$("#user_project").addClass("active");
<% when "m_bank", "p_bank" %>
$("#user_bank").addClass("active");
5 years ago
<% when "a_package", "p_package", "l_package" %>
$("#user_package").addClass("active");
6 years ago
<% end %>
$(".white-panel").hide();
$("#<%= @type %>").parent().show();
<% end %>
<% case @type %>
<% when "a_shixun", "l_shixun", "p_shixun" %>
$("#user_object_list").html("<%= j (render :partial => "l_shixun") %>");
<% when "a_course", "l_course", "p_course" %>
$("#user_object_list").html("<%= j (render :partial => "l_course") %>");
<% when "a_project", "l_project", "p_project" %>
$("#user_object_list").html("<%= j (render :partial => "l_project") %>");
<% when "a_path", "l_path", "p_path" %>
$("#user_object_list").html("<%= j (render :partial => "p_path") %>");
<% when "m_bank", "p_bank" %>
$("#user_object_list").html("<%= j (render :partial => "m_bank") %>");
<% when "a_package", "p_package", 'l_package' %>
$("#user_object_list").html("<%= j (render :partial => "project_package") %>");
6 years ago
<% end %>
<% end %>