aboutsummaryrefslogtreecommitdiff
path: root/shardweb/lib/templates/page
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2018-10-15 17:29:05 +0200
committerAlex Auvolat <alex@adnab.me>2018-10-15 17:29:05 +0200
commit07841bd2ec86cb667aea633de5dcb068751e64d3 (patch)
tree85fd1f47ea93e39614a84497d92cf4ad629cb3d1 /shardweb/lib/templates/page
parent181baf7e0c26c51d7c605bc9797f77ced9188455 (diff)
downloadshard-07841bd2ec86cb667aea633de5dcb068751e64d3.tar.gz
shard-07841bd2ec86cb667aea633de5dcb068751e64d3.zip
Friends list (beginning)
Diffstat (limited to 'shardweb/lib/templates/page')
-rw-r--r--shardweb/lib/templates/page/shard_entry.html.eex30
-rw-r--r--shardweb/lib/templates/page/shard_list.html.eex31
2 files changed, 31 insertions, 30 deletions
diff --git a/shardweb/lib/templates/page/shard_entry.html.eex b/shardweb/lib/templates/page/shard_entry.html.eex
new file mode 100644
index 0000000..8a55b3a
--- /dev/null
+++ b/shardweb/lib/templates/page/shard_entry.html.eex
@@ -0,0 +1,30 @@
+ <%= case @manifest do %>
+ <% %SApp.Identity.Manifest{pk: pk} -> %><i class="fa fa-user"></i>
+ <%= SApp.Identity.get_nick(pk) %>
+ <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>
+
+ <% %SApp.Directory.Manifest{owner: owner, public: public, name: name} -> %><i class="fa fa-folder"></i>
+ <%= SApp.Identity.get_nick(owner) %>
+ <a href="<%= identity_path(@conn, :view, owner|>Base.encode16) %>">
+ <small><%= Shard.Keys.pk_display owner %></small>
+ </a>
+ /
+ <a href="<%= directory_path(@conn, (if public do :view_pub else :view_priv end), owner|>Base.encode16(), name) %>"><%= name %></a>
+ <%= if public do %><i class="fa fa-globe"></i><% else %><i class="fa fa-lock"></i><% end %>
+
+
+ <% x -> %> <%= inspect x %>
+ <% end %>
diff --git a/shardweb/lib/templates/page/shard_list.html.eex b/shardweb/lib/templates/page/shard_list.html.eex
index 489c1a5..53f6264 100644
--- a/shardweb/lib/templates/page/shard_list.html.eex
+++ b/shardweb/lib/templates/page/shard_list.html.eex
@@ -35,36 +35,7 @@
<% end %>
</td>
<td>
- <%= case manifest do %>
- <% %SApp.Identity.Manifest{pk: pk} -> %><i class="fa fa-user"></i>
- <%= SApp.Identity.get_nick(pk) %>
- <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>
-
- <% %SApp.Directory.Manifest{owner: owner, public: public, name: name} -> %><i class="fa fa-folder"></i>
- <%= SApp.Identity.get_nick(owner) %>
- <a href="<%= identity_path(@conn, :view, owner|>Base.encode16) %>">
- <small><%= Shard.Keys.pk_display owner %></small>
- </a>
- /
- <a href="#"><%= name %></a>
- <%= if public do %><i class="fa fa-globe"></i><% else %><i class="fa fa-lock"></i><% end %>
-
-
- <% x -> %> <%= inspect x %>
- <% end %>
+ <%= render "shard_entry.html", conn: @conn, manifest: manifest %>
</td>
<td><small><%= id |> Base.encode16 %></small></td>
</tr>