From 8d64114c5827f526a08e0d9a9729aa9d17f1a65a Mon Sep 17 00:00:00 2001
From: huang
Date: Tue, 22 Sep 2015 17:31:33 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E7=95=99=E8=A8=80=E5=BC=95=E7=94=A8?=
=?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/journals_controller.rb | 9 ++++-----
app/views/issues/show.html.erb | 8 ++------
2 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/app/controllers/journals_controller.rb b/app/controllers/journals_controller.rb
index 6cebfef7a..769e62209 100644
--- a/app/controllers/journals_controller.rb
+++ b/app/controllers/journals_controller.rb
@@ -36,8 +36,7 @@ class JournalsController < ApplicationController
sort_update(@query.sortable_columns)
if @query.valid?
- @journals = @query.journals(:order => "#{Journal.table_name}.created_on DESC",
- :limit => 25)
+ @journals = @query.journals(:order => "#{Journal.table_name}.created_on DESC", :limit => 25)
end
@title = (@project ? @project.name : Setting.app_title) + ": " + (@query.new_record? ? l(:label_changes_details) : @query.name)
render :layout => false, :content_type => 'application/atom+xml'
@@ -72,9 +71,9 @@ class JournalsController < ApplicationController
end
# Replaces pre blocks with [...]
text = text.to_s.strip.gsub(%r{((.|\s)*?)
}m, '[...]')
- @content = "> #{ll(Setting.default_language, :text_user_wrote, user)}\n> "
- @content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
- # @content = "" << @content
+ @content = "#{ll(Setting.default_language, :text_user_wrote, user)}\n"
+ @content << text.gsub(/(\r?\n|\r\n?)/, "\n ") + "\n"
+ @content = "" << @content << "
"
@id = user.id
rescue ActiveRecord::RecordNotFound
render_404
diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb
index 01cbea1c1..d57be8a91 100644
--- a/app/views/issues/show.html.erb
+++ b/app/views/issues/show.html.erb
@@ -20,12 +20,8 @@
- 由<%= @issue.author %>
- <%# if @issue.created_on != @issue.updated_on %>
- 添加于 <%= format_time(@issue.created_on).html_safe %>
- <%# else %>
- <%#= format_time(@issue.updated_on).html_safe %>
- <%# end %>
+ 由<%= @issue.author %>
+ 添加于 <%= format_time(@issue.created_on).html_safe %>
'action_menu' %>
From 5b671c5109ef0b5dd26f17a6f2b3295084e57695 Mon Sep 17 00:00:00 2001
From: huang
Date: Wed, 23 Sep 2015 14:27:47 +0800
Subject: [PATCH 2/2] =?UTF-8?q?issue=20=E5=BC=95=E7=94=A8=E6=A8=A1?=
=?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9=20issue=E7=9B=B8=E5=85=B3=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/issues/_attributes.html.erb | 48 ++++-----
app/views/issues/_attributes_show.html.erb | 52 ++++++++++
app/views/issues/_edit.html.erb | 4 +-
app/views/issues/_form.html.erb | 22 ++---
app/views/issues/_form_custom_fields.html.erb | 22 ++---
app/views/issues/show.html.erb | 99 +++++--------------
app/views/journals/new.js.erb | 3 +-
public/javascripts/project.js | 3 +
8 files changed, 122 insertions(+), 131 deletions(-)
create mode 100644 app/views/issues/_attributes_show.html.erb
diff --git a/app/views/issues/_attributes.html.erb b/app/views/issues/_attributes.html.erb
index 68bd9f82c..54cb85212 100644
--- a/app/views/issues/_attributes.html.erb
+++ b/app/views/issues/_attributes.html.erb
@@ -6,12 +6,11 @@
<% if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %>
- <%= f.select :status_id,
- (@allowed_statuses.collect { |p| [p.name, p.id] }),
- {:no_label => true},
- # ajax 刷新
- #:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')",
- :class => "w150" %>
+ <%= f.select :status_id, (@allowed_statuses.collect { |p| [p.name, p.id] }),
+ {:no_label => true},
+ # ajax 刷新
+ #:onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')",
+ :class => "w150" %>
<% else %>
<%= h(@issue.status.name) %>
<% end %>
@@ -20,10 +19,9 @@
<% if @issue.safe_attribute? 'priority_id' %>
- <%= f.select :priority_id,
- (@priorities.collect { |p| [p.name, p.id] }),
- {:required => true, :no_label => true}, :disabled => !@issue.leaf?,
- :class => "w150" %>
+ <%= f.select :priority_id, (@priorities.collect { |p| [p.name, p.id] }),
+ {:required => true, :no_label => true}, :disabled => !@issue.leaf?,
+ :class => "w150" %>
<% end %>
@@ -32,8 +30,8 @@
<% if @issue.safe_attribute? 'assigned_to_id' %>
<%= f.select :assigned_to_id, principals_options_for_select(@issue.assignable_users, @issue.assigned_to),
- {:required => @issue.required_attribute?('assigned_to_id'), :no_label => true},
- :class => "w150" %>
+ {:required => @issue.required_attribute?('assigned_to_id'), :no_label => true},
+ :class => "w150" %>
<% end %>
@@ -41,8 +39,8 @@
<% if @issue.safe_attribute?('fixed_version_id') && @issue.assignable_versions.any? %>
<%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version),
- {:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
- :class => "w150" %>
+ {:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
+ :class => "w150" %>
<%#= link_to(image_tag('add.png', :style => 'vertical-align: middle;'),
new_project_version_path(@issue.project),
:remote => true,
@@ -60,11 +58,7 @@
<% if @issue.safe_attribute? 'start_date' %>
- <%= f.text_field :start_date,
- :size => 22,
- :disabled => !@issue.leaf?,
- :no_label => true,
- :required => @issue.required_attribute?('start_date') %>
+ <%= f.text_field :start_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true, :required => @issue.required_attribute?('start_date') %>
<%= calendar_for('issue_start_date', 'start_date') if @issue.leaf? %>
<% end %>
@@ -72,10 +66,7 @@
<% if @issue.safe_attribute? 'due_date' %>
- <%= f.text_field :due_date, :size => 22,
- :disabled => !@issue.leaf?,
- :no_label => true,
- :required => @issue.required_attribute?('due_date') %>
+ <%= f.text_field :due_date, :size => 22, :disabled => !@issue.leaf?, :no_label => true, :required => @issue.required_attribute?('due_date') %>
<%= calendar_for('issue_due_date', 'start_date') if @issue.leaf? %>
<% end %>
@@ -83,10 +74,7 @@
<% if @issue.safe_attribute? 'estimated_hours' %>
- <%= f.text_field :estimated_hours, :size => 22,
- :disabled => !@issue.leaf?,
- :no_label => true,
- :required => @issue.required_attribute?('estimated_hours') %>
+ <%= f.text_field :estimated_hours, :size => 22, :disabled => !@issue.leaf?, :no_label => true, :required => @issue.required_attribute?('estimated_hours') %>
<%= l(:field_hours) %>
<% end %>
@@ -94,9 +82,9 @@
<% if @issue.safe_attribute?('done_ratio') && @issue.leaf? && Issue.use_field_for_done_ratio? %>
<%= f.select :done_ratio, ((0..10).to_a.collect { |r| ["#{r*10} %", r*10] }),
- {:required => @issue.required_attribute?('done_ratio'), :no_label => true},
- :onchange => "PrecentChange(this.value)",
- :class => "w150" %>
+ {:required => @issue.required_attribute?('done_ratio'), :no_label => true},
+ :onchange => "PrecentChange(this.value)",
+ :class => "w150" %>
<% end %>
diff --git a/app/views/issues/_attributes_show.html.erb b/app/views/issues/_attributes_show.html.erb
new file mode 100644
index 000000000..7b9e2bedf
--- /dev/null
+++ b/app/views/issues/_attributes_show.html.erb
@@ -0,0 +1,52 @@
+
+
+ <%= issue_fields_rows do |rows| %>
+
+
+ 优先级 :
<%= @issue.priority.name %>
+
+
+ <% unless @issue.disabled_core_fields.include?('done_ratio') %>
+ % 完成 :
<%= @issue.done_ratio %>%
+
+ <% end %>
+
+
+
+
+ <% unless @issue.disabled_core_fields.include?('due_date') %>
+ 计划完成 :
<%= format_date(@issue.due_date)? format_date(@issue.due_date) : "--" %>
+
+ <% end %>
+
+ <% unless @issue.disabled_core_fields.include?('fixed_version_id') %>
+ 目标版本 :
<%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "--") %>
+
+ <% end %>
+
+
+ <% end %>
+ <%#= render_custom_fields_rows(@issue) %>
+ <%#= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
+
+
\ No newline at end of file
diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb
index 3a3782e47..c6b805d0a 100644
--- a/app/views/issues/_edit.html.erb
+++ b/app/views/issues/_edit.html.erb
@@ -14,7 +14,9 @@
<%= render :partial => 'history', :locals => {:issue => @issue, :journals => @journals} %>
<% end %>
-
+
+
+