From 4e49da836e69fd3d267271c66edba0e62bbf5969 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 21 Aug 2014 15:40:21 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=AF=BE=E7=A8=8B=E9=80=9A=E7=9F=A5=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E3=80=81=E4=BF=AE=E6=94=B9=E5=A1=AB=E5=86=99=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E6=97=B6=E5=AD=97=E6=AE=B5=E9=99=90=E5=88=B6=E5=AE=9E?= =?UTF-8?q?=E6=97=B6=E6=8F=90=E7=A4=BA=202.=E4=BF=AE=E6=94=B9=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E6=97=B6=E5=A1=AB=E5=86=99=E5=AD=97=E6=AE=B5=E8=B6=85?= =?UTF-8?q?=E5=87=BA=E9=99=90=E5=88=B6=E9=95=BF=E5=BA=A6=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E7=9A=84=E4=BF=AE=E5=A4=8D=203.=E6=B3=A8=E9=87=8A=E6=97=A0?= =?UTF-8?q?=E6=95=88=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/news_controller.rb | 3 +- app/views/contestnotifications/_news.html.erb | 10 ++-- app/views/news/_course_form.html.erb | 6 +- app/views/news/_course_news.html.erb | 56 ++++++++++++++++++- app/views/news/_course_show.html.erb | 56 ++++++++++++++++++- 5 files changed, 121 insertions(+), 10 deletions(-) diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index 9437889b2..e564bc940 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -148,7 +148,8 @@ class NewsController < ApplicationController flash[:notice] = l(:notice_successful_update) redirect_to news_path(@news) else - render :action => 'edit' + #flash[:error] = l(:notice_successful_update) + redirect_to news_path(@news) end end diff --git a/app/views/contestnotifications/_news.html.erb b/app/views/contestnotifications/_news.html.erb index 301a193d8..fbac2557f 100644 --- a/app/views/contestnotifications/_news.html.erb +++ b/app/views/contestnotifications/_news.html.erb @@ -1,9 +1,9 @@ - + <%# unless news.summary.blank? %><%#=h news.summary %><% end %> +<%#= authoring news.created_on, news.author %>

--> diff --git a/app/views/news/_course_form.html.erb b/app/views/news/_course_form.html.erb index 91b35670c..7ce42439a 100644 --- a/app/views/news/_course_form.html.erb +++ b/app/views/news/_course_form.html.erb @@ -3,9 +3,11 @@ <%= is_new ? l(:bale_news_notice):l(:bale_edit_notice)%>
-

<%= f.text_field :title, :required => true, :size => 60, :style => "width:488px;" %>

+

<%= f.text_field :title, :required => true, :size => 60, :style => "width:468px;", :onblur => "regexTitle();" %>

+

(60个字符以内)

-

<%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:490px;" %>

+

<%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:470px;", :onblur => "regexDescription();" %>

+

<%= render :partial => 'attachments/form', :locals => {:container => @news} %>

diff --git a/app/views/news/_course_news.html.erb b/app/views/news/_course_news.html.erb index adb2ce283..fdf12c06d 100644 --- a/app/views/news/_course_news.html.erb +++ b/app/views/news/_course_news.html.erb @@ -3,6 +3,59 @@ label_tips = l(:label_course_news) %> + + <%= label_tips %> @@ -16,7 +69,8 @@ <%= labelled_form_for @news, :url => course_news_index_path(@course), :html => {:id => 'news-form', :multipart => true} do |f| %> <%= render :partial => 'news/course_form', :locals => {:f => f, :is_new => true} %> - <%= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %> | + <%#= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %> + <%= link_to l(:button_create), "#", :onclick => 'submitNews();', :class => 'whiteButton m3p10' %>| <%= preview_link preview_news_path(:course_id => @course), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %> | <%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()', :class => 'whiteButton m3p10' %> diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb index eb4b5e8b7..c6661d9fe 100644 --- a/app/views/news/_course_show.html.erb +++ b/app/views/news/_course_show.html.erb @@ -1,3 +1,56 @@ + +
<%= watcher_link(@news, User.current) %> <%= link_to(l(:button_edit), @@ -15,7 +68,8 @@ <%= labelled_form_for :news, @news, :url => news_path(@news), :html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %> <%= render :partial => 'course_form', :locals => { :f => f, :is_new => false } %> - <%= submit_tag l(:button_save) %> + <%#= submit_tag l(:button_save) %> + <%= link_to l(:button_save), "#", :onclick => 'submitNews();' %> <%= preview_link preview_news_path(:course_id => @course, :id => @news), 'news-form',target='preview',{:class => ''} %> | <%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;' %> <% end %>