metamaps--metamaps/views/metacodes/_form.html.erb

44 lines
1.1 KiB
Text
Raw Normal View History

2018-03-04 02:25:42 +00:00
{ form_for(@metacode) do |f| }
{ if @metacode.errors.any? }
<div id="error_explanation">
2018-03-04 02:25:42 +00:00
<h2>{ pluralize(@metacode.errors.count, "error") } prohibited this metacode from being saved:</h2>
<ul>
2018-03-04 02:25:42 +00:00
{ @metacode.errors.full_messages.each do |msg| }
<li>{ msg }</li>
{ end }
</ul>
</div>
2018-03-04 02:25:42 +00:00
{ end }
<div class="field">
2018-03-04 02:25:42 +00:00
{ f.label :name }
{ f.text_field :name }
<div class="clearfloat"></div>
</div>
2018-03-04 02:25:42 +00:00
{ unless @metacode.new_record? }
<div class="field">
2018-03-04 02:25:42 +00:00
{ f.label 'Current Icon' }
{ image_tag @metacode.icon, width: 96 }
</div>
2018-03-04 02:25:42 +00:00
{ end }
<div class="field">
2018-03-04 02:25:42 +00:00
{ if @metacode.new_record? }
{ f.label 'Icon' }
{ else }
{ f.label 'Replace Icon: ' }
{ end }
{ f.hidden_field :manual_icon, value: nil }
{ f.file_field :aws_icon }
<div class="clearfloat"></div>
</div>
<div class="field">
2018-03-04 02:25:42 +00:00
{ f.label :color, "Color (hex with # sign)" }
{ f.text_field :color }
<div class="clearfloat"></div>
</div>
<div class="actions">
2018-03-04 02:25:42 +00:00
{ link_to 'Cancel', metacodes_path, { :class => 'button' } }
{ f.submit :class => 'add' }
</div>
2018-03-04 02:25:42 +00:00
{ end }