课程合并

This commit is contained in:
huangjingquan 2013-09-23 08:44:48 +08:00
parent 1c4f7f99e8
commit 3536883248
20 changed files with 273 additions and 143 deletions

View File

@ -176,7 +176,11 @@ class BidsController < ApplicationController
flash[:notice] = l(:label_bidding_succeed) flash[:notice] = l(:label_bidding_succeed)
end end
else else
if @bid.reward_type == 3
flash[:error] = l(:label_bidding_homework_fail)
else
flash[:error] = l(:label_bidding_fail) flash[:error] = l(:label_bidding_fail)
end
end end
@bidding_project = @bid.biding_projects @bidding_project = @bid.biding_projects
respond_to do |format| respond_to do |format|

View File

@ -559,7 +559,8 @@ class ProjectsController < ApplicationController
if validate_parent_id && @project.save if validate_parent_id && @project.save
@course = Course.find_by_extra(@project.identifier) @course = Course.find_by_extra(@project.identifier)
@course.state = params[:project][:course][:state] @course.state = params[:project][:course][:state]
@course.save @course.term = params[:project][:course][:term]
@course.save
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id') @project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
respond_to do |format| respond_to do |format|
format.html { format.html {

View File

@ -122,6 +122,17 @@ class UsersController < ApplicationController
# added by fq # added by fq
def user_courses def user_courses
case params[:type] case params[:type]
when "2"
@membership = @user.memberships.all(:conditions => Project.visible_condition(User.current))
@memberships = []
@membership.each do |membership|
if membership.project.project_type == 1
@membership << membership
end
end
@state = 2
when "1" when "1"
@membership = @user.memberships.all(:conditions => Project.visible_condition(User.current)) @membership = @user.memberships.all(:conditions => Project.visible_condition(User.current))
@ -133,13 +144,13 @@ class UsersController < ApplicationController
end end
@bid = [] @bid = []
@memberships.each do |membership| @memberships.each do |membership|
@bid += membership.project.homeworks @bid += membership.project.homeworks
end end
@bid = @bid.group_by {|bid| bid.courses.first.id} @bid = @bid.group_by {|bid| bid.courses.first.id}
@state = 1 @state = 1
else else
@membership = @user.memberships.all(:conditions => Project.visible_condition(User.current)) @membership = @user.memberships.all(:conditions => Project.visible_condition(User.current))
@memberships = [] @memberships = []
@membership.each do |membership| @membership.each do |membership|
if membership.project.project_type == 1 if membership.project.project_type == 1

View File

@ -102,6 +102,10 @@ module UsersHelper
s = content_tag('span', '我的作业', :class => "current-page") s = content_tag('span', '我的作业', :class => "current-page")
content << content_tag('li', link_to('我的课程', {:controller => 'users', :action => 'user_courses'})) content << content_tag('li', link_to('我的课程', {:controller => 'users', :action => 'user_courses'}))
content << content_tag('li', s, :class => "current-page") content << content_tag('li', s, :class => "current-page")
when 2
s = content_tag('span', '课程通知', :class => "current-page")
content << content_tag('li', link_to('课程通知', {:controller => 'users', :action => 'user_courses'}))
content << content_tag('li', s, :class => "current-page")
end end
content_tag('div', content, :class => "pagination") content_tag('div', content, :class => "pagination")

View File

@ -1,11 +1,11 @@
class Course < ActiveRecord::Base class Course < ActiveRecord::Base
include Redmine::SafeAttributes include Redmine::SafeAttributes
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term
belongs_to :project, :class_name => 'Project', :foreign_key => :extra belongs_to :project, :class_name => 'Project', :foreign_key => :extra # 定义一个project方法 该方法通过extra来调用project表
belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher该方法通过tea_id来调用User表 belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher该方法通过tea_id来调用User表
has_many :bid has_many :bid
validates_presence_of :state validates_presence_of :state, :term
safe_attributes 'extra', safe_attributes 'extra',
'time', 'time',
'name', 'name',
@ -13,7 +13,8 @@ class Course < ActiveRecord::Base
'code', 'code',
'location', 'location',
'tea_id', 'tea_id',
'state' 'state',
'term'
end end

View File

@ -8,9 +8,13 @@
<%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create) %>
<% end %> <% end %>
</div> </div>
<% if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ?', 5, 7)).size >0) %>
<div class='icon icon-add'> <div class='icon icon-add'>
<%= toggle_link l(:button_bidding), 'put-bid-form' %> <%= toggle_link l(:button_bidding), 'put-bid-form' %>
</div> </div>
<% elsif @homework_list.empty? %>
<div class="font_lighter_sidebar" style="padding-left: 10px">暂无学生提交作业!</div>
<% end %>
<div id='bidding_project_list'> <div id='bidding_project_list'>
<%= render :partial => 'homework_list', :locals => {:homework => @homework_list} %> <%= render :partial => 'homework_list', :locals => {:homework => @homework_list} %>

View File

@ -5,9 +5,12 @@
<td class="font_lighter" style="font-size: 15px;"><%= l(:label_homework_project) %>(<%= @bidding_project.count%>)</td> <td class="font_lighter" style="font-size: 15px;"><%= l(:label_homework_project) %>(<%= @bidding_project.count%>)</td>
<% if User.current.logged? %> <% if User.current.logged? %>
<td> <td>
<% if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ?', 5, 7)).size >0) %>
<div class='icon icon-add'> <div class='icon icon-add'>
<%= toggle_link l(:button_bidding_homework), 'put-bid-form' %> <%= toggle_link l(:button_bidding_homework), 'put-bid-form' %>
</div></td> </div>
<% end %>
</td>
<% end %> <% end %>
</table> </table>

View File

@ -35,7 +35,7 @@
<td><%= link_to image_tag(url_to_avatar(@project), :class => 'avatar2') %></td> <td><%= link_to image_tag(url_to_avatar(@project), :class => 'avatar2') %></td>
<td align="center"> <td align="center">
<div class="info_font" style=" word-wrap: break-word; word-break: break-all"> <div class="info_font" style=" word-wrap: break-word; word-break: break-all">
<%= textilizable @project.name %> <%= @project.name %>
</div> </div>
<%= join_in_course(@project, User.current)%> <%= join_in_course(@project, User.current)%>
</td> </td>
@ -57,7 +57,7 @@
<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"> <%= " 成员" %></td> <td align="center" width="80px"> <%= "成员" %></td>
<td align="center" width="80px"><%= l(:label_course_data) %></td> <td align="center" width="80px"><%= l(:label_course_data) %></td>
</tr> </tr>
@ -67,17 +67,19 @@
<!--info--> <!--info-->
<div class="inf_user_context"> <div class="inf_user_context">
<table style="font-family:微软雅黑" width="220"> <table style="font-family:微软雅黑" >
<!-- <tr> <!-- <tr>
<td valign="top" style="padding-left: 8px;">课程口令:</td><td class="font_lighter_sidebar"><%= @course.state%></td> <td valign="top" style="padding-left: 8px;">课程口令:</td><td class="font_lighter_sidebar"><%= @course.state%></td>
</tr> --> </tr> -->
<tr> <tr>
<td valign="top" style="padding-left: 8px;">主讲老师:</td><td class="font_lighter_sidebar"><%=@course.teacher.lastname+@course.teacher.firstname %></td> <td valign="top" style="padding-left: 8px;">主讲老师:</td><td class="font_lighter_sidebar"><%= @course.teacher.lastname+@course.teacher.firstname %></td>
</tr> </tr>
<tr> <tr>
<td valign="top" style="padding-left: 8px;">教师单位:</td><td class="font_lighter_sidebar">PDL(未定)</td> <td valign="top" style="padding-left: 8px;">课程学期:</td><td class="font_lighter_sidebar"><%= @course.term %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;">教师单位:</td><td class="font_lighter_sidebar"><%= @course.teacher.user_extensions.occupation %></td>
</tr> </tr>
</table> </table>

View File

@ -19,63 +19,51 @@
<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" class=""> <div id="main" class="">
<div id="sidebar"> <div id="sidebar">
<div class="main_context"> <div class="main_context">
<div class="spaceleft"> <div class="spaceleft">
<div class="inf_user_image"> <div>
<table> <table style="padding-top: 20px ;width: 232px ; height: 80px;">
<tr> <tr>
<td align="left" valign="middle"> <td class="info_font" align="center" style=" word-wrap: break-word; word-break: break-all; color: #ed8924 "><%= h @bid.name %></td>
<%= link_to image_tag(url_to_avatar(@bid.courses.first), :class => "avatar2"), project_path(@bid.courses.first), :class => "avatar" %> </tr>
</td> <tr>
<td> <td align="center"> <%= watcher_link(@bid, User.current) %> </td>
<table>
<tr>
<td class="info_font" style=" word-wrap: break-word; word-break: break-all">作业</td>
</tr>
<tr>
<td class="info_font" style=" word-wrap: break-word; word-break: break-all"><%= h @bid.name %></td>
</tr>
</table></td>
</tr> </tr>
</table> </table>
<table> </div>
<tr> <div class="user_underline"></div>
<td><%= l(:label_teacher) %> : <%= link_to(@user.lastname+@user.firstname, user_path(@user))%></td>
</tr>
<tr>
<td><%= l(:label_course_homework) %> : <%= link_to(@bid.courses.first.name, project_path(@bid.courses.first))%></td>
</tr>
<tr>
<td><%= l(:label_limit_time) %> <%= @bid.deadline%></td>
<!-- info -->
<div class="inf_user_image">
<table>
<tr>
<td style="text-align: justify ; text-justify: inter-ideograph; width: 180px"><%= l(:label_teacher_homework) %> : <%= link_to(@user.lastname+@user.firstname, user_path(@user)) %></td>
</tr> </tr>
<tr>
<td><%= l(:label_course_homework) %> : <%= link_to(@bid.courses.first.name, project_path(@bid.courses.first)) %></td>
</tr>
<tr>
<td><%= l(:label_limit_time) %> <%= @bid.deadline %></td>
</tr>
</table> </table>
<!-- <div>
<%= link_to "问答"+"("+@bid.watcher_users.count.to_s+")", respond_path(@bid) %> &nbsp;
<%= link_to l(:label_commit_homework)+ ":" +"("+@bid.biding_projects.count.to_s+")", project_for_bid_path(@bid) %>&nbsp;
<%= link_to l(:label_responses)+"("+@bid.commit.to_s+")", respond_path(@bid)%>
</div> -->
</div> </div>
<!-- tags -->
<div class="user_fans"> <div class="user_fans">
<div class="font_title_left"> <div class="user_underline"></div>
<strong><%= l(:label_tag) %></strong> <table style="font-family:微软雅黑; padding-left: 8px">
</div><div class="user_underline"></div>
<table style="font-family:微软雅黑">
<tr> <tr>
<td><!-- added by william -for tag --> <td><!-- added by william -for tag --> <%= render :partial => 'tags/tag', :locals => {:obj => @bid, :object_flag => "4"}%> </td>
<%= render :partial => 'tags/tag', :locals => {:obj => @bid, :object_flag => "4"}%>
</td>
</tr> </tr>
</table> </table>
</div> </div>
<!--homework--> <!--homework-->
<div class="user_fans"> <div class="user_fans">
<div class="font_title_left"> <div class="font_title_left">
@ -85,51 +73,61 @@
<div class="left_wf"> <div class="left_wf">
<table> <table>
<tr> <tr>
<td style="padding-top: 5px"> <td style="padding-top: 5px"> <% if @bid.homework_type == 1%>
<% if @bid.homework_type == 1%> <% if @bid.homeworks.size>0 %>
<% if @bid.homeworks.size>0 %> <% for homework in @bid.homeworks %>
<% for homework in @bid.homeworks %> <%= link_to image_tag(url_to_avatar(homework.user), :class => "avatar", :title => homework.user.name), user_path(homework.user), :class => "avatar" %>
<%= link_to image_tag(url_to_avatar(homework.user), :class => "avatar", :title => homework.user.name), user_path(homework.user), :class => "avatar" %> <% end %>
<% end %> <% else %>
<% else %> <p class="font_lighter">
<p class="font_lighter"><%= l(:label_no_course_project) %></p> <%= l(:label_no_course_project) %>
<% end %> </p> <% end %>
<% else%> <% else %>
<% if @bid.projects.size>0 %> <% if @bid.projects.size>0 %>
<% for project in @bid.projects%> <% for project in @bid.projects%>
<%= link_to image_tag(url_to_avatar(project), :class => "avatar", :title => project.name), project_path(project), :class => "avatar" %> <%= link_to image_tag(url_to_avatar(project), :class => "avatar", :title => project.name), project_path(project), :class => "avatar" %>
<% end%> <% end %>
<% else %> <% else %>
<p class="font_lighter"><%= l(:label_no_course_project) %></p> <p class="font_lighter">
<% end %> <%= l(:label_no_course_project) %>
<% end %> </p> <% end %>
</td> <% end %> </td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<div class="user_underline"></div> <div class="user_underline"></div>
</div> </div>
</div> </div>
<!-- end --> <!-- end -->
</div> </div>
<div id="content"> <div id="content">
<div class="tabs_new">
<ul> <div class="tabs_new">
<li><%= link_to l(:label_question_student), { :controller => 'bids', :action => 'show' },:class => link_class(:respond)%></li> <ul>
<li><%= link_to l(:label_homework_commit), { :controller => 'bids', :action => 'show_project' },:class => link_class(:project)%></li> <li>
<%= link_to l(:label_question_student), {:controller => 'bids', :action => 'show' },:class => link_class(:respond)%>
</li>
<li>
<% if User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ?', 5, 7)).size >0) %>
<%= link_to l(:label_homework_commit), {:controller => 'bids', :action => 'show_project' },:class => link_class(:project)%>
<% else %>
<%= link_to l(:label_homework_info), {:controller => 'bids', :action => 'show_project' },:class => link_class(:project)%>
<% end %>
</li>
<!-- <li><%= link_to l(:label_homework_statistics), { :controller => 'bids', :action => 'homework_statistics' },:class => link_class(:homework_statistics)%></li> --> <!-- <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> <!-- <li><%= link_to l(:label_homework_respond), { :controller => 'bids', :action => 'homework_respond' },:class => link_class(:homework_respond)%></li>
--><ul> --><ul>
</div> </div>
<%= 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'%>
</div> </div>
</div> </div>
</div> </div>

View File

@ -89,10 +89,10 @@
<div class="inf_user_context"> <div class="inf_user_context">
<table style="font-family:微软雅黑" width="240"> <table style="font-family:微软雅黑" width="240">
<tr> <tr>
<td style="padding-left: 8px" width="70px"><%= l(:label_user_joinin) %></td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"><%= format_date(@user.created_on) %></td> <td style="padding-left: 8px" width="70px"><%= l(:label_user_joinin) %></td><td class="font_lighter_sidebar" style="padding-left: 0px" width="170px"><%= format_time(@user.created_on) %></td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px"><%= l(:label_user_login) %></td><td class="font_lighter_sidebar" style="padding-left: 0px"><%= format_date(@user.last_login_on) %></td> <td style="padding-left: 8px"><%= l(:label_user_login) %></td><td class="font_lighter_sidebar" style="padding-left: 0px"><%= format_time(@user.last_login_on) %></td>
</tr> </tr>
<tr> <tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_user_mail) %></td><td class="font_lighter_sidebar" style="padding-left: 0px; word-wrap: break-word; word-break: break-all"><%= mail_to(h(@user.mail), nil, :encode => 'javascript') %></td> <td valign="top" style="padding-left: 8px;"><%= l(:label_user_mail) %></td><td class="font_lighter_sidebar" style="padding-left: 0px; word-wrap: break-word; word-break: break-all"><%= mail_to(h(@user.mail), nil, :encode => 'javascript') %></td>

View File

@ -2,7 +2,7 @@
<div class="box tabular"> <div class="box tabular">
<p><%= f.text_field :title, :required => true, :size => 60, :style => "width:488px;" %></p> <p><%= f.text_field :title, :required => true, :size => 60, :style => "width:488px;" %></p>
<p style="margin-left:-10px;"><%= f.text_area :summary, :cols => 60, :rows => 2, :style => "width:490px;margin-left:10px;" %></p> <!-- <p style="margin-left:-10px;"><%= f.text_area :summary, :cols => 60, :rows => 2, :style => "width:490px;margin-left:10px;" %></p> -->
<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 15, :class => 'wiki-edit', :style => "width:490px;" %></p> <p><%= f.text_area :description, :required => true, :cols => 60, :rows => 15, :class => 'wiki-edit', :style => "width:490px;" %></p>
<p id="attachments_form" style="margin-left:-10px;"><label style="padding-right: 15px;"><%= l(:label_attachment_plural) %></label><%= render :partial => 'attachments/form', :locals => {:container => @news} %></p> <p id="attachments_form" style="margin-left:-10px;"><label style="padding-right: 15px;"><%= l(:label_attachment_plural) %></label><%= render :partial => 'attachments/form', :locals => {:container => @news} %></p>
</div> </div>

View File

@ -14,7 +14,11 @@
</div> </div>
<div id="add-news" style="display:none;"> <div id="add-news" style="display:none;">
<% if @project.project_type == 1 %>
<h3><%=l(:bale_news_notice)%></h3>
<% else %>
<h3><%=l(:label_news_new)%></h3> <h3><%=l(:label_news_new)%></h3>
<% end %>
<%= labelled_form_for @news, :url => project_news_index_path(@project), <%= labelled_form_for @news, :url => project_news_index_path(@project),
:html => { :id => 'news-form', :multipart => true } do |f| %> :html => { :id => 'news-form', :multipart => true } do |f| %>
<%= render :partial => 'news/form', :locals => { :f => f } %> <%= render :partial => 'news/form', :locals => { :f => f } %>

View File

@ -1,4 +1,6 @@
<%= error_messages_for 'project' %> <%= error_messages_for 'project' %>
<%= error_messages_for 'course' %>
<!--[form:project]--> <!--[form:project]-->
<% unless @project.new_record? %> <% unless @project.new_record? %>
<p><%= render :partial=>"avatar/avatar_form",:locals=> {source:@project} %></p> <p><%= render :partial=>"avatar/avatar_form",:locals=> {source:@project} %></p>
@ -15,9 +17,10 @@
<%= f.fields_for @course do |m| %> <%= f.fields_for @course do |m| %>
<!-- added by huang --> <!-- added by huang -->
<p style="margin-left:-10px;"><%= m.text_field :state, :required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %></p> <p style="margin-left:-10px;"><%= m.text_field :state, :required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<em class="info" style="margin-left:95px;"><%= l(:text_command) %></em> <em class="info" style="margin-left:95px;"><%= l(:text_command) %></em>
<p style="margin-left:-10px;"><%= m.text_field :term, :required => true, :size => 60, :style => "width:488px;margin-left: 10px;" %></p>
<!-- <p style="margin-left:-28px;"><em class="info"><%= l(:label_term) %> <%= select_tag 'term', "<option value = '0'>#{l(:label_spring)}</option><option value = '1'>#{l(:label_summer)}</option><option value = '2'>#{l(:label_autumn)}</option>".html_safe %></em></p> -->
<% end %> <% end %>
<!-- <p style="margin-left:-10px;"><%= f.check_box :is_public, :style => "margin-left:10px;" %></p> --> <!-- <p style="margin-left:-10px;"><%= f.check_box :is_public, :style => "margin-left:10px;" %></p> -->
<p style="display:none;"><%= f.text_field :project_type, :value => 1 %></p> <p style="display:none;"><%= f.text_field :project_type, :value => 1 %></p>

View File

@ -18,7 +18,7 @@
<p><%= l(:label_role_plural) %>: <p><%= l(:label_role_plural) %>:
<% roles.each do |role| %> <% roles.each do |role| %>
<label> <label>
<% if @project.project_type == 1 %> <% if @project.project_type == 1 %>
<% if role == Role.find(3) %> <% if role == Role.find(3) %>
<%= check_box_tag 'membership[role_ids][]', role.id %>Teacher <%= check_box_tag 'membership[role_ids][]', role.id %>Teacher
<% elsif role == Role.find(5) %> <% elsif role == Role.find(5) %>
@ -27,9 +27,12 @@
<% else %> <% else %>
<%= check_box_tag 'membership[role_ids][]', role.id %><%=h role %> <%= check_box_tag 'membership[role_ids][]', role.id %><%=h role %>
<% end %> <% end %>
<% else %>
<% if role == Role.find(7) %>
<% else %> <% else %>
<%= check_box_tag 'membership[role_ids][]', role.id %><%=h role %> <%= check_box_tag 'membership[role_ids][]', role.id %><%=h role %>
<% end %></label> <% end %>
<% end %></label>
<% end %></p> <% end %></p>
</div> </div>
</fieldset> </fieldset>
@ -53,7 +56,7 @@
<td class="<%= member.principal.class.name.downcase %>"><%= link_to_user member.principal %></td> <td class="<%= member.principal.class.name.downcase %>"><%= link_to_user member.principal %></td>
<td class="roles"> <td class="roles">
<span id="member-<%= member.id %>-roles"> <span id="member-<%= member.id %>-roles">
<% if @project.project_type == 1 %> <% if @project.project_type == 1 %>
<% if member.roles.sort.collect(&:to_s).join(', ') =='Manager' %> <% if member.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
Teacher Teacher
@ -65,9 +68,19 @@
<% end %> <% end %>
<% else%> <% else %>
<%=h member.roles.sort.collect(&:to_s).join(', ') %>
<% end %></span> <% if member.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
Manager
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='Developer' %>
Developer
<% elsif member.roles.sort.collect(&:to_s).join(', ') =='Reporter' %>
Reporter
<% else %>
<% end %>
<% end %>
</span>
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member), <%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),

View File

@ -1,42 +1,56 @@
<div class="content_frame"> <div class="content_frame">
<% unless @memberships.empty? %> <% unless @memberships.empty? %>
<ul class="user_project_sort"> <ul class="user_project_sort">
<% for membership in @memberships %> <% for membership in @memberships %>
<li> <li>
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;"> <table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr> <tr>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(membership.project), :class => 'avatar'), project_path(membership.project) %></td> <td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(membership.project), :class => 'avatar'), project_path(membership.project) %></td>
<td> <td>
<table width="580" border="0"> <table width="580" border="0">
<tr> <tr>
<td colspan="2" valign="top"><strong> <%= link_to_user(membership.user) if membership.respond_to?(:user) %></strong> <td colspan="2" valign="top"><span><%= link_to_project(membership.project) %></span><span style="float: right"><%= l(:label_homework) %> (<span style="color: #ed8924"><%= link_to (membership.project.homeworks.count), {:controller => 'projects', :action => 'homework', :id => membership.project.identifier} %></span>)
<span class="font_lighter"> <%= l(:label_create_project) %></span> <%= link_to_project(membership.project) %></td> <%= l(:label_course_news)%> (<span style="color: #ed8924"><%= link_to (membership.project.news.count), {:controller => 'news', :action => 'index', :project_id => membership.project.identifier} %></span>)
</tr> <%= l(:label_member)%>(<span style="color: #ed8924"><%= link_to (membership.project.members.count) %></span>) </span></td>
<tr> </tr>
<td colspan="2" width="580" > <tr>
<p class="font_description"> <td colspan="2" width="580" >
<%= membership.project.description%> <p class="font_description">
</p></td> <%= membership.project.description%>
</tr> </p></td>
<tr> </tr>
<td align="left"><span class="font_lighter"> <%= format_time(membership.created_on) %></span></td><!-- modified by ming --> <tr>
<td align="right" ><%= h membership.roles.sort.collect(&:to_s).join(', ') %> </td> <td align="left"><span class="font_lighter"> <%= format_time(membership.created_on) %></span></td><!-- modified by ming -->
</tr> <td align="right" >
</table></td>
</tr> <% if membership.roles.sort.collect(&:to_s).join(', ') =='Manager' %>
Teacher
</table> <% elsif membership.roles.sort.collect(&:to_s).join(', ') =='Reporter' %>
Student
</li> <% elsif membership.roles.sort.collect(&:to_s).join(', ') =='TA' %>
<% end %> TA
</ul> <% end %>
<% else %> </td>
<% if @user != User.current %> </tr>
<p class="font_description"><%= l(:label_project_un) %></p> </table></td>
<% else %> </tr>
<p class="font_description"><%= l(:label_project_unadd) %><%= link_to"#{l(:label_new)}",:controller=>'projects',:action=>'new'%></p>
<% end %>
<% end %> </table>
<%= call_hook :view_account_left_bottom, :user => @user %>
</li>
<% end %>
</ul>
<% else %>
<% if @user != User.current %>
<p class="font_description">
<%= l(:label_project_un) %>
</p>
<% else %>
<p class="font_description">
<%= l(:label_project_unadd) %><%= link_to"#{l(:label_new)}",:controller=>'projects',:action=>'new'%>
</p>
<% end %>
<% end %>
<%= call_hook :view_account_left_bottom, :user => @user %>
</div> </div>

View File

@ -0,0 +1,48 @@
<!-- < added by huang > -->
<div class="content_frame">
<% unless @memberships.empty? %>
<ul class="user_project_sort">
<% for membership in @memberships %>
<li>
<table width="660" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(membership.project), :class => 'avatar'), project_path(membership.project) %></td>
<td>
<table width="580" border="0">
<tr>
<td colspan="2" valign="top"><span><%= link_to_project(membership.project) %></span>
<span style="float: right"><%= l(:label_homework) %> (<span style="color: #ed8924">8</span>)
<%= l(:label_course_news)%> (<span style="color: #ed8924">8</span>)
<%= l(:label_member)%>(<span style="color: #ed8924"><%=link_to (membership.project.members.count)%></span>)
</span>
</td>
</tr>
<tr>
<td colspan="2" width="580" >
<p class="font_description">
<%= membership.project.description%>
</p></td>
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= format_time(membership.created_on) %></span></td><!-- modified by ming -->
<td align="right" ><%= h membership.roles.sort.collect(&:to_s).join(', ') %> </td>
</tr>
</table></td>
</tr>
</table>
</li>
<% end %>
</ul>
<% else %>
<% if @user != User.current %>
<p class="font_description"><%= l(:label_project_un) %></p>
<% else %>
<p class="font_description"><%= l(:label_project_unadd) %><%= link_to"#{l(:label_new)}",:controller=>'projects',:action=>'new'%></p>
<% end %>
<% end %>
<%= call_hook :view_account_left_bottom, :user => @user %>
</div>

View File

@ -1,10 +1,11 @@
<!-- added by fq --> <!-- added by fq -->
<%= user_course @state%> <%= user_course @state%>
<% if @state == 0 %>
<% if @state == 0%>
<%= render :partial => 'my_course' %> <%= render :partial => 'my_course' %>
<% else %> <% elsif @state == 1 %>
<%= render :partial => 'my_homework' %> <%= render :partial => 'my_homework' %>
<% else @state == 2 %>
<%= render :partial => 'my_notice' %>
<% end %> <% end %>

View File

@ -222,6 +222,7 @@ zh:
field_couurse_time: 学时 field_couurse_time: 学时
field_course_code: 学分 field_course_code: 学分
field_state: 加入课程口令 field_state: 加入课程口令
field_term: 学期
#end #end
field_description: 描述 field_description: 描述
field_summary: 摘要 field_summary: 摘要
@ -521,6 +522,10 @@ zh:
label_user_login_tips: 您还没有登录,请登录后留言 label_user_login_tips: 您还没有登录,请登录后留言
#end #end
#by huang #by huang
label_term: 学期
label_spring: 春季
label_summer: 夏季
label_autumn: 秋季
label_followers: 关注 label_followers: 关注
label_teacher: 教师 label_teacher: 教师
label_limit_time: 截止日期 label_limit_time: 截止日期
@ -579,6 +584,7 @@ zh:
label_report_plural: 报表 label_report_plural: 报表
label_news: 新闻 label_news: 新闻
label_news_new: 添加新闻 label_news_new: 添加新闻
bale_news_notice: 添加通知 #huang
label_news_notice: 发布课程通知 label_news_notice: 发布课程通知
label_news_plural: 新闻 label_news_plural: 新闻
label_news_latest: 最近的新闻 label_news_latest: 最近的新闻
@ -586,8 +592,9 @@ zh:
label_news_added: 新闻已添加 label_news_added: 新闻已添加
label_settings: 配置 label_settings: 配置
label_overview: 课程动态 label_overview: 课程动态
label_question_student: 学生提问 #huang label_question_student: 学生反馈 #huang
label_homework_commit: 提交作业 #huang label_homework_commit: 提交作业 #huang
label_homework_info: 作业情况 #huang
label_course_file: 资料下载 label_course_file: 资料下载
label_course_news: 课程通知 label_course_news: 课程通知
label_version: 版本 label_version: 版本
@ -1271,6 +1278,7 @@ zh:
label_wrong_date: 时间格式错误,请输入正确的时间 yyyy-mm-dd label_wrong_date: 时间格式错误,请输入正确的时间 yyyy-mm-dd
label_bidding_succeed: 应标成功 label_bidding_succeed: 应标成功
label_bidding_fail: 应标失败,该项目已经应标 label_bidding_fail: 应标失败,该项目已经应标
label_bidding_homework_fail: 作业提交失败,该作业已经被提交!
label_requirement_list: 需求列表 label_requirement_list: 需求列表
@ -1282,7 +1290,7 @@ zh:
label_x_homework_project: #modify by huang label_x_homework_project: #modify by huang
zero: 已提交的作业 zero: 已提交的作业
one: 已提交的作业 one: 已提交的作业
other: 已提交的uzoye other: 已提交的作业
#end #end
label_x_responses: #modify by men label_x_responses: #modify by men
zero: 留言 zero: 留言
@ -1476,7 +1484,8 @@ zh:
label_user_create_project: 创建了 label_user_create_project: 创建了
#added by bai #added by bai
label_identity: 身份 label_identity: 身份
label_teacher: 教 师 label_teacher: 教 师
label_teacher_homework: 教师姓名
label_student: 学生 label_student: 学生
label_other: 其他 label_other: 其他
label_gender: 性别 label_gender: 性别
@ -1497,4 +1506,4 @@ zh:
label_course_homework_list: 作业列表 label_course_homework_list: 作业列表
label_course_homework_new: 发布作业 label_course_homework_new: 发布作业
label_course_data: 资料 label_course_data: 资料
label_homework_statistics: 作业统计 label_homework_statistics: 作业统计

View File

@ -0,0 +1,6 @@
class AddTermToCourses < ActiveRecord::Migration
def change
add_column :courses, :term, :string
add_column :courses, :string, :string
end
end

View File

@ -230,11 +230,15 @@ ul.tool li{list-style-type:none;
font-size:12px; font-size:12px;
font-family:微软雅黑; font-family:微软雅黑;
} }
.justify_side > span{
text-align: justify;
width: 180px;
}
.font_lighter_sidebar{ .font_lighter_sidebar{
/*font-family:微软雅黑;*/ /*font-family:微软雅黑;*/
color:#919294; color:#919294;
font-size:13px; font-size:13px;
padding-left: 12px; padding-left: 0px;
padding-right: 8px; padding-right: 8px;
line-height: 1.5em; line-height: 1.5em;
} }