Merge branch 'szzh' into develop

This commit is contained in:
huang 2016-01-14 15:11:01 +08:00
commit bcee2924bb
55 changed files with 3369 additions and 2304 deletions

View File

@ -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/

View File

@ -0,0 +1,3 @@
// Place all the styles related to the subfield_subdomain_dirs controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@ -53,6 +53,7 @@ class AtController < ApplicationController
end
def find_project(id)
return [] if id<0
at_persons = Project.find(id).users
at_persons.delete_if { |u| u.id == User.current.id }
end

View File

@ -172,6 +172,7 @@ class FilesController < ApplicationController
# #render 'stores'
# redirect_to search_course_files_url
end
@page = params[:page] || 1
end
def find_course_attache keywords,course,sort = ""
@ -380,6 +381,7 @@ class FilesController < ApplicationController
@organization = Organization.find(@containers.first.organization_id)
show_attachments @containers
@tag_list = attachment_tag_list @all_attachments
@page = params[:page] || 1
render :layout => 'base_org'
# @subfield = params[:org_subfield_id]
end

View File

@ -20,7 +20,12 @@ class OrgDocumentCommentsController < ApplicationController
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)
if params[:field_id]
redirect_to organization_path(@organization, :org_subfield_id => params[:field_id])
@org_subfield = OrgSubfield.find(params[:field_id])
if @org_subfield.subfield_subdomain_dir.nil?
redirect_to organization_path(@organization, :org_subfield_id => params[:field_id])
else
redirect_to show_org_subfield_organization_path(:id => @organization.id, :sub_dir_name => @org_subfield.subfield_subdomain_dir.name)
end
else
redirect_to organization_org_document_comments_path(@organization)
end

View File

@ -1,22 +1,90 @@
class OrgSubfieldsController < ApplicationController
helper :attachments
layout 'base_org'
def create
@subfield = OrgSubfield.create(:name => params[:name])
@organization = Organization.find(params[:organization_id])
@organization.org_subfields << @subfield
@subfield.update_attributes(:priority => @subfield.id, :field_type => params[:field_type])
if OrgSubfield.where("organization_id=#{params[:organization_id]} and name=?",params[:name]).count == 0
@res = true
@subfield = OrgSubfield.create(:name => params[:name])
@organization = Organization.find(params[:organization_id])
@organization.org_subfields << @subfield
if !params[:sub_dir].blank?
sql = "select subfield_subdomain_dirs.* from subfield_subdomain_dirs, org_subfields where subfield_subdomain_dirs.org_subfield_id = org_subfields.id "+
"and org_subfields.organization_id=#{@organization.id} and subfield_subdomain_dirs.name='#{params[:sub_dir]}'"
if SubfieldSubdomainDir.find_by_sql(sql).count == 0
SubfieldSubdomainDir.create(:org_subfield_id => @subfield.id, :name => params[:sub_dir])
end
end
@subfield.update_attributes(:priority => @subfield.id, :field_type => params[:field_type])
else
@res = false
end
end
def show
@org_subfield = OrgSubfield.find(params[:id])
@organization = @org_subfield.organization.id
@messages = []
@messages << @org_subfield.org_document_comments
@messages << @org_subfield.messages
@messages.sort{|a, b| b.updated_at <=> a.updated_at}
respond_to do |format|
format.html{render :layout => 'base_org'}
@flag = params[:flag] || false
sort = ""
@sort = ""
@order = ""
@is_remote = false
@organization = Organization.find(params[:id])
@org_subfield = OrgSubfield.find_by_sql("select distinct org_subfields.* from org_subfields,"+
"subfield_subdomain_dirs where org_subfields.id = subfield_subdomain_dirs.org_subfield_id and "+
" org_subfields.organization_id=#{@organization.id} and subfield_subdomain_dirs.name='#{params[:sub_dir_name]}'").first
if @org_subfield.field_type == 'Post'
@org_subfield_ids = @org_subfield.org_document_comments.map(&:id) << 0
@org_activities = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{@org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{@org_subfield.id})").order('updated_at desc').page(params[:page] || 1).per(10)
#redirect_to organization_path(@organization, :org_subfield_id => @org_subfield.id)
else
if params[:sort]
params[:sort].split(",").each do |sort_type|
order_by = sort_type.split(":")
case order_by[0]
when "filename"
attribute = "filename"
when "size"
attribute = "filesize"
when "attach_type"
attribute = "attachtype"
when "content_type"
attribute = "created_on"
when "field_file_dense"
attribute = "is_public"
when "downloads"
attribute = "downloads"
when "created_on"
attribute = "created_on"
when "quotes"
attribute = "quotes"
else
attribute = "created_on"
end
@sort = order_by[0]
@order = order_by[1]
if order_by.count == 1 && attribute
sort += "#{Attachment.table_name}.#{attribute} asc "
if sort_type != params[:sort].split(",").last
sort += ","
end
elsif order_by.count == 2 && order_by[1]
sort += "#{Attachment.table_name}.#{attribute} #{order_by[1]} "
if sort_type != params[:sort].split(",").last
sort += ","
end
end
end
else
sort = "#{Attachment.table_name}.created_on desc"
end
@container_type = 2
@containers = [ OrgSubfield.includes(:attachments).reorder(sort).find(@org_subfield.id)]
@organization = Organization.find(@containers.first.organization_id)
show_attachments @containers
@tag_list = attachment_tag_list @all_attachments
end
@page = params[:page] || 1
#render :layout => 'base_org'
end
def destroy
@subfield = OrgSubfield.find(params[:id])
@organization = Organization.find(@subfield.organization_id)
@ -29,4 +97,43 @@ class OrgSubfieldsController < ApplicationController
@subfield.update_attributes(:name => params[:name])
end
def update_sub_dir
@org_subfield = OrgSubfield.find(params[:id])
sql = "select subfield_subdomain_dirs.* from subfield_subdomain_dirs, org_subfields where subfield_subdomain_dirs.org_subfield_id = org_subfields.id "+
"and org_subfields.organization_id=#{@org_subfield.organization.id} and subfield_subdomain_dirs.name='#{params[:sub_dir_name]}'"
if SubfieldSubdomainDir.find_by_sql(sql).count == 0
if @org_subfield.subfield_subdomain_dir
@sub_dir = @org_subfield.subfield_subdomain_dir
@sub_dir.update_attribute(:name, params[:sub_dir_name])
else
@sub_dir = SubfieldSubdomainDir.create(:org_subfield_id => @org_subfield.id, :name => params[:sub_dir_name])
end
@exist = false
else
@exist = true
end
end
def show_attachments obj
@attachments = []
obj.each do |container|
@attachments += container.attachments
end
@all_attachments = User.current.admin? ? @attachments : visable_attachemnts(@attachments)
@limit = 10
@feedback_count = @all_attachments.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@offset ||= @feedback_pages.offset
#@curse_attachments_all = @all_attachments[@offset, @limit]
@obj_attachments = paginateHelper @all_attachments,10
end
#获取指定资源列表的TAG的集合以及每个TAG的数量降序排序
def attachment_tag_list attachments
tag_list = Hash.new
attachments.each do |attachment|
attachment.tag_list.map{|tag| tag_list.has_key?(tag) ? tag_list[tag] = tag_list[tag] + 1 : tag_list[tag] = 1}
end
tag_list.sort {|a,b| b[1]<=>a[1]}
end
end

View File

@ -114,7 +114,7 @@ class OrganizationsController < ApplicationController
@organization = Organization.find(params[:id])
@organization.name = params[:organization][:name]
@organization.description = params[:organization][:description]
@organization.domain = params[:organization][:domain]
# @organization.domain = params[:organization][:domain]
@organization.is_public = params[:organization][:is_public] == 'on' ? 1 : 0
#@organization.name = params[:organization][:name]
@organization.save

View File

@ -519,6 +519,14 @@ class ProjectsController < ApplicationController
def edit
end
def set_public_or_private
@project = Project.find(params[:id])
if @project.is_public?
@project.update_attribute(:is_public, 0)
else
@project.update_attribute(:is_public, 1)
end
end
# by young
# include CoursesHelper
def member

View File

@ -0,0 +1,10 @@
class SubfieldSubdomainDirsController < ApplicationController
def update
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
if @org_subfield.subfield_subdomain_dir
@org_subfield.subfield_subdomain_dir.update_attribute(:name, :params[:sub_dir_name])
else
SubfieldSubdomainDir.create(:org_subfield_id => @org_subfield.id, :name => params[:sub_dir_name])
end
end
end

View File

@ -0,0 +1,2 @@
module SubfieldSubdomainDirsHelper
end

View File

@ -1,5 +1,6 @@
class OrgSubfield < ActiveRecord::Base
belongs_to :organization, :foreign_key => :organization_id
has_one :subfield_subdomain_dir,:dependent => :destroy
has_many :org_document_comments, :dependent => :destroy
has_many :files
has_many :org_subfield_messages, :dependent => :destroy

View File

@ -0,0 +1,4 @@
class SubfieldSubdomainDir < ActiveRecord::Base
# attr_accessible :title, :body
belongs_to :org_subfield
end

View File

@ -205,7 +205,7 @@
<div class="loginContent">
<div class="loginLeft">
<div class="loginLogo"><img src="images/trustie_big_log.png" width="100" height="88" alt="Trustie Logo" /></div>
<div class="loginInro">&nbsp;&nbsp;欢迎加入Trustie高校创新实践社区!老师、学生和科研人员可以在此开展各种在线协同学习、协同作业、协同开发等活动。<br/><br/>&nbsp;&nbsp;Trustie是在中国推行大规模开放在线研究模式MOORE的支撑平台。</div>
<div class="loginInro">&nbsp;&nbsp;欢迎加入Trustie创新实践社区在这里您的创新意识和创新潜力将得到充分发挥目前已有超过200所高校和科研机构在平台中开展在线协同开发、协同学习和协同研究。<br/><br/>&nbsp;&nbsp;Trustie社区的理想是让创新过程变的更美好</div>
</div>
<div class="loginRight">
<div id="loginInBox">

View File

@ -26,12 +26,21 @@
) if User.current && User.current.id == activity.author.id %>
</li>
<li>
<%= link_to(
l(:button_set_homepage),
{:controller => 'blogs',:action => 'set_homepage',:user_id=>activity.author_id,:id=>activity.blog_id, :article_id => activity.id},
:method => :post,
:class => 'postOptionLink'
) if User.current && User.current.id == activity.blog.author_id %>
<% if activity.id == activity.blog.homepage_id %>
<%= link_to(
l(:button_cancel_homepage),
{:controller => 'blogs',:action => 'cancel_homepage',:user_id=>activity.author_id,:id=>activity.blog_id, :article_id => activity.id},
:method => :post,
:class => 'postOptionLink'
) if User.current && User.current.id == activity.blog.author_id %>
<% else %>
<%= link_to(
l(:button_set_homepage),
{:controller => 'blogs',:action => 'set_homepage',:user_id=>activity.author_id,:id=>activity.blog_id, :article_id => activity.id},
:method => :post,
:class => 'postOptionLink'
) if User.current && User.current.id == activity.blog.author_id %>
<% end %>
</li>
</ul>
</li>

View File

@ -43,11 +43,6 @@
</div>
</div>
<% if blog.homepage_id and BlogComment.where("id=?", blog.homepage_id).count > 0 %>
<% homepage = BlogComment.find(blog.homepage_id) %>
<%= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %>
<% end %>
<% if User.current.logged? && User.current.id == @user.id %>
<%= labelled_form_for @article, :url =>{:controller=>'blog_comments',:action => 'create',:user_id=>user.id , :blog_id => blog.id},
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>

View File

@ -36,7 +36,7 @@
</div>
<%end%>
<div class="cl"></div>
<div class="homepagePostTitle hidden m_w530 fl">
<div class="homepagePostTitle hidden m_w530">
<%= link_to activity.title.to_s.html_safe, user_blog_blog_comment_path(:user_id=>activity.author_id,
:blog_id=>activity.blog.id,:id=>activity), :class=> "postGrey", :style => 'text-align:center;' %>
</div>

View File

@ -40,7 +40,7 @@
}
$(function () {
init_activity_KindEditor_data(<%= topic.id%>, null, "87%");
init_activity_KindEditor_data(<%= topic.id%>, null, "87%", "<%=topic.class.to_s%>");
});
</script>
<% if topic %>

View File

@ -1,8 +1,16 @@
$("#project_info_<%=@course.id %>").html('<%=escape_javascript(render :partial=>'layouts/project_info') %>');
if(document.getElementById("course_is_public")) {
<% if @course.is_public == 0%>
$("#course_is_public").attr("checked",false);
<% elsif @course.is_public == 1 %>
$("#course_is_public").attr("checked",true);
<% if params[:user_page].nil? %>
$("#project_info_<%=@course.id %>").html('<%=escape_javascript(render :partial=>'layouts/project_info') %>');
if(document.getElementById("course_is_public")) {
<% if @course.is_public == 0%>
$("#course_is_public").attr("checked",false);
<% elsif @course.is_public == 1 %>
$("#course_is_public").attr("checked",true);
<% end %>
}
<% else %>
<% if @course.is_public? %>
$("#set_course_public_<%= @course.id %>").text("设为私有");
<% else %>
$("#set_course_public_<%= @course.id %>").text("设为公开");
<% end %>
}
<% end %>

View File

@ -1,59 +1,77 @@
<% delete_allowed = User.current.admin? %>
<div class="re_con_top">
<p class="f_l c_blue f_b f_14">共有&nbsp;<%= all_attachments.count%>&nbsp;个资源</p>
<p class="f_r" style="color: #808080">
<% if order == "asc" %>
按&nbsp;<%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"created_on"} %>&nbsp;/&nbsp;
<%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"downloads"} %>&nbsp;/&nbsp;
<%= link_to "引用次数",params.merge(:sort=>"quotes:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"quotes"} %>&nbsp;排序
<% else %>
按&nbsp;<%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"created_on"} %>&nbsp;/&nbsp;
<%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"downloads"} %>&nbsp; /&nbsp;
<%= link_to "引用次数",params.merge(:sort=>"quotes:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"quotes"} %>&nbsp;排序
<% end %>
</p>
</div>
<div class="cl"></div>
<div class="files_tag" id="files_tag">
<%= render :partial => "files/subfield_tags", :locals => {:tag_list => @tag_list,:org_subfield => @org_subfield,:tag_name => @tag_name}%>
</div>
<div class="cl"></div>
<div class="for_img_thumbnails">
<% org_subfield_attachments.each do |file| %>
<% if 1 %>
<div class="re_con_box" id="container_files_<%= file.id %>">
<div class="">
<%= 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 => "c_dblue f_14 f_b f_l" %>
<% org_subfield_attachments.each do |file| %>
<div class="resources mt10" id="container_files_<%= file.id %>">
<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 => "c_dblue f_14 f_b f_l" %>
<%= 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>
</div>
<div class="mt5">
<span class="fontGrey2 mr15 fl">上传时间:<%= format_date(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%>&nbsp;&nbsp;|&nbsp;&nbsp;引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
</div>
<div class="cl"></div>
<div class="tag_h">
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
</div>
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<% if User.current.logged? %>
<% if !@org_subfield.attachments.all.include?file %>
<%= link_to("选入栏目",quote_resource_show_org_subfield_org_subfield_file_path(:org_subfield_id => @org_subfield.id, :id => file.id),:class => "f_l re_select c_lorange",:remote => true) %>
<% elsif @org_subfield.organization.org_subfields.where("field_type='Resource'").count > 1 %>
<%= link_to("选入组织其他栏目",quote_resource_show_org_subfield_org_subfield_file_path(:org_subfield_id => @org_subfield.id, :id => file.id),:class => "f_l re_select c_lorange",:remote => true) %>
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == org_subfield.id && file.container_type == "OrgSubfield" %>
<ul class="homepagePostSettiongText">
<li><%= link_to("发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}')") %></li>
<li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li>
<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>
<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 == org_subfield.id && file.container_type == "OrgSubfield" && file.destroyable %>
</li>
</ul>
<%else%>
<ul class="resourceSendO">
<li><%= link_to("发&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}')") %></li>
</ul>
<% end %>
<%= file_preview_tag(file, class: 'f_l re_open', style:'text-align: center;') %>
<% end %>
</div>
<div class="cl"></div>
<div class="mt5">
<p class="f_l mb5 c_grey02">文件大小:<%= number_to_human_size(file.filesize) %></p>
<%= link_to( l(:button_delete), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @org_subfield.id && file.container_type == "OrgSubfield"%>
<p class="f_r c_grey02" ><%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %>&nbsp;&nbsp;|&nbsp;&nbsp;下载<%= file.downloads %>&nbsp;&nbsp;|&nbsp;&nbsp;引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
</div>
<div class="cl"></div>
<div class="tag_h">
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
</div>
<div class="cl"></div>
</div><!---re_con_box end-->
<% end %>
<% end %>
</div>
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul>
<div class="cl"></div>
</li>
</ul>
</div>
</div>
<div class="cl"></div>
</div>
</div><!---re_con_box end-->
<% end %>
<% if org_subfield_attachments.count == 10 %>
<% if params[:action] == 'search_files_in_subfield' %>
<%=link_to "点击展开更多", search_files_in_subfield_org_subfield_files_path(:org_subfield_id => org_subfield.id,:page => @page.to_i + 1, :name => params[:name],:insite => params[:insite]),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
<% else %>
<!-- 全站搜索的时候 返回的页码对象是obj_pages,而站内搜索返回的页码对象是feedback_pages -->
<%=link_to "点击展开更多", org_subfield_files_path(:org_subfield_id => org_subfield.id, :page => @page.nil? ? 2 :(@page + 1)), :id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
<%end%>
<% end%>

View File

@ -1,4 +1,4 @@
<%= stylesheet_link_tag 'courses' %>
<%= stylesheet_link_tag 'courses'%>
<script>
function searchone4reload(fileid){
var url = "<%= searchone4reload_org_subfield_files_path(@org_subfield)%>";
@ -11,87 +11,75 @@
}
});
}
function show_upload(obj)
{
switch(obj)
{
// case 1:
// $('#ajax-modal').html('<%#= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 1}) %>');
// break;
case 2:
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 2}) %>');
break;
case 3:
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 3}) %>');
break;
case 4:
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 4}) %>');
break;
// case 6:
// $('#ajax-modal').html('<%#= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 6}) %>');
// break;
default:
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 5}) %>');
}
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("popbox_polls");
}
function closeModal()
{
hideModal($("#popbox_upload"));
}
function presscss(id)
{
if(id == "inorg_subfield")
{
$('#inorg_subfield').attr("class", "re_schbtn b_dblue");
$('#insite').attr("class", "re_schbtn b_lblue");
}
else
{
$('#inorg_subfield').attr("class", "re_schbtn b_lblue");
$('#insite').attr("class", "re_schbtn b_dblue");
}
}
function buttoncss()
{
$('#inorg_subfield').attr("class", "re_schbtn b_lblue");
$('#insite').attr("class", "re_schbtn b_lblue");
}
</script>
<div class="container">
<div class="resources"><!--资源库内容开始--->
<div class="re_top" style="width:710px;">
<%= form_tag( search_files_in_subfield_org_subfield_files_path(@org_subfield), method: 'get',:class => "re_search f_l",:remote=>true) do %>
<%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%>
<%= submit_tag "栏目内搜索", :class => "re_schbtn b_lblue",:style => 'width:72px;',:name => "inorg_subfield",:id => "inorg_subfield", :onmouseover => "presscss('inorg_subfield')",:onmouseout =>"buttoncss()" %>
<%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
<div class="homepageRight mt0 ml0">
<div class="homepageRightBanner">
<div class="NewsBannerName"><%= org_subfield.name %></div>
<ul class="resourcesSelect">
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="resourcesType">
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield)%>','','<%= @q%>','<%= org_subfield.id%>');" class="resourcesTypeAll resourcesGrey">全部</a></li>
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield)%>','软件','<%= @q%>','<%= org_subfield.id%>');" class="softwareIcon postTypeGrey">软件</a></li>
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield)%>','媒体','<%= @q%>','<%= org_subfield.id%>');" class="mediaIcon resourcesGrey">媒体</a></li>
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield)%>','代码','<%= @q%>','<%= org_subfield.id%>');" class="codeIcon resourcesGrey">代码</a></li>
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_org_subfield_tag_attachment_org_subfield_files_path(org_subfield,:other=>true)%>','其他','<%= @q%>','<%= org_subfield.id%>');" class="othersIcon resourcesGrey">其它</a></li>
</ul>
</li>
</ul>
</ul>
</div>
<div class="resources mt10" style="padding-bottom:5px;">
<div class="reTop mb5">
<%= form_tag( search_files_in_subfield_org_subfield_files_path(@org_subfield), method: 'get',:class => "re_search",:remote=>true) do %>
<%= text_field_tag 'name', params[:name], name: "name", :class => 'researchBox fl',:style=>"padding: 0px"%>
<%= submit_tag "栏目内搜索", :class => "blueBtn mr5 fl",:style => 'width:72px;',:name => "inorg_subfield",:id => "inorg_subfield", :onmouseover => "presscss('inorg_subfield')",:onmouseout =>"buttoncss()" %>
<%= submit_tag "全站搜索", :class => "blueBtn mr5 fl",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
<input class="blueBtn fr mr5" value="上传资源" onclick="org_upload_files(<%= org_subfield.id %>);">
<%#= link_to "上传资源",subfield_upload_file_org_subfield_files_path(@org_subfield.id, :in_org => 1),:method => "post",:class=>"blueBtn fr mr5",:remote => true %>
<% end %>
<%# if is_org_subfield_teacher(User.current,@org_subfield) || (@org_subfield.publish_resource==1 && User.current.member_of_org_subfield?(@org_subfield) ) %> <!-- show_window('light','fade','20%','35%')-->
<!--<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload();">上传资源</a>-->
<p class="c_grey fr mt10 mr5">
上传:
<!--<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(1);">课件</a>&nbsp;|&nbsp;-->
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(2);">软件</a>&nbsp;|&nbsp;
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(3);">媒体</a>&nbsp;|&nbsp;
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(4);">代码</a>&nbsp;|&nbsp;
<!--<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(6);">论文</a>&nbsp;|&nbsp;-->
<a href="javascript:void(0);" class=" c_dblue font_bold" onclick="show_upload(5);">其他</a>
</p>
<%# end %>
</div><!---re_top end-->
<div class="cl"></div>
<div class="reCon" id="org_subfield_list">
<%= render :partial => 'org_subfield_list',:locals => {org_subfield: @org_subfield,all_attachments: @all_attachments,sort:@sort,order:@order,org_subfield_attachments:@obj_attachments} %>
</div><!---re_con end-->
<div>
<div class="re_con_top">
<div class="files_tag" id="files_tag">
<%#= render :partial => "files/subfield_tags", :locals => {:tag_list => @tag_list,:org_subfield => @org_subfield,:tag_name => @tag_name}%>
</div>
<div class="cl"></div>
<p class="f_l fontBlue f_b f_14">共有&nbsp;<span id="attachment_count"><%= @all_attachments.count %></span>&nbsp;个资源</p>
<p class="f_r" style="color: #808080">
<% if @order == "asc" %>
按&nbsp;<%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %>&nbsp;/&nbsp;
<%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %>&nbsp;/&nbsp;
<%= link_to "引用次数",params.merge(:sort=>"quotes:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %>&nbsp;排序
<% else %>
按&nbsp;<%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %>&nbsp;/&nbsp;
<%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %>&nbsp; /&nbsp;
<%= link_to "引用次数",params.merge(:sort=>"quotes:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %>&nbsp;排序
<% end %>
</p>
</div>
<div class="cl"></div>
</div>
</div>
<div id="org_subfield_list">
<%= render :partial => 'files/org_subfield_list',:locals => {org_subfield: @org_subfield,all_attachments: @all_attachments,sort:@sort,order:@order,org_subfield_attachments:@obj_attachments} %>
</div><!---re_con end-->
</div>
<% html_title(l(:label_attachment_plural)) -%>
<% html_title(l(:label_attachment_plural)) -%>
<script>
function org_upload_files(org_subfield_id){
$.ajax({
url :"/org_subfields/" + org_subfield_id + "/files/subfield_upload_file",
type :'post'
});
}
</script>

View File

@ -7,16 +7,12 @@
<div id="network_issue" style="color: red; display: none;"><%= l(:label_file_upload_error_messages)%></div>
<%= form_tag(org_subfield_files_path(org_subfield, :in_org => params[:in_org]), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
<% if params[:in_org] %>
<div class="c_dark">
<input name="org_subfield_attachment_type[]" type="checkbox" value="2" checked class="c_dblue">软件</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="org_subfield_attachment_type[]" type="checkbox" value="3" class="c_dblue">媒体</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="org_subfield_attachment_type[]" type="checkbox" value="4" class="c_dblue">代码</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="org_subfield_attachment_type[]" type="checkbox" value="5" class="c_dblue">其他</input></a>
</div>
<% else %>
<input type="hidden" name="org_subfield_attachment_type" value="<%= org_subfield_attachment_type %>">
<% end %>
<div class="c_dark">
<input name="org_subfield_attachment_type[]" type="checkbox" value="2" checked class="c_dblue">软件</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="org_subfield_attachment_type[]" type="checkbox" value="3" class="c_dblue">媒体</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="org_subfield_attachment_type[]" type="checkbox" value="4" class="c_dblue">代码</input>&nbsp;<span class="c_grey">|</span>&nbsp;
<input name="org_subfield_attachment_type[]" type="checkbox" value="5" class="c_dblue">其他</input></a>
</div>
<!--<input type="hidden" name="org_subfield_attachment_type" value="<%#= org_subfield_attachment_type%>">-->
<%= render :partial => 'files/org_subfield_upload_attachment_list', :locals => {:container => org_subfield}%>
<div class="cl"></div>

View File

@ -2,4 +2,6 @@
$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/course_list',:locals => {course:@course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} )%>");
<% elsif @project %>
$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/project_list', :locals => {project:@project, all_attachments:@all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments})%>");
<% elsif @org_subfield %>
$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/org_subfield_list', :locals => {org_subfield:@org_subfield, all_attachments:@all_attachments, sort:@sort, order:@order, org_subfield_attachments:@obj_attachments})%>");
<%end %>

View File

@ -1,2 +1,8 @@
$("#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})%>");
<% if (@obj_pages &&( @obj_pages.page > 1)) || (@feedback_pages && (@feedback_pages.page > 1)) %>
$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/org_subfield_list',
:locals => {org_subfield: @org_subfield,all_attachments: @result,sort:@sort,order:@order,org_subfield_attachments:@searched_attach} )%>");
<% else %>
$("#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})%>");
$("#attachment_count").html("<%= @result.count %>");
<% end %>

View File

@ -2,25 +2,25 @@
<%# pro = Project.find course.course_id %>
<li class="homepageLeftMenuCoursesLine" style="position:relative;">
<%= link_to course.name, course_path(course.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => course.name%>
<div class="homepagePostSetting mt5 mr10">
<ul>
<li class="menuSetting">
<ul class="homepagePostSettiongText boxShadow">
<li><%= link_to "发布作业", homework_common_index_path(:course => course.id,:is_new => 1), :class => 'postOptionLink' %></li>
<li><%= link_to "发布通知", new_course_news_path(course), :class => 'postOptionLink' %></li>
<li><%= link_to "上传资源",upload_files_menu_path(:course_id => course.id), :remote => true, :class => 'postOptionLink' %></li>
<li><%= link_to "发布新帖",course_boards_path( course, :flag => true, :is_new => 1), :class => 'postOptionLink' %></li>
<li>
<% if ShieldActivity.where("container_type='Organization' and container_id=#{org_id} and shield_type='Course' and shield_id=#{course.id}").count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:org_id => org_id, :course_id => course.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
<% else %>
<%= link_to "显示动态", show_acts_shield_activities_path(:org_id => org_id, :course_id => course.id), :method => 'delete',:class => 'postOptionLink',:remote => true %>
<% end %>
</li>
</ul>
</li>
</ul>
</div>
<!--<div class="homepagePostSetting mt5 mr10">-->
<!--<ul>-->
<!--<li class="menuSetting">-->
<!--<ul class="homepagePostSettiongText boxShadow">-->
<!--<li><%#= link_to "发布作业", homework_common_index_path(:course => course.id,:is_new => 1), :class => 'postOptionLink' %></li>-->
<!--<li><%#= link_to "发布通知", new_course_news_path(course), :class => 'postOptionLink' %></li>-->
<!--<li><%#= link_to "上传资源",upload_files_menu_path(:course_id => course.id), :remote => true, :class => 'postOptionLink' %></li>-->
<!--<li><%#= link_to "发布新帖",course_boards_path( course, :flag => true, :is_new => 1), :class => 'postOptionLink' %></li>-->
<!--<li>-->
<!--<%# if ShieldActivity.where("container_type='Organization' and container_id=#{org_id} and shield_type='Course' and shield_id=#{course.id}").count == 0 %>-->
<!--<%#= link_to "屏蔽动态", shield_activities_path(:org_id => org_id, :course_id => course.id), :method => 'post',:class => 'postOptionLink',:remote => true %>-->
<!--<%# else %>-->
<!--<#%= link_to "显示动态", show_acts_shield_activities_path(:org_id => org_id, :course_id => course.id), :method => 'delete',:class => 'postOptionLink',:remote => true %>-->
<!--<%# end %>-->
<!--</li>-->
<!--</ul>-->
<!--</li>-->
<!--</ul>-->
<!--</div>-->
</li>
<% end %>
<% if courses.size == 5%>

View File

@ -2,24 +2,24 @@
<%# pro = Project.find project.project_id %>
<li class="homepageLeftMenuCoursesLine" style="position:relative;">
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => project.name%>
<div class="homepagePostSetting mt5 mr10">
<ul>
<li class="menuSetting">
<ul class="homepagePostSettiongText boxShadow">
<li><%=link_to "发布问题", new_project_issue_path(project), :class => 'postOptionLink', :target => '_blank' %></li>
<li><%=link_to "发布新帖",project_boards_path(project, :flag => true), :class => 'postOptionLink',:target => '_blank' %></li>
<li><%= link_to "上传资源",upload_files_menu_path(:project_id => project.id), :remote => true, :class => 'postOptionLink' %></li>
<li>
<% if ShieldActivity.where("container_type='Organization' and container_id=#{org_id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:org_id => org_id, :project_id => project.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
<% else %>
<%= link_to "显示动态", show_acts_shield_activities_path(:org_id => org_id, :project_id => project.id),:method => 'delete',:class => 'postOptionLink',:remote => true %>
<% end %>
</li>
</ul>
</li>
</ul>
</div>
<!--<div class="homepagePostSetting mt5 mr10">-->
<!--<ul>-->
<!--<li class="menuSetting">-->
<!--<ul class="homepagePostSettiongText boxShadow">-->
<!--<li><%#=link_to "发布问题", new_project_issue_path(project), :class => 'postOptionLink', :target => '_blank' %></li>-->
<!--<li><%#=link_to "发布新帖",project_boards_path(project, :flag => true), :class => 'postOptionLink',:target => '_blank' %></li>-->
<!--<li><%#= link_to "上传资源",upload_files_menu_path(:project_id => project.id), :remote => true, :class => 'postOptionLink' %></li>-->
<!--<li>-->
<!--<%# if ShieldActivity.where("container_type='Organization' and container_id=#{org_id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %>-->
<!--<#%= link_to "屏蔽动态", shield_activities_path(:org_id => org_id, :project_id => project.id), :method => 'post',:class => 'postOptionLink',:remote => true %>-->
<!--<%# else %>-->
<!--<%#= link_to "显示动态", show_acts_shield_activities_path(:org_id => org_id, :project_id => project.id),:method => 'delete',:class => 'postOptionLink',:remote => true %>-->
<!--<%# end %>-->
<!--</li>-->
<!--</ul>-->
<!--</li>-->
<!--</ul>-->
<!--</div>-->
</li>
<% end %>
<% if projects.size == 5%>

View File

@ -1,25 +1,69 @@
<% courses.each do |course|%>
<li class="homepageLeftMenuCoursesLine pr">
<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}", :title => course.name+""+course.time.to_s+course.term+""%>
<div class="homepagePostSetting mt8 mr10">
<ul>
<li class="menuSetting">
<ul class="homepagePostSettiongText boxShadow">
<li><%= link_to "发布作业", homework_common_index_path(:course => course.id,:is_new => 1), :class => 'postOptionLink' %></li>
<li><%= link_to "发布通知", new_course_news_path(course), :class => 'postOptionLink' %></li>
<li><%= link_to "上传资源",upload_files_menu_path(:course_id => course.id), :remote => true, :class => 'postOptionLink' %></li>
<li><%= link_to "发布新帖",course_boards_path( course, :flag => true, :is_new => 1), :class => 'postOptionLink' %></li>
<li>
<% if ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
<% else %>
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :course_id => course.id),:method => 'delete',:class => 'postOptionLink',:remote => true %>
<% end %>
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
:title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+""+course.time.to_s+course.term+""%>
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %>
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
<li>
<ul class="subNavMenu boxShadow">
<% if is_teacher %>
<li class="subNavRow">
<%= link_to "作业",homework_common_index_path(:course => course.id), :class => 'fl fontGrey2 w48', :target => '_blank' %>
<%= link_to '+',homework_common_index_path(:course => course.id,:is_new => 1), :class => 'fr fb', :title => '发布作业',:target => '_blank' %>
<div class="cl"></div>
</li>
<li class="subNavRow">
<%= link_to "通知", course_news_index_path(course), :class => 'fl w48',:target => '_blank' %>
<%= link_to "+", new_course_news_path(course,:is_new=>1), :class => 'fr fb', :title => '发布通知',:target => '_blank' %>
<div class="cl"></div>
</li>
<% else %>
<li class="subNavRow">
<%= link_to "作业",homework_common_index_path(:course => course.id), :target => '_blank' %>
<div class="cl"></div>
</li>
<li class="subNavRow">
<%= link_to "通知", course_news_index_path(course),:target => '_blank' %>
<div class="cl"></div>
</li>
<% end %>
<% if is_teacher || (course.publish_resource == 1 && User.current.member_of_course?(course)) %>
<li class="subNavRow">
<%= link_to "资源",course_files_path(course), :class => 'fl w48',:target => '_blank' %>
<%= link_to "+",upload_files_menu_path(:course_id => course.id), :class => 'fr fb',:remote => true, :title => '上传资源' %>
<div class="cl"></div>
</li>
<% else %>
<li class="subNavRow">
<%= link_to "资源",course_files_path(course),:target => '_blank' %>
<div class="cl"></div>
</li>
<% end %>
<li class="subNavRow">
<%= link_to "论坛",course_boards_path(course), :class => 'fl w48',:target => '_blank' %>
<%= link_to "+",course_boards_path(course, :flag => true, :is_new => 1), :class => 'fr fb', :title => '发布帖子',:target => '_blank' %>
<div class="cl"></div>
</li>
<% if User.current == @user %>
<li class="subNavRow">
<% if count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post',:remote => true %>
<% else %>
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :course_id => course.id),:remote => true,:method => 'delete' %>
<% end %>
</li>
<% end %>
<% if User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
<li class="subNavRow">
<%= link_to course.is_public == 0 ? "设为公开" : "设为私有", {:controller => 'courses', :action => 'private_or_public', :id => course,:user_page => true},
:id => "set_course_public_#{course.id.to_s}",:remote=>true,:confirm=>"您确定要设置为"+(course.is_public == 0 ? "公开" : "私有")+"吗"%>
<div class="cl"></div>
</li>
<% end %>
</ul>
</li>
</ul>
</div>
</li>
<% end %>

View File

@ -1,24 +1,51 @@
<% projects.each do |project|%>
<li class="homepageLeftMenuCoursesLine pr">
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => project.name%>
<div class="homepagePostSetting mt8 mr10">
<ul>
<li class="menuSetting">
<ul class="homepagePostSettiongText boxShadow">
<li><%=link_to "发布问题", new_project_issue_path(project), :class => 'postOptionLink', :target => '_blank' %></li>
<li><%=link_to "发布新帖",project_boards_path(project, :flag => true), :class => 'postOptionLink',:target => '_blank' %></li>
<li><%= link_to "上传资源",upload_files_menu_path(:project_id => project.id), :remote => true, :class => 'postOptionLink' %></li>
<li>
<% if ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :project_id => project.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
<% else %>
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :project_id => project.id),:method => 'delete',:class => 'postOptionLink',:remote => true %>
<% end %>
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count %>
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
<li>
<ul class="subNavMenu boxShadow">
<li class="subNavRow">
<%=link_to "问题跟踪", project_issues_path(project), :class => 'fl fontGrey2', :target => '_blank',:style => "width:48px;" %>
<%=link_to "+", new_project_issue_path(project), :class => 'fr fb', :target => '_blank',:style => "width:48px;", :title => '发布问题',:style =>'width:10px;' %>
<div class="cl"></div>
</li>
<li class="subNavRow">
<%=link_to "资源", project_files_path(project),:class => 'fl fontGrey2 w48' %>
<%=link_to "+", upload_files_menu_path(:project_id => project.id),:remote => true,:class => 'fr fb',:title => '上传资源'%>
<div class="cl"></div>
</li>
<li class="subNavRow">
<%=link_to "论坛", project_boards_path(project),:class => 'fl fontGrey2 w48', :target => '_blank'%>
<%=link_to "+", project_boards_path(project, :flag => true),:class => 'fr fb', :target => '_blank',:title => '发布帖子'%>
<div class="cl"></div>
</li>
<% if (User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, project)) && rep_is_gitlab?(project) %>
<li class="subNavRow">
<%= link_to '版本库', url_for(:controller => 'projects', :action => 'settings', :id => project.id, :tab=>'repositories') , :target => '_blank',:class => "fl w48",:title => '版本库' %>
<div class="cl"></div>
</li>
<% end %>
<% if User.current == @user %>
<li class="subNavRow">
<% if ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :project_id => project.id), :method => 'post',:remote => true %>
<% else %>
<%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :project_id => project.id),:method => 'delete',:remote => true %>
<% end %>
<div class="cl"></div>
</li>
<% end %>
<% if User.current.logged? && (User.current.admin? || is_project_manager?(User.current,project)) %>
<li class="subNavRow">
<%= link_to project.is_public? ? "设为私有" : "设为公开", {:controller => 'projects', :action => 'set_public_or_private', :id => project.id,:user_page => true},
:id => 'set_project_public_'+ project.id.to_s,:method => 'post',:remote=>true,:confirm=>"您确定要设置为"+(project.is_public? ? "私有" : "公开")+"吗"%>
<div class="cl"></div>
</li>
<% end %>
</ul>
</li>
</ul>
</div>
</li>
<% end %>
<% if projects.size == 5%>

View File

@ -52,15 +52,25 @@
})
$(".coursesLineGrey").mouseout(function(){
$(this).css("color","#808080");
})
$(".homepagePostSetting,.coursesLineGrey").mouseover(function(){
$(this).prev().css("color","#ffffff");
$(this).css("z-index", "9999");
})
$(".homepagePostSetting").mouseout(function(){
$(this).prev().css("color","#808080");
$(this).css("z-index", "1");
})
});
//侧导航栏配置设置
$(".homepageLeftMenuCoursesLine").mouseover(function(){
$(this).children(".shild").css("background","url(/images/hwork_icon.png) -82px -399px no-repeat");
$(this).children().css("color","#ffffff");
});
$(".homepageLeftMenuCoursesLine").mouseout(function(){
$(this).children(".shild").css("background","url(/images/hwork_icon.png) -6px -354px no-repeat");
$(this).children().css("color","#808080");
});
$(".subNavRow").mouseover(function(){
$(this).css("background-color","#269ac9");
$(this).children().css("color","#ffffff");
});
$(".subNavRow").mouseout(function(){
$(this).css("background-color","#ffffff");
$(this).children().css("color","#888888");
});
})
</script>
</head>
@ -94,7 +104,7 @@
<% end%>
</div>
<div class="fl ml10">
<p class="homepageImageName hidden db mb5">
<p class="homepageImageName hidden db mb5" style="margin-left:0px;margin-right:0px;">
<%= @user.realname.blank? ? @user.login : @user.realname %>
</p>
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
@ -165,7 +175,7 @@
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
<div class="courseMenu" id="courseMenu">
<ul>
<li class="courseMenuIcon" id="courseMenuIcon">
<li class="courseMenuIcon fr" style="margin-right:10px;" id="courseMenuIcon">
<ul class="topnav_course_menu" id="topnav_course_menu">
<li>
<%= link_to "新建课程", new_course_path(:host=> Setting.host_course), :class => "menuGrey"%>
@ -179,7 +189,7 @@
</ul>
</div>
<% else%>
<%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:remote => true, :title => "加入课程"%>
<%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:style => "margin-right:10px;", :remote => true, :title => "加入课程"%>
<% end%>
<% end%>
</div>
@ -193,7 +203,7 @@
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuForge').slideToggle();">项目</a>
<% if is_current_user%>
<%=link_to "", new_project_path(:host=> Setting.host_name), :class => "homepageMenuSetting fr", :title => "新建项目"%>
<%=link_to "", new_project_path(:host=> Setting.host_name), :class => "homepageMenuSetting fr", :style => "margin-right:10px;", :title => "新建项目"%>
<% end%>
</div>
<% projects = @user.projects.visible.select("projects.*,(SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%>

View File

@ -0,0 +1,80 @@
<script>
$(document).ready(function(){
$("#relateProject,.relatePInfo").mouseover(function(){
$(".relatePInfo").css("display","block");
})
$("#relateProject,.relatePInfo").mouseout(function(){
$(".relatePInfo").css("display","none");
})
$(".homepagePostPortrait").mouseover(function(){
$(this).children(".userCard").css("display","block");
})
$(".homepagePostPortrait").mouseout(function(){
$(this).children(".userCard").css("display","none");
})
$(".userCard").mouseover(function(){
$(this).css("display","block");
})
$(".userCard").mouseout(function(){
$(this).css("display","none");
})
$(".coursesLineGrey").mouseover(function(){
$(this).css("color","#ffffff");
})
$(".coursesLineGrey").mouseout(function(){
$(this).css("color","#808080");
})
$(".homepagePostSetting,.coursesLineGrey").mouseover(function(){
$(this).prev().css("color","#ffffff");
$(this).css("z-index", "9999");
})
$(".homepagePostSetting").mouseout(function(){
$(this).prev().css("color","#808080");
$(this).css("z-index", "1");
})
})
</script>
<% unless org_activities.nil? %>
<% org_activities.each do |act| %>
<script>
$(function() {
init_activity_KindEditor_data(<%= act.id%>, null, "87%", "<%=act.class.to_s%>");
});
</script>
<% if act.container_type == 'Organization' %>
<% if act.org_act_type == 'OrgDocumentComment' && act.org_act_id != @organization.home_id %>
<%= render :partial => 'organizations/show_org_document', :locals => {:document => act.org_act, :act => act, :flag => 2, :org_subfield_id => params[:org_subfield_id]} %>
<% end %>
<% end %>
<% if act.container_type == 'Project' %>
<% case act.org_act_type.to_s %>
<% when 'Message' %>
<%= render :partial => 'organizations/project_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %>
<% end %>
<% end %>
<% if act.container_type == 'Course' %>
<% case act.org_act_type.to_s %>
<% when 'Message'%>
<%= render :partial => 'organizations/org_course_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %>
<% end %>
<% end %>
<% if act.container_type == 'OrgSubfield' %>
<% if act.org_act_type == 'Message' and act.org_act_id and Message.where("id=#{act.org_act_id}").count > 0 %>
<% message = Message.find(act.org_act_id) %>
<% if !message.board.course_id.nil? %>
<%= render :partial => 'organizations/org_course_message', :locals => {:activity => message,:user_activity_id =>act.id} %>
<% elsif message.board.project_id != -1 %>
<%= render :partial => 'organizations/project_message', :locals => {:activity => message,:user_activity_id =>act.id} %>
<% elsif message.board.org_subfield_id %>
<%= render :partial => 'organizations/org_subfield_message', :locals => {:activity => message, :user_activity_id => act.id} %>
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>
<% if org_act_count == 10 %>
<%= link_to "点击展开更多",show_org_subfield_organization_path(:id => @organization.id,:page => @page.to_i + 1,:sub_dir_name => params[:sub_dir_name]),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
<% end%>

View File

@ -0,0 +1,35 @@
<%= javascript_include_tag "jquery.infinitescroll.js" %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<% end %>
<style type="text/css">
/*回复框*/
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
.homepagePostReplyInputContainer .ke-toolbar-icon {line-height: 26px; font-size: 14px; padding-left: 26px;}
.homepagePostReplyInputContainer .ke-toolbar-icon-url {background-image: url(/images/public_icon.png)}
.homepagePostReplyInputContainer .ke-outline {padding: 0px 0px; line-height: 26px; font-size: 14px;}
.homepagePostReplyInputContainer .ke-icon-emoticons {background-position: 0px -671px; width: 50px; height: 26px;}
.homepagePostReplyInputContainer .ke-icon-emoticons:hover {background-position: -79px -671px; width: 50px; height: 26px;}
.homepagePostReplyInputContainer .ke-outline {border: none;}
.homepagePostReplyInputContainer .ke-inline-block {display: none;}
.homepagePostReplyInputContainer .ke-container {float: left;}
</style>
<div class="homepageRightBanner">
<div class="NewsBannerName"><%= @org_subfield.name %></div>
</div>
<% if @org_activities %>
<%= render :partial => 'org_subfields/show_details',
:locals => {:org_activities => @org_activities,
:page=> @page,
:org => @organization,
:org_act_count=> @org_activities.count} %>
<% end %>

View File

@ -1,7 +1,11 @@
$("#org_subfield_list").html("");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',
:locals => {:default_fields => @organization.org_subfields.where("field_type='default'"),
:subfields => @organization.org_subfields.where("field_type != 'default'") }) %>");
$("#sub_field_left_lists").html("");
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
$("#subfield_name").val("");
<% if @res %>
$("#org_subfield_list").html("");
$("#org_subfield_list").html("<%= escape_javascript(render :partial => 'organizations/subfield_list',
:locals => {:default_fields => @organization.org_subfields.where("field_type='default'"),
:subfields => @organization.org_subfields.where("field_type != 'default'") }) %>");
$("#sub_field_left_lists").html("");
$("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>");
$("#subfield_name").val("");
<% else %>
$("#subfield_name").val("");
<% end %>

View File

@ -0,0 +1,525 @@
<% if @org_subfield.field_type == 'Resource' %>
<div id="resource_list">
<%= render :partial => 'files/subfield_files', locals: {org_subfield: @org_subfield} %>
</div>
<% else %>
<%= render :partial => 'org_subfields/show_post_type'%>
<% end %>
<script type='text/javascript'>
var slideHeight = 29;
function readmore(aNode) {
// console.log(aNode)
// var $td_tags_area = $(aNode).parent().parent();
var $td_tags_area = $(aNode).parent().parent().parent().parent();
var $tags_area = $td_tags_area.find('.tags_area')
var $tags_gradint = $td_tags_area.find('.tags_gradint')
var $read_more = $td_tags_area.find('.read-more')
var $read_more_a = $td_tags_area.find('.read-more a')
var $tags = $td_tags_area.find('#tags')
var $icona = $td_tags_area.find('.tags_icona')
var slideHeight = 13; //px
var defHeight = $tags.height();
var curHeight = $tags_area.height();
if (curHeight == slideHeight) {
$tags_area.animate({
height: defHeight
}, 'normal');
$read_more_a.html('隐藏');
$icona.html('<%=image_tag "/images/sidebar/minus.png"%>')
$tags_gradint.fadeOut();
} else {
$tags_area.animate({
height: slideHeight
}, 'normal');
$read_more_a.html('更多');
$icona.html('<%=image_tag "/images/sidebar/add.png"%>')
$tags_gradint.fadeIn();
}
;
}
$(function () {
var slideHeight = 20; //px
var defHeight = $('.tags_area').height();
if (defHeight >= slideHeight) {
$('.tags_area').css('height', slideHeight + 'px');
}
;
});
function eval_ajax(xhr, textStatus) {
if (textStatus == 'success') {
eval(xhr.responseText);
} else if (textStatus == 'error') {
alert('error');
}
}
function attachment_contenttypes_searchex(value) {
<% if @project%>
$.ajax({
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: encodeURIComponent(value)
}
}).complete(eval_ajax);
<%end%>
}
function attachtype_edit(value) {
<% if @project%>
$.ajax({
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: encodeURIComponent(value)
}
}).complete(eval_ajax);
<%end%>
}
function attachmenttypes_change(id, type) {
<% if @project%>
$.ajax({
url: '<%=updateType_attachments_path%>',
type: "POST",
data: {
attachmentid: encodeURIComponent(id),
newtype: encodeURIComponent(type)
}
}).complete(function (xhr, textStatus) {
if (textStatus == 'success') {
$.ajax({
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: $('#attach_sufix_browse').val()
}
}).error(function () {
alert('error');
});
} else if (textStatus == 'error') {
alert('An error has occurred');
}
});
<%end%>
}
function org_id_click(){
var sendText = $("input[name='org_id']:checked").next().text();
var orgDirection = "目标地址:"
$(".orgDirection").text(orgDirection + sendText);
}
function subfield_click(){
var sendText = $("input[name='org_id']:checked").next().text();
var orgDirection = "目标地址:"
var sendColumn = $("input[name='subfield']:checked").next().text();
$(".orgDirection").text(orgDirection + sendText + " / " + sendColumn);
}
function course_attachmenttypes_change(id, type) {
<% if @course%>
$.ajax({
url: '<%=updateType_attachments_path%>',
type: "POST",
data: {
attachmentid: encodeURIComponent(id),
newtype: encodeURIComponent(type)
}
}).complete(function (xhr, textStatus) {
if (textStatus == 'success') {
$.ajax({
url: '<%=getattachtype_course_files_path(course_id: @course)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: $('#attach_sufix_browse').val()
}
}).error(function () {
alert('error');
});
} else if (textStatus == 'error') {
alert('An error has occurred');
}
});
<%end%>
}
// 编辑文件密级
function file_dense_edit(id, type) {
$.ajax({
url: '<%=updateFileDense_attachments_path%>',
type: "POST",
remote:"true",
data: {
attachmentid: encodeURIComponent(id),
newtype: encodeURIComponent(type)
}
}).complete(function (xhr, textStatus) {
});
}
function observeSearchfieldOnInput(fieldId, url,send_id,send_ids) {
$('#'+fieldId).each(function() {
var $this = $(this);
$this.addClass('autocomplete');
$this.attr('data-value-was', $this.val());
var check = function() {
var val = $this.val();
if ($this.attr('data-value-was') != val){
$this.attr('data-value-was', val);
$.ajax({
url: url,
type: 'get',
data: {search: $this.val(),send_id:send_id,send_ids:send_ids},
success: function(data){ },
beforeSend: function(){ $this.addClass('ajax-loading'); },
complete: function(){ $this.removeClass('ajax-loading'); }
});
}
};
var reset = function() {
if (timer) {
clearInterval(timer);
timer = setInterval(check, 300);
}
};
var timer = setInterval(check, 300);
$this.bind('keyup click mousemove', reset);
});
}
function check_des(event){
if($(".sectionContent").find('input[type="radio"]:checked').length <= 0){
event.preventDefault();
$(".orgDirection").text('目标地址组织不能为空')
return false;
}else if($(".columnContent").find('input[type="radio"]:checked').length <= 0){
event.preventDefault();
$(".orgDirection").text('目标地址栏目不能为空')
return false;
}else{
return true;
}
}
<% if User.current.logged? %>
var sendType = '1';
var lastSendType ;//初始为发送到我的课程
function show_send(id){
if (lastSendType === '2'){ //如果已经发送过一次了,那么就应该沿用上次发送的类型。
$.ajax({
type: 'get',
url: '<%= search_user_project_user_path(User.current)%>' + '?send_id=' + id
});
}else if(lastSendType == '1'){
$.ajax({
type: 'get',
url: '<%= search_user_course_user_path(User.current)%>' + '?send_id=' + id
});
}else if( lastSendType == '3'){//组织
$.ajax({
type: 'get',
url: '<%= search_user_org_user_path(User.current)%>' + '?send_id=' + id
});
}else{
$.ajax({
type: 'get',
url: '<%= search_user_course_user_path(User.current)%>' + '?send_id=' + id
});
}
}
//id 发送的id
//发送的id数组
function chooseSendType(res_id,res_ids){
sendType = $(".resourcesSendType").val();
if (sendType === lastSendType) {
return;
} else if(lastSendType != null) { //不是第一次点击的时候
if (sendType == '1') {
$.ajax({
type: 'get',
url: '<%= search_user_course_user_path(User.current)%>' + '?send_id=' + res_id
});
} else if(sendType == '2') {
$.ajax({
type: 'get',
url: '<%= search_user_project_user_path(User.current)%>' + '?send_id=' + res_id
});
}else if(sendType == '3'){
$.ajax({
type: 'get',
url: '<%= search_user_org_user_path(User.current)%>' + '?send_id=' + res_id
});
}
}
lastSendType = sendType;
}
<% end %>
<% if @course %>
var tagNameHtml; //当前双击的链接的父节点的html
var tagName; //标签的值
var parentCssBorder; //当前双击的链接的父节点
var ele; //当前双击的链接
var tagId; //标签的id
var taggableType; //被标签的类型
//这里renameTag有两种情况一种是改变某个资源的tag名称。如果其他资源也有这个tag。则新增一个改变后的tag名
//第二种是改变某个tag名称。其他所有的资源如果拥有这个tag。那么对应的tag名也要改掉。
//目前这两种依据 的来源就是 是否 传了参数 id。如果有id。就指定了资源id就是第一种情况。如果没有id。就是第二种情况
function rename_tag(domEle,name,id,type){
if(String(id) != '' || '<%=User.current.allowed_to?(:as_teacher,@course)%>' == 'true' ) { //如果有id 或者是老师就都能编辑否则没有id不是老师就不能编辑
isdb = true; //这是双击
//clearTimeout(clickFunction);
if (domEle.children().get(0) != undefined) { //已经是编辑框的情况下不要动
return;
}
tagNameHtml = domEle.parent().html()
tagName = name;
parentCssBorder = domEle.parent().css("border");
ele = domEle;
tagId = id;
taggableType = type;
width = parseInt(domEle.css('width').replace('px', '')) >= 100 ? parseInt(domEle.css('width').replace('px', '')) : 100
domEle.html('<input name="" id="renameTagName" maxlength="120" minlength="1" style="width:' + width + 'px;" value="' + name + '"/>');
domEle.parent().css("border", "1px solid #ffffff");
$("#renameTagName").focus();
}
}
//监听所有的单击事件
$(function(){
$("#renameTagName").live("blur",function(){
updateTagName();
}).live("keypress",function(e){
if (e.keyCode == '13') {
updateTagName();
}
});
});
//执行修改TAGName方法
function updateTagName(){
if(isdb){
isdb = false;
if($("#renameTagName").val() == tagName){ //如果值一样,则恢复原来的状态
ele.parent().css("border","");
ele.parent().html(tagNameHtml);
}
else{
$.post(
'<%= update_tag_name_path %>',
{"taggableId": tagId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim(),"courseId":<%= @course.id%>}
);
}
}
}
// $(document.body).click(function(e){
// isdb = false; //这是单击
// node = document.elementFromPoint(e.clientX, e.clientY);
// if(node.tagName == "INPUT"){ //如果是输入框的聚焦,那么就不要进行下去了
// isdb = true; //为了防止在编辑的时候又去单击其他tag去过滤。导致tag过滤不可用
// return;
// }
// if($("#renameTagName")[0] != undefined ){//存在renameTagName,则处于编辑状态
// if($("#renameTagName").val().trim() == tagName){ //如果值一样,则恢复原来的状态
// ele.parent().css("border","");
// ele.parent().html(tagNameHtml);
//
// }else{ //否则就要更新tag名称了
//// if(confirm("是否将标签改为 "+ $("#renameTagName").val().trim())){ 去掉询问
// $.post(
// '<%#= update_tag_name_path %>',
// {"taggableId": tagId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim(),"courseId":<%#= @course.id%>}
// )
//// }else{
//// ele.parent().css("border","");
//// ele.parent().html(tagNameHtml);
//// }
// }
// }
// });
<%end %>
<% if @project %>
var tagNameHtml; //当前双击的链接的父节点的html
var tagName; //标签的值
var parentCssBorder; //当前双击的链接的父节点
var ele; //当前双击的链接
var tagId; //标签的id
var taggableType; //被标签的类型
//这里renameTag有两种情况一种是改变某个资源的tag名称。如果其他资源也有这个tag。则新增一个改变后的tag名
//第二种是改变某个tag名称。其他所有的资源如果拥有这个tag。那么对应的tag名也要改掉。
//目前这两种依据 的来源就是 是否 传了参数 id。如果有id。就指定了资源id就是第一种情况。如果没有id。就是第二种情况
function rename_tag(domEle,name,id,type){
if(String(id) != '' || '<%=is_project_manager?(User.current.id, @project.id)%>' == 'true' ) { //如果有id 或者是老师就都能编辑否则没有id不是老师就不能编辑
isdb = true; //这是双击
//clearTimeout(clickFunction);
if (domEle.children().get(0) != undefined) { //已经是编辑框的情况下不要动
return;
}
tagNameHtml = domEle.parent().html()
tagName = name;
parentCssBorder = domEle.parent().css("border");
ele = domEle;
tagId = id;
taggableType = type;
width = parseInt(domEle.css('width').replace('px', '')) >= 100 ? parseInt(domEle.css('width').replace('px', '')) : 100
domEle.html('<input name="" id="renameTagName" maxlength="120" minlength="1" style="width:' + width + 'px;" value="' + name + '"/>');
domEle.parent().css("border", "1px solid #ffffff");
$("#renameTagName").focus();
}
}
//监听所有的单击事件
$(function(){
$("#renameTagName").live("blur",function(){
updateTagName();
}).live("keypress",function(e){
if (e.keyCode == '13') {
updateTagName();
}
});
});
//执行修改TAGName方法
function updateTagName(){
if(isdb){
isdb = false;
if($("#renameTagName").val() == tagName){ //如果值一样,则恢复原来的状态
ele.parent().css("border","");
ele.parent().html(tagNameHtml);
}
else{
$.post(
'<%= update_project_tag_name_path %>',
{"taggableId": tagId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim(),"projectId":<%= @project.id %>}
);
}
}
}
<%end %>
<% if @org_subfield %>
var tagNameHtml; //当前双击的链接的父节点的html
var tagName; //标签的值
var parentCssBorder; //当前双击的链接的父节点
var ele; //当前双击的链接
var tagId; //标签的id
var taggableType; //被标签的类型
//这里renameTag有两种情况一种是改变某个资源的tag名称。如果其他资源也有这个tag。则新增一个改变后的tag名
//第二种是改变某个tag名称。其他所有的资源如果拥有这个tag。那么对应的tag名也要改掉。
//目前这两种依据 的来源就是 是否 传了参数 id。如果有id。就指定了资源id就是第一种情况。如果没有id。就是第二种情况
function rename_tag(domEle,name,id,type){
if(1) {
isdb = true; //这是双击
//clearTimeout(clickFunction);
if (domEle.children().get(0) != undefined) { //已经是编辑框的情况下不要动
return;
}
tagNameHtml = domEle.parent().html()
tagName = name;
parentCssBorder = domEle.parent().css("border");
ele = domEle;
tagId = id;
taggableType = type;
width = parseInt(domEle.css('width').replace('px', '')) >= 100 ? parseInt(domEle.css('width').replace('px', '')) : 100
domEle.html('<input name="" id="renameTagName" maxlength="120" minlength="1" style="width:' + width + 'px;" value="' + name + '"/>');
domEle.parent().css("border", "1px solid #ffffff");
$("#renameTagName").focus();
}
}
//监听所有的单击事件
$(function(){
$("#renameTagName").live("blur",function(){
updateTagName();
}).live("keypress",function(e){
if (e.keyCode == '13') {
updateTagName();
}
});
});
//执行修改TAGName方法
function updateTagName(){
if(isdb){
isdb = false;
if($("#renameTagName").val() == tagName){ //如果值一样,则恢复原来的状态
ele.parent().css("border","");
ele.parent().html(tagNameHtml);
}
else{
$.post(
'<%= tags_update_org_subfield_tag_name_path %>',
{"taggableId": tagId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim(),"org_subfield_id":<%= @org_subfield.id %>}
);
}
}
}
<%end %>
function show_attachments_history(){
}
//更新文件版本 表单提交确认,原则是只能有一个更新文件
function upload_attachment_version(event){
if($("#upload_form").find('.upload_filename').length > 1){
$("#upload_file_count").html('(只能上传一个更新文件)')
event.preventDefault();
return false;
}else if($("#upload_form").find('.upload_filename').length == 0){
$("#upload_file_count").html('(请上传一个更新文件)')
event.preventDefault();
return false;
}else{
$("#upload_form").submit();
}
}
</script>
<script type='text/javascript'>
function tagAddClick(divid, objId, objTag) {
alert("OK");
$.ajax({
type: "POST",
url: '/users/tag_saveEx',
data: {
tagname: $('tag_name').value,
obj_id: encodeURIComponent(objId),
obj_flag: encodeURIComponent(objTag)
},
success: function (data, textStatus) {
alert("OK");
$(divid).empty();
$(divid).html('123');
$("#" + divid + " #name").val("");
}
})
}
</script>

View File

@ -0,0 +1,5 @@
$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'org_subfields/show_details',
:locals => {:org_activities =>@org_activities,
:page=>@page,
:org => @organization,
:org_act_count=>@org_activities.count} )%>");

View File

@ -0,0 +1,11 @@
<% if @exist == false %>
$('#sub_dir_show_<%= @org_subfield.id %>').html('<%= @sub_dir.name %>');
$('#sub_dir_edit_<%= @org_subfield.id %>').find('input').val('<%= @sub_dir.name %>');
// $('#sub_dir_show_<%= @org_subfield.id %>').show();
// $('#sub_dir_edit_<%= @org_subfield.id %>').hide();
<% else %>
$('#sub_dir_edit_<%= @org_subfield.id %>').find('input').val('<%= @org_subfield.subfield_subdomain_dir.nil? ? '': @org_subfield.subfield_subdomain_dir.name %>');
// alert("该目录已存在,请重新输入");
// $('#sub_dir_edit_<%#= @org_subfield.id %>').find('input').val('<%#= @org_subfield.subfield_subdomain_dir.nil? ? "未设置":@org_subfield.subfield_subdomain_dir.name %>');
// $('#sub_dir_edit_<%#= @org_subfield.id %>').focus();
<% end %>

View File

@ -70,12 +70,20 @@
<% organization.org_subfields.where("field_type != 'default'").each do |field| %>
<div class="homepageLeftMenuBlock" style="display:<%= field.hide == 0?'block':'none' %>;" id="org_subfield_<%= field.id %>">
<% if field.field_type == "Post" %>
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText" %>
<% if !field.subfield_subdomain_dir.nil? %>
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
<% else %>
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText" %>
<% end %>
<% if User.current.member_of_org?organization %>
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子"%>
<% end %>
<% else %>
<%= link_to "#{field.name}", org_subfield_files_path(field), :class => "homepageMenuText" %>
<% if !field.subfield_subdomain_dir.nil? %>
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
<% else %>
<%= link_to "#{field.name}", org_subfield_files_path(field), :class => "homepageMenuText" %>
<% end %>
<% if User.current.member_of_org?organization %>
<%= link_to "", subfield_upload_file_org_subfield_files_path(field.id, :in_org => 1),:method => "post", :remote => true, :class => "homepageMenuSetting fr", :title => "上传资源" %>
<!--<a class="homepageMenuSetting fr" title="上传资源" href="javascript:void(0);" onclick="org_subfield_files_upload(<%#= field.id %>);"> </a>-->

View File

@ -2,6 +2,7 @@
<li class="orgListUser fb">已有栏目</li>
<li class="orgListStatus fb">状态</li>
<li class="orgListStatus fb">类型</li>
<li class="orgListUser fb">域名目录</li>
<div class="cl"></div>
</ul>
@ -26,6 +27,12 @@
</li>
<li class="orgListStatus">新增</li>
<li class="orgListStatus"><%= field.field_type == "Post" ? "帖子" : "资源" %></li>
<li class="orgListUser hidden">
<div id="sub_dir_show_<%= field.id %>" ondblclick="edit_dir('#sub_dir_show_<%= field.id %>','#sub_dir_edit_<%= field.id %>');"><%= field.subfield_subdomain_dir.nil? ? '未设置': field.subfield_subdomain_dir.name %></div>
<div id="sub_dir_edit_<%= field.id %>" style="display:none;">
<input type="text" name="name" onblur="update_sub_dir('#sub_dir_show_<%= field.id %>','#sub_dir_edit_<%= field.id %>','<%= field.id %>',$(this).val());" value="<%= field.subfield_subdomain_dir.nil? ? '': field.subfield_subdomain_dir.name %>" style="width:70px;"/>
</div>
</li>
<%#= link_to "隐藏", hide_org_subfield_organizations_path(field), :method => 'post', :remote => true, :id => "hide_#{field.id}", :class => "linkBlue fr mr5" %>
<a href="javascript:void(0);" class="linkBlue fr mr10" onclick="hide($(this),'<%= field.id %>');" id="hide_<%= field.id %>"><%= field.hide==0?"设为隐藏":"设为可见" %></a>
<%= link_to "删除", org_subfield_path(field), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkBlue fr mr10" %>
@ -59,6 +66,28 @@
// $(edit_id).focus();
}
function edit_dir(show_id, edit_id){
$(show_id).toggle();
$(edit_id).toggle();
$(edit_id).find('input').focus();
$(edit_id).find('input').on('keypress', function(e){
if (e.keyCode == 13){
this.blur();
}
});
}
function update_sub_dir(show_id, edit_id, field_id, input_value) {
if ($(show_id).html().trim() != input_value.trim() && input_value.trim() != '') {
if (confirm('确定修改为' + input_value + "?"))
$.ajax({
url: "/org_subfields/" + field_id + "/update_sub_dir?sub_dir_name=" + input_value,
type: 'put'
});
}
$(show_id).show();
$(edit_id).hide();
}
function hide(content, id){
if (content.text() == '设为隐藏')
$.ajax({
@ -71,4 +100,4 @@
type: "post"
});
}
</script>
</script>

View File

@ -111,23 +111,33 @@
:subfields => @organization.org_subfields.where("field_type != 'default'") } %>
</div>
<div class="fr orgMemContainer">
<div class="orgMemberAdd">
<div class="fr">
<p class="fontBlue fb mb5">新增栏目</p>
<%= form_tag url_for(:controller => 'org_subfields', :action => 'create', :organization_id => @organization.id), :id=> 'add_subfield_form',:remote => true do %>
<input type="text" id="subfield_name" name="name" placeholder="栏目名称" class="orgAddSearch mb20" />
<ul class="orgAddRole">
<li class="fontGrey3 fb mb10">栏目类型</li>
<li>
<input type="radio" id="orgMng" value="Post" name="field_type" checked="checked"/>
<label for="orgMng">帖子</label>
</li>
<li>
<input type="radio" id="orgMeb" value="Resource" name="field_type" />
<label for="orgMeb">资源</label>
</li>
</ul>
<div class="cl"></div>
<a href="javascript:void(0);" class="saveBtn db fl mt10" onclick="add_org_subfield();">确定</a>
<input type="text" id="subfield_name" name="name" placeholder="栏目名称" class="orgAddSearch mb10" />
<div class="mb5">
<p class="fontGrey3"><span class="fb">域名目录</span>用户自定义url可选</p>
<% if @organization.domain %>
<span class="fl"><%= @organization.domain %>.trustie.net/</span><input class="fl personalUrl ml3" type="text" name="sub_dir">
<% else %>
<span class="fl">您还没有子域名,请先在左侧信息栏申请子域名</span>
<% end %>
<div class="cl"></div>
</div>
<ul class="orgAddRole">
<li class="fontGrey3 fb mb10">栏目类型</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">
<input type="radio" id="orgMeb" value="Resource" name="field_type" />
<label for="orgMeb">资源</label>
</li>
<li class="cl"></li>
</ul>
<div class="cl"></div>
<a href="javascript:void(0);" class="saveBtn db fl mt10" onclick="add_org_subfield();">确定</a>
<% end %>
</div>
</div>

View File

@ -0,0 +1,5 @@
<% if @project.is_public? %>
$("#set_project_public_<%= @project.id %>").text("设为私有");
<% else %>
$("#set_project_public_<%= @project.id %>").text("设为公开");
<% end %>

View File

@ -0,0 +1 @@
$("#sub_dir_show_<%= @org_subfield.id %>").html("<%= @org_subfield.subfield_subdomain_dir.name %>");

View File

@ -22,7 +22,7 @@
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(:send_ids, send_ids) %>
<div class="sectionWrap fl mr15">
<ul class="fontGrey3 sectionContent">
<ul class="fontGrey3">
<% unless @orgs.empty? %>
<% @orgs.each do |org|%>
<li>

View File

@ -40,4 +40,10 @@
</ul>
</div>
<!--显示个人主页-->
<% if @user.blog.homepage_id and BlogComment.where("id=?", @user.blog.homepage_id).count > 0 %>
<% homepage = BlogComment.find(@user.blog.homepage_id) %>
<%= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %>
<% end %>
<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0,:type => @type} %>

View File

@ -54,6 +54,7 @@ RedmineApp::Application.routes.draw do
post 'logout'
post 'apply_subdomain'
get 'org_resources_subfield'
get '/:sub_dir_name', :to => 'org_subfields#show', :as => 'show_org_subfield'
end
collection do
get 'check_uniq'
@ -73,7 +74,10 @@ RedmineApp::Application.routes.draw do
end
Organization.where("domain is not null").each do |org|
get '/', to: 'organizations#show', defaults: { id: org.id }, constraints: {subdomain: org.domain}
org_domains = []
org_domains << org.domain
#get '/', to: 'organizations#show', defaults: { id: org.id }, constraints: {subdomain: org.domain}
get '/', to: 'organizations#show', defaults: { id: org.id }, constraints: lambda{ |request| org_domains.include?(request.remote_ip) }
end
get '/', to: 'organizations#show', defaults: { id: 5 }, constraints: {subdomain: 'micros'}
get '/', to: 'organizations#show', defaults: { id: 23 }, constraints: {subdomain: 'nubot'}
@ -101,6 +105,9 @@ RedmineApp::Application.routes.draw do
match "quote_resource_show_org_subfield", :via => [:get]
end
end
member do
match 'update_sub_dir', :via => [:put]
end
resource :boards
end
@ -630,6 +637,7 @@ RedmineApp::Application.routes.draw do
post 'reopen'
get 'search_public_orgs_not_in_project'
match 'copy', :via => [:get, :post]
match 'set_public_or_private', :via => [:post]
end
collection do

View File

@ -0,0 +1,5 @@
class AddStatusToOrgMessages < ActiveRecord::Migration
def change
add_column :org_messages, :status, :integer, :default => 0
end
end

View File

@ -0,0 +1,9 @@
class CreateSubfieldSubdomainDirs < ActiveRecord::Migration
def change
create_table :subfield_subdomain_dirs do |t|
t.integer :org_subfield_id
t.string :name
t.timestamps
end
end
end

File diff suppressed because it is too large Load Diff

View File

@ -23,7 +23,7 @@ var enableAt = function(_editor) {
}
if('undefined' != (typeof id)){
names = '/at/' + id + '?type='+type;
names = '/at/' + id + '.json?type='+type;
}
//var names = ["Jacob","Isabella","Ethan","Emma","Michael","Olivia","Alexander","Sophia","William","Ava","Joshua","Emily","Daniel","Madison","Jayden","Abigail","Noah","Chloe","你好","你你你", "가"];

View File

@ -50,4 +50,28 @@ function show_more_org_course(url){
{page: $("#org_course_page_num").val()},
function (data){}
);
}
function search_tag_attachment(url,tag_name,q,course_id,sort)
{
//alert("111");
//clearTimeout(clickFunction);
clickFunction = setTimeout(function() {
search_func()
}, 500);
function search_func(){
if(isdb!= false ) return;
$.get(
url,
{
tag_name: tag_name,
q: q,
org_subfield_id:course_id
},
function (data) {
}
);
}
}

View File

@ -581,7 +581,7 @@ a.homepageImageNumber:hover {color:#269ac9;}
.homepageLeftMenuCourses {font-size:13px; border-bottom:1px solid #dddddd;}
.homepageLeftMenuCoursesLine {height:38px; line-height:38px; vertical-align:middle;}
.homepageLeftMenuCoursesLine:hover {background-color:#269ac9;}
a.coursesLineGrey {padding-left:25px; color:#808080; display:block;}
a.coursesLineGrey {padding-left:25px; padding-right:25px; color:#808080; display:block;}
a.coursesLineGrey:hover {color:#ffffff;}
.homepageLeftMenuMore {height:18px;}
.homepageLeftMenuMore:hover {background-color:#269ac9;}

View File

@ -18,11 +18,11 @@
.orgUrlInput {width:200px; outline:none; border:1px solid #eaeaea; height:22px;}
a.saveBtn {padding:3px 5px; background-color:#269ac9; color:#ffffff;}
a.saveBtn:hover {background-color:#297fb8;}
.orgMemberList {width:410px; float:left;}
.orgMemberList {width:460px; float:left;}
.orgListRow {border-bottom:1px solid #e4e4e4; padding-bottom:5px;}
.orgListUser {width:119px; float:left;}
.orgListUser {width:85px; float:left;}
.orgListRole {width:180px; float:left;}
.orgMemContainer {width:278px;}
.orgMemContainer {width:228px;}
.orgMemberAdd {float:right; width:240px;}
.orgAddSearch {border:1px solid #dddddd; outline:none; width:180px; height:22px; color:#9b9b9b;}
.undis {display:none;}
@ -73,6 +73,7 @@ a.linkGrey8:hover {color:#585858;}
.org_login_list a {color:#269ac9;}
.orgListStatus {width:55px; float:left;}
.personalUrl {border:1px solid #dddddd; width:75px; outline:none; white-space:nowrap; padding-left:2px;}
.reCon{ margin:5px; width:710px;}
.retop{width:710px; height:40px; background:#eaeaea; padding:5px;}
.resources {width:718px; background-color:#ffffff; padding:15px; border:1px solid #dddddd;float: right}
@ -107,4 +108,10 @@ div.flash {margin-top :0px !important}
.w80{ width:80px;}
.relatePInfo {text-align: left; position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;}
.captainName {max-width:40px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;}
.captainName {max-width:40px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;}
.researchBox { width:240px; height:24px; border:1px solid #dddddd; color:#666666; outline:none;}
.blueBtn{ width:60px; height:26px; color:#FFF; border:none; background-color:#269ac9; cursor:pointer; padding-left:0px; text-align:center;}
.blueBtn:hover {background-color:#298fbd;}
/*文本描述展开高度*/
.maxh360 {max-height: 810px;}
.lh18 { line-height: 18px;}

View File

@ -519,7 +519,7 @@ a.homepageImageNumber:hover {color:#15bccf;}
.homepageLeftMenuCourses {font-size:14px; border-bottom:1px solid #dddddd;}
.homepageLeftMenuCoursesLine {height:38px; line-height:38px; vertical-align:middle;}
.homepageLeftMenuCoursesLine:hover {background-color:#b3e0ee;}
a.coursesLineGrey {padding-left:25px; color:#15bccf; display:block;}
a.coursesLineGrey {padding-left:25px; padding-right:25px; color:#808080; display:block;}
a.coursesLineGrey:hover {color:#ffffff;}
.homepageLeftMenuMore {height:18px;}
.homepageLeftMenuMore:hover {background-color:#b3e0ee;}
@ -1003,4 +1003,4 @@ a:hover.userCancel{border:1px solid #888888; }
.userCard font {display:block; border-width:8px; position:absolute; bottom:-16px; left:110px; border-style:solid dashed dashed dashed; border-color:#FFF transparent transparent transparent; font-size:0; line-height:0;}
.userCard em {display:block; border-width:8px; position:absolute; bottom:-17px; left:110px; border-style:solid dashed dashed dashed; border-color:#eaeaea transparent transparent transparent; font-size:0; line-height:0;}
.userCardM {width:201px; height:20px; border:1px solid #dddddd; resize:none;}
.resourceCopy {padding:0px; margin:0px; width:12px; height:12px; display:inline-block;}
.resourceCopy {padding:0px; margin:0px; width:12px; height:12px; display:inline-block;}

View File

@ -18,6 +18,20 @@ a:hover.userCancel{border:1px solid #888888; }
.userCard {width:208px; border:1px solid #dddddd; background-color:#ffffff; margin-top:10px; padding:15px; top:-176px; left:-95px; position:absolute; z-index:999; display:none;}
.userCard font {display:block; border-width:8px; position:absolute; bottom:-16px; left:110px; border-style:solid dashed dashed dashed; border-color:#FFF transparent transparent transparent; font-size:0; line-height:0;}
.userCard em {display:block; border-width:8px; position:absolute; bottom:-17px; left:110px; border-style:solid dashed dashed dashed; border-color:#eaeaea transparent transparent transparent; font-size:0; line-height:0;}
.userCardM {width:201px; height:20px; border:1px solid #dddddd; resize:none;}
.praviteC {background:url(../images/hwork_icon.png) -79px -255px no-repeat;}
.praviteCP {display:inline-block; width:20px; height:20px; position:absolute; top:10px; left:25px;}
.publicC {background:url(../images/hwork_icon.png) -79px -125px no-repeat;}
.publicCP {display:inline-block; width:20px; height:20px; position:absolute; top:10px; left:25px;}
.shild {background:url(../images/hwork_icon.png) -6px -354px no-repeat;}
.shildP {display:inline-block; width:20px; height:20px; position:absolute; top:10px; right:0px;}
ul.shild:hover li ul {display:block;}
.subNavArrow {background:url(../images/hwork_icon.png) -82px -399px no-repeat; display:inline-block; width:20px; height:20px; position:absolute; top:10px; right:0px;}
ul.subNavArrow:hover li ul {display:block;}
.subNavMenu {line-height:2; font-size:12px; color:#616060; background-color:#ffffff; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:20px; top:-10px; padding:5px 0px; display:none; z-index:999;}
.subNavRow {padding:0px 15px; width:70px;}
.w48 {width:48px;}
a.mesIcon {background:url(../images/mes_icon.png) -5px -73px no-repeat; padding-left:23px;}
a.personalIcon {background:url(../images/mes_icon.png) -6px -16px no-repeat; padding-left:23px;}
.mesType {background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:10px 15px; left:-50px; font-size:12px; color:#888888; display:none; line-height:2; z-index:999; white-space:nowrap;}
@ -27,4 +41,13 @@ a.greyBtn2 {float:right; text-align:center; font-size:12px; color:#ffffff; backg
.upload_box{ width:430px; margin:15px auto;}
a.grey_btn{ background:#d9d9d9; color:#656565;font-size:14px; font-weight:normal; text-align:center; margin-left:10px; margin-bottom:10px; padding:2px 10px;}
a.blue_btn{background:#64bdd9;color:#fff;font-size:14px; font-weight:normal; padding:2px 8px; text-align:center;cursor: pointer;}
.homepageImageSex {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;}
.homepageImageSex {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;}
.homepageImageName {font-size:16px; color:#484848; margin-left:15px; margin-right:8px; height:21px; float:left;}
a.resourcesTypeAll {background:url(images/homepage_icon.png) -180px -89px no-repeat; padding-left:23px;}
.mediaIcon {background:url(../images/hwork_icon.png) -5px -160px no-repeat; padding-left:23px;}
.codeIcon {background:url(../images/hwork_icon.png) -78px -160px no-repeat; padding-left:23px;}
.othersIcon {background:url(../images/hwork_icon.png) -3px -210px no-repeat; padding-left:23px;}
.thesisIcon {background:url(../images/hwork_icon.png) -78px -212px no-repeat; padding-left:23px;}
.softwareIcon {background:url(../images/hwork_icon.png) -5px -254px no-repeat; padding-left:23px;}

View File

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe SubfieldSubdomainDirsController, :type => :controller do
end

View File

@ -0,0 +1,6 @@
FactoryGirl.define do
factory :subfield_subdomain_dir do
end
end

View File

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe SubfieldSubdomainDir, :type => :model do
pending "add some examples to (or delete) #{__FILE__}"
end