diff options
| author | hukl <contact@smyck.org> | 2009-02-17 21:56:05 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-02-17 21:56:05 +0100 |
| commit | ea8c12c74c332f6b4c12f3e582baf3cbe901e87d (patch) | |
| tree | 8da207c4f101e484c80b635a8bfae94e0d557986 | |
| parent | f61b5b0597e0c25f084ee67d402f12a43a7a9947 (diff) | |
modified edit form to work with translated
attributes. there seems to be something bogus
with form for - to be investigated
| -rw-r--r-- | app/views/nodes/edit.html.erb | 56 |
1 files changed, 32 insertions, 24 deletions
diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb index 67e3c56..477db81 100644 --- a/app/views/nodes/edit.html.erb +++ b/app/views/nodes/edit.html.erb | |||
| @@ -2,28 +2,36 @@ | |||
| 2 | 2 | ||
| 3 | <h1>Editing page</h1> | 3 | <h1>Editing page</h1> |
| 4 | 4 | ||
| 5 | <% form_for(@node) do |f| %> | 5 | <%= I18n.locale %> |
| 6 | <%= f.error_messages %> | 6 | |
| 7 | 7 | <%= @node.unique_name %> | |
| 8 | <% fields_for @node.find_or_create_draft( current_user ) do |d| %> | ||
| 9 | <p> | ||
| 10 | <%= d.label :title %><br /> | ||
| 11 | <%= d.text_field :title %> | ||
| 12 | </p> | ||
| 13 | <p> | ||
| 14 | <%= d.label :abstract %><br /> | ||
| 15 | <%= d.text_area :abstract %> | ||
| 16 | </p> | ||
| 17 | <p> | ||
| 18 | <%= d.label :body %><br /> | ||
| 19 | <%= d.text_area :body %> | ||
| 20 | </p> | ||
| 21 | <% end %> | ||
| 22 | |||
| 23 | <p> | ||
| 24 | <%= f.submit "Update" %> | ||
| 25 | </p> | ||
| 26 | <% end %> | ||
| 27 | 8 | ||
| 28 | <%= link_to 'Show', @page %> | | 9 | <div class="page_editor"> |
| 29 | <%= link_to 'Back', pages_path %> | 10 | <% form_for(@node) do |f| %> |
| 11 | <%= f.error_messages %> | ||
| 12 | |||
| 13 | <% draft = @node.find_or_create_draft( current_user ) %> | ||
| 14 | <% fields_for draft do |d| %> | ||
| 15 | <p></p> | ||
| 16 | <p> | ||
| 17 | <%= d.label :title %><br /> | ||
| 18 | <%= d.text_field :title, :value => draft.title %> | ||
| 19 | </p> | ||
| 20 | <p> | ||
| 21 | <%= d.label :abstract %><br /> | ||
| 22 | <%= d.text_area :abstract, :value => draft.abstract %> | ||
| 23 | </p> | ||
| 24 | <p> | ||
| 25 | <%= d.label :body %><br /> | ||
| 26 | <%= d.text_area :body, :value => draft.body, :class => 'with_editor' %> | ||
| 27 | </p> | ||
| 28 | <% end %> | ||
| 29 | |||
| 30 | <p> | ||
| 31 | <%= f.submit "Update" %> | ||
| 32 | </p> | ||
| 33 | <% end %> | ||
| 34 | |||
| 35 | <%= link_to 'Show', @node %> | | ||
| 36 | <%= link_to 'Back', nodes_path %> | ||
| 37 | </div> \ No newline at end of file | ||
