学号在作业里显示问题,首页时间显示不确定问题,项目缺陷滑动效果乱跳问题。

This commit is contained in:
yanxd 2014-01-06 19:29:18 +08:00
parent 38b1f69aa5
commit 4b8a4c82c9
7 changed files with 46 additions and 20 deletions

View File

@ -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

View File

@ -74,17 +74,31 @@ module WelcomeHelper
def show_user_content event
str = '&nbsp;'.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)) << ':&nbsp;'.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)) <<
':&nbsp;'.html_safe <<
link_to(truncate(strip_tags(event.event_description).gsub(/&nbsp;/,''), 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)) <<
':&nbsp;'.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)) <<
':&nbsp;'.html_safe <<
link_to(truncate(strip_tags(event.event_description).gsub(/&nbsp;/,''), length: 30, omission:'...'), event.event_url, :target => "_blank" )
link_to(truncate(strip_tags(event.event_description).gsub(/&nbsp;/,''), length: 30, omission:'...'), event.event_url)
when 'attachment'
str << content_tag('span', '上传了') << content_tag('span', find_all_event_type(event)) << ':&nbsp;'.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) << link_to(('&nbsp;['.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)) <<
':&nbsp;'.html_safe <<
link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) <<
link_to(('&nbsp;['.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)) << ':&nbsp;'.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)) <<
':&nbsp;'.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

View File

@ -13,6 +13,7 @@
</table>
</div>
<% end %>
<% display_id = im_watching_student_id? @bid%>
<% @homework_list.each do |homework|%>
<% if homework.attachments.any?%>
<table width="660px" border="0" align="center">
@ -24,7 +25,11 @@
<td colspan="2" valign="top"><strong> <%= link_to homework.user, user_path(homework.user)%></strong> <span class="font_lighter">提交了作业</span></td>
</tr>
<tr>
<td colspan="2" valign="top"><strong><%= l(:label_bidding_user_studentcode) %> <%= homework.user.user_extensions.student_id%></td>
<td colspan="2" valign="top">&nbsp;
<% if display_id %>
<strong><%= l(:label_bidding_user_studentcode) %> <%= homework.user.user_extensions.student_id%></strong>
<% end %>
</td>
</tr>
<tr>
<td colspan="2" width="580px" >

View File

@ -1,5 +1,3 @@
<%= form_tag({}) do -%>
<%= hidden_field_tag 'back_url', url_for(params), :id => nil %>
<div class="autoscroll">
<ul>
<% issue_list(issues) do |issue, level| -%>
@ -57,5 +55,4 @@
<% end -%>
</ul>
</div>
<% end -%>
</div>

View File

@ -4,7 +4,7 @@
:html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, :class => 'icon icon-add' %>
<%= link_to l(:label_query), '#', :class => 'icon icon-help',
:onclick => '$("#custom_query").slideToggle(); ' if User.current.logged? %>
:onclick => '$("#custom_query").slideToggle(400); ' if User.current.logged? %>
</div>
</div>
@ -16,12 +16,12 @@
</div>
<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %>
<div style="float:right; ">
<%= form_tag({ :controller => 'issues', :action => 'index', :project_id => @project }, :method => :get, :id => 'query_form', :class => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %>
<div id="custom_query" class="custom_query" style="display: <%= !params[:utf8].blank? ? 'block' : 'none' %>;">
<span>---<%= l :label_query_new %>---</span>
<span>---<%= l :label_query_new %>---</span>
<div id="query_form_content" class="hide-when-print">
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
<legend onclick="toggleFieldset(this);">
@ -59,7 +59,8 @@
</div>
</div>
<% end %>
</div>
<div style="clear:both"></div>
<%= error_messages_for 'query' %>
<% if @query.valid? %>

View File

@ -55,7 +55,6 @@ function checkMaxLength() {
<span class="portrait"><%= image_tag(url_to_avatar(journal.user), :class => "avatar") %></span>
<span class="body">
<span class="user"><%= link_to journal.user, user_path(journal.user)%></span>
<span class="font_lighter"><%= l(:label_projects_feedback) %></span>
<%= textilizable journal.notes%>
<span class="font_lighter"> <%= l :label_update_time %>: <%= format_time journal.created_on %></span>
<% id = 'project_respond_form_'+journal.id.to_s%>

View File

@ -138,7 +138,7 @@
<div class="inner-right" style="float: right; width:86%; height: 100%; ">
<span style="color: green;"><%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;", :target => "_blank" %></span><%= show_user_content event %>
<p style="margin-top: 4px;"><span style="color: rgb(172, 174, 177)"><%= time_tag_welcome event.event_datetime %></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="float: right; color: rgb(172, 174, 177);"><%= show_event_reply event %></span></p>
<p style="margin-top: 4px;"><span style="color: rgb(172, 174, 177)"><%= l(:field_updated_on) %><%= time_tag_welcome event.event_datetime %></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="float: right; color: rgb(172, 174, 177);"><%= show_event_reply event %></span></p>
</div>
</li>
<% end %>