about summary refs log tree commit diff
path: root/web/pwcrypt/src/main.html
blob: b19cbd379b700b2c451e57de752a2b22d62e1bb6 (plain) (blame)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
html!{
<div class="container">
  <h1>{"//web/pwcrypt"}</h1>
  <p>{"You can use this page to create your hashed credentials for a TVL account. Enter your desired username and password below, and send us the output you receive in order for us to create your account."}</p>
  <p>
    {"Detailed documentation about the registration process is "}
    <a href="https://code.tvl.fyi/about/docs/REVIEWS.md#registration">
      {"available here"}
    </a>
    {"."}
  </p>
  <p>{"All of this happens in your browser: Your password does not leave this site!"}</p>

  <form>
    <fieldset>
      <legend>{"Credentials:"}</legend>

      <div class="form-group">
        <label for="username">{"Username:"}</label>
        <input id="username" name="username" type="text"
               oninput={link.callback(|event| input_to_message(event, Msg::SetUsername))} />
      </div>

      <div class="form-group">
        <label for="email">{"Email:"}</label>
        <input id="email" name="email" type="email"
               oninput={link.callback(|event| input_to_message(event, Msg::SetEmail))} />
      </div>

      <div class="form-group">
        <label for="password">{"Password:"}</label>
        <input id="password" name="password" type="password"
               oninput={link.callback(|event| input_to_message(event, Msg::SetPassword))} />
      </div>

      if let Some(missing) = self.whats_missing() {
        <p>{"Please fill in "}{missing}{"."}</p>
      } else {
        <div class="form-group">
          <button class="btn btn-default" type="button"
                  onclick={link.callback(|_| Msg::UpdateCredentials)}>{"Prepare credentials"}</button>
        </div>
      }
    </fieldset>
  </form>
  {self.display_credentials()}
</div>
}