{{-- Name: Notice.list Author: JH2 Created: 2015-04-24 Updated by: AL Description: 2015-11-25 Notice.list is used to list notices in a partials.box Params: content_id - String, Unique string used by blade to prevent duplication of content when multiple instances of the same element is used header-title - String, This string will be used as header title (H5), this string will be visible when collapsed event - Array counter - Int, Number of new events text_single - String, Text for single event text_multiple - String, Text for multiple events filter - Array Example: @include('notice.list', [ 'content_id' => 'notice_list', 'header_title' => Lang::get('notice.notices'), 'event' => [ 'counter' => count($notices), 'text' => Lang::choice('notice.new_notice', count($notices)), ], 'data' => $notices, 'paginate' => true, ]) --}} @extends('partials.box') @section($content_id) @if((Route::currentRouteName() == 'admin.notice.index')) @if(isset($filter) && $filter == true)
{!! Form::label('hideHidden', Lang::get('notice.form.hideHidden'), ['class' => 'col-md-4 control-label']) !!}
{!! Form::checkbox('hideHidden', true, ($request->filled('hideHidden') && $request->get('hideHidden') == 1)? true : false) !!}

@endif @endif @if(isset($filter) && $filter == true)

{{ Lang::get('notice.filter.filterOn') }}:

{{ Lang::get('notice.filter.isRead') }}
{!! Form::select('isUnread', array('0' => Lang::get('notice.filter.default'), '1' => Lang::get('notice.filter.onlyUnread')), Request::has('isUnread')?Request::get('isUnread'):'1', ['class' => 'form-control']) !!}

@endif {{-- *********************************************** --}}
{{ trans('notice.form.title')}}
{{ trans('notice.form.shortDesc')}}
{{ trans('notice.form.time')}}
{{-- List all notices --}} @if (!$data->isEmpty()) @foreach($data as $key => $notice)
@if($notice->prio == 10) @endif {{ $notice->title }} @if(!$notice->readByUser(Auth::user())) @endif
{{ str_limit(strip_tags($notice->content), 150) }}
{{ $notice->start_time->diffForHumans() }}
@if(!$notice->readByUser(Auth::user())) {{ trans('notice.markAsRead') }} @endif
{{-- if admin and on the adminview --}} @if((Route::currentRouteName() == 'admin.notice.index')) @can('noticeEdit')

{{ trans('notice.form.editText')}} | ({{{ $notice->company->name ?? Lang::get('notice.global') }}}) | {{ trans('notice.form.starttime')}}: {{ $notice->start_time }} | {{ trans('notice.form.stoptime')}}: @if ($notice->stop_time < Carbon\Carbon::now()) {{ $notice->stop_time }} @else {{ $notice->stop_time }} @endif

@endcan @endif
@endforeach @else

{{ Lang::get('notice.no_new_notices') }}

@endif
@if(isset($paginate) && $paginate === true) {{-- Display pagination links --}}