Merge branch 'develop' into dev_shcool
This commit is contained in:
commit
4004e30216
|
@ -615,8 +615,10 @@ class AdminController < ApplicationController
|
|||
# 获取申请的高校列表
|
||||
# status: 0 未审批; 1 已批阅;
|
||||
def applied_schools
|
||||
@name = params[:name]
|
||||
@apply_status = ApplyAddSchools.where(:status => 0).order('created_at desc')
|
||||
@name = params[:name] || ""
|
||||
condition = "#{@name.strip}".gsub(" ","")
|
||||
|
||||
@apply_status = ApplyAddSchools.where("status = 0 and name like '%#{condition}%'").order('created_at desc')
|
||||
@apply_count = @apply_status.count
|
||||
|
||||
@apply_pages = Paginator.new @apply_count, 30, params['page'] || 1
|
||||
|
@ -629,8 +631,10 @@ class AdminController < ApplicationController
|
|||
end
|
||||
|
||||
def has_applied_schools
|
||||
@name = params[:name]
|
||||
@has_apply_status = ApplyAddSchools.where("status = 1 or status = 2").order('created_at desc')
|
||||
@name = params[:name] || ""
|
||||
condition = "#{@name.strip}".gsub(" ","")
|
||||
|
||||
@has_apply_status = ApplyAddSchools.where("(status = 1 or status = 2) and name like '%#{condition}%'").order('created_at desc')
|
||||
@has_apply_count = @has_apply_status.count
|
||||
|
||||
@has_apply_pages = Paginator.new @has_apply_count, 30, params['page'] || 1
|
||||
|
|
|
@ -61,10 +61,10 @@ class AppliedProjectController < ApplicationController
|
|||
@flag = 3
|
||||
else
|
||||
@flag = 4
|
||||
role = params[:member] == "member_manager" ? 3 : (params[:member] = "member_developer" ? 4 :5)
|
||||
role = params[:member] == "member_manager" ? 3 : (params[:member] == "member_developer" ? 4 :5)
|
||||
applied_project = AppliedProject.create(:user_id => User.current.id, :project_id => @project.id, :role => role)
|
||||
# 申请成功则给项目管理员发送邮件及发送消息
|
||||
Mailer.run.applied_project(applied_project)
|
||||
# Mailer.run.applied_project(applied_project)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -792,6 +792,11 @@ class ProjectsController < ApplicationController
|
|||
members = Member.where(:user_id => User.current.id, :project_id=>params[:id]).first
|
||||
if members != nil && members.roles.first.to_s != "Manager"
|
||||
members.destroy
|
||||
# 移出的时候删除申请消息,不需要删除消息,所以不必要关联删除
|
||||
applied_projects = AppliedProject.where(:project_id => @project.id, :user_id => members.user_id).first
|
||||
unless applied_projects.nil?
|
||||
applied_projects.delete
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
|
|
@ -53,14 +53,14 @@
|
|||
<td style="text-align: center;">
|
||||
<%= apply.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=apply.name%>' >
|
||||
<span title="双击可编辑" id="apply_title_<%= apply.id %>"><%= apply.name %></span>
|
||||
<td class="name" title='<%=apply.name%>' >
|
||||
<span id="apply_title_<%= apply.id %>"><%= apply.name %></span>
|
||||
<textarea style="display: none; width:100px; height:16px; border:1px solid #ddd; outline:none; padding:0 0 0 5px; resize:none; overflow:hidden;" placeholder="请编辑单位名称" id="school_name_edit_<%=apply.id%>" onblur="edit_school_name('<%= edit_apply_name_school_path(apply.id)%>','<%= apply.id %>');"><%= apply.name %></textarea>
|
||||
</td>
|
||||
<td class="center">
|
||||
<% user = User.where("id=?", apply.user_id).first %>
|
||||
<% unless user.nil? %>
|
||||
<%=link_to user.show_name, user_path(user) %>
|
||||
<%=link_to user.show_name, user_path(user),:target => '_blank' %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="center">
|
||||
|
@ -141,4 +141,7 @@
|
|||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="wlist" id="pages" style="float: right;margin-top: 10px;">
|
||||
<%= pagination_links_full @apply_pages, @apply_count ,:per_page_links => true, :remote => false, :flag => true %>
|
||||
</ul>
|
|
@ -23,7 +23,7 @@
|
|||
<th style="width: 20px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 85px;">
|
||||
<th style="width: 80px;">
|
||||
单位名称
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
|
@ -41,7 +41,7 @@
|
|||
<th style="width: 30px;">
|
||||
用户
|
||||
</th>
|
||||
<th style="width: 60px;">
|
||||
<th style="width: 65px;">
|
||||
创建时间
|
||||
</th>
|
||||
<th style="width: 75px;">
|
||||
|
@ -56,7 +56,7 @@
|
|||
<td style="text-align: center;">
|
||||
<%= apply.id %>
|
||||
</td>
|
||||
<td class="name center" title='<%=apply.name%>' >
|
||||
<td class="name" title='<%=apply.name%>' >
|
||||
<% unless apply.school_id.nil? %>
|
||||
<% school_name = School.where("id=?", apply.school_id).first %>
|
||||
<span title="双击可编辑" ondblclick = "show_edit_school_name('<%= apply.id %>');" id="apply_title_<%= apply.id %>"><%= school_name %></span>
|
||||
|
@ -64,9 +64,9 @@
|
|||
<% end %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<% user = User.where("id=?", apply.user_id).first %>
|
||||
<% user = User.where("id=?", apply.user_id).first%>
|
||||
<% unless user.nil? %>
|
||||
<%=link_to user.show_name, user_path(user) %>
|
||||
<%=link_to user.show_name, user_path(user), :target => '_blank'%>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="center">
|
||||
|
@ -137,4 +137,7 @@
|
|||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="wlist" id="pages" style="float: right;margin-top: 10px;">
|
||||
<%= pagination_links_full @has_apply_pages, @has_apply_count ,:per_page_links => true, :remote => false, :flag => true %>
|
||||
</ul>
|
|
@ -19,8 +19,8 @@
|
|||
<div class="cl"></div>
|
||||
</li>
|
||||
<li>
|
||||
<label> </label>
|
||||
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sy_btn_blue fl" onclick="$('#project_applied_form').submit();hideModal()">确 定</a></div>
|
||||
<label class="mr27"> </label>
|
||||
<a href="javascript:void(0);" class="sy_btn_blue fl" onclick="$('#project_applied_form').submit();hideModal()">确 定</a>
|
||||
<a href="javascript:void(0);" class="sy_btn_grey fl ml20" onclick="hideModal()">取 消</a>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
</div>
|
||||
<div class="">
|
||||
<p class="fl grayTxt ">更新:<%=format_date Time.at(course.updatetime) %><span class="mr10"></span>学期:<%=current_time_and_term(course) %></p>
|
||||
<p class="list-info fr grayTxt"><span><%=studentCount course %></span><span>学生</span><span>|</span><span><%=visable_course_homework course %></span><span>作业</span><span>|</span><span><%=visable_attachemnts_incourse(@course).count %></span><span>资源</span></p>
|
||||
<p class="list-info fr grayTxt"><span><%=studentCount course %></span><span>学生</span><span>|</span><span><%=visable_course_homework course %></span><span>作业</span><span>|</span><span><%=visable_attachemnts_incourse(course).count %></span><span>资源</span></p>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<p>真实姓名:<%= User.find(ma.course_message_id).realname %></p>
|
||||
<p>申请课程:<%= Course.find(ma.course_id).name%></p>
|
||||
<div class="fl">课程描述:</div>
|
||||
<div class="ml60"><%= Course.find(ma.course_id).description.html_safe if Course.find(ma.course_id).description %></div> <p>申请职位:<%= ma.content.include?('9') ? "教师" : "教辅"%></p>
|
||||
<div class="ml60"><%= Course.find(ma.course_id).description.html_safe if Course.find(ma.course_id).description %></div> <p>申请职位:<%=ma.content && ma.content.include?('9') ? "教师" : "教辅"%></p>
|
||||
</div>
|
||||
<li class="<%=(ma.status == 0 || ma.status.nil?) ? 'homepageHomeworkContentWarn2' : 'homepageHomeworkContentWarn' %> fl">
|
||||
<span id="deal_info_<%=ma.id%>">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<% if allow_to_show(ma) %>
|
||||
:<%= link_to "同意", allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id), :remote => true, :method => :post, :class => "link-blue"%> |
|
||||
<%= link_to "同意", allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id), :remote => true, :method => :post, :class => "link-blue"%> |
|
||||
<%= link_to "拒绝", refused_allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id), :remote => true, :method => :get, :class => "link-blue" %>
|
||||
<% elsif ma.status == 4 %>
|
||||
<span class="fontGrey3">被拒绝</span>
|
||||
|
|
|
@ -4,33 +4,39 @@
|
|||
<% if ma.status == 1 || ma.status == 2 || ma.status == 3 || ma.status == 4 %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);"><%= link_to image_tag(url_to_avatar(ma.user), :width => "30", :height => "30"), user_path(ma.user), :target => '_blank' %></a>
|
||||
<a href="javascript:void(0);">
|
||||
<% if ma.status == 1 || ma.status == 2 || ma.status == 3 %>
|
||||
<%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %>
|
||||
<% elsif ma.status == 4 %>
|
||||
<%= link_to image_tag(url_to_avatar(ma.user), :width => "30", :height => "30"), user_path(ma.user), :target => '_blank' %>
|
||||
<% end %>
|
||||
</a>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<% if ma.status == 1 %>
|
||||
<%=link_to ma.user, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
|
||||
<span class="newsBlue homepageNewsPublisher">系统提示</span>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的高校(单位):</span>
|
||||
<li class="homepageNewsContent fl">
|
||||
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank' title="<%= ma.name %>的申请,已通过"><%= ma.name %>的申请,已通过</a>
|
||||
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank' title="<%= ma.name %>的申请,已通过">“<%= ma.name %>”的申请,已通过</a>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
<% elsif ma.status == 2 %>
|
||||
<%=link_to ma.user, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
|
||||
<span class="newsBlue homepageNewsPublisher">系统提示</span>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的高校(单位):</span>
|
||||
<li class="homepageNewsContent fl">
|
||||
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank' title="<%= ma.applied.name %>的申请,因名称不合法,系统已将其更改为“<%= ma.name %>”"><%= ma.applied.name %>的申请,因名称不合法,系统已将其更改为“<%= ma.name %>”</a>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
<% elsif ma.status == 3 %>
|
||||
<%=link_to ma.user, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
|
||||
<span class="newsBlue homepageNewsPublisher">系统提示</span>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">您添加新的高校(单位):</span>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to ma.name + "的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料", { :controller=> "my",:action => "account" }, :title => "#{ma.name}的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料" %>
|
||||
<%= link_to "“"+ma.name+"”" + "的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料", { :controller=> "my",:action => "account" }, :title => "“#{ma.name}”的申请,因名称不合法,已被拒绝,请重新编辑您的基本资料", :target => '_blank'%>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
<% elsif ma.status == 4 %>
|
||||
<%=link_to ma.user, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>"> </span>
|
||||
<%=link_to User.where("id=?", ma.applied_user_id).first.show_name, user_path(ma.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>"> 申请了单位:</span>
|
||||
<li class="homepageNewsContent fl">
|
||||
<a class ="#{ma.viewed == 0 ? 'newsBlack' : 'newsGrey'}" target = '_blank'>
|
||||
<%= link_to User.where("id=?", ma.applied_user_id).first.show_name + "提交了申请:添加新的单位“#{ma.name}”", unapplied_schools_path(), :title => "#{User.where("id=?", ma.applied_user_id).first.show_name}提交了申请:添加新的单位“#{ma.name}”" %></a>
|
||||
|
|
Loading…
Reference in New Issue