Skip to content

Instantly share code, notes, and snippets.

@richjdsmith
Forked from thebrianemory/_navigation.html.eex
Created October 24, 2017 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richjdsmith/5c35ff2a716d2752597c5b8e698c7ee9 to your computer and use it in GitHub Desktop.
Save richjdsmith/5c35ff2a716d2752597c5b8e698c7ee9 to your computer and use it in GitHub Desktop.
... <!-- Code removed for readability -->
<div class="top-bar-right">
<ul class="menu">
<%= if @conn.assigns[:user] do %>
<li class="menu-text">
Welcome, <%= @conn.assigns.user.first_name %>!
</li>
<li>
<%= link "Videos", to: video_path(@conn, :index) %>
</li>
<li>
<%= link "Add Video", to: video_path(@conn, :new) %>
</li>
<li>
<%= link "Sign out", to: auth_path(@conn, :delete), class: "button alert" %>
</li>
<% else %>
<li>
<%= link "Videos", to: video_path(@conn, :index) %>
</li>
<li>
<%= link "Sign in with Google", to: auth_path(@conn, :request, "google", scope: "email profile"), class: "button" %>
</li>
<% end %>
</ul>
</div>
... <!-- Code removed for readability -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment