diff of de90cbdf59432063beb7cde9d47e1bd8b3a746fb
de90cbdf59432063beb7cde9d47e1bd8b3a746fb
diff --git a/elm-frontti/src/PostsAdmin.elm b/elm-frontti/src/PostsAdmin.elm
index c53a35a..c20d6a5 100644
--- a/elm-frontti/src/PostsAdmin.elm
+++ b/elm-frontti/src/PostsAdmin.elm
@@ -45,6 +45,9 @@ titleView title = case (int_to_month_string title.month) of
Nothing -> div [] [text ("Parsing month " ++ (String.fromInt title.month) ++ " failed")]
view titles = (div [class "vertical-flex-container"]
- (titles |>
- List.map titleView))
+ (if titles /= [] then
+ (titles
+ |> List.map titleView)
+ else [ span [] [ text "No posts in murja. Create one by "
+ , button [ onClick GenNewPost ] [ text "clicking here" ]]]))
diff --git a/src/routes/post-routes.lisp b/src/routes/post-routes.lisp
index 7761f42..952bfd9 100644
--- a/src/routes/post-routes.lisp
+++ b/src/routes/post-routes.lisp
@@ -21,7 +21,7 @@
:decorators (@json @transaction @authenticated (@can? "edit-post"))) ()
(let ((titles (get-titles-by-year :allow-hidden? t)))
- (stringify titles)))
+ (stringify (or titles #()))))
(defroute get-page-route ("/api/posts/page/:page" :method :get
:decorators (@json @transaction))