diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb
index 8784a2811..20d7eb15c 100644
--- a/app/controllers/pull_requests_controller.rb
+++ b/app/controllers/pull_requests_controller.rb
@@ -360,7 +360,7 @@ class PullRequestsController < ApplicationController
:project_id => project_id,
:forge_message_id => pull_request_id,
:forge_message_type => "PullRequest",
- :viewed => true,
+ :viewed => false,
:status => status,
:operate_user_id => User.current.id,
)
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 20e0463d0..4f723fb28 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -35,11 +35,11 @@ class UsersController < ApplicationController
#
before_filter :can_show_course, :only => [:user_courses,:user_homeworks]
- before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses, :unsolved_issues_list, :unfinished_homework_list,
+ before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses, :unsolved_issues_list, :unfinished_homework_list, :user_manage_homeworks,
:unfinished_poll_list, :user_homeworks,:student_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments,
- :anonymous_evaluation_list,:unfinished_test_list, :watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index,
+ :anonymous_evaluation_list,:unfinished_test_list, :watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index, :user_receive_homeworks,
:unapproval_applied_list, :activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
- :activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource,:user_contestlist,
+ :activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource,:user_contestlist, :user_manage_issues, :user_receive_issues,
:user_courses4show,:user_projects4show,:user_contests4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction,
:user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course,:user_courselist,:user_projectlist,:sort_syllabus_list,
:sort_project_list,:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks, :cancel_or_collect,:expand_courses,:homepage, :user_issues, :course_community, :project_community, :contest_community]
@@ -150,6 +150,98 @@ class UsersController < ApplicationController
end
end
+# 我发布的issue
+def user_manage_issues
+ @manage_issues = "我发布的Issue"
+ # 排序(默认以更新时间降序)
+ order = "updated_on desc"
+ if params[:reorder_release_time]
+ order = "created_on #{params[:reorder_release_time]}"
+ elsif params[:reorder_turnover_time]
+ order = "updated_on #{params[:reorder_turnover_time]}"
+ end
+
+ @subject = params[:subject]
+ params[:assigned_to_id].to_i == 0 ? @assigned_to = nil : @assigned_to = params[:assigned_to_id].to_i
+ params[:author_id].to_i == 0 ? author_id = nil : author_id = params[:author_id].to_i
+ params[:project_id].to_i == 0 ? @project_id = nil : @project_id = params[:project_id]
+ if @project_id.nil?
+ @issues = Issue.where("author_id =? and subject like ?",
+ @user.id, "%#{@subject}%").order(order)
+ else
+ @issues = Issue.where("author_id =? and project_id=? and subject like ?",
+ @user.id, @project_id, "%#{@subject}%").order(order)
+ end
+ @issues_filter = Issue.where("author_id =?", @user.id).order('updated_on desc')
+ @issue_open_count = Issue.where(:author_id => @user.id, :status_id => [1, 2, 3, 4, 6]).count
+ @issue_close_count = Issue.where(:author_id => @user.id, :status_id => 5).count
+
+ # 导出excel的issues
+ @excel_issues = @issues
+ @issue_count = @issues.count
+ @limit = 10
+ @is_remote = true
+ @issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1
+ @offset ||= @issue_pages.offset
+ @issues = paginateHelper @issues, @limit
+ # @issues.limit(@issue_pages.per_page).offset(@issue_pages.offset).reorder(order).all
+ respond_to do |format|
+ format.html{render :layout => 'static_base'}
+ format.xls{
+ filename = "我发布的_#{l(:label_issue_list_xls)}.xls"
+ send_data(issue_list_xls(@excel_issues), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
+ }
+ format.api
+ format.js
+ end
+end
+
+# 我收到的issue
+def user_receive_issues
+ @receive_issues = "我收到的Issue"
+ # 排序(默认以更新时间降序)
+ order = "updated_on desc"
+ if params[:reorder_release_time]
+ order = "created_on #{params[:reorder_release_time]}"
+ elsif params[:reorder_turnover_time]
+ order = "updated_on #{params[:reorder_turnover_time]}"
+ end
+
+ @subject = params[:subject]
+ params[:assigned_to_id].to_i == 0 ? @assigned_to = nil : @assigned_to = params[:assigned_to_id].to_i
+ params[:author_id].to_i == 0 ? author_id = nil : author_id = params[:author_id].to_i
+ params[:project_id].to_i == 0 ? @project_id = nil : @project_id = params[:project_id]
+ if @project_id.nil?
+ @issues = Issue.where("assigned_to_id =? and subject like ?",
+ @user.id, "%#{@subject}%").order(order)
+ else
+ @issues = Issue.where("assigned_to_id =? and project_id=? and subject like ?",
+ @user.id, @project_id, "%#{@subject}%").order(order)
+ end
+ @issues_filter = Issue.where("assigned_to_id =?", @user.id).order('updated_on desc')
+ @issue_open_count = Issue.where(:assigned_to_id => @user.id, :status_id => [1, 2, 3, 4, 6]).count
+ @issue_close_count = Issue.where(:assigned_to_id => @user.id, :status_id => 5).count
+
+ # 导出excel的issues
+ @excel_issues = @issues
+ @issue_count = @issues.count
+ @limit = 10
+ @is_remote = true
+ @issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1
+ @offset ||= @issue_pages.offset
+ @issues = paginateHelper @issues, @limit
+ # @issues.limit(@issue_pages.per_page).offset(@issue_pages.offset).reorder(order).all
+ respond_to do |format|
+ format.html{render :layout => 'static_base'}
+ format.xls{
+ filename = "我发布的_#{l(:label_issue_list_xls)}.xls"
+ send_data(issue_list_xls(@excel_issues), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
+ }
+ format.api
+ format.js
+ end
+end
+
#展开所有回复
def show_all_replies
case params[:type]
@@ -362,7 +454,7 @@ class UsersController < ApplicationController
messages.each do |message_all|
# 未读的消息存放在数组
mess = message_all.message
- if (message_all.message_type != "SystemMessage"&& !mess.nil? && (mess.viewed == 0 || !mess.viewed)) || (message_all.message_type == "SystemMessage"&& !mess.nil? && mess.created_at > onclick_time)
+ if (message_all.message_type != "SystemMessage" && !mess.nil? && (mess.viewed == 0 || !mess.viewed)) || (message_all.message_type == "SystemMessage"&& !mess.nil? && mess.created_at > onclick_time)
unless (message_all.message_type == 'CourseMessage' && mess && mess.course && mess.course.is_delete == 1)
@message_alls << mess
end
@@ -1738,6 +1830,72 @@ class UsersController < ApplicationController
end
end
+ # 用户发布的作业
+ def user_manage_homeworks
+ @manage_homeworks = "我发布的作业"
+ @order,@b_sort,@type = params[:order] || "created_at",params[:sort] || "desc", 1
+ @r_sort = @b_sort == "desc" ? "asc" : "desc"
+ @type = @type.to_i
+ tea_courses = @user.courses.visible.not_deleted.select{|course| @user.has_teacher_role(course)}
+ tea_course_ids = tea_courses.empty? ? "(-1)" : "(" + tea_courses.map{|course| course.id}.join(',') + ")"
+ @homeworks = HomeworkCommon.where("course_id in #{tea_course_ids}").order("#{@order} #{@b_sort}")
+ if params[:property]
+ all_homework_ids = @homeworks.empty? ? "(-1)" : "(" + @homeworks.map{|h| h.id}.join(",") + ")"
+ if params[:property] == "1"
+ @homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 1")
+ elsif params[:property] == "2"
+ @homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 2")
+ elsif params[:property] == "3"
+ @homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 3")
+ end
+ end
+ @limit = 10
+ @is_remote = true
+ @hw_count = @homeworks.count
+ @hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
+ @offset ||= @hw_pages.offset
+ @homeworks = paginateHelper @homeworks,@limit
+ @search = ""
+ @property = params[:property]
+ respond_to do |format|
+ format.js
+ format.html {render :layout => 'static_base'}
+ end
+ end
+
+ # 用户收到的作业
+ def user_receive_homeworks
+ @receive_homeworks = "我收到的作业"
+ @order,@b_sort,@type = params[:order] || "created_at",params[:sort] || "desc", 2
+ @r_sort = @b_sort == "desc" ? "asc" : "desc"
+ @type = @type.to_i
+ stu_courses = @user.courses.visible.not_deleted.select{|course| @user.has_student_role(course)}
+ stu_course_ids = stu_courses.empty? ? "(-1)" : "(" + stu_courses.map{|course| course.id}.join(',') + ")"
+ @homeworks = HomeworkCommon.where("course_id in #{stu_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
+ if params[:property]
+ all_homework_ids = @homeworks.empty? ? "(-1)" : "(" + @homeworks.map{|h| h.id}.join(",") + ")"
+ if params[:property] == "1"
+ @homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 1")
+ elsif params[:property] == "2"
+ @homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 2")
+ elsif params[:property] == "3"
+ @homeworks = HomeworkCommon.find_by_sql("select * from homework_commons where id in #{all_homework_ids} and homework_type = 3")
+ end
+ end
+ @limit = 10
+ @is_remote = true
+ @hw_count = @homeworks.count
+ @hw_pages = Paginator.new @hw_count, @limit, params['page'] || 1
+ @offset ||= @hw_pages.offset
+ @homeworks = paginateHelper @homeworks,@limit
+ @search = ""
+ @property = params[:property]
+ respond_to do |format|
+ format.js
+ format.html {render :layout => 'static_base'}
+ end
+ end
+
#我管理/收到的作业
def manage_or_receive_homeworks
@order,@b_sort,@type = params[:order] || "created_at",params[:sort] || "desc",params[:type] || 1
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 415913e93..df785c2ae 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1348,6 +1348,14 @@ module ApplicationHelper
title << @course_community
elsif !@contest_community.blank?
title << @contest_community
+ elsif !@manage_issues.blank?
+ title << @manage_issues
+ elsif !@receive_issues.blank?
+ title << @receive_issues
+ elsif !@manage_homeworks.blank?
+ title << @manage_homeworks
+ elsif !@receive_homeworks.blank?
+ title << @receive_homeworks
else
title << @user.try(:realname)
end
@@ -2920,6 +2928,20 @@ module ApplicationHelper
@user_course_total = @my_joined_course_count + @my_course_count
end
+ # 用户发布的作业数
+ def user_manage_homework_count
+ tea_courses = @user.courses.visible.not_deleted.select{|course| @user.has_teacher_role(course)}
+ tea_course_ids = tea_courses.map{|course| course.id}
+ @manage_homeworks = HomeworkCommon.where(:course_id => tea_course_ids).count
+ end
+
+ # 用户收到的作业数
+ def user_receive_homework_count
+ stu_courses = @user.courses.visible.not_deleted.select{|course| @user.has_student_role(course)}
+ stu_course_ids = stu_courses.empty? ? "(-1)" : "(" + stu_courses.map{|course| course.id}.join(',') + ")"
+ @homeworks = HomeworkCommon.where("course_id in #{stu_course_ids} and publish_time <= '#{Date.today}'").count
+ end
+
# 用户发布的issue数
def issues_author_is_self_count
@issues = Issue.where( :author_id => @user.id )
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index bda7831fe..b2fd4161c 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -130,7 +130,7 @@ module IssuesHelper
end
def options_for_version_isuue_list(project)
- versions = Version.where(:project_id => project, :status => "open").map{|version| [version.name, version.id]}.unshift(["里程碑", 0])
+ versions = Version.where(:project_id => project, :status => "open").order("created_on desc").map{|version| [version.name, version.id]}.unshift(["里程碑", 0])
end
def render_issue_subject_with_tree(issue)
diff --git a/app/models/memo.rb b/app/models/memo.rb
index a580f02a8..3c36875d1 100644
--- a/app/models/memo.rb
+++ b/app/models/memo.rb
@@ -203,7 +203,7 @@ class Memo < ActiveRecord::Base
end
def destroyable_by? user
- (user && self.author == user) || user.admin?
+ (user && self.author == user) || user.admin? || self.forum.creator == user
#self.author == user || user.admin?
end
diff --git a/app/views/layouts/_show_messages_list.html.erb b/app/views/layouts/_show_messages_list.html.erb
index e0ec673c1..00bf175a0 100644
--- a/app/views/layouts/_show_messages_list.html.erb
+++ b/app/views/layouts/_show_messages_list.html.erb
@@ -150,6 +150,10 @@
<%=ma.forge_message.author.show_name %> 发布了新闻:<%= ma.forge_message.title.html_safe%>
<% elsif ma.forge_message_type == "Comment" %>
<%=ma.forge_message.author.show_name %> 评论了新闻:<%= ma.forge_message.commented.title%>
+ <% elsif ma.forge_message_type == "PullRequest" && PullRequest.where(:pull_request_id => ma.forge_message_id).count != 0%>
+ <% send_message_user = PullRequest.where(:pull_request_id => ma.forge_message_id) %>
+ <% author = User.find(ma.operate_user_id.nil? ? 2 : ma.operate_user_id) %>
+ <%= User.find(author.id).show_name %> <%= pull_request_message_status(ma) %> <%= send_message_user[0].title %>
<% end %>
<% elsif ma.class == MemoMessage %>
<% if ma.memo_type == "Memo" && !ma.memo.nil? && !ma.memo.author.nil? %>
@@ -179,8 +183,8 @@
<% end %>
<% end %>
- 展开更多
-<%= link_to '查看全部', user_message_path(User.current),:id =>'show_all_messages', :class => "shadowbox_news_all", :style => "display:none", :target =>"_Blank" %>
+
+<%= link_to '查看全部', user_message_path(User.current),:id =>'show_all_messages', :class => "shadowbox_news_all", :target =>"_Blank" %>
+
diff --git a/app/views/users/_my_receive_issue_list.html.erb b/app/views/users/_my_receive_issue_list.html.erb
new file mode 100644
index 000000000..820c4fbad
--- /dev/null
+++ b/app/views/users/_my_receive_issue_list.html.erb
@@ -0,0 +1,84 @@
+<% unless activity.author.nil? %>
+
+
+ <% if activity.status_id.to_i == 5 %>
+
+ <% else %>
+
+ <% end %>
+
+
+
+
+
<%= format_time(activity.created_on) %> 发布
+
<%= format_time(activity.updated_on) %> 更新
+
+
+
+ -
+ <%= Project.find(activity.project_id).name %>
+
+ -
+ <% if activity.try(:author).try(:realname) == ' ' %>
+ <%= link_to activity.try(:author), user_path(activity.author_id)%>
+ <% else %>
+ <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id)%>
+ <% end %>
+
+ -
+ <% case activity.tracker_id %>
+ <% when 1 %>
+ 缺陷
+ <% when 2 %>
+ 功能
+ <% when 3 %>
+ 支持
+ <% when 4 %>
+ 任务
+ <% when 5 %>
+ 周报
+ <% end %>
+
+ -
+ <%= activity.priority.name %>
+
+
+ - <%= activity.fixed_version %>
+ - <%= activity.status.name %>
+ - <%= activity.done_ratio %>%
+ -
+ <% if activity.journals.count > 0 %>
+
+ <%= activity.journals.count %>
+ <% end %>
+
+
+
+<% end %>
+
+
+
diff --git a/app/views/users/_receive_homework_list.html.erb b/app/views/users/_receive_homework_list.html.erb
index c5b073ee2..70de76eb9 100644
--- a/app/views/users/_receive_homework_list.html.erb
+++ b/app/views/users/_receive_homework_list.html.erb
@@ -5,29 +5,22 @@
<% else %>
<% homeworks.each do |homework| %>
-
+
- <%= link_to homework.name, student_work_index_path(:homework => homework.id), :class => 'sy_cblack', :target => '_blank' %>
+ <%= link_to homework.course.name + " / " +homework.name, student_work_index_path(:homework => homework.id), :class => 'sy_cblack', :target => '_blank' %>
- 来源:
-
- <%= link_to homework.course.name, course_path(homework.course), :target => '_blank', :class => 'hw_cgrey' %>
-
- 类别:<%=homework.homework_type_ch %>
+ <%= cur_homework_end_time homework %>
<% my_work = homework.student_works.where("user_id = ? && work_status != 0",User.current).first %>
状态:<%= my_work ? '已提交' : '未提交' %>
- 作品:<%=homework.student_works.has_committed.count %>
成绩:
<% if my_work && !my_work.work_score.nil? %>
<%= format("%.1f",my_work.work_score.to_f) %>
<% else %>
--
<% end %>
- 发布时间:<%= format_date homework.publish_time %>
- <%=cur_homework_end_time homework %>
<%= student_for_homework_common homework %>
diff --git a/app/views/users/_user_manage_issue_list.html.erb b/app/views/users/_user_manage_issue_list.html.erb
new file mode 100644
index 000000000..78fbef88a
--- /dev/null
+++ b/app/views/users/_user_manage_issue_list.html.erb
@@ -0,0 +1,24 @@
+<% issue_list(issues) do |issue| -%>
+
+ <%= render :partial => 'users/my_manage_issue_list', :locals => {:activity => issue, :user_activity_id => issue.id} %>
+<% end %>
+
+
+
+
+ <%= link_to "导出EXCEL", user_manage_issues_user_path(:format => 'xls'), :class => "hw_btn_blue ml10 mt10 mb10", :id => "sendexcel",
+ :onclick => "remote_function_export('#{User.current}')"%>
+
+
+
+
+
diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb
index 9c0e61af6..a7cd81917 100644
--- a/app/views/users/_user_message_course.html.erb
+++ b/app/views/users/_user_message_course.html.erb
@@ -704,34 +704,34 @@
<% end %>
<% if ma.course_message_type == "CourseRequestDealResult" %>
-
+
-
-
<%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %>
+ <%= link_to image_tag(url_to_avatar(User.find(ma.user_id)), :width => "30", :height => "30"), user_path(User.find(ma.user_id)), :target => '_blank' %>
+
-
- 系统提示
+
+ <%=link_to User.find(ma.user_id).show_name, user_path(User.find(ma.user_id)),
+ :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
+
- 班级申请进度反馈:
+ 申请以“<%= ma.content.include?('9') ? '教师' : '教辅' %>”身份加入:
+
-
- <%= link_to ma.status == 1 ?
- '您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content.include?('9') ? '教师' : '教辅')+'申请已通过'
- :
- '您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content.include?('9') ? '教师' : '教辅')+'的申请被拒绝', course_path(Course.find(ma.course_id)),
+ <%= link_to Course.find(ma.course_id).name, course_path(Course.find(ma.course_id)),
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
-
-
- <%= User.current.lastname + User.current.firstname %>老师您好!您已成功加入班级<%= Course.find(ma.course_id).name%>。
-
-
申请班级:<%= Course.find(ma.course_id).name%>
-
班级描述:
-
<%= Course.find(ma.course_id).description.nil? ? "" : Course.find(ma.course_id).description.html_safe %>
-
申请职位:<%= ma.content == '9' ? "教师" : "教辅"%>
-
+
-
+ <% if ma.status == 1 %>
+ <%= User.find(ma.course_message_id).show_name%>已通过
+ <% else %>
+ <%= User.find(ma.course_message_id).show_name%>已拒绝
+ <% end %>
+
- <%= time_tag(ma.created_at).html_safe %>
<% end %>
diff --git a/app/views/users/_user_receive_issues_list.html.erb b/app/views/users/_user_receive_issues_list.html.erb
new file mode 100644
index 000000000..b6181668c
--- /dev/null
+++ b/app/views/users/_user_receive_issues_list.html.erb
@@ -0,0 +1,24 @@
+<% issue_list(issues) do |issue| -%>
+
+ <%= render :partial => 'users/my_receive_issue_list', :locals => {:activity => issue, :user_activity_id => issue.id} %>
+<% end %>
+
+
+
+
+ <%= link_to "导出EXCEL", user_manage_issues_user_path(:format => 'xls'), :class => "hw_btn_blue ml10 mt10 mb10", :id => "sendexcel",
+ :onclick => "remote_function_export('#{User.current}')"%>
+
+
+
+
+
diff --git a/app/views/users/user_issues.html.erb b/app/views/users/user_issues.html.erb
index c23ff7378..c506ca856 100644
--- a/app/views/users/user_issues.html.erb
+++ b/app/views/users/user_issues.html.erb
@@ -173,13 +173,13 @@
}
$(function(){
<% if @type %>
- <% if @type == "assigned" %>
- HoverLi(2);
- switch_assign_to(<%= User.current.id %>);
- <% else %>
- HoverLi(3);
- createByMe(<%= User.current.id %>);
- <% end %>
+ <% if @type == "assigned" %>
+ HoverLi(2);
+ switch_assign_to(<%= User.current.id %>);
+ <% else %>
+ HoverLi(3);
+ createByMe(<%= User.current.id %>);
+ <% end %>
<% end %>
});
@@ -224,9 +224,9 @@
-
- 我的发布
- <%= @issues_author_count %>
-
+ 我的发布
+ <%= @issues_author_count %>
+
diff --git a/app/views/users/user_manage_homeworks.html.erb b/app/views/users/user_manage_homeworks.html.erb
new file mode 100644
index 000000000..83bd70ab6
--- /dev/null
+++ b/app/views/users/user_manage_homeworks.html.erb
@@ -0,0 +1,42 @@
+
+
+
+
+
+ <%= render :partial=>'my_homeworks_search', :locals => {:type => @type,:property => nil, :order => @order, :search => ''} %>
+
+
+
+ <%= render :partial => "manage_homework_list", :locals => {:homeworks => @homeworks, :is_manage => 1} %>
+
+
+
+
+
+ <%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/users/user_manage_homeworks.js.erb b/app/views/users/user_manage_homeworks.js.erb
new file mode 100644
index 000000000..1ddc4687d
--- /dev/null
+++ b/app/views/users/user_manage_homeworks.js.erb
@@ -0,0 +1,7 @@
+$("#my_homework_list").html('<%= escape_javascript(render :partial => "manage_homework_list", :locals => {:homeworks => @homeworks, :is_manage => 1})%>');
+$("#homework_list_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');
+$("#my_homework_sort").html('<%= escape_javascript( render :partial => 'users/my_homework_sort', :locals => {:type => @type,:property => @property,:order => @order,:search => @search})%>');
+$("#homework_type_all").attr('href','<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 0) %>');
+$("#homework_type_nor").attr('href','<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 1) %>');
+$("#homework_type_pro").attr('href','<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 2) %>');
+$("#homework_type_gro").attr('href','<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 3) %>');
\ No newline at end of file
diff --git a/app/views/users/user_manage_issues.html.erb b/app/views/users/user_manage_issues.html.erb
new file mode 100644
index 000000000..6a69800e1
--- /dev/null
+++ b/app/views/users/user_manage_issues.html.erb
@@ -0,0 +1,312 @@
+<%= content_for(:header_tags) do %>
+ <%= import_ke(enable_at: true,init_activity: true) %>
+<% end %>
+
+
+
+
+
+
+
我发布的Issue
+
+
+ <%= form_tag( user_manage_issues_user_path(@user), :remote => 'xls', :method => "post", :id => "issue_query_form", :class => 'query_form') do %>
+
+
+
+
+ -
+ 搜索结果
+ <%= render :partial => "users/my_issue_filter_all" %>
+
+
+
+
+
+ <%= select( :project, :project_id, options_for_issue_project_list(@issues_filter),
+ { :include_blank => false,:selected => @project_id ? @project_id : 0 },
+ { :onchange => "remote_function();add_style();", :id => "project_id", :name => "project_id", :class => "fl", :style=>"width: 80px; margin-right:20px;"}
+ )%>
+
+
+ <%= select( :issue, :user_id, [[@user.show_name, @user.id]].unshift(["指派给",0]),
+ { :include_blank => false, :selected => @assigned_to ? @assigned_to : 0},
+ {:onchange=>"remote_function();add_style();",:id => "assigned_to_id",:name => "assigned_to_id", :class => "fl", :style => "visibility:hidden; width:0px;margin:0px;padding:0px;"} )
+ %>
+
+
+
+
+
+
+
+
+ <% end %>
+ <% if @issues.empty? %>
+
<%= l(:label_no_data) %>
+ <% else %>
+
+ <%= render :partial => 'users/user_manage_issue_list', :locals => {:issues => @issues, :issue_pages => @issue_pages, :issue_count => @issue_count, :subject => @subject } %>
+
+ <% end %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/views/users/user_manage_issues.js.erb b/app/views/users/user_manage_issues.js.erb
new file mode 100644
index 000000000..7a24c05f4
--- /dev/null
+++ b/app/views/users/user_manage_issues.js.erb
@@ -0,0 +1,3 @@
+$("#issue_filter_all").html("<%= escape_javascript(render :partial => 'users/my_issue_filter_all') %>");
+$("#issue_list").html("<%= escape_javascript(render :partial => 'users/user_manage_issue_list',:locals => {:issues => @issues, :issue_pages=> @issue_pages, :issue_count => @issue_count })%>");
+$("#issue_list_pagination").html('<%= pagination_links_full @issue_pages, @issue_count, :issues => @issues, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');
\ No newline at end of file
diff --git a/app/views/users/user_newfeedback.html.erb b/app/views/users/user_newfeedback.html.erb
index ddf686b6a..81e2fe399 100644
--- a/app/views/users/user_newfeedback.html.erb
+++ b/app/views/users/user_newfeedback.html.erb
@@ -14,16 +14,18 @@
-
<%= link_to image_tag(url_to_avatar(User.current),:class=>"fl mr10", :width => "50", :height => "50"), :alt => "用户头像" %>
-
- <%= form_for('new_form',:url => leave_user_message_path(@user.id), :html =>{:id => "user_feedback_new"}, :method => "post") do |f|%>
- <%=render :partial => "jour_form", :locals => {:f => f} %>
-
-
留言
-
私信
- <% end %>
-
-
+ <% unless is_current_user %>
+
<%= link_to image_tag(url_to_avatar(User.current),:class=>"fl mr10", :width => "50", :height => "50"), :alt => "用户头像" %>
+
+ <%= form_for('new_form',:url => leave_user_message_path(@user.id), :html =>{:id => "user_feedback_new"}, :method => "post") do |f|%>
+ <%= render :partial => "jour_form", :locals => {:f => f} %>
+
+
留言
+
私信
+ <% end %>
+
+
+ <% end %>
<%=render :partial => "users/user_jours_list", :locals => {:jours =>@jour, :page => 0, :type => @type, :count => @jour_count} %>
diff --git a/app/views/users/user_receive_homeworks.html.erb b/app/views/users/user_receive_homeworks.html.erb
new file mode 100644
index 000000000..58a79ba5c
--- /dev/null
+++ b/app/views/users/user_receive_homeworks.html.erb
@@ -0,0 +1,42 @@
+
+
+
+
+
+ <%= render :partial=>'my_homeworks_search', :locals => {:type => @type,:property => nil, :order => @order, :search => ''} %>
+
+
+
+ <%= render :partial => "receive_homework_list", :locals => {:homeworks => @homeworks} %>
+
+
+
+
+
+ <%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/users/user_receive_homeworks.js.erb b/app/views/users/user_receive_homeworks.js.erb
new file mode 100644
index 000000000..3ffbfaaa3
--- /dev/null
+++ b/app/views/users/user_receive_homeworks.js.erb
@@ -0,0 +1,7 @@
+$("#my_homework_list").html('<%= escape_javascript(render :partial => "receive_homework_list", :locals => {:homeworks => @homeworks})%>');
+$("#homework_list_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');
+$("#my_homework_sort").html('<%= escape_javascript( render :partial => 'users/my_homework_sort', :locals => {:type => @type,:property => @property,:order => @order,:search => @search})%>');
+$("#homework_type_all").attr('href','<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 0) %>');
+$("#homework_type_nor").attr('href','<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 1) %>');
+$("#homework_type_pro").attr('href','<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 2) %>');
+$("#homework_type_gro").attr('href','<%= manage_or_receive_homeworks_user_path(@user, :type => @type, :property => 3) %>');
\ No newline at end of file
diff --git a/app/views/users/user_receive_issues.html.erb b/app/views/users/user_receive_issues.html.erb
new file mode 100644
index 000000000..883b77688
--- /dev/null
+++ b/app/views/users/user_receive_issues.html.erb
@@ -0,0 +1,313 @@
+<%= content_for(:header_tags) do %>
+ <%= import_ke(enable_at: true,init_activity: true) %>
+<% end %>
+
+
+
+
+
+
+
我收到的Issue
+
+
+ <%= form_tag( user_receive_issues_user_path(@user), :remote => 'xls', :method => "post", :id => "issue_query_form", :class => 'query_form') do %>
+
+
+
+
+ -
+ 搜索结果
+ <%= render :partial => "users/my_issue_filter_all" %>
+
+
+
+
+
+ <%= select( :project, :project_id, options_for_issue_project_list(@issues_filter),
+ { :include_blank => false,:selected => @project_id ? @project_id : 0 },
+ { :onchange => "remote_function();add_style();", :id => "project_id", :name => "project_id", :class => "fl", :style=>"width: 80px; margin-right:20px;"}
+ )%>
+
+ <%= select( :issue, :user_id, [[@user.show_name, @user.id]].unshift(["发布人",0]),
+ {:include_blank => false,:selected => @author_id ? @author_id : 0},
+ {:onchange => "remote_function();add_style();",:id => "author_id", :name => "author_id", :class => "fl", :style => "visibility:hidden;width: 0px;margin:0px;padding:0px;"}
+ )
+ %>
+
+
+
+
+
+
+
+
+
+ <% end %>
+ <% if @issues.empty? %>
+
<%= l(:label_no_data) %>
+ <% else %>
+
+ <%= render :partial => 'users/user_receive_issues_list', :locals => {:issues => @issues, :issue_pages => @issue_pages, :issue_count => @issue_count, :subject => @subject } %>
+
+ <% end %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/views/users/user_receive_issues.js.erb b/app/views/users/user_receive_issues.js.erb
new file mode 100644
index 000000000..41f8ac63c
--- /dev/null
+++ b/app/views/users/user_receive_issues.js.erb
@@ -0,0 +1,3 @@
+$("#issue_filter_all").html("<%= escape_javascript(render :partial => 'users/my_issue_filter_all') %>");
+$("#issue_list").html("<%= escape_javascript(render :partial => 'users/user_receive_issues_list',:locals => {:issues => @issues, :issue_pages=> @issue_pages, :issue_count => @issue_count })%>");
+$("#issue_list_pagination").html('<%= pagination_links_full @issue_pages, @issue_count, :issues => @issues, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>');
\ No newline at end of file
diff --git a/config/locales/commons/zh.yml b/config/locales/commons/zh.yml
index a670b6497..c153ba334 100644
--- a/config/locales/commons/zh.yml
+++ b/config/locales/commons/zh.yml
@@ -291,7 +291,7 @@ zh:
label_tags_project_name: "项目名称:"
label_projects_new_name: "项目名称"
- label_tags_project_description: "项目描述"
+ label_tags_project_description: "项目简介"
label_organization_name: "组织名称"
label_organization_description: "组织描述"
diff --git a/config/routes.rb b/config/routes.rb
index 952ee65f9..f2ef4f43e 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -737,6 +737,10 @@ RedmineApp::Application.routes.draw do
get 'edit_brief_introduction'
get "user_resource"
match "user_issues", :to => 'users#user_issues', :via => [:get, :post], :as => "user_issues"
+ match "user_manage_issues", :to => 'users#user_manage_issues', :via => [:get, :post], :as => "user_manage_issues"
+ match "user_receive_issues", :to => 'users#user_receive_issues', :via => [:get, :post], :as => "user_receive_issues"
+ match "user_manage_homeworks", :to => 'users#user_manage_homeworks', :via => [:get, :post], :as => "user_manage_homeworks"
+ match "user_receive_homeworks", :to =>'users#user_receive_homeworks', :via => [:get, :post], :as => "user_receive_homeworks"
get "import_resources"
get "import_resources_search"
post "import_into_container"
diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css
index 9c9f0deeb..1b1c45e1b 100644
--- a/public/stylesheets/css/common.css
+++ b/public/stylesheets/css/common.css
@@ -248,6 +248,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.w56 {width:56px;}
.w60{ width:60px;}
.w61{ width:61px;}
+.w65{ width:65px;}
.w70{ width:70px;}
.w80{ width:80px;}
.w90{ width:90px;}
@@ -878,3 +879,6 @@ input.btn-blue{background: #3b94d6; color: #fff; cursor:pointer;}
input:hover.btn-blue{background: #2788d0; color: #fff;}
input.btn-grey{background: #d9d9d9; color: #656565; cursor:default;}
input.btn-grey:hover{background: #717171; color: #fff; cursor:default;}
+.icons-user-homework{background:url(/images/user/home-user-left.png) 0px -150px no-repeat; }
+.homework-user-leftnav-li{ height: 25px; line-height: 40px; padding-left: 25px; color: #666;background:url(/images/user/home-user-left.png) 0px -149px no-repeat; font-size: 14px; position: relative; }
+.homework-user-leftnav-li:hover{ height: 25px; line-height: 40px; padding-left: 25px; background:#f4f4f4; background:url(/images/user/home-user-left.png) 0px -186px no-repeat; font-size: 14px; position: relative; }