applied my changes - initial import
[boxroom-stian.git] / app / views / frontpage / list.rhtml
blob8908a4a6265a6fd1854b41126fb170f7d4068259
1 <h2>Recent news</h2>
2 <table>
3 <% has_access = @logged_in_user.groups.include?(Group.find_by_name("frontpage"))  %>
4 <% for news in @news %>
5   <tr class="<%= cycle('even', 'odd') %>">
6   <td>
7     <b><font color=#993300><%= news.title %>                   </font></b>
8  <br>
9 <i><%= news.date.to_formatted_s(:short) %></i><br>
10     <%= news.text %> 
11     <% if has_access %>
12       <%= link_to 'Edit', { :action => 'edit', :id => news }, { :title => 'Edit this news item' }%> |
13       <%= link_to 'Delete', { :action => 'delete', :id => news }, { :title => 'Delete this news item', :confirm => 'Are you sure you want to delete this news item?' } %>
14       <% end %>
15       
16 </td></tr><% end %>
17 </table>
19 <%= link_to 'Previous page', { :page => @news_pages.current.previous } if @news_pages.current.previous %>
20 <%= link_to 'Next page', { :page => @news_pages.current.next } if @news_pages.current.next %> 
22 <br />
24 <% if has_access %><%= link_to 'Add new item', :action => 'new' %><% end %>