You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
2.3 KiB

  1. <?php $this->layout('layout-loggedin', ['title' => $title, 'accounts' => $accounts, 'user' => $user]); ?>
  2. <div class="ui main text container" style="margin-top: 80px; margin-bottom: 40px;">
  3. <?php if($site): ?>
  4. <h2>Edit Site</h2>
  5. <?php else: ?>
  6. <h2>Create a New Site</h2>
  7. <p>Create a new site to help organize your webmentions. Each site has its own API key for sending webmentions, or for receiving mentions from Superfeedr.</p>
  8. <?php endif; ?>
  9. <form action="/site/save" method="post" class="ui form">
  10. <div class="field">
  11. <label>Name</label>
  12. <input type="text" name="name" value="<?= $site ? $site->name : '' ?>">
  13. </div>
  14. <div class="field">
  15. <label>URL</label>
  16. <input type="url" name="url" placeholder="http://example.com/" value="<?= $site ? $site->url : '' ?>">
  17. </div>
  18. <button class="ui button"><?= $site ? 'Save' : 'Create' ?> Site</button>
  19. <input type="hidden" name="account" value="<?= $site ? $site->id : '' ?>">
  20. </form>
  21. <p style="margin-top: 1em;">Enter your website's home page URL above, and you will be able to receive webmentions from a Superfeedr tracking feed to that domain.</p>
  22. <?php if($site): ?>
  23. <form class="ui form">
  24. <div class="field">
  25. <label>API Key</label>
  26. <input type="text" readonly="" value="<?= $role->token ?>">
  27. <p>Use this key when sending webmentions using the <a href="/api">API</a>.</p>
  28. </div>
  29. <div class="field">
  30. <label>Superfeedr Webhook URL</label>
  31. <input type="text" readonly="" value="<?= Config::$base ?>superfeedr/<?= $role->token ?>">
  32. <p>Create a <a href="/superfeedr">Superfeedr tracker</a> subscription and set this URL as the web hook URL.</p>
  33. <p>If you are using Telegraph to send webmentions as well as receive webmentions from Superfeedr, it is recommended you create a separate site for Superfeedr so you can more easily separate the two uses of the service.</p>
  34. </div>
  35. <div class="field">
  36. <label>Superfeedr Topic URL</label>
  37. <input type="text" readonly="" value="http://track.superfeedr.com/?query=link%3A<?= parse_url($site->url, PHP_URL_HOST) ?>">
  38. <p>Your Superfeedr tracker subscription should have this topic URL.</p>
  39. </div>
  40. </form>
  41. <?php endif; ?>
  42. </div>