summaryrefslogtreecommitdiff
path: root/views/index.php
blob: b06f20d1f4fc889881b5e854d5eaaf9e8e3fe5e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<div class="narrow">

  <div class="jumbotron h-app h-x-app">
    <h1><img src="/images/quill-logo-144.png" height="72" style="margin-bottom: 13px;" class="u-logo p-name" alt="Quill">Quill</h1>

    <p class="tagline">Quill is a simple app for posting text notes to your website.</p>

    <?php if(session('me')): ?>

      <?php if(profile('photo')): ?>
        <img src="<?= profile('photo'); ?>" height="125" alt="Profile Image" style="border: 1px #bbb solid; border-radius: 12px;" />
      <?php endif ?>
      <?php if(profile('name')): ?>
        <p>Signed in as: <?= htmlspecialchars(profile('name')); ?></p>
      <?php endif ?>
      <?php if(!profile('name') && !profile('photo')): ?>
        <p>You're already signed in!</p>
      <?php endif ?>

      <p><a href="/dashboard" class="btn btn-primary">Continue</a></p>
    <?php else: ?>
      <p>To use Quill, sign in with your domain. Your website will need to support <a href="https://indieweb.org/micropub">Micropub</a> for creating new posts.</p>

      <form action="/auth/start" method="get" class="form-inline">
        <input type="url" name="me" placeholder="https://example.com" value="" class="form-control" onchange="auto_prefix_url_field(this)" autofocus>
        <input type="submit" value="Sign In" class="btn btn-primary">
        <input type="hidden" name="client_id" value="<?= Config::$base_url ?>">
        <input type="hidden" name="redirect_uri" value="<?= Config::$base_url ?>auth/callback">
      </form>
    <?php endif; ?>

    <a href="" class="u-url"></a>
  </div>

</div>