summaryrefslogtreecommitdiff
path: root/app/views/nodes/edit.html.erb
blob: 8e27d0fd94282a31f0202376105729f0d0ec0d8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<% content_for :subnavigation do %>
  <%= link_to 'metadata', '#', :id => 'button', :class => "unselected" %>
  <%= link_to 'Show', @node %>
  <%= link_to 'Preview', preview_page_path(@draft) %>
  <%= link_to 'Publish', publish_node_path, :method => :put, :confirm => "Publish this draft?" %>
  <%= link_to 'Revisions', node_revisions_path(@node) %>  
<% end %>

<div id="page_editor">
<% form_for(@node) do |f| %>
  <%= f.error_messages %>
  
  <div id="metadata">
    <table>
      <tr>
        <td class="description">Event</td>
        <td><%= event_information %></td>
      </tr>
      <tr>
        <td class="description">Slug</td>
        <td>
          <%= 
            f.text_field(
              :staged_slug, :value => @node.staged_slug || @node.slug
            ) 
          %>
        </td>
      </tr>
      <tr>
        <td class="description">parent</td>
        <td>
          <%= text_field_tag :move_to_search_term, @node.parent.title rescue "" %>
          <div id="search_results">

          </div>
          <%= f.hidden_field(
                :staged_parent_id, 
                :value => @node.staged_parent_id || @node.parent_id
              )
           %>
        </td>
      </tr>
      
      <% fields_for @draft do |d| %>
      <tr>
        <td class="description">Tags - comma seperated</td>
        <td><%= text_field_tag :tag_list, @draft.tag_list %></td>
      </tr>
      <tr>
        <td class="description">Publish at</td>
        <td><%= d.datetime_select :published_at, :value => @draft.published_at %></td>
      </tr>
      <tr>
        <td class="description">Template</td>
        <td><%= d.select :template_name, custom_page_templates, {:prompt => 'Select Template'} %></td>
      </tr>
      <tr>
        <td class="description">Author</td>
        <td><%= d.select :user_id, user_list %></td>
      </tr>
      <tr>
        <td class="description">Images</td>
        <td> 
          <ul id="image_box" rel="<%= @draft.id %>">
            <% @draft.assets.images.each do |image| %>
              <li rel="images_<%= image.id %>">
                <%= image_tag(image.upload.url(:thumb)) %>
              </li>
            <% end %>
          </ul>
          <div class="clear_left right">
            <a id="image_browser_toggle" class="unselected" href="#">image browser</a>
          </div>
          <div id="image_browser">
            <ul>
              <% Asset.images.each do |image| %>
              <li rel="images_<%= image.id %>"><%= image_tag(image.upload.url(:thumb)) %></li>
              <% end %>
            </ul>
          </div>
        </td>
      </tr>
    </table>
  </div>
  
  <table id="content">
    <tr>
      <th class="description"></th>
      <th class="content"></th>
    </tr>
    <tr>
      <td class="description">Title</td>
      <td><%= d.text_field :title %></td>
    </tr>
    <tr>
      <td class="description">Abstract</td>
      <td><%= d.text_area :abstract %></td>
    </tr>
    <tr>
      <td class="description">Body</td>
      <td><%= d.text_area :body, :class => 'with_editor' %></td>
    </tr>
    <tr>
      <td></td>
      <td class="right"><%= d.submit 'save' %></td>
    </tr>
  </table>
  <% end %>
<% end %>
</div>