diff --git a/app/helpers/bids_helper.rb b/app/helpers/bids_helper.rb index cb3a8f784..bd39d6c28 100644 --- a/app/helpers/bids_helper.rb +++ b/app/helpers/bids_helper.rb @@ -129,8 +129,16 @@ module BidsHelper def im_watching_student_id? bid people = [] people << bid.author - bid.join_in_contests.each do |jic| - people << jic.user + case bid.reward_type # 天煞的bid分了三用途,里面各种hasmany还不定能用! + when 1 + when 2 + bid.join_in_contests.each do |jic| + people << jic.user + end + when 3 + people += bid.courses.first.users.to_a + else + raise 'bids_helper: unknow bid type' # 出了错看这里!不知道的抛异常,省的找不到出错的地方! end people.include?(User.current) end diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 329f84742..69b06aa12 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -74,17 +74,31 @@ module WelcomeHelper def show_user_content event str = ' '.html_safe case event.event_type - when 'news' , 'issue', 'message' , 'bid' , 'wiki-page' , 'document' - str << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url, :target => "_blank" ) + when 'news' + str << content_tag("span", "发表了") << + content_tag("span", find_all_event_type(event)) << + ': '.html_safe << + link_to(truncate(strip_tags(event.event_description).gsub(/ /,''), length: 30, omission:'...'), event.event_url) + when 'issue', 'message' , 'bid' , 'wiki-page' , 'document' + str << content_tag("span", "发表了") << + content_tag("span", find_all_event_type(event)) << + ': '.html_safe << + link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) when 'reply' ,'Reply', 'Memo' str << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << - link_to(truncate(strip_tags(event.event_description).gsub(/ /,''), length: 30, omission:'...'), event.event_url, :target => "_blank" ) + link_to(truncate(strip_tags(event.event_description).gsub(/ /,''), length: 30, omission:'...'), event.event_url) when 'attachment' - str << content_tag('span', '上传了') << content_tag('span', find_all_event_type(event)) << ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) << link_to((' ['.html_safe+l(:label_downloads_list).to_s << ']'), project_files_path(event.container), :class => "attachments_list_color") + str << content_tag('span', '上传了') << + content_tag('span', find_all_event_type(event)) << + ': '.html_safe << + link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) << + link_to((' ['.html_safe+l(:label_downloads_list).to_s << ']'), project_files_path(event.container), :class => "attachments_list_color") else - str << content_tag("span", "更新了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url, :target => "_blank" ) + str << content_tag("span", "更新了") << + content_tag("span", find_all_event_type(event)) << + ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) end str rescue Exception => e @@ -94,10 +108,12 @@ module WelcomeHelper def show_event_reply event str = "回复(" case event.event_type + when 'news' + str << link_to( event.comments.count, news_path(event)) << ")" when "issue" - str << link_to(cal_issues_count(event), issue_path(event), :target => "_blank" ) << ")" + str << link_to(cal_issues_count(event), issue_path(event)) << ")" when "Memo" - str << link_to(cal_memos_count(event), forum_memo_path(event.forum_id,event.id), :target => "_blank" ) << ")" + str << link_to(cal_memos_count(event), forum_memo_path(event.forum_id,event.id)) << ")" else str = "" end diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index 0fd2bf202..bae83f14a 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -13,6 +13,7 @@ <% end %> +<% display_id = im_watching_student_id? @bid%> <% @homework_list.each do |homework|%> <% if homework.attachments.any?%>
<%= link_to homework.user, user_path(homework.user)%> 提交了作业 | |||
<%= l(:label_bidding_user_studentcode) %> :<%= homework.user.user_extensions.student_id%> | ++ <% if display_id %> + <%= l(:label_bidding_user_studentcode) %> :<%= homework.user.user_extensions.student_id%> + <% end %> + | ||
diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb
index 2019a7b45..ed4407fa9 100644
--- a/app/views/issues/_list.html.erb
+++ b/app/views/issues/_list.html.erb
@@ -1,5 +1,3 @@
-<%= form_tag({}) do -%>
-<%= hidden_field_tag 'back_url', url_for(params), :id => nil %>
<%= form_tag({ :controller => 'issues', :action => 'index', :project_id => @project }, :method => :get, :id => 'query_form', :class => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %>
+
<%= error_messages_for 'query' %>
<% if @query.valid? %>
diff --git a/app/views/projects/feedback.html.erb b/app/views/projects/feedback.html.erb
index 7e1c4077c..027132cda 100644
--- a/app/views/projects/feedback.html.erb
+++ b/app/views/projects/feedback.html.erb
@@ -55,7 +55,6 @@ function checkMaxLength() {
<%= image_tag(url_to_avatar(journal.user), :class => "avatar") %>
<%= link_to journal.user, user_path(journal.user)%>
- <%= l(:label_projects_feedback) %>
<%= textilizable journal.notes%>
<%= l :label_update_time %>: <%= format_time journal.created_on %>
<% id = 'project_respond_form_'+journal.id.to_s%>
diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb
index 2b4412bc6..742c28a25 100644
--- a/app/views/welcome/index.html.erb
+++ b/app/views/welcome/index.html.erb
@@ -138,7 +138,7 @@
----<%= l :label_query_new %>---
+ ---<%= l :label_query_new %>---
<% end %>
-
+
<%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;", :target => "_blank" %><%= show_user_content event %>
-
<% end %>
<%= time_tag_welcome event.event_datetime %> <%= show_event_reply event %> +<%= l(:field_updated_on) %><%= time_tag_welcome event.event_datetime %>前 <%= show_event_reply event %> |