diff options
Diffstat (limited to 'application/modules/user/views/scripts/pool')
| -rw-r--r-- | application/modules/user/views/scripts/pool/index.phtml | 249 |
1 files changed, 136 insertions, 113 deletions
diff --git a/application/modules/user/views/scripts/pool/index.phtml b/application/modules/user/views/scripts/pool/index.phtml index f7d04e2..568654d 100644 --- a/application/modules/user/views/scripts/pool/index.phtml +++ b/application/modules/user/views/scripts/pool/index.phtml @@ -5,22 +5,30 @@ 'onclick' => 'self.location="/user/pool/createpool/page/'.$this->page.'"', 'class' => 'addbutton'))?> -<?php if ($this->pools): ?> - <table > - <tr> - <!--<th>ID <span class='code'>poolID</span></th>--> - <th>Title <span class='code'>title</span></th> - <th>Description <span class='code'>description</span></th> - <th>Location <span class='code'>location</span></th> - <th colspan=3>Actions</th> - </tr> +<div class='searchvars'> + <div class='head'>Available searchfilter:</div> + <div class='code'>bootosID</div> + <div class='code'>title</div> + <div class='code'>groupID</div> + <div class='code'>configID</div> + <div class='code'>init</div> + <div class='code'>kernel</div> + <div class='code'>kcl</div> + <div class='code'>description</div> + <div class='code'>changed</div> + <div class='code'>expires</div> + <div class='code'>public</div> +</div> + +<div class='listelement'> + <?php if(count($this->pools)==0) + echo "There are no Pools to display." ?> <?php foreach ($this->pools as $pool): ?> - <tr class=entry> - <!--<td><?php echo $this->escape($pool->getID()) ?></td>--> - <td><?php echo $this->escape($pool->getTitle()) ?></td> - <td><?php echo $this->escape($pool->getDescription()) ?></td> - <td><?php echo $this->escape($pool->getLocation()) ?></td> - <td class='action'><a href="<?php echo $this->url( + <div class='element'> + <div class='number'><?php echo $this->escape($pool->getID()) ?></div> + <div class='content'> + <div class='actions'> + <a href="<?php echo $this->url( array( 'module' => 'user', 'controller' => 'pool', @@ -29,8 +37,8 @@ 'page' => $this->page ), 'default', - true) ?>"><img src='/media/img/edit.png' alt='Edit Pool'/></a></td> - <td class='action'><a href="<?php echo $this->url( + true) ?>"><img src='/media/img/edit.png' alt='Edit Pool'/></a> + <a href="<?php echo $this->url( array( 'module' => 'user', 'controller' => 'pool', @@ -39,8 +47,8 @@ 'page' => $this->page ), 'default', - true) ?>"><img src='/media/img/delete.png' alt='Delete Pool'/></a></td> - <td class='action'><a href="<?php echo $this->url( + true) ?>"><img src='/media/img/delete.png' alt='Delete Pool'/></a> + <a href="<?php echo $this->url( array( 'module' => 'user', 'controller' => 'pool', @@ -49,54 +57,72 @@ 'page' => $this->page ), 'default', - true) ?>"><img src='/media/img/add.png' alt='Link Client'/></a></td> - </tr> - <?php - $poolentriesMapper = new Application_Model_PoolEntriesMapper(); - $clients = $poolentriesMapper->findBy(array('poolID' => $pool->getID()),true); - ?> - <?php if (count($clients)>0): ?> - <tr class=detail> - <td class=arrowtop>↳</td> - <td colspan=6> - <table> - <tr> - <!-- <th>ClientID</th> --> - <th>Mac</th> - <th>Hardwarehash</th> - <th>Actions</th> - </tr> - <?php - foreach ($clients as $client): ?> - <tr> - <!-- <td><?php echo $client['clientID'];?></td> --> - <?php - $cli = new Application_Model_Client(); - $clientMapper = new Application_Model_ClientMapper(); - $clientMapper->find($client['clientID'],$cli); + true) ?>"><img src='/media/img/add.png' alt='Link Client'/></a> + </div> + <?php + $poolentriesMapper = new Application_Model_PoolEntriesMapper(); + $clients = $poolentriesMapper->findBy(array('poolID' => $pool->getID()),true); ?> - <td><?php echo ($cli->macAdress); ?></td> - <td><?php echo ($cli->hardwarehash); ?></td> - <td class='action'><a href="<?php echo $this->url( - array( - 'module' => 'user', - 'controller' => 'pool', - 'action' => 'unlinkclient', - 'poolentriesID' => $client['poolentriesID'], - 'page' => $this->page - ), - 'default', - true) ?>"><img src='/media/img/delete.png' alt='Unlink Client'/></a></td> - </tr> - <?php endforeach ?> - </table> - </td> - </tr> - <?php endif;?> - <?php endforeach ?> - </table> - <?php echo $this->pagination; ?> - + <div class='title'><?php echo $this->escape($pool->getTitle()) ?></div> + <div class='subtitle'><?php echo $this->escape($pool->getLocation()) ?> - <?php echo count($clients);?> Clients<br/> + <?php echo $this->escape($pool->getDescription()) ?></div> + <div class='details dispnone'> + + <?php if (count($clients)>0): ?> + <?php + foreach ($clients as $client): ?> + <?php + $cli = new Application_Model_Client(); + $clientMapper = new Application_Model_ClientMapper(); + $clientMapper->find($client['clientID'],$cli); + ?> + <div class='element'> + <div class='number'><?php echo $client['clientID'];?></div> + <div class='content'> + <div class='actions'> + <a href="<?php echo $this->url( + array( + 'module' => 'user', + 'controller' => 'pool', + 'action' => 'unlinkclient', + 'poolentriesID' => $client['poolentriesID'], + 'page' => $this->page + ), + 'default', + true) ?>"><img src='/media/img/delete.png' alt='Unlink Client'/></a> + </div> + <div class='details'> + <label>MacAdress</label> + <div class='item'><?php echo ($cli->macAdress); ?></div> + <label>Hardwarehash</label> + <div class='item'><?php echo ($cli->hardwarehash); ?></div> + </div> + </div> + <div class='clear'></div> + </div> + <?php endforeach ?> + </div> + <?php endif;?> + </div> + <div class='clear'></div> + </div> + <?php endforeach ?> +</div> + +<?php echo $this->pagination; ?> + +<script> +$(document).ready(function(){ + if($('.element').find('.dispnone').length >= 1){ + $(this).find('.title').css('cursor','pointer'); + + $('.title').click(function(){ + $(this).siblings('.dispnone').toggle(); + }); + } +}); +</script> + <?php if (isset($this->freeclients) && count($this->freeclients)>0): ?> <h2 style='margin-top:20px;'>Free clients</h2> <p style="text-align:right;"> @@ -105,41 +131,44 @@ </p> <div style="height: 200px; overflow: scroll; overflow-x: hidden; "> -<table id='tblSearch'> -<tr> -<th>ClientID</th> -<th>MacAdress</th> -<th>Hardwarehash</th> -<th>Actions</th> -</tr> -<?php -foreach ($this->freeclients as $client): ?> - <tr> - <td><?php echo $client['clientID']; ?></td> - <td><?php echo $client['macadress']; ?></td> - <td><?php echo $client['hardwarehash']; ?></td> - <td><select onChange="location.href=this.options[this.selectedIndex].value"> - <option></option> - <?php foreach ($this->pools as $pool): ?> - <option value="<?php echo $this->url( - array( - 'module' => 'user', - 'controller' => 'pool', - 'action' => 'linkclient', - 'clientID' => $client['clientID'], - 'poolID' => $pool->getID(), - 'page' => $this->page - ), - 'default', - true) ?>"><?php echo $pool->getTitle(); ?></option> - <?php //<img src='/media/img/add.png' alt='Link to Pool'/></a></td> ?> - <?php endforeach ?> - </select> - </td> - </tr> -<?php endforeach ?> -</table> + <div class='listelement' id='tblSearch'> + <?php + foreach ($this->freeclients as $client): ?> + <div class='element'> + <div class='number'>5</div> + <div class='content'> + <div class='actions'> + <select onChange="location.href=this.options[this.selectedIndex].value"> + <option></option> + <?php foreach ($this->pools as $pool): ?> + <option value="<?php echo $this->url( + array( + 'module' => 'user', + 'controller' => 'pool', + 'action' => 'linkclient', + 'clientID' => $client['clientID'], + 'poolID' => $pool->getID(), + 'page' => $this->page + ), + 'default', + true) ?>"><?php echo $pool->getTitle(); ?></option> + <?php //<img src='/media/img/add.png' alt='Link to Pool'/></a></td> ?> + <?php endforeach ?> + </select> + </div> + <div class='details'> + <label>MacAdress</label> + <div class='item'><?php echo $client['macadress']; ?></div> + <label>HardwareHash</label> + <div class='item'><?php echo $client['hardwarehash']; ?></div> + </div> + </div> + <div class='clear'></div> + </div> + <?php endforeach ?> + </div> </div> +<script type='text/javascript' src='/media/js/jquery.highlight-3.js'></script> <script> jQuery.expr[":"].containsNoCase = function(el, i, m) { var search = m[3]; @@ -148,8 +177,6 @@ jQuery.expr[":"].containsNoCase = function(el, i, m) { }; jQuery(document).ready(function() { - // used for the first example in the blog post - jQuery('li:contains(\'DotNetNuke\')').css('color', '#0000ff').css('font-weight', 'bold'); // hide the cancel search image jQuery('#imgSearch').hide(); @@ -171,11 +198,12 @@ jQuery.expr[":"].containsNoCase = function(el, i, m) { // only search when there are 3 or more characters in the textbox if (jQuery('#txtSearch').val().length > 2) { // hide all rows - jQuery('#tblSearch tr').hide(); + jQuery('#tblSearch .element').hide(); // show the header row - jQuery('#tblSearch tr:first').show(); + //jQuery('#tblSearch .element:first').show(); // show the matching rows (using the containsNoCase from Rick Strahl) - jQuery('#tblSearch tr td:containsNoCase(\'' + jQuery('#txtSearch').val() + '\')').parent().show(); + jQuery('#tblSearch .element .item:containsNoCase(\'' + jQuery('#txtSearch').val() + '\')').parent().parent().parent().show(); + $('#tblSearch .element .item').removeHighlight().highlight(jQuery('#txtSearch').val()); // show the cancel search image jQuery('#imgSearch').show(); } @@ -185,11 +213,11 @@ jQuery.expr[":"].containsNoCase = function(el, i, m) { } // if there were no matching rows, tell the user - if (jQuery('#tblSearch tr:visible').length == 1) { + if (jQuery('#tblSearch .element:visible').length == 0) { // remove the norecords row if it already exists jQuery('.norecords').remove(); // add the norecords row - jQuery('#tblSearch').append('<tr class="norecords"><td colspan="5" class="Normal">No records were found</td></tr>'); + jQuery('#tblSearch').append('<div class="norecords">No records found</div>'); } }); }); @@ -198,7 +226,7 @@ function resetSearch() { // clear the textbox jQuery('#txtSearch').val(''); // show all table rows - jQuery('#tblSearch tr').show(); + jQuery('#tblSearch .element').show(); // remove any no records rows jQuery('.norecords').remove(); // remove the cancel search image @@ -208,9 +236,4 @@ function resetSearch() { } </script> <?php endif;?> -<?php else: ?> - - <p>There are no pools to display.</p> - -<?php endif;?> |
