Skip to content

Commit

Permalink
Removed knowledge score as it was stupid
Browse files Browse the repository at this point in the history
  • Loading branch information
Francismb committed May 19, 2016
1 parent 7eee3ba commit 59e8a0e
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 30 deletions.
55 changes: 36 additions & 19 deletions app/assets/stylesheets/skills.css.erb
Original file line number Diff line number Diff line change
@@ -1,32 +1,49 @@
/* Edit/Delete/New button styles */
a.new-skill, a.edit-skill, a.delete-skill {
position: absolute;
right: 0;
top: 3px;
position: absolute;
right: 0;
top: 3px;
}

a.edit-skill {
right: 120px;
right: 120px;
}

/* Skill index styles */
.skills > .third {
text-align: center;
margin: 10px;
padding: 20px;
width: 30%;
width: calc(33.3% - 20px);
-webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
position: relative;
text-align: center;
margin: 10px;
padding: 20px 20px 70px 20px;
width: 30%;
width: calc(33.3% - 20px);
-webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}

.skills > .third:nth-child(3n+1) {
margin-left: 0;
margin-right: 20px;
margin-left: 0;
margin-right: 20px;
}

.skills > .third:nth-child(3n) {
margin-right: 0;
margin-left: 20px;
margin-right: 0;
margin-left: 20px;
}

.skills > .third a {
position: absolute;
bottom: 20px;
left: 0;
right: 0;
margin: 0 auto;
width: 70px;
}
.skills > .third p
{
margin-bottom: 0;
}
1 change: 0 additions & 1 deletion app/models/skill.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ class Skill < ActiveRecord::Base
validates :color, :presence => {:message => 'The color field cannot be blank'}
validates :summary, :presence => {:message => 'The summary field cannot be blank'}
validates :content, :presence => {:message => 'The content field cannot be blank'}
validates :knowledge, :presence => {:message => 'The knowledge field cannot be blank'}

end
2 changes: 0 additions & 2 deletions app/views/skills/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
<%= skill_form.text_area(:summary) %>
<%= skill_form.label(:content, 'Content') %>
<%= skill_form.text_area(:content) %>
<%= skill_form.label(:knowledge, 'Knowledge') %>
<%= skill_form.number_field(:knowledge) %>
<%= skill_form.check_box(:visible) %>
<%= skill_form.label(:visible, 'Publicly visible') %>
<%= skill_form.submit('Update Skill', :class => 'button') %>
Expand Down
4 changes: 0 additions & 4 deletions app/views/skills/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@
<% @skills.each do |skill| %>
<section class="third">
<h2 style="color: <%= skill.color %>"><%= skill.name %></h2>

<p><%= skill.summary %></p>

<h2><%= skill.knowledge %>/100</h2>
<br class="spacer-sm"/>
<a class="button" href="<%= url_for :action => :show, :id => skill.id %>">More
Info
</a>
Expand Down
2 changes: 0 additions & 2 deletions app/views/skills/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
<%= skill_form.text_area(:summary) %>
<%= skill_form.label(:content, 'Content') %>
<%= skill_form.text_area(:content) %>
<%= skill_form.label(:knowledge, 'Knowledge') %>
<%= skill_form.number_field(:knowledge) %>
<%= skill_form.submit('Create Skill', :class => 'button') %>
<% end %>
</div>
5 changes: 5 additions & 0 deletions db/migrate/20160519073514_remove_knowledge_from_skills.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RemoveKnowledgeFromSkills < ActiveRecord::Migration
def change
remove_column :skills, :knowledge, :integer
end
end
3 changes: 1 addition & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20160519070409) do
ActiveRecord::Schema.define(version: 20160519073514) do

create_table "messages", force: :cascade do |t|
t.string "name"
Expand Down Expand Up @@ -49,7 +49,6 @@
t.text "summary"
t.text "content"
t.string "color"
t.integer "knowledge"
t.boolean "visible"
end

Expand Down

0 comments on commit 59e8a0e

Please sign in to comment.