Adds color to event types
This commit is contained in:
parent
e34a972b74
commit
bf4758a54a
5 changed files with 15 additions and 1 deletions
|
|
@ -109,6 +109,13 @@ $(function() {
|
||||||
},
|
},
|
||||||
5)
|
5)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('a:contains("Add event_type")').click(function () {
|
||||||
|
setTimeout(function () {
|
||||||
|
$("div.nested-fields:last div:nth-of-type(5) input").val(get_color());
|
||||||
|
},
|
||||||
|
5)
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function get_color() {
|
function get_color() {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
class EventType < ActiveRecord::Base
|
class EventType < ActiveRecord::Base
|
||||||
attr_accessible :title, :length, :minimum_abstract_length, :maximum_abstract_length
|
attr_accessible :title, :length, :minimum_abstract_length, :maximum_abstract_length, :color
|
||||||
|
|
||||||
belongs_to :conference
|
belongs_to :conference
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
<%= f.input :length, :input_html => {:size => 3} %>
|
<%= f.input :length, :input_html => {:size => 3} %>
|
||||||
<%= f.input :minimum_abstract_length, :input_html => {:size => 3} %>
|
<%= f.input :minimum_abstract_length, :input_html => {:size => 3} %>
|
||||||
<%= f.input :maximum_abstract_length, :input_html => {:size => 3} %>
|
<%= f.input :maximum_abstract_length, :input_html => {:size => 3} %>
|
||||||
|
<%= f.input :color, :input_html => { :size => 6, :type => 'color' } %>
|
||||||
<%= remove_association_link :event_type, f %>
|
<%= remove_association_link :event_type, f %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
5
db/migrate/20140612141123_add_color_to_event_type.rb
Normal file
5
db/migrate/20140612141123_add_color_to_event_type.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddColorToEventType < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :event_types, :color, :string
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -155,6 +155,7 @@ ActiveRecord::Schema.define(version: 20140612181230) do
|
||||||
t.integer "length", default: 30
|
t.integer "length", default: 30
|
||||||
t.integer "minimum_abstract_length", default: 0
|
t.integer "minimum_abstract_length", default: 0
|
||||||
t.integer "maximum_abstract_length", default: 500
|
t.integer "maximum_abstract_length", default: 500
|
||||||
|
t.string "color"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "events", force: true do |t|
|
create_table "events", force: true do |t|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue