From 2aa241bffa6d49e5922a52f8445e3c8d07e10783 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 16 Dec 2015 11:50:30 +0800 Subject: [PATCH] issue --- app/views/issues/_list.html.erb | 69 ++++---- app/views/issues/index.html.erb | 275 +++++++++++++++++--------------- public/stylesheets/project.css | 6 +- public/stylesheets/public.css | 1 + 4 files changed, 191 insertions(+), 160 deletions(-) diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index 6fc1898d0..327cc2c75 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -1,35 +1,44 @@ <% issue_list(issues) do |issue, level| -%> - <% if @query.grouped? && (group = @query.group_by_column.value(issue)) != previous_group %> - <% reset_cycle %> - <% previous_group = group %> - <% end %> - -
- <% column_content = ( query.inline_columns.map {|column| "#{column_content_new(column, issue)}"}) %> - <% unless issue.author.nil? || issue.author.name == "Anonymous" %> - -
- <%= link_to issue.author.name, user_path(issue.author), :class => "problem_name c_orange fl" %> - <%= l(:label_post_on_issue) %>(<%= "#{raw column_content[2]}" %>): -
- <%=link_to "#{column_content[4]}#{get_issue_priority(column_content[3])[1]}".html_safe, issue_path(issue.id), :class => "problem_tit_a break_word",:target => "_blank" %> -
-
-

- <% unless issue.assigned_to_id.nil? %> - <%= l(:field_assigned_to) %> - <%=link_to issue.assigned_to(@user), user_path(issue.assigned_to(@user)), :class => "problem_name c_orange f1" %> - <% end %> - <%= l(:label_updated_time_on, format_date(issue.updated_on)).html_safe %> -

-
- <%=link_to "#{issue.journals.all.count}".html_safe, issue_path(issue.id), :class => "pro_mes_w" %> + + <%= render :partial => 'users/project_issue', :locals => {:activity => issue, :user_activity_id => issue.id} %> + <% end %> \ No newline at end of file diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index 29c038226..df7f9dddc 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -1,10 +1,28 @@ +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: true,init_activity: true) %> +<% end %> + -
-

<%= l(:label_issue_tracking) %>

-
-
- <% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %> - <%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'true', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %> - <%= hidden_field_tag 'set_filter', '1' %> - - <%= link_to '新建问题', new_project_issue_path(@project) , :class => "green_u_btn fr ml10" %> -

<%= l(:label_issues_sum) %>:<%= @project.issues.visible.all.count %> - <%= l(:lable_issues_undo) %>:<%= @project.issues.where('status_id in (1,2,4,6)').visible.all.count %> -

+
+
+
<%= l(:label_issue_tracking) %>
+
+
+ <% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %> + <%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'true', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %> + <%= hidden_field_tag 'set_filter', '1' %> + + <%#= link_to '新建问题', new_project_issue_path(@project) , :class => "green_u_btn fr ml10" %> +

<%= l(:label_issues_sum) %>:<%= @project.issues.visible.all.count %> + <%= l(:lable_issues_undo) %>:<%= @project.issues.where('status_id in (1,2,4,6)').visible.all.count %> +

-
-
+
+
+ + <%= select( :issue, :user_id, principals_options_for_isuue_list(@project), + { :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0 + }, + {:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"w90 mr18"} + ) + %> + <%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]), + { :include_blank => false,:selected=>@priority_id ? @priority_id : 0 + }, + {:onchange=>"remote_function();",:id=>"priority_id",:name=>"priority_id",:class=>"w90 mr18"} + ) + %> + <%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]), + { :include_blank => false,:selected=>@status_id ? @status_id : 0 + }, + {:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"w90 mr18"} + ) + %> + <%= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["作者",0]), + { :include_blank => false,:selected=>@author_id ? @author_id : 0 + }, + {:onchange=>"remote_function();",:id=>"author_id",:name=>"author_id",:class=>"w90 mr18"} + ) + %> +
+
+
 
+
+ + <%= text_field_tag 'issue_create_date_start_show', '创建日期起始',:readonly=>true, :size=>15, :nhname=>'date_show',:style=>'float:left;'%> + <%= calendar_for('issue_create_date_start_show') %> +
+
 - 
+
+ + <%= text_field_tag 'issue_create_date_end_show', '创建日期结束',:readonly=>true, :size=>15, :nhname=>'date_show',:style=>'float:left;'%> + <%= calendar_for('issue_create_date_end_show') %> +
+
+
+ <% end %> - <%= select( :issue, :user_id, principals_options_for_isuue_list(@project), - { :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0 - }, - {:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"assigned_to_id",:class=>"w90"} - ) - %> - <%= select( :issue,:prior, [["低",1],["正常",2],["高",3],["紧急",4],["立刻",5]].unshift(["优先级",0]), - { :include_blank => false,:selected=>@priority_id ? @priority_id : 0 - }, - {:onchange=>"remote_function();",:id=>"priority_id",:name=>"priority_id",:class=>"w90"} - ) - %> - <%= select( :issue,:status, [["新增",1],["正在解决",2],["已解决",3],["反馈",4],["关闭",5],["拒绝",6]].unshift(["状态",0]), - { :include_blank => false,:selected=>@status_id ? @status_id : 0 - }, - {:onchange=>"remote_function();",:id=>"status_id",:name=>"status_id",:class=>"w90"} - ) - %> - <%= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["作者",0]), - { :include_blank => false,:selected=>@author_id ? @author_id : 0 - }, - {:onchange=>"remote_function();",:id=>"author_id",:name=>"author_id",:class=>"w90"} - ) - %> -
-
-
 
-
- - <%= text_field_tag 'issue_create_date_start_show', '创建日期起始',:readonly=>true, :size=>15, :nhname=>'date_show',:style=>'float:left;'%> - <%= calendar_for('issue_create_date_start_show') %> -
-
 - 
-
- - <%= text_field_tag 'issue_create_date_end_show', '创建日期结束',:readonly=>true, :size=>15, :nhname=>'date_show',:style=>'float:left;'%> - <%= calendar_for('issue_create_date_end_show') %> -
-
<% end %> +
-
- <% end %> -
-
- <% if !@query.new_record? && @query.editable_by?(User.current) %> - <%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %> - <%= delete_link query_path(@query) %> - <% end %> -
+
+ <% if !@query.new_record? && @query.editable_by?(User.current) %> + <%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %> + <%= delete_link query_path(@query) %> + <% end %> +
-<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %> -
-
+ <% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %> +
+
-<%= error_messages_for 'query' %> + <%= error_messages_for 'query' %> -<% if @query.valid? %> - <% if @issues.empty? %> -

- <%= l(:label_no_data) %> -

- <% else %> -
- <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count} %> + <% if @query.valid? %> + <% if @issues.empty? %> +

+ <%= l(:label_no_data) %> +

+ <% else %> +
+ <%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count} %> +
+ + + <% end %> + +
+ <% other_formats_links do |f| %> + <%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %> + <%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); return false;" %> + <%= f.link_to 'PDF', :url => params %> + <% end %>
+ + <% end %> + <%= call_hook(:view_issues_index_bottom, {:issues => @issues, :project => @project, :query => @query}) %> + <% content_for :sidebar do %> + <%= render :partial => 'issues/sidebar' %> <% end %> -
- <% other_formats_links do |f| %> - <%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %> - <%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); return false;" %> - <%= f.link_to 'PDF', :url => params %> - <% end %> -
+ <% content_for :header_tags do %> + <%= auto_discovery_link_tag(:atom, + {:query_id => @query, :format => 'atom', + :page => nil, :key => User.current.rss_key}, + :title => l(:label_issue_plural)) %> + <%= auto_discovery_link_tag(:atom, + {:controller => 'journals', :action => 'index', + :query_id => @query, :format => 'atom', + :page => nil, :key => User.current.rss_key}, + :title => l(:label_changes_details)) %> + <% end %> - -<% end %> -<%= call_hook(:view_issues_index_bottom, {:issues => @issues, :project => @project, :query => @query}) %> -<% content_for :sidebar do %> - <%= render :partial => 'issues/sidebar' %> -<% end %> - -<% content_for :header_tags do %> - <%= auto_discovery_link_tag(:atom, - {:query_id => @query, :format => 'atom', - :page => nil, :key => User.current.rss_key}, - :title => l(:label_issue_plural)) %> - <%= auto_discovery_link_tag(:atom, - {:controller => 'journals', :action => 'index', - :query_id => @query, :format => 'atom', - :page => nil, :key => User.current.rss_key}, - :title => l(:label_changes_details)) %> -<% end %> - -<%= context_menu issues_context_menu_path %> + <%= context_menu issues_context_menu_path %> +
\ No newline at end of file diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index aa3297128..c0afe45d5 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -161,9 +161,9 @@ a:hover.invi_search_btn{ background:#0da1b2; border:1px solid #0da1b2;} /*问题跟踪*/ .problem_top{ margin:10px 0 ;} -.problem_search_input{ border:1px solid #64bdd9; width:180px; height:24px; color:#9b9b9b; padding-left:5px; margin-bottom:5px;} -a.problem_search_btn{ background:#64bdd9; color:#fff; text-align: center; width:40px; height:22px;border:1px solid #64bdd9; padding-top:2px; cursor:pointer;} -a:hover.problem_search_btn{ background:#3da1c1; border:1px solid #3da1c1;} +.problem_search_input{ border:1px solid #dddddd; width:180px; height:24px; color:#9b9b9b; padding-left:5px; margin-bottom:5px;} +a.problem_search_btn{ background:#269ac9; color:#fff; text-align: center; width:40px; height:22px;border:1px solid #64bdd9; padding-top:2px; cursor:pointer;} +a:hover.problem_search_btn{ background:#269ac9; border:1px solid #3da1c1;} a.problem_new_btn{ margin-left:10px; border:1px solid #ff7143; color:#ff7143; width:60px; height:21px; font-size:12px; text-align:center; padding-top:3px;} a:hover.problem_new_btn{ background:#ff7143; color:#fff;} .problem_p{ color:#535252; margin-top:5px;} diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 003cf90df..13362dd19 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -87,6 +87,7 @@ h4{ font-size:14px; color:#3b3b3b;} .mr55{ margin-right:55px;} .mr10{ margin-right:10px;} .mr15 {margin-right:15px;} +.mr18 {margin-right:15px;} .mr20{ margin-right:20px;} .mr25 {margin-right:25px;} .mr30{ margin-right:30px;}