aboutsummaryrefslogtreecommitdiff
path: root/shardweb/lib/shard_web/templates/identity/view.html.eex
blob: b9210f291768fb0497687350e7fcf1e9440a5213 (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
<h4>Identity</h4>

<%= form_for @conn, identity_path(@conn, :update), [class: "form-horizontal"], fn f -> %>
  <div class="form-group">
    <label class="col-sm-2 control-label">Public key:</label>
    <div class="col-sm-10">
      <input type="text" value="<%= @pk |> Base.encode16 %>" class="form-control" disabled />
    </div>
  </div>
  <div class="form-group">
    <%= label :nick, "Nickname:", class: ["col-sm-2 control-label"] %>
    <div class="col-sm-10">
      <%= text_input f, :nick, [class: "form-control", value: @nick] %>
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <%= submit "Update", [class: "btn btn-default"] %>
    </div>
  </div>
<% end %>

<h4>Other identities</h4>

<ul>
  <%= for pk2 <- identity_list(), pk2 != @pk do %>
    <li>
      <%= form_for @conn, identity_path(@conn, :switch), [class: "form-inline"], fn f -> %>
        <%= hidden_input f, :pk, value: (pk2 |> Base.encode16) %>
        <%= submit "Switch to", [class: "btn btn-xs btn-success"] %>
        <strong><%= get_nick pk2 %></strong>
        <small><%= pk2 |> Base.encode16 %></small>
      <% end %>
    </li>
  <% end %>
</ul>

<%= form_for @conn, identity_path(@conn, :create), [class: "form-inline"], fn f -> %>
  <%= submit "Create new identity", [class: "btn btn-danger"] %>
<% end %>