changeset 10:5d2ae5b8eae2

Trying out pure image solution.
author David Eads <eads@chicagotech.org>
date Fri, 27 Feb 2009 00:37:24 -0600
parents 4626f7e31aa0
children 99ba5941779c
files dnd_test/dnd-library-item.tpl.php dnd_test/dnd_test.css dnd_test/dnd_test.module dnd_test/img/item-1-thumb.jpg dnd_test/img/item-2-thumb.jpg dnd_test/img/item-3-thumb.jpg
diffstat 6 files changed, 35 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/dnd_test/dnd-library-item.tpl.php	Thu Feb 26 22:12:29 2009 -0600
+++ b/dnd_test/dnd-library-item.tpl.php	Fri Feb 27 00:37:24 2009 -0600
@@ -5,8 +5,8 @@
 
   <div class="meta">
     <div class="title"><?php print $title; ?></div>
+    <div class="author"><?php print $author; ?></div>
     <div class="date"><?php print $date; ?></div>
-    <div class="author"><?php print $author; ?></div>
   </div>
 
   <div class="sizes">
--- a/dnd_test/dnd_test.css	Thu Feb 26 22:12:29 2009 -0600
+++ b/dnd_test/dnd_test.css	Fri Feb 27 00:37:24 2009 -0600
@@ -5,14 +5,12 @@
 }
 .dnd-library-wrapper {
   float: left;
-  width: 220px;
-  margin-right: 20px;
+  width: 250px;
+  margin-right: 10px;
   margin-top: 1em;
-  border: 1px solid #aaa;
 }
 .dnd-library-wrapper .header {
   padding: 1px 4px;
-  background-color: #ccc;
 }
 .dnd-library-wrapper .header h3 {
   font-size: 12px;
@@ -30,36 +28,49 @@
 }
 #edit-body-wrapper {
   float: left;
-  width: 700px;
+  width: 600px;
+}
+.dnd-library-wrapper .library {
+  border: 1px solid #aaa;
+  float: left;
 }
 .dnd-library-wrapper .editor-item {
   float: left;
-  width: 220px;
-  border-top: 1px solid #aaa;
-  margin-bottom: 1px;
+  width: 250px;
+  border-bottom: 2px solid #fff;
+  background-color: #ddd;
 }
 .dnd-library-wrapper .editor-item > div {
-  padding: 5px 4px;
+  padding: 3px;
 }
 .dnd-library-wrapper div.image {
   float: left;
-  width: 64px;
-  padding-left: 6px;
+  width: 32px;
+  padding-left: 4px;
   line-height: 1;
 }
 .dnd-library-wrapper div.meta {
   float: left;
-  width: 110px;
+  width: 149px;
+  line-height: 1.2;
 }
 .dnd-library-wrapper .title {
   font-weight: bold;
+  font-size: 12px;
 }
 .dnd-library-wrapper .date, .dnd-library-wrapper .author {
-  font-size: .75em;
+  font-size: 10px;
+  float: left;
+  margin-top: .5em;
+}
+.dnd-library-wrapper .author {
+  margin-right: 1em;
 }
 .dnd-library-wrapper .editor-item .sizes {
   float: left;
-  width: 18px;
+  width: 50px;
+  margin-top: 14px;
+  line-height: 1;
 }
 .dnd-library-wrapper .editor-item .sizes ul {
   list-style-type: none;
@@ -68,8 +79,9 @@
 .dnd-library-wrapper .editor-item .sizes ul li {
   background: none;
   list-style-type: none;
+  display: inline;
   padding: 0;
-  margin: 0;
+  margin: 0 0 0 2px;
 }
 .dnd-library-wrapper .editor-item .sizes a {
   float: left;
--- a/dnd_test/dnd_test.module	Thu Feb 26 22:12:29 2009 -0600
+++ b/dnd_test/dnd_test.module	Fri Feb 27 00:37:24 2009 -0600
@@ -20,7 +20,6 @@
   return array('access dnd test library');
 }
 
-
 /**
  * Implementation of hook_form_alter().
  *
@@ -71,7 +70,7 @@
 /**
  * Create contrived output
  */
-function dnd_test_generate_library($page = 1, $limit = 5) {
+function dnd_test_generate_library($page = 1, $limit = 12) {
   $start = ($page * $limit) - ($limit); 
   $end   = $page * $limit;
 
@@ -89,7 +88,7 @@
 
 /**
  * Theme wrapper that spins out multiple library representations for a given
- * editor representation.  This is because we want to demonstrate how to allow
+ ;[''''* editor representation.  This is because we want to demonstrate how to allow
  * for multiple versions (i.e. different sizes) of a single item
  */
 function dnd_editor_items($i) {
@@ -121,14 +120,11 @@
   $variables['date'] = 'Feb 18 2009';
   $variables['author'] = 'David Eads';
   foreach(array(t('S'), t('M'), t('L')) as $size) {
-    $sizes[] = l('<span>'. $size .'</span>', '', array( 
-      'html'       => TRUE,
-      'attributes' => array(
-        'class' => 'drop size-'. $size, 
-        'id' => 'item-'. $i .'-'. $size,
-      ),
-      'query' => array('dnd_id' => 'item-'. $i .'-'. $size),
-    ));
+    $attributes = array(
+      'class' => 'drop size-'. $size, 
+      'id' => 'item-'. $i .'-'. $size,
+    );
+    $sizes[] = theme('image', drupal_get_path('module', 'dnd_test') .'/img/icon/'. $size .'.png', $size, $size, $attributes);
   }
   $variables['sizes'] = '<ul><li>'. implode('</li><li>', $sizes) .'</li></ul>';
 }
Binary file dnd_test/img/item-1-thumb.jpg has changed
Binary file dnd_test/img/item-2-thumb.jpg has changed
Binary file dnd_test/img/item-3-thumb.jpg has changed