Working on UI redesign
Added recent orders to organiser dashboard
This commit is contained in:
parent
03e491994c
commit
cd5979f8f1
|
|
@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
|||
|
||||
use App\Models\Organiser;
|
||||
use Carbon\Carbon;
|
||||
use DB;
|
||||
|
||||
class OrganiserDashboardController extends MyBaseController
|
||||
{
|
||||
|
|
@ -17,7 +18,6 @@ class OrganiserDashboardController extends MyBaseController
|
|||
{
|
||||
$organiser = Organiser::scope()->findOrFail($organiser_id);
|
||||
$upcoming_events = $organiser->events()->where('end_date', '>=', Carbon::now())->get();
|
||||
|
||||
$data = [
|
||||
'organiser' => $organiser,
|
||||
'upcoming_events' => $upcoming_events,
|
||||
|
|
|
|||
|
|
@ -49,6 +49,16 @@ class Organiser extends MyBaseModel
|
|||
return $this->hasManyThrough('\App\Models\Attendee', '\App\Models\Event');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the orders related to an organiser
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasManyThrough
|
||||
*/
|
||||
public function orders()
|
||||
{
|
||||
return $this->hasManyThrough('\App\Models\Order', '\App\Models\Event');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the full logo path of the organizer.
|
||||
*
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -67,6 +67,7 @@
|
|||
height: @header-height-md - 1;
|
||||
line-height: @header-height-md;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -272,6 +273,21 @@
|
|||
}
|
||||
|
||||
|
||||
@media(max-width: @screen-sm-max) {
|
||||
#header.navbar {
|
||||
> .navbar-toolbar {
|
||||
> .navbar-nav {
|
||||
> li {
|
||||
> a {
|
||||
color: @white;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Extra small devices */
|
||||
|
||||
@media(min-width: 180px) and (max-width: @screen-xs-max) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
position: relative;
|
||||
z-index: 1030;
|
||||
width: 100%;
|
||||
background-color: @white;
|
||||
background-color: @attendize-base-color;
|
||||
height: @header-height;
|
||||
border-width: 0px;
|
||||
border-radius: 0px;
|
||||
|
|
|
|||
|
|
@ -66,17 +66,46 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($upcoming_events->count())
|
||||
<h4 style="margin-bottom: 25px;margin-top: 20px;">Upcoming Events</h4>
|
||||
<div class="row">
|
||||
@foreach($upcoming_events as $event)
|
||||
<div class="col-md-6 col-sm-6 col-xs-12">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h4 style="margin-bottom: 25px;margin-top: 20px;">Upcoming Events</h4>
|
||||
@if($upcoming_events->count())
|
||||
@foreach($upcoming_events as $event)
|
||||
@include('ManageOrganiser.Partials.EventPanel')
|
||||
@endforeach
|
||||
@else
|
||||
<div class="alert alert-success alert-lg">
|
||||
You have no events coming up. <a href="#"
|
||||
data-href="{{route('showCreateEvent', ['organiser_id' => $organiser->id])}}"
|
||||
class=" loadModal">You can click here to create an event.</a>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
</div>
|
||||
@else
|
||||
@include('ManageOrganiser.Partials.EventsBlankSlate')
|
||||
@endif
|
||||
<div class="col-md-6">
|
||||
<h4 style="margin-bottom: 25px;margin-top: 20px;">Recent Orders</h4>
|
||||
<ul class="list-group">
|
||||
@foreach($organiser->orders()->orderBy('created_at', 'desc')->take(30)->get() as $order)
|
||||
<li class="list-group-item">
|
||||
<h6 class="ellipsis">
|
||||
{{ $order->event->title }}
|
||||
</h6>
|
||||
<p class="list-group-text">
|
||||
<a href="{{ route('showEventOrders', ['event_id' => $order->event_id, 'q' => $order->order_reference]) }}">
|
||||
<b>#{{ $order->order_reference }}</b></a> - {{ $order->full_name }}
|
||||
registered {{ $order->attendees()->withTrashed()->count() }} tickets.
|
||||
|
||||
</p>
|
||||
<h6>
|
||||
{{ $order->created_at->diffForHumans() }} • <span
|
||||
style="color: green;">{{ $order->event->currency_symbol }}{{ $order->amount }}</span>
|
||||
</h6>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
|
|
|||
Loading…
Reference in New Issue