diff options
author | Alex Auvolat <alex@adnab.me> | 2018-10-11 20:14:47 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2018-10-11 20:14:54 +0200 |
commit | 6dcc2eefc3c8db0cadd7300536527dbd1905fa48 (patch) | |
tree | 3eb00337e1dd7bc47680b9fa16ec721eb216f4a9 /shardweb/lib/shard_web/templates/layout/app.html.eex | |
parent | 123fbcf6abcfe61ef65cc82f1d22843dde722b23 (diff) | |
download | shard-6dcc2eefc3c8db0cadd7300536527dbd1905fa48.tar.gz shard-6dcc2eefc3c8db0cadd7300536527dbd1905fa48.zip |
Template changes
Diffstat (limited to 'shardweb/lib/shard_web/templates/layout/app.html.eex')
-rw-r--r-- | shardweb/lib/shard_web/templates/layout/app.html.eex | 95 |
1 files changed, 25 insertions, 70 deletions
diff --git a/shardweb/lib/shard_web/templates/layout/app.html.eex b/shardweb/lib/shard_web/templates/layout/app.html.eex index bd405e7..e0cb9dc 100644 --- a/shardweb/lib/shard_web/templates/layout/app.html.eex +++ b/shardweb/lib/shard_web/templates/layout/app.html.eex @@ -132,18 +132,18 @@ </ul> </li> <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i> John Smith <b class="caret"></b></a> + <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i> <%= @nick %> <b class="caret"></b></a> <ul class="dropdown-menu"> <li> - <a href="#"><i class="fa fa-fw fa-user"></i> Profile</a> + <a href="<%= identity_path(@conn, :view) %>"><i class="fa fa-fw fa-user"></i> Profile</a> </li> + <li class="divider"></li> <li> <a href="#"><i class="fa fa-fw fa-envelope"></i> Inbox</a> </li> <li> <a href="#"><i class="fa fa-fw fa-gear"></i> Settings</a> </li> - <li class="divider"></li> <li> <a href="#"><i class="fa fa-fw fa-power-off"></i> Log Out</a> </li> @@ -153,40 +153,34 @@ <!-- 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="active"> - <a href="<%= page_path(@conn, :index) %>"><i class="fa fa-fw fa-dashboard"></i> Peer list</a> - </li> - <li> - <a href="<%= room_path(@conn, :show, "lobby") %>"><i class="fa fa-fw fa-bar-chart-o"></i> Chat</a> - </li> - <li> - <a href="<%= identity_path(@conn, :view) %>"><i class="fa fa-fw fa-table"></i> [<%= @nick %>]</a> + <li class="<%= if @view_module == ShardWeb.IdentityView do "active" else "" end %>"> + <a href="<%= identity_path(@conn, :view) %>"><i class="fa fa-fw fa-user"></i> <%= @nick %></a> </li> - <li> - <a href="forms.html"><i class="fa fa-fw fa-edit"></i> Forms</a> - </li> - <li> - <a href="bootstrap-elements.html"><i class="fa fa-fw fa-desktop"></i> Bootstrap Elements</a> - </li> - <li> - <a href="bootstrap-grid.html"><i class="fa fa-fw fa-wrench"></i> Bootstrap Grid</a> - </li> - <li> - <a href="javascript:;" data-toggle="collapse" data-target="#demo"><i class="fa fa-fw fa-arrows-v"></i> Dropdown <i class="fa fa-fw fa-caret-down"></i></a> - <ul id="demo" class="collapse"> - <li> - <a href="#">Dropdown Item</a> - </li> - <li> - <a href="#">Dropdown Item</a> + <li class="<%= if @view_module == ShardWeb.RoomView 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 %>"> + + + <%= for {_, %SApp.Chat.Manifest{channel: name}, _} <- shard_list() do %> + <li class="<%= if @view_module == ShardWeb.RoomView and @room == name do "custom_active" else "" end %>"> + <a href="<%= room_path(@conn, :show, 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> + </li> + + </ul> </li> + <li class="<%= if @view_module == ShardWeb.PageView and @view_template == "index.html" do "active" else "" end %>"> + <a href="<%= page_path(@conn, :index) %>"><i class="fa fa-fw fa-globe"></i> Peer list</a> + </li> <li> - <a href="blank-page.html"><i class="fa fa-fw fa-file"></i> Blank Page</a> + <a href="#"><i class="fa fa-fw fa-gear"></i> Settings</a> </li> <li> - <a href="index-rtl.html"><i class="fa fa-fw fa-dashboard"></i> RTL Dashboard</a> + <a href="#"><i class="fa fa-fw fa-dashboard"></i> Dashboard</a> </li> </ul> </div> @@ -197,48 +191,9 @@ <div class="container-fluid"> - <!-- Page Heading --> - <div class="row"> - <div class="col-lg-12"> - <h1 class="page-header"> - Dashboard <small>Statistics Overview</small> - </h1> - <ol class="breadcrumb"> - <li class="active"> - <i class="fa fa-dashboard"></i> Dashboard - </li> - </ol> - </div> - </div> - <!-- /.row --> - - <%= if get_flash(@conn, :info) do %> - <div class="row"> - <div class="col-lg-12"> - <div class="alert alert-info alert-dismissable"> - <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> - <i class="fa fa-info-circle"></i> <%= get_flash(@conn, :info) %> - </div> - </div> - </div> - <% end %> - <!-- /.row --> - <%= if get_flash(@conn, :error) do %> - <div class="row"> - <div class="col-lg-12"> - <div class="alert alert-warning alert-dismissable"> - <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> - <i class="fa fa-info-circle"></i> <%= get_flash(@conn, :error) %> - </div> - </div> - </div> - <% end %> - <!-- /.row --> - <main role="main"> - <%= render @view_module, @view_template, assigns %> - </main> + <%= render @view_module, @view_template, assigns %> </div> <!-- /.container-fluid --> |