Adds color to event types

This commit is contained in:
Chrisbr 2014-06-12 16:24:24 +02:00
parent e34a972b74
commit bf4758a54a
5 changed files with 15 additions and 1 deletions

View file

@ -109,6 +109,13 @@ $(function() {
},
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() {

View file

@ -1,5 +1,5 @@
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

View file

@ -4,6 +4,7 @@
<%= f.input :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 :color, :input_html => { :size => 6, :type => 'color' } %>
<%= remove_association_link :event_type, f %>
<% end %>
</div>