Initial import
This commit is contained in:
15
app/views/wiki/_form.html.haml
Normal file
15
app/views/wiki/_form.html.haml
Normal file
@@ -0,0 +1,15 @@
|
||||
= error_messages_for 'wiki_page'
|
||||
|
||||
%dl
|
||||
%dt
|
||||
%label{:for => 'wiki_page_title'} Título
|
||||
%dd= text_field 'wiki_page', 'title'
|
||||
|
||||
%dt
|
||||
%label{:for =>'wiki_page_content'} Conteúdo
|
||||
%dd= preserve(text_area('wiki_page', 'content'))
|
||||
|
||||
- unless @wiki_page.new_record?
|
||||
%dt
|
||||
%label{:for => 'wiki_page_description'} Descrição das alterações
|
||||
%dd= text_field('wiki_page', 'description', { :size => '80' })
|
||||
6
app/views/wiki/_history.html.haml
Normal file
6
app/views/wiki/_history.html.haml
Normal file
@@ -0,0 +1,6 @@
|
||||
= action_icon('undo', "Reverter", edit_course_wiki_url(@course, @wiki_page, :description => "Revertendo para versão #{page.version}", :version => page.version)) + " "
|
||||
= link_to page.updated_at.strftime("%d/%m/%y %H:%M:%S"), course_wiki_url(@course, @wiki_page, :version => page.version)
|
||||
= "por #{link_to h(page.user.display_name), user_path(page.user)}" if page.respond_to?(:user) and !page.user.nil?
|
||||
|
||||
- if page.description and !page.description.empty?
|
||||
= "(<i>#{h(page.description)}</i>)"
|
||||
11
app/views/wiki/diff.html.haml
Normal file
11
app/views/wiki/diff.html.haml
Normal file
@@ -0,0 +1,11 @@
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title= h(@wiki_page.title)
|
||||
|
||||
%p
|
||||
Comparando versões:
|
||||
%ul
|
||||
%li= render :partial => 'wiki/history', :locals => { :page => @to }
|
||||
%li= render :partial => 'wiki/history', :locals => { :page => @from }
|
||||
|
||||
= link_to "Comparar outras versões", versions_course_wiki_url(@course, @wiki_page, :from => @from.version, :to => @to.version)
|
||||
= format_diff h(@diff)
|
||||
14
app/views/wiki/edit.html.haml
Normal file
14
app/views/wiki/edit.html.haml
Normal file
@@ -0,0 +1,14 @@
|
||||
= javascript_include_tag 'wiki'
|
||||
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title= "Editar #{h(@wiki_page.title)}"
|
||||
|
||||
%p
|
||||
- form_tag course_wiki_url(@course, @wiki_page.id), :method => :put do
|
||||
= render :partial => 'form'
|
||||
= submit_tag 'Salvar'
|
||||
%button#show_preview{:type => "button"}
|
||||
Visualizar
|
||||
= image_tag "loading.gif", :class => "spinner_button", :id => "spinner_preview", :style => "display: none"
|
||||
#wiki_preview{:style => "display: none"}
|
||||
|
||||
13
app/views/wiki/new.html.haml
Normal file
13
app/views/wiki/new.html.haml
Normal file
@@ -0,0 +1,13 @@
|
||||
= javascript_include_tag 'wiki'
|
||||
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title Adicionar página wiki
|
||||
|
||||
%p
|
||||
- form_tag course_wiki_url(@course, @wiki_page.id) do
|
||||
= render :partial => 'form'
|
||||
= submit_tag "Criar"
|
||||
%button#show_preview{:type => "button"}
|
||||
Visualizar
|
||||
= image_tag "loading.gif", :class => "spinner_button", :id => "spinner_preview", :style => "display: none"
|
||||
#wiki_preview{:style => "display: none"}
|
||||
16
app/views/wiki/show.html.haml
Normal file
16
app/views/wiki/show.html.haml
Normal file
@@ -0,0 +1,16 @@
|
||||
= javascript_include_tag 'wiki'
|
||||
|
||||
.cmd
|
||||
= action_icon 'edit', 'Editar', edit_course_wiki_url
|
||||
= action_icon 'undo', 'Historico', versions_course_wiki_url
|
||||
= action_icon 'trash', 'Excluir página wiki', course_wiki_url, :confirm => 'Tem certeza que deseja excluir?', :method => :delete
|
||||
|
||||
- cache(:action => 'show', :short_name => h(@course.short_name), :title => h(@wiki_page.title) ) do
|
||||
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title= h(@wiki_page.title)
|
||||
#wiki_text
|
||||
= @wiki_page.to_html
|
||||
|
||||
%script{:language => 'javascript'}
|
||||
== enumerate_headers();
|
||||
34
app/views/wiki/versions.html.haml
Normal file
34
app/views/wiki/versions.html.haml
Normal file
@@ -0,0 +1,34 @@
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title= "Histórico de #{h(@wiki_page.title)}"
|
||||
%br
|
||||
|
||||
= javascript_include_tag "history"
|
||||
|
||||
%script{:language => 'javascript'}
|
||||
== radios_to = #{h(@history_to)};
|
||||
== radios_from = #{h(@history_from)};
|
||||
|
||||
- form_tag diff_course_wiki_url(@course, @wiki_page), :method => :get do
|
||||
%button{:type => "submit"}= "Comparar as versões selecionadas"
|
||||
%table.log
|
||||
%tr
|
||||
%th.narrow
|
||||
%th.narrow
|
||||
%th Data
|
||||
%th Usuário
|
||||
%th Descrição
|
||||
- @wiki_page.versions.reverse.each do |entry|
|
||||
%tr
|
||||
%td.narrow
|
||||
%input{:type => "radio", :name => "from", :value => entry.version, :onclick => "history_from(#{entry.version})"}
|
||||
%td.narrow
|
||||
%input{:type => "radio", :name => "to", :value => entry.version, :onclick => %"history_to(#{entry.version})"}
|
||||
%td= link_to(entry.updated_at.strftime("%d/%m/%y %H:%M:%S"), course_wiki_url(@course, @wiki_page, :version => entry.version))
|
||||
%td= link_to truncate(h(entry.user.display_name), 20), user_path(entry.user)
|
||||
%td
|
||||
= entry.description
|
||||
- if (entry.version > @wiki_page.versions.minimum(:version))
|
||||
= "(" + link_to("diff", diff_course_wiki_url(@course, @wiki_page, :from => entry.version - 1, :to => entry.version)) + ")"
|
||||
= "(" + link_to("edit", edit_course_wiki_url(@course, @wiki_page, :description => "Revertendo para versão #{entry.version}", :version => entry.version)) + ")"
|
||||
|
||||
/= will_paginate @versions
|
||||
15
app/views/wiki/versions.xml.builder
Normal file
15
app/views/wiki/versions.xml.builder
Normal file
@@ -0,0 +1,15 @@
|
||||
xml.instruct! :xml, :version=>"1.0"
|
||||
xml.versions do
|
||||
xml.count @wiki_page.versions.count
|
||||
xml.offset @offset
|
||||
@wiki_page.versions[(@offset.to_i)..(@offset.to_i+30)].reverse.each do |version|
|
||||
xml.version do
|
||||
xml.created_at version.created_at
|
||||
xml.updated_at version.updated_at
|
||||
xml.description version.description
|
||||
xml.title version.title
|
||||
xml.user_id version.user_id
|
||||
xml.version version.version
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user