Skip to content

Commit

Permalink
Generate correct HTML. #15.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Conway committed Aug 29, 2012
1 parent 9a319d8 commit 5991a6d
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions app/views/Admin/agenciesMultiAreas.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,33 @@
#{/list}
</ul>
</div>

#{list items:metros.keySet(), as:'agencyId' }
<div class="span6 hidden agencyDetail" id="agency-${agencyId}">
<ul>
#{list items:metros.get(agencyId), as:'metro'}
<li>${metro.name}</li>
#{/list}
</ul>

<div class="btn-group">
<a href="mergeAllAreas?agency.id=${agencyId}" class="btn btn-danger">Merge all</a>
<a href="splitToAreas?agency.id=${agencyId}" class="btn">Split to each</a>
<a href="disableAgency?agency.id=${agencyId}" class="btn">Disable</a>
</ul>
</div>
#{/list}
</div>
</div>
<div class="span6">
#{list items:metros.keySet(), as:'agencyId' }
<div class="agencyDetail hidden" id="agency-${agencyId}">
<ul>
#{list items:metros.get(agencyId), as:'metro'}
<li>${metro.name}</li> #{/list}
</ul>

<div class="btn-group">
<a href="mergeAllAreas?agency.id=${agencyId}"
class="btn btn-danger">Merge all</a> <a
href="splitToAreas?agency.id=${agencyId}" class="btn">Split to
each</a> <a href="disableAgency?agency.id=${agencyId}" class="btn">Disable</a>
</ul>
</div>
</div>
#{/list}
</div>
</div>

<script type="text/javascript">
$('.agencyLink').click(function (e) {
e.preventDefault();
var id = $(this).attr('id').split('-')[1];
$('.agencyDetail').addClass('hidden');
$('#agency-' + id).removeClass('hidden');
});
$('.agencyLink').click(function(e) {
e.preventDefault();
var id = $(this).attr('id').split('-')[1];

$('.agencyDetail').addClass('hidden');
$('#agency-' + id).removeClass('hidden');
});
</script>

0 comments on commit 5991a6d

Please sign in to comment.