diff options
| author | hukl <hukl@eight.local> | 2009-02-08 14:06:03 +0100 |
|---|---|---|
| committer | hukl <hukl@eight.local> | 2009-02-08 14:06:03 +0100 |
| commit | 56e1df622f8cb6fb558b83fc4d2836ad0aece7d7 (patch) | |
| tree | 7cef4583f4b025847f4e0ce506fff8fc082ef30c /app/views | |
| parent | 1a6516c7c8103fb63e7e11134e0fd8ff9f26d6fe (diff) | |
added nodes controller and made it a resource.
since the node is the proxy for the pages behind
it, it makes sense to operate on nodes rather than
on the pages themselves.
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/layouts/admin.html.erb | 15 | ||||
| -rw-r--r-- | app/views/nodes/create.html.erb | 2 | ||||
| -rw-r--r-- | app/views/nodes/destroy.html.erb | 2 | ||||
| -rw-r--r-- | app/views/nodes/edit.html.erb | 34 | ||||
| -rw-r--r-- | app/views/nodes/index.html.erb | 7 | ||||
| -rw-r--r-- | app/views/nodes/new.html.erb | 2 | ||||
| -rw-r--r-- | app/views/nodes/show.html.erb | 10 | ||||
| -rw-r--r-- | app/views/nodes/update.html.erb | 2 | ||||
| -rw-r--r-- | app/views/pages/index.html.erb | 3 |
9 files changed, 74 insertions, 3 deletions
diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb new file mode 100644 index 0000000..95161a8 --- /dev/null +++ b/app/views/layouts/admin.html.erb | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
| 3 | |||
| 4 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
| 5 | <head> | ||
| 6 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | ||
| 7 | |||
| 8 | <title>untitled</title> | ||
| 9 | |||
| 10 | </head> | ||
| 11 | |||
| 12 | <body> | ||
| 13 | <%= yield :layout %> | ||
| 14 | </body> | ||
| 15 | </html> | ||
diff --git a/app/views/nodes/create.html.erb b/app/views/nodes/create.html.erb new file mode 100644 index 0000000..05b6282 --- /dev/null +++ b/app/views/nodes/create.html.erb | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | <h1>Nodes#create</h1> | ||
| 2 | <p>Find me in app/views/nodes/create.html.erb</p> | ||
diff --git a/app/views/nodes/destroy.html.erb b/app/views/nodes/destroy.html.erb new file mode 100644 index 0000000..065cf1d --- /dev/null +++ b/app/views/nodes/destroy.html.erb | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | <h1>Nodes#destroy</h1> | ||
| 2 | <p>Find me in app/views/nodes/destroy.html.erb</p> | ||
diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb new file mode 100644 index 0000000..a5668e2 --- /dev/null +++ b/app/views/nodes/edit.html.erb | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | <h1>Nodes#edit</h1> | ||
| 2 | |||
| 3 | <h1>Editing page</h1> | ||
| 4 | |||
| 5 | <% form_for(@page) do |f| %> | ||
| 6 | <%= f.error_messages %> | ||
| 7 | |||
| 8 | <p> | ||
| 9 | <%= f.label :node_id %><br /> | ||
| 10 | <%= f.text_field :node_id %> | ||
| 11 | </p> | ||
| 12 | <p> | ||
| 13 | <%= f.label :title %><br /> | ||
| 14 | <%= f.text_field :title %> | ||
| 15 | </p> | ||
| 16 | <p> | ||
| 17 | <%= f.label :abstract %><br /> | ||
| 18 | <%= f.text_area :abstract %> | ||
| 19 | </p> | ||
| 20 | <p> | ||
| 21 | <%= f.label :body %><br /> | ||
| 22 | <%= f.text_area :body %> | ||
| 23 | </p> | ||
| 24 | <p> | ||
| 25 | <%= f.label :revision %><br /> | ||
| 26 | <%= f.text_field :revision %> | ||
| 27 | </p> | ||
| 28 | <p> | ||
| 29 | <%= f.submit "Update" %> | ||
| 30 | </p> | ||
| 31 | <% end %> | ||
| 32 | |||
| 33 | <%= link_to 'Show', @page %> | | ||
| 34 | <%= link_to 'Back', pages_path %> | ||
diff --git a/app/views/nodes/index.html.erb b/app/views/nodes/index.html.erb new file mode 100644 index 0000000..6cbf76d --- /dev/null +++ b/app/views/nodes/index.html.erb | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | <h1>Nodes</h1> | ||
| 2 | |||
| 3 | <ul> | ||
| 4 | <% @nodes.each do |node| %> | ||
| 5 | <li><%= link_to node.unique_name, node_path(node) %></li> | ||
| 6 | <% end %> | ||
| 7 | </ul> \ No newline at end of file | ||
diff --git a/app/views/nodes/new.html.erb b/app/views/nodes/new.html.erb new file mode 100644 index 0000000..4258377 --- /dev/null +++ b/app/views/nodes/new.html.erb | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | <h1>Nodes#new</h1> | ||
| 2 | <p>Find me in app/views/nodes/new.html.erb</p> | ||
diff --git a/app/views/nodes/show.html.erb b/app/views/nodes/show.html.erb new file mode 100644 index 0000000..bbf11c0 --- /dev/null +++ b/app/views/nodes/show.html.erb | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | <h1>Nodes</h1> | ||
| 2 | |||
| 3 | <table> | ||
| 4 | <% @nodes.each do |node| %> | ||
| 5 | <tr> | ||
| 6 | <td><%= link_to node.unique_name, node_path(node) %></td> | ||
| 7 | <td><%= link_to 'Edit', edit_node_path(node) %></td> | ||
| 8 | </tr> | ||
| 9 | <% end %> | ||
| 10 | </table> \ No newline at end of file | ||
diff --git a/app/views/nodes/update.html.erb b/app/views/nodes/update.html.erb new file mode 100644 index 0000000..5c6caa8 --- /dev/null +++ b/app/views/nodes/update.html.erb | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | <h1>Nodes#update</h1> | ||
| 2 | <p>Find me in app/views/nodes/update.html.erb</p> | ||
diff --git a/app/views/pages/index.html.erb b/app/views/pages/index.html.erb index f5918f0..16539da 100644 --- a/app/views/pages/index.html.erb +++ b/app/views/pages/index.html.erb | |||
| @@ -4,9 +4,6 @@ | |||
| 4 | <tr> | 4 | <tr> |
| 5 | <th>Node</th> | 5 | <th>Node</th> |
| 6 | <th>Title</th> | 6 | <th>Title</th> |
| 7 | <th>Abstract</th> | ||
| 8 | <th>Body</th> | ||
| 9 | <th>Revision</th> | ||
| 10 | </tr> | 7 | </tr> |
| 11 | 8 | ||
| 12 | <% for page in @pages %> | 9 | <% for page in @pages %> |
