{"action":"created","comment":{"url":"https://api.github.com/repos/matthieu-beteille/pancetta/pulls/comments/47444550","id":47444550,"diff_hunk":"@@ -1,23 +1,86 @@\n (ns pancetta.components.home\n   (:require [matchbox.core :as m]\n+            [pancetta.common.helpers :as h :refer [price-to-str]]\n+            [secretary.core :as secretary]\n             [reagent.core :as reagent :refer [atom]]))\n \n-(defn home-component [state]\n+(def style {:form-container {:background-color \"white\"\n+                             :padding \"20px 30px\"\n+                             :margin 5}\n+            :results-container {:margin 5}\n+            :ticket {:background-color \"white\"\n+                     :margin 1\n+                     :border-radius 3\n+                     :padding 10\n+                     :cursor \"pointer\"}\n+            :form-group {:margin \"20px 0px\"}})\n+\n+(def query (atom {:from \"London\"\n+                  :to \"Paris\"\n+                  :on (-> (js/Date.) .toISOString (.slice 0 10))}))\n+\n+(def tickets (atom nil))\n+\n+;; should be retrieved from firebase\n+(def cities [\"Paris\", \"London\", \"Bruxelles\"])\n+\n+(defn get-tickets [root]\n   (let [tickets-ref (->\n-                      (m/get-in (:root @state) [:tickets])\n-                      (.orderByChild \"price/amount\")\n-                      (.limitToLast 10))\n-        tickets (atom nil)]\n-    (m/listen-to tickets-ref :value #(reset! tickets (get % 1)))\n-    (fn []\n-      [:div\n-        [:h1 {:on-click #(.log js/console \"click\")} \"HOME PAGE\"]\n-        [:div\n-          (for [[ticket-id ticket] @tickets]\n-            [:div {:key ticket-id}\n-              (:from ticket)\n-              \" -> \"\n-              (:to ticket)\n-              \" on: \" (:on ticket)\n-              \" for \"\n-              (get-in ticket [:price :amount])])]])))\n+                     (m/get-in root [:tickets])\n+                     (.orderByChild \"on\")\n+                     (.equalTo (:on @query)))]\n+    (m/listen-to tickets-ref\n+                 :value\n+                 (fn [[id res]] (reset! tickets\n+                                        (doall (filter\n+                                                (fn [[id ticket]] (and (= (:to @query) (:to ticket))\n+                                                                       (= (:from @query) (:from ticket)))) res)))))))","path":"src/cljs/pancetta/components/home.cljs","position":55,"original_position":55,"commit_id":"a31ab9204ee3ddd20e72b3c31450c22f129f890a","original_commit_id":"a31ab9204ee3ddd20e72b3c31450c22f129f890a","user":{"login":"matthieu-beteille","id":5712325,"avatar_url":"https://avatars.githubusercontent.com/u/5712325?v=3","gravatar_id":"","url":"https://api.github.com/users/matthieu-beteille","html_url":"https://github.com/matthieu-beteille","followers_url":"https://api.github.com/users/matthieu-beteille/followers","following_url":"https://api.github.com/users/matthieu-beteille/following{/other_user}","gists_url":"https://api.github.com/users/matthieu-beteille/gists{/gist_id}","starred_url":"https://api.github.com/users/matthieu-beteille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthieu-beteille/subscriptions","organizations_url":"https://api.github.com/users/matthieu-beteille/orgs","repos_url":"https://api.github.com/users/matthieu-beteille/repos","events_url":"https://api.github.com/users/matthieu-beteille/events{/privacy}","received_events_url":"https://api.github.com/users/matthieu-beteille/received_events","type":"User","site_admin":false},"body":"yep nice, sorry I am busy right now, if you want feel free to update the PR yourself. ","created_at":"2015-12-13T13:46:04Z","updated_at":"2015-12-13T13:46:04Z","html_url":"https://github.com/matthieu-beteille/pancetta/pull/17#discussion_r47444550","pull_request_url":"https://api.github.com/repos/matthieu-beteille/pancetta/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/matthieu-beteille/pancetta/pulls/comments/47444550"},"html":{"href":"https://github.com/matthieu-beteille/pancetta/pull/17#discussion_r47444550"},"pull_request":{"href":"https://api.github.com/repos/matthieu-beteille/pancetta/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/matthieu-beteille/pancetta/pulls/17","id":52068478,"html_url":"https://github.com/matthieu-beteille/pancetta/pull/17","diff_url":"https://github.com/matthieu-beteille/pancetta/pull/17.diff","patch_url":"https://github.com/matthieu-beteille/pancetta/pull/17.patch","issue_url":"https://api.github.com/repos/matthieu-beteille/pancetta/issues/17","number":17,"state":"open","locked":false,"title":"home: create page","user":{"login":"matthieu-beteille","id":5712325,"avatar_url":"https://avatars.githubusercontent.com/u/5712325?v=3","gravatar_id":"","url":"https://api.github.com/users/matthieu-beteille","html_url":"https://github.com/matthieu-beteille","followers_url":"https://api.github.com/users/matthieu-beteille/followers","following_url":"https://api.github.com/users/matthieu-beteille/following{/other_user}","gists_url":"https://api.github.com/users/matthieu-beteille/gists{/gist_id}","starred_url":"https://api.github.com/users/matthieu-beteille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthieu-beteille/subscriptions","organizations_url":"https://api.github.com/users/matthieu-beteille/orgs","repos_url":"https://api.github.com/users/matthieu-beteille/repos","events_url":"https://api.github.com/users/matthieu-beteille/events{/privacy}","received_events_url":"https://api.github.com/users/matthieu-beteille/received_events","type":"User","site_admin":false},"body":"Issue #17 ","created_at":"2015-11-29T19:12:47Z","updated_at":"2015-12-13T13:46:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9d4946f7df42aa96138717404c3db0cbfb57d67","assignee":{"login":"teawaterwire","id":1702973,"avatar_url":"https://avatars.githubusercontent.com/u/1702973?v=3","gravatar_id":"","url":"https://api.github.com/users/teawaterwire","html_url":"https://github.com/teawaterwire","followers_url":"https://api.github.com/users/teawaterwire/followers","following_url":"https://api.github.com/users/teawaterwire/following{/other_user}","gists_url":"https://api.github.com/users/teawaterwire/gists{/gist_id}","starred_url":"https://api.github.com/users/teawaterwire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teawaterwire/subscriptions","organizations_url":"https://api.github.com/users/teawaterwire/orgs","repos_url":"https://api.github.com/users/teawaterwire/repos","events_url":"https://api.github.com/users/teawaterwire/events{/privacy}","received_events_url":"https://api.github.com/users/teawaterwire/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/matthieu-beteille/pancetta/pulls/17/commits","review_comments_url":"https://api.github.com/repos/matthieu-beteille/pancetta/pulls/17/comments","review_comment_url":"https://api.github.com/repos/matthieu-beteille/pancetta/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matthieu-beteille/pancetta/issues/17/comments","statuses_url":"https://api.github.com/repos/matthieu-beteille/pancetta/statuses/a31ab9204ee3ddd20e72b3c31450c22f129f890a","head":{"label":"matthieu-beteille:home-page","ref":"home-page","sha":"a31ab9204ee3ddd20e72b3c31450c22f129f890a","user":{"login":"matthieu-beteille","id":5712325,"avatar_url":"https://avatars.githubusercontent.com/u/5712325?v=3","gravatar_id":"","url":"https://api.github.com/users/matthieu-beteille","html_url":"https://github.com/matthieu-beteille","followers_url":"https://api.github.com/users/matthieu-beteille/followers","following_url":"https://api.github.com/users/matthieu-beteille/following{/other_user}","gists_url":"https://api.github.com/users/matthieu-beteille/gists{/gist_id}","starred_url":"https://api.github.com/users/matthieu-beteille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthieu-beteille/subscriptions","organizations_url":"https://api.github.com/users/matthieu-beteille/orgs","repos_url":"https://api.github.com/users/matthieu-beteille/repos","events_url":"https://api.github.com/users/matthieu-beteille/events{/privacy}","received_events_url":"https://api.github.com/users/matthieu-beteille/received_events","type":"User","site_admin":false},"repo":{"id":46613884,"name":"pancetta","full_name":"matthieu-beteille/pancetta","owner":{"login":"matthieu-beteille","id":5712325,"avatar_url":"https://avatars.githubusercontent.com/u/5712325?v=3","gravatar_id":"","url":"https://api.github.com/users/matthieu-beteille","html_url":"https://github.com/matthieu-beteille","followers_url":"https://api.github.com/users/matthieu-beteille/followers","following_url":"https://api.github.com/users/matthieu-beteille/following{/other_user}","gists_url":"https://api.github.com/users/matthieu-beteille/gists{/gist_id}","starred_url":"https://api.github.com/users/matthieu-beteille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthieu-beteille/subscriptions","organizations_url":"https://api.github.com/users/matthieu-beteille/orgs","repos_url":"https://api.github.com/users/matthieu-beteille/repos","events_url":"https://api.github.com/users/matthieu-beteille/events{/privacy}","received_events_url":"https://api.github.com/users/matthieu-beteille/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/matthieu-beteille/pancetta","description":"cljs spa project","fork":false,"url":"https://api.github.com/repos/matthieu-beteille/pancetta","forks_url":"https://api.github.com/repos/matthieu-beteille/pancetta/forks","keys_url":"https://api.github.com/repos/matthieu-beteille/pancetta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matthieu-beteille/pancetta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matthieu-beteille/pancetta/teams","hooks_url":"https://api.github.com/repos/matthieu-beteille/pancetta/hooks","issue_events_url":"https://api.github.com/repos/matthieu-beteille/pancetta/issues/events{/number}","events_url":"https://api.github.com/repos/matthieu-beteille/pancetta/events","assignees_url":"https://api.github.com/repos/matthieu-beteille/pancetta/assignees{/user}","branches_url":"https://api.github.com/repos/matthieu-beteille/pancetta/branches{/branch}","tags_url":"https://api.github.com/repos/matthieu-beteille/pancetta/tags","blobs_url":"https://api.github.com/repos/matthieu-beteille/pancetta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matthieu-beteille/pancetta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matthieu-beteille/pancetta/git/refs{/sha}","trees_url":"https://api.github.com/repos/matthieu-beteille/pancetta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matthieu-beteille/pancetta/statuses/{sha}","languages_url":"https://api.github.com/repos/matthieu-beteille/pancetta/languages","stargazers_url":"https://api.github.com/repos/matthieu-beteille/pancetta/stargazers","contributors_url":"https://api.github.com/repos/matthieu-beteille/pancetta/contributors","subscribers_url":"https://api.github.com/repos/matthieu-beteille/pancetta/subscribers","subscription_url":"https://api.github.com/repos/matthieu-beteille/pancetta/subscription","commits_url":"https://api.github.com/repos/matthieu-beteille/pancetta/commits{/sha}","git_commits_url":"https://api.github.com/repos/matthieu-beteille/pancetta/git/commits{/sha}","comments_url":"https://api.github.com/repos/matthieu-beteille/pancetta/comments{/number}","issue_comment_url":"https://api.github.com/repos/matthieu-beteille/pancetta/issues/comments{/number}","contents_url":"https://api.github.com/repos/matthieu-beteille/pancetta/contents/{+path}","compare_url":"https://api.github.com/repos/matthieu-beteille/pancetta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matthieu-beteille/pancetta/merges","archive_url":"https://api.github.com/repos/matthieu-beteille/pancetta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matthieu-beteille/pancetta/downloads","issues_url":"https://api.github.com/repos/matthieu-beteille/pancetta/issues{/number}","pulls_url":"https://api.github.com/repos/matthieu-beteille/pancetta/pulls{/number}","milestones_url":"https://api.github.com/repos/matthieu-beteille/pancetta/milestones{/number}","notifications_url":"https://api.github.com/repos/matthieu-beteille/pancetta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matthieu-beteille/pancetta/labels{/name}","releases_url":"https://api.github.com/repos/matthieu-beteille/pancetta/releases{/id}","created_at":"2015-11-21T12:13:31Z","updated_at":"2015-11-22T11:53:52Z","pushed_at":"2015-11-29T22:48:51Z","git_url":"git://github.com/matthieu-beteille/pancetta.git","ssh_url":"git@github.com:matthieu-beteille/pancetta.git","clone_url":"https://github.com/matthieu-beteille/pancetta.git","svn_url":"https://github.com/matthieu-beteille/pancetta","homepage":"","size":32,"stargazers_count":0,"watchers_count":0,"language":"Clojure","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"matthieu-beteille:master","ref":"master","sha":"4ce9f732cdebeb287a3fdd9d2dd26be951777340","user":{"login":"matthieu-beteille","id":5712325,"avatar_url":"https://avatars.githubusercontent.com/u/5712325?v=3","gravatar_id":"","url":"https://api.github.com/users/matthieu-beteille","html_url":"https://github.com/matthieu-beteille","followers_url":"https://api.github.com/users/matthieu-beteille/followers","following_url":"https://api.github.com/users/matthieu-beteille/following{/other_user}","gists_url":"https://api.github.com/users/matthieu-beteille/gists{/gist_id}","starred_url":"https://api.github.com/users/matthieu-beteille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthieu-beteille/subscriptions","organizations_url":"https://api.github.com/users/matthieu-beteille/orgs","repos_url":"https://api.github.com/users/matthieu-beteille/repos","events_url":"https://api.github.com/users/matthieu-beteille/events{/privacy}","received_events_url":"https://api.github.com/users/matthieu-beteille/received_events","type":"User","site_admin":false},"repo":{"id":46613884,"name":"pancetta","full_name":"matthieu-beteille/pancetta","owner":{"login":"matthieu-beteille","id":5712325,"avatar_url":"https://avatars.githubusercontent.com/u/5712325?v=3","gravatar_id":"","url":"https://api.github.com/users/matthieu-beteille","html_url":"https://github.com/matthieu-beteille","followers_url":"https://api.github.com/users/matthieu-beteille/followers","following_url":"https://api.github.com/users/matthieu-beteille/following{/other_user}","gists_url":"https://api.github.com/users/matthieu-beteille/gists{/gist_id}","starred_url":"https://api.github.com/users/matthieu-beteille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthieu-beteille/subscriptions","organizations_url":"https://api.github.com/users/matthieu-beteille/orgs","repos_url":"https://api.github.com/users/matthieu-beteille/repos","events_url":"https://api.github.com/users/matthieu-beteille/events{/privacy}","received_events_url":"https://api.github.com/users/matthieu-beteille/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/matthieu-beteille/pancetta","description":"cljs spa project","fork":false,"url":"https://api.github.com/repos/matthieu-beteille/pancetta","forks_url":"https://api.github.com/repos/matthieu-beteille/pancetta/forks","keys_url":"https://api.github.com/repos/matthieu-beteille/pancetta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matthieu-beteille/pancetta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matthieu-beteille/pancetta/teams","hooks_url":"https://api.github.com/repos/matthieu-beteille/pancetta/hooks","issue_events_url":"https://api.github.com/repos/matthieu-beteille/pancetta/issues/events{/number}","events_url":"https://api.github.com/repos/matthieu-beteille/pancetta/events","assignees_url":"https://api.github.com/repos/matthieu-beteille/pancetta/assignees{/user}","branches_url":"https://api.github.com/repos/matthieu-beteille/pancetta/branches{/branch}","tags_url":"https://api.github.com/repos/matthieu-beteille/pancetta/tags","blobs_url":"https://api.github.com/repos/matthieu-beteille/pancetta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matthieu-beteille/pancetta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matthieu-beteille/pancetta/git/refs{/sha}","trees_url":"https://api.github.com/repos/matthieu-beteille/pancetta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matthieu-beteille/pancetta/statuses/{sha}","languages_url":"https://api.github.com/repos/matthieu-beteille/pancetta/languages","stargazers_url":"https://api.github.com/repos/matthieu-beteille/pancetta/stargazers","contributors_url":"https://api.github.com/repos/matthieu-beteille/pancetta/contributors","subscribers_url":"https://api.github.com/repos/matthieu-beteille/pancetta/subscribers","subscription_url":"https://api.github.com/repos/matthieu-beteille/pancetta/subscription","commits_url":"https://api.github.com/repos/matthieu-beteille/pancetta/commits{/sha}","git_commits_url":"https://api.github.com/repos/matthieu-beteille/pancetta/git/commits{/sha}","comments_url":"https://api.github.com/repos/matthieu-beteille/pancetta/comments{/number}","issue_comment_url":"https://api.github.com/repos/matthieu-beteille/pancetta/issues/comments{/number}","contents_url":"https://api.github.com/repos/matthieu-beteille/pancetta/contents/{+path}","compare_url":"https://api.github.com/repos/matthieu-beteille/pancetta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matthieu-beteille/pancetta/merges","archive_url":"https://api.github.com/repos/matthieu-beteille/pancetta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matthieu-beteille/pancetta/downloads","issues_url":"https://api.github.com/repos/matthieu-beteille/pancetta/issues{/number}","pulls_url":"https://api.github.com/repos/matthieu-beteille/pancetta/pulls{/number}","milestones_url":"https://api.github.com/repos/matthieu-beteille/pancetta/milestones{/number}","notifications_url":"https://api.github.com/repos/matthieu-beteille/pancetta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matthieu-beteille/pancetta/labels{/name}","releases_url":"https://api.github.com/repos/matthieu-beteille/pancetta/releases{/id}","created_at":"2015-11-21T12:13:31Z","updated_at":"2015-11-22T11:53:52Z","pushed_at":"2015-11-29T22:48:51Z","git_url":"git://github.com/matthieu-beteille/pancetta.git","ssh_url":"git@github.com:matthieu-beteille/pancetta.git","clone_url":"https://github.com/matthieu-beteille/pancetta.git","svn_url":"https://github.com/matthieu-beteille/pancetta","homepage":"","size":32,"stargazers_count":0,"watchers_count":0,"language":"Clojure","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matthieu-beteille/pancetta/pulls/17"},"html":{"href":"https://github.com/matthieu-beteille/pancetta/pull/17"},"issue":{"href":"https://api.github.com/repos/matthieu-beteille/pancetta/issues/17"},"comments":{"href":"https://api.github.com/repos/matthieu-beteille/pancetta/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/matthieu-beteille/pancetta/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/matthieu-beteille/pancetta/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matthieu-beteille/pancetta/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/matthieu-beteille/pancetta/statuses/a31ab9204ee3ddd20e72b3c31450c22f129f890a"}}}}