diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 2ba90b0..fea4cc4 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -6,7 +6,7 @@ class ApplicationController < ActionController::Base before_filter :login_from_cookie, :setup_plugin_nav, :set_layout_variables, :load_menu around_filter :inhibit_retardase - helper :all, :testimonials, :site_settings, :form_builder + helper :all, :site_settings theme :get_theme_setting diff --git a/config/routes.rb b/config/routes.rb index f099d58..36bbb8b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,22 +1,10 @@ ActionController::Routing::Routes.draw do |map| map.from_plugin :ansuz_photo_album - map.from_plugin :ansuz_blog - map.from_plugin :ansuz_savage_beast map.from_plugin :ansuz_content_section map.from_plugin :ansuz_user_manager - map.from_plugin :ansuz_menu_system map.from_plugin :ansuz_theme_repository map.from_plugin :ansuz_theme_installer - map.from_plugin :ansuz_scrollable_content - map.from_plugin :ansuz_testimonials - map.from_plugin :ansuz_form_builder - map.from_plugin :ansuz_feed_reader - map.from_plugin :ansuz_jskit - map.from_plugin :ansuz_twitterati - map.from_plugin :ansuz_database_dumper - map.from_plugin :ansuz_user_system - #map.from_plugin :ansuz_plugin_media_player - map.from_plugin :ansuz_mephisto_xmlrpc + map.from_plugin :ansuz_menu_system map.resources :tags map.resources :users diff --git a/vendor/plugins/ansuz_menu_system/README b/vendor/plugins/ansuz_menu_system/README new file mode 100644 index 0000000..43c08aa --- /dev/null +++ b/vendor/plugins/ansuz_menu_system/README @@ -0,0 +1,13 @@ +AnsuzContentSection +=================== + +Introduction goes here. + + +Example +======= + +Example goes here. + + +Copyright (c) 2008 [name of plugin creator], released under the MIT license diff --git a/vendor/plugins/ansuz_menu_system/Rakefile b/vendor/plugins/ansuz_menu_system/Rakefile new file mode 100644 index 0000000..5e0d3e4 --- /dev/null +++ b/vendor/plugins/ansuz_menu_system/Rakefile @@ -0,0 +1,22 @@ +require 'rake' +require 'rake/testtask' +require 'rake/rdoctask' + +desc 'Default: run unit tests.' +task :default => :test + +desc 'Test the ansuz_content_section plugin.' +Rake::TestTask.new(:test) do |t| + t.libs << 'lib' + t.pattern = 'test/**/*_test.rb' + t.verbose = true +end + +desc 'Generate documentation for the ansuz_content_section plugin.' +Rake::RDocTask.new(:rdoc) do |rdoc| + rdoc.rdoc_dir = 'rdoc' + rdoc.title = 'AnsuzContentSection' + rdoc.options << '--line-numbers' << '--inline-source' + rdoc.rdoc_files.include('README') + rdoc.rdoc_files.include('lib/**/*.rb') +end diff --git a/vendor/plugins/ansuz_menu_system/app/controllers/admin/menu_entries_controller.rb b/vendor/plugins/ansuz_menu_system/app/controllers/admin/menu_entries_controller.rb new file mode 100644 index 0000000..103d43e --- /dev/null +++ b/vendor/plugins/ansuz_menu_system/app/controllers/admin/menu_entries_controller.rb @@ -0,0 +1,56 @@ +class Admin::MenuEntriesController < Admin::BaseController + unloadable # This is required if you subclass a controller provided by the base rails app + + layout 'admin' + before_filter :load_menu_entry, :only => [:show, :edit, :update, :destroy] + before_filter :load_new_menu_entry, :only => [:new, :create] + before_filter :load_menu_entries, :only => [:index] + + protected + def load_menu_entry + @menu_entry = Ansuz::JAdams::MenuEntry.find(params[:id]) + end + + def load_new_menu_entry + @menu_entry = Ansuz::JAdams::MenuEntry.new(params[:menu_entry]) + end + + def load_menu_entries + @menu_entries = Ansuz::JAdams::MenuEntry.find(:all, :order => 'position') + end + public + def new + end + + def create + if @menu_entry.save + flash[:notice] = "Menu Entry was created successfully." + redirect_to admin_menu_entries_path + else + flash.now[:error] = "There was a problem creating the menu entry." + render :action => 'new' + end + end + + def show + end + + def edit + end + + def update + if @menu_entry.update_attributes(params[:menu_entry]) + flash[:notice] = "Menu Entry has been updated." + redirect_to admin_menu_entries_path + else + flash.now[:error] = "There was a problem updating the Menu Entry. Please try again." + render :action => 'edit' + end + end + + def destroy + @menu_entry.destroy + flash[:notice] = "Menu Entry was deleted." + redirect_to admin_menu_entries_path + end +end diff --git a/vendor/plugins/ansuz_menu_system/app/models/ansuz/j_adams/menu_entry.rb b/vendor/plugins/ansuz_menu_system/app/models/ansuz/j_adams/menu_entry.rb new file mode 100644 index 0000000..7f2a1c8 --- /dev/null +++ b/vendor/plugins/ansuz_menu_system/app/models/ansuz/j_adams/menu_entry.rb @@ -0,0 +1,14 @@ +module Ansuz + module JAdams + class MenuEntry < ActiveRecord::Base + acts_as_tree :order => 'position' + def self.root_entries + Ansuz::JAdams::MenuEntry.find(:all, :conditions => "parent_id IS NULL", :order => 'position') + end + + def to_s + name + end + end + end +end diff --git a/vendor/plugins/ansuz_menu_system/app/views/admin/menu_entries/_content_section.html.erb b/vendor/plugins/ansuz_menu_system/app/views/admin/menu_entries/_content_section.html.erb new file mode 100644 index 0000000..87d2c62 --- /dev/null +++ b/vendor/plugins/ansuz_menu_system/app/views/admin/menu_entries/_content_section.html.erb @@ -0,0 +1 @@ +<%= plugin_module.contents -%> diff --git a/vendor/plugins/ansuz_menu_system/app/views/admin/menu_entries/_edit.html.erb b/vendor/plugins/ansuz_menu_system/app/views/admin/menu_entries/_edit.html.erb new file mode 100644 index 0000000..8e893a6 --- /dev/null +++ b/vendor/plugins/ansuz_menu_system/app/views/admin/menu_entries/_edit.html.erb @@ -0,0 +1 @@ +This is the edit view diff --git a/vendor/plugins/ansuz_menu_system/app/views/admin/menu_entries/_form.html.erb b/vendor/plugins/ansuz_menu_system/app/views/admin/menu_entries/_form.html.erb new file mode 100644 index 0000000..7240d42 --- /dev/null +++ b/vendor/plugins/ansuz_menu_system/app/views/admin/menu_entries/_form.html.erb @@ -0,0 +1,7 @@ +
Name | +URL | ++ |
---|---|---|
<%= link_to h(menu_entry.name), edit_admin_menu_entry_path(menu_entry) -%> | +<%= menu_entry.link -%> | +
+
|
+