编辑功能

This commit is contained in:
huang 2016-05-05 18:47:32 +08:00
parent 1d2e6327a8
commit d0db711449
3 changed files with 6 additions and 7 deletions

View File

@ -1,5 +1,5 @@
class SubDocumentCommentsController < ApplicationController
before_filter :find_subdomain_and_subfield, :only => [:new, :create, :show, :index, :destroy]
before_filter :find_subdomain_and_subfield, :only => [:new, :create, :show, :index, :destroy, :edit]
before_filter :find_subfield_content, :only => [:show, :index]
helper :attachments,:organizations
layout 'base_sub_domain'
@ -90,9 +90,8 @@ class SubDocumentCommentsController < ApplicationController
end
def edit
@org_document = SubDocumentComment.find(params[:id])
@sub_document = SubDocumentComment.find(params[:id])
@flag = params[:flag]
@organization = Organization.find(params[:organization_id])
end
def add_reply

View File

@ -9,12 +9,12 @@
<%= link_to User.find(document.creator_id), user_url_in_org(document.creator.id), :class => "newsBlue mr15" %>
TO&nbsp;&nbsp;<%= link_to @organization.name, organization_path(@organization), :class => "newsBlue" %>
|
<span style="color:#269ac9;"><%=link_to document.sub_domain.name, org_subfield_sub_domain_sub_document_comment_path(document, :org_subfield_id=> @org_subfield.id, :sub_domain_id => document.sub_domain.id), :class => "newsBlue" %></span>
<span style="color:#269ac9;"><a class="newsBlue"><%= document.sub_domain.name %></a></span>
<%# if document.organization.home_id == document.id %>
<!--<span class="red_homework_btn_cir ml5">已设为首页</span>-->
<%# end %>
</div>
<div class="homepagePostTitle postGrey"><a><% document.title %></a></div>
<div class="homepagePostTitle postGrey"><a><%= link_to document.title, org_subfield_sub_domain_sub_document_comment_path(document, :org_subfield_id=> @org_subfield.id, :sub_domain_id => document.sub_domain.id) %></a></div>
<div class="homepagePostDate fl">
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
</div>
@ -46,7 +46,7 @@
<!--<%# end %>-->
<!--</li>-->
<li>
<%= link_to "编辑文章", org_subfield_sub_domain_sub_document_comment_path(document, :org_subfield_id=> params[:org_subfield_id], :sub_domain_id => document.sub_domain.id, :flag => flag), :method => 'edit', :class => "postOptionLink" %>
<%= link_to "编辑文章", edit_org_subfield_sub_domain_sub_document_comment_path(document, :org_subfield_id=> params[:org_subfield_id], :sub_domain_id => document.sub_domain.id, :flag => flag), :method => 'update', :class => "postOptionLink" %>
</li>
<li>
<%= link_to "删除文章", org_subfield_sub_domain_sub_document_comment_path(document, :org_subfield_id=> params[:org_subfield_id], :sub_domain_id => document.sub_domain.id, :flag => flag), :method => 'delete',

View File

@ -126,9 +126,9 @@ RedmineApp::Application.routes.draw do
post 'reply'
post 'add_reply_in_doc'
delete 'delete_reply'
get 'edit'
end
collection do
end
end