Added support for right aligning table columns

This commit is contained in:
Hillel Coren 2016-02-01 15:58:52 +02:00
parent 63c1293e3b
commit 523b008d01
7 changed files with 22 additions and 6 deletions

View File

@ -722,7 +722,6 @@ class AccountController extends BaseController
private function saveInvoiceDesign()
{
//dd(Input::get('all_pages_header'));
if (Auth::user()->account->isPro()) {
$account = Auth::user()->account;
$account->hide_quantity = Input::get('hide_quantity') ? true : false;

View File

@ -195,6 +195,8 @@ class AccountGatewayController extends BaseController
if ($gatewayId == GATEWAY_DWOLLA) {
$optional = array_merge($optional, ['key', 'secret']);
} elseif ($gatewayId == GATEWAY_STRIPE) {
$rules['publishable_key'] = 'required';
}
foreach ($fields as $field => $details) {

View File

@ -3372,6 +3372,10 @@ ul.user-accounts a:hover div.remove {
font-size: .9em;
}
td.right {
text-align: right;
}
/* Show selected section in settings nav */
.list-group-item.selected:before {
position: absolute;

View File

@ -1021,6 +1021,10 @@ ul.user-accounts a:hover div.remove {
font-size: .9em;
}
td.right {
text-align: right;
}
/* Show selected section in settings nav */
.list-group-item.selected:before {
position: absolute;

View File

@ -23,7 +23,7 @@
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title" data-bind="text: title"></h3>
<h3 class="panel-title" data-bind="text: title">&nbsp;</h3>
</div>
<div class="panel-body">

View File

@ -56,10 +56,16 @@
@if (isset($hasCheckboxes) && $hasCheckboxes)
'aaSorting': [['1', 'asc']],
// Disable sorting on the first column
"aoColumnDefs": [ {
'bSortable': false,
'aTargets': [ 0, {{ count($columns) - 1 }} ]
} ],
"aoColumnDefs": [
{
'bSortable': false,
'aTargets': [ 0, {{ count($columns) - 1 }} ]
},
{
'sClass': 'right',
'aTargets': {{ isset($values['rightAlign']) ? json_encode($values['rightAlign']) : '[]' }}
}
],
@endif
@foreach ($options as $k => $o)
{!! json_encode($k) !!}: {!! json_encode($o) !!},

View File

@ -45,6 +45,7 @@
{!! Datatable::table()
->addColumn($columns)
->setUrl(route('api.' . $entityType . 's'))
->setCustomValues('rightAlign', isset($rightAlign) ? $rightAlign : [])
->setOptions('sPaginationType', 'bootstrap')
->setOptions('aaSorting', [[isset($sortCol) ? $sortCol : '1', 'desc']])
->render('datatable') !!}