summaryrefslogtreecommitdiff
path: root/app/views/nodes/new.html.erb
blob: 028d72701d513b7a570c15391b4ff297d0fb5215 (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
<h1>Create new node</h1>

<% if @node.errors.any? %>
  <div class="error_messages">
    <ul><% @node.errors.full_messages.each do |msg| %><li><%= msg.to_s.gsub("Slug", "Title") %></li><% end %></ul>
  </div>
<% end %>

<p>What kind of node do you want to create?</p>

<%= form_tag nodes_path do %>
<table id="new_node">
  <tr>
    <td class="description">Type</td>
    <td>
      <div>
        <%= radio_button_tag :kind, "top_level" %>
        Top Level
      </div>
      <p>
        <%= radio_button_tag :kind, "generic", :selected => true %>
        Generic ( can be created anywhere )
      </p>
      <p>
        <%= radio_button_tag :kind, "update" %>
        Update ( is automatically created in /updates/<%= Time.now.year.to_s %>/ and gets tag "update" )
      </p>
      <p>
        <%= radio_button_tag :kind, "press_release" %>
        Pressemitteilung ( is automatically created in /updates/<%= Time.now.year.to_s %>/ and gets tags "update, pressemitteilung" )
      </p>
    </td>
  </tr>
  <tr>
    <td class="description">Title</td>
    <td><%= text_field_tag :title %></td>
  </tr>
  <tr id="parent_search_field">
    <td class="description">Parent</td>
    <td>
      <%= text_field_tag :parent_search_term, @parent_name %>
      <%= hidden_field_tag :parent_id, @parent_id %>
      <div id="search_results">

      </div>
    </td>
  </tr>
  <tr>
    <td></td>
    <td class="right"><%= submit_tag "Create" %></td>
  </tr>
</table>
<% end %>