mirror of
https://github.com/openSUSE/osem.git
synced 2026-06-11 17:25:15 -04:00
Adds color to event types
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
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 "minimum_abstract_length", default: 0
|
||||
t.integer "maximum_abstract_length", default: 500
|
||||
t.string "color"
|
||||
end
|
||||
|
||||
create_table "events", force: true do |t|
|
||||
|
||||
Reference in New Issue
Block a user