Browse Source

show unsubscribe status

master
Aaron Parecki 9 years ago
parent
commit
f449a9dde2
3 changed files with 22 additions and 7 deletions
  1. +1
    -0
      lib/PushTask.php
  2. +7
    -0
      public/css/style.css
  3. +14
    -7
      views/subscription-status.php

+ 1
- 0
lib/PushTask.php View File

@ -47,6 +47,7 @@ class PushTask {
echo "Subscriber verified the request and is now subscribed\n";
} else {
$subscription->date_unsubscribed = db\now();
$subscription->date_expires = null;
$subscription->active = 0;
echo "Subscriber verified the request and is now unsubscribed\n";
}

+ 7
- 0
public/css/style.css View File

@ -64,6 +64,13 @@ body.logged-out {
font-size: 18px;
}
.subscription-status {
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
border: 1px #ccc solid;
}
/**
* Bootstrap callouts

+ 14
- 7
views/subscription-status.php View File

@ -1,4 +1,4 @@
<div class="narrow">
<div class="narrow subscription-status">
<? if($this->subscription->active): ?>
<div class="bs bs-callout bs-callout-success">This subscription is active!</div>
@ -22,18 +22,25 @@
<td><?= $this->subscription->date_requested ? friendly_date($this->subscription->date_requested, $tz) : '' ?></td>
</tr>
<tr>
<td>Subscription Verification Response (from your server)</td>
<td>Subscription Verification Response<br>(from your server)</td>
<td><pre><?= htmlspecialchars($this->subscription->challenge_response) ?></pre></td>
</tr>
<tr>
<td>Date Subscription was Confirmed</td>
<td><?= $this->subscription->date_confirmed ? friendly_date($this->subscription->date_confirmed, $tz) : '' ?></td>
</tr>
<tr>
<td>Subscription Expiration</td>
<td><?= $this->subscription->date_expires ? friendly_date($this->subscription->date_expires, $tz) : '' ?></td>
</tr>
<? if($this->subscription->date_unsubscribed): ?>
<tr>
<td>Date Unsubscribed</td>
<td><?= friendly_date($this->subscription->date_unsubscribed, $tz) ?></td>
</tr>
<? endif; ?>
<? if($this->subscription->date_expires): ?>
<tr>
<td>Subscription Expiration</td>
<td><?= friendly_date($this->subscription->date_expires, $tz) ?></td>
</tr>
<? endif; ?>
</table>

Loading…
Cancel
Save