Skip to content

Commit

Permalink
Default to no compression, and fixed a style issue when no compressor…
Browse files Browse the repository at this point in the history
…s at all.
  • Loading branch information
timwienk committed Oct 11, 2010
1 parent 3af05cb commit d6f6008
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions views/packager.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,19 @@
</th>
</tr>

<?php foreach($config['blocks'] as $block => $description): ?>
<?php

$blocks = $config['blocks'];

$i = 0;
$c = count($blocks);

foreach($config['blocks'] as $block => $description):
$i++;

?>

<tr class="middle checked selected">
<tr class="<?php echo ($i == $c && empty($config['compressors'])) ? 'last' : 'middle'; ?> checked selected">
<td class="first check">
<div class="checkbox"></div>
<input type="checkbox" name="blocks[]" value="<?php echo $block; ?>" checked="checked" />
Expand All @@ -140,21 +150,12 @@
</th>
</tr>

<?php

$compressors = $config['compressors'];

$i = 0;

foreach($compressors as $compressor):
$i++

?>
<?php foreach($config['compressors'] as $compressor): ?>

<tr class="middle <?php echo ($i == 1) ? 'checked selected' : 'unchecked'; ?>">
<tr class="middle unchecked">
<td class="first check">
<div class="radio"></div>
<input type="radio" name="compressor" value="<?php echo $compressor; ?>"<?php if ($i == 1) echo ' checked="checked"'; ?> />
<input type="radio" name="compressor" value="<?php echo $compressor; ?>" />
</td>
<td class="middle"><?php echo $compressor; ?> Compression</td>
<td class="last">
Expand Down Expand Up @@ -184,10 +185,10 @@

<?php endforeach; ?>

<tr class="last <?php echo (count($compressors)) ? 'unchecked' : 'checked selected'; ?>">
<tr class="last checked selected">
<td class="first check">
<div class="radio"></div>
<input type="radio" name="compressor" value=""<?php if (!count($compressors)) echo ' checked="checked"'; ?> />
<input type="radio" name="compressor" value="" checked="checked" />
</td>
<td class="middle">No Compression</td>
<td class="last">Uncompressed source. Recommended in testing phase.</td>
Expand Down

0 comments on commit d6f6008

Please sign in to comment.