           (email-address-table-mobile email)]
 
          [:div {:class "row col-md-12 col-sm-12 col-xs-12" :style {:margin-bottom "20px"}}
-          [:h2 {:class "uppercase-header"} [:a {:href (path-for "/badge")}(str (t :badge/Mybadges) ": ")(count user_badges)]]
+          [:h2 {:class "uppercase-header"} [:a {:href (path-for "/badge")} (str (t :badge/Mybadges) ": ") (count user_badges)]]
           (when (seq user_badges)
             (doall
-              (for [b user_badges]
-                ^{:key b}[:div.col-xs-12 [:a {:href "#"
+             (for [b user_badges]
+               ^{:key b} [:div.col-xs-12 [:a {:href "#"
                                               :on-click #(do
                                                            (.preventDefault %)
                                                            (mo/open-modal [:gallery :badges] {:badge-id (:badge_id b)}))}
-                                             (:name b)]])))]
+                                          (:name b)]])))]
          [:div {:class "row col-md-12 col-sm-12 col-xs-12"}
           (when (seq pending_badges)
             [:div
              [:h2 {:class "uppercase-header"} [:a {:href (path-for "/badge")} (str (t :badge/Pendingbadges) ": ") (count pending_badges)]]
              (doall
-               (for [p pending_badges]
-                 ^{:key p}[:div
+              (for [p pending_badges]
+                ^{:key p} [:div
                            [:div.col-xs-12 [:b (str (t :badge/Name) ": ")] (:name p)]
-                           [:div.col-xs-12 [:b (str (t :page/Description) ": ")] (:description p)]]))])]
-
-
-
-         (when (seq user_pages)
-           [:div {:class "row col-md-12 col-sm-12 col-xs-12"}
-            [:h2 {:class "uppercase-header"} [:a {:href (path-for "/profile/page")} (str (t :page/Mypages) ": ") (count user_pages)]]
-            (doall
-              (for [p user_pages]
-                ^{:key p}[:div.col-xs-12 [:a {:href "#"
-                                              :on-click #(do
-                                                           (.preventDefault %)
-                                                           (mo/open-modal [:page :view] {:page-id (:id p)}))}
-                                             (:name p)]]))])
-
-
-         (when (seq user_files)
-           [:div {:class "row col-md-12 col-sm-12 col-xs-12"}
-            [:h2 {:class "uppercase-header"} [:a {:href (path-for "/profile/files")} (str (t :file/Files) ": ") (count user_files)]]
-            (doall
-              (for [f user_files]
-                ^{:key f}[:div.col-xs-12 [:a {:href  (str "/" (:path f)) :target "_blank"}
-                                          (:name f)]]))])
-
-
-         [:div {:class "row col-md-12 col-sm-12 col-xs-12"}
-          [:h1 {:class "uppercase-header" :style {:text-align "center"}} (t :user/Activity)]
-          (when (pos? connections)
-            [:div
-             [:h2 {:class "uppercase-header"} [:a {:href (path-for "/connections/badge") :on-click #(session/put! :visible-area :badges)} (str (t :user/Badgeconnections) ": ")  connections]]])
-          (when (pos? endorsements)
-            [:div
-             [:h2 {:class "uppercase-header"} [:a {:href (path-for "/connections/endorsement")} (str (t :badge/Myendorsements) ": ")  endorsements]]])
-          (when (or (seq user_following) (seq user_followers))
-            [:div
-             [:h2 {:class "uppercase-header"} (str (t :user/Socialconnections) ": ") (+ (count user_followers) (count user_following))]
-             (when (seq user_followers)
-               [:div
-                [:h3 (str (t :social/Followersusers) ": ")]
-                (for [follower user_followers
-                      :let [id (:owner_id follower)
-                            fname (:first_name follower)
-                            lname (:last_name follower)
-                            status (:status follower)]]
-                  ^{:key follower}[:div
-                                   [:div.col-xs-12 {:style {:margin-bottom "20px"}} [:div {:id "inline"} [:b (str (t :badge/Name) ": ")] [:a {:href "#" :on-click #(mo/open-modal [:profile :view] {:user-id (:owner_id follower)})} (str (:first_name follower) " " (:last_name follower) )] ", "[:b (str (t :user/Status) ": ")] (t (keyword (str "social/"(:status follower))))]]
-                                   #_[:div.col-xs-12 {:style {:margin-bottom "20px"}} [:b (str (t :user/Status) ": ")] (t (keyword (str "social/"(:status follower))))]])
-
-                [:br]])
-
-             (when (seq user_following)
-               [:div
-                [:h3 (str (t :social/Followedusers) ": ")]
-                (for [f user_following
-                      :let [fid (:user_id f)
-                            fname (:first_name f)
-                            lname (:last_name f)
-                            status (:status f)]]
-                  ^{:key f}[:div
-                            [:div.col-xs-12 {:style {:margin-bottom "20px"}} [:div {:id "inline"}  [:b (str (t :badge/Name) ": ")] [:a {:href "#" :on-click #(mo/open-modal [:profile :view] {:user-id (:user_id f)})} (str (:first_name f) " " (:last_name f) )] ", " [:b (str (t :user/Status) ": ")] (t (keyword (str "social/"(:status f))))]]])])])
-
-
-
-          (when (seq events)
-            [:div.th-align
-             [:h2 {:class "uppercase-header"} (str (t :user/Activityhistory) ": ") (count events)]
-             [:table.table
-              [:thead
-               [:tr
-                [:th (t :social/Action)]
-                [:th (t :social/Object)]
-                [:th (t :badge/Name)]
-                [:th (t :social/Created)]]]
-              [:tbody
-               (doall
-                 (for [e (->> (reverse events) (remove #(= "-" (:info %))))]
-                   ^{:key e}[:tr
-                             [:td [:div (t (keyword (str "social/"(:verb e))))]]
-                             [:td [:div (case (:type e)
-                                          "page" (t :social/Emailpage)
-                                          "badge" (t :social/Emailbadge)
-                                          "user" (lower-case (t :social/User))
-                                          "admin" (lower-case (t :admin/Admin))
-                                          "-")]]
-                             [:td [:div (case (str (:verb e)(:type e))
-                                          "publishpage"  (or (get-in e [:info :object_name]) "-")
-                                          "unpublishpage" (or (get-in e [:info :object_name]) "-")
-                                          "publishbadge" (or (get-in e [:info :object_name]) "-")
-                                          "unpublishbadge" (or (get-in e [:info :object_name]) "-")
-                                          "messagebadge" [:div {:style {:max-width "550px"}}
-                                                          (or (get-in e [:info :object_name]) "-")"\n"
-                                                          [:br][:br]
-                                                          [:p [:i (or (get-in e [:info :message :message]) "comment-removed")]]]
-                                          "congratulatebadge" (or (get-in e [:info :object_name]) "-")
-                                          "followbadge" (or (get-in e [:info :object_name]) "-")
-                                          "followuser" (or (get-in e [:info :object_name]) "-")
-                                          "ticketadmin" (or (get-in e [:info :object_name]) "-")
-                                          "request_endorsementbadge" [:div {:style {:max-width "550px"}}
-                                                                       (or (get-in e [:info :object_name]) "-")"\n"
-                                                                       [:br][:br]
-                                                                       [:div {:dangerouslySetInnerHTML {:__html (or (get-in e [:info :content]) "-")}  :style {:font-style "italic"}}]]
-                                          "endorse_badgebadge" [:div {:style {:max-width "550px"}}
-                                                                 (or (get-in e [:info :object_name]) "-") "\n"
-                                                                 [:br][:br]
-                                                                 [:div {:dangerouslySetInnerHTML {:__html (or (get-in e [:info :content]) "-")}  :style {:font-style "italic"}}]]
-                                          "-")]]
-                             [:td [:div (date-from-unix-time (* 1000 (:ctime e)))]]]))]]])]]])]))
-
-
+                           [:div.col-xs-12 [:b (str (t :page/Description) ": ")] (:description p)]]))])] (when (seq user_pages)
+                                                                                                           [:div {:class "row col-md-12 col-sm-12 col-xs-12"}
+                                                                                                            [:h2 {:class "uppercase-header"} [:a {:href (path-for "/profile/page")} (str (t :page/Mypages) ": ") (count user_pages)]]
+                                                                                                            (doall
+                                                                                                             (for [p user_pages]
+                                                                                                               ^{:key p} [:div.col-xs-12 [:a {:href "#"
+                                                                                                                                              :on-click #(do
+                                                                                                                                                           (.preventDefault %)
+                                                                                                                                                           (mo/open-modal [:page :view] {:page-id (:id p)}))}
+                                                                                                                                          (:name p)]]))]) (when (seq user_files)
+                                                                                                                                                            [:div {:class "row col-md-12 col-sm-12 col-xs-12"}
+                                                                                                                                                             [:h2 {:class "uppercase-header"} [:a {:href (path-for "/profile/files")} (str (t :file/Files) ": ") (count user_files)]]
+                                                                                                                                                             (doall
+                                                                                                                                                              (for [f user_files]
+                                                                                                                                                                ^{:key f} [:div.col-xs-12 [:a {:href  (str "/" (:path f)) :target "_blank"}
+                                                                                                                                                                                           (:name f)]]))]) [:div {:class "row col-md-12 col-sm-12 col-xs-12"}
+                                                                                                                                                                                                            [:h1 {:class "uppercase-header" :style {:text-align "center"}} (t :user/Activity)]
+                                                                                                                                                                                                            (when (pos? connections)
+                                                                                                                                                                                                              [:div
+                                                                                                                                                                                                               [:h2 {:class "uppercase-header"} [:a {:href (path-for "/connections/badge") :on-click #(session/put! :visible-area :badges)} (str (t :user/Badgeconnections) ": ")  connections]]])
+                                                                                                                                                                                                            (when (pos? endorsements)
+                                                                                                                                                                                                              [:div
+                                                                                                                                                                                                               [:h2 {:class "uppercase-header"} [:a {:href (path-for "/connections/endorsement")} (str (t :badge/Myendorsements) ": ")  endorsements]]])
+                                                                                                                                                                                                            (when (or (seq user_following) (seq user_followers))
+                                                                                                                                                                                                              [:div
+                                                                                                                                                                                                               [:h2 {:class "uppercase-header"} (str (t :user/Socialconnections) ": ") (+ (count user_followers) (count user_following))]
+                                                                                                                                                                                                               (when (seq user_followers)
+                                                                                                                                                                                                                 [:div
+                                                                                                                                                                                                                  [:h3 (str (t :social/Followersusers) ": ")]
+                                                                                                                                                                                                                  (for [follower user_followers
+                                                                                                                                                                                                                        :let [id (:owner_id follower)
+                                                                                                                                                                                                                              fname (:first_name follower)
+                                                                                                                                                                                                                              lname (:last_name follower)
+                                                                                                                                                                                                                              status (:status follower)]]
+                                                                                                                                                                                                                    ^{:key follower} [:div
+                                                                                                                                                                                                                                      [:div.col-xs-12 {:style {:margin-bottom "20px"}} [:div {:id "inline"} [:b (str (t :badge/Name) ": ")] [:a {:href "#" :on-click #(mo/open-modal [:profile :view] {:user-id (:owner_id follower)})} (str (:first_name follower) " " (:last_name follower))] ", " [:b (str (t :user/Status) ": ")] (t (keyword (str "social/" (:status follower))))]]
+                                                                                                                                                                                                                                      #_[:div.col-xs-12 {:style {:margin-bottom "20px"}} [:b (str (t :user/Status) ": ")] (t (keyword (str "social/" (:status follower))))]])
+
+                                                                                                                                                                                                                  [:br]])
+
+                                                                                                                                                                                                               (when (seq user_following)
+                                                                                                                                                                                                                 [:div
+                                                                                                                                                                                                                  [:h3 (str (t :social/Followedusers) ": ")]
+                                                                                                                                                                                                                  (for [f user_following
+                                                                                                                                                                                                                        :let [fid (:user_id f)
+                                                                                                                                                                                                                              fname (:first_name f)
+                                                                                                                                                                                                                              lname (:last_name f)
+                                                                                                                                                                                                                              status (:status f)]]
+                                                                                                                                                                                                                    ^{:key f} [:div
+                                                                                                                                                                                                                               [:div.col-xs-12 {:style {:margin-bottom "20px"}} [:div {:id "inline"}  [:b (str (t :badge/Name) ": ")] [:a {:href "#" :on-click #(mo/open-modal [:profile :view] {:user-id (:user_id f)})} (str (:first_name f) " " (:last_name f))] ", " [:b (str (t :user/Status) ": ")] (t (keyword (str "social/" (:status f))))]]])])]) (when (seq events)
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [:div.th-align
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               [:h2 {:class "uppercase-header"} (str (t :user/Activityhistory) ": ") (count events)]
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               [:table.table
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [:thead
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 [:tr
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [:th (t :social/Action)]
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [:th (t :social/Object)]
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [:th (t :badge/Name)]
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [:th (t :social/Created)]]]
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                [:tbody
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 (doall
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  (for [e (->> (reverse events) (remove #(= "-" (:info %))))]
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ^{:key e} [:tr
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               [:td [:div (t (keyword (str "social/" (:verb e))))]]
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               [:td [:div (case (:type e)
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "page" (t :social/Emailpage)
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "badge" (t :social/Emailbadge)
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "user" (lower-case (t :social/User))
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "admin" (lower-case (t :admin/Admin))
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "-")]]
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               [:td [:div (case (str (:verb e) (:type e))
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "publishpage"  (or (get-in e [:info :object_name]) "-")
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "unpublishpage" (or (get-in e [:info :object_name]) "-")
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "publishbadge" (or (get-in e [:info :object_name]) "-")
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "unpublishbadge" (or (get-in e [:info :object_name]) "-")
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "messagebadge" [:div {:style {:max-width "550px"}}
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            (or (get-in e [:info :object_name]) "-") "\n"
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [:br] [:br]
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            [:p [:i (or (get-in e [:info :message :message]) "comment-removed")]]]
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "congratulatebadge" (or (get-in e [:info :object_name]) "-")
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "followbadge" (or (get-in e [:info :object_name]) "-")
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "followuser" (or (get-in e [:info :object_name]) "-")
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "ticketadmin" (or (get-in e [:info :object_name]) "-")
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "request_endorsementbadge" [:div {:style {:max-width "550px"}}
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        (or (get-in e [:info :object_name]) "-") "\n"
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [:br] [:br]
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        [:div {:dangerouslySetInnerHTML {:__html (or (get-in e [:info :content]) "-")}  :style {:font-style "italic"}}]]
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "endorse_badgebadge" [:div {:style {:max-width "550px"}}
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  (or (get-in e [:info :object_name]) "-") "\n"
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [:br] [:br]
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [:div {:dangerouslySetInnerHTML {:__html (or (get-in e [:info :content]) "-")}  :style {:font-style "italic"}}]]
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            "-")]]
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               [:td [:div (date-from-unix-time (* 1000 (:ctime e)))]]]))]]])]]])]))
 
 (defn init-data [user-id state]
   (ajax/GET
-    (path-for (str "obpv1/user/data/" user-id) true)
-    {:handler (fn [data]
-                (reset! state (assoc data
-                                :user-id user-id))
-                (swap! state assoc :initializing false))}
-    (fn [] (swap! state assoc :permission "error"))))
+   (path-for (str "obpv1/user/data/" user-id) true)
+   {:handler (fn [data]
+               (reset! state (assoc data
+                                    :user-id user-id))
+               (swap! state assoc :initializing false))}
+   (fn [] (swap! state assoc :permission "error"))))
 
 (defn handler [site-navi params]
   (let [user-id (:user-id params)

(defn export-data-to-pdf [state]
  (let [user-id (:user-id @state)]
    (ajax/GET
      (path-for (str "obpv1/user/export-to-pdf/" user-id))
      {:handler (js-navigate-to (str "obpv1/user/export-to-pdf/" user-id))})))

(defn email-address-table [email]
  [:table.table.hidden-xs

                          [:td.profile-field (t key) ":"]
                          [:td (cond
                                 (or (re-find #"www." (str value)) (re-find #"^https?://" (str value)) (re-find #"^http?://" (str value))) (hyperlink value)
                                 (and (re-find #"@" (str value)) (= "twitter" field)) [:a {:href (str "https://twitter.com/" value) :target "_blank"} (t value)]
                                 (and (re-find #"@" (str value)) (= "email" field)) [:a {:href (str "mailto:" value)} (t value)]
                                 (and  (empty? (re-find #" " (str value))) (= "facebook" field)) [:a {:href (str "https://www.facebook.com/" value) :target "_blank"} (t value)]
                                 (= "twitter" field) [:a {:href (str "https://twitter.com/" value) :target "_blank"} (t value)]
                                 (and  (empty? (re-find #" " (str value))) (= "pinterest" field)) [:a {:href (str "https://www.pinterest.com/" value) :target "_blank"} (t value)]
                                 (and  (empty? (re-find #" " (str value))) (= "instagram" field)) [:a {:href (str "https://www.instagram.com/" value) :target "_blank"} (t value)]
                                 (= "blog" field) (hyperlink value)
                                 :else (t value))]]))]]])

            [:div.col-xs-12 [:b (t :user/Language) ": "] (upper-case language)]
            [:div.col-xs-12 [:b (t :user/Country) ": "] country]
            [:div.col-xs-12 [:b (str (t :user/Emailnotifications) ": ")]  (if (true? email_notifications) (t :core/Yes) (t :core/No))]
            [:div.col-xs-12 [:b (str (t :user/Privateprofile) ": ")] (if (true? private) (t :core/Yes) (t :core/No))]
            [:div.col-xs-12 [:b (str (t :user/Activated) ": ")] (if (true? activated?) (t :core/Yes) (t :core/No))]
            [:div.col-xs-12  [:b (str (t :user/Profilevisibility) ": ")] (t (keyword (str "core/" (capitalize profile_visibility))))]
            (when-not (and (nil? (:lat location)) (nil? (:lng location))) [:div.col-xs-12 {:style {:margin-bottom "20px"}} [:b (str (t :location/Location) ": ")] (str (:lat location) "," (:lng location))])]]]

         [:div {:class "row col-md-12 col-sm-12 col-xs-12 th-align" :style {:margin-bottom "10px"}}
          [:h2 {:class "uppercase-header"} [:a {:href (path-for "/user/edit/email-addresses")} (str (if (empty? (rest email)) (t :user/Email) (t :user/Emailaddresses)))]]
