aboutsummaryrefslogblamecommitdiff
path: root/shardweb/lib/templates/page/shard_list.html.eex
blob: cc2320527907520ebd2af704e032dfed37fdf9fe (plain) (tree)































                                                                            
                                                   



                                                                            
                                                                                  
                                                           
                         

                
                                                                                               

                                                                                                          
                                                                                                                   

                








                                                        
<!-- Page Heading -->
<div class="row">
  <div class="col-lg-12">
    <h1 class="page-header">
      Shard list

    </h1>
    <ol class="breadcrumb">
      <li>
        <i class="fa fa-dashboard"></i> Dashboard
      </li>
      <li class="active">
        <i class="fa fa-table"></i> Shard list
      </li>
    </ol>
  </div>
</div>
<!-- /.row -->

<%= render ShardWeb.LayoutView, "flashes.html", assigns %>

<table class="table table-striped">
  <tr>
    <th>Shard</th>
    <th>Id</th>
    <th>Pid</th>
  </tr>
  <%= for {id, manifest, pid} <- shard_list() do %>
    <tr>
      <td>
        <%= case manifest do %>
          <% %SApp.Identity.Manifest{pk: pk} -> %><i class="fa fa-user"></i>
            <%= SApp.Identity.get_info(pid).nick %>
            <a href="<%= identity_path(@conn, :view, pk|>Base.encode16) %>">
              <small><%= Shard.Keys.pk_display pk %></small>
            </a>

          <% %SApp.Chat.Manifest{channel: chan} -> %><i class="fa fa-hashtag"></i>
            <a href="<%= chat_path(@conn, :chat, chan) %>">
              <%= chan %>
            </a>

          <% %SApp.Chat.PrivChat.Manifest{pk_list: pk_list} -> %><i class="fa fa-comments"></i>
            <a href="<%= chat_path(@conn, :privchat,
                (pk_list |> Enum.filter(&(&1!=@pk)) |> Enum.map(&Base.encode16/1) |> Enum.join(","))) %>">
                <%= pk_list |> Enum.filter(&(&1!=@pk)) |> Enum.map(&SApp.Identity.get_nick/1) |> Enum.join(", ") %>
            </a>

          <% x -> %> <%= inspect x %>
        <% end %>
      </td>
      <td><small><%= id |> Base.encode16 %></small></td>
      <td><%= inspect(pid) %></td>
    </tr>
  <% end %>
</table>