From 95f3d89afa9896d091d5d5603611940b0b09470d Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 27 May 2015 14:45:36 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=96=B0=E9=97=BB?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BC=96=E8=BE=91=E5=99=A8=EF=BC=9A=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=A1=B5=E9=9D=A2=E3=80=81=E5=88=97=E8=A1=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=96=B0=E6=A0=B7=E5=BC=8F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_form.html.erb | 14 ++++++------ app/views/news/_project_form.html.erb | 33 +++++++++++++++++---------- app/views/news/_project_news.html.erb | 2 +- public/javascripts/project.js | 1 + public/stylesheets/project.css | 1 + 5 files changed, 31 insertions(+), 20 deletions(-) diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index 27ac07d64..41fca87eb 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -53,13 +53,13 @@ <%= f.label_for_field :description, :required => @issue.required_attribute?('description'), :no_label => true, :class => "label" %> <%#= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %> <%#= content_tag 'span', :id => "issue_description_and_toolbar" do %> - <%= f.kindeditor :description,:editor_id => "issue_desc_editor", - # :rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min), - # :accesskey => accesskey(:edit), - # :class => "w583", - :width=>'87%', - :resizeType => 0, - :no_label => true %> + <%= f.kindeditor :description,:editor_id => "issue_desc_editor", + # :rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min), + # :accesskey => accesskey(:edit), + # :class => "w583", + :width=>'87%', + :resizeType => 0, + :no_label => true %> <%# end %> <%#= wikitoolbar_for 'issue_description' %> <% end %> diff --git a/app/views/news/_project_form.html.erb b/app/views/news/_project_form.html.erb index 37f11d3f0..33613e5a7 100644 --- a/app/views/news/_project_form.html.erb +++ b/app/views/news/_project_form.html.erb @@ -1,26 +1,35 @@ -
  • +<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> +
  • - +

  • -
  • - - -

    +
  • + <% if is_new %> + <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> + + <%= f.kindeditor :description,:width=>'91%',:editor_id=>'project_news_description_editor' %> +

    + <% else %> + + <%= f.kindeditor :description,:width=>'91%', :editor_id=>'project_news_description_editor', :owner_id => @news.id, :owner_type => OwnerTypeHelper::NEWS %> +

    + <% end %> +
  • -
  • - +
  • + <%= render :partial => 'attachments/new_form', :locals => {:container => @news} %>
  • -
  • +
  • <% if is_new %> - <%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fl c_white' %> + <%= link_to l(:button_create), "javascript:void(0)", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fl c_white' %> <%= link_to l(:button_cancel), project_news_index_path(@project), :onclick => '$("#add-news").hide()', :class => 'blue_btn grey_btn fl c_white' %> <% else %> - <%= link_to l(:button_save), "#", :onclick => 'submitNews();',:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white' %> - <%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;',:class => 'blue_btn grey_btn fl c_white' %> + <%= link_to l(:button_save), "javascript:void(0)", :onclick => "submitNews();",:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white' %> + <%= link_to l(:button_cancel), news_path(@news), :class => 'blue_btn grey_btn fl c_white' %> <% end %>
  • diff --git a/app/views/news/_project_news.html.erb b/app/views/news/_project_news.html.erb index 75b51ab6c..7b6a16e38 100644 --- a/app/views/news/_project_news.html.erb +++ b/app/views/news/_project_news.html.erb @@ -29,7 +29,7 @@ <%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %> <%= l(:label_add_news) %>:<%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %>
    -

    <%= news.description %>

    +

    <%=textAreailizable news.description %>

    <%= l(:label_create_time) %> :<%= format_time(news.created_on) %> diff --git a/public/javascripts/project.js b/public/javascripts/project.js index f9f88703d..e30c08b43 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -212,6 +212,7 @@ function regexTitle() { } function regexDescription() { + project_news_description_editor.sync(); var name = $("#news_description").val(); if (name.length == 0) { $("#description_notice_span").text("描述不能为空"); diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index d6bef6524..5a6d98fbe 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -330,6 +330,7 @@ a:hover.st_add{ color:#ff8e15;} .hwork_new{ color:#4c4c4c;} .c_red{ color:#F00;} .hwork_input{ border:1px solid #64bdd9; height:22px; width:555px; background:#fff; margin-bottom:10px; padding:5px;} +.hwork_input_news{ border:1px solid #64bdd9; height:22px; width:594px; background:#fff; margin-bottom:10px; padding:5px;} .hwork_input02{ border:1px solid #64bdd9; height:15px; width:120px; background:#fff; margin-bottom:10px; padding:5px;} .hwork_text{ border:1px solid #64bdd9; height:100px;width:555px; background:#fff; margin-left:5px; padding:5px; margin-bottom:10px;} .hwork_new ul li{ } From 04c54d4f6ee9a751210b432aecbd1a5322a4f72c Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 27 May 2015 14:50:09 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=96=B0=E9=97=BB?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=A1=B5=E9=9D=A2=E6=97=B6=E9=97=B4=E5=92=8C?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E6=8D=A2=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/news/_project_show.html.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/views/news/_project_show.html.erb b/app/views/news/_project_show.html.erb index 9d598f0b5..f95192d64 100644 --- a/app/views/news/_project_show.html.erb +++ b/app/views/news/_project_show.html.erb @@ -82,8 +82,9 @@ :onclick => '$("#edit-news").show(); return false;') if User.current.allowed_to?(:manage_news, @project) %> <%= delete_link news_path(@news),:class => 'talk_edit fr' if User.current.allowed_to?(:manage_news, @project) %>
    -
    <%= textAreailizable(@news, :description) %>
    <%= l(:label_create_time) %> : <%= format_time(@news.created_on) %>
    - <%= link_to_attachments_course @news %> +
    <%= textAreailizable(@news, :description) %>
    + <%= link_to_attachments_course @news %>
    + <%= l(:label_create_time) %> : <%= format_time(@news.created_on) %>
    From df5c040aab9d389a5d75d81568fd6b8558593818 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 27 May 2015 16:00:11 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AEissue?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_action_menu.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/issues/_action_menu.html.erb b/app/views/issues/_action_menu.html.erb index a5823ede3..2643c93e7 100644 --- a/app/views/issues/_action_menu.html.erb +++ b/app/views/issues/_action_menu.html.erb @@ -1,6 +1,6 @@ <%#= watcher_link_issue(@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_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_notes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %>