-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:almartin/120SpringTrunk
- Loading branch information
Showing
88 changed files
with
6,635 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.bundle | ||
log/* | ||
log/**/* | ||
db/*.sqlite3 | ||
log/*.log | ||
tmp/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.