Sha256: 7d70456cead5a2006eaab674339f78659ee1289bfdb4f524d86d4d69928b3735

Contents?: true

Size: 1.08 KB

Versions: 5

Compression:

Stored size: 1.08 KB

Contents

<h2><%%= t(:treeview, :default => 'Treeview') %> <%%= <%= i18n_t_m(singular_table_name) %> %></h2>

<% engine_or_empty = (engine_camel.present? ? "#{engine_camel}::" : '') %>

<%%
engine_name       = "<%= engine_name %>"
namespace_for_url = "<%= namespace_for_url %>"
plural_model_name = "<%= model_pluralize %>"
model_name        = "<%= singular_table_name %>"
opened_node       = <%= engine_or_empty %><%= model_camelize %>.select(:id).all.map{ |g| "'treeelt_" + g.id.to_s + "'" }.join(',').html_safe
%>

<div id="treeview" data-model="<%%= model_name %>" data-url="/<%%= engine_name %><%%= namespace_for_url %><%%= plural_model_name %>/" data-opened="[<%%= opened_node %>]">
  <ul>
    <%% <%= engine_or_empty %><%= model_camelize %>.transaction do %>
    <%% ar = <%= engine_or_empty %><%= model_camelize %>.where(:<%= model %>_id => nil) %>
    <%% ar = ar.order("position") if <%= engine_or_empty %><%= model_camelize %>.column_names.include?("position") %>
      <%% for g in ar.all %>
        <%%= build_treeview(g, '<%= model_pluralize %>') %>
      <%% end %>
    <%% end %>
  </ul>
</div>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
beautiful_scaffold-2.0.3 lib/generators/templates/app/views/treeview.html.erb
beautiful_scaffold-2.0.2 lib/generators/templates/app/views/treeview.html.erb
beautiful_scaffold-2.0.1 lib/generators/templates/app/views/treeview.html.erb
beautiful_scaffold-2.0.0 lib/generators/templates/app/views/treeview.html.erb
beautiful_scaffold-2.0.0.pre lib/generators/templates/app/views/treeview.html.erb