mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 16:27:31 -04:00 
			
		
		
		
	Added statust to client view page
This commit is contained in:
		
							parent
							
								
									8a9eb97134
								
							
						
					
					
						commit
						db4ec4fb62
					
				| @ -145,6 +145,7 @@ class TaskController extends BaseController | ||||
|             'actions' => $actions, | ||||
|             'timezone' => Auth::user()->account->timezone ? Auth::user()->account->timezone->name : DEFAULT_TIMEZONE, | ||||
|             'datetimeFormat' => Auth::user()->account->getMomentDateTimeFormat(), | ||||
|             //'entityStatus' => $task->present()->status,
 | ||||
|         ]; | ||||
| 
 | ||||
|         $data = array_merge($data, self::getViewModel()); | ||||
|  | ||||
| @ -9,4 +9,23 @@ class ClientPresenter extends Presenter { | ||||
|     { | ||||
|         return $this->entity->country ? $this->entity->country->name : ''; | ||||
|     } | ||||
| 
 | ||||
|     public function status() | ||||
|     { | ||||
|         $class = $text = ''; | ||||
| 
 | ||||
|         if ($this->entity->is_deleted) { | ||||
|             $class = 'danger'; | ||||
|             $text = trans('texts.deleted'); | ||||
|         } elseif ($this->entity->trashed()) { | ||||
|             $class = 'warning'; | ||||
|             $text = trans('texts.archived'); | ||||
|         } else { | ||||
|             $class = 'success'; | ||||
|             $text = trans('texts.active'); | ||||
|         } | ||||
| 
 | ||||
|         return "<span class=\"label label-{$class}\">{$text}</span>"; | ||||
| 
 | ||||
|     } | ||||
| } | ||||
| @ -36,4 +36,23 @@ class TaskPresenter extends Presenter { | ||||
| 
 | ||||
|         return implode("\n", $times); | ||||
|     } | ||||
| 
 | ||||
|     public function status() | ||||
|     { | ||||
|         $class = $text = ''; | ||||
| 
 | ||||
|         if ($this->entity->is_deleted) { | ||||
|             $class = 'danger'; | ||||
|             $text = trans('texts.deleted'); | ||||
|         } elseif ($this->entity->trashed()) { | ||||
|             $class = 'warning'; | ||||
|             $text = trans('texts.archived'); | ||||
|         } else { | ||||
|             $class = 'success'; | ||||
|             $text = trans('texts.active'); | ||||
|         } | ||||
| 
 | ||||
|         return "<span class=\"label label-{$class}\">{$text}</span>"; | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @ -93,7 +93,7 @@ class AppServiceProvider extends ServiceProvider { | ||||
|                         ->render(); | ||||
|         }); | ||||
| 
 | ||||
|         HTML::macro('breadcrumbs', function() { | ||||
|         HTML::macro('breadcrumbs', function($status = false) { | ||||
|             $str = '<ol class="breadcrumb">'; | ||||
| 
 | ||||
|             // Get the breadcrumbs by exploding the current path.
 | ||||
| @ -128,6 +128,11 @@ class AppServiceProvider extends ServiceProvider { | ||||
|                     $str .= '<li>'.link_to($crumb, $name).'</li>'; | ||||
|                 } | ||||
|             } | ||||
| 
 | ||||
|             if ($status) { | ||||
|                 $str .= '    ' . $status; | ||||
|             } | ||||
| 
 | ||||
|             return $str . '</ol>'; | ||||
|         }); | ||||
| 
 | ||||
|  | ||||
| @ -21,43 +21,54 @@ | ||||
| 
 | ||||
| @section('content') | ||||
| 
 | ||||
| 	<div class="pull-right"> | ||||
| 		{!! Former::open('clients/bulk')->addClass('mainForm') !!} | ||||
| 		<div style="display:none"> | ||||
| 			{!! Former::text('action') !!} | ||||
| 			{!! Former::text('public_id')->value($client->public_id) !!} | ||||
| 		</div> | ||||
|     <div class="row"> | ||||
|         <div class="col-md-8"> | ||||
|             <div> | ||||
|                 <span style="font-size:28px">{{ $client->getDisplayName() }}</span> | ||||
|                 @if ($client->trashed()) | ||||
|                       {!! $client->present()->status !!} | ||||
|                 @endif | ||||
|             </div> | ||||
|         </div> | ||||
|         <div class="col-md-4"> | ||||
|             <div class="pull-right"> | ||||
|                 {!! Former::open('clients/bulk')->addClass('mainForm') !!} | ||||
|                 <div style="display:none"> | ||||
|                     {!! Former::text('action') !!} | ||||
|                     {!! Former::text('public_id')->value($client->public_id) !!} | ||||
|                 </div> | ||||
| 
 | ||||
|         @if ($gatewayLink) | ||||
|             {!! Button::normal(trans('texts.view_in_stripe'))->asLinkTo($gatewayLink)->withAttributes(['target' => '_blank']) !!} | ||||
|         @endif | ||||
|                 @if ($gatewayLink) | ||||
|                     {!! Button::normal(trans('texts.view_in_stripe'))->asLinkTo($gatewayLink)->withAttributes(['target' => '_blank']) !!} | ||||
|                 @endif | ||||
| 
 | ||||
| 		@if ($client->trashed()) | ||||
| 			{!! Button::primary(trans('texts.restore_client'))->withAttributes(['onclick' => 'onRestoreClick()']) !!} | ||||
| 		@else | ||||
| 		    {!! DropdownButton::normal(trans('texts.edit_client')) | ||||
|                 ->withAttributes(['class'=>'normalDropDown']) | ||||
|                 ->withContents([ | ||||
| 			      ['label' => trans('texts.archive_client'), 'url' => "javascript:onArchiveClick()"], | ||||
| 			      ['label' => trans('texts.delete_client'), 'url' => "javascript:onDeleteClick()"], | ||||
| 			    ] | ||||
| 			  )->split() !!} | ||||
|                 @if ($client->trashed()) | ||||
|                     {!! Button::primary(trans('texts.restore_client'))->withAttributes(['onclick' => 'onRestoreClick()']) !!} | ||||
|                 @else | ||||
|                     {!! DropdownButton::normal(trans('texts.edit_client')) | ||||
|                         ->withAttributes(['class'=>'normalDropDown']) | ||||
|                         ->withContents([ | ||||
|                           ['label' => trans('texts.archive_client'), 'url' => "javascript:onArchiveClick()"], | ||||
|                           ['label' => trans('texts.delete_client'), 'url' => "javascript:onDeleteClick()"], | ||||
|                         ] | ||||
|                       )->split() !!} | ||||
| 
 | ||||
| 			{!! DropdownButton::primary(trans('texts.new_invoice')) | ||||
|                     ->withAttributes(['class'=>'primaryDropDown']) | ||||
|                     ->withContents($actionLinks)->split() !!} | ||||
| 		@endif | ||||
| 	  {!! Former::close() !!} | ||||
|                     {!! DropdownButton::primary(trans('texts.new_invoice')) | ||||
|                             ->withAttributes(['class'=>'primaryDropDown']) | ||||
|                             ->withContents($actionLinks)->split() !!} | ||||
|                 @endif | ||||
|               {!! Former::close() !!} | ||||
| 
 | ||||
| 	</div> | ||||
|             </div> | ||||
|         </div> | ||||
|     </div> | ||||
| 
 | ||||
| 
 | ||||
| 	<h2>{{ $client->getDisplayName() }}</h2> | ||||
| 	@if ($client->last_login > 0) | ||||
| 	<h3 style="margin-top:0px"><small> | ||||
| 		{{ trans('texts.last_logged_in') }} {{ Utils::timestampToDateTimeString(strtotime($client->last_login)) }} | ||||
| 	</small></h3> | ||||
| 	@endif | ||||
|     <br/> | ||||
| 
 | ||||
|     <div class="panel panel-default"> | ||||
|     <div class="panel-body"> | ||||
|  | ||||
| @ -519,7 +519,7 @@ | ||||
|   @endif | ||||
| 
 | ||||
|   @if (!isset($showBreadcrumbs) || $showBreadcrumbs) | ||||
|     {!! HTML::breadcrumbs() !!} | ||||
|     {!! HTML::breadcrumbs(isset($entityStatus) ? $entityStatus : '') !!} | ||||
|   @endif | ||||
| 
 | ||||
|   @yield('content')		 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user