Last active
August 29, 2015 14:27
-
-
Save Deraen/cf46b040730121266807 to your computer and use it in GitHub Desktop.
Additional data to Silk routes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deftype AdditionalData [data] | |
silk/Pattern | |
(-match [_ _] | |
data) | |
(-unmatch [_ _] | |
nil) | |
(-match-validator [_] | |
(constantly true)) | |
(-unmatch-validators [_] | |
{})) | |
(defn data [x] | |
(AdditionalData. x)) | |
(def routes | |
(silk/routes | |
[[:index [[]]] | |
[:profile [["profile"]]] | |
[:my-group [["group"]]] | |
[:users [["users"]]] | |
[:groups [["groups"]]] | |
;; Used to in nav-bar to mark link active | |
[:dashboard [["dashboard"] (data {:routing/nav :issue})]] | |
[:new-issue [["new-issue"] (data {:routing/nav :issue})]] | |
[:issue [["issue" :id] (data {:routing/nav :issue})]] | |
;; Used to allow access without login | |
[:token-view [["token" :id] (data {:public? true})]] | |
[:register-view [["register"] (data {:public? true})]] | |
[:password-forgotten-view [["password-forgotten"] (data {:public? true})]]])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment