Skip to content

Commit

Permalink
Logout / login header
Browse files Browse the repository at this point in the history
  • Loading branch information
rjsamson committed Mar 25, 2016
1 parent 2c9abdb commit 76d78e7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
19 changes: 1 addition & 18 deletions web/elm/src/Console/View.elm
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,7 @@ page : Signal.Address Action -> Model -> Html.Html
page address model =
div
[]
[ navbar address model
, tickerTable address model
]

navbar : Signal.Address Action -> Model -> Html.Html
navbar address model =
nav
[ class "navbar navbar-default" ]
[ div [ class "container-fluid" ]
[ div [ class "navbar-header" ]
[ brandLink address model ]
]
]

brandLink : Signal.Address Action -> Model -> Html.Html
brandLink address model =
a
[ href "#", class "navbar-brand" ][ text "Stackfooter" ]
[ tickerTable address model ]

tickerTable : Signal.Address Action -> Model -> Html.Html
tickerTable address model =
Expand Down
21 changes: 21 additions & 0 deletions web/templates/layout/app.html.eex
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,27 @@

<body>
<div class="container" role="main">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a href="#" class="navbar-brand">Stackfooter</a>
</div>
<div>
<ol class="breadcrumb navbar-right">
<%= if @current_user do %>
<li><%= @current_user.username %></li>
<li>
<%= link "Log out", to: session_path(@conn, :delete, @current_user), method: "delete" %>
</li>
<% else %>
<li>
<%= link "Log in", to: session_path(@conn, :new) %>
</li>
<% end %>
</ol>
</div>
</div>
</nav>
<%= render @view_module, @view_template, assigns %>
</div> <!-- /container -->
<script src="<%= static_path(@conn, "/js/app.js") %>"></script>
Expand Down

0 comments on commit 76d78e7

Please sign in to comment.