Initial import
This commit is contained in:
10
app/views/news/_form.html.haml
Normal file
10
app/views/news/_form.html.haml
Normal file
@@ -0,0 +1,10 @@
|
||||
= error_messages_for 'news'
|
||||
|
||||
%dl
|
||||
%dt
|
||||
%label{:for => "news_title"} Título
|
||||
%dd= text_field 'news', 'title'
|
||||
|
||||
%dt
|
||||
%label{:for => "news_body"} Descrição
|
||||
%dd= preserve(text_area('news', 'body'))
|
||||
7
app/views/news/edit.html.haml
Normal file
7
app/views/news/edit.html.haml
Normal file
@@ -0,0 +1,7 @@
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title Editar noticia
|
||||
|
||||
%p
|
||||
- form_tag course_news_url(@course, @news), :method => :put do
|
||||
= render :partial => 'form'
|
||||
= submit_tag 'Editar'
|
||||
28
app/views/news/index.html.haml
Normal file
28
app/views/news/index.html.haml
Normal file
@@ -0,0 +1,28 @@
|
||||
- cache 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)
|
||||
|
||||
.news
|
||||
- @course.news.each do |n|
|
||||
.line{:class => 'new', :id => "news_#{n.id}"}
|
||||
.cmd{:style => (n.id == params[:id].to_i ? '' : 'display: none')}
|
||||
= action_icon 'edit', 'Editar', edit_course_news_url(@course, n)
|
||||
= action_icon 'trash', 'Excluir', course_news_url(@course, n), :confirm => 'Tem certeza que deseja excluir?', :method => :delete
|
||||
|
||||
.left= n.timestamp.strftime("%d de %B")
|
||||
%h4
|
||||
= link_to h(n.title), course_news_url(@course, n)
|
||||
|
||||
%p{:style => (n.id == params[:id].to_i ? '' : 'display: none')}
|
||||
= h(n.body)
|
||||
|
||||
- if @course.news.empty?
|
||||
.box
|
||||
%ul
|
||||
%li.grey Nenhuma notícia
|
||||
18
app/views/news/index.rss.builder
Normal file
18
app/views/news/index.rss.builder
Normal file
@@ -0,0 +1,18 @@
|
||||
xml.instruct! :xml, :version=>"1.0"
|
||||
xml.rss(:version=>"2.0") do
|
||||
xml.channel do
|
||||
xml.title("#{App.title} - #{@course.full_name} - " + "News"[].titleize)
|
||||
xml.link(course_news_index_url(@course))
|
||||
xml.language(App.language)
|
||||
xml.description("{course} news"[:news_about, @course.full_name])
|
||||
for news_item in @news
|
||||
xml.item do
|
||||
xml.title(news_item.title)
|
||||
xml.description(news_item.body)
|
||||
xml.pubDate(news_item.timestamp.rfc2822)
|
||||
xml.link(course_news_url(@course, news_item))
|
||||
xml.guid(course_news_url(@course, news_item))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
6
app/views/news/new.html.haml
Normal file
6
app/views/news/new.html.haml
Normal file
@@ -0,0 +1,6 @@
|
||||
%h4.title= @course.full_name
|
||||
%h1.title Adicionar evento
|
||||
|
||||
- form_tag course_news_url(@course, @news), :method => :post do
|
||||
= render :partial => 'form'
|
||||
= submit_tag "Enviar"
|
||||
1
app/views/news/show.html.haml
Normal file
1
app/views/news/show.html.haml
Normal file
@@ -0,0 +1 @@
|
||||
= render 'news/index'
|
||||
Reference in New Issue
Block a user