Conflicts: app/controllers/organizations_controller.rb app/helpers/organizations_helper.rb db/schema.rb public/images/homepage_icon.png public/stylesheets/new_user.csschenlw_dev
@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the sub_document_comments controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the sub_domains controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
@ -0,0 +1,63 @@
|
||||
class SubDomainsController < ApplicationController
|
||||
layout 'base_org'
|
||||
before_filter :find_org_subfield_and_subdomain, :only => [:show, :index, :domain_update_priority, :destroy, :update, :hide_sub_domain, :show_sub_domain]
|
||||
|
||||
def new
|
||||
@subdomain = SubDomain.new
|
||||
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||
@organization = @org_subfield.organization
|
||||
end
|
||||
|
||||
def create
|
||||
if SubDomain.where("org_subfield_id=#{params[:org_subfield_id]} and name=?",params[:name]).count == 0
|
||||
@res = true
|
||||
@subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||
@organization = @subfield.organization
|
||||
@subdomain = SubDomain.create(:name => params[:name], :org_subfield_id => params[:org_subfield_id], :priority => @subfield.sub_domains.blank? ? 1 : @subfield.sub_domains.order("priority").last.priority + 1)
|
||||
@subdomain.update_column(:field_type, params[:field_type])
|
||||
else
|
||||
@res = false
|
||||
end
|
||||
end
|
||||
|
||||
def update
|
||||
@subdomain.update_column(:name, params[:name])
|
||||
end
|
||||
|
||||
def domain_update_priority
|
||||
@subdomain.update_attribute(:priority, params[:priority].to_i)
|
||||
end
|
||||
|
||||
def destroy
|
||||
@subdomain.destroy
|
||||
end
|
||||
|
||||
def show
|
||||
render_404
|
||||
# @subfield_content = @organization.org_subfields.order("priority")
|
||||
# render layout: @organization.switch_type ? 'base_sub_domain' : 'base_org'
|
||||
end
|
||||
|
||||
def index
|
||||
|
||||
end
|
||||
|
||||
def hide_sub_domain
|
||||
@subdomain.update_attribute(:hide, 1)
|
||||
end
|
||||
|
||||
def show_sub_domain
|
||||
@subdomain.update_attribute(:hide, 0)
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
def find_org_subfield_and_subdomain
|
||||
@subfield = OrgSubfield.find(params[:org_subfield_id])
|
||||
@subdomain = SubDomain.find(params[:id])
|
||||
@organization = @subfield.organization
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
# source_subdomain not found
|
||||
render_404
|
||||
end
|
||||
end
|
@ -0,0 +1,2 @@
|
||||
module SubDocumentCommentsHelper
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
module SubDomainsHelper
|
||||
include OrganizationsHelper
|
||||
|
||||
|
||||
end
|
@ -0,0 +1,32 @@
|
||||
class SubDocumentComment < ActiveRecord::Base
|
||||
attr_accessible :content, :creator_id, :locked, :org_subfield_id, :parent_id, :reply_id, :sticky, :sub_domain_id, :title
|
||||
|
||||
include Redmine::SafeAttributes
|
||||
include ApplicationHelper
|
||||
belongs_to :sub_domain
|
||||
belongs_to :creator, :class_name => 'User', :foreign_key => 'creator_id'
|
||||
acts_as_tree :order => "#{SubDocumentComment.table_name}.sticky asc, #{SubDocumentComment.table_name}.created_at desc"
|
||||
acts_as_attachable
|
||||
has_many :org_acts, :class_name => 'OrgActivity',:as =>:org_act ,:dependent => :destroy
|
||||
after_create :document_save_as_sub_activity
|
||||
after_update :update_activity
|
||||
|
||||
#动态的更新
|
||||
private
|
||||
def update_activity
|
||||
org_activity = OrgActivity.where("org_act_type='SubDocumentComment' and org_act_id =?", id).first
|
||||
if org_activity
|
||||
org_activity.updated_at = Time.now
|
||||
org_activity.save
|
||||
end
|
||||
end
|
||||
|
||||
def document_save_as_sub_activity
|
||||
if(self.parent().nil?)
|
||||
self.org_acts << OrgActivity.new(:user_id => User.current.id, :container_id => self.sub_domain.id, :container_type => 'SubDomain')
|
||||
else
|
||||
act = OrgActivity.where("org_act_type='SubDocumentComment' and org_act_id =?", self.root.id).first
|
||||
act.update_attributes(:updated_at => self.updated_at)
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class SubDomain < ActiveRecord::Base
|
||||
attr_accessible :field_type, :hide, :name, :org_subfield_id, :priority, :status
|
||||
belongs_to :org_subfield, :foreign_key => :org_subfield_id
|
||||
has_many :sub_document_comments
|
||||
end
|
@ -0,0 +1,11 @@
|
||||
<% subdomains.each do |subdomain|%>
|
||||
<li class="homepageLeftMenuCoursesLine" style="display:<%= subdomain.hide.to_i == 0?'block':'none' %>;position:relative;" id="sub_domain_hide_<%= subdomain.id %>">
|
||||
<%= link_to subdomain.name, org_subfield_sub_domain_sub_document_comments_path(subdomain, :org_subfield_id => org_subfield_id), :class => "coursesLineGrey hidden", :title => subdomain.name %>
|
||||
</li>
|
||||
<% end %>
|
||||
<%# if subdomains.size == 5 %>
|
||||
<!--<li class="homepageLeftMenuMore" id="show_more_org_project">-->
|
||||
<!--<input type="hidden" value="<%#= page %>" id="org_project_page_num">-->
|
||||
<!--<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_org_project('<%#= more_org_projects_organization_path(org_id) %>');"></a>-->
|
||||
<!--</li>-->
|
||||
<%# end%>
|
@ -0,0 +1,19 @@
|
||||
<div class="sn-index-leftbox" style="display:<%= field.hide == 0?'block':'none' %>;">
|
||||
<h2 class="h2-title">示例:合作伙伴<a href="javascript:void(0);" target="_blank" class="more">更多</a></h2>
|
||||
<div class="sn-index-partnerbox " >
|
||||
<ul id="scrollPic" >
|
||||
<div style="width: 760px;">
|
||||
<li class="fl"><a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="/images/default_blank/left-05.jpg" width="368" height="43" alt="" /></a></li>
|
||||
<li class="fl"><a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="/images/default_blank/left-05.jpg" width="368" height="43" alt="" /></a></li>
|
||||
<li class="fl"><a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="/images/default_blank/left-05.jpg" width="368" height="43" alt="" /></a></li>
|
||||
<li class="fl"><a href="javascript:void(0);" target="_blank" class="partnerimg"><img src="/images/default_blank/left-05.jpg" width="368" height="43" alt="" /></a></li>
|
||||
</div>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<div class="partner-btnbox">
|
||||
<div class="partner-prev partner-btn fl " id="LeftArr"><</div>
|
||||
<div class="partner-next partner-btn fl" id="RightArr">></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1,26 +1,38 @@
|
||||
<div class="sn-news-smallbox fl">
|
||||
<div class="sn-news-small mb18">
|
||||
<a href="javascript:void()" target="_blank" class="sn-news-smallimg fl"><img src="/images/news/img-news-small01.jpg" width="85" height="85" alt=""/></a>
|
||||
<h4><a href="javascript:void()" target="_blank" class="h4-title fl mt10">北斗开放实验室迎湖南省省直机关领导调研参观</a></h4>
|
||||
<span class="txt-grey fl">2016-04-08</span>
|
||||
<a href="javascript:void(0);" target="_blank" class="sn-news-smallimg fl"><img src="/images/default_blank/left-03.jpg" width="85" height="85" alt=""/></a>
|
||||
<h4><div class="sn-title-wrap"><a href="javascript:void(0);" target="_blank" class="h4-title fl mt10">帖子标题</a><span class="title-ellipsis"></span></div></h4>
|
||||
<span class="txt-grey fl">时间</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="sn-news-small mb18">
|
||||
<a href="javascript:void()" target="_blank" class="sn-news-smallimg fl"><img src="/images/news/img-news-small02.jpg" width="85" height="85" alt=""/></a>
|
||||
<h4><a href="javascript:void()" target="_blank" class="h4-title fl mt10">北斗开放实验室迎湖南省省直机关领导调研参观</a></h4>
|
||||
<span class="txt-grey fl">2016-04-08</span>
|
||||
<a href="javascript:void(0);" target="_blank" class="sn-news-smallimg fl"><img src="/images/default_blank/left-03.jpg" width="85" height="85" alt=""/></a>
|
||||
<h4><div class="sn-title-wrap"><a href="javascript:void(0);" target="_blank" class="h4-title fl mt10">帖子标题</a><span class="title-ellipsis"></span></div></h4>
|
||||
<span class="txt-grey fl">时间</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="sn-news-small mb18">
|
||||
<a href="javascript:void()" target="_blank" class="sn-news-smallimg fl"><img src="/images/news/img-news-small03.jpg" width="85" height="85" alt=""/></a>
|
||||
<h4><a href="javascript:void()" target="_blank" class="h4-title fl mt10">北斗开放实验室迎湖南省省直机关领导调研参观</a></h4>
|
||||
<span class="txt-grey fl">2016-04-08</span>
|
||||
<a href="javascript:void(0);" target="_blank" class="sn-news-smallimg fl"><img src="/images/default_blank/left-03.jpg" width="85" height="85" alt=""/></a>
|
||||
<h4><div class="sn-title-wrap"><a href="javascript:void(0);" target="_blank" class="h4-title fl mt10">帖子标题</a><span class="title-ellipsis"></span></div></h4>
|
||||
<span class="txt-grey fl">时间</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="sn-news-small ">
|
||||
<a href="javascript:void()" target="_blank" class="sn-news-smallimg fl"><img src="/images/news/img-news-small04.jpg" width="85" height="85" alt=""/></a>
|
||||
<h4><a href="javascript:void()" target="_blank" class="h4-title fl mt10">北斗开放实验室迎湖南省省直机关领导调研参观</a></h4>
|
||||
<span class="txt-grey fl">2016-04-08</span>
|
||||
<a href="javascript:void(0);" target="_blank" class="sn-news-smallimg fl"><img src="/images/default_blank/left-03.jpg" width="85" height="85" alt=""/></a>
|
||||
<h4><div class="sn-title-wrap"><a href="javascript:void(0);" target="_blank" class="h4-title fl mt10">帖子标题</a><span class="title-ellipsis"></span></div></h4>
|
||||
<span class="txt-grey fl">时间</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".h4-title").each(function(){
|
||||
var titleHeight = $(this).height();
|
||||
if (titleHeight > 52){
|
||||
$(this).next().show();
|
||||
}
|
||||
else {
|
||||
$(this).next().hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
@ -1,11 +1,11 @@
|
||||
<div class="sn-index-resourcesbox">
|
||||
<a href="javascript:void()" target="_blank" class="sn-resourcesimg"><img src="/images/default_blank/files-default.jpg" width="185" height="125" alt=""/></a>
|
||||
<h3><a href="javascript:void()" target="_blank" class="resources-title">仪器资源</a></h3>
|
||||
<div class="resources-tagbox">
|
||||
<a href="javascript:void()" target="_blank" class="resources-tag">测试服务</a>
|
||||
<a href="javascript:void()" target="_blank" class="resources-tag">开放日</a>
|
||||
<a href="javascript:void()" target="_blank" class="resources-tag">仪器共享</a>
|
||||
<a href="javascript:void()" target="_blank" class="resources-tag">定制测试</a>
|
||||
</div>
|
||||
<a href="javascript:void()" target="_blank" class="more-btn">更多</a>
|
||||
<a href="javascript:void(0);" target="_blank" class="sn-resourcesimg"><img src="/images/default_blank/left-04.jpg" width="185" height="125" alt=""/></a>
|
||||
<!--<h3><a href="javascript:void(0);" target="_blank" class="resources-title sn-hidden">仪器资源</a></h3>-->
|
||||
<!--<div class="resources-tagbox">-->
|
||||
<!--<a href="javascript:void(0);" target="_blank" class="resources-tag">测试服务</a>-->
|
||||
<!--<a href="javascript:void(0);" target="_blank" class="resources-tag">开放日</a>-->
|
||||
<!--<a href="javascript:void(0);" target="_blank" class="resources-tag">仪器共享</a>-->
|
||||
<!--<a href="javascript:void(0);" target="_blank" class="resources-tag">定制测试</a>-->
|
||||
<!--</div>-->
|
||||
<!--<a href="javascript:void(0);" target="_blank" class="more-btn">更多</a>-->
|
||||
</div>
|
@ -0,0 +1,5 @@
|
||||
<div class="sn-index-active">
|
||||
<a href="javascript:void()" target="_blank" class="sn-activeimg"><img src="/images/default_blank/right-01.jpg" width="330" height="210" alt=""/></a>
|
||||
<h3><a href="javascript:void()" target="_blank" class="active-title">北斗第二次工作会议在北京召议在北京召开议在北京召开开</a></h3>
|
||||
<span class="txt-grey ">2016-04-08</span>
|
||||
</div>
|
@ -0,0 +1,84 @@
|
||||
<% sub_domains = field.sub_domains %>
|
||||
<% if sub_domains %>
|
||||
<% sub_domains.each do |subdomain| %>
|
||||
<ul class="orgSubList">
|
||||
<li class="orgSubTree"></li>
|
||||
<li class="orgSubNum ml5 mr5">
|
||||
<div id="show_domain_priority_<%= subdomain.id %>" ondblclick="edit_priority('#show_domain_priority_<%= subdomain.id %>','#edit_domain_priority_<%= subdomain.id %>');" class="subNumBlock" title="双击可编辑">
|
||||
<%= subdomain.priority %>
|
||||
</div>
|
||||
<div id="edit_domain_priority_<%= subdomain.id %>" style="display:none; width:30px;">
|
||||
<input type="text" onblur="domain_update_priority('#show_domain_priority_<%= subdomain.id %>','#edit_domain_priority_<%= subdomain.id %>','<%= subdomain.org_subfield.id %>','<%= subdomain.id %>',$(this).val());" style="width:20px;" value="<%= subdomain.priority %>"/>
|
||||
</div>
|
||||
</li>
|
||||
<li class="orgSubColumn">
|
||||
<div id="subsubdomain_show_<%= subdomain.id %>" class="subColumnControl"><%= subdomain.name %></div>
|
||||
<div id="subsubdomain_edit_<%= subdomain.id %>" style="display:none;">
|
||||
<input type="text" name="name" onblur="update_subfield_subdomain('#subsubdomain_show_<%= subdomain.id %>','#subsubdomain_edit_<%= subdomain.id %>','<%= subdomain.org_subfield.id %>','<%= subdomain.id %>',$(this).val());" value="<%= subdomain.name %>" style="width:70px;"/>
|
||||
</div>
|
||||
</li>
|
||||
<li class="orgSubStatus">新增</li>
|
||||
<li class="orgSubOrder">
|
||||
默认
|
||||
</li>
|
||||
<li class="orgSubType"><%= subdomain.field_type == "Post" ? "帖子" : "资源" %></li>
|
||||
<li class="orgListCatalog hidden"> -- </li>
|
||||
<%#= link_to "隐藏", hide_org_subsubdomain_organizations_path(subdomain), :method => 'post', :remote => true, :id => "hide_#{subdomain.id}", :class => "linkBlue fr mr5" %>
|
||||
<li class="orgSubOperation">
|
||||
<a href="javascript:void(0);" class="linkGrey fr ml5 mr10" onclick="hide_domain($(this),'<%= subdomain.org_subfield.id %>','<%= subdomain.id %>');" id="hide_<%= subdomain.id %>"><%= subdomain.hide==0?"隐藏":"可见" %></a>
|
||||
<span class="fr">|</span>
|
||||
<%= link_to "删除", org_subfield_sub_domain_path(subdomain, :org_subfield_id => subdomain.org_subfield.id), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkGrey fr ml5 mr5" %>
|
||||
<span class="fr">|</span>
|
||||
<a href="javascript:void(0);" class="linkGrey fr ml5 mr5" onclick="edit('#subsubdomain_show_<%= subdomain.id %>','#subsubdomain_edit_<%= subdomain.id %>');">编辑</a>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
function update_subfield_subdomain(show_id, edit_id, field_id, domain_id, input_value) {
|
||||
if ($(show_id).html().trim() != input_value.trim()) {
|
||||
if (confirm('确定修改为' + input_value + "?"))
|
||||
$.ajax({
|
||||
url: "/org_subfields/" + field_id + "/sub_domains/" + domain_id + "?name=" + input_value,
|
||||
type: 'put'
|
||||
});
|
||||
else{
|
||||
$(edit_id).children("input").val($(show_id).html().trim());
|
||||
}
|
||||
}
|
||||
$(show_id).show();
|
||||
$(edit_id).hide();
|
||||
// $(edit_id).focus();
|
||||
}
|
||||
|
||||
|
||||
function domain_update_priority(show_id, edit_id, field_id, domain_id, input_value){
|
||||
var re = /^[0-9]*[1-9]*[0-9]$/
|
||||
if(re.test(input_value) && $(show_id).html().trim() != input_value.trim() && input_value.trim() != ''){
|
||||
$.ajax({
|
||||
url: "/org_subfields/" + field_id + "/sub_domains/" + domain_id + "/domain_update_priority?priority=" + input_value,
|
||||
type: 'put'
|
||||
});
|
||||
}
|
||||
else{
|
||||
$(edit_id).children("input").val($(show_id).html().trim());
|
||||
}
|
||||
$(show_id).show();
|
||||
$(edit_id).hide();
|
||||
}
|
||||
|
||||
function hide_domain(content, field_id, domain_id){
|
||||
if (content.text() == '隐藏')
|
||||
$.ajax({
|
||||
url: "/org_subfields/" + field_id + "/sub_domains/" + domain_id + "/hide_sub_domain",
|
||||
type: "post"
|
||||
});
|
||||
else
|
||||
$.ajax({
|
||||
url: "/org_subfields/" + field_id + "/sub_domains/" + domain_id + "/show_sub_domain",
|
||||
type: "post"
|
||||
});
|
||||
}
|
||||
</script>
|
@ -0,0 +1,79 @@
|
||||
<style type="text/css">
|
||||
input.is_public,input.is_public_checkbox{height:12px;}
|
||||
input.is_public_checkbox{margin-left:4px;margin-right:4px;}
|
||||
</style>
|
||||
<div class="fl">
|
||||
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
|
||||
<% if defined?(container) && container && container.saved_attachments %>
|
||||
<% container.attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>" class="attachment">
|
||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'upload_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') %>
|
||||
<%= if attachment.id.nil?
|
||||
#待补充代码
|
||||
else
|
||||
link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
|
||||
end
|
||||
%>
|
||||
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
|
||||
|
||||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% container.saved_attachments.each_with_index do |attachment, i| %>
|
||||
<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>
|
||||
<%= 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?
|
||||
#待补充代码
|
||||
else
|
||||
link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
|
||||
end
|
||||
%>
|
||||
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
|
||||
|
||||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<span class="add_attachment" style="font-weight:normal;">
|
||||
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
|
||||
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
|
||||
<%#= 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>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => '_file',
|
||||
:class => 'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => 'addInputFiles(this);',
|
||||
:style => ie8? ? '' : 'display:none',
|
||||
:data => {
|
||||
: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_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||
:upload_path => uploads_path(:format => 'js'),
|
||||
:description_placeholder => l(:label_optional_description),
|
||||
:field_is_public => l(:field_is_public),
|
||||
:are_you_sure => l(:text_are_you_sure),
|
||||
:file_count => l(:label_file_count),
|
||||
:lebel_file_uploding => l(:lebel_file_uploding),
|
||||
:delete_all_files => l(:text_are_you_sure_all)
|
||||
} %>
|
||||
<span id="upload_file_count">
|
||||
<%= l(:label_no_file_uploaded) %>
|
||||
</span>
|
||||
(<%= l(:label_max_size) %>:
|
||||
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
|
||||
</span>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
@ -0,0 +1,70 @@
|
||||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||
<%= javascript_include_tag "des_kindEditor" %>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
init_des_data(150);
|
||||
});
|
||||
function check_org_title()
|
||||
{
|
||||
if($("#document_title").val().trim() == "")
|
||||
{
|
||||
$("#doc_title_hint").html("<span class='c_red'>标题不能为空</span>").show();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#doc_title_hint").hide();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
function create_org_document()
|
||||
{
|
||||
if(check_org_title() == true)
|
||||
{
|
||||
org_document_description_editor.sync();
|
||||
$('#new_sub_document_form').submit();
|
||||
}
|
||||
}
|
||||
function cancel_create_org_document(){
|
||||
$("#document_title").val("");
|
||||
//org_document_description_editor.html("");
|
||||
//org_document_description_editor.sync();
|
||||
$('#sub_document_editor').hide();
|
||||
$('#doc_title_hint').hide();
|
||||
}
|
||||
</script>
|
||||
<div class="resources" nhname="new_topic_form">
|
||||
<%= form_tag org_subfield_sub_domain_sub_document_comments_path(:org_subfield_id => @org_subfield.id, :sub_domain_id => @subdomain.id), :id => 'new_sub_document_form' do |f| %>
|
||||
<div>
|
||||
<input class="postDetailInput fl" maxlength="250" name="sub_document_comment[title]" id="document_title" style="resize:none;" onfocus = "$('#sub_document_editor').show();" placeholder="请输入文章标题" />
|
||||
</div>
|
||||
<div id="doc_title_hint"></div>
|
||||
<div class="cl"></div>
|
||||
<div id="sub_document_editor" class="mt10" style="display: none">
|
||||
<div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='description_textarea' name="sub_document_comment[content]"></textarea>
|
||||
<%#= kindeditor_tag 'sub_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<p id="homework_course_id_span" class="c_red mt5"></p>
|
||||
<p id="e_tip" class="c_grey"></p>
|
||||
<p id="e_tips" class="c_grey"></p>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10">
|
||||
<div class="fl" id="topic_attachments">
|
||||
<%#= render :partial => 'sub_document_comments/attachment', :locals => {:container => nil} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt5">
|
||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" id="new_topic_submit_btn">确定</a>
|
||||
<span class="fr mr10 mt3">或</span>
|
||||
<a href="javascript:void(0);" id="new_topic_cancel_btn" class="fr mr10 mt3">取消</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
@ -0,0 +1,2 @@
|
||||
$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'sub_document_comments/show_sub_document', :locals => {:document => @document,:flag => params[:flag], :act => @act, :organization => @organization}) %>");
|
||||
sd_create_editor_from_data(<%= @act.id %>,"","100%", "<%=@act.class.to_s%>");
|
@ -0,0 +1,6 @@
|
||||
//location.reload();
|
||||
<% if params[:detail_page] %>
|
||||
window.location.href = '<%= org_subfield_sub_domain_sub_document_comments_path(@subdomain, :org_subfield_id => @org_subfield.id)%>';
|
||||
<% else %>
|
||||
window.location.reload();
|
||||
<% end %>
|
@ -0,0 +1,63 @@
|
||||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||
<%= javascript_include_tag "des_kindEditor" %>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
init_des_data(150);
|
||||
});
|
||||
function check_org_title()
|
||||
{
|
||||
if($("#document_title").val().trim() == "")
|
||||
{
|
||||
$("#doc_title_hint").html("<span class='c_red'>标题不能为空</span>").show();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#doc_title_hint").hide();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="homepageRightBanner mb5" style="margin-bottom:5px;">
|
||||
<div class="NewsBannerName">编辑文章</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<div class="resources" nhname="new_topic_form">
|
||||
<%= form_tag url_for(:controller => 'org_document_comments',:action => 'update', :id => @org_document.id, :flag => @flag, :org_subfield_id => params[:org_subfield_id]),:method => 'put', :id => 'new_org_document_form' do |f| %>
|
||||
<div>
|
||||
<input class="postDetailInput fl mr15" style="margin-bottom:15px;" name="org_document_comment[title]" id="document_title" style="resize:none;" onfocus = "$('#org_document_editor').show();" onblur="check_org_title();" value="<%= @org_document.title %>" />
|
||||
</div>
|
||||
<div id="doc_title_hint"></div>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<div class="mt10">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='description_textarea' name="org_document_comment[content]"><%=@org_document.content.html_safe %></textarea>
|
||||
<%#= kindeditor_tag 'org_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<p id="homework_course_id_span" class="c_red mt5"></p>
|
||||
<p id="e_tip" class="c_grey"></p>
|
||||
<p id="e_tips" class="c_grey"></p>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="mt10">
|
||||
<div class="fl" id="topic_attachments">
|
||||
<%= render :partial => 'org_document_comments/attachment', :locals => {:container => @org_document} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt5">
|
||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" id="new_topic_submit_btn">确定</a>
|
||||
<span class="fr mr10 mt3">或</span>
|
||||
<a href="javascript:void(0);" id="new_topic_cancel_btn" onclick="location=document.referrer;" class="fr mr10 mt3">取消</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,20 @@
|
||||
<% if @organization.switch_type %>
|
||||
<% unless @documents.nil? %>
|
||||
<%= render :partial => 'sub_document_comments/show_sub_document_newstyle', :locals => {:documents => @documents} %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
||||
<% end %>
|
||||
<%= render :partial => 'new' %>
|
||||
<% unless @documents.nil? %>
|
||||
<% @documents.each do |document| %>
|
||||
<script>
|
||||
$(function() {
|
||||
sd_create_editor_from_data(<%= OrgActivity.where("org_act_type='SubDocumentComment'and org_act_id=?", document.id).first.id %>, null, "100%", "OrgActivity");
|
||||
});
|
||||
</script>
|
||||
<%= render :partial => 'sub_document_comments/show_sub_document', :locals => {:document => document, :act => OrgActivity.where("org_act_type='SubDocumentComment'and org_act_id=?", document.id).first, :flag => 0} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
@ -0,0 +1,71 @@
|
||||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||
<%= javascript_include_tag "des_kindEditor" %>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
init_des_data(150);
|
||||
});
|
||||
function check_org_title()
|
||||
{
|
||||
if($("#document_title").val().trim() == "")
|
||||
{
|
||||
$("#doc_title_hint").html("<span class='c_red'>标题不能为空</span>").show();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#doc_title_hint").hide();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
function create_org_document()
|
||||
{
|
||||
if(check_org_title() == true)
|
||||
{
|
||||
org_document_description_editor.sync();
|
||||
$('#new_sub_document_form').submit();
|
||||
}
|
||||
}
|
||||
function cancel_create_org_document(){
|
||||
location.href = document.referrer;
|
||||
}
|
||||
</script>
|
||||
<div class="homepageRightBanner" style="margin-top:<%= User.current.logged? ? '0px':'10px' %>; margin-bottom:10px;">
|
||||
<div class="NewsBannerName"><%= OrgSubfield.try(:find, params[:field_id]).try(:name) %></div>
|
||||
</div>
|
||||
<div class="resources" nhname="new_topic_form" >
|
||||
<%= form_tag org_subfield_sub_domain_sub_document_comment_path(:org_subfield_id => @org_subfield.id, :sub_domain_id => @subdomain.id), :id => 'new_sub_document_form' do |f| %>
|
||||
<div>
|
||||
<input class="postDetailInput fl mr15" name="sub_document_comment[title]" id="document_title" style="resize:none;" onfocus = "$('#sub_document_editor').show();" placeholder="请输入文章标题"></input>
|
||||
</div>
|
||||
<div id="doc_title_hint">
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="" >
|
||||
<div class="mt10">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='description_textarea' name="org_document_comment[content]"></textarea>
|
||||
<%#= kindeditor_tag 'org_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<p id="homework_course_id_span" class="c_red mt5"></p>
|
||||
<p id="e_tip" class="c_grey"></p>
|
||||
<p id="e_tips" class="c_grey"></p>
|
||||
<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">
|
||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" id="new_topic_submit_btn">确定</a>
|
||||
<span class="fr mr10 mt3">或</span>
|
||||
<a href="javascript:void(0);" onclick="cancel_create_org_document();" id="new_topic_cancel_btn" class="fr mr10 mt3">取消</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
@ -0,0 +1,27 @@
|
||||
<div class="org-popup-wrap sn-w300"> <a href="javascript:void(0);" class="org-popup-close"></a>
|
||||
<div class="f16 fb fontBlue mb10">添加二级目录</div>
|
||||
<%= form_tag url_for(:controller => 'sub_domains', :action => 'create', :org_subfield_id => field.id), :id=> 'add_subfield_form_subdomain',:remote => true do %>
|
||||
<span class="fontGrey3 fb mb5 mr10">二级栏目名称</span>
|
||||
<input type="text" id="subfield_name_subdomain" name="name" placeholder="栏目名称" class="orgAddSearch mb10" />
|
||||
<ul class="orgAddRole mb10">
|
||||
<li class="fontGrey3 fb ml24 mr10 fl">栏目类型</li>
|
||||
<li class="fl mr15">
|
||||
<input type="radio" id="orgMng" value="Post" name="field_type" checked="checked"/>
|
||||
<label for="orgMng">帖子</label>
|
||||
</li>
|
||||
<!--<li class="fl mr15">-->
|
||||
<!--<input type="radio" id="orgMeb" value="Resource" name="field_type" />-->
|
||||
<!--<label for="orgMeb">资源</label>-->
|
||||
<!--</li>-->
|
||||
<li class="cl"></li>
|
||||
</ul>
|
||||
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="add_org_subfield_subdomain();hideModal()">确定</a></div>
|
||||
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText" onclick="hideModal()">取消</a></div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="javascript">
|
||||
|
||||
</script>
|
@ -0,0 +1,8 @@
|
||||
<% if @res %>
|
||||
$("#org_subfield_list").html("");
|
||||
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => @organization.org_subfields.order("priority") }) %>");
|
||||
$("#sub_field_left_lists").html("");
|
||||
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
|
||||
<% end %>
|
||||
$("#subfield_name").val("");
|
||||
$("#sub_dir").val("");
|
@ -0,0 +1,4 @@
|
||||
$("#org_subfield_list").html("");
|
||||
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list', :locals => {:subfields => @organization.org_subfields.order("priority") }) %>");
|
||||
$("#sub_field_left_lists").html("");
|
||||
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
|
@ -0,0 +1,2 @@
|
||||
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',:locals => {:subfields => @organization.org_subfields.order("priority")}) %>");
|
||||
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
|
@ -0,0 +1,3 @@
|
||||
$("#hide_<%= @subdomain.id %>").text("可见");
|
||||
$("#sub_domain_hide_<%= @subdomain.id %>").css("display", "none");
|
||||
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
|
@ -0,0 +1,6 @@
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'sub_domains/new',:locals => {:field => @org_subfield}) %>');
|
||||
showModal('ajax-modal', '513px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","50%").css("border","3px solid #269ac9");
|
||||
$('#ajax-modal').parent().addClass("popbox_polls");
|
@ -0,0 +1,3 @@
|
||||
$("#hide_<%= @subdomain.id %>").text("隐藏");
|
||||
$("#sub_domain_hide_<%= @subdomain.id %>").css("display", "block");
|
||||
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
|
@ -0,0 +1,3 @@
|
||||
$("#subsubdomain_show_<%= @subdomain.id %>").html("<%= @subdomain.name %>");
|
||||
$("#sub_field_left_lists").html("");
|
||||
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
|
@ -0,0 +1,14 @@
|
||||
class CreateSubDomains < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :sub_domains do |t|
|
||||
t.integer :org_subfield_id
|
||||
t.integer :priority, :default => false
|
||||
t.string :name
|
||||
t.string :field_type
|
||||
t.integer :hide, :default => false
|
||||
t.integer :status, :default => false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,17 @@
|
||||
class CreateSubDocumentComments < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :sub_document_comments do |t|
|
||||
t.text :content
|
||||
t.text :title
|
||||
t.integer :sub_domain_id
|
||||
t.integer :creator_id
|
||||
t.integer :parent_id
|
||||
t.integer :reply_id
|
||||
t.integer :locked
|
||||
t.integer :sticky
|
||||
t.integer :org_subfield_id
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe SubDocumentCommentsController, :type => :controller do
|
||||
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe SubDomainsController, :type => :controller do
|
||||
|
||||
end
|
@ -0,0 +1,14 @@
|
||||
FactoryGirl.define do
|
||||
factory :sub_document_comment do
|
||||
content "MyText"
|
||||
title "MyText"
|
||||
sub_domain_id 1
|
||||
creator_id 1
|
||||
parent_id 1
|
||||
reply_id 1
|
||||
locked 1
|
||||
sticky 1
|
||||
org_subfield_id 1
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,11 @@
|
||||
FactoryGirl.define do
|
||||
factory :sub_domain do
|
||||
org_subfield_id 1
|
||||
priority 1
|
||||
name "MyString"
|
||||
field_type "MyString"
|
||||
hide 1
|
||||
status 1
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe SubDocumentComment, :type => :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe SubDomain, :type => :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|