@extends('emails.layouts.master')

@section('content')
	<div style="font-style: italic; color: #555;">
		<!-- ******** Please do not reply to this email ******** -->
	</div>
	<div style="font-size: 14px; margin-top: 10px; color: #999;">
		### When replying, anything above this line will be added as a new comment to this ticket. ###
		<p style="margin-top: 5px;">Ticket number: <span style="color: #3a87ad; font-weight: bold;">#{!! $task->id !!}</span></p>
	</div>

	<!-- Bordered delimiter -->
	<div style="height: 1px; border-top: 1px dotted #cacaca; margin: 5px 0;"></div>

	<!-- Render conversations -->
	<table style="width: 100%; boder: none;">
		<tbody>

			@foreach ($comments as $comment)
				<tr style="border-bottom: 1px dotted #cacaca; margin: 5px 0;">
					<td style="width: 65px; padding-top: 15px; padding-bottom: 30px;">
						<img src="{!! $comment->creator->profile_photo_image  !!}" alt="Profile Photo" style="width: 50px; border-radius: 10px;">
					</td>
					<td style="padding-top: 15px; padding-bottom: 30px;">
						<!-- Render the author's name -->
						<div style="font-size: 16px; font-weight: bold;">

							<!-- Render the name of the person who created the comment -->
							@if ( $comment->customer_reply)
								<!-- this was emailed by a customer -->
								{!! $comment->from_name ? : trim($comment->client->name) !!}
							@else
								<!-- this is from a member of staff -->
								{!! trim($comment->creator->name) !!}

								<!-- we will append computer assistance support if this is a member of staff -->
								<span style="font-weight: normal;">(Computer Assistance Support)</span>
							@endif
						</div>

						<!-- Render the time -->
						<div style="color: #999; margin-top: 5px; font-size: 14px;">{!! Carbon\Carbon::parse($comment->created_at)->format('d F Y \a\t H:i') !!}</div>

						<!-- Render the message -->
						<div style="font-size: 14px; margin-top: 25px;">
							{!! nl2br($comment->message) !!}
						</div>
					</td>
				</tr>
			@endforeach


		</tbody>
	</table>
@stop

@section('automessage')

	<div style="font-size: 14px; margin-top: 10px; color: #999;">
		## This message was generated using the <span style="color: #3a87ad;">Seraph HelpDesk</span> ##
	</div>
@stop