Merge branch 'szzh' into dev_hjq
Conflicts: app/views/org_document_comments/edit.html.erb
This commit is contained in:
commit
687c0c8306
|
@ -16,7 +16,7 @@ class OrgMemberController < ApplicationController
|
|||
member_ids = params[:membership][:user_ids]
|
||||
role_id = params[:orgRole]
|
||||
member_ids.each do |user_id|
|
||||
member = OrgMember.create(:user_id=>user_id)
|
||||
member = OrgMember.create(:user_id=>user_id, :created_at => Time.now)
|
||||
@org.org_members << member
|
||||
OrgMemberRole.create(:org_member_id => member.id, :role_id => role_id)
|
||||
end
|
||||
|
|
|
@ -1,5 +1,33 @@
|
|||
# encoding: utf-8
|
||||
class OrganizationsController < ApplicationController
|
||||
|
||||
|
||||
helper :sort
|
||||
include SortHelper
|
||||
helper :custom_fields
|
||||
include CustomFieldsHelper
|
||||
include AvatarHelper
|
||||
include WordsHelper
|
||||
include GitlabHelper
|
||||
include UserScoreHelper
|
||||
|
||||
include PollHelper
|
||||
helper :user_score
|
||||
helper :journals
|
||||
|
||||
# added by liuping 关注
|
||||
|
||||
helper :watchers
|
||||
helper :activities
|
||||
|
||||
### added by william
|
||||
include ActsAsTaggableOn::TagsHelper
|
||||
|
||||
# fq
|
||||
helper :words
|
||||
helper :project_score
|
||||
helper :issues
|
||||
include UsersHelper
|
||||
before_filter :find_organization, :only => [:show, :members]
|
||||
layout 'base_org'
|
||||
def index
|
||||
|
@ -27,9 +55,19 @@ class OrganizationsController < ApplicationController
|
|||
def show
|
||||
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
||||
@organization = Organization.find(params[:id])
|
||||
@activities = OrgActivity.where('(org_act_id = ? and org_act_type = ?) || (container_id =? and org_act_type =? and org_act_id !=?)',
|
||||
@organization.id, 'CreateOrganization ', @organization.id, 'OrgDocumentComment', @organization.home_id).order('updated_at desc')
|
||||
@activities = paginateHelper @activities, 10
|
||||
project_ids = @organization.projects.map(&:id) << 0
|
||||
@org_activities = OrgActivity.where("(container_id =? and container_type =?) or (container_type ='Project' and container_id in (#{project_ids.join(',')}))",
|
||||
@organization.id, 'Organization').order('updated_at desc').page(params[:page] || 1).per(10)
|
||||
@org_activities_count = OrgActivity.where("(container_id =? and container_type =?) or (container_type ='Project' and container_id in (#{project_ids.join(',')}))" ,
|
||||
@organization.id, 'Organization ').count
|
||||
# @org_project_activties = ForgeActivity.where("project_id in (#{project_ids.join(',')}) and forge_act_type in('Issue','Message','ProjectCreateInfo')").order("updated_at desc").page(params[:page] || 1).per(10)
|
||||
# @org_project_activties_count = ForgeActivity.where('project_id in (?)',project_ids.join(',')).count
|
||||
#@org_activities = paginateHelper @org_activities, 10
|
||||
@page = params[:page]
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
end
|
||||
else
|
||||
render_403
|
||||
end
|
||||
|
@ -99,4 +137,13 @@ class OrganizationsController < ApplicationController
|
|||
def members
|
||||
@members = OrgMember.where("organization_id =?", @organization.id)
|
||||
end
|
||||
|
||||
def more_org_projects
|
||||
@organization = Organization.find params[:id]
|
||||
@page = params[:page]
|
||||
@org_projects = @organization.org_projects.reorder('created_at').page((params[:page].to_i || 1) +1).per(5)
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1918,6 +1918,20 @@ class UsersController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def search_user_orgs
|
||||
name=""
|
||||
if !params[:search_orgs].nil?
|
||||
name = params[:search_orgs].strip
|
||||
end
|
||||
name = "%"+name+"%"
|
||||
@orgs = User.current.organizations.where("name like ?", name)
|
||||
@user = User.current
|
||||
respond_to do |format|
|
||||
format.html {render :layout => 'static_base'}
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def find_user
|
||||
|
|
|
@ -2374,8 +2374,10 @@ module ApplicationHelper
|
|||
link_to "作品(#{homework.student_works.count})",student_work_index_path(:homework => homework.id),:class => "c_blue"
|
||||
else #学生显示提交作品、修改作品等按钮
|
||||
work = cur_user_works_for_homework homework
|
||||
if work.nil?
|
||||
if work.nil? && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
|
||||
link_to "提交作品(#{homework.student_works.count})", new_student_work_path(:homework => homework.id),:class => 'c_blue'
|
||||
elsif work.nil? && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d")
|
||||
link_to "补交作品(#{homework.student_works.count})", new_student_work_path(:homework => homework.id),:class => 'c_red'
|
||||
else
|
||||
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前
|
||||
link_to "作品匿评", student_work_index_path(:homework => homework.id), :class => 'c_blue', :title => "开启匿评后不可修改作品"
|
||||
|
|
|
@ -17,4 +17,6 @@ module OrganizationsHelper
|
|||
s + content_tag('ul', links,:class => 'wlist',:style=>'float:left !important', :id => "org_member_pagination_links" )
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
|
|
@ -20,7 +20,7 @@ class ForgeActivity < ActiveRecord::Base
|
|||
validates :forge_act_id,presence: true
|
||||
validates :forge_act_type, presence: true
|
||||
has_many :user_acts, :class_name => 'UserAcivity',:as =>:act
|
||||
after_save :add_user_activity
|
||||
after_save :add_user_activity, :add_org_activity
|
||||
before_destroy :destroy_user_activity
|
||||
|
||||
#在个人动态里面增加当前动态
|
||||
|
@ -45,6 +45,16 @@ class ForgeActivity < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
def add_org_activity
|
||||
OrgActivity.create(:user_id => self.user_id,
|
||||
:org_act_id => self.forge_act_id,
|
||||
:org_act_type => self.forge_act_type,
|
||||
:container_id => self.project_id,
|
||||
:container_type => 'Project',
|
||||
:created_at => self.created_at,
|
||||
:updated_at => self.updated_at)
|
||||
end
|
||||
|
||||
def destroy_user_activity
|
||||
user_activity = UserActivity.where("act_type = '#{self.forge_act_type.to_s}' and act_id = '#{self.forge_act_id}'")
|
||||
user_activity.destroy_all
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<% projects.each do |project|%>
|
||||
<% pro = Project.find project.project_id %>
|
||||
<li class="homepageLeftMenuCoursesLine">
|
||||
<%= link_to pro.name, project_path(pro.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden", :title => pro.name%>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if projects.size == 5%>
|
||||
<li class="homepageLeftMenuMore" id="show_more_org_project">
|
||||
<input type="hidden" value="<%= page%>" id="org_project_page_num">
|
||||
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="show_more_org_project('<%= more_org_projects_organization_path(org_id)%>');"></a>
|
||||
</li>
|
||||
<% end%>
|
|
@ -50,13 +50,9 @@
|
|||
<% end %>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="orgName fl mb5 f14">组织id:<%= @organization.id %></div>
|
||||
<% if User.current.admin_of_org?(@organization) %>
|
||||
<a href="<%= setting_organization_path(@organization) %>" class="pr_join_a c_white"><span class="pr_setting"></span>配置</a>
|
||||
<% end %>
|
||||
|
||||
<div style="clear:both;">
|
||||
<%= link_to l(:label_org_name)+"#{@organization.name}", organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %>
|
||||
<!--<div class="orgName fl mb5 f14">组织id:<%#= @organization.id %></div>-->
|
||||
<div class="orgName fl mb5 f14">
|
||||
<%= link_to @organization.name, organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %>
|
||||
<% if @organization.is_public? %>
|
||||
<span class="img_private"><%= l(:label_public)%></span>
|
||||
<% else %>
|
||||
|
@ -64,6 +60,19 @@
|
|||
<% end %>
|
||||
</div>
|
||||
|
||||
<% if User.current.admin_of_org?(@organization) %>
|
||||
<a href="<%= setting_organization_path(@organization) %>" class="pr_join_a c_white"><span class="pr_setting"></span>配置</a>
|
||||
<% end %>
|
||||
|
||||
<!--<div style="clear:both;">-->
|
||||
<!--<%#= link_to l(:label_org_name)+"#{@organization.name}", organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %>-->
|
||||
<!--<%# if @organization.is_public? %>-->
|
||||
<!--<span class="img_private"><%#= l(:label_public)%></span>-->
|
||||
<!--<%# else %>-->
|
||||
<!--<span class="img_private"><%#= l(:label_private)%></span>-->
|
||||
<!--<%# end %>-->
|
||||
<!--</div>-->
|
||||
|
||||
<div class="cl"></div>
|
||||
<div class="f12 fontGrey3">
|
||||
<%= link_to '文章', organization_org_document_comments_path(@organization) %> (
|
||||
|
@ -76,17 +85,18 @@
|
|||
<div class="homepageLeftMenuBlock">
|
||||
<%= link_to "动态",organization_path(@organization), :class => "homepageMenuText" %>
|
||||
</div>
|
||||
<!--<div class="homepageLeftMenuBlock"><a href="javascript:void(0);" class="homepageMenuText">项目</a><a href="javascript:void(0);" class="homepageMenuSetting fr" title="关联您的已有项目"></a></div>-->
|
||||
<!--<div class="homepageLeftMenuCourses borderBottomNone">-->
|
||||
<!--<ul style="display:none;">-->
|
||||
<!--<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称一</a></li>-->
|
||||
<!--<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称二</a></li>-->
|
||||
<!--<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称三</a></li>-->
|
||||
<!--<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称四</a></li>-->
|
||||
<!--<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称五</a></li>-->
|
||||
<div class="homepageLeftMenuBlock"><a href="javascript:void(0);" class="homepageMenuText">项目</a>
|
||||
<!--<a href="javascript:void(0);" class="homepageMenuSetting fr" title="关联您的已有项目"></a>-->
|
||||
</div>
|
||||
<div class="homepageLeftMenuCourses borderBottomNone">
|
||||
<ul >
|
||||
<%= render :partial => 'layouts/org_projects',:locals=>{:projects=>@organization.org_projects.reorder('created_at').limit(5),:org_id=>@organization.id,:page=>1}%>
|
||||
<!--<%#= @organization.org_projects.each do |p|%>-->
|
||||
<!--<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey"><%#= p.name%></a></li>-->
|
||||
<!--<%# end %>-->
|
||||
<!--<li class="homepageLeftMenuMore"><a href="javascript:void(0);" class="homepageLeftMenuMoreIcon"></a></li>-->
|
||||
<!--</ul>-->
|
||||
<!--</div>-->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepageRight">
|
||||
|
|
|
@ -581,7 +581,10 @@
|
|||
|
||||
}
|
||||
});
|
||||
|
||||
//查询学校
|
||||
$("input[name='province']").on('input', function (e) {
|
||||
throttle(shcool_search_fn,window,e);
|
||||
});
|
||||
|
||||
function throttle(method,context,e){
|
||||
clearTimeout(method.tId);
|
||||
|
@ -603,10 +606,7 @@
|
|||
type: 'post',
|
||||
success: function (data) {
|
||||
schoolsResult = data.schools;
|
||||
count = data.count; //查询学校
|
||||
$("input[name='province']").on('input', function (e) {
|
||||
throttle(shcool_search_fn,window,e);
|
||||
});
|
||||
count = data.count;
|
||||
maxPage = Math.ceil(count/100) //最大页码值
|
||||
if(schoolsResult.length != undefined && schoolsResult.length != 0) {
|
||||
var i = 0;
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
$("#organization_document_<%= @document.id %>").html("");
|
||||
$("#organization_document_<%= @document.id %>").html("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document}) %>");
|
||||
|
||||
$("#organization_document_<%= @document.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document}) %>");
|
||||
init_activity_KindEditor_data(<%= @document.id %>,"","87%");
|
|
@ -16,12 +16,9 @@
|
|||
<% @documents.each do |document| %>
|
||||
<script>
|
||||
$(function() {
|
||||
console.log(111)
|
||||
init_activity_KindEditor_data(<%= document.id%>, null, "87%");
|
||||
});
|
||||
</script>
|
||||
<div id="organization_document_<%= document.id %>">
|
||||
<%= render :partial => 'organizations/show_org_document', :locals => {:document => document} %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -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>
|
|
@ -34,8 +34,7 @@
|
|||
</div>
|
||||
<% end %>
|
||||
</li>
|
||||
<!-- -->
|
||||
<% if ( (User.current.id == member.organization.creator_id || member.roles[0].name == "orgManager" ) && member.user_id != member.organization.creator_id )%>
|
||||
<% if ( (User.current.id == member.organization.creator_id || User.current.admin_of_org?(member.organization) ) && member.user_id != member.organization.creator_id )%>
|
||||
<a href="javascript:void(0);" style="color: #0781B4;margin-left: 30px;float: left" onclick="$(this).parent().height(70);$('#org-member-<%= member.id%>-roles-form').show();">编辑</a>
|
||||
<%= link_to '删除', org_member_path(member.id),:method=>'delete',:style=>'color: #0781B4;margin-left: 30px;float: left',:confirm=>'您确定要删除么?', :remote => true %><% end %>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<%= stylesheet_link_tag 'courses' %>
|
||||
<div class="resources">
|
||||
<div class="resources mt10">
|
||||
<div class="project_r_h" style="width: 720px;">
|
||||
<h2 class="project_h2"> 组织成员</h2>
|
||||
</div>
|
||||
|
@ -16,6 +16,9 @@
|
|||
<span class="fl ml10 c_grey"><%= l(:label_username)%></span>
|
||||
<%= link_to(member.user.show_name, user_path(member.user),:class => "ml5 c_blue02") %><br />
|
||||
<span class="fl c_grey ml10">身份:<%= member.user.admin_of_org?(organization)?"组织管理员":"组织成员" %></span>
|
||||
<% if member.created_at %>
|
||||
<span class="fr c_grey"><%= format_time(member.created_at) %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<% org_project_activties.each do |act|%>
|
||||
<% if act %>
|
||||
<% if act %>
|
||||
<% case act.forge_act_type.to_s %>
|
||||
<% when 'Issue' %>
|
||||
<%= render :partial => 'organizations/org_project_issue', :locals => {:activity => act.forge_act,:user_activity_id =>act.id} %>
|
||||
<% when 'Message' %>
|
||||
<%= render :partial => 'organizations/project_message', :locals => {:activity => act.forge_act,:user_activity_id =>act.id} %>
|
||||
<% when 'ProjectCreateInfo'%>
|
||||
<%= render :partial => 'organizations/project_create', :locals => {:activity => act,:user_activity_id =>act.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if org_act_count == 10 || pro_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>
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% end %> TO
|
||||
<%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word">
|
||||
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey" %>
|
||||
<span class='<%#= get_issue_priority(activity.priority_id)[0] %>'>
|
||||
<%#= get_issue_priority(activity.priority_id)[1] %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostAssignTo">指派给
|
||||
<% unless activity.assigned_to_id.nil? %>
|
||||
<% if activity.try(:assigned_to).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostDeadline">
|
||||
时间:
|
||||
<%=format_time(activity.created_on) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<% if activity.description? %>
|
||||
<%= textAreailizable activity, :description, :attachments => activity.attachments %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<% if activity.attachments.any? %>
|
||||
<% activity.attachments.each do |attachment| %>
|
||||
<div class="break_word">
|
||||
<span class="fl">
|
||||
<span title="<%= attachment.filename %>" id="attachment_">
|
||||
<%= link_to_short_attachment attachment,:length=> 58, :class => 'link_file_a fl newsBlue', :download => true -%>
|
||||
</span>
|
||||
<% if attachment.is_text? %>
|
||||
<%= link_to image_tag('magnifier.png'),
|
||||
:controller => 'attachments',
|
||||
:action => 'show',
|
||||
:id => attachment,
|
||||
:class => 'fl',
|
||||
:filename => attachment.filename %>
|
||||
<% end %>
|
||||
</span>
|
||||
<span class="postAttSize">(
|
||||
<%= number_to_human_size attachment.filesize %>)
|
||||
</span>
|
||||
<span class="author" title="<%= attachment.author%>">
|
||||
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>,
|
||||
<%= format_time(attachment.created_on) %>
|
||||
</span>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count = activity.journals.count %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
|
||||
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
|
||||
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(<%= count %>)</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||
<% if count > 3 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%= user_activity_id %>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
|
||||
展开更多
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.journals.reorder("created_on desc").each do |reply| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i=replies_all_i + 1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<% if reply.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(reply.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
||||
<% if reply.details.any? %>
|
||||
<% details_to_strings(reply.details).each do |string| %>
|
||||
<p><%= string %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<P><%= reply.notes.nil? ? "" : reply.notes.html_safe %></P>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,38 @@
|
|||
<% project = Project.find(activity.project_id) %>
|
||||
<% user = User.find(project.user_id)%>
|
||||
<div class="resources mt10">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_path(user), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if user.try(:realname) == ' ' %>
|
||||
<%= link_to user, user_path(user), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to user.try(:realname), user_path(user), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to project.to_s+" | 项目", project_path(project.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word" >
|
||||
<%= link_to project.name, project_path(project.id,:host=>Setting.host_course), :class => "postGrey" %>
|
||||
</div>
|
||||
<div class="homepagePostDate">
|
||||
创建时间:<%= format_time(project.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,100 @@
|
|||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word mt-4">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to activity.project.name.to_s+" | 项目讨论区",project_boards_path(activity.project), :class => "newsBlue ml15 mr5"%>
|
||||
<!--<a href="javascript:void(0);" class="newsBlue ml15 mr5"><%= activity.project.name %>(项目讨论区)</a>-->
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<%= link_to activity.subject.to_s.html_safe, project_boards_path(activity.project,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey"
|
||||
%>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, project_boards_path(activity.project,:parent_id =>activity.parent_id, :topic_id => activity.id), :class=> "postGrey"
|
||||
%>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostDate">
|
||||
时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostIntro break_word upload_img list_style maxh360 lh18 table_maxWidth" id="activity_description_<%= user_activity_id%>">
|
||||
<div id="intro_content_<%= user_activity_id%>">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<%= activity.content.to_s.html_safe%>
|
||||
<% else %>
|
||||
<%= activity.parent.content.to_s.html_safe%>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% count = 0 %>
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
<% count=activity.children.count%>
|
||||
<% end %>
|
||||
<div class="homepagePostReply">
|
||||
<div class="topBorder" style="display: <%= count>0 ? 'none': '' %>"></div>
|
||||
<div class="homepagePostReplyBanner" style="display: <%= count>0 ? '': 'none' %>">
|
||||
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(
|
||||
<%=count %>
|
||||
)</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
|
||||
<%if count>3 %>
|
||||
<div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >展开更多</a></div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% activity= activity.parent_id.nil? ? activity : activity.parent %>
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<ul>
|
||||
<% activity.children.reorder("created_on desc").each do |reply| %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= reply.id %>');
|
||||
});
|
||||
</script>
|
||||
<% replies_all_i=replies_all_i+1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher mt-4">
|
||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to reply.try(:author), user_path(reply.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(reply.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
|
||||
<%= reply.content.html_safe %></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
|
@ -1,75 +1,76 @@
|
|||
<div class="resources mt10">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo">
|
||||
<%= link_to User.find(document.creator_id), user_path(document.creator.id), :class => "newsBlue mr15" %>
|
||||
TO <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %> |
|
||||
<% if defined?(home_id) %>
|
||||
<span style="color:#269ac9;">首页</span>
|
||||
<% else %>
|
||||
<span style="color:#269ac9;">组织</span>
|
||||
<% end %>
|
||||
<div class="resources mt10" id="organization_document_<%= document.id %>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(User.find(document.creator_id)), :width => 45, :heigth => 45), user_path(document.creator_id) %>
|
||||
</div>
|
||||
<div class="homepagePostTitle postGrey"><%= document.title %></div>
|
||||
<div class="homepagePostDate">
|
||||
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %></div>
|
||||
<% unless document.content.blank? %>
|
||||
<div class="homepagePostIntro">
|
||||
<%= document.content.html_safe %>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- <%# if defined?(home_id) %>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo">
|
||||
<%= link_to User.find(document.creator_id), user_path(document.creator.id), :class => "newsBlue mr15" %>
|
||||
TO <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %>
|
||||
|
|
||||
<% if document.organization.home_id == document.id %>
|
||||
<span style="color:#269ac9;">首页</span>
|
||||
<% else %>
|
||||
<span style="color:#269ac9;">组织</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostTitle postGrey"><%= document.title %></div>
|
||||
<div class="homepagePostDate">
|
||||
发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %></div>
|
||||
<% unless document.content.blank? %>
|
||||
<div class="homepagePostIntro">
|
||||
<%= document.content.html_safe %>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- <%# if defined?(home_id) %>
|
||||
<div style="float:right;">最后编辑:<%#= User.find() %></div>
|
||||
<%# end %>-->
|
||||
<% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id) || User.current.id == document.creator_id) %>
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= form_for('new_form',:url => {:controller => 'organizations',:action => 'set_homepage',:id => document.organization_id, :home_id => document.id},:method => "put",:remote => true) do |f|%>
|
||||
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">设为首页</a>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :class => "postOptionLink" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:remote => true, :class => 'postOptionLink' %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% comments_for_doc = document.children.reorder("created_at desc") %>
|
||||
<% count = document.children.count() %>
|
||||
|
||||
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>">
|
||||
<div class="homepagePostReplyBanner" style="display:<%= count == 0?'none':'block' %>">
|
||||
<div class="homepagePostReplyBannerCount">回复(<%= count %>)</div>
|
||||
<% if count > 3 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%= document.id %>" onclick="expand_reply('#reply_div_<%= document.id %> li','#reply_btn_<%=document.id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
|
||||
展开更多
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if User.current.admin? || User.current.admin_of_org?(Organization.find(document.organization_id) || User.current.id == document.creator_id) %>
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => document.organization_id, :home_id => document.id}, :method => "put", :remote => true) do |f| %>
|
||||
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">设为首页</a>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "编辑文章", edit_org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :class => "postOptionLink" %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "删除文章", org_document_comment_path(:id => document.id, :organization_id => document.organization_id), :method => 'delete',
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:remote => true, :class => 'postOptionLink' %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepagePostReplyContainer" id="reply_div_<%= document.id %>" style="display:<%= count == 0?'none':'block' %>">
|
||||
<% comments_for_doc = document.children.reorder("created_at desc") %>
|
||||
<% count = document.children.count() %>
|
||||
|
||||
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>">
|
||||
<div class="homepagePostReplyBanner" style="display:<%= count == 0 ? 'none' : 'block' %>">
|
||||
<div class="homepagePostReplyBannerCount">回复(<%= count %>)</div>
|
||||
<% if count > 3 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
<a id="reply_btn_<%= document.id %>" onclick="expand_reply('#reply_div_<%= document.id %> li','#reply_btn_<%=document.id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
|
||||
展开更多
|
||||
</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostReplyContainer" id="reply_div_<%= document.id %>" style="display:<%= count == 0 ? 'none' : 'block' %>">
|
||||
<ul>
|
||||
<% reply_id = 0 %>
|
||||
<% comments_for_doc.each do |comment| %>
|
||||
<% reply_id += 1 %>
|
||||
<li style="display:<%= reply_id > 3? 'none':'' %>">
|
||||
<li style="display:<%= reply_id > 3 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait"><%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像"), user_path(comment.creator_id) %></div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
|
@ -87,12 +88,12 @@
|
|||
</div>
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15">
|
||||
<%=link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_path(User.current) %>
|
||||
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_path(User.current) %>
|
||||
</div>
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<div nhname='new_message_<%= document.id %>' style="display:none;">
|
||||
<%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id), :method => "post", :remote => true) do |f| %>
|
||||
<input type="hidden" name="user_activity_id" value="<%= document.id %>" />
|
||||
<input type="hidden" name="user_activity_id" value="<%= document.id %>"/>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= document.id %>' name="org_content"></textarea>
|
||||
|
||||
<div nhname='toolbar_container_<%= document.id %>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
|
||||
|
@ -110,15 +111,15 @@
|
|||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function expand_reply(container,btnid){
|
||||
function expand_reply(container, btnid) {
|
||||
var target = $(container);
|
||||
var btn = $(btnid);
|
||||
if(btn.data('init')=='0'){
|
||||
btn.data('init',1);
|
||||
if (btn.data('init') == '0') {
|
||||
btn.data('init', 1);
|
||||
btn.html('收起回复');
|
||||
target.show();
|
||||
}else{
|
||||
btn.data('init',0);
|
||||
} else {
|
||||
btn.data('init', 0);
|
||||
btn.html('展开更多');
|
||||
target.hide();
|
||||
target.eq(0).show();
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
$("#show_more_org_project").replaceWith("<%= escape_javascript( render :partial => 'layouts/org_projects',:locals => {:projects => @org_projects,:org_id => @organization, :page => @page} )%>");
|
|
@ -30,42 +30,16 @@
|
|||
init_activity_KindEditor_data(<%= @organization.home_id%>, null, "87%");
|
||||
});
|
||||
</script>
|
||||
<div id="organization_document_<%= @organization.home_id %>">
|
||||
<%= render :partial => 'show_org_document', :locals => {:document => OrgDocumentComment.find(@organization.home_id), :home_id => @organization.home_id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% unless @activities.nil? %>
|
||||
<% @activities.each do |act| %>
|
||||
<% 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' %>
|
||||
<script>
|
||||
$(function() {
|
||||
init_activity_KindEditor_data(<%= act.org_act.id%>, null, "87%");
|
||||
});
|
||||
</script>
|
||||
<div id="organization_document_<%= act.org_act.id %>">
|
||||
<%= render :partial => 'show_org_document', :locals => {:document => act.org_act} %>
|
||||
</div>
|
||||
<% 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 %>
|
||||
<%= render :partial => 'organizations/org_activities',
|
||||
:locals => {:org_activities =>@org_activities,
|
||||
:page=>@page,
|
||||
:org => @organization,
|
||||
:org_act_count=>@org_activities.count}%>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
$("#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} )%>");
|
||||
|
|
@ -23,7 +23,11 @@
|
|||
<% else %>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
|
||||
<% end %>
|
||||
<span class="green_homework_btn_cir ml5">作品提交中</span>
|
||||
<% if Time.parse(activity.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")%>
|
||||
<span class="green_homework_btn_cir ml5">作品提交中</span>
|
||||
<% elsif Time.parse(activity.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") %>
|
||||
<span class="red_homework_btn_cir ml5">作品补交中</span>
|
||||
<% end %>
|
||||
<% elsif activity.homework_detail_manual.comment_status == 2%>
|
||||
<% if activity.anonymous_comment == 0%>
|
||||
<span class="green_homework_btn_cir ml5">匿评中</span>
|
||||
|
|
|
@ -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>
|
|
@ -23,7 +23,11 @@
|
|||
<% else %>
|
||||
<span class="grey_homework_btn_cir ml5">匿评已禁用</span>
|
||||
<% end %>
|
||||
<span class="green_homework_btn_cir ml5">作品提交中</span>
|
||||
<% if Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")%>
|
||||
<span class="green_homework_btn_cir ml5">作品提交中</span>
|
||||
<% elsif Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") %>
|
||||
<span class="red_homework_btn_cir ml5">作品补交中</span>
|
||||
<% end %>
|
||||
<% elsif homework_common.homework_detail_manual.comment_status == 2%>
|
||||
<% if homework_common.anonymous_comment == 0%>
|
||||
<span class="green_homework_btn_cir ml5">匿评中</span>
|
||||
|
|
|
@ -17,12 +17,16 @@
|
|||
|
||||
<div class=" mt10">
|
||||
<%= link_to("导入作业", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true) unless edit_mode%>
|
||||
<label class="fl c_grey f14" style="margin-top: 4px;">截止日期:</label>
|
||||
<div class="calendar_div fl">
|
||||
<% if edit_mode %>
|
||||
<label class="fl c_grey f14" style="margin-top: 4px;">截止日期:</label>
|
||||
<% end %>
|
||||
<div class="calendar_div fl mr10">
|
||||
<input type="text" name="homework_common[end_time]" id="homework_end_time" placeholder="截止日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.end_time%>" >
|
||||
<%= calendar_for('homework_end_time')%>
|
||||
</div>
|
||||
<label class="fl c_grey f14 ml10" style="margin-top: 4px;">发布日期(可选):</label>
|
||||
<% if edit_mode %>
|
||||
<label class="fl c_grey f14" style="margin-top: 4px;">发布日期(可选):</label>
|
||||
<% end %>
|
||||
<div class="calendar_div fl">
|
||||
<input type="text" name="homework_common[publish_time]" id="homework_publish_time" placeholder="发布日期(可选)" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.publish_time%>" >
|
||||
<%= calendar_for('homework_publish_time')%>
|
||||
|
|
|
@ -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}) %>")
|
|
@ -1,4 +1,4 @@
|
|||
<%= stylesheet_link_tag 'pleft','header','new_user','repository','org' %>
|
||||
<%= 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">
|
||||
|
@ -6,30 +6,34 @@
|
|||
<div class="postBanner" style="padding-bottom:5px;">
|
||||
<span class="linkGrey2 f16">组织列表</span>
|
||||
|
||||
<form class="resourcesSearchloadBox" style="float:right; margin-top:-5px;">
|
||||
<input type="text" name="serach" placeholder="输入关键词进行搜索" class="searchResource"/>
|
||||
<a href="javascript:void(0);" class="homepageSearchIcon"></a>
|
||||
</form>
|
||||
<%= 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>
|
||||
<% @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 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="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 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>
|
||||
<!--<div class="mt28 fr"><a href="javascript:void(0);" class="linkGrey5">申请加入</a></div>-->
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -37,6 +37,7 @@ RedmineApp::Application.routes.draw do
|
|||
get 'clear_org_avatar_temp'
|
||||
put 'set_homepage'
|
||||
get 'members'
|
||||
get 'more_org_projects'
|
||||
end
|
||||
collection do
|
||||
get 'check_uniq'
|
||||
|
@ -443,6 +444,7 @@ RedmineApp::Application.routes.draw do
|
|||
get 'dealwith_apply_request'
|
||||
get 'store_selected_resource'
|
||||
get 'user_organizations'
|
||||
get 'search_user_orgs'
|
||||
# end
|
||||
end
|
||||
#resources :blogs
|
||||
|
|
|
@ -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
|
|
@ -1,4 +1,4 @@
|
|||
//添加组织成员的提交函数
|
||||
//<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֯<EFBFBD><EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>ύ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
function submit_add_org_members(){
|
||||
$("#org_member_add_form").submit();
|
||||
}
|
||||
|
@ -31,4 +31,15 @@ function observeSearchfield(fieldId, targetId, url) {
|
|||
var timer = setInterval(check, 300);
|
||||
$this.bind('keyup click mousemove', reset);
|
||||
});
|
||||
}
|
||||
|
||||
//显示更多的项目
|
||||
function show_more_org_project(url){
|
||||
$.get(
|
||||
url,
|
||||
{ page: $("#org_project_page_num").val() },
|
||||
function (data) {
|
||||
|
||||
}
|
||||
);
|
||||
}
|
|
@ -182,6 +182,7 @@ a.f_grey:hover {color:#000000;}
|
|||
/*.upbtn{ margin:42px 0 0 10px; border:none; color:#999; width:150px;}*/
|
||||
.red_btn_cir{ background:#e74c3c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
|
||||
.green_btn_cir{ background:#28be6c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
|
||||
.red_homework_btn_cir{ background:#e74c3c; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
|
||||
.green_homework_btn_cir{ background:#28be6c; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
|
||||
.grey_btn_cir{ background:#b2b2b2; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
|
||||
.grey_homework_btn_cir{ background:#b2b2b2; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
|
||||
|
|
|
@ -299,6 +299,7 @@ a:hover.bgreen_n_btn{background:#08a384;}
|
|||
.green_btn_cir{ background:#28be6c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
|
||||
.green_homework_btn_cir{ background:#28be6c; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
|
||||
.grey_btn_cir{ background:#b2b2b2; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
|
||||
.red_homework_btn_cir{ background:#e74c3c; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
|
||||
.grey_homework_btn_cir{ background:#b2b2b2; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
|
||||
.blue_btn_cir{ background:#3498db; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
|
||||
.orange_btn_cir{ background:#e67e22; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
|
||||
|
|
Loading…
Reference in New Issue