aboutsummaryrefslogtreecommitdiff
path: root/shardweb/lib/shard_web/templates/identity/view.html.eex
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2018-09-26 18:14:32 +0200
committerAlex Auvolat <alex@adnab.me>2018-09-26 18:14:32 +0200
commit26629dc30a116204263ac4b515600649ba742ba0 (patch)
treea066688ce44e028abd188867bc92b72496d4893a /shardweb/lib/shard_web/templates/identity/view.html.eex
parent1a13285971ef728109011a93e676e26248b30242 (diff)
downloadshard-26629dc30a116204263ac4b515600649ba742ba0.tar.gz
shard-26629dc30a116204263ac4b515600649ba742ba0.zip
Web UI for multiple identities
Diffstat (limited to 'shardweb/lib/shard_web/templates/identity/view.html.eex')
-rw-r--r--shardweb/lib/shard_web/templates/identity/view.html.eex40
1 files changed, 40 insertions, 0 deletions
diff --git a/shardweb/lib/shard_web/templates/identity/view.html.eex b/shardweb/lib/shard_web/templates/identity/view.html.eex
new file mode 100644
index 0000000..b9210f2
--- /dev/null
+++ b/shardweb/lib/shard_web/templates/identity/view.html.eex
@@ -0,0 +1,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 %>