Skip to content
Permalink
Browse files

Revert "Better dashboard: Merge Delete/Disable column to Control colu…

…mn" (#430)
  • Loading branch information...
cydrobolt committed Mar 29, 2018
1 parent d39efe6 commit f3b9f09460fec1223bdf1de922218d6e274cd08a
@@ -123,12 +123,6 @@ public function renderToggleLinkActiveCell($link) {
</a>';
}
public function renderControlLinkCell($link){
return '<div class="btn-group" role="group">
' . $this->renderToggleLinkActiveCell($link) . $this->renderDeleteLinkCell($link) . '
</div>';
}
/* DataTables bindings */
public function paginateAdminUsers(Request $request) {
@@ -149,7 +143,8 @@ public function paginateAdminLinks(Request $request) {
$admin_links = Link::select(['short_url', 'long_url', 'clicks', 'created_at', 'creator', 'is_disabled']);
return Datatables::of($admin_links)
->addColumn('control', [$this, 'renderControlLinkCell'])
->addColumn('disable', [$this, 'renderToggleLinkActiveCell'])
->addColumn('delete', [$this, 'renderDeleteLinkCell'])
->editColumn('clicks', [$this, 'renderClicksCell'])
->editColumn('long_url', [$this, 'renderLongUrlCell'])
->escapeColumns(['short_url', 'creator'])
@@ -152,12 +152,15 @@ polr.controller('AdminCtrl', function($scope, $compile, $timeout) {
"ajax": BASE_API_PATH + 'admin/get_admin_links',

"columns": [
{className: 'wrap-text', data: 'short_url', name: 'short_url', width: '10%'},
{className: 'wrap-text', data: 'short_url', name: 'short_url'},
{className: 'wrap-text', data: 'long_url', name: 'long_url'},
{data: 'clicks', name: 'clicks', width: '10%'},
{data: 'created_at', name: 'created_at', width: '18%'},
{data: 'creator', name: 'creator', width: '20%'},
{data: 'control', name: 'control', orderable: false, searchable: false, width: '15%'},
{data: 'clicks', name: 'clicks'},
{data: 'created_at', name: 'created_at'},
{data: 'creator', name: 'creator'},

{data: 'disable', name: 'disable', orderable: false, searchable: false},
{data: 'delete', name: 'delete', orderable: false, searchable: false}

]
}, datatables_config));
}
@@ -8,7 +8,8 @@
@if ($table_id == "admin_links_table")
{{-- Show action buttons only if admin view --}}
<th>Creator</th>
<th>Control</th>
<th>Disable</th>
<th>Delete</th>
@endif
</tr>
</thead>

0 comments on commit f3b9f09

Please sign in to comment.
You can’t perform that action at this time.