From 68aceaa7dfbdbd68bfde084fca7fc6402b4ecaf4 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 15 Dec 2015 18:43:58 +0800 Subject: [PATCH] =?UTF-8?q?issue=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 4 + app/views/issues/_action_menu.html.erb | 4 +- app/views/issues/_attributes.html.erb | 5 +- app/views/issues/_attributes_show.html.erb | 2 +- app/views/issues/_detail.html.erb | 36 +++++ app/views/issues/_edit.html.erb | 38 ++--- app/views/issues/_form.html.erb | 2 +- app/views/issues/_issue_replies.html.erb | 34 +++++ app/views/issues/add_journal.js.erb | 11 +- app/views/issues/show.html.erb | 139 ++++++------------ app/views/issues/update.js.erb | 5 + .../lib/rails_kindeditor/helper.rb | 8 +- public/assets/kindeditor/kindeditor.js | 28 ++-- .../plugins/autoheight/autoheight.js | 4 +- public/javascripts/project.js | 10 ++ public/stylesheets/project.css | 15 +- public/stylesheets/public.css | 3 +- 17 files changed, 200 insertions(+), 148 deletions(-) create mode 100644 app/views/issues/_detail.html.erb create mode 100644 app/views/issues/_issue_replies.html.erb create mode 100644 app/views/issues/update.js.erb diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 7cdc838e2..9bb602178 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -256,6 +256,7 @@ class IssuesController < ApplicationController end flash[:notice] = l(:notice_successful_update) unless @issue.current_journal.new_record? respond_to do |format| + format.js format.html { redirect_to issue_url(@issue.id) } format.api { render_api_ok } end @@ -398,6 +399,9 @@ class IssuesController < ApplicationController user_activity.updated_at = jour.created_on user_activity.save @user_activity_id = params[:user_activity_id] + if params[:issue_id] + @issue_id = params[:issue_id] + end respond_to do |format| format.js end diff --git a/app/views/issues/_action_menu.html.erb b/app/views/issues/_action_menu.html.erb index ae2a848e0..97e95d4a9 100644 --- a/app/views/issues/_action_menu.html.erb +++ b/app/views/issues/_action_menu.html.erb @@ -2,5 +2,5 @@ <%#= watcher_link_issue(@issue, User.current) %> <%= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'talk_edit fr' 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) %> -<%= link_to l(:button_edit), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("all_attributes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %> -<%= link_to l(:label_user_newfeedback), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("update", "issue_journal_kind_reply"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %> +<%= link_to l(:button_edit), 'javascript:void(0);', :onclick => 'issueEditShow();', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %> +<%#= link_to l(:label_user_newfeedback), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("update", "issue_journal_kind_reply"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %> diff --git a/app/views/issues/_attributes.html.erb b/app/views/issues/_attributes.html.erb index 54cb85212..1b6bebb01 100644 --- a/app/views/issues/_attributes.html.erb +++ b/app/views/issues/_attributes.html.erb @@ -1,7 +1,6 @@ <%= labelled_fields_for :issue, @issue do |f| %>
-
- <%= l(:label_change_properties) %> +
  • @@ -54,7 +53,7 @@
-
    +
    • <% if @issue.safe_attribute? 'start_date' %> diff --git a/app/views/issues/_attributes_show.html.erb b/app/views/issues/_attributes_show.html.erb index 7b9e2bedf..15160facb 100644 --- a/app/views/issues/_attributes_show.html.erb +++ b/app/views/issues/_attributes_show.html.erb @@ -1,5 +1,5 @@ -
      +
      <%= issue_fields_rows do |rows| %>
      •  状态  : 

        <%= @issue.status.name %>

        diff --git a/app/views/issues/_detail.html.erb b/app/views/issues/_detail.html.erb new file mode 100644 index 000000000..b085ce32f --- /dev/null +++ b/app/views/issues/_detail.html.erb @@ -0,0 +1,36 @@ +
        + <%= link_to image_tag(url_to_avatar(@issue.author), :width => 46, :height => 46), user_path(@issue.author), :class => "ping_dispic" %> +
        +
        +

        <%= @issue.subject %> + <%= get_issue_priority(@issue.priority_id)[1] %>

        +
        +
        + 由<%= @issue.author %>添加于 <%= format_time(@issue.created_on).html_safe %> +
        + + + +<%= render :partial => 'action_menu' %> +
        +<% if @issue.description? || @issue.attachments.any? -%> +
        + <% if @issue.description? %> + <%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %> + <%= textAreailizable @issue, :description, :attachments => @issue.attachments %> + <% end %> +
        +<% end -%> +<% if @issue.attachments.any? %> +
        + + + <%= link_to_attachment_project @issue, :thumbnails => true %>
        + <%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %> +
        +
        +<% end %> + + +<%= render :partial => 'issues/attributes_show' %> +
        \ No newline at end of file diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb index b8f362429..87430e5d6 100644 --- a/app/views/issues/_edit.html.erb +++ b/app/views/issues/_edit.html.erb @@ -3,44 +3,26 @@ <% end %> -<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %> +<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true,:remote=>true} do |f| %> <%= error_messages_for 'issue', 'time_entry' %> <%= render :partial => 'conflict' if @conflict %> - <% if @edit_allowed || !@allowed_statuses.empty? %> -