You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

35 lines
1.1 KiB

= javascript_include_tag 'news'
-# cache(course_news_index_path(@course.id)) do
.cmd
= action_icon 'add', 'Adicionar', new_course_news_url
%h4.title= h(@course.full_name)
%h1.title Notícias
= auto_discovery_link_tag :rss, formatted_course_news_index_url(@course, :rss)
.box.div_news
- if !@course.news.empty?
%table
- @course.news.each do |n|
- n.revert_to(params[:version]) if (n.id == params[:id].to_i) and (params[:version])
%tr[n]
%td.top.aright{:width => '1%'}
= n.timestamp.strftime("%d de %B")
%td
.title= link_to h(n.title), course_news_url(@course, n)
.description{:style => (n.id == params[:id].to_i ? '' : 'display: none')}
.cmd
= action_icon 'edit', 'Editar', edit_course_news_url(@course, n, :version => n.version)
= action_icon 'trash', 'Excluir', course_news_url(@course, n), :confirm => 'Tem certeza que deseja excluir?', :method => :delete
= formatted(n.body)
= "Sem descrição" if n.body.empty?
- else
.box
%ul
%li.no_itens Nenhuma notícia