Merge branch 'dev_hjq' of https://git.trustie.net/jacknudt/trustieforge into dev_hjq
This commit is contained in:
commit
06b89c5108
|
@ -1,166 +1,169 @@
|
||||||
class OrgDocumentCommentsController < ApplicationController
|
class OrgDocumentCommentsController < ApplicationController
|
||||||
before_filter :find_organization, :only => [:new, :create, :show, :index]
|
before_filter :find_organization, :only => [:new, :create, :show, :index]
|
||||||
helper :attachments
|
helper :attachments
|
||||||
layout 'base_org'
|
layout 'base_org'
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@org_document_comment = OrgDocumentComment.new
|
@org_document_comment = OrgDocumentComment.new
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@org_document_comment = OrgDocumentComment.new(:organization_id => @organization.id, :creator_id => User.current.id)
|
@org_document_comment = OrgDocumentComment.new(:organization_id => @organization.id, :creator_id => User.current.id)
|
||||||
@org_document_comment.title = params[:org_document_comment][:title]
|
@org_document_comment.title = params[:org_document_comment][:title]
|
||||||
@org_document_comment.content = params[:org_document_comment][:content]
|
@org_document_comment.content = params[:org_document_comment][:content]
|
||||||
@org_document_comment.save_attachments(params[:attachments])
|
@org_document_comment.save_attachments(params[:attachments])
|
||||||
if params[:field_id]
|
if params[:field_id]
|
||||||
@org_document_comment.org_subfield_id = params[:field_id].to_i
|
@org_document_comment.org_subfield_id = params[:field_id].to_i
|
||||||
end
|
end
|
||||||
if @org_document_comment.save
|
if @org_document_comment.save
|
||||||
flash.keep[:notice] = l(:notice_successful_create)
|
flash.keep[:notice] = l(:notice_successful_create)
|
||||||
EditorOfDocument.create(:editor_id => User.current.id, :org_document_comment_id => @org_document_comment.id, :created_at => @org_document_comment.updated_at)
|
EditorOfDocument.create(:editor_id => User.current.id, :org_document_comment_id => @org_document_comment.id, :created_at => @org_document_comment.updated_at)
|
||||||
if params[:field_id]
|
if params[:field_id]
|
||||||
redirect_to organization_path(@organization, :org_subfield_id => params[:field_id])
|
redirect_to organization_path(@organization, :org_subfield_id => params[:field_id])
|
||||||
else
|
else
|
||||||
redirect_to organization_org_document_comments_path(@organization)
|
redirect_to organization_org_document_comments_path(@organization)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
redirect_to new_org_document_comment_path(:organization_id => @organization.id)
|
redirect_to new_org_document_comment_path(:organization_id => @organization.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
def show
|
|
||||||
@document = OrgDocumentComment.find(params[:id])
|
def show
|
||||||
end
|
@document = OrgDocumentComment.find(params[:id])
|
||||||
|
end
|
||||||
def index
|
|
||||||
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
def index
|
||||||
@documents = @organization.org_document_comments.where("parent_id is null").order("created_at desc")
|
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
||||||
else
|
@documents = @organization.org_document_comments.where("parent_id is null").order("created_at desc")
|
||||||
render_403
|
else
|
||||||
end
|
render_403
|
||||||
end
|
end
|
||||||
def update
|
end
|
||||||
@org_document = OrgDocumentComment.find(params[:id])
|
|
||||||
@org_document.update_attributes(:title => params[:org_document_comment][:title], :content => params[:org_document_comment][:content])
|
def update
|
||||||
@org_document.save_attachments(params[:attachments])
|
@org_document = OrgDocumentComment.find(params[:id])
|
||||||
if @org_document.parent.nil?
|
@org_document.update_attributes(:title => params[:org_document_comment][:title], :content => params[:org_document_comment][:content])
|
||||||
act = OrgActivity.where("org_act_type='OrgDocumentComment' and org_act_id =?", @org_document.id).first
|
Attachment.attach_files(@org_document, params[:attachments])
|
||||||
act.update_attributes(:updated_at => @org_document.updated_at)
|
# @org_document.save_attachments(params[:attachments])
|
||||||
EditorOfDocument.create(:editor_id => User.current.id, :org_document_comment_id => @org_document.id, :created_at => Time.now)
|
if @org_document.parent.nil?
|
||||||
end
|
act = OrgActivity.where("org_act_type='OrgDocumentComment' and org_act_id =?", @org_document.id).first
|
||||||
respond_to do |format|
|
act.update_attributes(:updated_at => @org_document.updated_at)
|
||||||
format.html {
|
EditorOfDocument.create(:editor_id => User.current.id, :org_document_comment_id => @org_document.id, :created_at => Time.now)
|
||||||
if params[:flag].to_i == 0
|
end
|
||||||
redirect_to organization_org_document_comments_path(:organization_id => @org_document.organization.id)
|
respond_to do |format|
|
||||||
else
|
format.html {
|
||||||
if params[:flag].to_i == 1
|
if params[:flag].to_i == 0
|
||||||
redirect_to org_document_comment_path(@org_document.root.id, :organization_id => @org_document.organization.id)
|
redirect_to organization_org_document_comments_path(:organization_id => @org_document.organization.id)
|
||||||
else
|
else
|
||||||
redirect_to organization_path(@org_document.organization.id, :org_subfield_id => params[:org_subfield_id])
|
if params[:flag].to_i == 1
|
||||||
end
|
redirect_to org_document_comment_path(@org_document.root.id, :organization_id => @org_document.organization.id)
|
||||||
end
|
else
|
||||||
}
|
redirect_to organization_path(@org_document.organization.id, :org_subfield_id => params[:org_subfield_id])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
}
|
||||||
def edit
|
end
|
||||||
@org_document = OrgDocumentComment.find(params[:id])
|
end
|
||||||
@flag = params[:flag]
|
|
||||||
@organization = Organization.find(params[:organization_id])
|
def edit
|
||||||
end
|
@org_document = OrgDocumentComment.find(params[:id])
|
||||||
|
@flag = params[:flag]
|
||||||
def add_reply
|
@organization = Organization.find(params[:organization_id])
|
||||||
@document = OrgDocumentComment.find(params[:id]).root
|
end
|
||||||
@act = OrgActivity.find(params[:id])
|
|
||||||
@comment = OrgDocumentComment.new(:organization_id => @document.organization_id, :creator_id => User.current.id, :reply_id => params[:id])
|
def add_reply
|
||||||
@comment.content = params[:org_content]
|
@document = OrgDocumentComment.find(params[:id]).root
|
||||||
@document.children << @comment
|
@act = OrgActivity.find(params[:id])
|
||||||
@document.save
|
@comment = OrgDocumentComment.new(:organization_id => @document.organization_id, :creator_id => User.current.id, :reply_id => params[:id])
|
||||||
end
|
@comment.content = params[:org_content]
|
||||||
|
@document.children << @comment
|
||||||
def add_reply_in_doc
|
@document.save
|
||||||
@document = OrgDocumentComment.find(params[:id]).root
|
end
|
||||||
@comment = OrgDocumentComment.new(:organization_id => @document.organization_id, :creator_id => User.current.id, :reply_id => params[:id])
|
|
||||||
@comment.content = params[:org_comment][:org_content]
|
def add_reply_in_doc
|
||||||
@document.children << @comment
|
@document = OrgDocumentComment.find(params[:id]).root
|
||||||
@document.save
|
@comment = OrgDocumentComment.new(:organization_id => @document.organization_id, :creator_id => User.current.id, :reply_id => params[:id])
|
||||||
respond_to do |format|
|
@comment.content = params[:org_comment][:org_content]
|
||||||
format.html {redirect_to org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id)}
|
@document.children << @comment
|
||||||
end
|
@document.save
|
||||||
end
|
respond_to do |format|
|
||||||
|
format.html {redirect_to org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id)}
|
||||||
def find_organization
|
end
|
||||||
@organization = Organization.find(params[:organization_id])
|
end
|
||||||
end
|
|
||||||
|
def find_organization
|
||||||
def destroy
|
@organization = Organization.find(params[:organization_id])
|
||||||
@org_document_comment = OrgDocumentComment.find(params[:id])
|
end
|
||||||
org = @org_document_comment.organization
|
|
||||||
if @org_document_comment.id == org.home_id
|
def destroy
|
||||||
org.update_attributes(:home_id => nil)
|
@org_document_comment = OrgDocumentComment.find(params[:id])
|
||||||
end
|
org = @org_document_comment.organization
|
||||||
if @org_document_comment.destroy
|
if @org_document_comment.id == org.home_id
|
||||||
end
|
org.update_attributes(:home_id => nil)
|
||||||
respond_to do |format|
|
end
|
||||||
format.js
|
if @org_document_comment.destroy
|
||||||
end
|
end
|
||||||
end
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
def delete_reply
|
end
|
||||||
@org_document_comment = OrgDocumentComment.find(params[:id])
|
end
|
||||||
@document = @org_document_comment.root
|
|
||||||
org = @org_document_comment.organization
|
def delete_reply
|
||||||
@org_document_comment.destroy
|
@org_document_comment = OrgDocumentComment.find(params[:id])
|
||||||
respond_to do |format|
|
@document = @org_document_comment.root
|
||||||
format.html {redirect_to org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id)}
|
org = @org_document_comment.organization
|
||||||
end
|
@org_document_comment.destroy
|
||||||
end
|
respond_to do |format|
|
||||||
def quote
|
format.html {redirect_to org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id)}
|
||||||
@org_comment = OrgDocumentComment.find(params[:id])
|
end
|
||||||
@subject = @org_comment.content
|
end
|
||||||
@subject = "RE: #{@subject}" unless @subject.starts_with?('RE:')
|
def quote
|
||||||
|
@org_comment = OrgDocumentComment.find(params[:id])
|
||||||
@content = "> #{ll(Setting.default_language, :text_user_wrote, User.find(@org_comment.creator_id).realname)}\n> "
|
@subject = @org_comment.content
|
||||||
@temp = OrgDocumentComment.new
|
@subject = "RE: #{@subject}" unless @subject.starts_with?('RE:')
|
||||||
#@course_id = params[:course_id]
|
|
||||||
@temp.content = "<blockquote>#{ll(Setting.default_language, :text_user_wrote, User.find(@org_comment.creator_id).realname)} <br/>#{@org_comment.content.html_safe}</blockquote>".html_safe
|
@content = "> #{ll(Setting.default_language, :text_user_wrote, User.find(@org_comment.creator_id).realname)}\n> "
|
||||||
respond_to do | format|
|
@temp = OrgDocumentComment.new
|
||||||
format.js
|
#@course_id = params[:course_id]
|
||||||
end
|
@temp.content = "<blockquote>#{ll(Setting.default_language, :text_user_wrote, User.find(@org_comment.creator_id).realname)} <br/>#{@org_comment.content.html_safe}</blockquote>".html_safe
|
||||||
end
|
respond_to do | format|
|
||||||
|
format.js
|
||||||
def reply
|
end
|
||||||
@document = OrgDocumentComment.find(params[:id]).root
|
end
|
||||||
@quote = params[:quote][:quote]
|
|
||||||
@org_document = OrgDocumentComment.new(:creator_id => User.current.id, :reply_id => params[:id])
|
def reply
|
||||||
|
@document = OrgDocumentComment.find(params[:id]).root
|
||||||
# params[:blog_comment][:sticky] = params[:blog_comment][:sticky] || 0
|
@quote = params[:quote][:quote]
|
||||||
# params[:blog_comment][:locked] = params[:blog_comment][:locked] || 0
|
@org_document = OrgDocumentComment.new(:creator_id => User.current.id, :reply_id => params[:id])
|
||||||
@org_document.title = params[:org_document_comment][:title]
|
|
||||||
@org_document.content = params[:org_document_comment][:content]
|
# params[:blog_comment][:sticky] = params[:blog_comment][:sticky] || 0
|
||||||
@org_document.content = @quote + @org_document.content
|
# params[:blog_comment][:locked] = params[:blog_comment][:locked] || 0
|
||||||
#@org_document.title = "RE: #{@article.title}" unless params[:blog_comment][:title]
|
@org_document.title = params[:org_document_comment][:title]
|
||||||
@document.children << @org_document
|
@org_document.content = params[:org_document_comment][:content]
|
||||||
# @user_activity_id = params[:user_activity_id]
|
@org_document.content = @quote + @org_document.content
|
||||||
# user_activity = UserActivity.where("act_type='BlogComment' and act_id =#{@article.id}").first
|
#@org_document.title = "RE: #{@article.title}" unless params[:blog_comment][:title]
|
||||||
# if user_activity
|
@document.children << @org_document
|
||||||
# user_activity.updated_at = Time.now
|
# @user_activity_id = params[:user_activity_id]
|
||||||
# user_activity.save
|
# user_activity = UserActivity.where("act_type='BlogComment' and act_id =#{@article.id}").first
|
||||||
# end
|
# if user_activity
|
||||||
# attachments = Attachment.attach_files(@org_document, params[:attachments])
|
# user_activity.updated_at = Time.now
|
||||||
# render_attachment_warning_if_needed(@org_document)
|
# user_activity.save
|
||||||
#@article.save
|
# end
|
||||||
# redirect_to user_blogs_path(:user_id=>params[:user_id])
|
# attachments = Attachment.attach_files(@org_document, params[:attachments])
|
||||||
respond_to do |format|
|
# render_attachment_warning_if_needed(@org_document)
|
||||||
format.html {
|
#@article.save
|
||||||
# if params[:course_id] #如果呆了course_id过来了,那么这是要跳到课程大纲去的
|
# redirect_to user_blogs_path(:user_id=>params[:user_id])
|
||||||
# redirect_to syllabus_course_path(:id=>params[:course_id])
|
respond_to do |format|
|
||||||
# else
|
format.html {
|
||||||
redirect_to org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id)
|
# if params[:course_id] #如果呆了course_id过来了,那么这是要跳到课程大纲去的
|
||||||
# end
|
# redirect_to syllabus_course_path(:id=>params[:course_id])
|
||||||
|
# else
|
||||||
}
|
redirect_to org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id)
|
||||||
format.js
|
# end
|
||||||
end
|
|
||||||
end
|
}
|
||||||
end
|
format.js
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -61,8 +61,7 @@
|
||||||
:are_you_sure => l(:text_are_you_sure),
|
:are_you_sure => l(:text_are_you_sure),
|
||||||
:file_count => l(:label_file_count),
|
:file_count => l(:label_file_count),
|
||||||
:delete_all_files => l(:text_are_you_sure_all),
|
:delete_all_files => l(:text_are_you_sure_all),
|
||||||
:lebel_file_uploding => l(:lebel_file_uploding),
|
:lebel_file_uploding => l(:lebel_file_uploding)
|
||||||
:containerid => "#{container.id}"
|
|
||||||
} %>
|
} %>
|
||||||
<% if container.nil? %>
|
<% if container.nil? %>
|
||||||
<span id="upload_file_count" :class="c_grey"><%= l(:label_no_file_uploaded)%></span>
|
<span id="upload_file_count" :class="c_grey"><%= l(:label_no_file_uploaded)%></span>
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
$("#RSide").removeAttr("id");
|
||||||
|
$("#Container").css("width","1000px");
|
||||||
|
$("#message_subject").focus();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<div class="homepageRight mt0 ml10">
|
||||||
|
<div class="homepageRightBanner">
|
||||||
|
<div class="NewsBannerName">
|
||||||
|
编辑帖子
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%= render :partial => 'boards/project_new_topic',
|
||||||
|
:locals => {:f => f, :edit_mode => edit_mode, :topic => topic, :project => project} %>
|
||||||
|
</div>
|
|
@ -1,26 +1,16 @@
|
||||||
<% if @message.project %>
|
<% if @message.project %>
|
||||||
<div class="project_r_h">
|
|
||||||
<h2 class="project_h2"><%= l(:label_course_board) %></h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<%#= board_breadcrumb(@message) %>
|
|
||||||
<!--<h3><%#= avatar(@topic.author, :size => "24") %><span style = "width:100%;word-break:break-all;word-wrap: break-word;"><%#=h @topic.subject %></span></h3>-->
|
|
||||||
<div class="ml15">
|
|
||||||
<ul>
|
|
||||||
<%= form_for @message, {:as => :message,
|
<%= form_for @message, {:as => :message,
|
||||||
:url => {:action => 'edit'},
|
:url => {:action => 'edit'},
|
||||||
:html => {:multipart => true,
|
:html => {:multipart => true,
|
||||||
:id => 'message-form',
|
:id => 'message-form',
|
||||||
:method => :post}
|
:method => :post}
|
||||||
} do |f| %>
|
} do |f| %>
|
||||||
<%= render :partial => 'form_project',
|
<%= render :partial => 'boards/project_message_edit',
|
||||||
:locals => {:f => f, :replying => !@message.parent.nil?} %>
|
:locals => {:f => f, :edit_mode => true, :topic => @message, :project => @message.project} %>
|
||||||
<a href="#" onclick="submitProjectsBoard();" class="blue_btn fl c_white"><%= l(:button_submit) %></a>
|
<!--<a href="#" onclick="submitProjectsBoard();" class="blue_btn fl c_white"><%#= l(:button_submit) %></a>-->
|
||||||
<%= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "blue_btn grey_btn fl c_white" %>
|
<%#= link_to l(:button_cancel), board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id)), :class => "blue_btn grey_btn fl c_white" %>
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% elsif @message.course %>
|
<% elsif @message.course %>
|
||||||
<%= form_for @message, {
|
<%= form_for @message, {
|
||||||
:as => :message,
|
:as => :message,
|
||||||
|
@ -31,7 +21,6 @@
|
||||||
} do |f| %>
|
} do |f| %>
|
||||||
<%= render :partial => 'boards/course_message_edit',
|
<%= render :partial => 'boards/course_message_edit',
|
||||||
:locals => {:f => f, :edit_mode => true, :topic => @message, :course => @message.course} %>
|
:locals => {:f => f, :edit_mode => true, :topic => @message, :course => @message.course} %>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
|
@ -1,79 +1,79 @@
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
input.is_public,input.is_public_checkbox{height:12px;}
|
input.is_public,input.is_public_checkbox{height:12px;}
|
||||||
input.is_public_checkbox{margin-left:4px;margin-right:4px;}
|
input.is_public_checkbox{margin-left:4px;margin-right:4px;}
|
||||||
</style>
|
</style>
|
||||||
<div class="fl">
|
<div class="fl">
|
||||||
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
|
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
|
||||||
<% if defined?(container) && container && container.saved_attachments %>
|
<% if defined?(container) && container && container.saved_attachments %>
|
||||||
<% container.attachments.each_with_index do |attachment, i| %>
|
<% container.attachments.each_with_index do |attachment, i| %>
|
||||||
<span id="attachments_p<%= i %>" class="attachment">
|
<span id="attachments_p<%= i %>" class="attachment">
|
||||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly') %><%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %><span class="ispublic-label"><%= l(:field_is_public) %>:</span>
|
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly') %><%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %><span class="ispublic-label"><%= l(:field_is_public) %>:</span>
|
||||||
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %>
|
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %>
|
||||||
<%= if attachment.id.nil?
|
<%= if attachment.id.nil?
|
||||||
#待补充代码
|
#待补充代码
|
||||||
else
|
else
|
||||||
link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
|
link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
|
||||||
end
|
end
|
||||||
%>
|
%>
|
||||||
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
|
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
|
||||||
|
|
||||||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||||
</span>
|
</span>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% container.saved_attachments.each_with_index do |attachment, i| %>
|
<% container.saved_attachments.each_with_index do |attachment, i| %>
|
||||||
<span id="attachments_p<%= i %>" class="attachment">
|
<span id="attachments_p<%= i %>" class="attachment">
|
||||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly') %>
|
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly') %>
|
||||||
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %>
|
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %>
|
||||||
<span class="ispublic-label"><%= l(:field_is_public) %>:</span>
|
<span class="ispublic-label"><%= l(:field_is_public) %>:</span>
|
||||||
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %>
|
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %>
|
||||||
<%= if attachment.id.nil?
|
<%= if attachment.id.nil?
|
||||||
#待补充代码
|
#待补充代码
|
||||||
else
|
else
|
||||||
link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
|
link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
|
||||||
end
|
end
|
||||||
%>
|
%>
|
||||||
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
|
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
|
||||||
|
|
||||||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||||
</span>
|
</span>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<span class="add_attachment" style="font-weight:normal;">
|
<span class="add_attachment" style="font-weight:normal;">
|
||||||
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
|
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
|
||||||
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
|
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
|
||||||
<%#= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file').click();",:onmouseover => 'this.focus()',:class => 'sub_btn' %>
|
<%#= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file').click();",:onmouseover => 'this.focus()',:class => 'sub_btn' %>
|
||||||
<a href="javascript:void(0);" onclick="_file.click();" class="AnnexBtn fl mr15">上传附件</a>
|
<a href="javascript:void(0);" onclick="_file.click();" class="AnnexBtn fl mr15">上传附件</a>
|
||||||
<%= file_field_tag 'attachments[dummy][file]',
|
<%= file_field_tag 'attachments[dummy][file]',
|
||||||
:id => '_file',
|
:id => '_file',
|
||||||
:class => 'file_selector',
|
:class => 'file_selector',
|
||||||
:multiple => true,
|
:multiple => true,
|
||||||
:onchange => 'addInputFiles(this);',
|
:onchange => 'addInputFiles(this);',
|
||||||
:style => ie8? ? '' : 'display:none',
|
:style => ie8? ? '' : 'display:none',
|
||||||
:data => {
|
:data => {
|
||||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||||
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||||
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||||
:upload_path => uploads_path(:format => 'js'),
|
:upload_path => uploads_path(:format => 'js'),
|
||||||
:description_placeholder => l(:label_optional_description),
|
:description_placeholder => l(:label_optional_description),
|
||||||
:field_is_public => l(:field_is_public),
|
:field_is_public => l(:field_is_public),
|
||||||
:are_you_sure => l(:text_are_you_sure),
|
:are_you_sure => l(:text_are_you_sure),
|
||||||
:file_count => l(:label_file_count),
|
:file_count => l(:label_file_count),
|
||||||
:lebel_file_uploding => l(:lebel_file_uploding),
|
:lebel_file_uploding => l(:lebel_file_uploding),
|
||||||
:delete_all_files => l(:text_are_you_sure_all)
|
:delete_all_files => l(:text_are_you_sure_all)
|
||||||
} %>
|
} %>
|
||||||
<span id="upload_file_count">
|
<span id="upload_file_count">
|
||||||
<%= l(:label_no_file_uploaded) %>
|
<%= l(:label_no_file_uploaded) %>
|
||||||
</span>
|
</span>
|
||||||
(<%= l(:label_max_size) %>:
|
(<%= l(:label_max_size) %>:
|
||||||
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<% content_for :header_tags do %>
|
<% content_for :header_tags do %>
|
||||||
<%= javascript_include_tag 'attachments' %>
|
<%= javascript_include_tag 'attachments' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -45,10 +45,14 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
|
||||||
<p id="homework_course_id_span" class="c_red mt5"></p>
|
<p id="homework_course_id_span" class="c_red mt5"></p>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
<div class="mt10">
|
||||||
|
<div class="fl" id="topic_attachments">
|
||||||
|
<%= render :partial => 'org_document_comments/attachment', :locals => {:container => nil} %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
<div class="mt5">
|
<div class="mt5">
|
||||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="create_org_document();">确定</a>
|
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="create_org_document();">确定</a>
|
||||||
<span class="fr mr10 mt3">或</span>
|
<span class="fr mr10 mt3">或</span>
|
||||||
|
|
|
@ -16,10 +16,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostTitle break_word">
|
<div class="homepagePostTitle break_word">
|
||||||
<% if activity.parent_id.nil? %>
|
<% if activity.parent_id.nil? %>
|
||||||
<%= link_to activity.subject.to_s.html_safe, project_boards_path(activity.project,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey"
|
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey"
|
||||||
%>
|
%>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to activity.parent.subject.to_s.html_safe, project_boards_path(activity.project,:parent_id =>activity.parent_id, :topic_id => activity.id), :class=> "postGrey"
|
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey"
|
||||||
%>
|
%>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue