socialforge/app/views/layouts/base_homework.html.erb

250 lines
12 KiB
Plaintext

<% @nav_dispaly_course_all_label = 1
@nav_dispaly_forum_label = 1
@nav_dispaly_course_label = nil
@nav_dispaly_store_all_label = 1 %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<title><%=h l(:label_active_homework) << " - Trustie" %></title>
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
</head>
<body class="<%= h body_css_classes %>">
<% course = @bid.courses.first %>
<% if course %>
<div id="wrapper">
<div id="wrapper2">
<div id="wrapper3">
<%= render :partial => 'layouts/base_header' %>
<div id="main">
<!--added by huang-->
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">高校课程实践社区</td>
<td style="width: auto; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
</tr>
<tr>
<td style="padding-left: 8px">
<a><%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index' %></a></td>
<td><p class="top-content-list-homework"><%= link_to "主页", home_path %>
> <%= link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %> >
<span><%= link_to(course.name.to_s, homework_course_path(course)) if course %></span>
>
<%= link_to(@bid.name, respond_path(@bid)) %></p></td>
</tr>
</table>
</div>
<!--end-->
<div id="sidebar">
<div class="main_context">
<div class="spaceleft">
<div>
<table>
<tr>
<td style="padding-left:8px ">
<% if get_avatar?(course) %>
<%= image_tag(url_to_avatar(course), :style => "width:80px;height:80px") %>
<% else %>
<%= image_tag('../images/avatars/course/course.jpg', :style => "width:80px;height:80px") %>
<% end %>
</td>
<td>
<table>
<tr>
<td style="vertical-align: top;font-size: 16px;text-align: center;">
<span style=" word-wrap: break-word; word-break: break-all">
<strong>
<%= link_to course.name.to_s, homework_course_path(course) if course %>
</strong>
</span>
</td>
</tr>
<tr>
<td style=" word-wrap: break-word; word-break: break-all;font-size: 16px;text-align: center">
<span style=" color:#ed8924">
<!-- modified by zjc 添加超链接 -->
<strong><%=link_to(@bid.name, respond_path(@bid)) %></strong>
</span>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class="user_underline"></div>
<!--count-->
<div class="inf_user_image">
<table>
<tr>
<td valign="top" colspan="2" style="font-size: 16px;padding-left: 8px;">
<strong><%= l(:label_new_course_description) %> :</strong></td>
</tr>
<tr>
<td class="font_lighter_sidebar" colspan="2" style="padding-left: 8px;"><%= textilizable course.description %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_create_time) %> :</td>
<td class="font_lighter_sidebar"><%= format_time course.created_at %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px; width:60px">主讲老师 :</td>
<td class="font_lighter_sidebar"><%= link_to(@user.lastname+@user.firstname, user_path(@user)) %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_class_period) %> :</td>
<td class="font_lighter_sidebar"><%= course.class_period.to_s %>&nbsp;<%= l(:label_class_hour) %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_main_term) %> :</td>
<td class="font_lighter_sidebar"><%= course.time.to_s %> <%= course.term %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_teacher_work_unit) %> :</td>
<!-- modified by zjc 有@user.user_extensions.occupation改为 @user.user_extensions.school 并添加超链接 -->
<% unless @user.user_extensions.nil? || @user.user_extensions.school.nil? %>
<td class="font_lighter_sidebar"><%= link_to @user.user_extensions.school,"http://course.trustie.net/?school_id=#{@user.user_extensions.school.id}" %></td>
<% end %>
</tr>
</table>
</div>
<div class="user_underline"></div>
<!-- info -->
<div class="inf_user_image">
<table>
<tr>
<td><%= l(:label_limit_time) %>: <%= @bid.deadline %></td>
</tr>
<tr>
<td>作业类型: <%= @bid.homework_type==Bid::HomeworkFile ? "提交文件" : "提交项目" %></td>
</tr>
<% unless @bid.parent_id.nil? %>
<tr>
<td>
<div style=" color: rgb(255, 0, 0); width:200px">
<% author=Bid.find(@bid.parent_id).author %>
作业来源于<%= link_to(author.lastname+author.firstname, user_path(Bid.find(@bid.parent_id).author)) %>
的需求:<%= link_to(Bid.find(@bid.parent_id).name, respond_path(Bid.find(@bid.parent_id))) %>
</div>
</td>
</tr>
<% end %>
</table>
</div>
<!-- tags -->
<div class="user_fans">
<div class="user_underline"></div>
<table style="font-family:'微软雅黑'; padding-left: 8px">
<tr>
<td><!-- added by william -for tag --> <%= render :partial => 'tags/tag', :locals => {:obj => @bid, :object_flag => "4"} %> </td>
</tr>
</table>
</div>
<!--homework-->
<div class="user_fans">
<div class="user_underline"></div>
<div class="font_title_left">
<strong><%= l(:label_commit_homework) %></strong>
</div>
<div class="left_wf">
<table>
<tr>
<td style="padding-top: 5px">
<% if @bid.homework_type == 1 %>
<% if @bid.homeworks.size>0 %>
<% for homework in @bid.homeworks.eager_load(:user) %>
<%= link_to image_tag(url_to_avatar(homework.user), :class => "avatar", :title => homework.user.name), user_path(homework.user), :class => "avatar" %>
<% end %>
<% else %>
<p class="font_lighter">
<%= l(:label_no_course_project) %>
</p>
<% end %>
<% else %>
<% if @bid.courses.size>0 %>
<% for course in @bid.courses %>
<%= link_to image_tag(url_to_avatar(course), :class => "avatar", :title => course.name), course_path(course), :class => "avatar" %>
<% end %>
<% else %>
<p class="font_lighter">
<%= l(:label_no_course_project) %>
</p>
<% end %>
<% end %> </td>
</tr>
</table>
</div>
</div>
<div class="user_underline"></div>
</div>
</div>
<!-- end -->
</div>
<div id="content">
<div class="tabs_new">
<ul>
<li>
<%= link_to l(:label_question_student), {:controller => 'bids', :action => 'show'}, :class => link_class(:respond) %>
</li>
<% if User.current.member_of_course? course %>
<li>
<% if User.current.logged? && course && (!Member.where('user_id = ? and course_id = ?', User.current.id, course.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, course.id).first.roles&Role.where('id = ? or id = ? or id =?', 5, 10, 7)).size >0) %>
<%= link_to l(:label_homework_commit), course_for_bid_path, :class => link_class(:course) %>
<% else %>
<%= link_to l(:label_homework_info), course_for_bid_path, :class => link_class(:course) %>
<% end %>
</li>
<% end %>
<!-- <li><%#= link_to l(:label_homework_statistics), {:controller => 'bids', :action => 'homework_statistics'}, :class => link_class(:homework_statistics) %></li> -->
<!-- <li><%#= link_to l(:label_homework_respond), {:controller => 'bids', :action => 'homework_respond'}, :class => link_class(:homework_respond) %></li>-->
</ul>
</div>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div>
</div>
<%= render :partial => 'layouts/base_footer' %>
</div>
</div>
</div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<div id="ajax-modal" style="display:none;"></div>
</div>
<%= call_hook :view_layouts_base_body_bottom %>
<% end %>
</body>
</html>