dev_haigong
huang 6 years ago
commit a696886800

@ -4060,28 +4060,30 @@ end
def shixun_feedback_xls shixun_ids
xls_report = StringIO.new
book = Spreadsheet::Workbook.new
sheet1 = book.create_worksheet :name => "报名列表"
sheet1 = book.create_worksheet :name => "实训反馈"
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
sheet1.row(0).default_format = blue
count_row = 1
shixuns = Shixun.where(:id => shixun_ids).includes(discusses: [:user])
sheet1.row(0).concat(["序号", "实训ID", "实训名称","评论数", "评论内容", "关卡", "评论者", "评论者职业",
sheet1.row(0).concat(["序号", "实训ID", "实训名称", "实训作者", "作者单位", "评论数", "评论内容", "关卡", "评论者", "评论者职业",
"评论者单位", "评论时间", "社区导师是否已回复"])
shixuns.each_with_index do |shixun, i|
discusses = shixun.discusses.where("user_id != ?", 1)
sheet1[count_row, 0] = i + 1
sheet1[count_row, 1] = shixun.identifier
sheet1[count_row, 2] = shixun.name
sheet1[count_row, 3] = discusses.count
sheet1[count_row, 3] = shixun.owner.show_real_name
sheet1[count_row, 4] = shixun.owner.school_name
sheet1[count_row, 5] = discusses.count
discusses.each_with_index do |discuss, j|
user = discuss.user
sheet1[count_row, 4] = discuss.content.gsub(/<img.*\/>/, "【图片评论】").gsub(/!\[\].+\)/, "【图片评论】")
sheet1[count_row, 5] = "#{discuss.position}"
sheet1[count_row, 6] = user.show_real_name
sheet1[count_row, 7] = user.identity
sheet1[count_row, 8] = user.school_name
sheet1[count_row, 9] = format_time discuss.created_at
sheet1[count_row, 10] = discuss.children.pluck(:user_id).include?(1) ? "" : ""
sheet1[count_row, 6] = discuss.content.gsub(/<img.*\/>/, "【图片评论】").gsub(/!\[\].+\)/, "【图片评论】")
sheet1[count_row, 7] = "#{discuss.position}"
sheet1[count_row, 8] = user.show_real_name
sheet1[count_row, 9] = user.identity
sheet1[count_row, 10] = user.school_name
sheet1[count_row, 11] = format_time discuss.created_at
sheet1[count_row, 12] = discuss.children.pluck(:user_id).include?(1) ? "" : ""
count_row += 1
end
#count_row += 1

@ -3,16 +3,14 @@
<div class="head-nav pr">
<ul id="header-nav">
<li class="active" style="display: none"><%= link_to "首页", home_path %></li>
<li><%= link_to "实训课程", subjects_path %></li>
<li><%= link_to "翻转课堂", courses_path %></li>
<li class="<%= subjects_controller.include?(params[:controller]) ? " active" : "" %>"><%= link_to "实训课程", subjects_path %></li>
<li class="<%= course_controller.include?(params[:controller]) ? " active" : "" %>"><%= link_to "翻转课堂", courses_path %></li>
<li class="pr <%= shixuns_controller.include?(params[:controller]) ? " active" : "" %>"><%= link_to "开发社区", shixuns_path %><img src="/images/educoder/hot-h.png" class="nav-img" /></li>
<li class="pr">
<%= link_to "开发社区", shixuns_path %>
<img src="/images/educoder/hot-h.png" class="nav-img" />
</li>
<% careers = Career.published.order("created_at asc") %>
<% if careers.present? %>
<li class="fl edu-menu-panel headIcon careershover" style="cursor: auto;">
<li class="fl edu-menu-panel headIcon careershover <%= params[:action] == "index" && params[:controller] == "careers" ? " active" : "" %>" style="cursor: auto;">
<p>职业路径</p>
<ul class="edu-menu-list edu-menu-listnew" style="top:60px">
<% careers.each do |career| %>
@ -21,8 +19,8 @@
</ul>
</li>
<% end %>
<li><%= link_to "竞赛", competitions_path %></li>
<li><%= link_to "问答", forums_path %></li>
<li class="<%= params[:controller] == "competitions" ? " active" : "" %>"><%= link_to "竞赛", competitions_path %></li>
<li class="<%= params[:controller] == "forums" ? " active" : "" %>"><%= link_to "问答", forums_path %></li>
<!--<li><%#= link_to "活动竞赛", competitions_path %></li>-->
</ul>
<div class="posi-search unlogin" id="posi-search" style="display: none" >
@ -89,21 +87,5 @@
window.onscroll=function(){
var sl=-Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
document.getElementById('nHeader').style.left=sl+'px';
}
$(function () {
var $header = $("#header-nav").children("li");
<% if params[:controller] == "welcome" %>
$("#header-nav").children("li").eq(0).addClass("active");
<% elsif subjects_controller.include?(params[:controller]) %>
$("#header-nav").children("li").eq(1).addClass("active");
<% elsif course_controller.include?(params[:controller]) %>
$("#header-nav").children("li").eq(2).addClass("active");
<% elsif shixuns_controller.include?(params[:controller]) %>
$header.length == 7 ? $header.eq(2).addClass("active") : $header.eq(3).addClass("active");
<% elsif params[:controller] == "competitions" %>
$header.length == 7 ? $header.eq(5).addClass("active") : $header.eq(4).addClass("active");
<% elsif params[:controller] == "forums" %>
$header.length == 7 ? $header.eq(6).addClass("active") : $header.eq(5).addClass("active");
<% end %>
})
};
</script>
Loading…
Cancel
Save