@@ -186,7 +206,7 @@
<%= back_url_hidden_field_tag %>
<%= text_field_tag 'username', params[:username], :tabindex => '1' ,
- :class=>'loginSignBox',:placeholder=>'请输入邮箱地址或昵称'%>
+ :class=>'loginSignBox',:placeholder=>'请输入邮箱地址或昵称', :onkeypress => "user_name_keypress(event);"%>
<% if Setting.openid? %>
@@ -196,7 +216,7 @@
<% end %>
- <%= password_field_tag 'password', nil, :tabindex => '2',:class=>'loginSignBox' ,:placeholder=>'请输密码'%>
+ <%= password_field_tag 'password', nil, :tabindex => '2',:class=>'loginSignBox' ,:placeholder=>'请输密码', :onkeypress => "user_name_keypress(event);"%>
<% if Setting.autologin? %>
diff --git a/app/views/courses/_history.html.erb b/app/views/courses/_history.html.erb
index 864509546..70e943e99 100644
--- a/app/views/courses/_history.html.erb
+++ b/app/views/courses/_history.html.erb
@@ -5,7 +5,7 @@
<%= link_to image_tag(url_to_avatar(journal.user),:width => '46',:height => '46'), user_path(journal.user) %>
-
+
diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb
index 8dd0bd2bb..ace881194 100644
--- a/app/views/layouts/_logined_header.html.erb
+++ b/app/views/layouts/_logined_header.html.erb
@@ -33,12 +33,21 @@
$(function(){
$("#navHomepageSearchInput").keypress(function(e){
- if (e.keyCode == '13') {
+ var name = $.trim($('#navHomepageSearchInput').val());
+ if (e.keyCode == '13' && name != "" && name.length != 0) {
$('#type').val($('input[type=radio]:checked').val());
$(this).parent().submit();
}
})
});
+
+ function search_in_header(obj){
+ var name = $.trim($('#navHomepageSearchInput').val());
+ if (name != "" && name.length != 0) {
+ $('#type').val($('input[type=radio]:checked').val());
+ obj.parent().submit();
+ }
+ }
@@ -46,9 +55,10 @@
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词进行搜索"/>
-
-
- <% end %>
+
+
+
+ <% end %>
diff --git a/app/views/layouts/_unlogin_header.html.erb b/app/views/layouts/_unlogin_header.html.erb
index d6c6fbc51..1665a2493 100644
--- a/app/views/layouts/_unlogin_header.html.erb
+++ b/app/views/layouts/_unlogin_header.html.erb
@@ -9,45 +9,53 @@
-
+ function search_in_header(obj){
+ var name = $.trim($('#navHomepageSearchInput').val());
+ if (name != "" && name.length != 0) {
+ $('#type').val($('input[type=radio]:checked').val());
+ obj.parent().submit();
+ }
+ }
+
+ function search_in_header_I(e,obj){
+ var name = $.trim($('#navHomepageSearchInput').val());
+ if (e.keyCode == '13' && name != "" && name.length != 0) {
+ $('#type').val($('input[type=radio]:checked').val());
+ obj.parent().submit();
+ }
+ }
+
<% name = name%>
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
-
" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词进行搜索" />
-
-
+
" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词进行搜索" onkeypress="search_in_header_I(event,$(this));"/>
+
+
+
<% end %>
diff --git a/app/views/layouts/login.html.erb b/app/views/layouts/login.html.erb
index b5dc9e75a..18fbcfcd5 100644
--- a/app/views/layouts/login.html.erb
+++ b/app/views/layouts/login.html.erb
@@ -15,18 +15,6 @@
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
-
<% is_current_user = User.current.logged? && User.current == @user%>
<% if User.current.logged? %>
diff --git a/app/views/news/_course_form.html.erb b/app/views/news/_course_form.html.erb
index 0a5488714..6d4e915ea 100644
--- a/app/views/news/_course_form.html.erb
+++ b/app/views/news/_course_form.html.erb
@@ -27,7 +27,7 @@
<%= render :partial => 'attachments/new_form', :locals => {:container => @news} %>
-
+
<% if is_new %>
<%= link_to l(:button_create), "javascript:void(0)", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fl c_white' %>
<%= link_to l(:button_cancel), course_news_index_path(@course), :onclick => '$("#add-news").hide()', :class => 'blue_btn grey_btn fl c_white' %>
diff --git a/app/views/poll/_poll.html.erb b/app/views/poll/_poll.html.erb
index 1828ede6d..1d5752a28 100644
--- a/app/views/poll/_poll.html.erb
+++ b/app/views/poll/_poll.html.erb
@@ -2,7 +2,7 @@
<% poll_name = poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name%>
<% if @is_teacher%>
-
+
<% if has_commit %>
<%= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue"%>
<% else %>
diff --git a/app/views/users/_course_attachment.html.erb b/app/views/users/_course_attachment.html.erb
index ec68b2332..e0d04548b 100644
--- a/app/views/users/_course_attachment.html.erb
+++ b/app/views/users/_course_attachment.html.erb
@@ -5,7 +5,7 @@
<%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %>
-
+
<% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %>
@@ -15,7 +15,7 @@
<%= link_to activity.course.name.to_s+"(课程名称)", course_path(activity.container_id), :class => "newsBlue ml15", :style=>"word-break:break-all" %>
-
+
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb
index 10bbe4bdf..a3d4992c5 100644
--- a/app/views/users/_course_homework.html.erb
+++ b/app/views/users/_course_homework.html.erb
@@ -4,7 +4,7 @@
<%= link_to image_tag(url_to_avatar(activity.user), :width => "90", :height => "90"), user_path(activity.user_id), :alt => "用户头像" %>
-
+
<% if activity.try(:user).try(:realname) == ' ' %>
<%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %>
<% else %>
@@ -12,7 +12,7 @@
<% end %> TO
<%= link_to activity.course.name.to_s+" | 课程作业", course_path(activity.course_id), :class => "newsBlue ml15", :style=>"word-break:break-all" %>
-
+
<%= link_to activity.name.to_s, student_work_index_path(:homework => activity.id), :class => "postGrey", :style=>"word-break:break-all" %>
diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb
index f8b5c70a1..05caa1f91 100644
--- a/app/views/users/_course_message.html.erb
+++ b/app/views/users/_course_message.html.erb
@@ -4,7 +4,7 @@
<%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %>
-
+
<% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %>
@@ -14,7 +14,7 @@
<%= link_to activity.course.name.to_s+" | 课程讨论区", course_path(activity.course), :class => "newsBlue ml15 mr5", :style=>"word-break:break-all"%>
<%#= link_to activity.course.name.to_s+"(课程讨论区)", course_path(activity.course), :class => "newsBlue ml15 mr5", :style=>"word-break:break-all"%>
-
+
<% if activity.parent_id.nil? %>
<%= link_to activity.subject.to_s.html_safe, course_boards_path(activity.course,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all" %>
<% else %>
@@ -106,7 +106,7 @@
) if reply.course_destroyable_by?(User.current) %>
-
<%= reply.content.html_safe %>
+
<%= reply.content.html_safe %>
diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb
index 15fc74386..dbeb8d450 100644
--- a/app/views/users/_course_news.html.erb
+++ b/app/views/users/_course_news.html.erb
@@ -4,7 +4,7 @@
<%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %>
-
+
<% if @ctivity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %>
@@ -12,7 +12,7 @@
<% end %> TO
<%= link_to activity.course.name.to_s+" | 课程通知", course_path(activity.course), :class => "newsBlue ml15", :style => "word-break:break-all" %>
-
+
<%= link_to activity.title.to_s, news_path(activity), :class => "postGrey", :style => "word-break:break-all" %>
@@ -83,7 +83,7 @@
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %>
-
<%= comment.comments.html_safe %>
+
<%= comment.comments.html_safe %>
diff --git a/app/views/users/_course_poll.html.erb b/app/views/users/_course_poll.html.erb
index f0a2a8aba..97b3b759d 100644
--- a/app/views/users/_course_poll.html.erb
+++ b/app/views/users/_course_poll.html.erb
@@ -7,7 +7,7 @@
<%= link_to image_tag(url_to_avatar(activity.user), :width => "90", :height => "90"), user_path(activity.user_id), :alt => "用户头像" %>
-
+
<% if activity.try(:user).try(:realname) == ' ' %>
<%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %>
<% else %>
@@ -17,7 +17,7 @@
<%= link_to Course.find(activity.polls_group_id).name.to_s+" | 问卷", course_path(activity.polls_group_id), :class => "newsBlue ml15", :style=>"word-break:break-all" %>
-
+
<%#= link_to activity.polls_name.to_s/*+"(问卷名称)"*/, %>
<% if has_commit %>
<%= link_to poll_name, poll_result_poll_path(activity.id), :class => "postGrey"%>
diff --git a/app/views/users/_project_attachment.html.erb b/app/views/users/_project_attachment.html.erb
index 13e6df408..731737610 100644
--- a/app/views/users/_project_attachment.html.erb
+++ b/app/views/users/_project_attachment.html.erb
@@ -1,5 +1,5 @@
-
+

diff --git a/app/views/users/_project_create.html.erb b/app/views/users/_project_create.html.erb
index b2487c444..913aeb3d0 100644
--- a/app/views/users/_project_create.html.erb
+++ b/app/views/users/_project_create.html.erb
@@ -1,5 +1,5 @@
-
+

diff --git a/app/views/users/_project_document.html.erb b/app/views/users/_project_document.html.erb
index 4f5d986d7..4a7fa1f4d 100644
--- a/app/views/users/_project_document.html.erb
+++ b/app/views/users/_project_document.html.erb
@@ -1,5 +1,5 @@
-
+
diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb
index 0ee4f30fb..4badcff42 100644
--- a/app/views/users/_project_issue.html.erb
+++ b/app/views/users/_project_issue.html.erb
@@ -4,7 +4,7 @@
<%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %>
-
+
<% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %>
@@ -12,7 +12,7 @@
<% end %> TO
<%= link_to activity.project.name.to_s+" | 项目缺陷", project_path(activity.project), :class => "newsBlue ml15", :style=>"word-break:break-all" %>
-
+
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey", :style=>"word-break:break-all" %>
<%= get_issue_priority(activity.priority_id)[1] %>
@@ -28,11 +28,11 @@
时间:<%=format_date(activity.created_on) %>
-
缺陷描述:<%= activity.description.html_safe %>
+
缺陷描述:<%= activity.description.html_safe %>
<% if activity.attachments.any? %>
<% activity.attachments.each do |attachment| %>
-
+
<%= link_to_short_attachment attachment, :class => 'homepagePostFileAtt newsBlue', :download => true -%>
@@ -107,8 +107,8 @@
<% if reply.try(:user).try(:realname) == ' ' %>
<%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
- <%# else %>
- <%#= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
+ <% else %>
+ <%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_date(reply.created_on) %>
@@ -116,10 +116,10 @@
<% if reply.details.any? %>
<% details_to_strings(reply.details).each do |string| %>
-
<%= string %>
+
<%= string %>
<% end %>
<% else %>
-
<%= reply.notes.html_safe %>
+
<%= reply.notes.html_safe %>
<% end %>
diff --git a/app/views/users/_project_journal.html.erb b/app/views/users/_project_journal.html.erb
index 3c1f8c61d..cc5036ede 100644
--- a/app/views/users/_project_journal.html.erb
+++ b/app/views/users/_project_journal.html.erb
@@ -1,5 +1,5 @@
-
+

diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb
index 89f149303..e9fdb87e1 100644
--- a/app/views/users/_project_message.html.erb
+++ b/app/views/users/_project_message.html.erb
@@ -1,10 +1,10 @@
-
+
<%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %>
-
+
<% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %>
@@ -14,7 +14,7 @@
<%= link_to activity.project.name.to_s+" | 项目讨论区",project_path(activity.project), :class => "newsBlue ml15 mr5", :style=>"word-break:break-all"%>
-
+
<% if activity.parent_id.nil? %>
<%= link_to activity.subject.to_s.html_safe, project_boards_path(activity.project,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all" %>
<% else %>
@@ -24,7 +24,7 @@
时间:<%= format_date(activity.created_on) %>
-
帖子描述:
+
帖子描述:
<% if activity.parent_id.nil? %>
<%= activity.content.to_s.html_safe%>
<% else %>
@@ -103,7 +103,7 @@
) if reply.course_destroyable_by?(User.current) %>
-
<%= reply.content.html_safe %>
+
<%= reply.content.html_safe %>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index 91a35e711..74ca48595 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -14,7 +14,7 @@
$(window).scroll(scrollHandler);
-
+