Permalink
Browse files

spud photos!

  • Loading branch information...
0 parents commit 814bd13f3177cfc3a6520a4fc50d1921b75bb4af @gregawoods committed Feb 18, 2012
Showing with 236 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +13 −0 Rakefile
  3. +32 −0 Readme.markdown
  4. +1 −0 VERSION
  5. +48 −0 config/application.rb
  6. +6 −0 config/boot.rb
  7. +56 −0 config/routes.rb
  8. +6 −0 lib/spud_photos.rb
  9. +13 −0 lib/spud_photos/configuration.rb
  10. +15 −0 lib/spud_photos/engine.rb
  11. +6 −0 script/rails
  12. +38 −0 spud_photos.gemspec
@@ -0,0 +1,2 @@
+.DS_Store
+pkg/
@@ -0,0 +1,13 @@
+begin
+ require "jeweler"
+ Jeweler::Tasks.new do |gem|
+ gem.name = "spud_photos"
+ gem.summary = "Spud Photo Album Engine"
+ gem.files = Dir["{lib}/**/*", "{app}/**/*", "{config}/**/*"]
+ gem.add_dependency 'spud_core', '>= 0.5.2'
+ gem.authors = 'Greg Woods'
+ gem.email = 'greg@westlakedesign.com'
+ end
+rescue
+ puts "Jeweler or one of its dependencies is not installed."
+end
@@ -0,0 +1,32 @@
+Spud Blog
+========
+
+Spud Photo Albums is an engine for creating and managing photo galleries, designed for use with [Spud][1].
+
+Installation/Usage
+------------------
+
+1. In your Gemfile add the following
+
+ gem 'spud_core', :git => "git://github.com/davydotcom/spud_core_admin.git"
+ gem 'spud_photos', :git => "git://github.com/gregawoods/spud_photos.git"
+
+2. Run bundle install
+3. Copy in database migrations to your new rails project
+
+ bundle exec rake spud_core:install:migrations
+ bundle exec rake spud_photos:install:migrations
+ rake db:migrate
+
+4. Run a rails server instance and point your browser to /spud/admin
+
+Configuration
+-------------
+
+Spud Blog current accepts the following configuration options.
+
+ Spud::Photos.configure do |config|
+ config.base_layout = 'photos'
+ end
+
+[1]:https://github.com/davydotcom/spud_core_admin
@@ -0,0 +1 @@
+0.0.1
@@ -0,0 +1,48 @@
+require File.expand_path('../boot', __FILE__)
+
+require 'rails/all'
+
+if defined?(Bundler)
+ # If you precompile assets before deploying to production, use this line
+ Bundler.require *Rails.groups(:assets => %w(development test))
+ # If you want your assets lazily compiled in production, use this line
+ # Bundler.require(:default, :assets, Rails.env)
+end
+
+module SpudTest
+ class Application < Rails::Application
+ # Settings in config/environments/* take precedence over those specified here.
+ # Application configuration should go into files in config/initializers
+ # -- all .rb files in that directory are automatically loaded.
+
+ # Custom directories with classes and modules you want to be autoloadable.
+ # config.autoload_paths += %W(#{config.root}/extras)
+
+ # Only load the plugins named here, in the order given (default is alphabetical).
+ # :all can be used as a placeholder for all plugins not explicitly named.
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
+
+ # Activate observers that should always be running.
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
+
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
+ # config.time_zone = 'Central Time (US & Canada)'
+
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
+ # config.i18n.default_locale = :de
+
+ # Configure the default encoding used in templates for Ruby 1.9.
+ config.encoding = "utf-8"
+
+ # Configure sensitive parameters which will be filtered from the log file.
+ config.filter_parameters += [:password]
+
+ # Enable the asset pipeline
+ config.assets.enabled = true
+
+ # Version of your assets, change this if you want to expire all your assets
+ config.assets.version = '1.0'
+ end
+end
@@ -0,0 +1,6 @@
+require 'rubygems'
+
+# Set up gems listed in the Gemfile.
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+
+require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -0,0 +1,56 @@
+Rails.application.routes.draw do
+
+ namespace :spud do
+ namespace :admin do
+ resources :posts do
+ resources :post_comments, :path => 'comments', :only => :index
+ end
+ resources :news_posts
+ resources :post_comments, :except => :new
+ resources :post_categories
+ end
+ end
+
+ if Spud::Blog.config.blog_enabled
+ scope Spud::Blog.config.blog_path do
+
+ # Blog Post Categories
+ get 'category/:category_url_name', :controller => 'blog', :action => 'category', :page => 1, :as => 'blog_category'
+ get 'category/:category_url_name/page/:page', :controller => 'blog', :action => 'category'
+ post 'category', :controller => 'blog', :action => 'category'
+
+ # Blog Post Archives
+ get 'archive/:archive_date', :controller => 'blog', :action => 'archive', :page => 1, :as => 'blog_archive'
+ get 'archive/:archive_date/page/:page', :controller => 'blog', :action => 'archive'
+ post 'archive', :controller => 'blog', :action => 'archive'
+
+ # Blog Posts
+ get '/', :controller => 'blog', :action => 'index', :page => 1, :as => 'blog'
+ get 'page/:page', :controller => 'blog', :action => 'index'
+ resources :blog_posts, :path => '/', :controller => 'blog', :only => [:show] do
+ post '/', :on => :member, :controller => 'blog', :action => 'create_comment'
+ end
+ end
+ end
+
+ if Spud::Blog.config.news_enabled
+ scope Spud::Blog.config.news_path do
+
+ # News Post Categories
+ get 'category/:category_url_name', :controller => 'news', :action => 'category', :page => 1, :as => 'news_category'
+ get 'category/:category_url_name/page/:page', :controller => 'news', :action => 'category'
+ post 'category', :controller => 'news', :action => 'category'
+
+ # News Post Archives
+ get 'archive/:archive_date', :controller => 'news', :action => 'archive', :page => 1, :as => 'news_archive'
+ get 'archive/:archive_date/page/:page', :controller => 'news', :action => 'archive'
+ post 'archive', :controller => 'news', :action => 'archive'
+
+ # News Posts
+ get '/', :controller => 'news', :action => 'index', :page => 1, :as => 'news'
+ get 'page/:page', :controller => 'news', :action => 'index'
+ resources :news_posts, :path => '/', :controller => 'news', :only => [:show]
+ end
+ end
+
+end
@@ -0,0 +1,6 @@
+module Spud
+ module Blog
+ require 'spud_photos/configuration'
+ require 'spud_photos/engine' if defined?(Rails)
+ end
+end
@@ -0,0 +1,13 @@
+module Spud
+ module Blog
+ include ActiveSupport::Configurable
+ config_accessor :base_layout, :news_layout, :blog_enabled, :news_enabled, :posts_per_page, :blog_path, :news_path
+ self.base_layout = 'application'
+ self.news_layout = nil
+ self.news_enabled = false
+ self.blog_enabled = true
+ self.posts_per_page = 5
+ self.blog_path = 'blog'
+ self.news_path = 'news'
+ end
+end
@@ -0,0 +1,15 @@
+require 'spud_core'
+module Spud
+ module Photos
+ class Engine < Rails::Engine
+ engine_name :spud_photos
+ initializer :admin do
+ Spud::Core.config.admin_applications += [{
+ :name => 'Photo Albums',
+ :thumbnail => 'spud/admin/photos_thumb.png',
+ :url => '/spud/admin/photo_album'
+ }]
+ end
+ end
+ end
+end
@@ -0,0 +1,6 @@
+#!/usr/bin/env ruby
+# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
+
+APP_PATH = File.expand_path('../../config/application', __FILE__)
+require File.expand_path('../../config/boot', __FILE__)
+require 'rails/commands'
@@ -0,0 +1,38 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = "spud_photos"
+ s.version = "0.0.1"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Greg Woods"]
+ s.date = "2012-02-18"
+ s.email = "greg@westlakedesign.com"
+ s.files = [
+ "config/application.rb",
+ "config/boot.rb",
+ "config/routes.rb",
+ "lib/spud_photos.rb",
+ "lib/spud_photos/configuration.rb",
+ "lib/spud_photos/engine.rb"
+ ]
+ s.require_paths = ["lib"]
+ s.rubygems_version = "1.8.10"
+ s.summary = "Spud Photo Album Engine"
+
+ if s.respond_to? :specification_version then
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+ s.add_runtime_dependency(%q<spud_core>, [">= 0.5.2"])
+ else
+ s.add_dependency(%q<spud_core>, [">= 0.5.2"])
+ end
+ else
+ s.add_dependency(%q<spud_core>, [">= 0.5.2"])
+ end
+end
+

0 comments on commit 814bd13

Please sign in to comment.