Skip to content

Commit

Permalink
Added the base list elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Dibbets committed Jul 6, 2016
1 parent 3ad4f95 commit b51bc8f
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
applications/*
!applications/widgets
!applications/base
!applications/ApplicationBase.php
!applications/ApplicationController.php
!applications/assets
Expand Down
12 changes: 12 additions & 0 deletions applications/base/view/___data-popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

<div class="unselectable modal-header application-modal-header" data-drag-handle>
<button type="button" class=" unselectable close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="unselectable modal-title" data-drag-handle><?= $title ?></h4>
</div>
<div class="modal-body <?= $this->getId('modal')?> application-modal-body" >
<?= $contents ?>
</div>

<div class="modal-footer application-modal-footer" style="clear:both">
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
</div>
76 changes: 76 additions & 0 deletions applications/base/view/___list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<div class="control-list">
<table class="table data" data-control="rowlink">
<thead>

<tr>
<?php foreach($columsToList as $column => $properties):?>
<th class="<?= ($orderColumn == $column ? 'active' : '')?> sort-<?= ($orderColumn == $column ? $sortDirection : 'desc')?> '">
<a data-apprequest="onSort"
data-apprequest-data="listName:'<?=$listName?>',column:'<?= $column ?>'"
href="javascript:void(0)">

<?= $properties->label ?>
</a>
</th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach($list as $item):?>
<tr <?php if(!empty($destinationLink)):?>data-open-window-url="<?= Backend::url($destinationLink,[$item->getKey()])?>" style="cursor:pointer;"<?php endif;?>>

<?php foreach($columsToList as $column => $label):?>
<td>
<?= $item->getAttribute($column); ?>
</td>
<?php endforeach; ?>

</tr>
<?php endforeach; ?>
</body>
<tfoot>
<tr>
<td colspan="8" class="list-pagination nolink">
<div class="control-pagination">
<?php if($page -1 > -1):?>
<a href="javascript:void(0)"
data-apprequest="onPaginate"
data-apprequest-data="listName:'<?=$listName?>',page:<?= $page - 1?>"
class="page-back"
title="Previous page"></a>&nbsp;
<?php endif;?>

<span class="page-iteration"><?= $start ?>-<?= $to ?> of <?= $totalCount ?></span>

<?php if($to < $totalCount): ?>
<a href="javascript:void(0)"
data-apprequest="onPaginate"
data-apprequest-data="listName:'<?=$listName?>',page:<?= $page + 1?>"
class="page-next"
title="Next page"></a>
<?php endif;?>
<?php
if(($to < $totalCount)||($page -1 > -1)): ?>
<select class="form-control custom-select"
id="<?=$this->getId('jump-to-page')?>">
<?php for($c=0;$c < ceil($totalCount / $limitPerPage);$c++):?>
<option
<?php if($c==$page):?>
selected="selected"
<?php endif;?>
value="<?= $c ?>">
Page <?= $c+1 ?>
</option>
<?php endfor;?>
</select>
<a class="btn btn-success" style="color:white;"
data-apprequest="onPaginate"
data-apprequest-data="listName:'<?=$listName?>',page:$('#<?=$this->getId('jump-to-page')?> option:selected').val()">Jump</a>

<?php endif;?>
</div>
</td>
</tr>
</tfoot>
</table>
</div>
2 changes: 2 additions & 0 deletions applications/base/view/___list_footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
</div>
</div>
9 changes: 9 additions & 0 deletions applications/base/view/___list_header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="list-container" data-appid="<?= $this->getApplicationID();?>">
<input type="search"
value="<?=$searchValue?>"
data-search-in-list-element data-apprequest-data="listName:'<?=$listName?>'"
class="form-control icon search"
title="Use % as a wild card for multiple characters. Use _ as a wildcard for a single character"
style=" height:20px;
width:calc(100% - 44px);">
<div id="<?= $this->getId('list-container') ?>">

0 comments on commit b51bc8f

Please sign in to comment.