diff --git a/app/models/principal.rb b/app/models/principal.rb
index 2c8465538..0c87ec0c6 100644
--- a/app/models/principal.rb
+++ b/app/models/principal.rb
@@ -44,7 +44,7 @@ class Principal < ActiveRecord::Base
else
pattern = "%#{q}%".gsub("/","//").gsub("_","/_")
# sql = %w(login firstname lastname mail).map {|column| "LOWER(#{table_name}.#{column}) LIKE LOWER(:p)"}.join(" OR ")
- sql= "LOWER(concat(lastname,firstname)) LIKE LOWER(:p) or LOWER(login) LIKE LOWER(:p) or LOWER(mail) LIKE LOWER(:p) escape '/'"
+ sql= "LOWER(concat(lastname,firstname)) LIKE LOWER(:p) escape '/' or LOWER(login) LIKE LOWER(:p) escape '/' or LOWER(mail) LIKE LOWER(:p) escape '/'"
params = {:p => pattern}
if q =~ /^(.+)\s+(.+)$/
a, b = "#{$1}%", "#{$2}%"
diff --git a/app/views/courses/_recommendation.html.erb b/app/views/courses/_recommendation.html.erb
index 63803a5b9..1db2edf57 100644
--- a/app/views/courses/_recommendation.html.erb
+++ b/app/views/courses/_recommendation.html.erb
@@ -7,8 +7,8 @@
<%=link_to e_course.name, course_path(e_course.id), :class => "hidden fl w170" %>
- <% if course_file_num > 0 %>
- <%= l(:project_module_attachments) %>(<%= link_to course_file_num, course_files_path(e_course), :class => "linkBlue2" %>)
+ <% if visable_attachemnts_incourse(e_course).count > 0 %>
+ <%= l(:project_module_attachments) %>(<%= link_to visable_attachemnts_incourse(e_course).count, course_files_path(e_course), :class => "linkBlue2" %>)
<% end %>
<% if e_course.homework_commons.where("publish_time <= '#{Date.today}'").count > 0 %>
<%= l(:label_homework_commont) %>(<%= link_to e_course.homework_commons.where("publish_time <= '#{Date.today}'").count, homework_common_index_path(:course=>e_course.id), :class => "linkBlue2" %>)
diff --git a/app/views/layouts/_project_info.html.erb b/app/views/layouts/_project_info.html.erb
index 06d6304d2..d94cbdcc7 100644
--- a/app/views/layouts/_project_info.html.erb
+++ b/app/views/layouts/_project_info.html.erb
@@ -1,6 +1,6 @@
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) %>
-<% teacher_num = 0 %>
-<% student_num = 0 %>
+<% teacher_num = TeacherAndAssistantCount(@course) %>
+<% student_num = studentCount(@course) %>
<% if is_excellent_course(@course) %>

diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index 7495b20db..bdbed2931 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -169,7 +169,7 @@
- <%= render :partial => 'courses/recommendation', :locals => {:course => @course, :course_file_num => course_file_num} %>
+ <%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
访问计数 <%= @course.visits.to_i %>
diff --git a/app/views/org_document_comments/edit.html.erb b/app/views/org_document_comments/edit.html.erb
index 3ad388bd2..5997482fb 100644
--- a/app/views/org_document_comments/edit.html.erb
+++ b/app/views/org_document_comments/edit.html.erb
@@ -12,10 +12,12 @@
if($("#document_title").val().trim() == "")
{
$("#doc_title_hint").html("标题不能为空").show();
+ return false;
}
else
{
$("#doc_title_hint").hide();
+ return true;
}
}
diff --git a/app/views/org_document_comments/new.html.erb b/app/views/org_document_comments/new.html.erb
index 24dd7dcfe..cf4ffddcf 100644
--- a/app/views/org_document_comments/new.html.erb
+++ b/app/views/org_document_comments/new.html.erb
@@ -38,7 +38,7 @@
<%= form_tag organization_org_document_comments_path(:organization_id => @organization.id, :field_id => params[:field_id]), :id => 'new_org_document_form' do |f| %>
-
+
diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb
index cf68d71f5..fdd6772e7 100644
--- a/app/views/organizations/_show_org_document.html.erb
+++ b/app/views/organizations/_show_org_document.html.erb
@@ -10,7 +10,7 @@
TO <%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %>
|
<%= document.org_subfield_id.nil? ? "组织文章" :"#{OrgSubfield.find(document.org_subfield_id).name}" %>
- <% if @organization.home_id == document.id %>
+ <% if document.organization.home_id == document.id %>
已设为首页
<% end %>
diff --git a/app/views/users/_resources_list.html.erb b/app/views/users/_resources_list.html.erb
index a545038f1..c2b37f0e6 100644
--- a/app/views/users/_resources_list.html.erb
+++ b/app/views/users/_resources_list.html.erb
@@ -26,349 +26,14 @@
<% end %>
<% end %>
-
diff --git a/app/views/users/_user_resource_info.html.erb b/app/views/users/_user_resource_info.html.erb
index bea78130a..bf36e4b38 100644
--- a/app/views/users/_user_resource_info.html.erb
+++ b/app/views/users/_user_resource_info.html.erb
@@ -37,12 +37,350 @@
-
\ No newline at end of file
+
\ No newline at end of file