@extends('header') @section('content') @parent @include('accounts.nav', ['selected' => ACCOUNT_USER_MANAGEMENT]) {!! Former::open($url)->method($method)->addClass('warn-on-exit')->rules(array( 'first_name' => 'required', 'last_name' => 'required', 'email' => 'required|email', )); !!} @if ($user) {!! Former::populate($user) !!} @endif

{!! $title !!}

{!! Former::text('first_name') !!} {!! Former::text('last_name') !!} {!! Former::text('email') !!} {!! Former::checkbox('is_admin') ->label(' ') ->text(trans('texts.administrator')) ->help(trans('texts.administrator_help')) !!} {!! Former::checkbox('permissions[create_all]') ->value('create_all') ->label(' ') ->id('permissions_create_all') ->text(trans('texts.user_create_all')) !!} {!! Former::checkbox('permissions[view_all]') ->value('view_all') ->label(' ') ->id('permissions_view_all') ->text(trans('texts.user_view_all')) !!} {!! Former::checkbox('permissions[edit_all]') ->value('edit_all') ->label(' ') ->id('permissions_edit_all') ->text(trans('texts.user_edit_all')) !!}
{!! Former::actions( Button::normal(trans('texts.cancel'))->asLinkTo(URL::to('/settings/user_management'))->appendIcon(Icon::create('remove-circle'))->large(), Button::success(trans($user && $user->confirmed ? 'texts.save' : 'texts.send_invite'))->submit()->large()->appendIcon(Icon::create($user && $user->confirmed ? 'floppy-disk' : 'send')) )!!} {!! Former::close() !!} @stop @section('onReady') $('#first_name').focus(); $('#is_admin, #permissions_view_all').change(fixCheckboxes); function fixCheckboxes(){ var adminChecked = $('#is_admin').is(':checked'); var viewChecked = $('#permissions_view_all').is(':checked'); $('#permissions_view_all').prop('disabled', adminChecked); $('#permissions_create_all').prop('disabled', adminChecked); $('#permissions_edit_all').prop('disabled', adminChecked || !viewChecked); if(!viewChecked)$('#permissions_edit_all').prop('checked',false) } fixCheckboxes(); @stop