1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00
invoiceninja/resources/views/accounts/user_management.blade.php

71 lines
2.1 KiB
PHP
Raw Normal View History

2015-03-16 22:45:25 +01:00
@extends('accounts.nav')
@section('content')
@parent
@include('accounts.nav_advanced')
2015-04-01 21:57:02 +02:00
{!! Former::open('users/delete')->addClass('user-form') !!}
2015-03-16 22:45:25 +01:00
<div style="display:none">
2015-04-01 21:57:02 +02:00
{!! Former::text('userPublicId') !!}
2015-03-16 22:45:25 +01:00
</div>
2015-04-01 21:57:02 +02:00
{!! Former::close() !!}
2015-03-16 22:45:25 +01:00
<div class="pull-right">
2015-05-19 21:14:00 +02:00
{!! Button::normal(trans('texts.api_tokens'))->asLinkTo(URL::to('/company/advanced_settings/token_management'))->appendIcon(Icon::create('cloud')) !!}
2015-03-16 22:45:25 +01:00
@if (Utils::isPro())
2015-05-19 21:14:00 +02:00
{!! Button::primary(trans('texts.add_user'))->asLinkTo(URL::to('/users/create'))->appendIcon(Icon::create('plus-sign')) !!}
2015-03-16 22:45:25 +01:00
@endif
</div>
<label for="trashed" style="font-weight:normal; margin-left: 10px;">
<input id="trashed" type="checkbox" onclick="setTrashVisible()"
2015-04-01 21:57:02 +02:00
{!! Session::get('show_trash:user') ? 'checked' : ''!!}/> {!! trans('texts.show_deleted_users')!!}
2015-03-16 22:45:25 +01:00
</label>
2015-04-01 21:57:02 +02:00
{!! Datatable::table()
2015-03-16 22:45:25 +01:00
->addColumn(
trans('texts.name'),
trans('texts.email'),
trans('texts.user_state'),
trans('texts.action'))
->setUrl(url('api/users/'))
->setOptions('sPaginationType', 'bootstrap')
->setOptions('bFilter', false)
->setOptions('bAutoWidth', false)
->setOptions('aoColumns', [[ "sWidth"=> "20%" ], [ "sWidth"=> "45%" ], ["sWidth"=> "20%"], ["sWidth"=> "15%" ]])
->setOptions('aoColumnDefs', [['bSortable'=>false, 'aTargets'=>[3]]])
2015-04-01 21:57:02 +02:00
->render('datatable') !!}
2015-03-16 22:45:25 +01:00
<script>
window.onDatatableReady = function() {
$('tbody tr').mouseover(function() {
$(this).closest('tr').find('.tr-action').css('visibility','visible');
}).mouseout(function() {
$dropdown = $(this).closest('tr').find('.tr-action');
if (!$dropdown.hasClass('open')) {
$dropdown.css('visibility','hidden');
}
});
}
function setTrashVisible() {
var checked = $('#trashed').is(':checked');
2015-04-01 21:57:02 +02:00
window.location = '{!! URL::to('view_archive/user') !!}' + (checked ? '/true' : '/false');
2015-03-16 22:45:25 +01:00
}
function deleteUser(id) {
if (!confirm('Are you sure?')) {
return;
}
$('#userPublicId').val(id);
$('form.user-form').submit();
}
</script>
@stop