From 83dbaebd0cf8e739b693559ed7e35d0d4d55cd03 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sun, 25 Oct 2009 20:29:17 -0400 Subject: [PATCH] make edit posts column nicer --- classes/WhatDidTheySayAdmin.inc | 21 +++++++++++++++++---- css/wdts-admin.css | 18 ++++++++++++++++++ graphics/transcript-icon-background.png | Bin 0 -> 131 bytes 3 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 graphics/transcript-icon-background.png diff --git a/classes/WhatDidTheySayAdmin.inc b/classes/WhatDidTheySayAdmin.inc index fe20f06..4146b3c 100644 --- a/classes/WhatDidTheySayAdmin.inc +++ b/classes/WhatDidTheySayAdmin.inc @@ -346,6 +346,10 @@ class WhatDidTheySayAdmin { } } + if (strpos($pagenow, 'edit') === 0) { + wp_enqueue_style('wdts-admin', plugin_dir_url(dirname(__FILE__)) . 'css/wdts-admin.css'); + } + wp_enqueue_script('scriptaculous-effects'); add_action('wp_head', array(&$this, 'include_editor_javascript')); @@ -407,7 +411,7 @@ class WhatDidTheySayAdmin { if ($index === false) { $index = count($keys); } array_splice($keys, $index, 0, array('transcripts')); - array_splice($values, $index, 0, __('Trans')); + array_splice($values, $index, 0, __('   ')); return array_combine($keys, $values); } @@ -417,10 +421,19 @@ class WhatDidTheySayAdmin { */ function manage_posts_custom_column($name, $post_id) { if ($name === "transcripts") { - $queued_transcript_object = new WDTSQueuedTranscript($post_id); + foreach (array('Queued' => __('Queued', 'what-did-they-say'), 'Approved' => __('Approved', 'what-did-they-say')) as $type => $label) { + $class = "WDTS${type}Transcript"; + $transcript_object = new $class($post_id); + $style = strtolower($type); - if (($queued_count = $queued_transcript_object->count()) > 0) { - printf(__('%s queued', 'what-did-they-say'), $queued_count); + $count = 0; + foreach ($transcript_object->get_transcripts() as $language => $transcript_info) { + if (!empty($transcript_info['transcript'])) { $count++; } + } + + if ($count > 0) { + echo "" . $count . ' '; + } } } } diff --git a/css/wdts-admin.css b/css/wdts-admin.css index 469a94d..59ec8cf 100644 --- a/css/wdts-admin.css +++ b/css/wdts-admin.css @@ -105,6 +105,24 @@ h3.wdts { padding: 0.75em; } +.widefat .column-transcripts { + padding-top: 8px; +} + +.wdts-posts-queued-icon, .wdts-posts-approved-icon { + background: url(../graphics/transcript-icon-background.png) 1px 1px no-repeat; + font-size: 9px; + padding: 2px 6px; + color: white +} +.wdts-posts-queued-icon { + background-color: #c99 +} + +.wdts-posts-approved-icon { + background-color: #aaa +} + body { overflow-x: hidden } \ No newline at end of file diff --git a/graphics/transcript-icon-background.png b/graphics/transcript-icon-background.png new file mode 100644 index 0000000000000000000000000000000000000000..e3e33d818d44d8d08e418024cb1445b4505f857c GIT binary patch literal 131 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=$1|-8uW1a&k#^NA%Cx&(BWL^R}ww^AIAsXkC z6BGmuj0_A6&djm=Y`-a?s>({)hiC3thmE`j!V`VfZkO;#U+`VpEB`{=>&73KoxDGs cIMb{cb{+L#-y2%M0yK!h)78&qol`;+0B^=7j{pDw literal 0 HcmV?d00001