-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
68 additions
and
54,902 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,4 +1,6 @@ | ||
db/openstudio.data | ||
db/*.sqlite3 | ||
tmp/* | ||
.DS_Store | ||
.DS_Store | ||
public/os | ||
log/* |
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,2 +1,11 @@ | ||
class MembersController < ApplicationController | ||
|
||
def index | ||
@members = Member.all | ||
end | ||
|
||
def show | ||
@member = Member.find(params[:id]) | ||
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 |
---|---|---|
@@ -1,2 +1,7 @@ | ||
class PiecesController < ApplicationController | ||
|
||
def show | ||
@piece = Piece.find(params[:id]) | ||
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 |
---|---|---|
@@ -1,2 +1,7 @@ | ||
class Member < ActiveRecord::Base | ||
has_many :created, :foreign_key => "creator_id", :class_name => "Piece" | ||
has_many :owned, :foreign_key => "owner_id", :class_name => "Piece" | ||
|
||
default_scope :order => "name asc, login asc" | ||
|
||
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
class Piece < ActiveRecord::Base | ||
belongs_to :owner, :class_name => "Member" | ||
belongs_to :creator, :class_name => "Member" | ||
|
||
named_scope :sold, :conditions => "owner_id != creator_id" | ||
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,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" | ||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | ||
|
||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | ||
<head> | ||
<title>OPENSTUDIO Archives</title> | ||
</head> | ||
|
||
<body> | ||
<%= yield %> | ||
</body> | ||
</html> |
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,3 @@ | ||
<% @members.each do |member| %> | ||
<%= link_to h(member.name), member_path(member) %> | ||
<% 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,12 @@ | ||
<h1><%= @member.name %></h1> | ||
<p>(<%= @member.login %>)</p> | ||
|
||
<h2>Purchased</h2> | ||
<% @member.owned.sold.each do |piece| %> | ||
<%= link_to h(piece.title), piece_path(piece) %> | ||
<% end %> | ||
|
||
<h2>Portfolio</h2> | ||
<% @member.created.each do |piece| %> | ||
<%= link_to h(piece.title), piece_path(piece) %> | ||
<% 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,14 @@ | ||
<h1><%= @piece.title %></h1> | ||
|
||
<div> | ||
<%= image_tag "/os/500/#{@piece.legacy_id}.png" %> | ||
</div> | ||
|
||
<p> | ||
Creator: <%= link_to h(@piece.creator.name), member_path(@piece.creator) %> | ||
</p> | ||
|
||
<p> | ||
Owner: <%= link_to h(@piece.owner.name), member_path(@piece.owner) %> | ||
</p> | ||
|
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,47 +1,7 @@ | ||
ActionController::Routing::Routes.draw do |map| | ||
map.resources :pieces | ||
|
||
map.resources :members | ||
|
||
# The priority is based upon order of creation: first created -> highest priority. | ||
|
||
# Sample of regular route: | ||
# map.connect 'products/:id', :controller => 'catalog', :action => 'view' | ||
# Keep in mind you can assign values other than :controller and :action | ||
|
||
# Sample of named route: | ||
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase' | ||
# This route can be invoked with purchase_url(:id => product.id) | ||
|
||
# Sample resource route (maps HTTP verbs to controller actions automatically): | ||
# map.resources :products | ||
|
||
# Sample resource route with options: | ||
# map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get } | ||
|
||
# Sample resource route with sub-resources: | ||
# map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller | ||
|
||
# Sample resource route with more complex sub-resources | ||
# map.resources :products do |products| | ||
# products.resources :comments | ||
# products.resources :sales, :collection => { :recent => :get } | ||
# end | ||
|
||
# Sample resource route within a namespace: | ||
# map.namespace :admin do |admin| | ||
# # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb) | ||
# admin.resources :products | ||
# end | ||
|
||
# You can have the root of your site routed with map.root -- just remember to delete public/index.html. | ||
# map.root :controller => "welcome" | ||
|
||
# See how all your routes lay out with "rake routes" | ||
|
||
# Install the default routes as the lowest priority. | ||
# Note: These default routes make all actions in every controller accessible via GET requests. You should | ||
# consider removing or commenting them out if you're using named routes and resources. | ||
map.connect ':controller/:action/:id' | ||
map.connect ':controller/:action/:id.:format' | ||
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 was deleted.
Oops, something went wrong.