活动不显示留言。
This commit is contained in:
parent
071738c54e
commit
4f9686fc57
|
@ -388,15 +388,14 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
pre_count = 10 #limit
|
||||
case params[:type]
|
||||
when "1"
|
||||
if @user == User.current
|
||||
activity = Activity.where('user_id = ?', User.current.id).order('id desc')
|
||||
@offset, @limit = api_offset_and_limit({:limit => 10})
|
||||
@activity_count = activity.count
|
||||
@activity_pages = Paginator.new @activity_count, @limit, params['page']
|
||||
@offset ||= @activity_pages.offset
|
||||
@activity = activity.offset(@offset).limit(@limit)
|
||||
@activity_pages = Paginator.new @activity_count, pre_count, params['page']
|
||||
@activity = activity.offset(@activity_pages.offset).limit(@activity_pages.per_page).all
|
||||
@state = 1
|
||||
end
|
||||
when "2"
|
||||
|
@ -405,28 +404,24 @@ class UsersController < ApplicationController
|
|||
message = JournalsForMessage.reference_message(@user.id)
|
||||
message += Journal.reference_message(@user.id)
|
||||
end
|
||||
@offset, @limit = api_offset_and_limit({:limit => 10})
|
||||
@activity_count = message.size
|
||||
@info_pages = Paginator.new @activity_count, @limit, params['page']
|
||||
@offset ||= @info_pages.offset
|
||||
|
||||
@info_pages = Paginator.new @activity_count, pre_count, params['page']
|
||||
messages = message.sort {|x,y| y.created_on <=> x.created_on }
|
||||
|
||||
@message = messages[@offset, @limit]
|
||||
@message = messages[@info_pages.offset, @info_pages.per_page]
|
||||
@state = 2
|
||||
else
|
||||
where_condition = nil;#"act_type <> 'JournalsForMessage'"
|
||||
where_condition = "act_type <> 'JournalsForMessage'"
|
||||
if @user == User.current
|
||||
watcher = User.watched_by(@user)
|
||||
watcher.push(User.current)
|
||||
activity = Activity.where('user_id in (?)', watcher).order('id desc')
|
||||
activity = Activity.where(where_condition).where('user_id in (?)', watcher).order('id desc')
|
||||
else
|
||||
activity = Activity.where('user_id = ?', @user.id).order('id desc')
|
||||
activity = Activity.where(where_condition).where('user_id = ?', @user.id).order('id desc')
|
||||
end
|
||||
@offset, @limit = api_offset_and_limit({:limit => 10})
|
||||
@activity_count = activity.count
|
||||
@activity_pages = Paginator.new @activity_count, @limit, params['page']
|
||||
@offset ||= @activity_pages.offset
|
||||
@activity = activity.offset(@offset).limit(@limit)
|
||||
@activity_pages = Paginator.new @activity_count, pre_count, params['page']
|
||||
@activity = activity.offset(@activity_pages.offset).limit(@activity_pages.per_page).all
|
||||
@state = 0
|
||||
end
|
||||
|
||||
|
|
|
@ -4,274 +4,248 @@
|
|||
<div class="user-search-block" style="float:right;margin-top:-55px">
|
||||
<table width="100%" valign="center">
|
||||
<tr>
|
||||
<td align="right">
|
||||
<div class="project-search">
|
||||
<%= text_field_tag 'user', params[:user], :size => 30 %>
|
||||
<%= submit_tag l(:label_search_by_user), :class => "small", :name => nil %>
|
||||
</div></td>
|
||||
<td align="right">
|
||||
<div class="project-search">
|
||||
<%= text_field_tag 'user', params[:user], :size => 30 %>
|
||||
<%= submit_tag l(:label_search_by_user), :class => "small", :name => nil %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% unless @state == 2%>
|
||||
<% unless @activity.empty? %>
|
||||
<div id="activity">
|
||||
<% @activity.each do |e| %>
|
||||
<% #next if( (e.act_type == 'JournalsForMessage') && !(User.current.id.eql?(params[:id].to_i)) ) %>
|
||||
<% act = e.act %>
|
||||
<% unless act.nil? %>
|
||||
|
||||
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;font-size:14px;">
|
||||
<tr>
|
||||
<!-- fq -->
|
||||
<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 %>
|
||||
<% when 'JournalsForMessage' %>
|
||||
<% if User.current.login == @user.login %>
|
||||
<% if e.user_id == act.jour.id %>
|
||||
<tr><td colspan="2" valign="top"><strong><%= link_to("#{e.user.show_name}", user_path(e.user_id)) %></strong> <span class="font_lighter">有了留言</td></tr>
|
||||
<% else %>
|
||||
<tr><td colspan="2" valign="top" class="font_lighter"><strong><%= link_to("#{e.user.show_name}", user_path(e.user_id)) %> 给 <%= link_to("#{act.jour.show_name}", user_path(act.jour.id)) %> 留言了</strong> </td></tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<tr><td colspan="2" valign="top"><strong><%= link_to("#{@user.show_name}", user_path(e.user_id)) %></strong> <span class="font_lighter">有了新的动态</td></tr>
|
||||
<% end %>
|
||||
<!-- end -->
|
||||
<tr>
|
||||
<td colspan="2" width="580" >
|
||||
<p class="font_description">
|
||||
<%=textilizable act.notes %>
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div style="display: inline-block; float: right; margin-top: 0px"></div>
|
||||
|
||||
<% 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>
|
||||
<% else %>
|
||||
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span>
|
||||
<%= 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%>
|
||||
<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_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> <span class="font_lighter"><%= l(:label_new_activity) %></span>
|
||||
<%= link_to format_activity_title("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %></td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580" >
|
||||
<p class="font_description">
|
||||
<%= h act.description %>
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<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></div>
|
||||
<% when 'Journal' %>
|
||||
<!-- modified by bai -->
|
||||
<tr>
|
||||
<% 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(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier))%> <%= 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> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to( l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier))%> <%= 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>
|
||||
<% end %>
|
||||
</tr>
|
||||
<!-- end -->
|
||||
<tr>
|
||||
<td colspan="2" width="580" >
|
||||
<p class="font_description">
|
||||
<%= h act.notes %>
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div style="display: inline-block; float: right; margin-top: 0px"></div>
|
||||
<% when 'Changeset' %>
|
||||
<tr>
|
||||
<% 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(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %></td>
|
||||
<% else %>
|
||||
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to format_activity_title(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580" >
|
||||
<p class="font_description">
|
||||
<%= h act.long_comments %>
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div style="display: inline-block; float: right; margin-top: 0px"><span><%= link_to l(:label_find_all_comments), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.count)%></a></div>
|
||||
<% when 'Message' %>
|
||||
<tr>
|
||||
<% 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("#{act.board.name}: #{act.subject}"), {:controller => 'messages', :action => 'show', :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %></td>
|
||||
<% else %>
|
||||
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), {:controller => 'messages', :action => 'show', :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580" >
|
||||
<p class="font_description">
|
||||
<%= h stringCut240(act.content) %>
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div style="display: inline-block; float: right; margin-top: 0px"></div>
|
||||
<% when 'Principal' %>
|
||||
<tr>
|
||||
<% 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_new_user) %></span></td>
|
||||
<% else %>
|
||||
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_new_user) %></span></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580" >
|
||||
<p class="font_description">
|
||||
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div style="display: inline-block; float: right; margin-top: 0px"></div>
|
||||
<% when 'News' %>
|
||||
<tr>
|
||||
<% 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_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> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= 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">
|
||||
<%= h act.description %>
|
||||
</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div style="display: inline-block; float: right; margin-top: 0px"><span><%= link_to l(:label_find_all_comments), {:controller => 'news', :action => 'show', :id => act.id} %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.comments_count)%></a></div>
|
||||
<% when 'Issue' %>
|
||||
<!-- modified by bai -->
|
||||
<tr>
|
||||
<% 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(l(:label_activity_project)+act.project.name, project_path(act.project.identifier))%> <%= link_to format_activity_title("#{act.tracker.name} ##{act.id} (#{act.status}): #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %></td>
|
||||
<% else %>
|
||||
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to(l(:label_activity_project)+act.project.name, project_path(act.project.identifier))%> <%= link_to format_activity_title("#{act.tracker.name} ##{act.id} (#{act.status}): #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<!-- end -->
|
||||
<tr>
|
||||
<td colspan="2" width="580" >
|
||||
<p class="font_description">
|
||||
<%= textilizable act.description %>
|
||||
</p></td>
|
||||
</tr>
|
||||
<!--modified by nie -->
|
||||
<tr>
|
||||
<td>
|
||||
<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></div>
|
||||
<% end %>
|
||||
<div style="display: inline-block; float: left; margin-top: 0px" width="200" align="right" class="a"><span class="font_lighter"> <% if e.act_type == 'Changeset' %>
|
||||
<%= format_time(e.act.committed_on) %>
|
||||
<% else %>
|
||||
<%= l :label_update_time %>: <%= format_time(e.act.created_on) %>
|
||||
<% end %></span></div>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr><div class="line_under"></div></tr> -->
|
||||
</table></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="pagination" style="float:left;">
|
||||
<ul>
|
||||
<%= pagination_links_full @activity_pages %>
|
||||
<ul>
|
||||
</div>
|
||||
<% else %>
|
||||
<% if @user == User.current %>
|
||||
<%= l(:label_user_activities) %>
|
||||
<% else %>
|
||||
<p class="font_description">
|
||||
<%= l(:label_user_activities_other) %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% unless @state == 2%>
|
||||
<% unless @activity.empty? %>
|
||||
<div id="activity">
|
||||
<% @activity.each do |e| %>
|
||||
<% act = e.act %>
|
||||
<% unless act.nil? %>
|
||||
<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>
|
||||
<table width="580" border="0" class="info-break">
|
||||
<% case e.act_type %>
|
||||
<% when 'JournalsForMessage' %>
|
||||
<% if User.current.login == @user.login %>
|
||||
<% if e.user_id == act.jour.id %>
|
||||
<tr><td colspan="2" valign="top"><strong><%= link_to("#{e.user.show_name}", user_path(e.user_id)) %></strong> <span class="font_lighter">有了留言</span></td></tr>
|
||||
<% else %>
|
||||
<tr><td colspan="2" valign="top" class="font_lighter"><strong><%= link_to("#{e.user.show_name}", user_path(e.user_id)) %> 给 <%= link_to("#{act.jour.show_name}", user_path(act.jour.id)) %> 留言了</strong> </td></tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<tr><td colspan="2" valign="top"><strong><%= link_to("#{@user.show_name}", user_path(e.user_id)) %></strong> <span class="font_lighter">有了新的动态</span></td></tr>
|
||||
<% end %>
|
||||
<tr> <td colspan="2" width="580" > <p class="font_description"> <%=textilizable act.notes %> </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>
|
||||
</div>
|
||||
<div style="display: inline-block; float: right; margin-top: 0px"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<% 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>
|
||||
<% else %>
|
||||
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= 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%>
|
||||
<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_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> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to format_activity_title("#{l(:label_active_call)}##{act.id}:#{act.name}"), respond_path(e.act_id) %></td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tr>
|
||||
<tr> <td colspan="2" width="580" > <p class="font_description"> <%= h 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>
|
||||
</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></div>
|
||||
</td>
|
||||
</tr>
|
||||
<% when 'Journal' %>
|
||||
<tr>
|
||||
<% 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(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier))%> <%= 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> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to( l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.identifier))%> <%= 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>
|
||||
<% end %>
|
||||
</tr>
|
||||
<tr> <td colspan="2" width="580" > <p class="font_description"> <%= h act.notes %> </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>
|
||||
</div>
|
||||
<div style="display: inline-block; float: right; margin-top: 0px"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<% when 'Changeset' %>
|
||||
<tr>
|
||||
<% 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(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %></span></td>
|
||||
<% else %>
|
||||
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to format_activity_title(act.title), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<tr> <td colspan="2" width="580" > <p class="font_description"> <%= h 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>
|
||||
</div>
|
||||
<div style="display: inline-block; float: right; margin-top: 0px"><span><%= link_to l(:label_find_all_comments), {:controller => 'repositories', :action => 'revision', :id => act.repository.project, :repository_id => act.repository.identifier_param, :rev => act.identifier} %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.count)%></a></div>
|
||||
</td>
|
||||
</tr>
|
||||
<% when 'Message' %>
|
||||
<tr>
|
||||
<% 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("#{act.board.name}: #{act.subject}"), {:controller => 'messages', :action => 'show', :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %></td>
|
||||
<% else %>
|
||||
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), {:controller => 'messages', :action => 'show', :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<tr> <td colspan="2" width="580" > <p class="font_description"> <%= h stringCut240(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>
|
||||
</div>
|
||||
<div style="display: inline-block; float: right; margin-top: 0px"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<% when 'Principal' %>
|
||||
<tr>
|
||||
<% 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_new_user) %></span></td>
|
||||
<% else %>
|
||||
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_new_user) %></span></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<tr> <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>
|
||||
</div>
|
||||
<div style="display: inline-block; float: right; margin-top: 0px"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<% when 'News' %>
|
||||
<tr>
|
||||
<% 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_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> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= 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"> <%= h 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>
|
||||
</div>
|
||||
<div style="display: inline-block; float: right; margin-top: 0px"><span><%= link_to l(:label_find_all_comments), {:controller => 'news', :action => 'show', :id => act.id} %></span><a class="font_lighter"><%= l(:label_comments_count, :count => e.act.comments_count)%></a></div></td>
|
||||
</tr>
|
||||
<% when 'Issue' %>
|
||||
<tr>
|
||||
<% 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(l(:label_activity_project)+act.project.name, project_path(act.project.identifier))%> <%= link_to format_activity_title("#{act.tracker.name} ##{act.id} (#{act.status}): #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %></td>
|
||||
<% else %>
|
||||
<td colspan="2" valign="top"><strong><%= link_to(h(e.user), user_path(e.user_id)) %></strong> <span class="font_lighter"><%= l(:label_new_activity) %></span> <%= link_to(l(:label_activity_project)+act.project.name, project_path(act.project.identifier))%> <%= link_to format_activity_title("#{act.tracker.name} ##{act.id} (#{act.status}): #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<tr> <td colspan="2" width="580" > <p class="font_description"> <%= textilizable 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>
|
||||
</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></div>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %><!-- < % #case end %> -->
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %><!-- < % #unless act.nil? end %> -->
|
||||
|
||||
<% end %><!-- < % #@activity.each do |e| end%> -->
|
||||
</div>
|
||||
<div class="pagination" style="float:left;">
|
||||
<ul> <%= pagination_links_full @activity_pages %> </ul>
|
||||
</div>
|
||||
<% else %> <!-- < %# unless @activity.empty? %> -->
|
||||
<% if @user == User.current %>
|
||||
<%= l(:label_user_activities) %>
|
||||
<% else %>
|
||||
<p class="font_description">
|
||||
<%= l(:label_user_activities_other) %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% end %><!-- < %# unless @activity.empty? end %> -->
|
||||
|
||||
<% else %>
|
||||
<!-- fq -->
|
||||
<% unless @message.empty? %>
|
||||
<div id="activity">
|
||||
<% @message.each do |e| -%>
|
||||
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;">
|
||||
<tr>
|
||||
<!-- fq -->
|
||||
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(e.user), :class => "avatar") %></td>
|
||||
<td>
|
||||
<table width="580" border="0">
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><strong> <%= link_to(h(e.user), user_path(e.user)) %></strong><span class="font_lighter">
|
||||
<% if e.instance_of?(JournalsForMessage)%>
|
||||
<% if e.reply_id == User.current.id%>
|
||||
<%if e.jour_type == 'Bid'%>
|
||||
<%= l(:label_in_bids)%><%= link_to(e.jour.name, respond_path(e.jour))%> <%= l(:label_quote_my_words) %>
|
||||
<% unless @message.empty? %>
|
||||
<div id="activity">
|
||||
<% @message.each do |e| -%>
|
||||
<table width="660" border="0" align="left" style="border-bottom: 1px dashed rgb(204, 204, 204); margin-bottom: 10px;">
|
||||
<tr>
|
||||
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(e.user), :class => "avatar") %></td>
|
||||
<td>
|
||||
<table width="580" border="0">
|
||||
<tr>
|
||||
<td colspan="2" valign="top"><strong> <%= link_to(h(e.user), user_path(e.user)) %></strong><span class="font_lighter">
|
||||
<% if e.instance_of?(JournalsForMessage)%>
|
||||
<% if e.reply_id == User.current.id%>
|
||||
<%if e.jour_type == 'Bid'%>
|
||||
<%= l(:label_in_bids)%><%= link_to(e.jour.name, respond_path(e.jour))%> <%= l(:label_quote_my_words) %>
|
||||
<% else %>
|
||||
<%= l(:label_in_users)%><%= link_to(e.jour.firstname, feedback_path(e.jour))%> <%= l(:label_quote_my_words) %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= l(:label_in_users)%><%= link_to(e.jour.firstname, feedback_path(e.jour))%> <%= l(:label_quote_my_words) %>
|
||||
<%= l(:label_about_requirement) %><%= link_to(e.jour.name, respond_path(e.jour_id))%> <%= l(:label_have_respond) %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= l(:label_about_requirement) %><%= link_to(e.jour.name, respond_path(e.jour_id))%> <%= l(:label_have_respond) %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if e.journal_reply.nil? || e.journal_reply.reply_id != User.current.id %>
|
||||
<%= l(:label_about_issue) %><%= link_to(e.issue.subject, issue_path(e.journalized_id))%><%= l(:label_have_respond) %>
|
||||
<% if e.journal_reply.nil? || e.journal_reply.reply_id != User.current.id %>
|
||||
<%= l(:label_about_issue) %><%= link_to(e.issue.subject, issue_path(e.journalized_id))%><%= l(:label_have_respond) %>
|
||||
|
||||
<% else %>
|
||||
<%= l(:label_in_issues)%><%= link_to(e.issue.subject, issue_path(e.issue))%><%= l(:label_quote_my_words) %>
|
||||
<% end %>
|
||||
<% end %> </span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580" >
|
||||
<p class="font_description">
|
||||
<%= textilizable 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>
|
||||
</tr>
|
||||
<!-- <tr><div class="line_under"></div></tr> -->
|
||||
</table></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% else %>
|
||||
<%= l(:label_in_issues)%><%= link_to(e.issue.subject, issue_path(e.issue))%><%= l(:label_quote_my_words) %>
|
||||
<% end %>
|
||||
<% end %> </span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" width="580" > <p class="font_description"> <%= textilizable 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>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="pagination" style="float:left;">
|
||||
<ul> <%= pagination_links_full @info_pages %> <ul>
|
||||
</div>
|
||||
|
||||
<% else %>
|
||||
<p class="font_description"><%= l(:label_no_user_respond_you) %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="pagination" style="float:left;">
|
||||
<ul>
|
||||
<%= pagination_links_full @info_pages %>
|
||||
<ul>
|
||||
</div>
|
||||
<% else %>
|
||||
<p class="font_description"><%= l(:label_no_user_respond_you) %></p>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue