-
Notifications
You must be signed in to change notification settings - Fork 1
/
show.html.erb
40 lines (33 loc) · 1.66 KB
/
show.html.erb
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
<h1>Menu: <%= @menu.name %></h1>
<div class="card">
<div class="card-body" data-controller='menuitem'>
Add Item
<%
@menuitem = @menu.menuitems.new unless @menuitem
%>
<%= simple_form_for([:admin, @menu, @menuitem]) do |f| %>
<%= f.error_notification %>
<%= f.error_notification message: f.object.errors[:base].to_sentence if f.object.errors[:base].present? %>
<div class="form-inputs">
<%= f.input :link,
hint: 'Search against title or slug fields for linkable models like page:about or article:getting started',
input_html: {'autocomplete': "off", 'data-menuitem-target': 'q', 'data-action': 'input->menuitem#search'} %>
<div class="results menuitem-results" data-menuitem-target="results"></div>
<div class='menuitem-record' data-menuitem-target="record"></div>
<%= f.input :name, input_html: {'data-menuitem-target': 'name'}, hint: 'Name is required unless a linkable record is chosen. You can override the records name if you want.' %>
<%= f.input :menuitemable_type, as: :hidden, input_html: {'data-menuitem-target': 'menuitemableType'} %>
<%= f.input :menuitemable_id, as: :hidden, input_html: {'data-menuitem-target': 'menuitemableId'} %>
</div>
<div class="form-actions text-right">
<%= f.button :submit, class: 'btn btn-primary' %>
</div>
<% end %>
</div>
</div>
<div class="card ">
<div class="card-body nested"
data-controller="dragger"
data-dragger-url="/admin/menus/<%= @menu.id %>/menuitems/:id/move">
<%= nested_items(@menu.menuitems.arrange(:order => :position)) %>
</div>
</div>