Skip to content

Commit

Permalink
fix: views
Browse files Browse the repository at this point in the history
  • Loading branch information
ScuffedNewt committed Oct 25, 2024
1 parent 7853893 commit f9b7f89
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 110 deletions.
2 changes: 2 additions & 0 deletions resources/views/admin/mail/create_mail.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@

{!! Form::close() !!}

@endsection
@section('scripts')
<script>
$(document).ready(function() {
$('#usernameList').selectize();
Expand Down
29 changes: 13 additions & 16 deletions resources/views/admin/mail/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@
<p>Mod Mail can be sent to a user anonymously by staff in order to issue strikes, warnings, information etc. <br> Mail can be used to automatically ban users after a set number of strikes (see the setting "user_strike_count" in <a href="{{ url('admin/settings') }}">Site Settings</a>).</p>

@if (!count($mails))
<p>No mail found.</p>
@else
{!! $mails->render() !!}

<div class="row ml-md-2">
<div class="d-flex row flex-wrap col-12 mt-1 pt-1 px-0 ubt-bottom">
<div class="col-12 col-md-2 font-weight-bold">Subject</div>
<div class="col-6 col-md-3 font-weight-bold">To</div>
<div class="col-6 col-md-4 font-weight-bold">Sent</div>
<div class="col-6 col-md-2 font-weight-bold">Seen</div>
<div class="col-12 col-md-1 font-weight-bold">Details</div>
<p>No mail found.</p>
@else
{!! $mails->render() !!}
<div class="row ml-md-2">
<div class="d-flex row flex-wrap col-12 mt-1 pt-1 px-0 ubt-bottom">
<div class="col-12 col-md-2 font-weight-bold">Subject</div>
<div class="col-6 col-md-3 font-weight-bold">To</div>
<div class="col-6 col-md-4 font-weight-bold">Sent</div>
<div class="col-6 col-md-2 font-weight-bold">Seen</div>
<div class="col-12 col-md-1 font-weight-bold">Details</div>
</div>
</div>

@foreach ($mails as $mail)
<div class="d-flex row flex-wrap col-12 mt-1 pt-1 px-0 ubt-top">
<div class="d-flex row flex-wrap col-12 mt-1 pt-1 px-0 ubt-top">
<div class="col-12 col-md-2">
{{ $mail->subject }}
</div>
Expand All @@ -43,9 +42,7 @@
<a href="{{ url('admin/mail/view') }}/{{ $mail->id }}" class="btn btn-primary btn-sm py-0 px-1">Details</a>
</div>
</div>
@endforeach
</div>

@endforeach
{!! $mails->render() !!}
<div class="text-center mt-4 small text-muted">{{ $mails->total() }} result{{ $mails->total() == 1 ? '' : 's' }} found.</div>
@endif
Expand Down
12 changes: 6 additions & 6 deletions resources/views/admin/mail/mail.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@
</div>
<div class="card-body">
@if (Auth::check() && Auth::user()->isStaff)
<p class="float-right ml-5">From: {!! $mail->staff->displayName !!} {!! add_help('Not viewable by users.') !!}</p>
@endif
<p class="float-right ml-5">From: {!! $mail->staff->displayName !!} {!! add_help('Not viewable by users.') !!}</p>
@endif
<p>To: {!! $mail->user->displayName !!} {!! $mail->seen ? '<i class="fas fa-eye text-success"></i>' : '<i class="fas fa-eye-slash text-danger"></i>' !!}</p>
<hr>
<p>{!! $mail->message !!}</p>
<hr>
<div class="card-text {!! $mail->issue_strike ? 'text-danger' : 'text-secondary' !!} float-right">
@if (!$mail->issue_strike)
<h5>No Strike Issued</h5>
@else
<h5>Strike{{ $mail->strike_count > 1 ? 's' : '' }} Issued</h5>
<h5>No Strike Issued</h5>
@else
<h5>Strike{{ $mail->strike_count > 1 ? 's' : '' }} Issued</h5>
<strong>Amount:</strong> {{ $mail->strike_count }}
@endif
@endif
</div>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions resources/views/home/mail/create_user_mail.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

{!! Form::close() !!}

@endsection
@section('scripts')
<script>
$(document).ready(function() {
$('#usernameList').selectize();
Expand Down
4 changes: 2 additions & 2 deletions resources/views/home/mail/mail.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
{!! $mail->message !!}
</div>
@if ($mail->issue_strike)
<hr>
<hr>
<div class="card-text text-danger float-right">
<h5>Strike{{ $mail->strike_count > 1 ? 's' : '' }} issued</h5>
<strong>Amount:</strong> {{ $mail->strike_count }}
</div>
@endif
@endif
</div>
</div>
@endsection
121 changes: 59 additions & 62 deletions resources/views/home/mail/mail_index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,101 +28,99 @@
</li>
</ul>
<div class="tab-content" id="inboxTypeContent">
<div class="tab-pane fade show active" id="inbox" role="tabpanel">
<div class="tab-pane fade show active" id="inbox" role="tabpanel">
@if (count($inbox))
<div class="row ml-md-2">
<div class="row ml-md-2">
<div class="d-flex row flex-wrap col-12 mt-1 pt-1 px-0 ubt-bottom">
<div class="col-12 col-md-2 font-weight-bold">Subject</div>
<div class="col-6 col-md-3 font-weight-bold">Message</div>
<div class="col-6 col-md-4 font-weight-bold">From</div>
<div class="col-6 col-md-2 font-weight-bold">Seen</div>
<div class="col-12 col-md-1 font-weight-bold">Details</div>
</div>

@foreach ($inbox as $mail)
<div class="d-flex row flex-wrap col-12 mt-1 pt-1 px-0 ubt-top">
<div class="col-12 col-md-2">{!! $mail->displayName !!}</div>
<div class="col-6 col-md-3">
<span class="ubt-texthide">{{ Illuminate\Support\Str::limit($mail->message, 50, $end = '...') }}</span>
</div>
<div class="col-6 col-md-4">{!! $mail->sender->displayName !!} {!! pretty_date($mail->created_at) !!}</div>
<div class="col-6 col-md-2">{!! $mail->seen ? '<i class="fas fa-check text-success"></i>' : '<i class="fas fa-times text-danger"></i>' !!}</div>
<div class="col-12 col-md-1">
<a href="{{ $mail->viewUrl }}" class="btn btn-primary btn-sm py-0 px-1">Details</a>
</div>
</div>
@foreach ($inbox as $mail)
<div class="d-flex row flex-wrap col-12 mt-1 pt-1 px-0 ubt-top">
<div class="col-12 col-md-2">{!! $mail->displayName !!}</div>
<div class="col-6 col-md-3">
<span class="ubt-texthide">{{ Illuminate\Support\Str::limit($mail->message, 50, $end = '...') }}</span>
</div>
<div class="col-6 col-md-4">{!! $mail->sender->displayName !!} {!! pretty_date($mail->created_at) !!}</div>
<div class="col-6 col-md-2">{!! $mail->seen ? '<i class="fas fa-check text-success"></i>' : '<i class="fas fa-times text-danger"></i>' !!}</div>
<div class="col-12 col-md-1">
<a href="{{ $mail->viewUrl }}" class="btn btn-primary btn-sm py-0 px-1">Details</a>
</div>
@endforeach
</div>
</div>
@endforeach
<div class="text-center mt-4 small text-muted">{{ $inbox->count() }} result{{ $inbox->count() == 1 ? '' : 's' }} found.</div>
@else
<p>Your inbox is empty.</p>
@endif
</div>
<div class="tab-pane fade" id="outbox" role="tabpanel">
@else
<p>Your inbox is empty.</p>
@endif
</div>
<div class="tab-pane fade" id="outbox" role="tabpanel">
@if (count($outbox))
<div class="row ml-md-2">
<div class="row ml-md-2">
<div class="d-flex row flex-wrap col-12 mt-1 pt-1 px-0 ubt-bottom">
<div class="col-12 col-md-2 font-weight-bold">Subject</div>
<div class="col-6 col-md-3 font-weight-bold">Message</div>
<div class="col-6 col-md-4 font-weight-bold">To</div>
<div class="col-6 col-md-2 font-weight-bold">Seen</div>
<div class="col-12 col-md-1 font-weight-bold">Details</div>
</div>

@foreach ($outbox as $mail)
<div class="d-flex row flex-wrap col-12 mt-1 pt-1 px-0 ubt-top">
<div class="col-12 col-md-2">{!! $mail->displayName !!}</div>
<div class="col-6 col-md-3">
<span class="ubt-texthide">{{ Illuminate\Support\Str::limit($mail->message, 50, $end = '...') }}</span>
</div>
<div class="col-6 col-md-4">{!! $mail->recipient->displayName !!} {!! pretty_date($mail->created_at) !!}</div>
<div class="col-6 col-md-2">{!! $mail->seen ? '<i class="fas fa-check text-success"></i>' : '<i class="fas fa-times text-danger"></i>' !!}</div>
<div class="col-12 col-md-1">
<a href="{{ $mail->viewUrl }}" class="btn btn-primary btn-sm py-0 px-1">Details</a>
</div>
</div>
@foreach ($outbox as $mail)
<div class="d-flex row flex-wrap col-12 mt-1 pt-1 px-0 ubt-top">
<div class="col-12 col-md-2">{!! $mail->displayName !!}</div>
<div class="col-6 col-md-3">
<span class="ubt-texthide">{{ Illuminate\Support\Str::limit($mail->message, 50, $end = '...') }}</span>
</div>
<div class="col-6 col-md-4">{!! $mail->recipient->displayName !!} {!! pretty_date($mail->created_at) !!}</div>
<div class="col-6 col-md-2">{!! $mail->seen ? '<i class="fas fa-check text-success"></i>' : '<i class="fas fa-times text-danger"></i>' !!}</div>
<div class="col-12 col-md-1">
<a href="{{ $mail->viewUrl }}" class="btn btn-primary btn-sm py-0 px-1">Details</a>
</div>
@endforeach
</div>
</div>
@endforeach
<div class="text-center mt-4 small text-muted">{{ $outbox->count() }} result{{ $outbox->count() == 1 ? '' : 's' }} found.</div>
@else
<p>Your outbox is empty.</p>
@endif
</div>
<div class="tab-pane fade" id="modMail" role="tabpanel">
@else
<p>Your outbox is empty.</p>
@endif
</div>
<div class="tab-pane fade" id="modMail" role="tabpanel">
<p class="alert alert-info">
This mail is anonymously sent messages from moderators. {{ config('lorekeeper.mod_mail.can_user_respond_to_staff_mail') ? 'You can respond to staff mail.' : 'It cannot be responded to.' }}
</p>
@if (count($mails))
<div class="row ml-md-2">
<div class="row ml-md-2">
<div class="d-flex row flex-wrap col-12 mt-1 pt-1 px-0 ubt-bottom">
<div class="col-12 col-md-2 font-weight-bold">Subject</div>
<div class="col-6 col-md-3 font-weight-bold">Message</div>
<div class="col-6 col-md-4 font-weight-bold">Sent</div>
<div class="col-6 col-md-2 font-weight-bold">Seen</div>
<div class="col-12 col-md-1 font-weight-bold">Details</div>
</div>

@foreach ($mails as $mail)
<div class="d-flex row flex-wrap col-12 mt-1 pt-1 px-0 ubt-top">
<div class="col-12 col-md-2">{{ $mail->subject }}</div>
<div class="col-6 col-md-3">
<span class="ubt-texthide">{{ Illuminate\Support\Str::limit(strip_tags($mail->message), 50, $end = '...') }}</span>
</div>
<div class="col-6 col-md-4">{!! pretty_date($mail->created_at) !!}</div>
<div class="col-6 col-md-2">{!! $mail->seen ? '<i class="fas fa-check text-success"></i>' : '<i class="fas fa-times text-danger"></i>' !!}</div>
<div class="col-12 col-md-1">
<a href="{{ $mail->viewUrl }}" class="btn btn-primary btn-sm py-0 px-1">Details</a>
</div>
</div>
@foreach ($mails as $mail)
<div class="d-flex row flex-wrap col-12 mt-1 pt-1 px-0 ubt-top">
<div class="col-12 col-md-2">{{ $mail->subject }}</div>
<div class="col-6 col-md-3">
<span class="ubt-texthide">{{ Illuminate\Support\Str::limit(strip_tags($mail->message), 50, $end = '...') }}</span>
</div>
<div class="col-6 col-md-4">{!! pretty_date($mail->created_at) !!}</div>
<div class="col-6 col-md-2">{!! $mail->seen ? '<i class="fas fa-check text-success"></i>' : '<i class="fas fa-times text-danger"></i>' !!}</div>
<div class="col-12 col-md-1">
<a href="{{ $mail->viewUrl }}" class="btn btn-primary btn-sm py-0 px-1">Details</a>
</div>
@endforeach
</div>
</div>
@endforeach
<div class="text-center mt-4 small text-muted">{{ $mails->count() }} result{{ $mails->count() == 1 ? '' : 's' }} found.</div>
@else
<p>No mod mail found.</p>
@endif
</div>
@else
<p>No mod mail found.</p>
@endif
</div>
</div>

@endsection
@section('scripts')
<script>
$(function() {
var hash = window.location.hash;
Expand All @@ -136,5 +134,4 @@
});
});
</script>

@endsection
50 changes: 26 additions & 24 deletions resources/views/home/mail/user_mail.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,43 +32,45 @@
</div>
<div class="collapse card-body pb-0" id="collapseExample">
@if ($mail->parent)
<p><strong>Previous Message:</strong> {!! $mail->parent->displayName !!} ({{ Illuminate\Support\Str::limit($mail->parent->message, 25, $end = '...') }})</p>
@endif
<p>
<strong>Previous Message:</strong> {!! $mail->parent->displayName !!} ({{ Illuminate\Support\Str::limit($mail->parent->message, 25, $end = '...') }})
</p>
@endif
@if ($mail->parent && $mail->children)
<hr/>
@endif
<hr/>
@endif
@if ($mail->children)
@foreach ($mail->children as $child)
<p><strong>Replies:</strong> {!! $child->displayName !!} ({{ Illuminate\Support\Str::limit($child->message, 50, $end = '...') }})</p>
@endforeach
@endif
@foreach ($mail->children as $child)
<p><strong>Replies:</strong> {!! $child->displayName !!} ({{ Illuminate\Support\Str::limit($child->message, 50, $end = '...') }})</p>
@endforeach
@endif
</div>
</div>
@endif

<br>

@if (Auth::user()->id != $mail->sender_id)
{!! Form::open(['url' => 'inbox/new']) !!}
{!! Form::open(['url' => 'inbox/new']) !!}

<div class="form-group">
@if ($mail->children)
{!! Form::label('message', 'Send New Reply') !!}
@else
{!! Form::label('message', 'Send Reply') !!}
@endif
{!! Form::textarea('message', null, ['class' => 'form-control wysiwyg']) !!}
</div>
<div class="form-group">
@if ($mail->children)
{!! Form::label('message', 'Send New Reply') !!}
@else
{!! Form::label('message', 'Send Reply') !!}
@endif
{!! Form::textarea('message', null, ['class' => 'form-control wysiwyg']) !!}
</div>

{{ Form::hidden('parent_id', $mail->id) }}
{{ Form::hidden('subject', $mail->subject) }}
{{ Form::hidden('recipient_id', $mail->sender_id) }}
{{ Form::hidden('parent_id', $mail->id) }}
{{ Form::hidden('subject', $mail->subject) }}
{{ Form::hidden('recipient_id', $mail->sender_id) }}

<div class="text-right">
{!! Form::submit('Submit', ['class' => 'btn btn-primary']) !!}
</div>
<div class="text-right">
{!! Form::submit('Submit', ['class' => 'btn btn-primary']) !!}
</div>

{!! Form::close() !!}
{!! Form::close() !!}
@endif

@endsection

0 comments on commit f9b7f89

Please sign in to comment.