From 95f3d89afa9896d091d5d5603611940b0b09470d Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 27 May 2015 14:45:36 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=96=B0=E9=97=BB=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=BC=96=E8=BE=91=E5=99=A8=EF=BC=9A=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E3=80=81=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=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{ }