From a138ee31ab7c59a05364466df2c618a278657bb4 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 8 Jun 2016 11:00:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E9=A6=96=E9=A1=B5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/org_document_comments/show.html.erb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/views/org_document_comments/show.html.erb b/app/views/org_document_comments/show.html.erb index dfa37bfb6..dbeabfa72 100644 --- a/app/views/org_document_comments/show.html.erb +++ b/app/views/org_document_comments/show.html.erb @@ -23,6 +23,9 @@ <% else %> 组织文章 <% end %> + <% if @document.organization.home_id == @document.id %> + 已设为首页 + <% end %>
<%= link_to @document.title, org_document_comment_path(:id => @document.id, :organization_id => @document.organization.id) %>
@@ -45,8 +48,14 @@
    • - <%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => @document.organization_id, :home_id => @document.id}, :method => "put", :remote => true) do |f| %> - 设为首页 + <% if @document.organization.home_id == @document.id %> + <%= form_for('new_form', :url => {:controller => 'organizations', :action => 'cancel_homepage', :id => @document.organization_id, :home_id => @document.id}, :method => "put", :remote => true) do |f| %> + 取消首页 + <% end %> + <% else %> + <%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => @document.organization_id, :home_id => @document.id}, :method => "put", :remote => true) do |f| %> + 设为首页 + <% end %> <% end %>