Skip to content
This repository has been archived by the owner on Aug 15, 2018. It is now read-only.

Commit

Permalink
took out some whitelist stuff in savage beast, as it was screwing up …
Browse files Browse the repository at this point in the history
…the console
  • Loading branch information
Josh Adams committed Oct 24, 2008
1 parent 6e58d41 commit 32333b1
Show file tree
Hide file tree
Showing 39 changed files with 183 additions and 602 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -21,3 +21,4 @@ public/photo_album_photo_images/
public/photo_album_photo_images/*
public/uploads/*/*
themes/*
config/deploy.rb
File renamed without changes.
2 changes: 1 addition & 1 deletion config/environment.rb
Expand Up @@ -40,7 +40,7 @@
# Only load the plugins named here, in the order given. By default, all plugins
# in vendor/plugins are loaded in alphabetical order.
# :all can be used as a placeholder for all plugins not explicitly named
config.plugins = [ :version_fu, :all ]
config.plugins = [ :all ]

# Add additional load paths for your own custom dirs
# config.load_paths += %W( #{RAILS_ROOT}/extras )
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Expand Up @@ -8,6 +8,7 @@
map.from_plugin :ansuz_theme_repository
map.from_plugin :ansuz_theme_installer
map.from_plugin :ansuz_scrollable_content
map.from_plugin :ansuz_testimonials

map.resources :users
map.resources :tags
Expand Down
1 change: 1 addition & 0 deletions vendor/plugins/ansuz_blog/app/models/blog_post.rb
Expand Up @@ -2,6 +2,7 @@ class Ansuz
class JAdams
class BlogPost < ActiveRecord::Base
acts_as_taggable
belongs_to :author, :class => "User", :foreign_key => 'created_by'
has_many :blog_comments, :class_name => "Ansuz::JAdams::BlogComment", :order => "created_at DESC"

def edit_path
Expand Down
4 changes: 4 additions & 0 deletions vendor/plugins/ansuz_testimonials/README
@@ -0,0 +1,4 @@
AnsuzTestimonials
===================

This plugin provides the ability to keep a database of testimonials, and display them in a theme as well as provide a resource for them
22 changes: 22 additions & 0 deletions vendor/plugins/ansuz_testimonials/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
@@ -0,0 +1,56 @@
class Admin::TestimonialsController < Admin::BaseController
unloadable # This is required if you subclass a controller provided by the base rails app

layout 'admin'
before_filter :load_testimonial, :only => [:show, :edit, :update]
before_filter :load_new_testimonial, :only => [:new, :create]
before_filter :load_testimonials, :only => [:index]

protected
def load_testimonial
@testimonial = Ansuz::JAdams::Testimonial.find(params[:id])
end

def load_new_testimonial
@testimonial = Ansuz::JAdams::Testimonial.new(params[:testimonial])
end

def load_testimonials
@testimonials = Ansuz::JAdams::Testimonial.find(:all)
end
public
def new
end

def create
if @testimonial.save
flash[:notice] = "Testimonial was created successfully."
redirect_to admin_testimonials_path
else
flash.now[:error] = "There was a problem creating the testimonial."
render :action => 'new'
end
end

def show
end

def edit
end

def update
if @testimonial.update_attributes(params[:testimonial])
flash[:notice] = "Testimonial has been updated."
redirect_to admin_testimonials_path
else
flash.now[:error] = "There was a problem updating the Testimonial. Please try again."
render :action => 'edit'
end
end

def destroy
@testimonial.destroy
flash[:notice] = "Testimonial was deleted."
redirect_to admin_testimonials_path
end
end
@@ -0,0 +1,18 @@
class TestimonialsController < ApplicationController
unloadable # This is required if you subclass a controller provided by the base rails app

before_filter :load_testimonials, :only => [:index]

protected
def load_testimonials
@testimonials = Ansuz::JAdams::Testimonial.find(:all)
end

public

def index
respond_to do |format|
format.html{ render }
end
end
end
6 changes: 6 additions & 0 deletions vendor/plugins/ansuz_testimonials/app/models/testimonial.rb
@@ -0,0 +1,6 @@
class Ansuz
class JAdams
class Testimonial < ActiveRecord::Base
end
end
end
@@ -0,0 +1,2 @@
Content: <%= f.text_area(:content) -%><br />
Attributed To: <%= f.text_field(:attributed_to) -%><br />
@@ -0,0 +1,8 @@
<%= title "Edit Ansuz Theme: #{@ansuz_theme}" -%>
<% content_for :sidebar do -%>
<%= link_to "All Ansuz Themes", admin_ansuz_themes_path -%>
<% end -%>
<% form_for :ansuz_theme, :url => admin_ansuz_theme_path(@ansuz_theme), :html => { :method => :put } do |f| -%>
<%= render :partial => 'form', :locals => { :f => f } -%>
<%= submit_tag("Update Ansuz Theme") -%> or <%= link_to "Cancel", admin_ansuz_themes_path -%>
<% end -%>
@@ -0,0 +1,27 @@
<%= title "Testimonials" -%>
<% content_for :sidebar do -%>
<%= link_to "New Testimonial", new_admin_testimonial_path -%><br />
<% end -%>
<table class='subdued'>
<thead>
<tr>
<th>Content</th>
<th>Attributed To</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<% @testimonials.each do |testimonial| -%>
<tr class='<%= cycle('odd', 'even') -%>'>
<td><%= testimonial.content -%></td>
<td><%= link_to testimonial.attributed_to, edit_admin_testimonial_path(testimonial) -%></td>
<td>
<ul class='admin_actions'>
<li><%= link_to "Edit", edit_admin_testimonial_path(testimonial) -%></li>
<li><%= link_to "Delete", admin_testimonial_path(testimonial), :method => :delete, :confirm => "Are you sure you want to delete this testimonial?" -%></li>
</ul>
</td>
</tr>
<% end -%>
</tbody>
</table>
@@ -0,0 +1,8 @@
<%= title "New Testimonial" -%>
<% content_for :sidebar do -%>
<%= link_to "All Testimonials", admin_testimonials_path -%>
<% end -%>
<% form_for :testimonial, :url => admin_testimonials_path do |f| -%>
<%= render :partial => 'form', :locals => { :f => f } -%>
<%= submit_tag("Create Testimonial") -%> or <%= link_to "Cancel", admin_testimonials_path -%>
<% end -%>
@@ -0,0 +1,4 @@
<div class='testimonial'>
<div class='content'><%=h testimonial.content -%></div>
<div class='attributed_to'><%= testimonial.attributed_to -%></div>
</div>
@@ -0,0 +1,2 @@
<h2>Testimonials</h2>
<%= render :partial => 'testimonials/testimonial', :collection => @testimonials -%>
@@ -0,0 +1,13 @@
class CreateTestimonials < ActiveRecord::Migration
def self.up
create_table "testimonials", :force => true do |t|
t.text "content"
t.string "attributed_to"
t.timestamps
end
end

def self.end
drop_table "testimonials"
end
end
3 changes: 3 additions & 0 deletions vendor/plugins/ansuz_testimonials/init.rb
@@ -0,0 +1,3 @@
# Include hook code here
require 'testimonial'
Ansuz::PluginManagerInstance.register_admin_plugin_nav('Testimonials', '/admin/testimonials')
4 changes: 4 additions & 0 deletions vendor/plugins/ansuz_testimonials/routes.rb
@@ -0,0 +1,4 @@
namespace :admin do |admin|
admin.resources :testimonials
end
resources :testimonials
10 changes: 0 additions & 10 deletions vendor/plugins/ansuz_theme_installer/app/models/menu_entry.rb

This file was deleted.

10 changes: 0 additions & 10 deletions vendor/plugins/ansuz_theme_repository/app/models/menu_entry.rb

This file was deleted.

2 changes: 1 addition & 1 deletion vendor/plugins/savage_beast/app/models/forum.rb
Expand Up @@ -17,7 +17,7 @@ class Forum < ActiveRecord::Base
has_many :posts, :order => "#{Post.table_name}.created_at DESC", :dependent => :delete_all
has_one :recent_post, :order => "#{Post.table_name}.created_at DESC", :class_name => 'Post'

format_attribute :description
#format_attribute :description

# retrieves forums ordered by position
def self.find_ordered(options = {})
Expand Down
2 changes: 1 addition & 1 deletion vendor/plugins/savage_beast/app/models/post.rb
Expand Up @@ -5,7 +5,7 @@ def self.per_page() 25 end
belongs_to :user
belongs_to :topic

format_attribute :body
#format_attribute :body
before_create { |r| r.forum_id = r.topic.forum_id }
after_create :update_cached_fields
after_destroy :update_cached_fields
Expand Down
2 changes: 0 additions & 2 deletions vendor/plugins/version_fu/.gitignore

This file was deleted.

24 changes: 0 additions & 24 deletions vendor/plugins/version_fu/MIT-LICENSE

This file was deleted.

0 comments on commit 32333b1

Please sign in to comment.