From 64107ca5ccc9af52eafa9f2a2d66d6c8deded2da Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 19 Sep 2014 15:43:25 +0800 Subject: [PATCH 01/19] =?UTF-8?q?#1279=20=E4=B8=BB=E9=A1=B5--=E2=80=9C?= =?UTF-8?q?=E6=88=91=E8=A6=81=E6=8F=90=E9=97=AE=E2=80=9D/=E2=80=9C?= =?UTF-8?q?=E6=88=91=E8=A6=81=E5=8F=8D=E9=A6=88=E2=80=9D=20=E7=BD=AE?= =?UTF-8?q?=E6=89=80=E6=9C=89=E6=9D=A1=E4=BB=B6=E4=B8=BA=E7=A9=BA=EF=BC=8C?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=8F=91=E5=B8=83=E6=8C=89=E9=92=AE=EF=BC=8C?= =?UTF-8?q?=E6=9C=AA=E7=BB=99=E5=87=BA=E7=B1=BB=E4=BC=BC=E4=BA=8E=E2=80=9C?= =?UTF-8?q?=E4=B8=BB=E9=A2=98/=E5=86=85=E5=AE=B9=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E5=AD=97=E7=AC=A6=E2=80=9D=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E4=BF=A1=E6=81=AF,=E7=BB=99=E5=87=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BF=A1=E6=81=AF=E5=90=8E=E8=B7=B3=E8=BD=AC=E9=94=99?= =?UTF-8?q?=E8=AF=AF=EF=BC=8C=E4=BF=AE=E6=AD=A3=EF=BC=8C=E5=B0=86=E4=B8=A4?= =?UTF-8?q?=E4=B8=AA=E6=8C=89=E9=92=AE=E5=B9=B6=E6=8E=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 5 ++--- app/views/memos/_topic_form.html.erb | 12 +----------- app/views/memos/new.html.erb | 2 +- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index aad575ee5..9f261c78a 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -89,10 +89,9 @@ class MemosController < ApplicationController offset(@reply_pages.offset). all if @memo.new_record? - format.html { redirect_to back_url, error: "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}" } + format.html { render :new,:layout=>'base'} else - format.html { render action: :show }#, error: "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}" } - # format.html { redirect_to back_memo_or_forum_url}#, error: "#{l :label_memo_create_fail}: #{@memo.errors.full_messages[0]}" } + format.html { render action: :show } format.json { render json: @memo.errors, status: :unprocessable_entity } end diff --git a/app/views/memos/_topic_form.html.erb b/app/views/memos/_topic_form.html.erb index 3f5642733..d7d0aeca0 100644 --- a/app/views/memos/_topic_form.html.erb +++ b/app/views/memos/_topic_form.html.erb @@ -1,15 +1,5 @@ <%= labelled_form_for(@memo, :url => forum_memos_path) do |f| %> - <% if @memo.errors.any? %> -
-

<%= pluralize(@memo.errors.count, "error") %> prohibited this memo from being saved:

- -
- <% end %>

<%= f.text_field :subject, :required => true, :size => 95 %>

<%= f.text_area :content, :required => true, :id => 'editor01' %>

@@ -20,6 +10,6 @@ <%= l(:label_attachment_plural) %>
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %>

- <%= f.submit :value => l(:label_memo_create) %> + <%= f.submit :value => l(:label_memo_create) %> <%= link_to l(:button_back), forum_path(@forum) %>
<% end %> \ No newline at end of file diff --git a/app/views/memos/new.html.erb b/app/views/memos/new.html.erb index bcda7896d..03a60044a 100644 --- a/app/views/memos/new.html.erb +++ b/app/views/memos/new.html.erb @@ -27,5 +27,5 @@ <%= render :partial => 'memos/topic_form' %> -<%= link_to l(:button_back), forum_path(@forum) %> + From 086d99fe2ac20d30af7478a8db792916b25255da Mon Sep 17 00:00:00 2001 From: z9hang Date: Mon, 22 Sep 2014 10:35:18 +0800 Subject: [PATCH 02/19] =?UTF-8?q?#1280=20=E5=85=AC=E5=85=B1=E8=B4=B4?= =?UTF-8?q?=E5=90=A7--=E6=96=B0=E5=BB=BA=E5=B8=96=E5=AD=90=EF=BC=8C?= =?UTF-8?q?=E7=BD=AE=E6=89=80=E6=9C=89=E6=9D=A1=E4=BB=B6=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=EF=BC=8C=E7=82=B9=E5=87=BB=E5=8F=91=E5=B8=83=E6=8C=89=E9=92=AE?= =?UTF-8?q?=EF=BC=8C=E5=8D=B4=E8=BF=94=E5=9B=9E=E5=B8=96=E5=AD=90=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=8F=8A=E5=85=B6=E4=BB=96=E7=9B=B8=E5=85=B3=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=82=E4=BF=AE=E6=94=B9=EF=BC=9A=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E5=90=8E=E5=81=9C=E7=95=99=E5=9C=A8=E5=8F=91?= =?UTF-8?q?=E5=B8=96=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/show.html.erb | 3 +-- config/locales/zh.yml | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 4cd6631c2..642cf5b15 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -1,5 +1,5 @@ -