diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 89accca9e..54a2c59ad 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -90,11 +90,21 @@ class UsersController < ApplicationController # order 排序条件 # subject 主题:搜索用(注意:搜索和列表调用同一方法,通过参数或者remote区分) def user_issues - subject = params[:subject] + @subject = params[:subject] author_id = params[:author_id] - @issues = Issue.where("author_id =? or assigned_to_id =? and subject like ?", (author_id ? author_id : @user.id) , @user, "%#{subject}%") + #@issues = Issue.where("author_id =? or assigned_to_id =? and subject like ?", (author_id ? author_id : @user.id) , @user.id, "%#{@subject}%") + @issues_filter = Issue.where("author_id =? or assigned_to_id =?", (author_id ? author_id : @user.id) , @user).order('updated_on desc') + @issue_open_count = Issue.where(" (author_id =? or assigned_to_id =?) and status_id in (1,2,3,4,6)", (author_id ? author_id : @user.id) , @user).count + @issue_close_count = Issue.where("(author_id =? or assigned_to_id =?) and status_id = 5", (author_id ? author_id : @user.id) , @user.id).count + @issue_count = @issues_filter.count + @limit = 10 + @is_remote = true + @issue_pages = Paginator.new @issue_count, @limit, params['page'] || 1 + @offset ||= @issue_pages.offset + @issues = paginateHelper @issues_filter, @limit + respond_to do |format| - format.html{render :layout => 'new_base_user'} + format.html{render :layout => 'static_base'} format.api format.js end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 95cd844f3..4c178c543 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -29,6 +29,17 @@ module UsersHelper ["#{l(:status_locked)} (#{user_count_by_status[3].to_i})", '3']], selected.to_s) end + def issue_list(issues, &block) + ancestors = [] + issues.each do |issue| + while (ancestors.any? && !issue.is_descendant_of?(ancestors.last)) + ancestors.pop + end + yield issue, ancestors.size + ancestors << issue unless issue.leaf? + end + end + def get_resource_type type case type when 'Course' diff --git a/app/views/users/_all_issue_list.html.erb b/app/views/users/_all_issue_list.html.erb new file mode 100644 index 000000000..3c21dc3c8 --- /dev/null +++ b/app/views/users/_all_issue_list.html.erb @@ -0,0 +1,24 @@ +<% issue_list(issues) do |issue| -%> + + <%= render :partial => 'users/my_issue_list', :locals => {:activity => issue, :user_activity_id => issue.id} %> +<% end %> + +
+ + +
+ +
+
+ +
\ No newline at end of file diff --git a/app/views/users/_my_issue_list.html.erb b/app/views/users/_my_issue_list.html.erb new file mode 100644 index 000000000..a855a710f --- /dev/null +++ b/app/views/users/_my_issue_list.html.erb @@ -0,0 +1,82 @@ +<% unless activity.author.nil? %> +
+
+ <% if activity.status_id.to_i == 5 %> + + <% else %> + + <% end %> +
+
+ +
+ <%# if activity.try(:author).try(:realname) == ' ' %> + <%#= link_to activity.try(:author), user_path(activity.author_id), :class => "fl issues_list_name" %> + <%# else %> + <%#= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "fl issues_list_name" %> + <%# end %> + +

<%= format_time(activity.created_on) %> 发布

+

<%= format_time(activity.updated_on) %> 更新

+
+
+ +
+<% end %> + + + diff --git a/app/views/users/user_issues.html.erb b/app/views/users/user_issues.html.erb index 56b6510f1..c925f33d7 100644 --- a/app/views/users/user_issues.html.erb +++ b/app/views/users/user_issues.html.erb @@ -1 +1,276 @@ -11111 \ No newline at end of file +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: true,init_activity: true) %> +<% end %> + + + + +
+
+

我的缺陷

+
+
+ + +
+ <%= form_tag({:controller => 'users', :action => 'user_issues'}, :remote=>'xls', :id=>"issue_query_form", :class => 'query_form') do %> +
+ + 清除 + +
+ +
+ +
+ + + + + + + + + + +
+ <% end %> + <% if @issues.empty? %> +

<%= l(:label_no_data) %>

+ <% else %> +
+ <%#= render :partial => 'users/all_issue_list', :locals => {:issues => @issues, :issue_pages => @issue_pages,:issue_count => @issue_count, :subject => @subject } %> +
+ <% end %> + +
+
+ +
+ +
+ ddd + +
+
+ + ddd +
+
+ +
+ + + + diff --git a/app/views/users/user_issues.js.erb b/app/views/users/user_issues.js.erb new file mode 100644 index 000000000..97b9f760d --- /dev/null +++ b/app/views/users/user_issues.js.erb @@ -0,0 +1,3 @@ +/*$("#issue_filter_all").html("<%#= escape_javascript(render :partial => 'issues/issue_filter_all') %>");*/ +$("#issue_list").html("<%= escape_javascript(render :partial => 'users/all_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/public/stylesheets/css/common.css b/public/stylesheets/css/common.css index afe6192fb..973f7a7b9 100644 --- a/public/stylesheets/css/common.css +++ b/public/stylesheets/css/common.css @@ -676,3 +676,128 @@ a:hover.hw_btn_blue,a:active.hw_btn_blue{ background: #3b94d6; color:#fff;} /*禁用*/ .disabled {background-color:#f5f5f5;} + +/* 缺陷列表 */ +.issues_greycirbg_btn{ background-color:#dedede; padding:1px 5px;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; } +.issues_greycirbg_btn:hover{background-color:#cbcbcb;} +input:focus,select:focus{ border:none;outline:medium;border-right:none;} +.issues_con{ width:718px; padding:15px; border:1px solid #ddd; background-color:#fff; color:#444; } +.issues_statistics{ line-height:35px;} +.issues_statistics ul li{ float:left; } +.issues_statistics ul li a{ font-size:12px; margin:5px; color:#888; } +.issues_statistics ul li a.act{} + + +.issues_form_filter select{ width:84px; height:35px; font-size:14px; border:1px solid #c8c8c8; border-right:none; background-color:#fff; margin-bottom: 10px; color: #888;} +.issues_form_filter input{ height:33px;width:91px; border:1px solid #c8c8c8;background-color:#fff;} +.issues_form_filter select:focus,.issues_form_filter input:focus{border:1px solid #c8c8c8; border-right:none;} +.issues_form_filter select{appearance:none;-moz-appearance:none;-webkit-appearance:none; background: url("../images/project/arrow.png") no-repeat scroll right center transparent;} +input.issues_calendar_input{ padding-left:5px; color:#444; border-right:none;} +.issues_data_img{ display:block; width:25px; height:33px; border:1px solid #c8c8c8; border-left:none; background: url("../images/public_icon.png") -29px 9px no-repeat; } +/* 缺陷Tab */ +.issues_con_list{border:1px solid #c8c8c8; } +#issues_list_nav {border-bottom:1px solid #d0d0d0;} +#issues_list_nav li {float:left; padding:10px 15px; text-align:center; } +#issues_list_nav li a{font-size:12px; color:#444;} +.issues_nav_hover{border-bottom:3px solid #3498db; font-weight:bold; } +.issues_nav_nomall {border-bottom:none; } +.issues_nav_tag{ background-color:#eaeaea; padding:2px 8px;-webkit-border-radius:15px;-moz-border-radius:15px;-o-border-radius:15px;border-radius:15px; font-size:12px;} +.undis {display:none;} +.dis {display:block;} +.issues_form_filter{ position: absolute; top:0; right: 0;} +.issues_form_filter select{ width:70px; height:30px; border:none; font-size:14px; border:none;border-right:none; color: #888; font-size: 12px; line-height: 30px; padding-right:10px;} +.issues_form_filter select.issues_filter_select_min{width:50px; } +.issues_form_filter select:focus,.issues_form_filter input:focus{border:none; } +.issues_filter_data input{height:28px;width:91px; border:1px solid #c8c8c8;background-color:#fff;} +.issues_form_filter select{appearance:none;-moz-appearance:none;-webkit-appearance:none; background: url("../images/project/arrow.png") no-repeat scroll right center transparent;} +input.issues_calendar_input{ padding-left:5px; color:#444; border-right:none;} +.issues_data_img{ display:block; width:25px; height:28px; border:1px solid #c8c8c8; border-left:none; background: url("../images/public_icon.png") -29px 9px no-repeat; } + +.issues_list_box{ padding:15px; padding-right: 0px; border-bottom:1px dashed #c8c8c8;} +.issues_list_titlebox{ font-size:14px; font-weight:bold; margin-bottom:8px;} +a.issues_list_title{ color:#444; max-width:260px; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; white-space:nowrap; } +a:hover.issues_list_title{color:#3b94d6;} +.issues_list_titlebox span{ font-size: 12px;color: #888; font-weight: normal; } +.issues_ciricons_01{ width: 22px; height: 22px; display: inline-block; background: url("../images/project/icons_issue.png") 0 0 no-repeat;} +.issues_ciricons_02{ width: 22px; height: 22px; display: inline-block; background: url("../images/project/icons_issue.png") 0 -30px no-repeat;} +.issues_icons_mes{width: 17px; height: 17px; display: inline-block; background: url("../images/project/icons_issue.png") 0 -57px no-repeat; } +.issues_list_name{ font-size: 12px;} +.issues_list_name:hover{ color: #3b94d6;} +.issues_list_small{ font-size: 12px; color: #666;} +.issues_list_txt li{ height: 50px; line-height: 50px; float: left; font-size: 12px; width: 70px; text-align: center; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; white-space:nowrap;} +.issues_list_txt li.issues_list_min{ width: 50px;} + + +/* 搜索 与课程相同 */ +.hw_search_box{ position:relative; } +.hw_search_box input.hw_search-input{ width:293px; height:28px; border:none; border:1px solid #e7e7e7; background:#fff; padding-left:5px;} +.hw_search_box a.hw_btn_search{display:block; width:20px; height:20px; background:url(../images/hw/icons_hw.png) 0 -57px no-repeat; position:absolute; right:5px; top:5px; cursor:pointer;} +.hw_search_box a:hover.hw_btn_search{background:url(../images/hw/icons_hw.png) -40px -57px no-repeat;} +.hw_files_icon{display:block; width:17px; height:14px; background:url(../images/hw/icons_hw.png) 0 -135px no-repeat;} +/* 编辑删除 与课程相同 */ +.sy_icons_edit{ display: inline-block; padding:9px;background:url(../images/sy/sy_icons02.png) 0 1px no-repeat; } +.sy_icons_del{ padding:9px;background:url(../images/sy/sy_icons02.png) 0 -21px no-repeat;} +.sy_icons_edit:hover{ background:url(../images/sy/sy_icons02.png) -20px 1px no-repeat; } +.sy_icons_del:hover{ background:url(../images/sy/sy_icons02.png) -20px -21px no-repeat;} +/* 翻页 与课程相同*/ +.pages a{ + display:block; + border:1px solid #d1d1d1; + color:#888; + float:left; + width:30px; + text-align:center; + padding:3px 0; + line-height:1.9; + margin-right:5px; +} +.pages a:hover{ + background-color:#3b94d6; + border:1px solid #3b94d6; + color:#fff; +} +a.pages-big{ + width:50px; +} +.pages .active{ + background-color:#3b94d6; + border:1px solid #3b94d6; + color:#fff; +} +.pages{ + width:330px; + + margin:20px auto 10px; +} +.sy_corange{ color: #ee4a1f;} +.sy_new_orange{font-size: 12px;padding: 0 5px;border-radius: 3px;line-height: 14px;color: #ff4a1b;border: 1px solid #ff4a1b;} +.sy_cgrey{ color: #888;} +a.sy_cgrey{ color: #888;} +.sy_corange{ color: #ee4a1f;} +a.sy_corange{ color: #ee4a1f;} +a.sy_cblue{ color: #3b94d6;} +/* 新增粉色关注按钮*/ +a.sy_btn_pink{ + display: inline-block; + color: #fff; + background: #ff7d7d; + text-align: center; + font-size: 12px; + padding:0 15px; + height: 30px; + line-height: 30px; + -webkit-border-radius:3px; + -moz-border-radius:3px; + -o-border-radius:3px; + border-radius:3px; +} +a:hover.sy_btn_pink{ background: #e64c4c;} + +/* 我的缺陷列表*/ +.myissues_con{ width:968px; padding:15px; border:1px solid #ddd; background-color:#fff; color:#444; } +.myissues_head{ width: 100%; height: 40px; line-height: 40px; background: #f4f4f4; } +.myissues_head h2{ font-size: 14px;} +select.issues_filter_active { font-weight: bold; color: #333;} +.issues_form_filter select.issues_filter_select_min02{width:60px; } +.issues_form_filter select.issues_filter_select_max{width:90px; } +.issues_list_txt li.issues_list_max{ width:90px } \ No newline at end of file