diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 155932587..e6ab0f431 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -377,7 +377,7 @@ class UsersController < ApplicationController } scope = User.logged.status(@status) @search_by = params[:search_by] ? params[:search_by][:id] : 0 - scope = scope.like(params[:name],@search_by) if params[:name].present? + scope = scope.like(params[:name],"0") if params[:name].present? @user_count = scope.count @user_pages = Paginator.new @user_count, @limit, params['page'] @user_base_tag = params[:id] ? 'base_users':'users_base' diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index 935fb440e..842e1f1b7 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -98,7 +98,7 @@ module WatchersHelper # modify by nwb # 主讲教师不允许退出课程 return '' if user.id == course.tea_id - joined = user.member_of_course?(course) + joined = course.members.map{|m| m.user}.include? user text = joined ? l(:label_exit_course) : l(:label_new_join) url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id) method = joined ? 'delete' : 'post' diff --git a/app/models/user.rb b/app/models/user.rb index cae5f1aa2..e966742f1 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -206,11 +206,11 @@ class User < Principal pattern = "%#{arg.to_s.strip.downcase}%" #where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern) if type == "0" - where(" LOWER(login) LIKE :p ", :p => pattern) + where(" LOWER(login) LIKE '#{pattern}' ") elsif type == "1" - where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern) + where(" LOWER(concat(lastname, firstname)) LIKE '#{pattern}' ") else - where(" LOWER(mail) LIKE :p ", :p => pattern) + where(" LOWER(mail) LIKE '#{pattern}' ") end end } diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index 7937912e4..a8296165f 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -45,7 +45,7 @@
+ | <%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author)) %> @@ -55,6 +55,8 @@ <%= link_to(bid.name, course_for_bid_path(bid), :class => 'bid_path') %> + | +<% if User.current.logged? && is_cur_course_student(@course) %> <% cur_user_homework = cur_user_homework_for_bid(bid) %> @@ -83,8 +85,8 @@ <%end%> <%= link_to( - l(:button_edit), - {:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id} + l(:button_edit), + {:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id} ) %> <%#= link_to( diff --git a/app/views/common/403.html b/app/views/common/403.html index f3696c4ea..a89be932d 100644 --- a/app/views/common/403.html +++ b/app/views/common/403.html @@ -7,7 +7,7 @@ body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff; font-style:normal;} div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;} div,img,tr,td{ border:0;} -table,tr,td{border:0 cellspacing:0; cellpadding:0;} +table,tr,td{border:0; cellspacing:0; cellpadding:0;} ul,li{ list-style-type:none} .cl{ clear:both; overflow:hidden; } a{ text-decoration:none; } diff --git a/app/views/common/404.html b/app/views/common/404.html index 8453e0a41..0d632c4c8 100644 --- a/app/views/common/404.html +++ b/app/views/common/404.html @@ -7,7 +7,7 @@ body{ font-size:12px; font-family:"微软雅黑","宋体"; line-height:1.9; background:#fff;} div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margin:0; padding:0;} div,img,tr,td{ border:0;} -table,tr,td{border:0 cellspacing:0; cellpadding:0;} +table,tr,td{border:0; cellspacing:0; cellpadding:0;} ul,li{ list-style-type:none} .cl{ clear:both; overflow:hidden; } a{ text-decoration:none; } diff --git a/app/views/contests/index.html.erb b/app/views/contests/index.html.erb index 5867d7fcd..75b892461 100644 --- a/app/views/contests/index.html.erb +++ b/app/views/contests/index.html.erb @@ -21,36 +21,36 @@ |
- <%= text_field_tag 'name', params[:name], :size => 30, :onkeyup => 'regexName();' %>
+ <%= text_field_tag 'name', params[:name], :size => 30, :onkeyup => 'regexName1();', :width => "125px" %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => "contests_search" %>
<%= l(:label_search)%>
- + |
<%= form_tag({controller: 'contests', action: 'index'}, method: :get, :id => "contst_search_form") do %>
- <%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => 'regexName();' %>
+ <%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => 'regexName1();', :width => "125px" %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<%= l(:label_search)%>
-
+
+ <% end %> |
diff --git a/app/views/stores/index.html.erb b/app/views/stores/index.html.erb
index 6eca2b0bf..e6f795722 100644
--- a/app/views/stores/index.html.erb
+++ b/app/views/stores/index.html.erb
@@ -11,9 +11,15 @@