问题六

This commit is contained in:
yanxd 2013-12-11 10:00:38 +08:00
parent 75451fa785
commit 265e0f246b
2 changed files with 257 additions and 255 deletions

View File

@ -25,8 +25,10 @@ class ProjectsController < ApplicationController
menu_item l(:label_sort_by_active), :only => :index menu_item l(:label_sort_by_active), :only => :index
menu_item l(:label_sort_by_influence), :only => :index menu_item l(:label_sort_by_influence), :only => :index
menu_item l(:label_homework), :only => :homework # menu_item l(:label_homework), :only => :homework
menu_item l(:label_course_feedback), :only => :feedback # menu_item l(:label_course_feedback), :only => :feedback
menu_item :homework, :only => :homework
menu_item :feedback, :only => :feedback
menu_item l(:label_course_file), :only => :index menu_item l(:label_course_file), :only => :index
menu_item l(:label_course_news), :only => :index menu_item l(:label_course_news), :only => :index
# end # end

View File

@ -1,254 +1,254 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title><%= h html_title %></title> <title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" /> <meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" /> <meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
<%= favicon %> <%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %> <%= javascript_heads %>
<%= heads_for_theme %> <%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %> <%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags --> <!-- page specific tags -->
<%= yield :header_tags -%> <%= yield :header_tags -%>
</head> </head>
<!--add by huang--> <!--add by huang-->
<body class="<%= h body_css_classes %>"> <body class="<%= h body_css_classes %>">
<div id="wrapper"> <div id="wrapper">
<div id="wrapper2"> <div id="wrapper2">
<div id="wrapper3"> <div id="wrapper3">
<%= render :partial => 'layouts/base_header'%> <%= render :partial => 'layouts/base_header'%>
<div id="main"> <div id="main">
<!--added by huang--> <!--added by huang-->
<div class="top-content"> <div class="top-content">
<% @project = Project.find_by_id(@project.id)%> <% @project = Project.find_by_id(@project.id)%>
<% @course = Course.find_by_extra(@project.identifier)%> <% @course = Course.find_by_extra(@project.identifier)%>
<table> <table>
<tr> <tr>
<td class="info_font" style="width: 240px; color: #15bccf"">高校课程实践社区</td> <td class="info_font" style="width: 240px; color: #15bccf">高校课程实践社区</td>
<td style="color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td> <td style="color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="250px"> <td rowspan="2" width="250px">
<div class="top-content-search"> <div class="top-content-search">
<%= form_tag(:controller => 'projects', :action => 'search', :method => :get) do %> <%= form_tag(:controller => 'projects', :action => 'search', :method => :get) do %>
<%= text_field_tag 'name', params[:name], :size => 20 %> <%= text_field_tag 'name', params[:name], :size => 20 %>
<%= hidden_field_tag 'project_type', @project.project_type %> <%= hidden_field_tag 'project_type', @project.project_type %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<% end %> <% end %>
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px"><a><%=link_to "forge.trustie.net/course", :controller => 'projects', :action => 'course' %></a></td> <td style="padding-left: 8px"><a><%=link_to "forge.trustie.net/course", :controller => 'projects', :action => 'course' %></a></td>
<td><p class="top-content-list"><%=link_to "主页", home_path %> > <%=link_to "实践课程", :controller => 'projects', :action => 'course' %> > <%=link_to @project.name, nil %></p></td> <td><p class="top-content-list"><%=link_to "主页", home_path %> > <%=link_to "实践课程", :controller => 'projects', :action => 'course' %> > <%=link_to @project.name, nil %></p></td>
</tr> </tr>
</table> </table>
</div> </div>
<!-- end --> <!-- end -->
<!--project page--> <!--project page-->
<div id="sidebar"> <div id="sidebar">
<div class="spaceleft"> <div class="spaceleft">
<!--informations--> <!--informations-->
<div class="inf_user_image"> <div class="inf_user_image">
<% @project = Project.find_by_id(@project.id) %> <% @project = Project.find_by_id(@project.id) %>
<% @course = Course.find_by_extra(@project.identifier) %> <% @course = Course.find_by_extra(@project.identifier) %>
<table> <table>
<tr><td valign="top"> <tr><td valign="top">
<% if(@project.project_type==1) %> <% if(@project.project_type==1) %>
<% if get_avatar?(@project) %> <% if get_avatar?(@project) %>
<%= image_tag(url_to_avatar(@project), :class => "avatar2") %> <%= image_tag(url_to_avatar(@project), :class => "avatar2") %>
<% else %> <% else %>
<%= link_to image_tag('../images/avatars/Project/course.jpg', :class => "avatar2"), project_path(@project) %> <%= link_to image_tag('../images/avatars/Project/course.jpg', :class => "avatar2"), project_path(@project) %>
<% end %> <% end %>
<% else %> <% else %>
<%= image_tag(url_to_avatar(@project), :class => "avatar2") %> <%= image_tag(url_to_avatar(@project), :class => "avatar2") %>
<% end %> </td> <% end %> </td>
<td> <td>
<table><tr> <table><tr>
<td class="info-course"><%= @project.name %></td> <td class="info-course"><%= @project.name %></td>
</tr> </tr>
<tr><td align="center"> <tr><td align="center">
<div id=join_in_course> <div id=join_in_course>
<%if User.current.logged? %> <%if User.current.logged? %>
<% if @course.teacher.id == User.current.id %> <% if @course.teacher.id == User.current.id %>
<%= link_to l(:label_course_modify_settings), {:controller => 'projects', :action => 'settings', :id => @project} %> <%= link_to l(:label_course_modify_settings), {:controller => 'projects', :action => 'settings', :id => @project} %>
<% else %> <% else %>
<%= join_in_course(@project, User.current) %></div> <%= join_in_course(@project, User.current) %></div>
<% end %> </div> <% end %> </div>
<% unless User.current.member_of?(@project) %> <% unless User.current.member_of?(@project) %>
<!-- <%= image_tag "/images/fav.png" %> --> <!-- <%= image_tag "/images/fav.png" %> -->
<div style="padding-right: 10px"> <div style="padding-right: 10px">
<span class="icon-fav icon"></span><span> <span class="icon-fav icon"></span><span>
<%= watcher_link(@project, User.current) %></span></div> <%= watcher_link(@project, User.current) %></span></div>
<% end %> <% end %>
<% end %> <% end %>
</td></tr></table> </td></tr></table>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<!--parameter--> <!--parameter-->
<div class="user_fans"> <div class="user_fans">
<table width="240" border="0"> <table width="240" border="0">
<tr align="center" width="80px"> <tr align="center" width="80px">
<% files_count = @project.attachments.count %> <% files_count = @project.attachments.count %>
<% @project.versions.each do |version| %> <% @project.versions.each do |version| %>
<% files_count += version.attachments.count %> <% files_count += version.attachments.count %>
<% end %> <% end %>
<td class="font_index"> <td class="font_index">
<!-- %= link_to "#{@project.members.count}", project_member_path(@project) ,:course =>'1'% --> <!-- %= link_to "#{@project.members.count}", project_member_path(@project) ,:course =>'1'% -->
<!-- 1 教师; 2 学生0 全部--> <!-- 1 教师; 2 学生0 全部-->
<%= link_to "#{teacherCount(@project)}", project_member_path(@project, :role => 1) ,:course =>'1'%> <%= link_to "#{teacherCount(@project)}", project_member_path(@project, :role => 1) ,:course =>'1'%>
</td> </td>
<td class="font_index"> <td class="font_index">
<%= link_to "#{studentCount(@project)}", project_member_path(@project, :role => 2) ,:course =>'1'%> <%= link_to "#{studentCount(@project)}", project_member_path(@project, :role => 2) ,:course =>'1'%>
</td> </td>
<td class="font_index"><%= link_to files_count, project_files_path(@project) %></td> <td class="font_index"><%= link_to files_count, project_files_path(@project) %></td>
<tr class="font_aram"> <tr class="font_aram">
<td align="center" width="80px" id="teacherCount"> <td align="center" width="80px" id="teacherCount">
<!-- %= l(:label_x_base_courses_member, :count => @project.members.count) % --> <!-- %= l(:label_x_base_courses_member, :count => @project.members.count) % -->
<%= l(:label_x_base_courses_teacher, :count => teacherCount(@project)) %> <%= l(:label_x_base_courses_teacher, :count => teacherCount(@project)) %>
</td> </td>
<td align="center" width="80px" id="studentCount"> <td align="center" width="80px" id="studentCount">
<%= l(:label_x_base_courses_student, :count => studentCount(@project)) %> <%= l(:label_x_base_courses_student, :count => studentCount(@project)) %>
<!-- %= l(:label_x_course_data, :count => files_count) % --> <!-- %= l(:label_x_course_data, :count => files_count) % -->
</td> </td>
<td align="center" width="80px"> <td align="center" width="80px">
<%= l(:label_x_course_data, :count => files_count) %> <%= l(:label_x_course_data, :count => files_count) %>
</td> </td>
</tr> </tr>
</table> </table>
<div class="user_underline"></div> <div class="user_underline"></div>
</div> </div>
<!--info--> <!--info-->
<div class="inf_user_context"> <div class="inf_user_context">
<table style="font-family:微软雅黑" > <table style="font-family:微软雅黑" >
<!-- addedby bai 教师姓名加超链接、加入开课时间、结课时间与课时 --> <!-- addedby bai 教师姓名加超链接、加入开课时间、结课时间与课时 -->
<tr> <tr>
<td valign="top" style="padding-left: 8px; width:60px"><%= l(:label_main_teacher) %> :</td><td class="font_lighter_sidebar"><%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher)) %></td> <td valign="top" style="padding-left: 8px; width:60px"><%= l(:label_main_teacher) %> :</td><td class="font_lighter_sidebar"><%= link_to(@course.teacher.lastname+@course.teacher.firstname, user_path(@course.teacher)) %></td>
</tr> </tr>
<tr> <tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_setup_time) %> :</td><td class="font_lighter_sidebar"><%= @course.setup_time %></td> <td valign="top" style="padding-left: 8px;"><%= l(:label_setup_time) %> :</td><td class="font_lighter_sidebar"><%= @course.setup_time %></td>
</tr> </tr>
<tr> <tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_endup_time) %> :</td><td class="font_lighter_sidebar"><%= @course.endup_time %></td> <td valign="top" style="padding-left: 8px;"><%= l(:label_endup_time) %> :</td><td class="font_lighter_sidebar"><%= @course.endup_time %></td>
</tr> </tr>
<tr> <tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_class_period) %> :</td><td class="font_lighter_sidebar"><%= @course.class_period %>&nbsp;<%= l(:label_class_hour)%></td> <td valign="top" style="padding-left: 8px;"><%= l(:label_class_period) %> :</td><td class="font_lighter_sidebar"><%= @course.class_period %>&nbsp;<%= l(:label_class_hour)%></td>
</tr> </tr>
<tr> <tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_main_term) %> :</td><td class="font_lighter_sidebar"><%= @course.time %> <%= @course.term %></td> <td valign="top" style="padding-left: 8px;"><%= l(:label_main_term) %> :</td><td class="font_lighter_sidebar"><%= @course.time %> <%= @course.term %></td>
</tr> </tr>
<!-- end --> <!-- end -->
<% unless @course.teacher.user_extensions.nil?%> <% unless @course.teacher.user_extensions.nil?%>
<tr> <tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_teacher_work_unit) %> :</td><td class="font_lighter_sidebar"><%= @course.teacher.user_extensions.occupation %></td> <td valign="top" style="padding-left: 8px;"><%= l(:label_teacher_work_unit) %> :</td><td class="font_lighter_sidebar"><%= @course.teacher.user_extensions.occupation %></td>
</tr> </tr>
<% else %> <% else %>
<tr> <tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_teacher_work_unit) %> :</td><td class="font_lighter_sidebar"><%= l(:field_course_un) %></td> <td valign="top" style="padding-left: 8px;"><%= l(:label_teacher_work_unit) %> :</td><td class="font_lighter_sidebar"><%= l(:field_course_un) %></td>
</tr> </tr>
<% end %> <% end %>
</table> </table>
</div> </div>
<div class="user_underline"></div> <div class="user_underline"></div>
<!--description--> <!--description-->
<div class="inf_user_context"> <div class="inf_user_context">
<div class="font_title_left"> <div class="font_title_left">
<%= l(:label_project_overview) %> <%= l(:label_project_overview) %>
</div> </div>
<div style="padding-bottom: 8px"> <div style="padding-bottom: 8px">
<% if @project.description.size>0 %> <% if @project.description.size>0 %>
<div class="font_lighter_sidebar"> <div class="font_lighter_sidebar">
<%= textilizable @project.description %> <%= textilizable @project.description %>
</div> </div>
<% else %> <% else %>
<div class="font_lighter_sidebar"> <div class="font_lighter_sidebar">
<%= l(:label_course_description_no) %> <%= l(:label_course_description_no) %>
</div> </div>
<% end %> <% end %>
<div class="created_on_project"> <div class="created_on_project">
<strong style="color: #068d9c"><%= l(:label_create_time) %></strong><%= format_time(@project.created_on) %> <strong style="color: #068d9c"><%= l(:label_create_time) %></strong><%= format_time(@project.created_on) %>
</div> </div>
</div> </div>
<div class="user_underline"></div> <div class="user_underline"></div>
</div> </div>
<!--tags--> <!--tags-->
<div class="user_fans"> <div class="user_fans">
<!-- added by william -for tag --> <!-- added by william -for tag -->
<div class="user_tags"> <div class="user_tags">
<div id="tags"> <div id="tags">
<%= render :partial => 'tags/tag', :locals => {:obj => @project,:object_flag => "2"}%> <%= render :partial => 'tags/tag', :locals => {:obj => @project,:object_flag => "2"}%>
</div> </div>
</div> </div>
</div> </div>
<div class="user_underline"></div> <div class="user_underline"></div>
</div> </div>
</div> </div>
<div id="content"> <div id="content">
<div class="tabs_new"> <div class="tabs_new">
<ul> <ul>
<li> <li>
<%= link_to l(:label_course_overview), project_path(@project), :class => link_class(:overview) %> <%= link_to l(:label_course_overview), project_path(@project), :class => link_class(:overview) %>
</li> </li>
<li> <li>
<%= link_to l(:label_homework), homework_project_path(@project), :class => link_class('Task') ,:project_type => 1 %> <%= link_to l(:label_homework), homework_project_path(@project), :class => link_class(:homework) ,:project_type => 1 %>
</li> </li>
<li> <li>
<%= link_to l(:label_course_board), { :controller => 'boards', :action => 'index', :project_id => @project}, :class => link_class(:boards) %> <%= link_to l(:label_course_board), { :controller => 'boards', :action => 'index', :project_id => @project}, :class => link_class(:boards) %>
</li> </li>
<li> <li>
<%= link_to l(:label_course_file), project_files_path(@project), :class => link_class(:files)%> <%= link_to l(:label_course_file), project_files_path(@project), :class => link_class(:files)%>
</li> </li>
<li> <li>
<%= link_to l(:label_course_news), {:controller => 'news', :action => 'index', :project_id => @project}, :class => link_class(:news) %> <%= link_to l(:label_course_news), {:controller => 'news', :action => 'index', :project_id => @project}, :class => link_class(:news) %>
</li> </li>
<li> <li>
<%= link_to l(:label_course_feedback), project_feedback_path(@project), :class => link_class('Feedback')%> <%= link_to l(:label_course_feedback), project_feedback_path(@project), :class => link_class(:feedback)%>
</li> </li>
<!-- <li><%= link_to(l(:label_course_repository), {:controller => 'repositories', :action => 'show', :id => @project, :repository_id => nil, :path => nil, :rev => nil, :course => 1 })%></li> --> <!-- <li><%= link_to(l(:label_course_repository), {:controller => 'repositories', :action => 'show', :id => @project, :repository_id => nil, :path => nil, :rev => nil, :course => 1 })%></li> -->
<% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.roles&Role.where('id = ? or id = ?', 7, 9)).size >0))%> <% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.roles&Role.where('id = ? or id = ?', 7, 9)).size >0))%>
</ul> </ul>
<% end %> <% end %>
</div> </div>
<%= render_flash_messages %> <%= render_flash_messages %>
<%= yield %> <%= yield %>
<%= call_hook :view_layouts_base_content %> <%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div> <div style="clear:both;"></div>
</div> </div>
<%= render :partial => 'layouts/base_footer'%> <%= render :partial => 'layouts/base_footer'%>
<%= debug(params) if Rails.env.development? %> <%= debug(params) if Rails.env.development? %>
</div> </div>
<div id="ajax-indicator" style="display:none;"> <div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span> <span><%= l(:label_loading) %></span>
</div> </div>
<div id="ajax-modal" style="display:none;"></div> <div id="ajax-modal" style="display:none;"></div>
</div> </div>
</div> </div>
<%= call_hook :view_layouts_base_body_bottom %> <%= call_hook :view_layouts_base_body_bottom %>
</body> </body>
</html> </html>