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

90 lines
3.2 KiB
Text
Raw Normal View History

2018-03-04 02:25:42 +00:00
{ form_for(@metacode_set) do |f| }
{ if @metacode_set.errors.any? }
<div id="error_explanation">
2018-03-04 02:25:42 +00:00
<h2>{ pluralize(@metacode_set.errors.count, "error") } prohibited this metacode set from being saved:</h2>
<ul>
2018-03-04 02:25:42 +00:00
{ @metacode_set.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>
<div class="field">
2018-03-04 02:25:42 +00:00
{ f.label :desc, "Description" }
{ f.text_area :desc, :cols => "40", :rows => "4" }
<div class="clearfloat"></div>
</div>
<br />
<p>Choose Metacodes</p>
2014-09-16 01:57:34 +00:00
<div class="allMetacodes">
<span id="showAll" onclick="Metamaps.Admin.selectAll();">Select All</span>
<span id="hideAll" onclick="Metamaps.Admin.deselectAll();">Unselect All</span>
</div>
<div class="clearfloat"></div>
<div class="editMetacodes">
<ul id="filters-one">
2018-03-04 02:25:42 +00:00
{ $i = 0 }
{ @m = Metacode.order("name").all }
{ while $i < (Metacode.all.length / 4) do }
<li id="{ @m[$i].id }" { if not @m[$i].in_metacode_set(@metacode_set) }class="toggledOff"{ end }
2014-09-16 01:57:34 +00:00
onclick="Metamaps.Admin.liClickHandler.call(this);">
2018-03-04 02:25:42 +00:00
<img src="{ asset_path @m[$i].icon }" alt="{ @m[$i].name }" />
<p>{ @m[$i].name.downcase }</p>
<div class="clearfloat"></div>
</li>
2018-03-04 02:25:42 +00:00
{ $i += 1 }
{ end }
</ul>
<ul id="filters-two">
2018-03-04 02:25:42 +00:00
{ while $i < (Metacode.all.length / 4 * 2) do }
<li id="{ @m[$i].id }" { if not @m[$i].in_metacode_set(@metacode_set) }class="toggledOff"{ end }
2014-09-16 01:57:34 +00:00
onclick="Metamaps.Admin.liClickHandler.call(this);">
2018-03-04 02:25:42 +00:00
<img src="{ asset_path @m[$i].icon }" alt="{ @m[$i].name }" />
<p>{ @m[$i].name.downcase }</p>
<div class="clearfloat"></div>
</li>
2018-03-04 02:25:42 +00:00
{ $i += 1 }
{ end }
</ul>
<ul id="filters-three">
2018-03-04 02:25:42 +00:00
{ while $i < (Metacode.all.length / 4 * 3) do }
<li id="{ @m[$i].id }" { if not @m[$i].in_metacode_set(@metacode_set) }class="toggledOff"{ end }
2014-09-16 01:57:34 +00:00
onclick="Metamaps.Admin.liClickHandler.call(this);">
2018-03-04 02:25:42 +00:00
<img src="{ asset_path @m[$i].icon }" alt="{ @m[$i].name }" />
<p>{ @m[$i].name.downcase }</p>
<div class="clearfloat"></div>
</li>
2018-03-04 02:25:42 +00:00
{ $i += 1 }
{ end }
</ul>
<ul id="filters-four">
2018-03-04 02:25:42 +00:00
{ while $i < Metacode.all.length do }
<li id="{ @m[$i].id }" { if not @m[$i].in_metacode_set(@metacode_set) }class="toggledOff"{ end }
2014-09-16 01:57:34 +00:00
onclick="Metamaps.Admin.liClickHandler.call(this);">
2018-03-04 02:25:42 +00:00
<img src="{ asset_path @m[$i].icon }" alt="{ @m[$i].name }" />
<p>{ @m[$i].name.downcase }</p>
<div class="clearfloat"></div>
</li>
2018-03-04 02:25:42 +00:00
{ $i += 1 }
{ end }
</ul>
</div>
2018-03-04 02:25:42 +00:00
{ hidden_field(:metacodes, :value, {:value => 0}) }
<div class="clearfloat"></div>
<div class="actions">
2018-03-04 02:25:42 +00:00
{ link_to 'Cancel', metacode_sets_path,
{ :class => 'button' } }
{ f.submit :class => 'add', :onclick => "return Metamaps.Admin.validate();" }
</div>
2018-03-04 02:25:42 +00:00
{ end }