diff options
Diffstat (limited to 'shardweb/lib/templates/layout')
-rw-r--r-- | shardweb/lib/templates/layout/app.html.eex | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/shardweb/lib/templates/layout/app.html.eex b/shardweb/lib/templates/layout/app.html.eex index 5a087f2..f49c8e6 100644 --- a/shardweb/lib/templates/layout/app.html.eex +++ b/shardweb/lib/templates/layout/app.html.eex @@ -153,28 +153,37 @@ <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens --> <div class="collapse navbar-collapse navbar-ex1-collapse"> <ul class="nav navbar-nav side-nav"> - <li class="<%= if @view_module == ShardWeb.IdentityView do "active" else "" end %>"> + <li class="<%= if @view_module == ShardWeb.IdentityView and @view_template == "self.html" do "active" else "" end %>"> <a href="<%= identity_path(@conn, :self) %>"><i class="fa fa-fw fa-user"></i> <%= @nick %></a> </li> - <li class="<%= if @view_module == ShardWeb.RoomView do "active" else "" end %>"> + <li class="<%= if @view_module == ShardWeb.ChatView and @view_template == "chat.html" and @public do "active" else "" end %>"> <a href="javascript:;" data-toggle="collapse" data-target="#demo"><i class="fa fa-fw fa-comments"></i> Chat rooms <i class="fa fa-fw fa-caret-down"></i></a> - <ul id="demo" class="<%= if @view_module != ShardWeb.RoomView do "collapse" else "" end %>"> + <ul id="demo" class="<%= if not (@view_module == ShardWeb.ChatView and @view_template == "chat.html" and @public) do "collapse" else "" end %>"> - <%= for {_, %SApp.Chat.Manifest{channel: name}, _} <- shard_list() do %> - <li class="<%= if @view_module == ShardWeb.RoomView and @room == name do "custom_active" else "" end %>"> + <%= for {id, %SApp.Chat.Manifest{channel: name}, _} <- shard_list() do %> + <li class="<%= if @shard == id do "custom_active" else "" end %>"> <a href="<%= chat_path(@conn, :chat, name) %>">#<%= name %></a> </li> <% end %> <li> - <a href="#" onclick="if(new_room=prompt('Enter name of room to join, without preceding # sign:'))window.location.href='/room/'+new_room;">Join room</a> + <a href="#" onclick="if(new_room=prompt('Enter name of room to join, without preceding # sign:'))window.location.href='<%= chat_path(@conn, :chat, "") %>'+new_room;">Join room</a> </li> </ul> </li> - <li> - <a href="<%= identity_path(@conn, :list) %>"><i class="fa fa-fw fa-users"></i> People</a> + <li class="<%= if (@view_module == ShardWeb.IdentityView and @view_template == "list.html") or (@view_module == ShardWeb.ChatView and @view_template == "chat.html" and not @public) do "active" else "" end %>"> + <a href="<%= identity_path(@conn, :list) %>"><i class="fa fa-fw fa-users"></i> People<i class="fa fa-fw fa-caret-down"></i></a> + <%= if (@view_module == ShardWeb.IdentityView and @view_template == "list.html") or (@view_module == ShardWeb.ChatView and @view_template == "chat.html" and not @public) do %> + <ul> + <%= for {id, %SApp.Chat.PrivChat.Manifest{pk_list: pk_list}, _} <- shard_list() do %> + <li class="<%= if id == @shard do "custom_active" else "" end %>"> + <a href="<%= chat_path(@conn, :privchat, str_of_pk_list(@conn, pk_list)) %>"><%= nicks_of_pk_list(@conn, pk_list) %></a> + </li> + <% end %> + </ul> + <% end %> </li> <li class="<%= if @view_module == ShardWeb.PageView and @view_template == "peer_list.html" do "active" else "" end %>"> <a href="<%= page_path(@conn, :peer_list) %>"><i class="fa fa-fw fa-globe"></i> Peer list</a> @@ -182,7 +191,7 @@ <li> <a href="#"><i class="fa fa-fw fa-gear"></i> Settings</a> </li> - <li> + <li class="<%= if @view_module == ShardWeb.PageView and @view_template == "shard_list.html" do "active" else "" end %>"> <a href="<%= page_path(@conn, :shard_list) %>"><i class="fa fa-fw fa-dashboard"></i> Dashboard</a> </li> </ul> |