closes #368. ability to add in metacode colors

This commit is contained in:
Connor Turland 2014-09-29 22:26:12 -04:00
parent f14bdfac57
commit 2138aa89f3
10 changed files with 291 additions and 134 deletions

View file

@ -2151,6 +2151,9 @@ float: left;
.blackBox td.iconURL {
max-width: 415px;
word-wrap: break-word;
}
.blackBox td.iconColor {
}
.blackBox .field {
margin: 15px 0 5px;

View file

@ -292,7 +292,7 @@ cursor: pointer;
display: none;
width: 90%;
padding: 13px 0 9px 10%;
background-color: #64BC61;
background-color: #E0E0E0;
color: #424242;
}
.permission.canEdit .metacodeTitle {

View file

@ -77,6 +77,7 @@
<%= render :partial => 'layouts/lightboxes' %>
<%= render :partial => 'layouts/templates' %>
<%= render :partial => 'shared/metacodeBgColors' %>
<style type='text/css'>@import url('http://getbarometer.s3.amazonaws.com/assets/barometer/css/barometer.css');</style>
<script src='http://getbarometer.s3.amazonaws.com/assets/barometer/javascripts/barometer.js'
type='text/javascript'></script>

View file

@ -21,6 +21,11 @@
<%= f.text_field :icon %>
<div class="clearfloat"></div>
</div>
<div class="field">
<%= f.label :color, "Color (hex with # sign)" %>
<%= f.text_field :color %>
<div class="clearfloat"></div>
</div>
<div class="actions">
<%= link_to 'Cancel', metacodes_path, { :class => 'button', 'data-bypass' => 'true' } %>
<%= f.submit :class => 'add' %>

View file

@ -6,6 +6,7 @@
<tr>
<th>Name</th>
<th>Icon</th>
<th>Color</th>
<th></th>
<th></th>
</tr>
@ -14,6 +15,13 @@
<tr>
<td><%= metacode.name %></td>
<td class="iconURL"><%= metacode.icon %></td>
<% if metacode.color %>
<td class="iconColor" style="background-color: <%= metacode.color %>">
<%= metacode.color %>
</td>
<% else %>
<td></td>
<% end %>
<td><img width='40' src='<%= metacode.icon %>' /></td>
<td><%= link_to 'Edit', edit_metacode_path(metacode), :data => { :bypass => 'true'} %></td>
</tr>

View file

@ -0,0 +1,9 @@
<style>
<% Metacode.all.each do |m| %>
<% if m.color %>
<%= ".mbg" + m.name.gsub(/\s+/, "") + "{" %>
<%= "background-color:" + m.color + " !important;" %>
<%= "}" %>
<% end %>
<% end %>
</style>

View file

@ -0,0 +1,5 @@
class AddColorToMetacodes < ActiveRecord::Migration
def change
add_column :metacodes, :color, :string
end
end

View file

@ -0,0 +1,5 @@
class AddColorToMetacodes < ActiveRecord::Migration
def change
add_column :metacodes, :color, :string
end
end

View file

@ -1,133 +1,134 @@
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140815162253) do
create_table "in_metacode_sets", :force => true do |t|
t.integer "metacode_id"
t.integer "metacode_set_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
add_index "in_metacode_sets", ["metacode_id"], :name => "index_in_metacode_sets_on_metacode_id"
add_index "in_metacode_sets", ["metacode_set_id"], :name => "index_in_metacode_sets_on_metacode_set_id"
create_table "mappings", :force => true do |t|
t.text "category"
t.integer "xloc"
t.integer "yloc"
t.integer "topic_id"
t.integer "synapse_id"
t.integer "map_id"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "maps", :force => true do |t|
t.text "name"
t.boolean "arranged"
t.text "desc"
t.text "permission"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.boolean "featured"
t.string "screenshot_file_name"
t.string "screenshot_content_type"
t.integer "screenshot_file_size"
t.datetime "screenshot_updated_at"
end
create_table "metacode_sets", :force => true do |t|
t.string "name"
t.text "desc"
t.integer "user_id"
t.boolean "mapperContributed"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
add_index "metacode_sets", ["user_id"], :name => "index_metacode_sets_on_user_id"
create_table "metacodes", :force => true do |t|
t.text "name"
t.string "icon"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "synapses", :force => true do |t|
t.text "desc"
t.text "category"
t.text "weight"
t.text "permission"
t.integer "node1_id"
t.integer "node2_id"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "topics", :force => true do |t|
t.text "name"
t.text "desc"
t.text "link"
t.text "permission"
t.integer "user_id"
t.integer "metacode_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "image_file_name"
t.string "image_content_type"
t.integer "image_file_size"
t.datetime "image_updated_at"
t.string "audio_file_name"
t.string "audio_content_type"
t.integer "audio_file_size"
t.datetime "audio_updated_at"
end
create_table "users", :force => true do |t|
t.string "name"
t.string "email"
t.text "settings"
t.string "code", :limit => 8
t.string "joinedwithcode", :limit => 8
t.string "crypted_password"
t.string "password_salt"
t.string "persistence_token"
t.string "perishable_token"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "encrypted_password", :limit => 128, :default => ""
t.string "remember_token"
t.datetime "remember_created_at"
t.string "reset_password_token"
t.datetime "last_sign_in_at"
t.string "last_sign_in_ip"
t.integer "sign_in_count", :default => 0
t.datetime "current_sign_in_at"
t.string "current_sign_in_ip"
t.datetime "reset_password_sent_at"
t.boolean "admin"
t.string "image_file_name"
t.string "image_content_type"
t.integer "image_file_size"
t.datetime "image_updated_at"
end
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
end
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140930013020) do
create_table "in_metacode_sets", :force => true do |t|
t.integer "metacode_id"
t.integer "metacode_set_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
add_index "in_metacode_sets", ["metacode_id"], :name => "index_in_metacode_sets_on_metacode_id"
add_index "in_metacode_sets", ["metacode_set_id"], :name => "index_in_metacode_sets_on_metacode_set_id"
create_table "mappings", :force => true do |t|
t.text "category"
t.integer "xloc"
t.integer "yloc"
t.integer "topic_id"
t.integer "synapse_id"
t.integer "map_id"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "maps", :force => true do |t|
t.text "name"
t.boolean "arranged"
t.text "desc"
t.text "permission"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.boolean "featured"
t.string "screenshot_file_name"
t.string "screenshot_content_type"
t.integer "screenshot_file_size"
t.datetime "screenshot_updated_at"
end
create_table "metacode_sets", :force => true do |t|
t.string "name"
t.text "desc"
t.integer "user_id"
t.boolean "mapperContributed"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
add_index "metacode_sets", ["user_id"], :name => "index_metacode_sets_on_user_id"
create_table "metacodes", :force => true do |t|
t.text "name"
t.string "icon"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "color"
end
create_table "synapses", :force => true do |t|
t.text "desc"
t.text "category"
t.text "weight"
t.text "permission"
t.integer "node1_id"
t.integer "node2_id"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "topics", :force => true do |t|
t.text "name"
t.text "desc"
t.text "link"
t.text "permission"
t.integer "user_id"
t.integer "metacode_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "image_file_name"
t.string "image_content_type"
t.integer "image_file_size"
t.datetime "image_updated_at"
t.string "audio_file_name"
t.string "audio_content_type"
t.integer "audio_file_size"
t.datetime "audio_updated_at"
end
create_table "users", :force => true do |t|
t.string "name"
t.string "email"
t.text "settings"
t.string "code", :limit => 8
t.string "joinedwithcode", :limit => 8
t.string "crypted_password"
t.string "password_salt"
t.string "persistence_token"
t.string "perishable_token"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "encrypted_password", :limit => 128, :default => ""
t.string "remember_token"
t.datetime "remember_created_at"
t.string "reset_password_token"
t.datetime "last_sign_in_at"
t.string "last_sign_in_ip"
t.integer "sign_in_count", :default => 0
t.datetime "current_sign_in_at"
t.string "current_sign_in_ip"
t.datetime "reset_password_sent_at"
t.boolean "admin"
t.string "image_file_name"
t.string "image_content_type"
t.integer "image_file_size"
t.datetime "image_updated_at"
end
add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
end

120
metacode_backgrounds.css Normal file
View file

@ -0,0 +1,120 @@
.mbgAction {
background-color: #bd6c85 !important;
}
.mbgActivity {
background-color: #6ebf65 !important;
}
.mbgArgument {
background-color: #7FAEFD !important;
}
.mbgBizarre {
background-color: #bdb25e !important;
}
.mbgCatalyst {
background-color: #EF8964 !important;
}
.mbgClosed {
background-color: #ABB49F !important;
}
.mbgCon {
background-color: #CF7C74 !important;
}
.mbgDecision {
background-color: #cca866 !important;
}
.mbgExample {
background-color: #598559 !important;
}
.mbgExperience {
background-color: #BE995F !important;
}
.mbgForesight {
background-color: #b0b0b0 !important;
}
.mbgFutureDev {
background-color: #25A17F !important;
}
.mbgGoodPractice {
background-color: #BD9E86 !important;
}
.mbgGroup {
background-color: #7076BC !important;
}
.mbgIdea {
background-color: #c4bc5e !important;
}
.mbgImplication {
background-color: #83DECA !important;
}
.mbgInsight {
background-color: #B074AD !important;
}
.mbgIntention {
background-color: #baeaff !important;
}
.mbgKnowledge {
background-color: #60acf7 !important;
}
.mbgList {
background-color: #B7A499 !important;
}
.mbgLocation {
background-color: #abd9a7 !important;
}
.mbgMovieMap {
background-color: #a5a0de !important;
}
.mbgNote {
background-color: #a389a1 !important;
}
.mbgOpenIssue {
background-color: #9bbf71 !important;
}
.mbgOpinion {
background-color: #54a19d !important;
}
.mbgOpportunity {
background-color: #889F64 !important;
}
.mbgPerson {
background-color: #de925f !important;
}
.mbgPlatform {
background-color: #21C8FE !important;
}
.mbgPro {
background-color: #89b879 !important;
}
.mbgProblem {
background-color: #99cfc4 !important;
}
.mbgQuestion {
background-color: #709899 !important;
}
.mbgReference {
background-color: #A7A7A7 !important;
}
.mbgRequirement {
background-color: #d2a7d4 !important;
}
.mbgResearch {
background-color: #CD8E89 !important;
}
.mbgResource {
background-color: #c98c63 !important;
}
.mbgRole {
background-color: #a8595d !important;
}
.mbgTask {
background-color: #2f89ba !important;
}
.mbgTool {
background-color: #828282 !important;
}
.mbgTrajectory {
background-color: #b3953d !important;
}
.mbgWildcard {
background-color: #73c7de !important;
}