new updates for paddel
This commit is contained in:
@@ -1 +1,113 @@
|
||||
@extends('layouts.app') @section('content')<h1>My licences</h1>@forelse($licenses as $license)<div class="card"><h2>{{ $license->product->name }} · {{ $license->edition }}</h2><p>Licence ending <strong>{{ $license->license_key_last4 }}</strong> · {{ $license->activations->whereNull('deactivated_at')->count() }}/{{ $license->activation_limit }} activations</p><p class="{{ $license->is_usable ? 'ok':'bad' }}">{{ $license->is_usable ? 'Active':'Unavailable' }}</p><a class="btn" href="{{ route('portal.show',$license) }}">Manage</a></div>@empty<div class="card">No licences are associated with {{ auth()->user()->email }}.</div>@endforelse@endsection
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<section class="portal-header">
|
||||
<div>
|
||||
<span class="eyebrow">Account</span>
|
||||
<h1>My licences</h1>
|
||||
<p class="lead compact">Manage subscriptions, licence keys and activated Macs.</p>
|
||||
</div>
|
||||
<a class="btn btn-secondary" href="{{ route('buy') }}">Buy another licence</a>
|
||||
</section>
|
||||
|
||||
@php
|
||||
$activeLicences = $licenses->filter(fn ($license) => $license->is_usable);
|
||||
$historyLicences = $licenses->reject(fn ($license) => $license->is_usable);
|
||||
@endphp
|
||||
|
||||
@if($activeLicences->isEmpty())
|
||||
<div class="empty-state">
|
||||
<h2>No active licences</h2>
|
||||
<p>No active Rsync Studio licence is associated with {{ auth()->user()->email }}.</p>
|
||||
<a class="btn" href="{{ route('buy') }}">Choose a plan</a>
|
||||
</div>
|
||||
@else
|
||||
<div class="licence-list">
|
||||
@foreach($activeLicences as $license)
|
||||
@php
|
||||
$activeCount = $license->activations->whereNull('deactivated_at')->count();
|
||||
$isDuplicatePersonal = $hasProfessional && $license->edition === 'Personal';
|
||||
$billing = str_contains(strtolower((string) optional($license->product)->code), 'annual') ? 'Annual' : 'Monthly';
|
||||
@endphp
|
||||
<article class="licence-card {{ $license->edition === 'Professional' ? 'licence-card-featured' : '' }}">
|
||||
<div class="licence-main">
|
||||
<div class="licence-title-row">
|
||||
<div>
|
||||
<div class="badge-row">
|
||||
<span class="status-badge status-active">Active</span>
|
||||
<span class="plan-badge">{{ $license->edition }}</span>
|
||||
<span class="billing-badge">{{ $billing }}</span>
|
||||
</div>
|
||||
<h2>Rsync Studio {{ $license->edition }}</h2>
|
||||
<p class="muted licence-key">Licence ending <strong>{{ $license->license_key_last4 }}</strong></p>
|
||||
</div>
|
||||
<a class="btn btn-secondary" href="{{ route('portal.show', $license) }}">Manage licence</a>
|
||||
</div>
|
||||
|
||||
<div class="licence-stats">
|
||||
<div>
|
||||
<span class="stat-label">Macs activated</span>
|
||||
<strong>{{ $activeCount }} of {{ $license->activation_limit }}</strong>
|
||||
</div>
|
||||
<div>
|
||||
<span class="stat-label">Subscription</span>
|
||||
<strong>{{ ucfirst($license->subscription_status ?: 'active') }}</strong>
|
||||
</div>
|
||||
<div>
|
||||
<span class="stat-label">{{ $license->subscription_status === 'trialing' ? 'Trial ends' : 'Renews' }}</span>
|
||||
<strong>{{ optional($license->current_period_ends_at)->format('j M Y') ?: '—' }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="activation-meter" aria-label="{{ $activeCount }} of {{ $license->activation_limit }} Macs activated">
|
||||
<span style="width: {{ min(100, ($activeCount / max(1, $license->activation_limit)) * 100) }}%"></span>
|
||||
</div>
|
||||
|
||||
@if($isDuplicatePersonal)
|
||||
<div class="subscription-warning">
|
||||
<div>
|
||||
<strong>You already have an active Professional subscription.</strong>
|
||||
<p>This Personal plan is a separate Paddle subscription and could be billed separately. Cancel it if it was only created while upgrading.</p>
|
||||
</div>
|
||||
<form method="post" action="{{ route('portal.cancel', $license) }}" onsubmit="return confirm('Cancel this Personal subscription immediately in Paddle? This cannot be undone.');">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button class="danger">Cancel Personal</button>
|
||||
</form>
|
||||
</div>
|
||||
@elseif($license->edition === 'Personal')
|
||||
<div class="upgrade-strip">
|
||||
<div>
|
||||
<strong>Need more Macs?</strong>
|
||||
<span>Upgrade this subscription to Professional for up to 3 Macs.</span>
|
||||
</div>
|
||||
<form method="post" action="{{ route('portal.upgrade', $license) }}" onsubmit="return confirm('Upgrade this existing Paddle subscription to Professional now? Paddle will prorate the change.');">
|
||||
@csrf
|
||||
<button>Upgrade to Professional</button>
|
||||
</form>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</article>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($historyLicences->isNotEmpty())
|
||||
<details class="history-panel">
|
||||
<summary>Licence history <span>{{ $historyLicences->count() }}</span></summary>
|
||||
<div class="history-list">
|
||||
@foreach($historyLicences as $license)
|
||||
<div class="history-row">
|
||||
<div>
|
||||
<strong>Rsync Studio {{ $license->edition }}</strong>
|
||||
<span>Licence ending {{ $license->license_key_last4 }}</span>
|
||||
</div>
|
||||
<div class="history-status">{{ ucfirst($license->subscription_status ?: ($license->revoked_at ? 'revoked' : 'unavailable')) }}</div>
|
||||
<a href="{{ route('portal.show', $license) }}">Details</a>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</details>
|
||||
@endif
|
||||
@endsection
|
||||
|
||||
@@ -1 +1,80 @@
|
||||
@extends('layouts.app') @section('content')<div class="card"><h1>{{ $license->product->name }}</h1><p>{{ $license->edition }} · key ending {{ $license->license_key_last4 }}</p><form method="post" action="{{ route('portal.resend',$license) }}">@csrf<button>Email my licence key</button></form></div><div class="card"><h2>Installations</h2><table><tr><th>Installation</th><th>Platform</th><th>Version</th><th>Last seen</th><th></th></tr>@foreach($license->activations->whereNull('deactivated_at') as $a)<tr><td>{{ $a->installation_name ?: $a->installation_id }}</td><td>{{ $a->platform }}</td><td>{{ $a->app_version }}</td><td>{{ optional($a->last_seen_at)->toDayDateTimeString() }}</td><td><form method="post" action="{{ route('portal.deactivate',[$license,$a->id]) }}">@csrf @method('DELETE')<button class="danger">Deactivate</button></form></td></tr>@endforeach</table></div>@endsection
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
@php
|
||||
$activeActivations = $license->activations->whereNull('deactivated_at');
|
||||
$billing = str_contains(strtolower((string) optional($license->product)->code), 'annual') ? 'Annual' : 'Monthly';
|
||||
@endphp
|
||||
|
||||
<a class="back-link" href="{{ route('portal.index') }}">← My licences</a>
|
||||
|
||||
<section class="licence-detail-head">
|
||||
<div>
|
||||
<div class="badge-row">
|
||||
<span class="status-badge {{ $license->is_usable ? 'status-active' : 'status-inactive' }}">{{ $license->is_usable ? 'Active' : 'Unavailable' }}</span>
|
||||
<span class="plan-badge">{{ $license->edition }}</span>
|
||||
<span class="billing-badge">{{ $billing }}</span>
|
||||
</div>
|
||||
<h1>Rsync Studio {{ $license->edition }}</h1>
|
||||
<p class="muted">Licence ending <strong>{{ $license->license_key_last4 }}</strong></p>
|
||||
</div>
|
||||
<form method="post" action="{{ route('portal.resend', $license) }}">
|
||||
@csrf
|
||||
<button class="btn-secondary">Email licence key</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<div class="detail-grid">
|
||||
<section class="panel">
|
||||
<div class="panel-heading">
|
||||
<div>
|
||||
<h2>Activated Macs</h2>
|
||||
<p>{{ $activeActivations->count() }} of {{ $license->activation_limit }} activation slots in use.</p>
|
||||
</div>
|
||||
<span class="activation-count">{{ $activeActivations->count() }}/{{ $license->activation_limit }}</span>
|
||||
</div>
|
||||
|
||||
@forelse($activeActivations as $activation)
|
||||
<div class="device-row">
|
||||
<div class="device-icon">⌘</div>
|
||||
<div class="device-copy">
|
||||
<strong>{{ $activation->installation_name ?: 'Mac' }}</strong>
|
||||
<span>{{ $activation->platform ?: 'macOS' }}@if($activation->app_version) · Rsync Studio {{ $activation->app_version }}@endif</span>
|
||||
<small>Last seen {{ optional($activation->last_seen_at)->diffForHumans() ?: 'not yet recorded' }}</small>
|
||||
</div>
|
||||
<form method="post" action="{{ route('portal.deactivate', [$license, $activation->id]) }}" onsubmit="return confirm('Deactivate this Mac? Rsync Studio on that Mac will lose access when it next validates.');">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button class="danger-outline">Deactivate</button>
|
||||
</form>
|
||||
</div>
|
||||
@empty
|
||||
<div class="empty-inline">No Macs are currently activated with this licence.</div>
|
||||
@endforelse
|
||||
</section>
|
||||
|
||||
<aside class="panel subscription-panel">
|
||||
<h2>Subscription</h2>
|
||||
<dl class="subscription-facts">
|
||||
<div><dt>Plan</dt><dd>{{ $license->edition }} {{ $billing }}</dd></div>
|
||||
<div><dt>Status</dt><dd>{{ ucfirst($license->subscription_status ?: 'active') }}</dd></div>
|
||||
<div><dt>{{ $license->subscription_status === 'trialing' ? 'Trial ends' : 'Current period ends' }}</dt><dd>{{ optional($license->current_period_ends_at)->format('j M Y') ?: '—' }}</dd></div>
|
||||
</dl>
|
||||
|
||||
@if($license->edition === 'Personal' && $license->is_usable)
|
||||
<form method="post" action="{{ route('portal.upgrade', $license) }}" onsubmit="return confirm('Upgrade this existing Paddle subscription to Professional now? Paddle will prorate the change.');">
|
||||
@csrf
|
||||
<button class="full-width">Upgrade to Professional</button>
|
||||
</form>
|
||||
@endif
|
||||
|
||||
@if($license->payment_provider === 'paddle' && $license->external_subscription_id && $license->subscription_status !== 'canceled')
|
||||
<form method="post" action="{{ route('portal.cancel', $license) }}" onsubmit="return confirm('Cancel this Paddle subscription immediately? This cannot be undone.');">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button class="danger-outline full-width">Cancel subscription</button>
|
||||
</form>
|
||||
@endif
|
||||
</aside>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user