From 7a710a4a8f094577379656c47b2174334aaf5825 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 13 Oct 2014 09:40:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=8E=89=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=97=A0=E7=94=A8=E9=A2=84=E8=A7=88=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/_course_show.html.erb | 2 +- app/views/boards/_project_show.html.erb | 4 ++-- app/views/common/_preview.html.erb | 2 +- app/views/contestnotifications/edit.html.erb | 2 +- app/views/news/_course_news.html.erb | 6 +++--- app/views/news/_course_show.html.erb | 2 +- app/views/news/_project_news.html.erb | 4 ++-- app/views/news/_project_show.html.erb | 2 +- app/views/news/edit.html.erb | 2 +- app/views/news/new.html.erb | 4 ++-- app/views/wiki/edit.html.erb | 2 +- config/routes.rb | 19 +++++++++++++------ 12 files changed, 29 insertions(+), 22 deletions(-) diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 35e066d45..26576195d 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -17,7 +17,7 @@ <%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %> <%= render :partial => 'messages/form', :locals => {:f => f} %>

<%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %> - <%= preview_link(preview_board_message_path(@board), 'message-form' ,target='preview',{:class => 'whiteButton m3p10'} )%> | + <%#= preview_link(preview_board_message_path(@board), 'message-form' ,target='preview',{:class => 'whiteButton m3p10'} )%> <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;' ,:class => 'whiteButton m3p10' %>

<% end %>
diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb index 199155838..d615c877c 100644 --- a/app/views/boards/_project_show.html.erb +++ b/app/views/boards/_project_show.html.erb @@ -18,8 +18,8 @@ <%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %> <%= render :partial => 'messages/form', :locals => {:f => f} %>

<%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %> - <%= preview_link(preview_board_message_path(@board), 'message-form', target='preview', {:class => 'whiteButton m3p10'}) %> - | + <%#= preview_link(preview_board_message_path(@board), 'message-form', target='preview', {:class => 'whiteButton m3p10'}) %> + <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;', :class => 'whiteButton m3p10' %>

<% end %>
diff --git a/app/views/common/_preview.html.erb b/app/views/common/_preview.html.erb index 90d83ce8c..cf26d78ab 100644 --- a/app/views/common/_preview.html.erb +++ b/app/views/common/_preview.html.erb @@ -1,3 +1,3 @@
<%= l(:label_preview) %> -<%= textilizable @text, :attachments => @attachments, :object => @previewed %> + <%= textilizable @text, :attachments => @attachments, :object => @previewed %>
diff --git a/app/views/contestnotifications/edit.html.erb b/app/views/contestnotifications/edit.html.erb index 27e38f999..22f484724 100644 --- a/app/views/contestnotifications/edit.html.erb +++ b/app/views/contestnotifications/edit.html.erb @@ -7,7 +7,7 @@ :method => :put } do |f| %> <%= render :partial => 'form', :locals => { :f => f } %> <%= submit_tag l(:button_save) %> -<%= preview_link preview_contestnotifications_path(id: @contestnotification), +<%#= preview_link preview_contestnotifications_path(id: @contestnotification), 'contestnotifications-form' %> <% end %> diff --git a/app/views/news/_course_news.html.erb b/app/views/news/_course_news.html.erb index ea94244d5..f66def486 100644 --- a/app/views/news/_course_news.html.erb +++ b/app/views/news/_course_news.html.erb @@ -74,9 +74,9 @@ <%= 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} %> - <%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'whiteButton m3p10' %>| - <%= preview_link preview_news_path(:course_id => @course), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %> - | + <%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'whiteButton m3p10' %> + <%#= preview_link preview_news_path, 'news-form', target='preview', {:class => 'whiteButton m3p10'} %> + <%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()', :class => 'whiteButton m3p10' %> <% end if @course %>
diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb index 6e03e8e34..6f13c28c7 100644 --- a/app/views/news/_course_show.html.erb +++ b/app/views/news/_course_show.html.erb @@ -70,7 +70,7 @@ <%= render :partial => 'course_form', :locals => { :f => f, :is_new => false } %> <%#= submit_tag l(:button_save) %> <%= link_to l(:button_save), "#", :onclick => 'submitNews();',:onmouseover => 'this.focus()',:class => 'whiteButton m3p10' %> - <%= preview_link preview_news_path(:course_id => @course, :id => @news), 'news-form',target='preview',{:class => 'whiteButton m3p10'} %> | + <%#= preview_link preview_news_path(:course_id => @course, :id => @news), 'news-form',target='preview',{:class => 'whiteButton m3p10'} %> <%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;',:class => 'whiteButton m3p10' %> <% end %>
diff --git a/app/views/news/_project_news.html.erb b/app/views/news/_project_news.html.erb index 75f33d1d3..79217f1fe 100644 --- a/app/views/news/_project_news.html.erb +++ b/app/views/news/_project_news.html.erb @@ -84,8 +84,8 @@ <%#= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %> <%= link_to l(:button_create), "#", :onclick => 'submitNews();',:onmouseover => 'submitFocus(this);', :class => 'whiteButton m3p10' %> | - <%= preview_link preview_news_path(:project_id => @project), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %> - | + <%#= preview_link preview_news_path(:project_id => @project), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %> + <%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()', :class => 'whiteButton m3p10' %> <% end if @project %>
diff --git a/app/views/news/_project_show.html.erb b/app/views/news/_project_show.html.erb index 665094cc8..7b4c209b0 100644 --- a/app/views/news/_project_show.html.erb +++ b/app/views/news/_project_show.html.erb @@ -70,7 +70,7 @@ <%= render :partial => 'form', :locals => { :f => f } %> <%#= submit_tag l(:button_save) %> <%= link_to l(:button_save), "#", :onclick => 'submitNews();',:onmouseover => 'this.focus()',:class => 'whiteButton m3p10' %> - <%= preview_link preview_news_path(:project_id => @project, :id => @news), 'news-form',target='preview',{:class => 'whiteButton m3p10'} %> | + <%#= preview_link preview_news_path(:project_id => @project, :id => @news), 'news-form',target='preview',{:class => 'whiteButton m3p10'} %> <%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;',:class => 'whiteButton m3p10' %> <% end %>
diff --git a/app/views/news/edit.html.erb b/app/views/news/edit.html.erb index e5e5221b9..3225f8031 100644 --- a/app/views/news/edit.html.erb +++ b/app/views/news/edit.html.erb @@ -3,7 +3,7 @@ <%= labelled_form_for @news, :html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %> <%= render :partial => 'form', :locals => { :f => f } %> <%= submit_tag l(:button_save) %> -<%= preview_link preview_news_path(:project_id => @project, :id => @news), 'news-form' %> +<%#= preview_link preview_news_path(:project_id => @project, :id => @news), 'news-form' %> <% end %>
diff --git a/app/views/news/new.html.erb b/app/views/news/new.html.erb index 836d3b6ed..03c1d3ee7 100644 --- a/app/views/news/new.html.erb +++ b/app/views/news/new.html.erb @@ -4,14 +4,14 @@ :html => {:id => 'news-form', :multipart => true} do |f| %> <%= render :partial => 'news/form', :locals => {:f => f} %> <%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %> - <%= preview_link preview_news_path(:project_id => @project), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %> + <%#= preview_link preview_news_path(:project_id => @project), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %> <% end %> <% elsif @course %> <%= labelled_form_for @news, :url => course_news_index_path(@course), :html => {:id => 'news-form', :multipart => true} do |f| %> <%= render :partial => 'news/form', :locals => {:f => f} %> <%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %> - <%= preview_link preview_news_path(:course_id => @course), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %> + <%#= preview_link preview_news_path(:course_id => @course), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %> <% end %> <% end %>
diff --git a/app/views/wiki/edit.html.erb b/app/views/wiki/edit.html.erb index 3a1abdd83..ba82865ad 100644 --- a/app/views/wiki/edit.html.erb +++ b/app/views/wiki/edit.html.erb @@ -44,7 +44,7 @@

<%= submit_tag l(:button_save) %> - <%= preview_link({:controller => 'wiki', :action => 'preview', :project_id => @project, :id => @page.title }, 'wiki_form') %>

+ <%#= preview_link({:controller => 'wiki', :action => 'preview', :project_id => @project, :id => @page.title }, 'wiki_form') %>

<%= wikitoolbar_for 'content_text' %> <% end %> diff --git a/config/routes.rb b/config/routes.rb index f4f858a9f..339d3a853 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -100,7 +100,6 @@ RedmineApp::Application.routes.draw do #resources :contestnotifications, :only => [:index, :show, :edit, :update, :destroy] # match '/contestnotifications/:id/notificationcomments', :to => 'notificationcomments#create', :via => :post # match '/contestnotifications/:id/notificationcomments/:notificationcomment_id', :to => 'notificationcomments#destroy', :via => :delete - match '/contestnotifications/preview', :to => 'previews#contestnotification', :as => 'preview_contestnotifications', :via => [:get, :post, :put] ## new added by linchun #新竞赛相关 resources :contests, only: [:index] do resources :contestnotifications do @@ -136,6 +135,19 @@ RedmineApp::Application.routes.draw do end end + match '/news/preview', :to => 'previews#news', :as => 'preview_news', :via => [:get, :post, :put] + match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue', :via => [:get, :post, :put] + match '/issues/preview/edit/:id', :to => 'previews#issue', :as => 'preview_edit_issue', :via => [:get, :post, :put] + match '/issues/preview', :to => 'previews#issue', :as => 'preview_issue', :via => [:get, :post, :put] + match '/contestnotifications/preview', :to => 'previews#contestnotification', :as => 'preview_contestnotifications', :via => [:get, :post, :put] + + #resource :previews, only: [] do + # collection do + # match 'news', :via => [:get, :post, :put] + # match 'issue', :via => [:get, :post, :put] + # end + #end + resources :stores do collection do match 'search', :via => [:get, :post] @@ -188,11 +200,6 @@ RedmineApp::Application.routes.draw do match 'account/activate', :via => :get match 'account/valid_ajax', :via => :get - match '/news/preview', :to => 'previews#news', :as => 'preview_news', :via => [:get, :post, :put] - match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue', :via => [:get, :post, :put] - match '/issues/preview/edit/:id', :to => 'previews#issue', :as => 'preview_edit_issue', :via => [:get, :post, :put] - match '/issues/preview', :to => 'previews#issue', :as => 'preview_issue', :via => [:get, :post, :put] - match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post]