app/views/library_groups/_form.html.erb
<script>
$(document).ready( function() {
$('.demo').each( function() {
//
// Dear reader, it's actually very easy to initialize MiniColors. For example:
//
// $(selector).minicolors();
//
// The way I've done it below is just for the demo, so don't get confused
// by it. Also, data- attributes aren't supported at this time. Again,
// they're only used for the purposes of this demo.
//
$(this).minicolors({
control: $(this).attr('data-control') || 'hue',
defaultValue: $(this).attr('data-defaultValue') || '',
inline: $(this).attr('data-inline') === 'true',
letterCase: $(this).attr('data-letterCase') || 'lowercase',
opacity: $(this).attr('data-opacity'),
position: $(this).attr('data-position') || 'bottom left',
change: function(hex, opacity) {
var log;
try {
log = hex ? hex : 'transparent';
if( opacity ) log += ', ' + opacity;
console.log(log);
} catch(e) {}
},
theme: 'default'
});
});
});
</script>
<%= form_for(@library_group) do |f| -%>
<%= f.error_messages -%>
<div class="field">
<%= f.label :name -%><br />
<%= f.text_field :name, :class => 'short_name' -%>
</div>
<div class="field">
<%= f.label :display_name -%><br />
<%= f.text_area :display_name, :class => 'resource_textarea' -%>
</div>
<div class="field">
<%= f.label :header_title -%><br />
<%= f.text_area :header_title, :class => 'resource_textarea' -%>
</div>
<div class="field">
<%= f.label :email -%><br />
<%= f.email_field :email, :class => 'resource_email' -%>
</div>
<div class="field">
<%= f.label :url -%><br />
<%= f.url_field :url, :class => 'resource_url' -%>
</div>
<div class="field">
<%= f.label :login_banner -%><br />
<%= f.text_area :login_banner -%>
</div>
<div class="field">
<%= f.label :allow_bookmark_external_url -%>
<%= f.check_box :allow_bookmark_external_url -%>
</div>
<!--
<div class="field">
<%= f.label :post_to_union_catalog -%>
<%= f.check_box :post_to_union_catalog -%>
</div>
-->
<div class="field">
<%= f.label :my_networks -%><br />
<%= f.text_area :my_networks -%>
</div>
<div class="field">
<%= f.label :admin_networks -%><br />
<%= f.text_area :admin_networks -%>
</div>
<div class="field">
<%= f.label :use_dsbl -%>
<%= f.check_box :use_dsbl -%>
</div>
<div class="field">
<%= f.label :dsbl_list -%><br />
<%= f.text_area :dsbl_list -%>
</div>
<!--
<div class="form-group">
<label for="hue-demo">カラーピッカーサンプル</label>
<input type="text" id="hue-demo" class="demo" data-control="hue" value="#ff6161">
</div>
-->
<div class="field">
<%= f.label :colors -%>:<br />
<%= f.label :title_color %><br />
<%= f.text_field :title_color %>
<br />
<%= f.label :list_odd_color %><br />
<%= f.text_field :list_odd_color %>
<br />
<%= f.label :list_even_color %><br />
<%= f.text_field :list_even_color %>
<br />
<%= f.label :list_border_color %><br />
<%= f.text_field :list_border_color %>
</div>
<div class="field">
<%= f.label :note -%><br />
<%= f.text_area :note -%>
</div>
<div class="field">
<%= f.label t('activerecord.models.country') -%><br />
<%= f.select(:country_id, @countries.collect{|c| [c.display_name.localize, c.id]}) -%>
</div>
<div class="actions">
<%= f.submit %>
</div>
<%- end -%>