1.修复项目新闻发送至其他项目后,位于讨论区下的bug
2.资料未完善情况下,“修改资料”可操作 3.组织成员列表增加分页功能(配置成员页面分页为完成) 4.修复回复表情显示不对
This commit is contained in:
parent
d37cbaad61
commit
548a263f0f
|
@ -30,7 +30,7 @@ class AccountController < ApplicationController
|
||||||
user = UserExtensions.where(:user_id => User.current.id).first
|
user = UserExtensions.where(:user_id => User.current.id).first
|
||||||
if user.gender.nil? || user.school_id.nil? || User.current.lastname.nil?
|
if user.gender.nil? || user.school_id.nil? || User.current.lastname.nil?
|
||||||
redirect_to my_account_path(:tip => 1)
|
redirect_to my_account_path(:tip => 1)
|
||||||
elsif user.identity == 3 && user.occupation.nil?
|
elsif user.identity == 3 && user.school_id.nil?
|
||||||
redirect_to my_account_path(:tip => 1)
|
redirect_to my_account_path(:tip => 1)
|
||||||
else
|
else
|
||||||
redirect_to user_path(User.current)
|
redirect_to user_path(User.current)
|
||||||
|
@ -359,7 +359,7 @@ class AccountController < ApplicationController
|
||||||
user = UserExtensions.where(:user_id => User.current.id).first
|
user = UserExtensions.where(:user_id => User.current.id).first
|
||||||
if user.gender.nil? || user.school_id.nil? || User.current.lastname.nil?
|
if user.gender.nil? || user.school_id.nil? || User.current.lastname.nil?
|
||||||
redirect_to my_account_path(:tip => 1)
|
redirect_to my_account_path(:tip => 1)
|
||||||
elsif user.identity == 3 && user.occupation.nil?
|
elsif user.identity == 3 && user.school_id.nil?
|
||||||
redirect_to my_account_path(:tip => 1)
|
redirect_to my_account_path(:tip => 1)
|
||||||
else
|
else
|
||||||
redirect_back_or_default User.current
|
redirect_back_or_default User.current
|
||||||
|
|
|
@ -421,6 +421,7 @@ class OrganizationsController < ApplicationController
|
||||||
@organization = Organization.find(params[:id])
|
@organization = Organization.find(params[:id])
|
||||||
|
|
||||||
if User.current.admin? || User.current.admin_of_org?(@organization)
|
if User.current.admin? || User.current.admin_of_org?(@organization)
|
||||||
|
@members = OrgMember.where(:organization_id => @organization.id).all.sort
|
||||||
else
|
else
|
||||||
render_403
|
render_403
|
||||||
end
|
end
|
||||||
|
@ -451,10 +452,11 @@ class OrganizationsController < ApplicationController
|
||||||
|
|
||||||
def members
|
def members
|
||||||
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
|
||||||
@members = OrgMember.where("organization_id =?", @organization.id)
|
@members = OrgMember.where(:organization_id => @organization.id).all.sort
|
||||||
else
|
else
|
||||||
render_403
|
render_403
|
||||||
end
|
end
|
||||||
|
@members = paginateHelper @members, 20
|
||||||
end
|
end
|
||||||
|
|
||||||
def more_org_projects
|
def more_org_projects
|
||||||
|
|
|
@ -580,6 +580,7 @@ class ProjectsController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@members = paginateHelper @members
|
@members = paginateHelper @members
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_message_status(user, project)
|
def update_message_status(user, project)
|
||||||
|
|
|
@ -2628,7 +2628,8 @@ class UsersController < ApplicationController
|
||||||
project_ids.each do |project_id|
|
project_ids.each do |project_id|
|
||||||
project = Project.find(project_id)
|
project = Project.find(project_id)
|
||||||
if project.news.map(&:id).exclude?(news.id)
|
if project.news.map(&:id).exclude?(news.id)
|
||||||
message = Message.create(:board_id => project.boards.first.id, :subject => news.title, :content => news.description, :author_id => User.current.id)
|
# message = Message.create(:board_id => project.boards.first.id, :subject => news.title, :content => news.description, :author_id => User.current.id)
|
||||||
|
message = News.create(:project_id => project.id, :title => news.title, :summary => news.summary, :description => news.description, :author_id => User.current.id, :created_on => Time.now )
|
||||||
# record forward to table forwards if new record is valid
|
# record forward to table forwards if new record is valid
|
||||||
if message.valid?
|
if message.valid?
|
||||||
news.forwards << Forward.new(:to_type => message.class.name, :to_id => message.id)
|
news.forwards << Forward.new(:to_type => message.class.name, :to_id => message.id)
|
||||||
|
|
|
@ -74,7 +74,6 @@
|
||||||
});
|
});
|
||||||
function check_and_submit(doc){
|
function check_and_submit(doc){
|
||||||
$("#error").html('').hide();
|
$("#error").html('').hide();
|
||||||
check_forum_name();
|
|
||||||
if( $("textarea[name='forum[name]']").val().trim() == "" && $("textarea[name='forum[description]']").val().trim() != "" ){
|
if( $("textarea[name='forum[name]']").val().trim() == "" && $("textarea[name='forum[description]']").val().trim() != "" ){
|
||||||
$("#error").html("名称不能为空").show();
|
$("#error").html("名称不能为空").show();
|
||||||
return;
|
return;
|
||||||
|
@ -98,7 +97,6 @@
|
||||||
'<%= check_forum_name_forums_path %>',
|
'<%= check_forum_name_forums_path %>',
|
||||||
{"forum_name":encodeURIComponent(name)},
|
{"forum_name":encodeURIComponent(name)},
|
||||||
function(data){
|
function(data){
|
||||||
|
|
||||||
if( data == 'true'){
|
if( data == 'true'){
|
||||||
$("#error").html("贴吧名称已经存在").show();
|
$("#error").html("贴吧名称已经存在").show();
|
||||||
check_pass = false;
|
check_pass = false;
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
<a href ="javascript:void(0);" disabled="true"><%= image_tag(url_to_avatar(User.current),:width =>"40",:height => "40",:alt=>"头像", :id => "nh_user_logo", :class => "portraitRadius") %></a>
|
<a href ="javascript:void(0);" disabled="true"><%= image_tag(url_to_avatar(User.current),:width =>"40",:height => "40",:alt=>"头像", :id => "nh_user_logo", :class => "portraitRadius") %></a>
|
||||||
<ul class="topnav_login_list none" id="topnav_login_list">
|
<ul class="topnav_login_list none" id="topnav_login_list">
|
||||||
<li>
|
<li>
|
||||||
<a href ="javascript:void(0);" class="menuGrey" disabled="true">修改资料</a>
|
<%= link_to "添加成员", my_account_path(:tip => 1), :class => "menuGrey"%>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href ="javascript:void(0);" class="menuGrey" disabled="true">我的组织</a>
|
<a href ="javascript:void(0);" class="menuGrey" disabled="true">我的组织</a>
|
||||||
|
|
|
@ -90,7 +90,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="homepagePostReplyDes">
|
<div class="homepagePostReplyDes">
|
||||||
<div class="homepagePostReplyPublisher"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a><%= format_date(reply.created_at) %></div>
|
<div class="homepagePostReplyPublisher"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a><%= format_date(reply.created_at) %></div>
|
||||||
<div class="homepagePostReplyContent" id="activity_description_<%= reply.id %>"><%= h reply.content%></div>
|
<div class="homepagePostReplyContent" id="activity_description_<%= reply.id %>"><%= h reply.content.html_safe%></div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
|
|
|
@ -101,22 +101,20 @@
|
||||||
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
|
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
|
<!-- link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" -->
|
||||||
|
<a href = "javascript:void(0);" class = "homepageMenuText" onclick = "$('#PostDomain_<%= field.id %>').slideToggle();"><%= field.name %></a>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
|
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
|
||||||
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子" %>
|
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<div class="<%= (field.sub_domains.count == 0) ? 'homepageLeftMenuCourses':'homepageLeftMenuCourses borderBottomNone' %>" id="PostDomain_<%= field.id %>" style="display:none;">
|
<div class="homepageLeftMenuCourses" id="PostDomain_<%= field.id %>" style="display:<%= field.sub_domains.count == 0 ? 'none' : '' %>">
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<%= render :partial => 'organizations/org_subdomain',:locals => {:subdomains => field.sub_domains.reorder('priority').uniq, :org_subfield_id => field.id} %>
|
<%= render :partial => 'organizations/org_subdomain',:locals => {:subdomains => field.sub_domains.reorder('priority').uniq, :org_subfield_id => field.id} %>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<% unless (field.sub_domains.count == 0 || !if_hidden_subdomain(field)) %>
|
|
||||||
<li class="homepageLeftMenuMore" id="sub_domain_jiantou_<%= field %>">
|
|
||||||
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="$('#PostDomain_<%= field.id %>').slideToggle();" style="border-bottom: 1px solid #ddd;"></a>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
<% elsif field.field_type == "Comptec" %>
|
<% elsif field.field_type == "Comptec" %>
|
||||||
<div class="homepageLeftMenuBlock">
|
<div class="homepageLeftMenuBlock">
|
||||||
<%= link_to "#{field.name}", teachers_organization_path(organization, :org_subfield_id => field.id, :type => "#{User.current.admin? ? "" : "famous"}"), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
|
<%= link_to "#{field.name}", teachers_organization_path(organization, :org_subfield_id => field.id, :type => "#{User.current.admin? ? "" : "famous"}"), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
|
||||||
|
|
|
@ -34,8 +34,10 @@
|
||||||
<% if ( (User.current.id == member.organization.creator_id || User.current.admin_of_org?(member.organization) ) && 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();$('#org-member-<%= member.id%>-roles-form').show();">编辑</a>
|
<a href="javascript:void(0);" style="color: #0781B4;margin-left: 30px;float: left" onclick = "$(this).parent().height();$('#org-member-<%= member.id%>-roles-form').show();">编辑</a>
|
||||||
<a href="javascript:void(0)" style = "color: #0781B4;margin-left: 30px;float: left" onclick = "ifDeleteOrgMember('<%= member.id %>','<%= username %>')" >删除</a>
|
<a href="javascript:void(0)" style = "color: #0781B4;margin-left: 30px;float: left" onclick = "ifDeleteOrgMember('<%= member.id %>','<%= username %>')" >删除</a>
|
||||||
<%#= link_to '删除', Setting.protocol + "://" + Setting.host_name + "/org_member/" + member.id.to_s,:method=>'delete',:style=>'color: #0781B4;margin-left: 30px;float: left',:confirm=>'您确定要删除么?', :remote => true %><% end %>
|
<%#= link_to '删除', Setting.protocol + "://" + Setting.host_name + "/org_member/" + member.id.to_s,:method=>'delete',:style=>'color: #0781B4;margin-left: 30px;float: left',:confirm=>'您确定要删除么?', :remote => true %>
|
||||||
|
<% end %>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
<% end%>
|
<% end%>
|
||||||
|
|
||||||
<ul class="wlist">
|
<ul class="wlist">
|
||||||
<%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true %>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,9 +4,11 @@
|
||||||
//如果有N个标签,就将i<=N;
|
//如果有N个标签,就将i<=N;
|
||||||
for(var i=1;i<=3;i++){
|
for(var i=1;i<=3;i++){
|
||||||
g('orgSetting_'+i).className='orgSettingOp';
|
g('orgSetting_'+i).className='orgSettingOp';
|
||||||
g('orgContent_'+i).className='undis';}
|
g('orgContent_'+i).className='undis';
|
||||||
|
}
|
||||||
g('orgContent_'+n).className='dis ml15 mr15';
|
g('orgContent_'+n).className='dis ml15 mr15';
|
||||||
g('orgSetting_'+n).className='orgSettingOp orgOpActive';}
|
g('orgSetting_'+n).className='orgSettingOp orgOpActive';
|
||||||
|
}
|
||||||
//如果要做成点击后再转到请将<li>中的onmouseover 改成 onclick;
|
//如果要做成点击后再转到请将<li>中的onmouseover 改成 onclick;
|
||||||
//]]>
|
//]]>
|
||||||
$checkName = true;
|
$checkName = true;
|
||||||
|
@ -103,9 +105,10 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</ul>
|
</ul>
|
||||||
<div id="org_member_list">
|
<div id="org_member_list">
|
||||||
<%= render :partial=>"org_member_list",:locals=> {:members=>@organization.org_members} %>
|
<%= render :partial => "org_member_list", :locals => {:members => @members} %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="fr orgMemContainer">
|
<div class="fr orgMemContainer">
|
||||||
<div class="orgMemberAdd">
|
<div class="orgMemberAdd">
|
||||||
<p class="fontBlue fb mb5">添加成员</p>
|
<p class="fontBlue fb mb5">添加成员</p>
|
||||||
|
@ -176,6 +179,7 @@
|
||||||
<%= render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)} %>
|
<%= render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)} %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
function add_org_subfield(){
|
function add_org_subfield(){
|
||||||
|
|
|
@ -25,3 +25,6 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
<li class="homepagePostSettingIcon">
|
<li class="homepagePostSettingIcon">
|
||||||
<% if User.current.logged? %>
|
<% if User.current.logged? %>
|
||||||
<ul class="homepagePostSettiongText">
|
<ul class="homepagePostSettiongText">
|
||||||
<li><%= link_to("发送", 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{activity.id}',#{User.current.id},'news')") %></li>
|
<li><%= link_to("发送", 'javascript:void(0)', :class => "postOptionLink", :onclick => "show_send('#{activity.id}', '#{User.current.id}', 'news')") %></li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to(
|
<%= link_to(
|
||||||
l(:button_edit),
|
l(:button_edit),
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
//<2F><><EFBFBD><EFBFBD><EFBFBD>֯<EFBFBD><D6AF>Ա<EFBFBD><D4B1><EFBFBD>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>֯<EFBFBD><D6AF>Ա<EFBFBD><D4B1><EFBFBD>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>
|
||||||
|
// 组织:新增成员
|
||||||
function submit_add_org_members(){
|
function submit_add_org_members(){
|
||||||
$("#org_member_add_form").submit();
|
$("#org_member_add_form").submit();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue