diff --git a/.project b/.project
new file mode 100644
index 0000000..9bd42ac
--- /dev/null
+++ b/.project
@@ -0,0 +1,18 @@
+
+
+ WhosGotWhat
+
+
+
+
+
+ com.aptana.ide.core.unifiedBuilder
+
+
+
+
+
+ org.radrails.rails.core.railsnature
+ com.aptana.ruby.core.rubynature
+
+
diff --git a/app/assets/javascripts/skill_holdings.js b/app/assets/javascripts/skill_holdings.js
new file mode 100644
index 0000000..dee720f
--- /dev/null
+++ b/app/assets/javascripts/skill_holdings.js
@@ -0,0 +1,2 @@
+// Place all the behaviors and hooks related to the matching controller here.
+// All this logic will automatically be available in application.js.
diff --git a/app/assets/javascripts/skills.js b/app/assets/javascripts/skills.js
new file mode 100644
index 0000000..dee720f
--- /dev/null
+++ b/app/assets/javascripts/skills.js
@@ -0,0 +1,2 @@
+// Place all the behaviors and hooks related to the matching controller here.
+// All this logic will automatically be available in application.js.
diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css
index fdca7c0..c17d45e 100644
--- a/app/assets/stylesheets/application.css
+++ b/app/assets/stylesheets/application.css
@@ -2,3 +2,36 @@
*= require_self
*= require_tree .
*/
+
+ table {
+ font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
+ font-size: 12px;
+ background: #CCCCCC;
+ margin: 40px;
+ width: 480px;
+ border-collapse: collapse;
+ text-align: left;
+ border-top: 4px solid #aabcfe;
+ border-bottom: 4px solid #aabcfe;
+ }
+ th {
+ font-size: 13px;
+ font-weight: normal;
+ padding: 8px;
+ background: #b9c9fe;
+ color: #039;
+ }
+ td {
+ padding: 8px;
+ background: #e8edff;
+ border-bottom: 1px solid #fff;
+ color: #669;
+ border-top: 1px solid #aabcfe;
+ }
+ tr:hover td{
+ background: #d0dafd;
+ color: #339;
+ }
+ h1 {
+ margin-left: 20px
+ }
diff --git a/app/assets/stylesheets/scaffolds.css.scss b/app/assets/stylesheets/scaffolds.css.scss
new file mode 100644
index 0000000..05188f0
--- /dev/null
+++ b/app/assets/stylesheets/scaffolds.css.scss
@@ -0,0 +1,56 @@
+body {
+ background-color: #fff;
+ color: #333;
+ font-family: verdana, arial, helvetica, sans-serif;
+ font-size: 13px;
+ line-height: 18px; }
+
+p, ol, ul, td {
+ font-family: verdana, arial, helvetica, sans-serif;
+ font-size: 13px;
+ line-height: 18px; }
+
+pre {
+ background-color: #eee;
+ padding: 10px;
+ font-size: 11px; }
+
+a {
+ color: #000;
+ &:visited {
+ color: #666; }
+ &:hover {
+ color: #fff;
+ background-color: #000; } }
+
+div {
+ &.field, &.actions {
+ margin-bottom: 10px; } }
+
+#notice {
+ color: green; }
+
+.field_with_errors {
+ padding: 2px;
+ background-color: red;
+ display: table; }
+
+#error_explanation {
+ width: 450px;
+ border: 2px solid red;
+ padding: 7px;
+ padding-bottom: 0;
+ margin-bottom: 20px;
+ background-color: #f0f0f0;
+ h2 {
+ text-align: left;
+ font-weight: bold;
+ padding: 5px 5px 5px 15px;
+ font-size: 12px;
+ margin: -7px;
+ margin-bottom: 0px;
+ background-color: #c00;
+ color: #fff; }
+ ul li {
+ font-size: 12px;
+ list-style: square; } }
diff --git a/app/assets/stylesheets/skill_holdings.css.scss b/app/assets/stylesheets/skill_holdings.css.scss
new file mode 100644
index 0000000..b6a3c44
--- /dev/null
+++ b/app/assets/stylesheets/skill_holdings.css.scss
@@ -0,0 +1,3 @@
+// Place all the styles related to the skill_holdings controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/skills.css.scss b/app/assets/stylesheets/skills.css.scss
new file mode 100644
index 0000000..b6c781d
--- /dev/null
+++ b/app/assets/stylesheets/skills.css.scss
@@ -0,0 +1,3 @@
+// Place all the styles related to the skills controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/assets/stylesheets/tools.css.scss b/app/assets/stylesheets/tools.css.scss
new file mode 100644
index 0000000..1c54797
--- /dev/null
+++ b/app/assets/stylesheets/tools.css.scss
@@ -0,0 +1,3 @@
+// Place all the styles related to the tools controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
diff --git a/app/controllers/skill_holdings_controller.rb b/app/controllers/skill_holdings_controller.rb
new file mode 100644
index 0000000..6a93b24
--- /dev/null
+++ b/app/controllers/skill_holdings_controller.rb
@@ -0,0 +1,42 @@
+class SkillHoldingsController < ApplicationController
+
+ def create
+ @skill_holding = current_user.skill_holdings.build(params[:skill_holding])
+
+ if @skill_holding.save
+ redirect_to user_skill_holdings_url(current_user.id)
+ else
+ # render :action => "new"
+ render action: "new"
+ end
+ end
+
+ def destroy
+ @skill_holding = current_user.skill_holdings.find(params[:id])
+ @skill_holding.destroy
+ redirect_to user_skill_holdings_url(current_user.id)
+ end
+
+ def edit
+ @skill_holding = current_user.skill_holdings.find(params[:id])
+ end
+
+ def index
+ @skill_holdings = current_user.skill_holdings
+ end
+
+ def new
+ @skill_holding = current_user.skill_holdings.build
+ end
+
+ def update
+ @skill_holding = current_user.skill_holdings.find(params[:id])
+
+ if @skill_holding.update_attributes(params[:skill_holding])
+ redirect_to user_skill_holdings_url(current_user.id)
+ else
+ render action: "edit"
+ end
+ end
+
+end
diff --git a/app/controllers/skills_controller.rb b/app/controllers/skills_controller.rb
new file mode 100644
index 0000000..e18ca4e
--- /dev/null
+++ b/app/controllers/skills_controller.rb
@@ -0,0 +1,83 @@
+class SkillsController < ApplicationController
+ # GET /skills
+ # GET /skills.json
+ def index
+ @skills = Skill.all
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.json { render json: @skills }
+ end
+ end
+
+ # GET /skills/1
+ # GET /skills/1.json
+ def show
+ @skill = Skill.find(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.json { render json: @skill }
+ end
+ end
+
+ # GET /skills/new
+ # GET /skills/new.json
+ def new
+ @skill = Skill.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.json { render json: @skill }
+ end
+ end
+
+ # GET /skills/1/edit
+ def edit
+ @skill = Skill.find(params[:id])
+ end
+
+ # POST /skills
+ # POST /skills.json
+ def create
+ @skill = Skill.new(params[:skill])
+
+ respond_to do |format|
+ if @skill.save
+ format.html { redirect_to @skill, notice: 'Skill was successfully created.' }
+ format.json { render json: @skill, status: :created, location: @skill }
+ else
+ format.html { render action: "new" }
+ format.json { render json: @skill.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /skills/1
+ # PUT /skills/1.json
+ def update
+ @skill = Skill.find(params[:id])
+
+ respond_to do |format|
+ if @skill.update_attributes(params[:skill])
+ format.html { redirect_to @skill, notice: 'Skill was successfully updated.' }
+ format.json { head :no_content }
+ else
+ format.html { render action: "edit" }
+ format.json { render json: @skill.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /skills/1
+ # DELETE /skills/1.json
+ def destroy
+ @skill = Skill.find(params[:id])
+ @skill.destroy
+
+ respond_to do |format|
+ format.html { redirect_to skills_url }
+ format.json { head :no_content }
+ end
+ end
+end
diff --git a/app/controllers/tools_controller.rb b/app/controllers/tools_controller.rb
new file mode 100644
index 0000000..a0a34ad
--- /dev/null
+++ b/app/controllers/tools_controller.rb
@@ -0,0 +1,83 @@
+class ToolsController < ApplicationController
+ # GET /tools
+ # GET /tools.json
+ def index
+ @tools = Tool.all
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.json { render json: @tools }
+ end
+ end
+
+ # GET /tools/1
+ # GET /tools/1.json
+ def show
+ @tool = Tool.find(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.json { render json: @tool }
+ end
+ end
+
+ # GET /tools/new
+ # GET /tools/new.json
+ def new
+ @tool = Tool.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.json { render json: @tool }
+ end
+ end
+
+ # GET /tools/1/edit
+ def edit
+ @tool = Tool.find(params[:id])
+ end
+
+ # POST /tools
+ # POST /tools.json
+ def create
+ @tool = Tool.new(params[:tool])
+
+ respond_to do |format|
+ if @tool.save
+ format.html { redirect_to @tool, notice: 'Tool was successfully created.' }
+ format.json { render json: @tool, status: :created, location: @tool }
+ else
+ format.html { render action: "new" }
+ format.json { render json: @tool.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /tools/1
+ # PUT /tools/1.json
+ def update
+ @tool = Tool.find(params[:id])
+
+ respond_to do |format|
+ if @tool.update_attributes(params[:tool])
+ format.html { redirect_to @tool, notice: 'Tool was successfully updated.' }
+ format.json { head :no_content }
+ else
+ format.html { render action: "edit" }
+ format.json { render json: @tool.errors, status: :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /tools/1
+ # DELETE /tools/1.json
+ def destroy
+ @tool = Tool.find(params[:id])
+ @tool.destroy
+
+ respond_to do |format|
+ format.html { redirect_to tools_url }
+ format.json { head :no_content }
+ end
+ end
+end
diff --git a/app/helpers/skill_holdings_helper.rb b/app/helpers/skill_holdings_helper.rb
new file mode 100644
index 0000000..e1e8757
--- /dev/null
+++ b/app/helpers/skill_holdings_helper.rb
@@ -0,0 +1,2 @@
+module SkillHoldingsHelper
+end
diff --git a/app/helpers/skills_helper.rb b/app/helpers/skills_helper.rb
new file mode 100644
index 0000000..5a66444
--- /dev/null
+++ b/app/helpers/skills_helper.rb
@@ -0,0 +1,2 @@
+module SkillsHelper
+end
diff --git a/app/helpers/tools_helper.rb b/app/helpers/tools_helper.rb
new file mode 100644
index 0000000..6f87959
--- /dev/null
+++ b/app/helpers/tools_helper.rb
@@ -0,0 +1,2 @@
+module ToolsHelper
+end
diff --git a/app/models/skill.rb b/app/models/skill.rb
new file mode 100644
index 0000000..30cb08a
--- /dev/null
+++ b/app/models/skill.rb
@@ -0,0 +1,8 @@
+class Skill < ActiveRecord::Base
+
+ has_many :skill_holdings
+ has_many :users, :through => :skill_holdings
+
+ validates :name, :presence => true, :length => {:maximum => 60}, :uniqueness => true
+
+end
diff --git a/app/models/skill_holding.rb b/app/models/skill_holding.rb
new file mode 100644
index 0000000..42e1e4b
--- /dev/null
+++ b/app/models/skill_holding.rb
@@ -0,0 +1,28 @@
+class SkillHolding < ActiveRecord::Base
+
+ attr_accessible :level, :name
+
+ belongs_to :user
+ belongs_to :skill
+
+ validates :level, :numericality => {:minimum => 0, :maximum => 4}
+ validates :user_id, :presence => true
+ validates :skill_id, :presence => true
+
+ SKILL_LEVELS = ["Interested in", "Novice", "Intermediate", "Experienced" , "Guru"]
+
+ def level_name
+ level && SKILL_LEVELS[level]
+ end
+
+ def name
+ skill && skill.name
+ end
+
+ def name=(skill_name)
+ self.skill = Skill.find_or_create_by_name(skill_name)
+ save
+ return name
+ end
+
+end
diff --git a/app/models/tool.rb b/app/models/tool.rb
new file mode 100644
index 0000000..b36babc
--- /dev/null
+++ b/app/models/tool.rb
@@ -0,0 +1,7 @@
+class Tool < ActiveRecord::Base
+ # attr_accessible :title, :body
+ attr_accessible :name, :electric, :volts
+ validates :name, :presence => true
+ validates :volts, :numericality => {:greater_than => 0}, :if => Proc.new{|tool| tool.electric?}
+
+end
diff --git a/app/models/user.rb b/app/models/user.rb
index 18df122..e1324fd 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -10,6 +10,9 @@ class User < ActiveRecord::Base
},
:options => { :skip_provider_check => true }
+ has_many :skill_holdings
+ has_many :skills, :through => :skill_holdings
+
has_one :facebook_profile, :dependent => :destroy, :inverse_of => :user
validates :first_name, :presence => true
diff --git a/app/views/home/dashboard.html.erb b/app/views/home/dashboard.html.erb
index f87cae5..3cfb0be 100644
--- a/app/views/home/dashboard.html.erb
+++ b/app/views/home/dashboard.html.erb
@@ -1 +1,29 @@
-Welcome <%= current_user.name %>
+
+<% if current_user == nil %>
+ Not logged in.
+ <%= link_to "Log in", "/auth/facebook" %>
+
+<% else %>
+
Welcome <%= current_user.name %>
+
+
+
+
+ <%= link_to "My skills", user_skill_holdings_path(current_user) %>
+ |
+
+ <%= link_to "All skills", skills_path %>
+ FIXME
+ |
+
+
+
+ My Tools FIXME
+ |
+
+ <%= link_to "All Tools", tools_path %>
+ |
+
+
+<% end %>
+
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 27f07d7..22680b5 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -1,16 +1,69 @@
+
+
+
+
+
WhosGotWhat
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
+
+
+
+
+
+
+
+ <%= render 'shared/flashes' %>
+ <%= content_for?(:content) ? yield(:content) : yield %>
+
+
+
+
+
-<%= render 'shared/flashes' %>
-<%= content_for?(:content) ? yield(:content) : yield %>
-