fix the show out of the frame and the location of show

This commit is contained in:
xianbo 2013-11-07 19:14:57 +08:00
parent 7c4e62cc40
commit 5032eaabcb
7 changed files with 42 additions and 24 deletions

View File

@ -1426,7 +1426,4 @@ module ApplicationHelper
def stringCut240(str)
(str.length > 240) ? (str[0,240]<<"......") : str
end
def truncate_at_line_break(str, length = 240)
str.gsub(%r{^(.{#{length}}[^\n]*)\n.+$}m, '\\1...')
end
end

View File

@ -55,7 +55,7 @@
<% @project = Project.find_by_id(@project.id) %>
<% @course = Course.find_by_extra(@project.identifier) %>
<table>
<tr><td>
<tr><td valign="top">
<% if(@project.project_type==1) %>
<% if get_avatar?(@project) %>
<%= image_tag(url_to_avatar(@project), :class => "avatar2") %>
@ -65,13 +65,14 @@
<% else %>
<%= image_tag(url_to_avatar(@project), :class => "avatar2") %>
<% end %> </td>
<td align="center">
<div class="info_font" style=" word-wrap: break-word; word-break: break-all">
<span aligm="left"><%= @project.name %></span>
</div>
<%if User.current.logged? %>
<td>
<table><tr>
<td class="info-course"><%= @project.name %></td>
</tr>
<tr><td align="center">
<%if User.current.logged? %>
<% if @course.teacher.id == User.current.id %>
</br><%= link_to l(:label_course_modify_settings), {:controller => 'projects', :action => 'settings', :id => @project} %>
<%= link_to l(:label_course_modify_settings), {:controller => 'projects', :action => 'settings', :id => @project} %>
<% else %>
<%= join_in_course(@project, User.current) %></div>
@ -81,9 +82,11 @@
<div style="padding-right: 10px">
<span class="icon-fav icon"></span><span>
<%= watcher_link(@project, User.current) %></span></div>
<% end %></td>
<% end %>
<% end %>
</td></tr></table>
</td>
</tr>
</table>
</div>

View File

@ -43,7 +43,7 @@
<div class="spaceleft">
<div>
<table style="width: 232px ; padding-left: 8px; font-size:16px; line-height: 1.5em">
<tr>
<tr valign="top">
<td style="width: 70px" >课程名:</td>
<td>
<span style=" word-wrap: break-word; word-break: break-all"><strong> <%= link_to @bid.courses.first.name,project_path(@bid.courses.first) %></strong></span>

View File

@ -59,8 +59,8 @@
<table>
<tr>
<td><%= image_tag(url_to_avatar(@project), :class => 'avatar2') %></td>
<td align="center">
<div class="info_font" style=" word-wrap: break-word; word-break: break-all">
<td>
<div class="info-course">
<%= @project.name %>
</div>
<div>

View File

@ -27,8 +27,8 @@
</tr>
<tr>
<td colspan="2" width="580px" >
<p class="font_description">
<%= textilizable(truncate(e.event_description, :length => 68)) %>
<p class="info-break">
<%= h (truncate(e.event_description, :length => 240)) %>
</p></td>
</tr>
<tr>

View File

@ -15,15 +15,17 @@
<!-- fq -->
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(e.user), :class => "avatar") %></td>
<td>
<table width="580" border="0">
<table width="580" border="0" class "info-break">
<% case e.act_type %>
<% when 'Bid' %>
<tr>
<% if act.reward_type ==3 %>
<% if e.user == User.current%>
<td colspan="2" valign="top"><strong> <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong><span class="font_lighter"><%= l(:label_i_new_activity) %></span> <%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %></td>
<td colspan="2" valign="top"><strong> <%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong><span class="font_lighter"><%= l(:label_i_new_activity) %></span>
<%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %></td>
<% else %>
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp;<%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %></td>
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong>&nbsp;<span class="font_lighter"><%= l(:label_new_activity) %></span>&nbsp;
<%= link_to format_activity_title("#{l(:label_active_homework)}##{act.id}:#{act.name}"), respond_path(e.act_id) %></td>
<% end %>
<% else %>
<% if e.user == User.current%>
@ -38,7 +40,7 @@
<tr>
<td colspan="2" width="580" >
<p class="font_description">
<%= textilizable act.description %>
<%= h act.description %>
</p></td>
</tr>
<tr>
@ -57,7 +59,7 @@
<tr>
<td colspan="2" width="580" >
<p class="font_description">
<%= textilizable act.notes %>
<%= h act.notes %>
</p></td>
</tr>
<tr>
@ -74,7 +76,7 @@
<tr>
<td colspan="2" width="580" >
<p class="font_description">
<%= textilizable act.long_comments %>
<%= h act.long_comments %>
</p></td>
</tr>
<tr>
@ -91,7 +93,7 @@
<tr>
<td colspan="2" width="580" >
<p class="font_description">
<%= textilizable act.content %>
<%= h stringCut240(act.content) %>
</p></td>
</tr>
<tr>
@ -125,7 +127,7 @@
<tr>
<td colspan="2" width="580" >
<p class="font_description">
<%= textilizable act.description %>
<%= h act.description %>
</p></td>
</tr>
<tr>

View File

@ -281,6 +281,22 @@ ul.tool li{list-style-type:none;
color:#09b2c8;
padding-top: 50px;
}
.info-course{
padding-left: 8px;
font-family:微软雅黑;
font-weight:bold;
font-size:16px;
color:#4d4d4d;
word-wrap: break-word;
word-break: break-all;
}
.info-break{
word-wrap: break-word;
word-break: break-all;
}
.info_font{
padding-left: 8px;
font-family:微软雅黑;