commit
347efa275d
@ -1,3 +1,14 @@
|
|||||||
class AttachmentHistory < ActiveRecord::Base
|
class AttachmentHistory < ActiveRecord::Base
|
||||||
belongs_to :attachment,foreign_key: 'attachment_id'
|
belongs_to :attachment,foreign_key: 'attachment_id'
|
||||||
|
cattr_accessor :storage_history_path
|
||||||
|
@@storage_history_path = Redmine::Configuration['attachments_storage_path'] || File.join(Rails.root, "files")
|
||||||
|
|
||||||
|
# Returns file's location on disk
|
||||||
|
def diskfile_history
|
||||||
|
File.join(self.class.storage_history_path, disk_directory.to_s, disk_filename.to_s)
|
||||||
|
end
|
||||||
|
|
||||||
|
def increment_download
|
||||||
|
increment!(:downloads)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
class Secdomain < ActiveRecord::Base
|
||||||
|
attr_accessible :pid, :subname, :sub_type, :desc
|
||||||
|
|
||||||
|
validates_presence_of :subname, :sub_type
|
||||||
|
validates_uniqueness_of :subname
|
||||||
|
|
||||||
|
def controller
|
||||||
|
return 'organizations' if sub_type == 2
|
||||||
|
return 'users' if sub_type == 3
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
|
||||||
|
def action
|
||||||
|
return 'show' if sub_type == 2
|
||||||
|
return 'show' if sub_type == 3
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
end
|
@ -1,54 +1,57 @@
|
|||||||
<!--<div class="resourceUploadPopup">-->
|
<!--<div class="resourceUploadPopup">-->
|
||||||
<span class="uploadDialogText">更新资源版本</span>
|
<span class="uploadDialogText">更新资源版本</span>
|
||||||
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
|
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>-->
|
||||||
<div class="uploadBoxContainer mt0">
|
<div class="uploadBoxContainer mt0">
|
||||||
<div>
|
<div>
|
||||||
<div>当前版本
|
<div>当前版本
|
||||||
<span class="attachment" >
|
<span class="attachment" >
|
||||||
<input readonly="readonly" name="attachments[1][filename]" value="<%=@attachment.filename%>" class="upload_filename readonly" type="text">
|
<input readonly="readonly" name="attachments[1][filename]" value="<%=@attachment.filename%>" class="upload_filename readonly" type="text">
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<% unless @attachment_histories.empty? %>
|
<% unless @attachment_histories.empty? %>
|
||||||
|
|
||||||
<div >历史版本</div>
|
<div >历史版本</div>
|
||||||
<div style="max-height: 95px;overflow-y:auto; background-color: #e3e3e3;" class="mb10 p10">
|
<div style="max-height: 95px;overflow-y:auto; background-color: #e3e3e3;" class="mb10 p10">
|
||||||
<% @attachment_histories.each do |history| %>
|
<% @attachment_histories.each do |history| %>
|
||||||
<span class="attachment">
|
<span class="attachment">
|
||||||
<input readonly="readonly" name="attachments_versions_<%= history.id%>" value="<%=history.filename%>" class="upload_filename readonly" type="text">
|
<%= link_to truncate(history.filename,length: 35, omission: '...'),
|
||||||
<span>版本号:<%= history.version %></span>
|
download_history_attachment_path(history.id, history.filename),
|
||||||
</span>
|
:title => history.filename+"\n"+history.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis; max-width:300px;",:class => "linkBlue f_14 f_b link_file_a2 fl" %>
|
||||||
|
<span class="fr">版本号:<%= history.version %></span>
|
||||||
<% end %>
|
<div class="cl"></div>
|
||||||
</div>
|
</span>
|
||||||
<% end %>
|
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<%= form_tag(upload_attachment_version_path, :multipart => true,:remote => !ie8?,:name=>"upload_form",:id=>'upload_form') do %>
|
<% end %>
|
||||||
<%= hidden_field_tag :old_attachment_id,@attachment.id %>
|
|
||||||
<div>
|
</div>
|
||||||
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
|
<%= form_tag(upload_attachment_version_path, :multipart => true,:remote => !ie8?,:name=>"upload_form",:id=>'upload_form') do %>
|
||||||
</span>
|
<%= hidden_field_tag :old_attachment_id,@attachment.id %>
|
||||||
</div>
|
<div>
|
||||||
<div class="uploadBox">
|
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
|
||||||
<input type="hidden" name="attachment_type" value="1">
|
</span>
|
||||||
<%= render :partial => 'attachments/upload_attachment_new_version' %>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="uploadBox">
|
||||||
<!--<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%#= l(:button_cancel)%></a>-->
|
<input type="hidden" name="attachment_type" value="1">
|
||||||
<!--<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%#= l(:button_confirm)%></a>-->
|
<%= render :partial => 'attachments/upload_attachment_new_version' %>
|
||||||
</div>
|
<div class="cl"></div>
|
||||||
<div class="uploadResourceIntr">
|
<!--<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%#= l(:button_cancel)%></a>-->
|
||||||
<div class="uploadResourceName fl"><span id="upload_file_count">(未选择文件)</span></div>
|
<!--<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%#= l(:button_confirm)%></a>-->
|
||||||
<div class="uploadResourceIntr2 fl">您可以上传小于<span class="c_red">50MB</span>的文件</div>
|
</div>
|
||||||
</div>
|
<div class="uploadResourceIntr">
|
||||||
</div>
|
<div class="uploadResourceName fl"><span id="upload_file_count">(未选择文件)</span></div>
|
||||||
<div class="cl"></div>
|
<div class="uploadResourceIntr2 fl">您可以上传小于<span class="c_red">50MB</span>的文件</div>
|
||||||
<div style="margin-top: 10px" >
|
</div>
|
||||||
<div class="courseSendSubmit">
|
</div>
|
||||||
<!--<a href="javascript:void(0);" class="sendSourceText" onclick="">确定</a>-->
|
<div class="cl"></div>
|
||||||
<%= submit_tag '确定',:onclick=>'upload_attachment_version(event);',:onfocus=>'this.blur()',:id=>'upload_files_submit_btn',:class=>'sendSourceText' %>
|
<div style="margin-top: 10px" >
|
||||||
</div>
|
<div class="courseSendSubmit">
|
||||||
<div class="courseSendCancel"><a href="javascript:void(0);" id="upload_files_cancle_btn" class="sendSourceText" onclick="hideModal();">取消</a></div>
|
<!--<a href="javascript:void(0);" class="sendSourceText" onclick="">确定</a>-->
|
||||||
</div>
|
<%= submit_tag '确定',:onclick=>'upload_attachment_version(event);',:onfocus=>'this.blur()',:id=>'upload_files_submit_btn',:class=>'sendSourceText' %>
|
||||||
<% end %>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="courseSendCancel"><a href="javascript:void(0);" id="upload_files_cancle_btn" class="sendSourceText" onclick="hideModal();">取消</a></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
<!--</div>-->
|
<!--</div>-->
|
@ -0,0 +1,55 @@
|
|||||||
|
<script src="/javascripts/i18n/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
|
||||||
|
<span class="uploadText mb10" style="margin-top: -20px;">发布设置</span>
|
||||||
|
<!--<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose"></a></div>-->
|
||||||
|
<%= form_tag(republish_file_course_file_path(@course,@file), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
|
||||||
|
<div class="mb10">
|
||||||
|
<label class="fl c_dark f14" style="margin-top: 4px;">延迟发布:</label>
|
||||||
|
<div class="calendar_div fl">
|
||||||
|
<input type="text" name="publish_time" id="attachment_publish_time" placeholder="发布日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%=@file.publish_time %>">
|
||||||
|
<%#= calendar_for('attachment_publish_time')%>
|
||||||
|
</div>
|
||||||
|
<span class="fl c_red" style="margin-top: 4px;" id="publish_time_notice"></span>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<!--<div class="mt15"> <span class="f14 fontGrey3 mr10">延迟发布:</span>
|
||||||
|
<input type="text" name="" placeholder="请输入0-50数值" class="markInput" />
|
||||||
|
</div>-->
|
||||||
|
<div>
|
||||||
|
<div class="courseSendSubmit"><a href="javascript:void(0);" onclick="submit_republish_file()" class="sendSourceText" id="submit_file">确定</a></div>
|
||||||
|
<div class="courseSendCancel"><a href="javascript:void(0);" onclick="hideModal()" class="sendSourceText linkGrey6">取消</a></div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<script>
|
||||||
|
function regex_publish_time()
|
||||||
|
{
|
||||||
|
var myDate = new Date();
|
||||||
|
if($.trim($("#attachment_publish_time").val()) == "")
|
||||||
|
{
|
||||||
|
$("#publish_time_notice").text("发布日期不能为空");
|
||||||
|
return false;
|
||||||
|
} else{
|
||||||
|
var publish_time = Date.parse($("#attachment_publish_time").val());
|
||||||
|
if(Date.parse(formate_date(myDate)) > publish_time)
|
||||||
|
{
|
||||||
|
$("#publish_time_notice").text("发布日期不能小于当前日期");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$("#publish_time_notice").text("");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function submit_republish_file()
|
||||||
|
{
|
||||||
|
if(regex_publish_time()) {
|
||||||
|
$('#submit_file').parent().parent().submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$(function(){
|
||||||
|
var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: 0, showOn: 'button', buttonImageOnly: true, buttonImage: '/images/public_icon.png', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true};
|
||||||
|
$('#attachment_publish_time').datepicker(datepickerOptions);
|
||||||
|
});
|
||||||
|
</script>
|
@ -0,0 +1,77 @@
|
|||||||
|
<% delete_allowed = User.current.allowed_to?(:manage_files, @course) %>
|
||||||
|
<div class="resources mt10"><!--资源库内容开始--->
|
||||||
|
<div class="homepagePostBrief">
|
||||||
|
<div class="homepagePostPortrait">
|
||||||
|
<%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostDes">
|
||||||
|
<div class="homepagePostTitle break_word mt-4">
|
||||||
|
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
||||||
|
download_named_attachment_path(file.id, file.filename),
|
||||||
|
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkBlue f_14 f_b" %>
|
||||||
|
<%= file_preview_eye(file, class: 'preview') %>
|
||||||
|
<span id="image_private_<%= file.id%>">
|
||||||
|
<% if file.is_public? == false%>
|
||||||
|
<span class="img_private ml5">私有</span>
|
||||||
|
<%end %>
|
||||||
|
</span>
|
||||||
|
<% if file.is_publish == 0 %>
|
||||||
|
<span class="grey_homework_btn_cir ml5"><%=file.publish_time %> 0点发布</span>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div class="mt5">
|
||||||
|
<span class="fontGrey2 mr15 fl">上传时间:<%= format_time(file.created_on)%></span>
|
||||||
|
<% if file.tag_list.length > 0%>
|
||||||
|
<span class="fontGrey2 fl mr15">上传类型:<%= file.tag_list[0] %></span>
|
||||||
|
<% end %>
|
||||||
|
<p class="f_l mb5 fontGrey2">文件大小:<%= number_to_human_size(file.filesize) %></p>
|
||||||
|
<p class="fl ml15 fontGrey2">下载<%= file.downloads%> | 引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<div class="tag_h">
|
||||||
|
<!-- container_type = 1 代表是课程里的资源 -->
|
||||||
|
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
|
||||||
|
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
|
||||||
|
</div>
|
||||||
|
<div class="homepagePostSetting">
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li class="homepagePostSettingIcon">
|
||||||
|
<% if User.current.logged? %>
|
||||||
|
|
||||||
|
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
|
||||||
|
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" %>
|
||||||
|
<ul class="homepagePostSettiongText">
|
||||||
|
|
||||||
|
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
|
||||||
|
<li><%= link_to '延期发布',file_hidden_course_file_path(@course,file),:class => "postOptionLink",:remote=>true %></li>
|
||||||
|
<li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li>
|
||||||
|
<% if @course.is_public? %>
|
||||||
|
<li>
|
||||||
|
<span id="is_public_<%= file.id %>">
|
||||||
|
<%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"postOptionLink",:method => :post %>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
<%end%>
|
||||||
|
<li>
|
||||||
|
<%= link_to( '删除资源', attachment_path(file),
|
||||||
|
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "postOptionLink") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" && file.destroyable %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
<%else%>
|
||||||
|
<ul class="resourceSendO">
|
||||||
|
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
|
||||||
|
</ul>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,6 @@
|
|||||||
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/hidden_file',:locals => {:course => @course,:course_attachment_type => 1}) %>');
|
||||||
|
showModal('ajax-modal', '311px');
|
||||||
|
$('#ajax-modal').siblings().remove();
|
||||||
|
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 280px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||||
|
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
|
||||||
|
$('#ajax-modal').parent().addClass("popbox_polls");
|
@ -0,0 +1,2 @@
|
|||||||
|
hideModal();
|
||||||
|
$("#resource_detail_<%=@file.id %>").html("<%= escape_javascript(render :partial=>'files/resource_detail',:locals => {:file => @file}) %>")
|
@ -1,2 +1,3 @@
|
|||||||
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'org_subfield_list',
|
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'org_subfield_list',
|
||||||
:locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach})%>");
|
:locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach})%>");
|
||||||
|
$("#attachment_count").html("<%= @result.count %>");
|
@ -1,8 +1,8 @@
|
|||||||
clickCanel();
|
clickCanel();
|
||||||
<% if @user_activity_id != -1 %>
|
<% if @user_activity_id != -1 %>
|
||||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@courae_activity}) %>");
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@courae_activity}) %>");
|
||||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
|
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity");
|
||||||
<% else %>
|
<% else %>
|
||||||
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework,:is_in_course => @is_in_course}) %>");
|
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework,:is_in_course => @is_in_course}) %>");
|
||||||
init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
|
sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>");
|
||||||
<% end %>
|
<% end %>
|
@ -1,3 +1,3 @@
|
|||||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>");
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>");
|
||||||
|
|
||||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
|
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity");
|
@ -1,3 +1,3 @@
|
|||||||
$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
|
$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
|
||||||
$(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue).journals.count %>)')
|
$(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue).journals.count %>)')
|
||||||
sd_create_editor_from_data(<%= @issue.id%>, null, "100%");
|
sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%=@issue.class.name%>");
|
@ -1,3 +1,3 @@
|
|||||||
$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
|
$("#reply_div_<%= @issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
|
||||||
$(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>)')
|
$(".homepagePostReplyBannerCount").html('回复(<%= @issue.journals.count %>)')
|
||||||
sd_create_editor_from_data(<%= @issue.id%>, null, "100%");
|
sd_create_editor_from_data(<%= @issue.id%>, null, "100%","<%=@issue.class.name%>");
|
@ -1,2 +1,2 @@
|
|||||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
||||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
|
sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity");
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => params[:flag], :act => @act}) %>");
|
$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => params[:flag], :act => @act}) %>");
|
||||||
init_activity_KindEditor_data(<%= @act.id %>,"","87%", "<%=@act.class.to_s%>");
|
sd_create_editor_from_data(<%= @act.id %>,"","100%", "<%=@act.class.to_s%>");
|
||||||
|
@ -1,72 +1,78 @@
|
|||||||
<div class="resources mt10">
|
<div class="resources mt10">
|
||||||
<div class="homepagePostBrief">
|
<div class="homepagePostBrief">
|
||||||
|
|
||||||
<div class="homepagePostDes" style="width:690px;">
|
<div class="homepagePostDes" style="width:690px;">
|
||||||
<div class="homepagePostTitle postGrey"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></div>
|
<div class="homepagePostTitle postGrey"><%= link_to document.title, org_document_comment_path(:id => document.id, :organization_id => document.organization.id) %></div>
|
||||||
<% unless document.content.blank? %>
|
<% unless document.content.blank? %>
|
||||||
<div class="homepagePostIntro" id="intro_content_<%= document.id%>">
|
<div class="homepagePostIntro" id="intro_content_<%= document.id%>">
|
||||||
<%= document.content.html_safe %>
|
<%= document.content.html_safe %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if params[:show_homepage].nil? %>
|
<% if params[:show_homepage].nil? %>
|
||||||
<div class="homepagePostDate" style="float:right;">
|
<div class="homepagePostDate" style="float:right;">
|
||||||
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
|
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="homepagePostDate" style="float:right;">
|
<div class="homepagePostDate" style="float:right;">
|
||||||
最后编辑:<%= User.find(EditorOfDocument.where("org_document_comment_id =?", document.id).order("created_at desc").first.editor_id).realname %>
|
最后编辑:<%= User.find(EditorOfDocument.where("org_document_comment_id =?", document.id).order("created_at desc").first.editor_id).realname %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<!-- <%# if defined?(home_id) %>
|
<div class="cl"></div>
|
||||||
<div style="float:right;">最后编辑:<%#= User.find() %></div>
|
<!-- <%# if defined?(home_id) %>
|
||||||
<%# end %>-->
|
<div style="float:right;">最后编辑:<%#= User.find() %></div>
|
||||||
<% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id)) || User.current.id == document.creator_id %>
|
<%# end %>-->
|
||||||
<div class="homepagePostSetting">
|
<% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id)) || User.current.id == document.creator_id %>
|
||||||
<ul>
|
<div class="homepagePostSetting">
|
||||||
<li class="homepagePostSettingIcon">
|
<ul>
|
||||||
<ul class="homepagePostSettiongText">
|
<li class="homepagePostSettingIcon">
|
||||||
<li>
|
<ul class="homepagePostSettiongText">
|
||||||
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'cancel_homepage', :id => document.organization_id, :home_id => document.id}, :method => "put", :remote => true) do |f| %>
|
<li>
|
||||||
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">取消首页</a>
|
<%= 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 %>
|
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">取消首页</a>
|
||||||
</li>
|
<% end %>
|
||||||
<li>
|
</li>
|
||||||
<%= link_to "编辑首页", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id, :flag => 2), :class => "postOptionLink" %>
|
<li>
|
||||||
</li>
|
<%= link_to "编辑首页", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id, :flag => 2), :class => "postOptionLink" %>
|
||||||
<li>
|
</li>
|
||||||
<%= link_to "删除首页", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',
|
<li>
|
||||||
:data => {:confirm => l(:text_are_you_sure)},
|
<%= link_to "删除首页", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',
|
||||||
:remote => true, :class => 'postOptionLink' %>
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
</li>
|
:remote => true, :class => 'postOptionLink' %>
|
||||||
</ul>
|
</li>
|
||||||
</li>
|
</ul>
|
||||||
</ul>
|
</li>
|
||||||
</div>
|
</ul>
|
||||||
<div class="cl"></div>
|
</div>
|
||||||
<% end %>
|
<div class="cl"></div>
|
||||||
</div>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
|
||||||
|
</div>
|
||||||
<script type="text/javascript">
|
|
||||||
var postContent = $("#intro_content_<%= document.id%>").html();
|
<script type="text/javascript">
|
||||||
postContent = postContent.replace(/ /g," ");
|
$("#intro_content_<%= document.id%> p,#intro_content_<%= document.id%> span,#intro_content_<%= document.id%> em").each(function(){
|
||||||
$("#intro_content_<%= document.id%>").html(postContent);
|
var postContent = $(this).html();
|
||||||
function expand_reply(container, btnid) {
|
postContent = postContent.replace(/ /g," ");
|
||||||
var target = $(container);
|
postContent= postContent.replace(/ {2}/g," ");
|
||||||
var btn = $(btnid);
|
postContent=postContent.replace(/ /g," ");
|
||||||
if (btn.data('init') == '0') {
|
postContent=postContent.replace(/ /g," ");
|
||||||
btn.data('init', 1);
|
$(this).html(postContent);
|
||||||
btn.html('收起回复');
|
});
|
||||||
target.show();
|
function expand_reply(container, btnid) {
|
||||||
} else {
|
var target = $(container);
|
||||||
btn.data('init', 0);
|
var btn = $(btnid);
|
||||||
btn.html('展开更多');
|
if (btn.data('init') == '0') {
|
||||||
target.hide();
|
btn.data('init', 1);
|
||||||
target.eq(0).show();
|
btn.html('收起回复');
|
||||||
target.eq(1).show();
|
target.show();
|
||||||
target.eq(2).show();
|
} else {
|
||||||
}
|
btn.data('init', 0);
|
||||||
}
|
btn.html('展开更多');
|
||||||
|
target.hide();
|
||||||
|
target.eq(0).show();
|
||||||
|
target.eq(1).show();
|
||||||
|
target.eq(2).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue