forked from bofh/fetsite
pages added
This commit is contained in:
23
app/views/pages/_form.haml
Normal file
23
app/views/pages/_form.haml
Normal file
@@ -0,0 +1,23 @@
|
||||
= form_for(@page) do |f|
|
||||
|
||||
%p
|
||||
= f.label :name
|
||||
= f.text_field :name
|
||||
|
||||
%p
|
||||
- unless @page.new_record?
|
||||
= link_to 'Edit mode', '#', :id => 'write'
|
||||
= link_to 'Preview mode', preview_page_path(@page), :id => 'preview'
|
||||
#write_area
|
||||
= f.textile_editor :body
|
||||
#preview_area.hide
|
||||
|
||||
%p
|
||||
= f.label 'Describe this change (optional)'
|
||||
= f.text_field :change_comment
|
||||
|
||||
.actions
|
||||
= f.submit
|
||||
= cancel_link
|
||||
|
||||
= raw(textile_editor_initialize(:framework => :jquery))
|
||||
12
app/views/pages/_form.html.erb
Normal file
12
app/views/pages/_form.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<%= tinymce_assets %>
|
||||
<%= semantic_form_for @page do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<%= f.input :name %>
|
||||
<%= f.input :body, :as=>:text,:input_html=>{:style=>"width:100%"} %>
|
||||
<%= f.input :change_comment %>
|
||||
<% end %>
|
||||
<%= tinymce %>
|
||||
<%= f.actions do %>
|
||||
<%= f.action :submit, :as =>:input %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
3
app/views/pages/_index.haml
Normal file
3
app/views/pages/_index.haml
Normal file
@@ -0,0 +1,3 @@
|
||||
%h3 Table of contents
|
||||
|
||||
%ul#pages_list= render Page.root
|
||||
0
app/views/pages/_item.haml
Normal file
0
app/views/pages/_item.haml
Normal file
7
app/views/pages/_page.haml
Normal file
7
app/views/pages/_page.haml
Normal file
@@ -0,0 +1,7 @@
|
||||
%li{:id => dom_id(page), :class => "level_#{page.level}"}
|
||||
|
||||
= link_to page.name, page_path(page)
|
||||
= link_to '(Add)', new_page_path, :rel => dom_id(page)
|
||||
|
||||
- unless page.children.empty?
|
||||
%ul= render page.children
|
||||
5
app/views/pages/destroy.js.erb
Normal file
5
app/views/pages/destroy.js.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<% unless @page.errors.any? -%>
|
||||
$("#flash_notice").html("<%= escape_javascript(flash[:notice])%>");
|
||||
$("#flash_notice").show(300);
|
||||
$("#<%= dom_id(@page)%>").fadeOut('fast');
|
||||
<% end -%>
|
||||
2
app/views/pages/edit.haml
Normal file
2
app/views/pages/edit.haml
Normal file
@@ -0,0 +1,2 @@
|
||||
%h1="Editing page \"#{@page.name}\""
|
||||
= render 'form'
|
||||
2
app/views/pages/edit.html.erb
Normal file
2
app/views/pages/edit.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<h1>Edit Form</h1>
|
||||
<%= render 'form' %>
|
||||
2
app/views/pages/new.haml
Normal file
2
app/views/pages/new.haml
Normal file
@@ -0,0 +1,2 @@
|
||||
%h1 New page
|
||||
= render 'form'
|
||||
15
app/views/pages/show.haml
Normal file
15
app/views/pages/show.haml
Normal file
@@ -0,0 +1,15 @@
|
||||
%small
|
||||
= breadcrumbs(@page)
|
||||
|
||||
%h4
|
||||
= "Page name: #{@page.name}"
|
||||
= link_to '(Edit)', edit_page_path(@page)
|
||||
= link_to '(Destroy)', @page, :remote => true, :confirm => 'Are you sure?', :method => :delete
|
||||
|
||||
%small= "Last edited by #{@page.author} #{time_ago_in_words(@page.date)} ago."
|
||||
|
||||
%hr
|
||||
|
||||
= raw(@page.content)
|
||||
|
||||
%hr
|
||||
8
app/views/rubriken/_admin_liste.html.erb
Normal file
8
app/views/rubriken/_admin_liste.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<table class="table">
|
||||
<% rubriken.each do |r| %>
|
||||
<% r.neuigkeiten.each do |n| %>
|
||||
<tr>
|
||||
<td><%= r.name %></td><td><%= n.title %></td></tr>
|
||||
<% end
|
||||
end %>
|
||||
</table>
|
||||
1
app/views/rubriken/alle_verwalten.html.erb
Normal file
1
app/views/rubriken/alle_verwalten.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
<%= render :partial=>"admin_liste", :locals=>{:rubriken=>@rubriken} %>
|
||||
Reference in New Issue
Block a user