Skip to content
Snippets Groups Projects
Commit be9825c3 authored by pabois's avatar pabois
Browse files

wip menus

parent bf62c15c
No related branches found
No related tags found
No related merge requests found
......@@ -44,7 +44,7 @@ class Communication::Website::Menu::Item < ApplicationRecord
foreign_key: :parent_id,
dependent: :destroy
enum kind: { url: 0, page: 1, blank: 2 }, _prefix: :kind
enum kind: { blank: 0, url: 10, page: 20 }, _prefix: :kind
validates :title, presence: true
......
......@@ -15,6 +15,7 @@
<% end %>
<%= link_to item, admin_communication_website_menu_item_path(website_id: item.website.id, menu_id: item.menu.id, id: item.id) %>
<span class="move_btn py-2 ps-2"><i class="fas fa-sort"></i></span>
<%= link_to t('edit'), edit_admin_communication_website_menu_item_path(website_id: item.website.id, menu_id: item.menu.id, id: item.id), class: "#{button_classes} float-end" %>
</div>
<ul class="list-unstyled treeview__children js-treeview-children js-treeview-sortable-container ms-4" data-id="<%= item.id %>">
<li class="treeview__empty">
......
......@@ -17,7 +17,7 @@
<td width="150"><%= Communication::Website::Menu::Item.human_attribute_name('url') %></td>
<td><%= link_to @item.url, @item.url, target: :blank unless @item.url.blank? %></td>
</tr>
<% else %>
<% elsif @item.kind_page? %>
<tr>
<td width="150"><%= Communication::Website::Menu::Item.human_attribute_name('about') %></td>
<td><%= link_to_if can?(:read, @item.about), @item.about, [:admin, @item.about] %></td>
......
<% content_for :title, @menu %>
<div class="row">
<div class="col-md-6">
<div class="col-md-8">
<div class="card flex-fill w-100">
<div class="card-header">
<h5 class="card-title mb-0"><%= t('metadata') %></h5>
<h2 class="card-title mb-2 h5">
<%= "#{Communication::Website::Menu::Item.model_name.human(count: 2)} (#{@items.size})" %>
</h2>
<%= render 'admin/communication/website/menu/items/list', items: @root_items if @items.any? %>
<%= link_to t('create'),
new_admin_communication_website_menu_item_path(website_id: @website, menu_id: @menu.id),
class: button_classes if can?(:create, Communication::Website::Menu::Item) %>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card flex-fill w-100">
<div class="card-header">
<h2 class="card-title mb-0 h5"><%= t('metadata') %></h2>
</div>
<table class="<%= table_classes %>">
<tbody>
......@@ -18,13 +31,6 @@
</div>
</div>
<h2><%= "#{Communication::Website::Menu::Item.model_name.human(count: 2)} (#{@items.size})" %></h2>
<%= link_to t('create'),
new_admin_communication_website_menu_item_path(website_id: @website, menu_id: @menu.id),
class: button_classes %>
<%= render 'admin/communication/website/menu/items/list', items: @root_items if @items.any? %>
<% content_for :action_bar_right do %>
<%= edit_link @menu %>
<% end %>
......@@ -107,7 +107,7 @@ en:
enums:
communication/website/menu/item:
kind:
blank: Blank
blank: Title
page: Page
url: URL
simple_form:
......
......@@ -107,7 +107,7 @@ fr:
enums:
communication/website/menu/item:
kind:
blank: Vide
blank: Titre intermédiaire
page: Page
url: URL
simple_form:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment