Преглед изворни кода

Converted locations list to use a table.

Alan Lam пре 8 година
родитељ
комит
1de3cc1333
1 измењених фајлова са 29 додато и 15 уклоњено
  1. 29 15
      views/location_list.php

+ 29 - 15
views/location_list.php

@@ -1,24 +1,38 @@
-<?php
-if(empty($locations)) {
-	?>
-	<div class="alert alert-info">
-		No locations to display.
-	</div>
-	<?php
-}
-else {
-	?>
-	<div class="list-group">
+<table class="table table-hover">
+	<thead>
+		<tr>
+			<th>ID</th>
+			<th>Name / Address</th>
+			<th></th>
+		</tr>
+	</thead>
+	<tbody>
 	<?php
 	<?php
 	foreach($locations as $location) {
 	foreach($locations as $location) {
 		?>
 		?>
-		<a class="list-group-item list-group-item-action" href="/account/locations/<?=$location->id?>">
-			<?=htmlspecialchars($location->name)?><br />
-			<small><?=htmlspecialchars($location->getDisplayAddress(["address_1", "address_2", "city", "postal_code"]))?></small>
-		</a>
+		<tr>
+			<td class="text-right">
+				<?=$location->id?>
+			</td>
+			<td>
+				<a href="/account/locations/<?=$location->id?>"><?=htmlspecialchars($location->name)?></a><br />
+				<small><?=htmlspecialchars($location->getDisplayAddress(["address_1", "address_2", "city", "postal_code"]))?></small>
+			</td>
+			<td class="text-right align-middle">
+				<a class="btn btn-outline-primary" href="/account/locations/<?=$location->id?>/edit">Edit</a>
+			</td>
+		</tr>
 		<?php
 		<?php
 	}
 	}
 	?>
 	?>
+	</tbody>
+</table>
+
+<?php
+if(empty($locations)) {
+	?>
+	<div class="alert alert-info">
+		No locations to display.
 	</div>
 	</div>
 	<?php
 	<?php
 }
 }