diff options
Diffstat (limited to 'shardweb/lib/templates/identity')
-rw-r--r-- | shardweb/lib/templates/identity/list.html.eex | 32 | ||||
-rw-r--r-- | shardweb/lib/templates/identity/self.html.eex | 59 |
2 files changed, 91 insertions, 0 deletions
diff --git a/shardweb/lib/templates/identity/list.html.eex b/shardweb/lib/templates/identity/list.html.eex new file mode 100644 index 0000000..1354264 --- /dev/null +++ b/shardweb/lib/templates/identity/list.html.eex @@ -0,0 +1,32 @@ +<!-- Page Heading --> +<div class="row"> + <div class="col-lg-12"> + <h1 class="page-header"> + People on the network + + </h1> + <ol class="breadcrumb"> + <li class="active"> + <i class="fa fa-users"></i> People + </li> + </ol> + </div> +</div> +<!-- /.row --> + +<%= render ShardWeb.LayoutView, "flashes.html", assigns %> + + +<table class="table table-striped"> + <tr> + <th>User name</th> + <th>Public key</th> + </tr> + <%= for {_id, manifest, pid} <- people_list() do %> + <tr> + <td><i class="fa fa-user"></i> <%= GenServer.call(pid, :get_info).nick %> </td> + <td><small><%= manifest.pk |> Base.encode16 %></small></td> + </tr> + <% end %> +</table> + diff --git a/shardweb/lib/templates/identity/self.html.eex b/shardweb/lib/templates/identity/self.html.eex new file mode 100644 index 0000000..5e57e02 --- /dev/null +++ b/shardweb/lib/templates/identity/self.html.eex @@ -0,0 +1,59 @@ +<!-- Page Heading --> +<div class="row"> + <div class="col-lg-12"> + <h1 class="page-header"> + <%= @nick %> <small><%= @pk |> Base.encode16 %></small> + </h1> + <ol class="breadcrumb"> + <li> + <i class="fa fa-users"></i> My identities + </li> + <li class="active"> + <i class="fa fa-user"></i> <%= @nick %> + </li> + </ol> + </div> +</div> +<!-- /.row --> + +<%= render ShardWeb.LayoutView, "flashes.html", assigns %> + + +<%= 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 %> |