Merge branch 'develop' of 10.0.47.245:/home/trustie2 into develop

Conflicts:
	app/views/news/index.html.erb
This commit is contained in:
xianbo 2013-11-01 15:53:38 +08:00
commit c7b38e5bf2
21 changed files with 293 additions and 122 deletions

View File

@ -7,7 +7,7 @@ class BidsController < ApplicationController
menu_item :homework_respond, :only => :homework_respond menu_item :homework_respond, :only => :homework_respond
menu_item :homework_statistics, :only => :homework_statistics menu_item :homework_statistics, :only => :homework_statistics
#Ended by young #Ended by young
before_filter :find_bid, :only => [:show, :show_project, :create, :destroy, :more, :back, :add,:new,:show_results,:set_reward, :add_homework, :fork, :create_fork, before_filter :find_bid, :only => [:show, :show_project, :create,:destroy,:more,:back,:add,:new,:show_results,:set_reward, :add_homework, :fork, :create_fork,
:show_course, :show_bid_project, :show_bid_user] :show_course, :show_bid_project, :show_bid_user]
before_filter :require_login,:only => [:set_reward, :destroy, :add, :new, ] before_filter :require_login,:only => [:set_reward, :destroy, :add, :new, ]
@ -28,8 +28,6 @@ class BidsController < ApplicationController
@bids = Bid.visible.where('reward_type = ?', 1) @bids = Bid.visible.where('reward_type = ?', 1)
end end
@bids = @bids.like(params[:name]) if params[:name].present? @bids = @bids.like(params[:name]) if params[:name].present?
@bid_count = @bids.count @bid_count = @bids.count
@bid_pages = Paginator.new @bid_count, @limit, params['page'] @bid_pages = Paginator.new @bid_count, @limit, params['page']
@ -310,6 +308,18 @@ class BidsController < ApplicationController
# @project = Project.where("id in []", a) # @project = Project.where("id in []", a)
@user = @bid.author @user = @bid.author
@bidding_project = @bid.biding_projects.all @bidding_project = @bid.biding_projects.all
if params[:student_id].present?
@temp = []
@bidding_project.each do |pro|
if pro.project && pro.project.project_status
if /#{params[:student_id]}/ =~ pro.user.user_extensions.student_id
@temp << pro
end
end
@temp
end
@bidding_project = @temp
else
#added by nie #added by nie
@temp = [] @temp = []
@bidding_project.each do |pro| @bidding_project.each do |pro|
@ -322,6 +332,8 @@ class BidsController < ApplicationController
@bidding_project = @temp.sort {|a,b| b.project.project_status.grade <=> a.project.project_status.grade} @bidding_project = @temp.sort {|a,b| b.project.project_status.grade <=> a.project.project_status.grade}
end end
#ended #ended
end
if @bid.homework_type == 1 if @bid.homework_type == 1
@homework = HomeworkAttach.new @homework = HomeworkAttach.new
@homework_list = @bid.homeworks @homework_list = @bid.homeworks

View File

@ -328,15 +328,15 @@ class ProjectsController < ApplicationController
else else
@offset ||= @project_pages.reverse_offset @offset ||= @project_pages.reverse_offset
unless @offset == 0 unless @offset == 0
@projects_status = @projects_status.reorder('changesets_count').offset(@offset).limit(@limit).all.reverse @projects_status = @projects_status.offset(@offset).limit(@limit).all.reverse
else else
limit = @project_count % @limit limit = @project_count % @limit
if limit == 0 if limit == 0
limit = @limit limit = @limit
end end
@projects_status = @projects_status.reorder('changesets_count').offset(@offset).limit(limit).all.reverse @projects_status = @projects_status.offset(@offset).limit(limit).all.reverse
end end
@s_type = 1 @s_type = 0
# @projects = @projects.sort {|x,y| y.created_on <=> x.created_on } # @projects = @projects.sort {|x,y| y.created_on <=> x.created_on }
# @projects = @projects[@offset, @limit] # @projects = @projects[@offset, @limit]
end end
@ -513,6 +513,9 @@ class ProjectsController < ApplicationController
# added by bai # added by bai
@course.term = params[:term] @course.term = params[:term]
@course.time = params[:time] @course.time = params[:time]
@course.setup_time = params[:setup_time]
@course.endup_time = params[:endup_time]
@course.class_period = params[:class_period]
end end
# end # end
# @course.save # @course.save
@ -536,7 +539,7 @@ class ProjectsController < ApplicationController
r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first
m = Member.new(:user => User.current, :roles => [r]) m = Member.new(:user => User.current, :roles => [r])
project = ProjectInfo.new(:user_id => User.current.id, :project_id => @project.id) project = ProjectInfo.new(:user_id => User.current.id, :project_id => @project.id)
UserGrade.create(:user_id => User.current.id, :project_id => @project.id, :grade => 0) user_grades = UserGrade.create(:user_id => User.current.id, :project_id => @project.id)
if params[:project][:is_public] == '1' if params[:project][:is_public] == '1'
project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0, :grade => 0, :project_type => @course_tag) project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0, :grade => 0, :project_type => @course_tag)
end end
@ -590,6 +593,7 @@ class ProjectsController < ApplicationController
r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first
m = Member.new(:user => User.current, :roles => [r]) m = Member.new(:user => User.current, :roles => [r])
project = ProjectInfo.new(:user_id => User.current.id, :project_id => @project.id) project = ProjectInfo.new(:user_id => User.current.id, :project_id => @project.id)
user_grades = UserGrade.create(:user_id => User.current.id, :project_id => @project.id)
if params[:project][:is_public] == '1' || @course_tag=="1" if params[:project][:is_public] == '1' || @course_tag=="1"
project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0) project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0)
end end
@ -808,6 +812,9 @@ class ProjectsController < ApplicationController
# added by bai # added by bai
@course.term = params[:term] @course.term = params[:term]
@course.time = params[:time] @course.time = params[:time]
@course.setup_time = params[:setup_time]
@course.endup_time = params[:endup_time]
@course.class_period = params[:class_period]
# end # end
@course.save @course.save
end end

View File

@ -113,6 +113,8 @@ class UsersController < ApplicationController
events << Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 30) events << Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 30)
end end
@events_by_day = events.group_by(&:event_date) @events_by_day = events.group_by(&:event_date)
unless User.current.admin? unless User.current.admin?
@ -424,6 +426,25 @@ class UsersController < ApplicationController
@state = 0 @state = 0
end end
if params[:user].present?
user_temp = User.find_by_sql("select id from users where firstname like '%#{params[:user]}%' or lastname like '%#{params[:user]}%'")
if user_temp.size > 1
activity = Activity.where('user_id in (?)', user_temp).where('user_id in (?)', watcher).order('id desc')
elsif user_temp.size == 1
activity = Activity.where('user_id = ?', user_temp).where('user_id in (?)', watcher).order('id desc')
else
activity = Activity.where("1 = 0")
end
@offset, @limit = api_offset_and_limit({:limit => 10})
@activity_count = activity.count
@activity_pages = Paginator.new @activity_count, @limit, params['page']
@offset ||= @activity_pages.offset
@activity = activity.offset(@offset).limit(@limit)
@state = 0
end
#Modified by nie #Modified by nie
unless User.current.admin? unless User.current.admin?

View File

@ -225,4 +225,21 @@ module ProjectsHelper
end end
return @result return @result
end end
# 将动态中类型转换为可读的字符串
def eventToLanguage event_type
case event_type
when "issue-note"
l :label_issue
when "issue"
l :label_issue
when "attachment"
l :label_attachment
when "news"
l :label_news
else
""
end
end
end end

View File

@ -1,6 +1,25 @@
<%= form_tag(:controller => 'bids', :action => "show_project", :method => :get) do %>
<div class="project-search-block">
<table width="100%" valign="center">
<tr>
<td width="16%"><span style="margin-left:0px"><%= l(:label_task_plural)%></span></td>
<td align="right">
<div class="project-search">
<%= text_field_tag 'student_id', params[:student_id], :size => 30 %>
<%= submit_tag l(:label_search_by_student_id), :class => "small", :name => nil %>
</div></td>
</tr>
</table>
</div>
<% end %>
<% bidding_project.each do |b_project|%> <% bidding_project.each do |b_project|%>
<% if b_project.project %> <% if b_project.project %>
<table width="90%" border="0" align='center'> <table width="90%" border="0" align='center'>
<tr> <tr>
<td> <td>
@ -24,7 +43,7 @@
<td style="color: red;" align="right" valign="0.1em" width="16%"> <td style="color: red;" align="right" valign="0.1em" width="16%">
<strong><span id="reward_result_<%=b_project.id%>"> <!-- 调用js进行刷新 --> <strong><span id="reward_result_<%=b_project.id%>"> <!-- 调用js进行刷新 -->
<%= l(:label_system_grade) %>:<%= (b_project.project.project_status.nil? ? 0 : b_project.project.project_status.grade) unless (b_project.project.project_status.nil? && b_project.project.nil?) %> <%= l(:label_system_grade) %>:<%= (b_project.project.project_status.nil? ? 0.0 : b_project.project.project_status.grade) unless (b_project.project.project_status.nil? && b_project.project.nil?) %>
<% if get_prize(b_project).nil? or get_prize(b_project) == "" %> <% if get_prize(b_project).nil? or get_prize(b_project) == "" %>
<% if @bid.deadline < Date.today %> <% if @bid.deadline < Date.today %>
<%= l(:label_noawards)%> <%= l(:label_noawards)%>

View File

@ -111,14 +111,25 @@
<div class="inf_user_context"> <div class="inf_user_context">
<table style="font-family:微软雅黑" > <table style="font-family:微软雅黑" >
<!-- modified by bai 加超链接 --> <!-- addedby bai 教师姓名加超链接、加入开课时间、结课时间与课时 -->
<tr> <tr>
<td valign="top" style="padding-left: 8px;"><%= 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;"><%= 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>
<!-- end -->
<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_setup_time) %> :</td><td class="font_lighter_sidebar"><%= @course.setup_time %></td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;"><%= l(:label_endup_time) %> :</td><td class="font_lighter_sidebar"><%= @course.endup_time %></td>
</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>
</tr>
<tr>
<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 -->

View File

@ -67,7 +67,7 @@
</tr> </tr>
<tr> <tr>
<td><%= l(:label_limit_time) %> <%= @bid.deadline %></td> <td><%= l(:label_limit_time) %>: <%= @bid.deadline %></td>
</tr> </tr>
<% unless @bid.parent_id.nil?%> <% unless @bid.parent_id.nil?%>
<tr> <tr>

View File

@ -213,12 +213,14 @@
<%= render_menu :user_menu %> <%= render_menu :user_menu %>
<% end %> <% end %>
</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>
<%= render_flash_messages %> <%= render_flash_messages %>
</div> </div>
<%= render :partial => 'layouts/base_footer'%> <%= render :partial => 'layouts/base_footer'%>
</div> </div>
<div id="ajax-indicator" style="display:none;"> <div id="ajax-indicator" style="display:none;">

View File

@ -1,6 +1,7 @@
<!-- added by huang -->
<div style="padding-bottom: 10px"> <div style="padding-bottom: 10px">
<% if @project.project_type == 1%> <% if @project.project_type == 1%>
<%= link_to(l(:label_news_notice), <%= link_to(l(:label_news_notice),
new_project_news_path(@project), new_project_news_path(@project),
:class => 'icon icon-add', :class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %> :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %>
@ -14,19 +15,19 @@
</div> </div>
<div id="add-news" style="display:none;"> <div id="add-news" style="display:none;">
<% if @project.project_type == 1 %> <% if @project.project_type == 1 %>
<h3><%=l(:bale_news_notice)%></h3> <h3><%= l(:bale_news_notice)%></h3>
<% else %> <% else %>
<h3><%=l(:label_news_new)%></h3> <h3><%= l(:label_news_new)%></h3>
<% end %> <% 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 } %>
<%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create) %>
<%= preview_link preview_news_path(:project_id => @project), 'news-form' %> | <%= preview_link preview_news_path(:project_id => @project), 'news-form' %> |
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()' %> <%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()' %>
<% end if @project %> <% end if @project %>
<div id="preview" class="wiki"></div> <div id="preview" class="wiki"></div>
</div> </div>
<!--<h3><%=l(:label_news_plural)%></h3> <!--<h3><%=l(:label_news_plural)%></h3>
@ -35,33 +36,38 @@
<p class="nodata"><%= l(:label_no_data) %></p> <p class="nodata"><%= l(:label_no_data) %></p>
<% else %> <% else %>
<% @newss.each do |news| %> <% @newss.each do |news| %>
<h3><%= avatar(news.author, :size => "24") %><%= link_to_project(news.project) + ': ' unless news.project == @project %> <h3><%= avatar(news.author, :size => "24") %><%= link_to_project(news.project) + ': ' unless news.project == @project %>
<%= link_to h(news.title), news_path(news) %> <%= link_to h(news.title), news_path(news) %>
<%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %></h3> <%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %></h3>
<p class="author"><%= authoring news.created_on, news.author %></p> <p class="author"><%= authoring news.created_on, news.author %></p>
<div class="wiki"> <div class="wiki">
<%= textilizable(news, :description) %> <%= textilizable(news, :description) %>
</div> </div>
<% end %> <% end %>
<% end %> --> <% end %> -->
<!--add by huang :list news--> <!--add by huang :list news-->
<div style="padding-top: 15px"> <div style="padding-top: 15px">
<% if @newss.empty? %> <% if @newss.empty? %>
<p class="nodata"><%= l(:label_no_data) %></p> <p class="nodata">
<% else %> <%= l(:label_no_data) %>
<% @newss.each do |news| %> </p>
<table width="660px" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;"> <% else %>
<tr> <% @newss.each do |news| %>
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(news.author), :class => "avatar") %></td> <td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(news.author), :class => "avatar") %></td>
<td><table width="580px" border="0"> <td><table width="580px" border="0">
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(news.author), :class => "avatar"), user_path(news.author) %></td>
<td>
<table width="580px" border="0">
<% if @project.project_type == 1 %> <% if @project.project_type == 1 %>
<tr> <tr>
<td colspan="2" valign="top"><strong><%=link_to_user(news.author)if news.respond_to?(:author) %></strong> <span class="font_lighter"><%= l(:label_project_notice)%></span> <%= link_to h(news.title), news_path(news) %></td> <td colspan="2" valign="top"><strong><%= link_to_user(news.author)if news.respond_to?(:author) %></strong><span class="font_lighter"><%= l(:label_project_notice)%></span><span><%= link_to h(news.title), news_path(news) %></span>
<span style="float: right"><%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> </span></td>
</tr> </tr>
<% else %> <% else %>
<tr> <tr>
<td colspan="2" valign="top"><strong><%=link_to_user(news.author)if news.respond_to?(:author) %></strong> <span class="font_lighter"><%= l(:label_project_newshare)%></span> <%= link_to h(news.title), news_path(news) %></td> <td colspan="2" valign="top"><strong><%= link_to_user(news.author)if news.respond_to?(:author) %></strong><span class="font_lighter"><%= l(:label_project_newshare)%></span><span> <%= link_to h(news.title), news_path(news) %></span>
<span style="float: right"> <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> </span></td>
</tr> </tr>
<% end %> <% end %>
<tr> <tr>
@ -73,24 +79,26 @@
</tr> </tr>
</table></td> </table></td>
</tr> </tr>
</table> </table>
<% end %> <% end %>
<% end %></div> <% end %>
</div>
<!--end--> <!--end-->
<div style="padding-right: 10px"> <div style="padding-right: 10px">
<div class="pagination"> <div class="pagination">
<ul> <ul>
<%= pagination_links_full @news_pages %> <%= pagination_links_full @news_pages %>
</ul> </ul>
</div> </div>
<% other_formats_links do |f| %> <% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %> <%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %>
<% end %> <% end %>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %> <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
<%= stylesheet_link_tag 'scm' %> <%= stylesheet_link_tag 'scm' %>
<% end %> <% end %>
<% html_title(l(:label_news_plural)) -%> </div> <% html_title(l(:label_news_plural)) -%>
</div>

View File

@ -8,7 +8,7 @@
<%= delete_link news_path(@news) if User.current.allowed_to?(:manage_news, @project) %> <%= delete_link news_path(@news) if User.current.allowed_to?(:manage_news, @project) %>
</div> </div>
<h3><strong><%= h @news.title %></strong></h3> <h3><strong><%=h @news.title %></strong></h3>
<% if authorize_for('news', 'edit') %> <% if authorize_for('news', 'edit') %>
<div id="edit-news" style="display:none;"> <div id="edit-news" style="display:none;">

View File

@ -17,11 +17,52 @@
<%= f.fields_for @course do |m| %> <%= f.fields_for @course do |m| %>
<!-- added by bai 新增开课时间、结课时间、课时 -->
<% unless @course.nil?%>
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:20px"><%= l(:label_setup_time) %><span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" style="width: 10px"><%= text_field_tag :setup_time, @course.setup_time, :placeholder => "在此选择开课日期" %></span>
<span><%= calendar_for('setup_time')%></span>
</td></tr></table></p>
<% else %>
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:20px"><%= l(:label_setup_time) %><span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" style="width: 10px"><%= text_field_tag :setup_time, nil, :placeholder => "在此选择开课日期" %></span>
<span><%= calendar_for('setup_time')%></span>
</td></tr></table></p>
<% end %>
<% unless @course.nil?%>
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:20px"><%= l(:label_endup_time) %><span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" style="width: 10px"><%= text_field_tag :endup_time, @course.endup_time, :placeholder => "在此选择结课日期" %></span>
<span><%= calendar_for('endup_time')%></span>
</td></tr></table></p>
<% else %>
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:20px"><%= l(:label_endup_time) %><span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" style="width: 10px"><%= text_field_tag :endup_time, nil, :placeholder => "在此选择结课日期" %></span>
<span><%= calendar_for('endup_time')%></span>
</td></tr></table></p>
<% end %>
<% unless @course.nil?%>
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:20px"><%= l(:label_class_period) %><span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" style="width: 10px"><%= text_field_tag :class_period, @course.class_period, :placeholder => "在此输入课时" %></span> <span>&nbsp;<strong><%= l(:label_class_hour)%></strong></span>
</td></tr></table></p>
<% else %>
<p><table><tr><td><span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:20px"><%= l(:label_class_period) %><span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" style="width: 10px"><%= text_field_tag :class_period, nil, :placeholder => "在此输入课时" %></span><strong><%= l(:label_class_hour)%></strong>
</td></tr></table></p>
<% end %>
<!-- end -->
<!-- added by bai 增加了“年度”和“学期” --> <!-- added by bai 增加了“年度”和“学期” -->
<p><table><tr><td> <p><table><tr><td>
<% unless @course.nil? %> <% unless @course.nil? %>
<% if @course.time == 2008 %> <% if @course.time == 2008 %>
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_term) %><span class="required"> *&nbsp;&nbsp;</span></strong></td> <p><table><tr><td class="info" align="right" style="width: 90px; margin-left:20px"><strong><%= l(:label_term) %><span class="required"> *&nbsp;&nbsp;</span></strong></td>
<td class="info" style="width: 10px"> <td class="info" style="width: 10px">
<%= select_tag 'time', "<option value = '2008' selected='selected'>2008</option> <%= select_tag 'time', "<option value = '2008' selected='selected'>2008</option>
<option value = '2009'>2009</option> <option value = '2009'>2009</option>
@ -227,7 +268,7 @@
<em class="info" style="margin-left:95px;"><%= l(:text_command) %></em> <em class="info" style="margin-left:95px;"><%= l(:text_command) %></em>
<% end %> <% end %>
<p style="margin-left:-10px;padding-right: 20px;"><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %></p><!--by young--> <p style="margin-left:-10px;padding-right: 20px;"><%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %></p><!--by young-->
<p style="margin-left:-10px;"><em style ="color: #888888;display: block;font-size: 90%;font-style: normal;"><%= f.check_box :is_public, :style => "margin-left:10px;" %></em></p> <p style="margin-left:-10px;"><em style ="color: #888888;display: block;font-size: 90%;font-style: normal;"><%= f.check_box :is_public, :style => "margin-left:10px;" %><%= l(:label_public_info) %></em></p> <!-- modified by bai -->
<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

@ -89,7 +89,7 @@
</div> </div>
<div class="grade"> <div class="grade">
<% if @project.project_type !=1 %> <% if @project.project_type !=1 %>
<%= content_tag('span', "#{l(:label_project_grade)}: ")%><span style='color:red'><%= @project.project_status.grade%></span> <%= content_tag('span', "#{l(:label_project_grade)}: ")%><span style='color:red'><%=@project.project_status ? @project.project_status.grade : 0.0 %></span>
<% end %> <% end %>
</div> </div>
<!-- added by liuping --> <!-- added by liuping -->

View File

@ -7,6 +7,7 @@
<%= error_messages_for 'member' %> <%= error_messages_for 'member' %>
<% roles = Role.find_all_givable %> <% roles = Role.find_all_givable %>
<% members = @project.member_principals.includes(:roles, :principal).all.sort %> <% members = @project.member_principals.includes(:roles, :principal).all.sort %>
<!-- 如果是课程且点击教师或者学生,则对成员进行过滤 -->
<% members = searchPeopleByRoles(@project, 3).sort if params[:role] == '1' %> <% members = searchPeopleByRoles(@project, 3).sort if params[:role] == '1' %>
<% members = searchPeopleByRoles(@project, 5).sort if params[:role] == '2' %> <% members = searchPeopleByRoles(@project, 5).sort if params[:role] == '2' %>
<% if @project.project_type == 1 %> <% if @project.project_type == 1 %>

View File

@ -12,10 +12,13 @@
</span></td> </span></td>
<td valign="center"><%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %></td> <td valign="center"><%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %></td>
<% else %> <% else %>
<%= l(:label_new_course)%> <%= l(:label_new_course)%>
</span></td> </span></td>
<% if User.current.user_extensions.identity == 0 %>
<td valign="center"><%= link_to(l(:label_course_new), {:controller => 'projects', :action => 'new', :course => 1, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %></td> <td valign="center"><%= link_to(l(:label_course_new), {:controller => 'projects', :action => 'new', :course => 1, :project_type => @project_type}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %></td>
<% end %>
<% end %> <% end %>
<td align="right"> <td align="right">
<div class="project-search"> <div class="project-search">

View File

@ -22,14 +22,13 @@
<span class="font_lighter"> <span class="font_lighter">
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %> <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
<%= l(:label_new_activity) %> </span> <%= l(:label_new_activity) %> </span>
<%= link_to format_activity_title(e.event_title), e.event_url %> <%= link_to "#{eventToLanguage(e.event_type)}: "<<format_activity_title(e.event_title), e.event_url %>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" width="580px" > <td colspan="2" width="580px" >
<p class="font_description"> <p class="font_description">
<!-- modify by nyan --> <%= textilizable( truncate(e.event_description, :length => 240)) %>
<%= textilizable( stringCut240(e.event_description) ) %>
</p></td> </p></td>
</tr> </tr>
<tr> <tr>

View File

@ -9,8 +9,10 @@
<table width="580" border="0"> <table width="580" border="0">
<tr> <tr>
<td colspan="2" valign="top"><span><%= link_to_project(membership.project) %></span> <td colspan="2" valign="top"><span><%= link_to_project(membership.project) %></span>
<span></span> <span>
<span style="float: right"><%= l(:label_x_base_courses_member, :count => membership.project.members.count) %>(<%= link_to "#{membership.project.members.count}", project_member_path(membership.project), :course =>'1' %>)&nbsp;&nbsp;
</span>
<span style="float: right"><%= join_in_course(membership.project, User.current)%>&nbsp;&nbsp;&nbsp;&nbsp;<%= l(:label_x_base_courses_member, :count => membership.project.members.count) %>(<%= link_to "#{membership.project.members.count}", project_member_path(membership.project), :course =>'1' %>)&nbsp;&nbsp;
<%= l(:label_homework) %> (<span class=""><%= link_to (membership.project.homeworks.count), {:controller => 'projects', :action => 'homework', :id => membership.project.identifier} %></span>) <%= l(:label_homework) %> (<span class=""><%= link_to (membership.project.homeworks.count), {:controller => 'projects', :action => 'homework', :id => membership.project.identifier} %></span>)
&nbsp;&nbsp; &nbsp;&nbsp;
<%= l(:label_course_news)%> (<span style="color: #ed8924"><%= link_to (membership.project.news.count), {:controller => 'news', :action => 'index', :project_id => membership.project.identifier} %></span>) <%= l(:label_course_news)%> (<span style="color: #ed8924"><%= link_to (membership.project.news.count), {:controller => 'news', :action => 'index', :project_id => membership.project.identifier} %></span>)

View File

@ -1,6 +1,22 @@
<% if User.current.id == @user.id%> <% if User.current.id == @user.id%>
<%= show_activity @state%> <%= show_activity @state%>
<%= form_tag(:controller => 'users', :action => "show") do %>
<div class="user-search-block">
<table width="100%" valign="center">
<tr>
<td align="right">
<div class="project-search">
<%= text_field_tag 'user', params[:user], :size => 30 %>
<%= submit_tag l(:label_search_by_user), :class => "small", :name => nil %>
</div></td>
</tr>
</table>
</div>
<% end %> <% end %>
<% end %>
<% unless @state == 2%> <% unless @state == 2%>
<% unless @activity.empty? %> <% unless @activity.empty? %>
<div id="activity"> <div id="activity">

View File

@ -19,6 +19,7 @@
<% unless @events_by_day.empty? %> <% unless @events_by_day.empty? %>
<div id="activity"> <div id="activity">
<% @events_by_day.keys.sort.reverse.each do |day| %> <% @events_by_day.keys.sort.reverse.each do |day| %>
<% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%> <% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%>

View File

@ -827,7 +827,7 @@ zh:
label_user_login: "最后登录:" label_user_login: "最后登录:"
label_user_mail: "邮件地址:" label_user_mail: "邮件地址:"
label_user_joinin: "加入时间:" label_user_joinin: "加入时间:"
label_user_activities: 当前还没有活动,快来加入我们吧 label_user_activities: 没有关注该用户,请尝试重新输入
label_user_activities_other: 该用户暂无任何动态! label_user_activities_other: 该用户暂无任何动态!
label_project_overview: "概述" label_project_overview: "概述"
label_project_tool: "工具" label_project_tool: "工具"
@ -1546,14 +1546,19 @@ zh:
label_requirement_from: 需求来源 label_requirement_from: 需求来源
label_course_view: 作业界面 label_course_view: 作业界面
label_course_return: "返 回 课 程" label_course_return: "返 回 课 程"
label_setup_time: 开课时间
label_endup_time: 结课时间
label_class_period: 整体课时
label_class_hour: 学时
#end #end
label_course: 课程 label_course: 课程
label_course_new: 新建课程 label_course_new: 新建课程
label_course_join_student: 加入课程 label_course_join_student: 加入课程
label_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该项目。)
label_course_view_student: 查看其他课程 label_course_view_student: 查看其他课程
label_public_info: 若不公开,仅项目成员可见该项目
label_course_student: 学生 label_course_student: 学生
label_homework: 课程作业 label_homework: 课程作业
label_course_file: 资料共享 label_course_file: 资料共享
@ -1603,6 +1608,8 @@ zh:
one: 份资料 one: 份资料
other: 份资料 other: 份资料
#add by men #add by men
label_technicl_title_professor: 教授 label_technicl_title_professor: 教授
label_technicl_title_associate_professor: 副教授 label_technicl_title_associate_professor: 副教授
@ -1663,4 +1670,7 @@ zh:
label_has_watched_project: 关注的项目 label_has_watched_project: 关注的项目
label_project_take: 参与的项目 label_project_take: 参与的项目
label_peoject_take_in: 加入了项目: label_peoject_take_in: 加入了项目:
label_search_by_user: 按用户搜索
label_update_homework_succeed: 作业更新成功 label_update_homework_succeed: 作业更新成功
label_task_plural: 作业
label_search_by_student_id: 按学号过滤

View File

@ -81,6 +81,7 @@ RedmineApp::Application.routes.draw do
get 'projects/:id/issues/report', :to => 'reports#issue_report', :as => 'project_issues_report' get 'projects/:id/issues/report', :to => 'reports#issue_report', :as => 'project_issues_report'
get 'projects/:id/issues/report/:detail', :to => 'reports#issue_report_details', :as => 'project_issues_report_details' get 'projects/:id/issues/report/:detail', :to => 'reports#issue_report_details', :as => 'project_issues_report_details'
post '/users/:id/user_activities', :to => 'users#show', :as => "user_activities"
#added by young #added by young
resources :users do resources :users do