Simple css reference name needed

Archived from the Xataface Users forum.

rlevin — Fri Sep 02, 2011 8:50 am

I want to expand the default input box a bit wider. I notice “input” in plone.css, but giving it a width parameter changes all fields such as the calendar widget input box. What id or class name should I be looking at to adjust the default input box for varchar type data?


shannah — Sun Sep 04, 2011 9:49 pm

Ah.. This change has been made in SVN (so that cells now include a CSS class indicating the field type). Unfortunately the plan is to freeze features on 1.x. This will be released with 2.0 but there is still a long ways to go before that will be released. Here is the SVN log entry for this particular change:

Code: Select all
`r2217 shannah 2011-04-24 12:29:43 -0700 (Sun, 24 Apr 2011) 16 lines

Added css classes to result list and related list to make it easier to target them. 
This includes the following classes:
For result list <table> tag:
   1. resultList
   2. resultList–

For result list <td> tag:    1. resultListCell--    2. resultListCell For related list <table> tag:    1. relatedList    2. relatedList--    3. relatedList---- For related list <td> tag:    1. resultListCell--    2. resultListCell`

And the diff:

Code: Select all
mini:~ shannah$ svn diff -r 2216:2217 http://weblite.ca/svn/dataface/core/trunk Index: Dataface/ResultList.php =================================================================== --- Dataface/ResultList.php   (revision 2216) +++ Dataface/ResultList.php   (revision 2217) @@ -236,7 +236,7 @@             <script>if ( typeof(xataface) == "undefined" ){xataface = {};} xataface.query = '.$sq.';</script>             <script>if ( typeof(jQuery)=="undefined") document.writeln("<"+"script src=\"'.DATAFACE_URL.'/js/jquery.packed.js\"><"+"/script>");</script>             <script src="'.DATAFACE_URL.'/js/list.js"></script> -            <table  id="result_list" class="listing"> +            <table  id="result_list" class="listing resultList resultList--'.$this->_tablename.'">             <thead>             <tr>';          if ( $canSelect){ @@ -346,11 +346,11 @@             $recordid = $record->getId();             echo "<tr class=\"listing $rowClass\">";             if ( $canSelect ) { -               echo '<td><input class="rowSelectorCheckbox" id="rowSelectorCheckbox:'.$record->getId().'" type="checkbox"></td>'; +               echo '<td class="checkbox-cell"><input class="rowSelectorCheckbox" id="rowSelectorCheckbox:'.$record->getId().'" type="checkbox"></td>';             }                          if ( !@$app->prefs['disable_ajax_record_details']  ){ -               echo '<td>'; +               echo '<td class="ajax-record-details-cell">';                echo '<script language="javascript" type="text/javascript"><!--                      registerRecord(\''.addslashes($recordid).'\',  '.$record->toJS(array()).');                      //--></script> @@ -400,7 +400,9 @@                                      if ( @$thisField['noEditInListView'] ) $editable_class='';                    -                  echo "<td id=\"td-".rand()."\" class=\"$rowClass $editable_class\">&nbsp;$val</td>"; +                   +                  $cellClass = 'resultListCell resultListCell--'.$key; +                  echo "<td id=\"td-".rand()."\" class=\"$cellClass $rowClass $editable_class\">&nbsp;$val</td>";                   unset($thisField);                }             } Index: Dataface/RelatedList.php =================================================================== --- Dataface/RelatedList.php   (revision 2216) +++ Dataface/RelatedList.php   (revision 2217) @@ -348,7 +348,7 @@          echo '<div style="display:none" id="related_find_wrapper"></div>';          if ( count($records) > 0 ){             echo ' -               <table class="listing" id="relatedList"> +               <table class="listing relatedList relatedList--'.$this->_tablename.' relatedList--'.$this->_tablename.'--'.$this->_relationship_name.'" id="relatedList">                <thead>                <tr>';                 @@ -536,11 +536,11 @@                                                  $accessClass = '';                      } -                      +                     $cellClass = 'resultListCell resultListCell--'.$key;                      $renderVal = $this->renderCell($srcRecord, $field['Field']);                      if ( isset($renderVal) ) $val = $renderVal;                      else if ( $link and !@$field['noLinkFromListView'] ) $val = "<a href=\"$link\" title=\"". htmlspecialchars($title)."\">".$val."</a>"; -                     echo "<td class=\"$rowClass $accessClass\">$val</td>\n"; +                     echo "<td class=\"$cellClass $rowClass $accessClass\">$val</td>\n";                      unset($srcRecord);                   }

shannah — Sun Sep 04, 2011 9:50 pm

Whoops… that was the wrong change. That was one that allows you to target columns by name - not type…. hold on.. I’ll post the right change in a sec.


shannah — Sun Sep 04, 2011 9:52 pm

Here it is:

Code: Select all
`mini:~ shannah$ svn diff -r 2423:2424 http://weblite.ca/svn/dataface/core/trunk
Index: Dataface/ResultList.php
===================================================================
— Dataface/ResultList.php   (revision 2423)
+++ Dataface/ResultList.php   (revision 2424)
@@ -402,6 +402,7 @@
                  
                  
                  $cellClass = ‘resultListCell resultListCell–’.$key;
+                  $cellClass .= ‘ ‘.$record->table()->getType($key);
                  echo “<td id="td-“.rand().”" class="$cellClass $rowClass $editable_class"> $val</td>”;
                  unset($thisField);
               }
Index: Dataface/RelatedList.php
===================================================================
— Dataface/RelatedList.php   (revision 2423)
+++ Dataface/RelatedList.php   (revision 2424)
@@ -500,37 +500,7 @@
                  $field =& $fields_index[$key];//$s->getField($fullpath);
                  $srcRecord =& $rrec->toRecord($field[‘tablename’]);
                  $link = $srcRecord->getURL(‘-action=browse’);
-                  /*
-                  if ( isset($link_queries[$col_tables[$key]]) ){
-                     $query = $link_queries[$col_tables[$key]];
-                     $failed = false;
-                  } else {
-                     
-                     $query = array( “-action”=>”browse”, “-relationship”=>null, “-cursor”=>0, “-table”=>$col_tables[$key]) ;
-                     $failed = false;
-                        // flag to indicate if we failed to generate appropriate link
-                     
-                     foreach ( $table_keys[$col_tables[$key]] as $table_key ){
-                        $query[$table_key] = “=”.$this->_record->getValueAsString($this->_relationship_name.’.’.$table_key, $i, $this->_where, $sort_columns_str);
-                        if ( $query[$table_key] == ‘=’ ){
-                           if ( isset( $fkeys[$col_tables[$key]][$table_key]) ){
-                              $query[$table_key] = $this->_record->parseString($fkeys[$col_tables[$key]][$table_key]);
-                           } else {
-                              $failed = true;
-                           }
-                        }
-                     }
-                     $link_queries[$col_tables[$key]] = $query;
-                  }
                  
-                  if ( $failed ){
-                     $link = “#”;
-                  } else {
-                     
-                     $link = Dataface_LinkTool::buildLink($query, false);
-                  }
-                  */
-                  //$val = ‘’;
                  $val = $this->_record->preview($fullpath, $i,255, $this->_where, $sort_columns_str);
                  $title = “”;
                  
@@ -547,6 +517,7 @@
                        $accessClass = ‘’;
                     }
                     $cellClass = ‘resultListCell resultListCell–’.$key;
+                     $cellClass .= ‘ ‘.$srcRecord->table()->getType($key);
                     $renderVal = $this->renderCell($srcRecord, $field[‘Field’]);
                     if ( isset($renderVal) ) $val = $renderVal;
                     else if ( $link and !@$field[‘noLinkFromListView’] and !$this->noLinks) $val = “<a href="$link" title="”. htmlspecialchars($title).”">”.$val.”</a>”;
Index: plone.css
===================================================================
— plone.css   (revision 2423)
+++ plone.css   (revision 2424)
@@ -2712,4 +2712,16 @@
   padding-bottom:2px;
   vertical-align:text-top;
   font-style:italic;
+}
  • +table.listing td.resultListCell.decimal,
    +table.listing td.resultListCell.int,
    +table.listing td.resultListCell.float,
    +table.listing td.resultListCell.double,
    +table.listing td.resultListCell.tinyint,
    +table.listing td.resultListCell.mediumint,
    +table.listing td.resultListCell.bigint,
    +table.listing td.resultListCell.smallint,
    +table.listing td.resultListCell.real {
    +   text-align: right;
    }
    \ No newline at end of file`