From 9679aa0d8f072a06f7c8af3b92c87fc3f23a804c Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Wed, 25 May 2016 01:19:52 -0400 Subject: populate posts table --- src/guff.cr | 20 +++++++++++++++++++- src/views/admin-page.ecr | 25 +++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/guff.cr b/src/guff.cr index d3817d0..dc04fbe 100644 --- a/src/guff.cr +++ b/src/guff.cr @@ -276,6 +276,8 @@ module Guff ON (b.state_id = a.state_id) JOIN sites c ON (c.site_id = a.site_id) + JOIN users d + ON (d.user_id = a.created_by) LEFT JOIN blogs x ON (x.post_id = a.post_id) LEFT JOIN pages y @@ -291,8 +293,22 @@ module Guff a.site_id, c.name AS site_name, b.state, + d.user_id, + d.name AS user_name, + d.email AS user_email, + + a.created_at, + date(a.created_at) AS created_at_text, + datetime(a.created_at) AS created_at_text_full, + a.posted_at, + date(a.posted_at) AS posted_at_text, + datetime(a.posted_at) AS posted_at_text_full, + a.expires_at, + date(a.expires_at) AS expires_at_text, + datetime(a.expires_at) AS expires_at_text_full, + a.slug, a.slug_lock, a.name, @@ -310,7 +326,7 @@ module Guff strftime('/%%Y/%%m/%%d/', a.posted_at) || a.slug || '.html' WHEN y.post_id IS NOT NULL THEN '/' || a.slug || '.html' - WHEN x.post_id IS NOT NULL THEN + WHEN z.post_id IS NOT NULL THEN '/' || a.slug || '/' END ELSE @@ -322,6 +338,8 @@ module Guff ON (b.state_id = a.state_id) JOIN sites c ON (c.site_id = a.site_id) + JOIN users d + ON (d.user_id = a.created_by) LEFT JOIN blogs x ON (x.post_id = a.post_id) diff --git a/src/views/admin-page.ecr b/src/views/admin-page.ecr index ad8d429..f2b44f0 100644 --- a/src/views/admin-page.ecr +++ b/src/views/admin-page.ecr @@ -9,6 +9,7 @@ assets/font-awesome-4.5.0/css/font-awesome.min.css assets/bootstrap-3.3.6/css/bootstrap.min.css assets/bootstrap-3.3.6/css/bootstrap-theme.min.css + assets/css/admin.css } %> @@ -84,6 +85,9 @@ new_post_button %> +
+
+
<%= dropdown( id: "posts-filter-type", @@ -194,8 +198,25 @@
-
-
+ + + + + + + + + + + + + + + +
 NameAuthorSiteURL / SlugCreatedPosted
-- cgit v1.2.3