diff --git a/app/controllers/admin/snippets_controller.rb b/app/controllers/admin/snippets_controller.rb index 6baebe8a..4e94206f 100644 --- a/app/controllers/admin/snippets_controller.rb +++ b/app/controllers/admin/snippets_controller.rb @@ -26,6 +26,19 @@ class Admin::SnippetsController < ApplicationController def new @snippet = Snippet.new + if params[:menu] + @snippet.name = "#{params[:menu]}_nav" + lis = Page.find(:all, :conditions => { :parent_page_id => params[:menu], :is_published => true }, :order => "position" ).map do |page| + if page.external_link.blank? + "
<%= f.label :is_published, "Is Published" %> -<%= f.radio_button :is_published, true %>Yes <%= f.radio_button :is_published, false %> No +<%= f.radio_button :is_published, 1 %>Yes <%= f.radio_button :is_published, 0 %> No
diff --git a/app/views/admin/pages/index.html.erb b/app/views/admin/pages/index.html.erb
index fb13788b..ba38eaf0 100644
--- a/app/views/admin/pages/index.html.erb
+++ b/app/views/admin/pages/index.html.erb
@@ -35,4 +35,5 @@
-<%= link_to 'New pages', new_admin_page_path, :class => 'button positive' %>
\ No newline at end of file
+<%= link_to 'New pages', new_admin_page_path, :class => 'button positive' %>
+<%= link_to 'New root menu snippets', new_admin_snippet_path( :menu => 'root' ), :class => 'button positive' %>
\ No newline at end of file
diff --git a/app/views/admin/snippets/index.html.erb b/app/views/admin/snippets/index.html.erb
index 354f0f9a..40eba30b 100644
--- a/app/views/admin/snippets/index.html.erb
+++ b/app/views/admin/snippets/index.html.erb
@@ -15,5 +15,4 @@
-<%= link_to 'New snippets', new_admin_snippet_path, :class => 'button positive' %>
-<%= link_to 'New menu snippets', new_admin_snippet_path, :class => 'button positive' %>
\ No newline at end of file
+<%= link_to 'New snippets', new_admin_snippet_path, :class => 'button positive' %>
\ No newline at end of file