← Back to team overview

amm-dev-tem team mailing list archive

[Branch ~amm-dev-tem/amm/trunk] Rev 40: Added classes for designing

 

------------------------------------------------------------
revno: 40
committer: The Whole Life To Learn <thewholelifetolearn@xxxxxxxxx>
branch nick: sources
timestamp: Thu 2011-10-13 21:18:07 +0200
message:
  Added classes for designing
modified:
  app/views/people/index.ctp


--
lp:amm
https://code.launchpad.net/~amm-dev-tem/amm/trunk

Your team AMM dev team is subscribed to branch lp:amm.
To unsubscribe from this branch go to https://code.launchpad.net/~amm-dev-tem/amm/trunk/+edit-subscription
=== modified file 'app/views/people/index.ctp'
--- app/views/people/index.ctp	2011-05-31 15:21:15 +0000
+++ app/views/people/index.ctp	2011-10-13 19:18:07 +0000
@@ -1,35 +1,53 @@
-<div class="people index">
+<div class="actions grid_3">
+	<h3><?php __('Actions'); ?></h3>
+	<ul>
+		<li><?php echo $this->Html->link(__('New contact', true), array('action' => 'add')); ?></li>
+		<li><?php echo $this->Html->link(__('Events', true), array('controller' => 'events', 'action' => 'index')); ?> </li>
+		<li><?php echo $this->Html->link(__('New Event', true), array('controller' => 'events', 'action' => 'add')); ?> </li>
+	</ul>
+</div>
+<div class="people index grid_13">
 	<h2><?php __('People');?></h2>
-	<table cellpadding="0" cellspacing="0">
-	<tr>
-			<th><?php echo $this->Paginator->sort(__('Name', true), 'name');?></th>
-			<th><?php echo $this->Paginator->sort(__('Nickname', true), 'surname');?></th>
-			<th><?php echo $this->Paginator->sort(__('Birthday', true), 'birthday');?></th>
-			<th><?php echo $this->Paginator->sort(__('Address', true), 'town');?></th>
-			<th><?php echo __('Contact', true);?></th>
-			<th class="actions"><?php echo __('Actions', true);?></th>
-	</tr>
+	<table>
+		<thead>
+			<tr>
+				<th><?php echo $this->Paginator->sort(__('Name', true), 'name');?></th>
+				<th><?php echo $this->Paginator->sort(__('Nickname', true), 'surname');?></th>
+				<th><?php echo $this->Paginator->sort(__('Birthday', true), 'birthday');?></th>
+				<th><?php echo $this->Paginator->sort(__('Address', true), 'town');?></th>
+				<th><?php echo __('Contact', true);?></th>
+				<th class="actions"><?php echo __('Actions', true);?></th>
+			</tr>
+		</thead>
+		<tbody>
 	<?php
-	$i = 0;
 	foreach ($people as $person):
-		$class = null;
-		if ($i++ % 2 == 0) {
-			$class = ' class="altrow"';
-		}
 	?>
-	<tr<?php echo $class;?>>
-		<td><?php echo $person['Person']['name']; ?>&nbsp;</td>
-		<td><?php echo $person['Person']['surname']; ?>&nbsp;</td>
-		<td><?php echo $person['Person']['birthday']; ?>&nbsp;</td>
-		<td><?php echo $person['Person']['address'].' '.$person['Person']['addr_comp'].' '.$person['Person']['postal_code'].' '.$person['Person']['town']; ?>&nbsp;</td>
-		<td><?php echo $person['Person']['phone'].' '.$person['Person']['email']; ?>&nbsp;</td>
-		<td class="actions">
-			<?php echo $this->Html->link(__('View', true), array('action' => 'view', $person['Person']['id'])); ?>
-			<?php echo $this->Html->link(__('Edit', true), array('action' => 'edit', $person['Person']['id'])); ?>
-			<?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $person['Person']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $person['Person']['id'])); ?>
-		</td>
-	</tr>
+			<tr>
+				<td><?php echo $person['Person']['name']; ?>&nbsp;</td>
+				<td><?php echo $person['Person']['surname']; ?>&nbsp;</td>
+				<td>
+				<?php
+					$date = new DateTime($person['Person']['birthday']);
+					echo $date->format('d F Y')
+				?>&nbsp;
+				</td>
+				<td><?php echo $person['Person']['address'].' '.$person['Person']['addr_comp'].'<br />'.$person['Person']['postal_code'].' '.$person['Person']['town']; ?>&nbsp;</td>
+				<td>
+				<?php
+					echo $person['Person']['phone'];
+					if(!empty($person['Person']['phone']) && !empty($person['Person']['email'])) { echo ' | '; }
+					echo $person['Person']['email'];
+				?>&nbsp;
+				</td>
+				<td class="actions">
+					<?php echo $this->Html->link($this->Html->image('view_16.png', array('alt' => __('View', true))), array('action' => 'view', $person['Person']['id']), array('escape' => false)); ?>
+					<?php echo $this->Html->link($this->Html->image('edit_16.png', array('alt' => __('Edit', true))), array('action' => 'edit', $person['Person']['id']), array('escape' => false)); ?>
+					<?php echo $this->Html->link($this->Html->image('delete_16.png', array('alt' => __('Delete', true))), array('action' => 'delete', $person['Person']['id']), array('escape' => false), sprintf(__('Are you sure you want to delete %s?', true), $person['Person']['name'])); ?>
+				</td>
+			</tr>
 <?php endforeach; ?>
+		</tbody>
 	</table>
 	<p>
 	<?php
@@ -44,18 +62,4 @@
  |
 		<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
 	</div>
-</div>
-<div class="actions">
-	<h3><?php __('Actions'); ?></h3>
-	<ul>
-		<li><?php echo $this->Html->link(__('New Person', true), array('action' => 'add')); ?></li>
-		<li><?php echo $this->Html->link(__('List Members', true), array('controller' => 'members', 'action' => 'index')); ?> </li>
-		<li><?php echo $this->Html->link(__('New Member', true), array('controller' => 'members', 'action' => 'add')); ?> </li>
-		<li><?php echo $this->Html->link(__('List Person Infos', true), array('controller' => 'person_infos', 'action' => 'index')); ?> </li>
-		<li><?php echo $this->Html->link(__('New Person Info', true), array('controller' => 'person_infos', 'action' => 'add')); ?> </li>
-		<li><?php echo $this->Html->link(__('List Events', true), array('controller' => 'events', 'action' => 'index')); ?> </li>
-		<li><?php echo $this->Html->link(__('New Event', true), array('controller' => 'events', 'action' => 'add')); ?> </li>
-		<li><?php echo $this->Html->link(__('List Places', true), array('controller' => 'places', 'action' => 'index')); ?> </li>
-		<li><?php echo $this->Html->link(__('New Place', true), array('controller' => 'places', 'action' => 'add')); ?> </li>
-	</ul>
 </div>
\ No newline at end of file