1.修复项目新闻发送至其他项目后,位于讨论区下的bug

2.资料未完善情况下,“修改资料”可操作
3.组织成员列表增加分页功能(配置成员页面分页为完成)
4.修复回复表情显示不对
This commit is contained in:
daiao 2016-08-31 17:09:02 +08:00
parent d37cbaad61
commit 548a263f0f
16 changed files with 45 additions and 35 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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>
@ -46,7 +46,7 @@
</li> </li>
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>--> <!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
<li> <li>
<%= link_to "退出",logout_url_without_domain,:class => "menuGrey",:method => "post"%> <%= link_to "退出", logout_url_without_domain, :class => "menuGrey", :method => "post"%>
</li> </li>
</ul> </ul>
</li> </li>

View File

@ -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(){

View File

@ -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();" %>

View File

@ -22,20 +22,22 @@
<% end %> <% end %>
<%= hidden_field_tag 'membership[role_ids][]', '' %> <%= hidden_field_tag 'membership[role_ids][]', '' %>
<div class="pt5"> <div class="pt5">
<a href="javascript:void(0)" class="org_member_btn" onclick="$('#org-member-<%= member.id%>-roles-form').submit();" style="margin-right: 10px;"> <a href="javascript:void(0)" class="org_member_btn" onclick = "$('#org-member-<%= member.id%>-roles-form').submit();" style="margin-right: 10px;">
<%= l(:button_change)%> <%= l(:button_change)%>
</a> </a>
<a href="javascript:void(0)" class="org_member_btn" onclick="$('#org-member-<%= member.id%>-roles-form').hide();$(this).parent().parent().parent().parent().height(18)"> <a href="javascript:void(0)" class="org_member_btn" onclick = "$('#org-member-<%= member.id%>-roles-form').hide();$(this).parent().parent().parent().parent().height(18)">
<%= l(:button_cancel)%> <%= l(:button_cancel)%>
</a> </a>
</div> </div>
<% end %> <% end %>
</li> </li>
<% 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 %>

View File

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

View File

@ -1,12 +1,14 @@
<script> <script>
function g(o){return document.getElementById(o);} function g(o){return document.getElementById(o);}
function HoverLi(n){ function HoverLi(n){
//如果有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;
@ -92,7 +94,7 @@
<!--<input id="allow_set_excellent_teachers" type="checkbox" style="margin-top:5px;" name="organization[allow_teacher]" <%#= @organization.allow_teacher==1 ? 'checked': ''%> class="ml3" />--> <!--<input id="allow_set_excellent_teachers" type="checkbox" style="margin-top:5px;" name="organization[allow_teacher]" <%#= @organization.allow_teacher==1 ? 'checked': ''%> class="ml3" />-->
<!--</div>--> <!--</div>-->
<!--<%# end %>--> <!--<%# end %>-->
<a href="javascript:void(0);" class="saveBtn ml80 db fl" onclick="update_org('<%=@organization.id %>','<%= @organization.name %>', $('#organization_name'));">保存</a> <a href="javascript:void(0);" class="saveBtn ml80 db fl" onclick = "update_org('<%=@organization.id %>', '<%= @organization.name %>', $('#organization_name'));">保存</a>
<% end %> <% end %>
</div> </div>
<div class="undis ml15 mr15" id="orgContent_2"> <div class="undis ml15 mr15" id="orgContent_2">
@ -103,16 +105,17 @@
<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>
<%= form_tag url_for(:controller => 'org_member', :action => 'create', :org => @organization),:id=>'org_member_add_form',:remote=>true do |f|%> <%= form_tag url_for(:controller => 'org_member', :action => 'create', :org => @organization),:id => 'org_member_add_form', :remote => true do |f|%>
<input type="text" id="not_org_member_search" name="orgAddSearch" placeholder="支持姓名、邮箱、登录名搜索" class="orgAddSearch mb20" /> <input type="text" id="not_org_member_search" name="orgAddSearch" placeholder="支持姓名、邮箱、登录名搜索" class="orgAddSearch mb20" />
<%# if @organization.secdomain_name.nil? %> <%# if @organization.secdomain_name.nil? %>
<%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %> <%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript "/org_member/org_member_autocomplete?" + {:org => @organization.id}.to_query }')" %>
<%#= javascript_tag "observeSearchfield('not_org_member_search', null, '#{url_for(:controller => 'organizations', :action => 'org_member_autocomplete', :org=> @organization.id)}')" %> <%#= javascript_tag "observeSearchfield('not_org_member_search', null, '#{url_for(:controller => 'organizations', :action => 'org_member_autocomplete', :org=> @organization.id)}')" %>
<%# else %> <%# else %>
<%#= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript secdomain_with_protocol(@organization.secdomain_name) + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %> <%#= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript secdomain_with_protocol(@organization.secdomain_name) + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %>
@ -141,7 +144,7 @@
<div class="undis ml15 mr15" id="orgContent_3"> <div class="undis ml15 mr15" id="orgContent_3">
<!--新增二级栏目--> <!--新增二级栏目-->
<div> <div>
<%= form_tag url_for(:controller => 'org_subfields', :action => 'create', :organization_id => @organization.id), :id=> 'add_subfield_form',:remote => true do %> <%= form_tag url_for(:controller => 'org_subfields', :action => 'create', :organization_id => @organization.id), :id => 'add_subfield_form',:remote => true do %>
<span class="fontGrey3 fb mb5 mr10" >新增一级栏目</span> <span class="fontGrey3 fb mb5 mr10" >新增一级栏目</span>
<input type="text" id="subfield_name" name="name" placeholder="栏目名称" class="orgAddSearch mb10" /> <input type="text" id="subfield_name" name="name" placeholder="栏目名称" class="orgAddSearch mb10" />
<div class="mb10"> <div class="mb10">
@ -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(){

View File

@ -24,4 +24,7 @@
</ul> </ul>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>

View File

@ -1,5 +1,5 @@
<div class="project_r_h"> <div class="project_r_h">
<h2 class="project_h2 fl"><%= @subPage_title%></h2> <h2 class="project_h2 fl"><%= @subPage_title %></h2>
<% if is_project_manager?(User.current, @project) %> <% if is_project_manager?(User.current, @project) %>
<span class="fr f14 fontGrey2" style="height: 40px; line-height: 40px; margin-right: 15px;"> <span class="fr f14 fontGrey2" style="height: 40px; line-height: 40px; margin-right: 15px;">
<%=link_to "成员管理", :controller => 'projects', :action => 'settings', :id => @project.id, :tab => 'members' %> <%=link_to "成员管理", :controller => 'projects', :action => 'settings', :id => @project.id, :tab => 'members' %>

View File

@ -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),

View File

@ -20,7 +20,7 @@
<%= hidden_field_tag(:send_ids, send_ids) %> <%= hidden_field_tag(:send_ids, send_ids) %>
<input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入班级ID或者名称搜索" class="searchResourcePopup" /> <input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入班级ID或者名称搜索" class="searchResourcePopup" />
<script> <script>
observeSearchfieldOnInput('search_course_input','<%= search_user_course_user_path(user)%>','<%= send_id %>','<%= send_ids%>','news') observeSearchfieldOnInput('search_course_input', '<%= search_user_course_user_path(user)%>', '<%= send_id %>', '<%= send_ids%>', 'news')
</script> </script>
<!--<a href="javascript:void(0);" class="searchIconPopup"></a>--> <!--<a href="javascript:void(0);" class="searchIconPopup"></a>-->
<%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %> <%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %>

View File

@ -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();
} }