diff options
Diffstat (limited to 'app/views/nodes/new.html.erb')
| -rw-r--r-- | app/views/nodes/new.html.erb | 75 |
1 files changed, 37 insertions, 38 deletions
diff --git a/app/views/nodes/new.html.erb b/app/views/nodes/new.html.erb index 028d727..b63a606 100644 --- a/app/views/nodes/new.html.erb +++ b/app/views/nodes/new.html.erb | |||
| @@ -6,48 +6,47 @@ | |||
| 6 | </div> | 6 | </div> |
| 7 | <% end %> | 7 | <% end %> |
| 8 | 8 | ||
| 9 | <p>What kind of node do you want to create?</p> | ||
| 10 | |||
| 11 | <%= form_tag nodes_path do %> | 9 | <%= form_tag nodes_path do %> |
| 12 | <table id="new_node"> | 10 | <div id="new_node"> |
| 13 | <tr> | 11 | |
| 14 | <td class="description">Type</td> | 12 | <div class="node_description">Type</div> |
| 15 | <td> | 13 | <div class="node_content"> |
| 16 | <div> | 14 | <% CccConventions::NODE_KINDS.each do |kind, config| %> |
| 17 | <%= radio_button_tag :kind, "top_level" %> | ||
| 18 | Top Level | ||
| 19 | </div> | ||
| 20 | <p> | ||
| 21 | <%= radio_button_tag :kind, "generic", :selected => true %> | ||
| 22 | Generic ( can be created anywhere ) | ||
| 23 | </p> | ||
| 24 | <p> | ||
| 25 | <%= radio_button_tag :kind, "update" %> | ||
| 26 | Update ( is automatically created in /updates/<%= Time.now.year.to_s %>/ and gets tag "update" ) | ||
| 27 | </p> | ||
| 28 | <p> | 15 | <p> |
| 29 | <%= radio_button_tag :kind, "press_release" %> | 16 | <%= radio_button_tag :kind, kind, kind == @selected_kind, |
| 30 | Pressemitteilung ( is automatically created in /updates/<%= Time.now.year.to_s %>/ and gets tags "update, pressemitteilung" ) | 17 | data: { path_prefix: resolve_kind_text(config[:path_prefix]) } %> |
| 18 | <%= resolve_kind_text(config[:label]) %> | ||
| 19 | <% if config[:hint] %> | ||
| 20 | <span class="field_hint"><%= resolve_kind_text(config[:hint]) %></span> | ||
| 21 | <% end %> | ||
| 31 | </p> | 22 | </p> |
| 32 | </td> | 23 | <% end %> |
| 33 | </tr> | 24 | </div> |
| 34 | <tr> | 25 | |
| 35 | <td class="description">Title</td> | 26 | <div class="node_description">Title</div> |
| 36 | <td><%= text_field_tag :title %></td> | 27 | <div class="node_content"> |
| 37 | </tr> | 28 | <%= text_field_tag :title, nil, required: true %> |
| 38 | <tr id="parent_search_field"> | 29 | <span class="field_hint">A URL slug will be generated from this automatically. You can review or adjust it afterward under the "metadata" section's Slug field.</span> |
| 39 | <td class="description">Parent</td> | 30 | </div> |
| 40 | <td> | 31 | |
| 32 | <div id="parent_search_field" style="<%= @selected_kind == "generic" ? "" : "display: none;" %>"> | ||
| 33 | <div class="node_description">Parent</div> | ||
| 34 | <div class="node_content"> | ||
| 41 | <%= text_field_tag :parent_search_term, @parent_name %> | 35 | <%= text_field_tag :parent_search_term, @parent_name %> |
| 42 | <%= hidden_field_tag :parent_id, @parent_id %> | 36 | <%= hidden_field_tag :parent_id, @parent_id %> |
| 43 | <div id="search_results"> | 37 | <div id="parent_search_results" class="search_results"></div> |
| 38 | </div> | ||
| 39 | </div> | ||
| 40 | |||
| 41 | <div class="node_description">Resulting path</div> | ||
| 42 | <div class="node_content"> | ||
| 43 | <span id="resulting_path">—</span> | ||
| 44 | <button type="button" id="copy_resulting_path" class="unselected">copy</button> | ||
| 45 | <span class="field_hint">This preview updates as you type. The final path can still be changed afterward by editing the title (for the last segment) or moving the node to a different parent (for everything before it).</span> | ||
| 46 | </div> | ||
| 47 | |||
| 48 | <div class="node_description"></div> | ||
| 49 | <div class="node_content"><%= submit_tag "Create" %></div> | ||
| 44 | 50 | ||
| 45 | </div> | 51 | </div> |
| 46 | </td> | ||
| 47 | </tr> | ||
| 48 | <tr> | ||
| 49 | <td></td> | ||
| 50 | <td class="right"><%= submit_tag "Create" %></td> | ||
| 51 | </tr> | ||
| 52 | </table> | ||
| 53 | <% end %> | 52 | <% end %> |
