Skip to content

Commit

Permalink
Merge branch 'master' of github.com:almartin/120SpringTrunk
Browse files Browse the repository at this point in the history
  • Loading branch information
almartin committed May 7, 2011
2 parents 71b1ab0 + a5b6189 commit f53dec2
Show file tree
Hide file tree
Showing 88 changed files with 6,635 additions and 227 deletions.
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
.bundle
db/*.sqlite3
log/*.log
tmp/**/*
log/*
tmp/*
.DS_Store
*~
*~
tmp/**/*
config/*.yml
nbproject/*
nbproject/**/*
19 changes: 9 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
source 'http://rubygems.org'

group :development do
gem 'sqlite3'
end

group :production do
gem 'mysql2'
end

gem 'rails', '3.0.4'
gem 'aws-s3'
gem 'rails', '3.0.7'
gem 'formtastic'
gem 'will_paginate', '~> 3.0.pre2'
gem 'devise'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'jquery-rails'
gem 'aws-s3'
gem 'xml-simple'
gem 'meta_where'
88 changes: 57 additions & 31 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,80 +2,106 @@ GEM
remote: http://rubygems.org/
specs:
abstract (1.0.0)
actionmailer (3.0.4)
actionpack (= 3.0.4)
actionmailer (3.0.7)
actionpack (= 3.0.7)
mail (~> 2.2.15)
actionpack (3.0.4)
activemodel (= 3.0.4)
activesupport (= 3.0.4)
actionpack (3.0.7)
activemodel (= 3.0.7)
activesupport (= 3.0.7)
builder (~> 2.1.2)
erubis (~> 2.6.6)
i18n (~> 0.4)
i18n (~> 0.5.0)
rack (~> 1.2.1)
rack-mount (~> 0.6.13)
rack-mount (~> 0.6.14)
rack-test (~> 0.5.7)
tzinfo (~> 0.3.23)
activemodel (3.0.4)
activesupport (= 3.0.4)
activemodel (3.0.7)
activesupport (= 3.0.7)
builder (~> 2.1.2)
i18n (~> 0.4)
activerecord (3.0.4)
activemodel (= 3.0.4)
activesupport (= 3.0.4)
i18n (~> 0.5.0)
activerecord (3.0.7)
activemodel (= 3.0.7)
activesupport (= 3.0.7)
arel (~> 2.0.2)
tzinfo (~> 0.3.23)
activeresource (3.0.4)
activemodel (= 3.0.4)
activesupport (= 3.0.4)
activesupport (3.0.4)
activeresource (3.0.7)
activemodel (= 3.0.7)
activesupport (= 3.0.7)
activesupport (3.0.7)
arel (2.0.9)
aws-s3 (0.6.2)
builder
mime-types
xml-simple
bcrypt-ruby (2.1.4)
builder (2.1.2)
devise (1.3.4)
bcrypt-ruby (~> 2.1.2)
orm_adapter (~> 0.0.3)
warden (~> 1.0.3)
erubis (2.6.6)
abstract (>= 1.0.0)
formtastic (1.2.3)
actionpack (>= 2.3.7)
activesupport (>= 2.3.7)
i18n (~> 0.4)
i18n (0.5.0)
jquery-rails (1.0)
rails (~> 3.0)
thor (~> 0.14)
mail (2.2.19)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
meta_where (1.0.4)
activerecord (~> 3.0.0)
activesupport (~> 3.0.0)
arel (~> 2.0.7)
mime-types (1.16)
mysql2 (0.3.2)
orm_adapter (0.0.4)
polyglot (0.3.1)
rack (1.2.2)
rack-mount (0.6.14)
rack (>= 1.0.0)
rack-test (0.5.7)
rack (>= 1.0)
rails (3.0.4)
actionmailer (= 3.0.4)
actionpack (= 3.0.4)
activerecord (= 3.0.4)
activeresource (= 3.0.4)
activesupport (= 3.0.4)
rails (3.0.7)
actionmailer (= 3.0.7)
actionpack (= 3.0.7)
activerecord (= 3.0.7)
activeresource (= 3.0.7)
activesupport (= 3.0.7)
bundler (~> 1.0)
railties (= 3.0.4)
railties (3.0.4)
actionpack (= 3.0.4)
activesupport (= 3.0.4)
railties (= 3.0.7)
railties (3.0.7)
actionpack (= 3.0.7)
activesupport (= 3.0.7)
rake (>= 0.8.7)
thor (~> 0.14.4)
rake (0.8.7)
sqlite3 (1.3.3)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
thor (0.14.6)
treetop (1.4.9)
polyglot (>= 0.3.1)
tzinfo (0.3.27)
warden (1.0.4)
rack (>= 1.0)
will_paginate (3.0.pre2)
xml-simple (1.0.15)

PLATFORMS
ruby

DEPENDENCIES
aws-s3
mysql2
rails (= 3.0.4)
sqlite3
devise
formtastic
jquery-rails
meta_where
rails (= 3.0.7)
sqlite3-ruby
will_paginate (~> 3.0.pre2)
xml-simple
6 changes: 6 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.bundle
log/*
log/**/*
db/*.sqlite3
log/*.log
tmp/**/*
33 changes: 33 additions & 0 deletions app/controllers/admin_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
class AdminController < CmsapplicationController
def index
end

def manage
@user=current_user
@usern=User.new
end

def create
user=User.new(params[:user])
if user.save
str="User " + user.email + " added"
redirect_to(manage_path, :notice=>str)
else
redirect_to(manage_path, :notice=>"Adding user failed.")
end

end

def changepass
user=params[:user]
@current=User.find(current_user.id)
change={:password=>user["password"],:password_confirmation=>user["password_confirmation"]}
if(change[:password]!=change[:password_confirmation])
redirect_to(manage_path, :notice=>'Passwords do not match')
elsif @current.update_attributes(:password=>user['password'],:password_confirmation=>user['password_confirmation'])
redirect_to(new_user_session_path, :notice=>'Password successfully changed')
else
redirect_to(manage_path, :notice=>'Password change failed.')
end
end
end
49 changes: 49 additions & 0 deletions app/controllers/arts_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
class ArtsController < CmsapplicationController
def index
@artwork=Artwork.new
@artworks = Artwork.paginate(:page => params[:page], :per_page=>10)
end

# GET /arts/1
def show
@artwork = Artwork.find(params[:id])
end

# GET /arts/new
def new
@artwork = Artwork.new
end

# GET /arts/1/edit
def edit
@artwork = Artwork.find(params[:id])
end

# POST /arts
def create
@artwork = Artwork.new(params[:artwork])
if @artwork.save
render :action=>"show", :notice => 'Artwork was successfully created.', :id=>@artwork.id
else
render :action => "new"
end
end

# PUT /arts/1
def update
@artwork = Artwork.find(params[:id])

if @artwork.update_attributes(params[:artwork])
redirect_to(@artwork, :notice => 'Artwork was successfully updated.')
else
render :action => "edit"
end
end

# DELETE /artworks/1
def destroy
@artwork = Artwork.find(params[:id])
@artwork.destroy
redirect_to(arts_url)
end
end
12 changes: 12 additions & 0 deletions app/controllers/artworks_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
class ArtworksController < ApplicationController
# GET /artworks/search?query=Anything%2C-Search
# GET /artworks/search.json?query=Anything%2C-Search
def search
@artworks = Artwork.search(params[:query], params[:filter], params[:order])

respond_to do |format|
format.html # search.html.erb
format.xml { render :xml => @artworks }
format.json { render :json => @artworks }
end
end

# GET /artworks
# GET /artworks.xml
def index
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/cmsapplication_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class CmsapplicationController < ActionController::Base
before_filter :authenticate_user!
layout "cmsapplication"
protect_from_forgery
end
46 changes: 11 additions & 35 deletions app/controllers/collections_controller.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
class ArtworkDescriptor
def initialize(title, creator, date, object, description, recfrom, location, imglink)
@title = title
@creator = creator
@date = date
@object = object
@description = description
@recfrom = recfrom
@location = location
@imglink = imglink
end

attr_accessor :title, :creator, :date, :object, :description, :recfrom, :location, :imglink
end

class CollectionsController < ApplicationController
def index
end
Expand All @@ -21,29 +6,20 @@ def category
@type = params[:type]
@value = params[:value]

case @type
when 'artist'
dbartworks = Artwork.where("creator = ?", params[:value])
when 'donor'
dbartworks = Artwork.where("recfrom = ?", params[:value])
when 'location'
dbartworks = Artwork.where("location = ?", params[:value])
unless type.nil?
dbartworks = Artwork.filter_by(params[:type], params[:value])
else
redirect_to ''
end

@artworks = []
dbartworks.each do |artwork|
imglink = 'http://s3.amazonaws.com/Art_Images/' + artwork.filename
@artworks.push(ArtworkDescriptor.new(artwork.title,
artwork.creator,
artwork.date,
artwork.object,
artwork.description,
artwork.recfrom,
artwork.location,
imglink))
end

@artworks = dbartworks.each do |art|
art.imglink = 'http://s3.amazonaws.com/Art_Images/' + art.filename
end

respond_to do |format|
format.html # index.html.erb
format.json { render :json => @artworks }
end
end

def artists
Expand Down
Loading

0 comments on commit f53dec2

Please sign in to comment.