Including Alert me!

This commit is contained in:
2018-09-15 02:09:07 -03:00
parent c4bd6a8a1a
commit a173e3923a
7 changed files with 107 additions and 4 deletions

View File

@@ -0,0 +1,12 @@
@component('mail::message')
Hi, {{$username}},
&nbsp;<br>
&nbsp;<br>
#Good news: {{$item->name}} is available!
&nbsp;<br>
The item <em>{{$item->name}} ({{$item->product->name}})</em> is now available on **Share&nbsp;It**.
&nbsp;<br>
&nbsp;<br>
<a href="https://shareit.brunofontes.net/home">Take it</a> before anyone else.
@endcomponent

View File

@@ -15,10 +15,21 @@
<form action="/alert" method="POST">
{{ csrf_field() }}
<input type="hidden" name="item" value="{{$item->id}}">
<button type="submit" class="btn btn-sm btn-outline-secondary">Alert me</button>
@if ($item->waiting_user_id == \Auth::id())
@method('DELETE')
<button type="submit" class="btn btn-sm btn-outline-danger">Cancel Alert</button>
@elseif (!$item->waiting_user_id)
<button type="submit" class="btn btn-sm btn-outline-secondary">Alert me</button>
@endif
</form>
</span>
<span class="float-right mr-3">
<em>{{str_limit($users[$item->used_by], 15, '...')}} ({{$item->updated_at->diffForHumans()}})</em>
<em>
{{str_limit($users[$item->used_by], 15, '...')}}
@if ($item->waiting_user_id && $item->waiting_user_id != \Auth::id())
<strong>> {{str_limit($users[$item->waiting_user_id], 15, '...')}}</strong>
@endif
<small>({{$item->updated_at->diffForHumans()}})</small>
</em>
</span>
@endif