socailForge#329

This commit is contained in:
yanxd 2014-03-28 14:55:34 +08:00
parent a9d662872c
commit 378e8cbefd
5 changed files with 29 additions and 16 deletions

View File

@ -56,7 +56,10 @@ class Issue < ActiveRecord::Base
:include => [:project, :visible_journals], :include => [:project, :visible_journals],
# sort by id so that limited eager loading doesn't break with postgresql # sort by id so that limited eager loading doesn't break with postgresql
:order_column => "#{table_name}.id" :order_column => "#{table_name}.id"
acts_as_event :title => Proc.new {|o| "#{o.tracker.name} ##{o.id} (#{o.status}): #{o.subject}"}, acts_as_event :title => Proc.new {|o|
#"#{o.tracker.name} ##{o.id} (#{o.status}): #{o.subject}"
"#{o.tracker.name} #{o.source_from} (#{o.status}): #{o.subject}"
},
:url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o}}, :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o}},
:type => Proc.new {|o| 'issue' + (o.closed? ? ' closed' : '') } :type => Proc.new {|o| 'issue' + (o.closed? ? ' closed' : '') }

View File

@ -158,9 +158,9 @@
<% when 'Issue' %> <% when 'Issue' %>
<tr> <tr>
<% if e.user == User.current%> <% 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;<%= 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> <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;<%= link_to format_activity_title("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %></td>
<% else %> <% 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.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> <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("#{act.source_from} (#{act.status}): #{act.tracker.name} #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %></td>
<% end %> <% end %>
</tr> </tr>
<tr> <td colspan="2" width="580" > <p class="font_description"> <%= textilizable act.description %> </p></td> </tr> <tr> <td colspan="2" width="580" > <p class="font_description"> <%= textilizable act.description %> </p></td> </tr>
@ -253,6 +253,6 @@
<% end %> <% end %>
<script type="text/javascript" language="javascript"> <script type="text/javascript" language="javascript">
$(document).ready(function($) { $(document).ready(function($) {
$("#content .pagination:first~ div").find("a").attr("target", "_blank"); $("#content .pagination:first~ div").first().find("a").attr("target", "_blank");
}); });
</script> </script>

View File

@ -1,21 +1,21 @@
<!--<% unless @events_by_day.empty? %> <!--<%# unless @events_by_day.empty? %>
<div id="activity"> <div id="activity">
<% @events_by_day.keys.sort.reverse.each do |day| %> <%# @events_by_day.keys.sort.reverse.each do |day| %>
<h4><%= format_activity_day(day) %></h4> <h4><%#= format_activity_day(day) %></h4>
<dl> <dl>
<% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%> <%# @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%>
<dt class="<%= e.event_type %>"> <dt class="<%#= e.event_type %>">
<span class="time"><%= format_time(e.event_datetime, false) %></span> <span class="time"><%#= format_time(e.event_datetime, false) %></span>
<%= content_tag('span', h(e.project), :class => 'project') %> <%#= content_tag('span', h(e.project), :class => 'project') %>
<%= link_to format_activity_title(e.event_title), e.event_url %></dt> <%#= link_to format_activity_title(e.event_title), e.event_url %></dt>
<dd><span class="description"><%= format_activity_description(e.event_description) %></span></dd> <dd><span class="description"><%#= format_activity_description(e.event_description) %></span></dd>
<% end -%> <%# end -%>
</dl> </dl>
<% end -%> <%# end -%>
</div> </div>
<% end %> --> <%# end %> -->
<% unless @events_by_day.empty? %> <% unless @events_by_day.empty? %>

View File

@ -17,6 +17,11 @@
$('#' + id).val(content); $('#' + id).val(content);
} }
} }
// 给主页用户弹新页面
$(document).ready(function($) {
$("#loggedas").find("a").attr("target", "_blank");
//$("#content .tabs_new~ .pagination").find("a").removeAttr("target");
});
</script> </script>

View File

@ -17,6 +17,11 @@
$('#' + id).val(content); $('#' + id).val(content);
} }
} }
// 给主页用户弹新页面
$(document).ready(function($) {
$("#loggedas").find("a").attr("target", "_blank");
//$("#content .tabs_new~ .pagination").find("a").removeAttr("target");
});
</script> </script>