59 lines
2.2 KiB
PHP
59 lines
2.2 KiB
PHP
@php
|
|
$is_reply = isset($reply_comment);
|
|
@endphp
|
|
|
|
{{-- Show a previous of the comment we're replying to --}}
|
|
@if ($is_reply)
|
|
<ul class="mb-3">
|
|
@include (Theme::viewName('partials.photo_single_comment'), ['comment' => $reply_comment, 'is_reply' => true])
|
|
</ul>
|
|
@endif
|
|
|
|
<form action="{{ $photo->postCommentUrl() }}" method="post">
|
|
{{ csrf_field() }}
|
|
|
|
@if ($is_reply)
|
|
<input type="hidden" name="parent_comment_id" value="{{ $reply_comment->id }}"/>
|
|
@endif
|
|
|
|
<div class="form-group">
|
|
<label for="commentor-name">@lang('forms.name_label')</label>
|
|
<input type="text" class="form-control{{ $errors->has('commentor_name') ? ' is-invalid' : '' }}" id="commentor-name" name="commentor_name"/>
|
|
|
|
@if ($errors->has('commentor_name'))
|
|
<div class="invalid-feedback">
|
|
<strong>{{ $errors->first('commentor_name') }}</strong>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="commentor-email">@lang('forms.email_label')</label>
|
|
<input type="text" class="form-control{{ $errors->has('commentor_email') ? ' is-invalid' : '' }}" id="commentor-email" name="commentor_email" placeholder="@lang('forms.email_placeholder')"/>
|
|
|
|
@if ($errors->has('commentor_email'))
|
|
<div class="invalid-feedback">
|
|
<strong>{{ $errors->first('commentor_email') }}</strong>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="comment-text">@lang('forms.photo_comment_text_label')</label>
|
|
<textarea class="form-control{{ $errors->has('comment_text') ? ' is-invalid' : '' }}" id="comment-text" name="comment_text" rows="10"></textarea>
|
|
|
|
@if ($errors->has('comment_text'))
|
|
<div class="invalid-feedback">
|
|
<strong>{{ $errors->first('comment_text') }}</strong>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
|
|
<div class="form-group text-right">
|
|
@if ($is_reply)
|
|
<button type="button" class="btn btn-success" onclick="app.postCommentReply();">@lang('forms.photo_comment_reply_action')</button>
|
|
@else
|
|
<button type="submit" class="btn btn-success">@lang('forms.photo_comment_submit_action')</button>
|
|
@endif
|
|
</div>
|
|
</form> |