commit
166511b7f8
|
@ -577,19 +577,19 @@ class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def redirect_back_or_default(default, options={})
|
def redirect_back_or_default(default, options={})
|
||||||
back_url = params[:back_url].to_s
|
back_url = ''#params[:back_url].to_s
|
||||||
if back_url.present?
|
if back_url.present?
|
||||||
begin
|
begin
|
||||||
uri = URI.parse(back_url)
|
uri = URI.parse(back_url)
|
||||||
# do not redirect user to another host or to the login or register page
|
# do not redirect user to another host or to the login or register page
|
||||||
if (uri.relative? || (uri.host == request.host)) && !uri.path.match(%r{/(login|account/register)})
|
if (uri.relative? || (uri.host == request.host)) && !uri.path.match(%r{/(login|account/register)})
|
||||||
back_url = back_url.gsub(%r{\/users\/(\D+)},"/users/"+default.to_s) if default.is_a?(User)
|
back_url = back_url.gsub(%r{\/users\/(\w+)},"/users/"+default.to_s) if default.is_a?(:User)
|
||||||
redirect_to(back_url)
|
redirect_to(back_url)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
rescue URI::InvalidURIError
|
rescue URI::InvalidURIError
|
||||||
logger.warn("Could not redirect to invalid URL #{back_url}")
|
logger.warn("Could not redirect to invalid URL #{back_url}")
|
||||||
redirect to default
|
#redirect to default
|
||||||
end
|
end
|
||||||
elsif options[:referer]
|
elsif options[:referer]
|
||||||
redirect_to_referer_or default
|
redirect_to_referer_or default
|
||||||
|
|
|
@ -237,7 +237,7 @@ class UsersController < ApplicationController
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html{render :layout => 'static_base'}
|
format.html{render :layout => 'static_base'}
|
||||||
format.xls{
|
format.xls{
|
||||||
filename = "我发布的_#{l(:label_issue_list_xls)}.xls"
|
filename = "我收到的Issue#{l(:label_issue_list_xls)}.xls"
|
||||||
send_data(issue_list_xls(@excel_issues), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
|
send_data(issue_list_xls(@excel_issues), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
|
||||||
}
|
}
|
||||||
format.api
|
format.api
|
||||||
|
|
|
@ -39,9 +39,9 @@
|
||||||
|
|
|
|
||||||
<%= link_to '拒绝',dealwith_apply_request_user_path(User.current,:agree=>'N',:msg_id=>ma.id),:remote=>'true',:class=>'linkBlue'%>
|
<%= link_to '拒绝',dealwith_apply_request_user_path(User.current,:agree=>'N',:msg_id=>ma.id),:remote=>'true',:class=>'linkBlue'%>
|
||||||
<% elsif ma.status == 1%> <!-- 同意 -->
|
<% elsif ma.status == 1%> <!-- 同意 -->
|
||||||
<%= Course.find(ma.course_id).teacher.show_name %>已同意
|
<span title="<%= Course.find(ma.course_id).teacher.show_name %>已同意"><%= Course.find(ma.course_id).teacher.show_name %>已同意</span>
|
||||||
<% elsif ma.status == 2%> <!-- 拒绝 -->
|
<% elsif ma.status == 2%> <!-- 拒绝 -->
|
||||||
<%= Course.find(ma.course_id).teacher.show_name %>已拒绝
|
<span title="<%= Course.find(ma.course_id).teacher.show_name %>已拒绝"><%= Course.find(ma.course_id).teacher.show_name %>已拒绝</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<%#= render :partial => 'user_jours_new', :locals => {:jour => jour} %>
|
<%#= render :partial => 'user_jours_new', :locals => {:jour => jour} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% else %>
|
<% elsif User.current == @user %>
|
||||||
<%= render :partial => "projects/no_data" %>
|
<%= render :partial => "projects/no_data" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if (jours.count + page * 10) < count %>
|
<% if (jours.count + page * 10) < count %>
|
||||||
|
|
Loading…
Reference in New Issue