From 33abbaffe1a0461c4de21eca7f697dd8849448fe Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 10 Apr 2015 17:49:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9isuue=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=20=E9=99=84=E4=BB=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=BD=A2=E5=BC=8F=20=E5=9B=BD=E9=99=85=E5=8C=96=20=E9=83=A8?= =?UTF-8?q?=E5=88=86=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/helpers/issues_helper.rb | 12 +- app/views/attachments/_links.html.erb | 2 +- app/views/issues/_action_menu.html.erb | 23 +- app/views/issues/_attributes.html.erb | 118 +++--- app/views/issues/_edit.html.erb | 4 - app/views/issues/_form.html.erb | 92 +++-- app/views/issues/_history.html.erb | 61 ++-- app/views/issues/show.html.erb | 441 ++++++----------------- app/views/layouts/base_projects.html.erb | 2 +- config/locales/zh.yml | 1 + public/stylesheets/project.css | 2 +- 11 files changed, 296 insertions(+), 462 deletions(-) diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 966028c81..54cef5c7a 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -70,11 +70,11 @@ module IssuesHelper #获取跟踪类型 #REDO:时间紧需要优化,两个方法可以综合成一个 def get_issue_type(value) - if value == "缺陷" + if value == "缺陷" || value == 1 class_type = "red_btn_cir ml10" - elsif value == "功能" + elsif value == "功能" || value == 2 class_type = "blue_btn_cir ml10" - elsif value == "支持" + elsif value == "支持" || value == 3 class_type = "green_btn_cir ml10" else class_type = "orange_btn_cir ml10" @@ -82,11 +82,11 @@ module IssuesHelper end def get_issue_typevalue(value) - if value == "缺陷" + if value == "缺陷" || value == 1 assign = "缺陷" - elsif value == "功能" + elsif value == "功能" || value == 2 assign = "功能" - elsif value == "支持" + elsif value == "支持" || value == 3 assign = "支持" else assign = "任务" diff --git a/app/views/attachments/_links.html.erb b/app/views/attachments/_links.html.erb index 02c7ba4dc..c3ec2b9f0 100644 --- a/app/views/attachments/_links.html.erb +++ b/app/views/attachments/_links.html.erb @@ -60,7 +60,7 @@ <% if defined?(thumbnails) && thumbnails %> <% images = attachments.select(&:thumbnailable?) %> <% if images.any? %> -
+
<% images.each do |attachment| %>
<%= thumbnail_tag(attachment) %>
<% end %> diff --git a/app/views/issues/_action_menu.html.erb b/app/views/issues/_action_menu.html.erb index 61cea920c..231116f2f 100644 --- a/app/views/issues/_action_menu.html.erb +++ b/app/views/issues/_action_menu.html.erb @@ -1,18 +1,11 @@ -
- + -<% if (@issue.author == User.current) || (User.current.admin?) %> - - -<%= link_to l(:button_update), edit_issue_path(@issue), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'icon icon-edit', :accesskey => accesskey(:edit) if @issue.editable? %> +<%#= watcher_link(@issue, User.current) %> +<%#= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'icon icon-copy' if User.current.allowed_to?(:add_issues, @project) %> +<%= link_to l(:button_delete), issue_path(@issue.id), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'talk_edit fr' if User.current.allowed_to?(:delete_issues, @project) %> +<% if (@issue.author == User.current) || (User.current.admin?) %> + <%= link_to l(:button_edit), edit_issue_path(@issue), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? %> <% else %> - -<%= link_to l(:label_user_newfeedback), edit_issue_path(@issue), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'icon icon-edit', :accesskey => accesskey(:edit) if @issue.editable? %> - -<% end %> - -<%= watcher_link(@issue, User.current) %> -<%= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'icon icon-copy' if User.current.allowed_to?(:add_issues, @project) %> -<%= link_to l(:button_delete), issue_path(@issue.id), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'icon icon-del' if User.current.allowed_to?(:delete_issues, @project) %> -
+ <%= link_to l(:label_user_newfeedback), edit_issue_path(@issue), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? %> +<% end %> \ No newline at end of file diff --git a/app/views/issues/_attributes.html.erb b/app/views/issues/_attributes.html.erb index 04d7af7de..ff32e99e4 100644 --- a/app/views/issues/_attributes.html.erb +++ b/app/views/issues/_attributes.html.erb @@ -1,50 +1,77 @@ <%= labelled_fields_for :issue, @issue do |f| %> +
+
+ <%= l(:label_change_properties) %> +
    +
  • + <% if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %> +

    <%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), {:required => true}, :onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')" %>

    + <% else %> +

    <%= h(@issue.status.name) %>

    + <% end %> +
  • +
    +
  • + <% if @issue.safe_attribute? 'priority_id' %> +

    <%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), {:required => true}, :disabled => !@issue.leaf? %>

    + <% end %> +
  • +
    +
  • <% if @issue.safe_attribute? 'assigned_to_id' %> +

    <%= f.select :assigned_to_id, principals_options_for_select(@issue.assignable_users, @issue.assigned_to), :include_blank => true, :required => @issue.required_attribute?('assigned_to_id') %>

    + <% end %> +
  • +
    +
  • <% 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') %> + <%= link_to(image_tag('add.png', :style => 'vertical-align: middle;'), + new_project_version_path(@issue.project), + :remote => true, + :method => 'get', + :title => l(:label_version_new), + :tabindex => 200) if User.current.allowed_to?(:manage_versions, @issue.project) %> +

    + <% end %> +
  • +
    + +
+
    +
  • <% if @issue.safe_attribute? 'start_date' %> +

    <%= f.text_field :start_date, :size => 10, :disabled => !@issue.leaf?, :required => @issue.required_attribute?('start_date') %><%= calendar_for('issue_start_date','start_date') if @issue.leaf? %>

    + <% end %> +
  • +
    +
  • <% if @issue.safe_attribute? 'due_date' %> +

    <%= f.text_field :due_date, :size => 10, :disabled => !@issue.leaf?, :required => @issue.required_attribute?('due_date') %><%= calendar_for('issue_due_date','start_date') if @issue.leaf? %>

    + <% end %> +
  • +
    +
  • <% if @issue.safe_attribute? 'estimated_hours' %> +

    <%= f.text_field :estimated_hours, :size => 3, :disabled => !@issue.leaf?, :required => @issue.required_attribute?('estimated_hours') %> <%= l(:field_hours) %>

    + <% end %> +
  • +
    +
  • + +
  • +
    +
+
+
-