|
| 1 | +@extends('sendportal::layouts.app') |
| 2 | + |
| 3 | +@section('title', __('Campaigns')) |
| 4 | + |
| 5 | +@section('heading') |
| 6 | + {{ __('Campaigns') }} |
| 7 | +@endsection |
| 8 | + |
| 9 | +@section('content') |
| 10 | + |
| 11 | + @include('sendportal::campaigns.partials.nav') |
| 12 | + |
| 13 | + @component('sendportal::layouts.partials.actions') |
| 14 | + @slot('right') |
| 15 | + <a class="btn btn-primary btn-md btn-flat" href="{{ route('sendportal.campaigns.create') }}"> |
| 16 | + <i class="fa fa-plus mr-1"></i> {{ __('New Campaign') }} |
| 17 | + </a> |
| 18 | + @endslot |
| 19 | + @endcomponent |
| 20 | + |
| 21 | + <div class="card"> |
| 22 | + <div class="card-table table-responsive"> |
| 23 | + <table class="table"> |
| 24 | + <thead> |
| 25 | + <tr> |
| 26 | + <th>{{ __('Name') }}</th> |
| 27 | + @if (request()->routeIs('sendportal.campaigns.sent')) |
| 28 | + <th>{{ __('Sent') }}</th> |
| 29 | + <th>{{ __('Opened') }}</th> |
| 30 | + <th>{{ __('Clicked') }}</th> |
| 31 | + @endif |
| 32 | + <th>{{ __('Created') }}</th> |
| 33 | + <th>{{ __('Status') }}</th> |
| 34 | + <th>{{ __('Actions') }}</th> |
| 35 | + </tr> |
| 36 | + </thead> |
| 37 | + <tbody> |
| 38 | + @forelse($campaigns as $campaign) |
| 39 | + <tr> |
| 40 | + <td> |
| 41 | + @if ($campaign->draft) |
| 42 | + <a href="{{ route('sendportal.campaigns.edit', $campaign->id) }}">{{ $campaign->name }}</a> |
| 43 | + @elseif($campaign->sent) |
| 44 | + <a href="{{ route('sendportal.campaigns.reports.index', $campaign->id) }}">{{ $campaign->name }}</a> |
| 45 | + @else |
| 46 | + <a href="{{ route('sendportal.campaigns.status', $campaign->id) }}">{{ $campaign->name }}</a> |
| 47 | + @endif |
| 48 | + </td> |
| 49 | + @if (request()->routeIs('sendportal.campaigns.sent')) |
| 50 | + <td>{{ $campaignStats[$campaign->id]['counts']['sent'] }}</td> |
| 51 | + <td>{{ number_format($campaignStats[$campaign->id]['ratios']['open'] * 100, 1) . '%' }}</td> |
| 52 | + <td> |
| 53 | + {{ number_format($campaignStats[$campaign->id]['ratios']['click'] * 100, 1) . '%' }} |
| 54 | + </td> |
| 55 | + @endif |
| 56 | + <td><span title="{{ $campaign->created_at }}">{{ $campaign->created_at->diffForHumans() }}</span></td> |
| 57 | + <td> |
| 58 | + @include('sendportal::campaigns.partials.status') |
| 59 | + </td> |
| 60 | + <td> |
| 61 | + <div class="dropdown"> |
| 62 | + <button class="btn btn-light btn-sm btn-wide" type="button" id="dropdownMenuButton" |
| 63 | + data-toggle="dropdown" data-boundary="viewport" aria-haspopup="true" aria-expanded="false"> |
| 64 | + <i class="fas fa-ellipsis-h"></i> |
| 65 | + </button> |
| 66 | + <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> |
| 67 | + @if ($campaign->draft) |
| 68 | + <a href="{{ route('sendportal.campaigns.edit', $campaign->id) }}" |
| 69 | + class="dropdown-item"> |
| 70 | + {{ __('Edit') }} |
| 71 | + </a> |
| 72 | + @else |
| 73 | + <a href="{{ route('sendportal.campaigns.reports.index', $campaign->id) }}" |
| 74 | + class="dropdown-item"> |
| 75 | + {{ __('View Report') }} |
| 76 | + </a> |
| 77 | + @endif |
| 78 | + |
| 79 | + <a href="{{ route('sendportal.campaigns.duplicate', $campaign->id) }}" |
| 80 | + class="dropdown-item"> |
| 81 | + {{ __('Duplicate') }} |
| 82 | + </a> |
| 83 | + |
| 84 | + @if($campaign->canBeCancelled()) |
| 85 | + <div class="dropdown-divider"></div> |
| 86 | + <a href="{{ route('sendportal.campaigns.confirm-cancel', $campaign->id) }}" |
| 87 | + class="dropdown-item"> |
| 88 | + {{ __('Cancel') }} |
| 89 | + </a> |
| 90 | + @endif |
| 91 | + |
| 92 | + @if ($campaign->draft) |
| 93 | + <div class="dropdown-divider"></div> |
| 94 | + <a href="{{ route('sendportal.campaigns.destroy.confirm', $campaign->id) }}" |
| 95 | + class="dropdown-item"> |
| 96 | + {{ __('Delete') }} |
| 97 | + </a> |
| 98 | + @endif |
| 99 | + </div> |
| 100 | + </div> |
| 101 | + </td> |
| 102 | + </tr> |
| 103 | + @empty |
| 104 | + <tr> |
| 105 | + <td colspan="100%"> |
| 106 | + <p class="empty-table-text"> |
| 107 | + @if (request()->routeIs('sendportal.campaigns.index')) |
| 108 | + {{ __('You do not have any draft campaigns.') }} |
| 109 | + @else |
| 110 | + {{ __('You do not have any sent campaigns.') }} |
| 111 | + @endif |
| 112 | + </p> |
| 113 | + </td> |
| 114 | + </tr> |
| 115 | + @endforelse |
| 116 | + </tbody> |
| 117 | + </table> |
| 118 | + </div> |
| 119 | + </div> |
| 120 | + |
| 121 | + @include('sendportal::layouts.partials.pagination', ['records' => $campaigns]) |
| 122 | + |
| 123 | +@endsection |
0 commit comments