 
 (defpartial user-links []
   [:li.dropdown
-   [:a.dropdown-toggle
-    {:data-toggle "dropdown"}
-    [:i.icon-user.icon-white] " User " [:b.caret]]
-   [:ul.dropdown-menu
-    [:li [:a {:href "/signup"} [:i.icon-check] " Sign Up"]]
-    [:li [:a {:href "/login"} [:i.icon-share] " Log In"]]]])
+   (if (friend/anonymous?)
+     (html [:a.dropdown-toggle
+            {:data-toggle "dropdown"}
+            [:i.icon-user.icon-white] " User " [:b.caret]]
+           [:ul.dropdown-menu
+            [:li [:a {:href "/signup"} [:i.icon-check] " Sign Up"]]
+            [:li [:a {:href "/login"} [:i.icon-share] " Log In"]]])
+     (html [:a.dropdown-toggle
+            {:data-toggle "dropdown"}
+            [:i.icon-user.icon-white] " " (m/identity) " " [:b.caret]]
+           [:ul.dropdown-menu
+            [:li [:a {:href "/logout"} [:i.icon-off] " Log Out"]]]))])
 
 (defpartial layout [& content]
   (base-layout

         (user-links)]
        ]]]]
    [:div#main-wrapper
     [:div#main.container content]]))

(defpartial control-group [params]
  (let [name (string/lower-case (:name params))]
    [:div.control-group
     [:label.control-label {:for name} (str (:name params) ": ")]
     [:div.controls

(ns cadence.views.common
  (:require [clojure.string :as string]
            [cemerick.friend :as friend]
            [cadence.model :as m]
            [cadence.model.flash :as flash])
  (:use noir.core
        hiccup.core
        hiccup.page-helpers))
