Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into sw_new_course
commit
167d001b3f
@ -0,0 +1,56 @@
|
||||
<% unless org_activities.nil? %>
|
||||
<% org_activities.each do |act| %>
|
||||
<% if act.container_type == 'Organization' %>
|
||||
<% if act.org_act_type == 'CreateOrganization' %>
|
||||
<div class="resources mt10">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<a href="javascript:void(0);"><%= image_tag(url_to_avatar(User.find(act.user_id)), :width => "45", :height => "45") %></a>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo"><%= link_to User.find(act.user_id), user_path(act.user_id) %> 创建了 <a href="<%= organization_path(@organization)%>" class="newsBlue ml10"><%= Organization.find(act.org_act_id).name %>
|
||||
| 组织</a></div>
|
||||
<div class="homepagePostDate"> 创建时间:<%= format_activity_day(act.created_at) %> <%= format_time(act.created_at, false) %> </div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if act.org_act_type == 'OrgDocumentComment' && act.org_act_id != @organization.home_id %>
|
||||
<script>
|
||||
$(function() {
|
||||
init_activity_KindEditor_data(<%= act.org_act.id%>, null, "87%");
|
||||
});
|
||||
</script>
|
||||
<%= render :partial => 'show_org_document', :locals => {:document => act.org_act} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if act.container_type == 'Project' %>
|
||||
<% case act.org_act_type.to_s %>
|
||||
<% when 'Issue' %>
|
||||
<%= render :partial => 'organizations/org_project_issue', :locals => {:activity => Issue.find(act.org_act_id),:user_activity_id =>act.id} %>
|
||||
<% when 'Message' %>
|
||||
<%= render :partial => 'organizations/project_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %>
|
||||
<%# when 'ProjectCreateInfo'%>
|
||||
<%#= render :partial => 'organizations/project_create', :locals => {:activity => act,:user_activity_id =>act.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<!--<ul class="wlist" style=" border:none; padding-top: 15px;">-->
|
||||
<%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
<!--</ul>-->
|
||||
<% end %>
|
||||
|
||||
<% if org_act_count == 10 %>
|
||||
<div id="show_more_activities" class="loadMore mt10 f_grey">展开更多<%=link_to "", organization_path(org,:page => page.to_i + 1),:id => "more_org_activities_link",:remote => "true",:class => "none" %></div>
|
||||
<%#= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||
<% end%>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$("#show_more_activities").mouseover(function(){
|
||||
$("#more_org_activities_link").click();
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
@ -1,7 +1,6 @@
|
||||
$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'organizations/org_project_activities',
|
||||
:locals => {:org_project_activties =>@org_project_activties,
|
||||
$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'organizations/org_activities',
|
||||
:locals => {:org_activities =>@org_activities,
|
||||
:page=>@page,
|
||||
:org => @organization,
|
||||
:org_act_count=>@org_activities.count,
|
||||
:pro_act_count=>@org_project_activties.count} )%>");
|
||||
:org_act_count=>@org_activities.count} )%>");
|
||||
|
||||
|
@ -0,0 +1,39 @@
|
||||
<%= stylesheet_link_tag 'pleft','header','new_user','repository','org', 'project' %>
|
||||
<%#= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','org' %>
|
||||
<div class="homepageContentContainer">
|
||||
<div class="homepageContent">
|
||||
<div class="postContainer">
|
||||
<div class="postBanner" style="padding-bottom:5px;">
|
||||
<span class="linkGrey2 f16">组织列表</span>
|
||||
|
||||
<%= form_tag url_for(:controller => 'users', :action => 'search_user_orgs', :id => User.current.id), :method => 'get', :id => "search_org_form", :class=>"resourcesSearchloadBox", :style=>"float:right; margin-top:-5px;" do %>
|
||||
<input type="text" name="search_orgs" placeholder="输入关键词进行搜索" class="problem_search_input fl"/>
|
||||
|
||||
<!--<a href="javascript:void(0);" class="homepageSearchIcon" onclick="$('#search_org_form').submit();"></a>-->
|
||||
<a href="javascript:void(0);" class="problem_search_btn fl" onclick="$('#search_org_form').submit();">搜索</a>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div id="org_list">
|
||||
<% orgs.each do |org| %>
|
||||
<div class="postRow">
|
||||
<div class="postPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(org), :width => '78', :height => '78', :alt => '组织logo'), organization_path(org), :class => "linkGrey2" %>
|
||||
</div>
|
||||
<div class="orgWrap">
|
||||
<div class="orgTitle">
|
||||
<%= link_to org.name, organization_path(org), :class => 'f16 linkBlue' %>
|
||||
</div>
|
||||
<div class="orgIntro"><%= org.description %></div>
|
||||
<div class="postCreater">创建者:<%= link_to User.find(org.creator_id), user_path(org.creator_id), :class => 'linkGrey2', :target => '_blank' %></div>
|
||||
<div class="postDate fl mr40">创建时间:<%= format_activity_day(org.created_at) %> <%= format_time(org.created_at, false) %></div>
|
||||
<div class="postCreater">您的身份:<%= User.current.admin_of_org?(org) ? "组织管理员" : "组织成员" %></div>
|
||||
</div>
|
||||
<!--<div class="mt28 fr"><a href="javascript:void(0);" class="linkGrey5">申请加入</a></div>-->
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1 @@
|
||||
<%= render :partial => 'show_user_org', :locals => {:orgs => @orgs} %>
|
@ -0,0 +1,2 @@
|
||||
|
||||
//$("#org_list").replaceWith("<%#= escape_javascript(render :partial => 'show_user_org', :locals => {:orgs => @orgs}) %>")
|
@ -0,0 +1,16 @@
|
||||
class CopyForgeActivitiesToOrgActivities < ActiveRecord::Migration
|
||||
def up
|
||||
ForgeActivity.all.each do |forge_act|
|
||||
OrgActivity.create(:user_id => forge_act.user_id,
|
||||
:org_act_id => forge_act.forge_act_id,
|
||||
:org_act_type => forge_act.forge_act_type,
|
||||
:container_id => forge_act.project_id,
|
||||
:container_type => 'Project',
|
||||
:created_at => forge_act.created_at,
|
||||
:updated_at => forge_act.updated_at)
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddCreatedAtToOrgMembers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :org_members, :created_at, :timestamp
|
||||
end
|
||||
end
|
@ -0,0 +1,13 @@
|
||||
class SetTimeForOrgMember < ActiveRecord::Migration
|
||||
def up
|
||||
OrgMember.all.each do |member|
|
||||
if(member.created_at.nil?)
|
||||
member.created_at = Time.now - 5.days
|
||||
member.save
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
Loading…
Reference in new issue