-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add about section #86
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,7 +82,10 @@ | |
|
||
(defn channel-days [db chan-name] | ||
(when-let [indexes @!indexes] | ||
(let [{:keys [chan-day-cnt chan-name->id] :as index} @!indexes] | ||
(let [{:keys [chan-day-cnt chan-name->id] :as index} | ||
(if (seq @!indexes) | ||
@!indexes | ||
{:chan-day-cnt {} :chan-name->id {}})] | ||
Comment on lines
+85
to
+88
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a hack to solve #61. I'd like to find a clean solution. But the suggested (defonce !indexes (atom {:chan-name->id {} ,,,})) does not work, because after calling (go) at the repl, !indexes is reset to empty map {}. Question: which code is actually called when I type (go) at the repl? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I would approach this differently, and make sure the indexes are |
||
(when index | ||
(some->> chan-name | ||
chan-name->id | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -220,14 +220,22 @@ | |
[:body | ||
[:div.main | ||
(fork-me-badge) | ||
[:p | ||
[:a {:href (path-for context :clojurians-log.routes/about)} | ||
"About Clojurians Slack Log"]] | ||
[:p | ||
[:a {:href (path-for context :clojurians-log.routes/sitemap)} | ||
"Sitemap"]] | ||
[:h1 "Channels"] | ||
[:ul | ||
(for [{:channel/keys [name]} channels] | ||
[:li | ||
[:a {:href (path-for context | ||
:clojurians-log.routes/channel | ||
{:channel name})} | ||
"# " name]])]]]]) | ||
(if (seq channels) | ||
[:ul | ||
(for [{:channel/keys [name]} channels] | ||
[:li | ||
[:a {:href (path-for context | ||
:clojurians-log.routes/channel | ||
{:channel name})} | ||
"# " name]])] | ||
[:p "no data loaded"])]]]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix for #61. Question: is there a more suitable text than "no data loaded", especially for the production environment? |
||
|
||
(defn log-page [context] | ||
(assoc context :response/html (log-page-html context))) | ||
|
@@ -237,3 +245,43 @@ | |
|
||
(defn channel-list-page [context] | ||
(assoc context :response/html (channel-list-page-html context))) | ||
|
||
(defn- about-html [context] | ||
[:html | ||
(page-head context) | ||
[:body | ||
[:div.main | ||
(fork-me-badge) | ||
[:h1 "About Clojurians Slack Log"] | ||
[:p "One of the main on-line hangouts for Clojure people is the " | ||
[:a {:href "http://clojurians.net"} "Clojurians Slack community"] | ||
". Unfortunately it suffers from its popularity. Slack will only retain the last 10,000 messages of history, that is less than two weeks of logs. A lot of valuable information is in that chat history. The Clojureverse team has decided to set up this service so that the logs aren’t lost in time." | ||
[:p "If some channel is not logging, it's probably because @logbot isn't receiving its messages. Feel free to invite @logbot to a channel to start logging"] | ||
[:p "The source code is in " | ||
[:a {:href "https://github.com/clojureverse/clojurians-log-app"} | ||
"this"] " github repo, you are welcome to contribute."]] | ||
[:p "The hosting of Clojurians Slack Log is kindly donated by " [:a {:href "https://www.exoscale.com"} "Exoscale."]]]]]) | ||
|
||
(defn about [context] | ||
(assoc context :response/html (about-html context))) | ||
|
||
(defn- sitemap-html [{:data/keys [channel-day-tuples] :as context}] | ||
[:html | ||
(page-head context) | ||
[:body | ||
[:div.main | ||
(fork-me-badge) | ||
[:h1 "Sitemap"] | ||
(if (seq channel-day-tuples) | ||
[:ul | ||
(for [[{:channel/keys [name]} channel-days] channel-day-tuples] | ||
(for [[day cnt] channel-days] | ||
[:li [:a {:href (path-for context | ||
:clojurians-log.routes/channel-date | ||
{:channel name | ||
:date day})} | ||
"# " name " " day " (" cnt ")"]]))] | ||
Comment on lines
+276
to
+283
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Attempt to solve #50 |
||
[:p "no data loaded"])]]]) | ||
|
||
(defn sitemap [context] | ||
(assoc context :response/html (sitemap-html context))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useful snippets for repl-driven development in Sapcemacs. Question: is there a better place to put this? Or do you bind those to some keystrokes in your IDE? Or in general: which keystrokes do you bind to which commands for repl-driven development?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine to have it in a comment here. Alternatively you can put it in a file in the
repl/
directory.I also use Spacemacs, with standard bindings like
, e e
to eval. I also have some leader key bindings myself.I use
, e p
a lot., e P
will insert the result in the buffer in a comment, or you can useSPC u , e e
to insert directly.The bottom ones are to undo the recent keybinding changes in the spacemacs clojure layer.
I also have a special
, , <register>
binding, so I can put snippets in a register and eval them from anywhere. I don't use it a lot, but sometimes it's very handy.