<commit_before>;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) 2015-2017 <NAME> <<EMAIL>>
;; Copyright (c) 2015-2017 <NAME> <<EMAIL>>

(ns uxbox.main.ui.settings.header
  (:require [potok.core :as ptk]
            [lentes.core :as l]
            [uxbox.util.i18n :refer [tr]]
            [uxbox.util.router :as r]
            [uxbox.main.store :as st]
            [uxbox.main.data.auth :as da]
            [uxbox.main.data.projects :as dp]
            [uxbox.main.ui.navigation :as nav]
            [uxbox.builtins.icons :as i]
            [uxbox.main.ui.users :refer [user]]
            [rumext.core :as mx :include-macros true]))

(def ^:private section-ref
  (-> (l/in [:route :id])
      (l/derive st/state)))

(mx/defc header-link
  [section content]
  (let [link (r/route-for section)]
    [:a {:href (str "/#" link)} content]))

(mx/defc header
  {:mixins [mx/static mx/reactive]}
  []
  (let [section (mx/react section-ref)
        profile? (= section :settings/profile)
        password? (= section :settings/password)
        notifications? (= section :settings/notifications)]
    [:header#main-bar.main-bar
     [:div.main-logo
      (header-link :dashboard/projects i/logo)]
     [:ul.main-nav
      [:li {:class (when profile? "current")}
       (header-link :settings/profile (tr "settings.profile"))]
      [:li {:class (when password? "current")}
       (header-link :settings/password (tr "settings.password"))]
      [:li {:class (when notifications? "current")}
       (header-link :settings/notifications (tr "settings.notifications"))]
      [:li {:on-click #(st/emit! (da/logout))}
       (header-link :settings/profile (tr "settings.exit"))]]
     (user)]))
<commit_msg>:art: Exit links to authentication page<commit_after>;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) 2015-2017 <NAME> <<EMAIL>>
;; Copyright (c) 2015-2017 <NAME> <<EMAIL>>

(ns uxbox.main.ui.settings.header
  (:require [potok.core :as ptk]
            [lentes.core :as l]
            [uxbox.util.i18n :refer [tr]]
            [uxbox.util.router :as r]
            [uxbox.main.store :as st]
            [uxbox.main.data.auth :as da]
            [uxbox.main.data.projects :as dp]
            [uxbox.main.ui.navigation :as nav]
            [uxbox.builtins.icons :as i]
            [uxbox.main.ui.users :refer [user]]
            [rumext.core :as mx :include-macros true]))

(def ^:private section-ref
  (-> (l/in [:route :id])
      (l/derive st/state)))

(mx/defc header-link
  [section content]
  (let [link (r/route-for section)]
    [:a {:href (str "/#" link)} content]))

(mx/defc header
  {:mixins [mx/static mx/reactive]}
  []
  (let [section (mx/react section-ref)
        profile? (= section :settings/profile)
        password? (= section :settings/password)
        notifications? (= section :settings/notifications)]
    [:header#main-bar.main-bar
     [:div.main-logo
      (header-link :dashboard/projects i/logo)]
     [:ul.main-nav
      [:li {:class (when profile? "current")}
       (header-link :settings/profile (tr "settings.profile"))]
      [:li {:class (when password? "current")}
       (header-link :settings/password (tr "settings.password"))]
      [:li {:class (when notifications? "current")}
       (header-link :settings/notifications (tr "settings.notifications"))]
      [:li {:on-click #(st/emit! (da/logout))}
       (header-link :auth/login (tr "settings.exit"))]]
     (user)]))

{'fraction_non_alphanumeric': 0.16826411075612355, 'fraction_numerical': 0.011714589989350373, 'mean_word_length': 2.676125244618395, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1554048', 'n_tokens_mistral': 1308, 'n_tokens_neox': 1242, 'n_words': 333}