Merge branch 'develop' of 10.0.47.245:/home/trustie2 into develop
Conflicts: app/views/news/index.html.erb
This commit is contained in:
commit
c7b38e5bf2
|
@ -7,7 +7,7 @@ class BidsController < ApplicationController
|
|||
menu_item :homework_respond, :only => :homework_respond
|
||||
menu_item :homework_statistics, :only => :homework_statistics
|
||||
#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]
|
||||
before_filter :require_login,:only => [:set_reward, :destroy, :add, :new, ]
|
||||
|
||||
|
@ -28,8 +28,6 @@ class BidsController < ApplicationController
|
|||
@bids = Bid.visible.where('reward_type = ?', 1)
|
||||
end
|
||||
|
||||
|
||||
|
||||
@bids = @bids.like(params[:name]) if params[:name].present?
|
||||
@bid_count = @bids.count
|
||||
@bid_pages = Paginator.new @bid_count, @limit, params['page']
|
||||
|
@ -310,6 +308,18 @@ class BidsController < ApplicationController
|
|||
# @project = Project.where("id in []", a)
|
||||
@user = @bid.author
|
||||
@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
|
||||
@temp = []
|
||||
@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}
|
||||
end
|
||||
#ended
|
||||
end
|
||||
|
||||
if @bid.homework_type == 1
|
||||
@homework = HomeworkAttach.new
|
||||
@homework_list = @bid.homeworks
|
||||
|
|
|
@ -328,15 +328,15 @@ class ProjectsController < ApplicationController
|
|||
else
|
||||
@offset ||= @project_pages.reverse_offset
|
||||
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
|
||||
limit = @project_count % @limit
|
||||
if limit == 0
|
||||
limit = @limit
|
||||
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
|
||||
@s_type = 1
|
||||
@s_type = 0
|
||||
# @projects = @projects.sort {|x,y| y.created_on <=> x.created_on }
|
||||
# @projects = @projects[@offset, @limit]
|
||||
end
|
||||
|
@ -513,6 +513,9 @@ class ProjectsController < ApplicationController
|
|||
# added by bai
|
||||
@course.term = params[:term]
|
||||
@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
|
||||
|
@ -536,7 +539,7 @@ class ProjectsController < ApplicationController
|
|||
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])
|
||||
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'
|
||||
project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0, :grade => 0, :project_type => @course_tag)
|
||||
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
|
||||
m = Member.new(:user => User.current, :roles => [r])
|
||||
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"
|
||||
project_status = ProjectStatus.create(:project_id => @project.id, :watchers_count => 0, :changesets_count => 0)
|
||||
end
|
||||
|
@ -808,6 +812,9 @@ class ProjectsController < ApplicationController
|
|||
# added by bai
|
||||
@course.term = params[:term]
|
||||
@course.time = params[:time]
|
||||
@course.setup_time = params[:setup_time]
|
||||
@course.endup_time = params[:endup_time]
|
||||
@course.class_period = params[:class_period]
|
||||
# end
|
||||
@course.save
|
||||
end
|
||||
|
|
|
@ -113,6 +113,8 @@ class UsersController < ApplicationController
|
|||
events << Redmine::Activity::Fetcher.new(User.current, :author => @user).events(nil, nil, :limit => 30)
|
||||
end
|
||||
|
||||
|
||||
|
||||
@events_by_day = events.group_by(&:event_date)
|
||||
|
||||
unless User.current.admin?
|
||||
|
@ -424,6 +426,25 @@ class UsersController < ApplicationController
|
|||
@state = 0
|
||||
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
|
||||
unless User.current.admin?
|
||||
|
|
|
@ -225,4 +225,21 @@ module ProjectsHelper
|
|||
end
|
||||
return @result
|
||||
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
|
||||
|
|
|
@ -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|%>
|
||||
<% if b_project.project %>
|
||||
|
||||
|
||||
|
||||
<table width="90%" border="0" align='center'>
|
||||
<tr>
|
||||
<td>
|
||||
|
@ -24,7 +43,7 @@
|
|||
|
||||
<td style="color: red;" align="right" valign="0.1em" width="16%">
|
||||
<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 @bid.deadline < Date.today %>
|
||||
<%= l(:label_noawards)%>
|
||||
|
|
|
@ -111,14 +111,25 @@
|
|||
<div class="inf_user_context">
|
||||
<table style="font-family:微软雅黑" >
|
||||
|
||||
<!-- modified by bai 加超链接 -->
|
||||
<!-- addedby bai 教师姓名加超链接、加入开课时间、结课时间与课时 -->
|
||||
<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>
|
||||
</tr>
|
||||
<!-- end -->
|
||||
|
||||
<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 %> <%= 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>
|
||||
<!-- end -->
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><%= l(:label_limit_time) %>: <%= @bid.deadline %></td>
|
||||
<td><%= l(:label_limit_time) %>: <%= @bid.deadline %></td>
|
||||
</tr>
|
||||
<% unless @bid.parent_id.nil?%>
|
||||
<tr>
|
||||
|
|
|
@ -213,12 +213,14 @@
|
|||
<%= render_menu :user_menu %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= yield %>
|
||||
<%= call_hook :view_layouts_base_content %>
|
||||
<div style="clear:both;"></div>
|
||||
<%= render_flash_messages %>
|
||||
|
||||
</div>
|
||||
|
||||
<%= render :partial => 'layouts/base_footer'%>
|
||||
</div>
|
||||
<div id="ajax-indicator" style="display:none;">
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<!-- added by huang -->
|
||||
<div style="padding-bottom: 10px">
|
||||
<% if @project.project_type == 1%>
|
||||
<%= link_to(l(:label_news_notice),
|
||||
<%= link_to(l(:label_news_notice),
|
||||
new_project_news_path(@project),
|
||||
:class => 'icon icon-add',
|
||||
:onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %>
|
||||
|
@ -14,19 +15,19 @@
|
|||
</div>
|
||||
|
||||
<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>
|
||||
<% end %>
|
||||
<%= labelled_form_for @news, :url => project_news_index_path(@project),
|
||||
<% if @project.project_type == 1 %>
|
||||
<h3><%= l(:bale_news_notice)%></h3>
|
||||
<% else %>
|
||||
<h3><%= l(:label_news_new)%></h3>
|
||||
<% end %>
|
||||
<%= labelled_form_for @news, :url => project_news_index_path(@project),
|
||||
:html => { :id => 'news-form', :multipart => true } do |f| %>
|
||||
<%= render :partial => 'news/form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<%= preview_link preview_news_path(:project_id => @project), 'news-form' %> |
|
||||
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()' %>
|
||||
<% end if @project %>
|
||||
<div id="preview" class="wiki"></div>
|
||||
<%= render :partial => 'news/form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<%= preview_link preview_news_path(:project_id => @project), 'news-form' %> |
|
||||
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()' %>
|
||||
<% end if @project %>
|
||||
<div id="preview" class="wiki"></div>
|
||||
</div>
|
||||
|
||||
<!--<h3><%=l(:label_news_plural)%></h3>
|
||||
|
@ -35,33 +36,38 @@
|
|||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% else %>
|
||||
<% @newss.each do |news| %>
|
||||
<h3><%= avatar(news.author, :size => "24") %><%= link_to_project(news.project) + ': ' unless news.project == @project %>
|
||||
<%= link_to h(news.title), news_path(news) %>
|
||||
<%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %></h3>
|
||||
<p class="author"><%= authoring news.created_on, news.author %></p>
|
||||
<div class="wiki">
|
||||
<%= textilizable(news, :description) %>
|
||||
</div>
|
||||
<h3><%= avatar(news.author, :size => "24") %><%= link_to_project(news.project) + ': ' unless news.project == @project %>
|
||||
<%= link_to h(news.title), news_path(news) %>
|
||||
<%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %></h3>
|
||||
<p class="author"><%= authoring news.created_on, news.author %></p>
|
||||
<div class="wiki">
|
||||
<%= textilizable(news, :description) %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %> -->
|
||||
|
||||
<!--add by huang :list news-->
|
||||
<div style="padding-top: 15px">
|
||||
<% if @newss.empty? %>
|
||||
<p class="nodata"><%= l(:label_no_data) %></p>
|
||||
<% else %>
|
||||
<% @newss.each do |news| %>
|
||||
<table width="660px" border="0" align="center" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
|
||||
<tr>
|
||||
<% if @newss.empty? %>
|
||||
<p class="nodata">
|
||||
<%= l(:label_no_data) %>
|
||||
</p>
|
||||
<% else %>
|
||||
<% @newss.each do |news| %>
|
||||
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(news.author), :class => "avatar") %></td>
|
||||
<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 %>
|
||||
<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>
|
||||
<% else %>
|
||||
<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>
|
||||
<% end %>
|
||||
<tr>
|
||||
|
@ -73,24 +79,26 @@
|
|||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
<% end %></div>
|
||||
</table>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<!--end-->
|
||||
<div style="padding-right: 10px">
|
||||
<div class="pagination">
|
||||
<ul>
|
||||
<%= pagination_links_full @news_pages %>
|
||||
</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} %>
|
||||
<% 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})) %>
|
||||
<%= stylesheet_link_tag 'scm' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% html_title(l(:label_news_plural)) -%> </div>
|
||||
<% html_title(l(:label_news_plural)) -%>
|
||||
</div>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<%= delete_link news_path(@news) if User.current.allowed_to?(:manage_news, @project) %>
|
||||
</div>
|
||||
|
||||
<h3><strong><%= h @news.title %></strong></h3>
|
||||
<h3><strong><%=h @news.title %></strong></h3>
|
||||
|
||||
<% if authorize_for('news', 'edit') %>
|
||||
<div id="edit-news" style="display:none;">
|
||||
|
|
|
@ -17,11 +17,52 @@
|
|||
|
||||
|
||||
<%= 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"> * </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"> * </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"> * </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"> * </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"> * </span></span>
|
||||
<span class="info" style="width: 10px"><%= text_field_tag :class_period, @course.class_period, :placeholder => "在此输入课时" %></span> <span> <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"> * </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 增加了“年度”和“学期” -->
|
||||
<p><table><tr><td>
|
||||
<% unless @course.nil? %>
|
||||
<% if @course.time == 2008 %>
|
||||
<p><table><tr><td class="info" align="right" style="width: 90px"><strong><%= l(:label_term) %><span class="required"> * </span></strong></td>
|
||||
<p><table><tr><td class="info" align="right" style="width: 90px; margin-left:20px"><strong><%= l(:label_term) %><span class="required"> * </span></strong></td>
|
||||
<td class="info" style="width: 10px">
|
||||
<%= select_tag 'time', "<option value = '2008' selected='selected'>2008</option>
|
||||
<option value = '2009'>2009</option>
|
||||
|
@ -227,7 +268,7 @@
|
|||
<em class="info" style="margin-left:95px;"><%= l(:text_command) %></em>
|
||||
<% 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;"><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>
|
||||
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
</div>
|
||||
<div class="grade">
|
||||
<% 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 %>
|
||||
</div>
|
||||
<!-- added by liuping -->
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<%= error_messages_for 'member' %>
|
||||
<% roles = Role.find_all_givable %>
|
||||
<% members = @project.member_principals.includes(:roles, :principal).all.sort %>
|
||||
<!-- 如果是课程且点击教师或者学生,则对成员进行过滤 -->
|
||||
<% members = searchPeopleByRoles(@project, 3).sort if params[:role] == '1' %>
|
||||
<% members = searchPeopleByRoles(@project, 5).sort if params[:role] == '2' %>
|
||||
<% if @project.project_type == 1 %>
|
||||
|
|
|
@ -12,10 +12,13 @@
|
|||
</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>
|
||||
<% else %>
|
||||
|
||||
<%= l(:label_new_course)%>
|
||||
|
||||
</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>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<td align="right">
|
||||
<div class="project-search">
|
||||
|
|
|
@ -22,14 +22,13 @@
|
|||
<span class="font_lighter">
|
||||
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
|
||||
<%= 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>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580px" >
|
||||
<p class="font_description">
|
||||
<!-- modify by nyan -->
|
||||
<%= textilizable( stringCut240(e.event_description) ) %>
|
||||
<%= textilizable( truncate(e.event_description, :length => 240)) %>
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -9,8 +9,10 @@
|
|||
<table width="580" border="0">
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><span><%= link_to_project(membership.project) %></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' %>)
|
||||
<span>
|
||||
|
||||
</span>
|
||||
<span style="float: right"><%= join_in_course(membership.project, User.current)%> <%= l(:label_x_base_courses_member, :count => membership.project.members.count) %>(<%= link_to "#{membership.project.members.count}", project_member_path(membership.project), :course =>'1' %>)
|
||||
<%= l(:label_homework) %> (<span class=""><%= link_to (membership.project.homeworks.count), {:controller => 'projects', :action => 'homework', :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>)
|
||||
|
|
|
@ -1,6 +1,22 @@
|
|||
<% if User.current.id == @user.id%>
|
||||
<%= 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 %>
|
||||
|
||||
|
||||
|
||||
<% unless @state == 2%>
|
||||
<% unless @activity.empty? %>
|
||||
<div id="activity">
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
|
||||
<% unless @events_by_day.empty? %>
|
||||
|
||||
<div id="activity">
|
||||
<% @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| -%>
|
||||
|
|
|
@ -827,7 +827,7 @@ zh:
|
|||
label_user_login: "最后登录:"
|
||||
label_user_mail: "邮件地址:"
|
||||
label_user_joinin: "加入时间:"
|
||||
label_user_activities: 您当前还没有活动,快来加入我们吧!
|
||||
label_user_activities: 您没有关注该用户,请尝试重新输入!
|
||||
label_user_activities_other: 该用户暂无任何动态!
|
||||
label_project_overview: "概述"
|
||||
label_project_tool: "工具"
|
||||
|
@ -1546,14 +1546,19 @@ zh:
|
|||
label_requirement_from: 需求来源
|
||||
label_course_view: 作业界面
|
||||
label_course_return: "返 回 课 程"
|
||||
label_setup_time: 开课时间
|
||||
label_endup_time: 结课时间
|
||||
label_class_period: 整体课时
|
||||
label_class_hour: 学时
|
||||
|
||||
|
||||
#end
|
||||
|
||||
label_course: 课程
|
||||
label_course_new: 新建课程
|
||||
label_course_join_student: 加入课程
|
||||
label_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该项目。)
|
||||
label_course_view_student: 查看其他课程
|
||||
label_public_info: 若不公开,仅项目成员可见该项目
|
||||
label_course_student: 学生
|
||||
label_homework: 课程作业
|
||||
label_course_file: 资料共享
|
||||
|
@ -1603,6 +1608,8 @@ zh:
|
|||
one: 份资料
|
||||
other: 份资料
|
||||
|
||||
|
||||
|
||||
#add by men
|
||||
label_technicl_title_professor: 教授
|
||||
label_technicl_title_associate_professor: 副教授
|
||||
|
@ -1663,4 +1670,7 @@ zh:
|
|||
label_has_watched_project: 关注的项目
|
||||
label_project_take: 参与的项目
|
||||
label_peoject_take_in: 加入了项目:
|
||||
label_search_by_user: 按用户搜索
|
||||
label_update_homework_succeed: 作业更新成功
|
||||
label_task_plural: 作业
|
||||
label_search_by_student_id: 按学号过滤
|
||||
|
|
|
@ -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/: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
|
||||
resources :users do
|
||||
|
|
Loading…
Reference in New Issue