#1233修复个人主页--动态:点击项目链接报500错误的BUG

优化页面代码
This commit is contained in:
sw 2014-10-23 09:44:06 +08:00
parent e9124c62ce
commit 91d08d5b9a
1 changed files with 484 additions and 341 deletions

View File

@ -48,7 +48,9 @@
<% if e.act_type == 'JournalsForMessage' || e.act_type == 'Bid' || e.act_type == 'Journal'|| e.act_type == 'Changeset' || e.act_type == 'Message' || e.act_type == 'Principal' || e.act_type == 'News' || e.act_type == 'Issue' || e.act_type == 'Contest'%>
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
<tr>
<td colspan="2" valign="top" width="50"><%= image_tag(url_to_avatar(e.user), :class => "avatar") %></td>
<td colspan="2" valign="top" width="50">
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
</td>
<td>
<table width="580" border="0" class="info-break">
<% case e.act_type %>
@ -61,17 +63,22 @@
</strong>
&nbsp;
<% else %>
<strong><%= link_to("#{e.user.name}", user_path(e.user_id)) %></strong>
<strong>
<%= link_to("#{e.user.name}", user_path(e.user_id)) %>
</strong>
<% end %>
<span class="font_lighter">
<%= l(:label_have_feedback) %>
<%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %><%= l(:label_of_feedback) + l(:label_layouts_feedback) %>
<%= link_to("#{e.act.user.name}", user_path(e.act.user.id)) %>
<%= l(:label_of_feedback) + l(:label_layouts_feedback) %>
</span>
</td>
</tr>
<tr>
<td colspan="2" width="580">
<p class="font_description"> <%= textAreailizable act.notes %> </p>
<p class="font_description">
<%= textAreailizable act.notes %>
</p>
<div style="display: inline-block; float: right; margin-top: 0px">
<span>
<%= link_to(l(:label_goto), user_newfeedback_user_path(e.user_id)) %>
@ -82,7 +89,9 @@
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px"></div>
</td>
@ -114,14 +123,22 @@
<% else %>
<% 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>
<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_call)}##{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;
<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_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %>
</td>
<% end %>
@ -129,16 +146,24 @@
</tr>
<tr>
<td colspan="2" width="580">
<p class="font_description"> <%=textAreailizable act, :description %> </p></td>
<p class="font_description">
<%=textAreailizable act, :description %>
</p></td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px">
<span><%= link_to l(:label_find_all_comments), respond_path(e.act_id) %></span>
<a class="font_lighter"><%= l(:label_comments_count, :count => e.act.commit) %></a>
<span>
<%= link_to l(:label_find_all_comments), respond_path(e.act_id) %>
</span>
<a class="font_lighter">
<%= l(:label_comments_count, :count => e.act.commit) %>
</a>
</div>
</td>
</tr>
@ -146,17 +171,29 @@
<tr>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;
<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>
&nbsp;
<%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.id)) %>
<%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"),
{:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{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(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier)) %>
<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(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.id)) %>
<%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.id}: #{act.issue.subject}"),
{:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %>
</td>
@ -168,13 +205,18 @@
<% else %>
<% desStr= textAreailizable(act, :notes) %>
<% end %>
<td colspan="2" width="580"><p class="font_description"> <%= desStr %> </p>
<td colspan="2" width="580">
<p class="font_description">
<%= desStr %>
</p>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px"></div>
</td>
@ -183,8 +225,14 @@
<tr>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;
<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title(act.title),
{:controller => 'repositories',
:action => 'revision',
@ -194,8 +242,14 @@
</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;
<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(act.title),
{:controller => 'repositories',
:action => 'revision',
@ -207,12 +261,17 @@
</tr>
<tr>
<td colspan="2" width="580">
<p class="font_description"> <%= textAreailizable act,:long_comments %> </p></td>
<p class="font_description">
<%= textAreailizable act,:long_comments %>
</p>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter"> <%= format_time(e.act.committed_on) %></span>
<span class="font_lighter">
<%= format_time(e.act.committed_on) %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px">
<span><%= link_to l(:label_find_all_comments),
@ -222,7 +281,9 @@
:repository_id => act.repository.identifier_param,
:rev => act.identifier} %>
</span>
<a class="font_lighter"><%= l(:label_comments_count, :count => e.act.count) %></a>
<a class="font_lighter">
<%= l(:label_comments_count, :count => e.act.count) %>
</a>
</div>
</td>
</tr>
@ -230,8 +291,14 @@
<tr>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;
<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"),
{:controller => 'messages',
:action => 'show',
@ -239,8 +306,14 @@
</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;
<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("#{act.board.name}: #{act.subject}"),
{:controller => 'messages',
:action => 'show',
@ -250,13 +323,17 @@
</tr>
<tr>
<td colspan="2" width="580">
<p class="font_description"> <%= textAreailizable(act,:content) %> </p>
<p class="font_description">
<%= textAreailizable(act,:content) %>
</p>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px"></div>
</td>
@ -265,23 +342,37 @@
<tr>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;
<span class="font_lighter"><%= l(:label_new_user) %></span>
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_new_user) %>
</span>
</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_user) %></span>
<strong>
<%= link_to(h(e.user), user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_new_user) %>
</span>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" width="580"><p class="font_description"></p></td>
<td colspan="2" width="580">
<p class="font_description"></p>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px"></div>
</td>
@ -290,26 +381,43 @@
<tr>
<% if e.user == User.current %>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;
<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => 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;
<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_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" width="580">
<p class="font_description"> <%= textAreailizable act,:description %> </p></td>
<p class="font_description">
<%= textAreailizable act,:description %>
</p>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px">
<span>
@ -327,7 +435,8 @@
<td colspan="2" valign="top">
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>&nbsp;
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>&nbsp;
@ -359,11 +468,17 @@
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
</span>
</div>
<div style="display: inline-block; float: right; margin-top: 0px">
<span><%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} %></span>
<a class="font_lighter"><%= l(:label_comments_count, :count => e.act.journals.count) %></a>
<span>
<%= link_to l(:label_find_all_comments), {:controller => 'issues', :action => 'show', :id => act.id} %>
</span>
<a class="font_lighter">
<%= l(:label_comments_count, :count => e.act.journals.count) %>
</a>
</div>
</td>
</tr>
@ -371,26 +486,43 @@
<tr>
<% if e.user == User.current && @show_contest == 1%>
<td colspan="2" valign="top">
<strong><%= link_to("#{l(:label_i)}", user_path(e.user_id)) %></strong>&nbsp;
<span class="font_lighter"><%= l(:label_i_new_activity) %></span>&nbsp;
<strong>
<%= link_to("#{l(:label_i)}", user_path(e.user_id)) %>
</strong>
&nbsp;
<span class="font_lighter">
<%= l(:label_i_new_activity) %>
</span>
&nbsp;
<%= link_to format_activity_title("#{l(:label_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => 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;
<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_contest)}: #{act.name}"), {:controller => 'contests', :action => 'show_contest', :id => act.id} %>
</td>
<% end %>
</tr>
<tr>
<td colspan="2" width="580"><p class="font_description"> <%= textAreailizable act, :description %> </p>
<td colspan="2" width="580">
<p class="font_description">
<%= textAreailizable act, :description %>
</p>
</td>
</tr>
<tr>
<td>
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a">
<span class="font_lighter"> <%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %></span>
<span class="font_lighter">
<%= (l(:label_update_time).to_s << ':' << format_time(e.act.created_on)).to_s %>
</span>
</div>
</tr>
<% else %>
@ -451,12 +583,19 @@
</td>
</tr>
<tr>
<td colspan="2" width="580"><p class="font_description"> <%= textAreailizable e.notes %> </p></td>
<td colspan="2" width="580">
<p class="font_description">
<%= textAreailizable e.notes %>
</p>
</td>
</tr>
<tr>
<td align="left"><a class="font_lighter"></a></td>
<td width="200" align="right" class="a">
<span class="font_lighter"><%= format_time e.created_on %></span></td>
<span class="font_lighter">
<%= format_time e.created_on %>
</span>
</td>
</tr>
</table>
</td>
@ -466,11 +605,15 @@
</div>
<div class="pagination" style="float:left;">
<ul> <%= pagination_links_full @info_pages %> </ul>
<ul>
<%= pagination_links_full @info_pages %>
</ul>
</div>
<% else %>
<p class="font_description"><%= l(:label_no_user_respond_you) %></p>
<p class="font_description">
<%= l(:label_no_user_respond_you) %>
</p>
<% end %>