summaryrefslogtreecommitdiff
path: root/app/views/nodes/new.html.erb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-06 16:49:45 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-06 16:49:45 +0200
commit36b5324900968afc7498950c14ad13be5c061a7c (patch)
treea717b115e308a940cc69d2b979ab03f90e5aeb80 /app/views/nodes/new.html.erb
parent889e15eabbe107d2642fdd8aa3f03821058c00dc (diff)
Restructure nodes#show and nodes#new around node_description/node_content
nodes#show's flat <table> of label/value pairs grew unreadable once Admin Preview and Public Preview were added alongside Public Link - switched to the div.node_description/div.node_content pattern already used by nodes#edit, grouped into People/Dates/Links/Revisions/Tags/ Events/Children sections rather than one undifferentiated list. People/Dates/Links use a flex-based item layout, not a second <table> - multiple independent tables sharing one outer width but different column counts produced misaligned columns with no shared grid. Flex items size to their own content with a shared minimum instead. Revisions and Children are both collapsed via <details>, no JS needed - previously nodes#show didn't list a node's children at all, blocking the ability to find/navigate erfa and chaostreff pages without already knowing they're now standalone nodes. Revision list items link to node_revision_path(@node, page) - the actual per-revision diff/restore view, not the plain index. nodes#new converted to the same pattern for visual consistency, plus a few things surfaced along the way: submit buttons were unstyled site-wide (a bare input[type=submit] with no border, fill, or hover state - Create on this exact page was easy to miss entirely), fixed with a bordered/bold treatment reusing the existing form.button_to visual language rather than introducing a fourth button style. Title regained the bold weight it had before the table rewrite dropped it silently. Tag list grouping and full link/button semantic taxonomy (show vs edit/add vs publish/revoke vs destroy, applied consistently across every link on the page, not just buttons) are known follow-ups, not attempted here.
Diffstat (limited to 'app/views/nodes/new.html.erb')
-rw-r--r--app/views/nodes/new.html.erb55
1 files changed, 25 insertions, 30 deletions
diff --git a/app/views/nodes/new.html.erb b/app/views/nodes/new.html.erb
index f5574547..0a053250 100644
--- a/app/views/nodes/new.html.erb
+++ b/app/views/nodes/new.html.erb
@@ -6,13 +6,11 @@
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 <% CccConventions::NODE_KINDS.each do |kind, config| %> 14 <% CccConventions::NODE_KINDS.each do |kind, config| %>
17 <p> 15 <p>
18 <%= radio_button_tag :kind, kind, kind == "generic", 16 <%= radio_button_tag :kind, kind, kind == "generic",
@@ -23,35 +21,32 @@
23 <% end %> 21 <% end %>
24 </p> 22 </p>
25 <% end %> 23 <% end %>
26 </td> 24 </div>
27 </tr> 25
28 <tr> 26 <div class="node_description">Title</div>
29 <td class="description">Title</td> 27 <div class="node_content">
30 <td><%= text_field_tag :title %> 28 <%= text_field_tag :title %>
31 <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> 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>
32 </td> 30 </div>
33 </tr> 31
34 <tr id="parent_search_field"> 32 <div id="parent_search_field">
35 <td class="description">Parent</td> 33 <div class="node_description">Parent</div>
36 <td> 34 <div class="node_content">
37 <%= text_field_tag :parent_search_term, @parent_name %> 35 <%= text_field_tag :parent_search_term, @parent_name %>
38 <%= hidden_field_tag :parent_id, @parent_id %> 36 <%= hidden_field_tag :parent_id, @parent_id %>
39 <div id="search_results"> 37 <div id="search_results"></div>
38 </div>
39 </div>
40 40
41 </div> 41 <div class="node_description">Resulting path</div>
42 </td> 42 <div class="node_content">
43 </tr>
44 <tr>
45 <td class="description">Resulting path</td>
46 <td>
47 <span id="resulting_path">—</span> 43 <span id="resulting_path">—</span>
48 <button type="button" id="copy_resulting_path" class="unselected">copy</button> 44 <button type="button" id="copy_resulting_path" class="unselected">copy</button>
49 <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> 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>
50 </td> 46 </div>
51 </tr> 47
52 <tr> 48 <div class="node_description"></div>
53 <td></td> 49 <div class="node_content right"><%= submit_tag "Create" %></div>
54 <td class="right"><%= submit_tag "Create" %></td> 50
55 </tr> 51</div>
56</table>
57<% end %> 52<% end %>