summaryrefslogtreecommitdiffstats
path: root/app/views/my/blocks/_latest_news.rhtml
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/my/blocks/_latest_news.rhtml')
-rw-r--r--app/views/my/blocks/_latest_news.rhtml13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/views/my/blocks/_latest_news.rhtml b/app/views/my/blocks/_latest_news.rhtml
new file mode 100644
index 000000000..85430ef54
--- /dev/null
+++ b/app/views/my/blocks/_latest_news.rhtml
@@ -0,0 +1,13 @@
+<h3><%=l(:label_news_latest)%></h3>
+
+<ul>
+<% for news in News.find :all,
+ :limit => 10,
+ :conditions => "news.project_id in (#{@user.projects.collect{|m| m.id}.join(',')})",
+ :include => [:project, :author] %>
+ <li><%= link_to news.title, :controller => 'news', :action => 'show', :id => news %><br />
+ <% unless news.summary.empty? %><%= news.summary %><br /><% end %>
+ <em><%= news.author.name %>, <%= format_time(news.created_on) %></em><br />&nbsp;
+ </li>
+<% end unless @user.projects.empty? %>
+</ul> \ No newline at end of file