make edit posts column nicer
This commit is contained in:
parent
b6888da24c
commit
83dbaebd0c
@ -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, __('<span class="wdts-posts-queued-icon"> </span> <span class="wdts-posts-approved-icon"> </span>'));
|
||||
|
||||
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 "<span title=\"${label}\" class=\"wdts-posts-${style}-icon\">" . $count . '</span> ';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
}
|
BIN
graphics/transcript-icon-background.png
Normal file
BIN
graphics/transcript-icon-background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 131 B |
Loading…
Reference in New Issue
Block a user