You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2006/12/19 17:40:52 UTC

svn commit: r488725 - in /lenya/trunk/src: modules/lucene/ modules/lucene/resources/ modules/lucene/resources/i18n/ modules/lucene/xslt/ pubs/default/config/ pubs/default/resources/shared/css/

Author: andreas
Date: Tue Dec 19 08:40:52 2006
New Revision: 488725

URL: http://svn.apache.org/viewvc?view=rev&rev=488725
Log:
Improved search screen layout and i18n

Added:
    lenya/trunk/src/modules/lucene/resources/
    lenya/trunk/src/modules/lucene/resources/i18n/
    lenya/trunk/src/modules/lucene/resources/i18n/cmsui.xml
    lenya/trunk/src/modules/lucene/resources/i18n/cmsui_de.xml
Modified:
    lenya/trunk/src/modules/lucene/sitemap.xmap
    lenya/trunk/src/modules/lucene/xslt/search2html.xsl
    lenya/trunk/src/pubs/default/config/publication.xconf
    lenya/trunk/src/pubs/default/resources/shared/css/page.xml

Added: lenya/trunk/src/modules/lucene/resources/i18n/cmsui.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/lucene/resources/i18n/cmsui.xml?view=auto&rev=488725
==============================================================================
--- lenya/trunk/src/modules/lucene/resources/i18n/cmsui.xml (added)
+++ lenya/trunk/src/modules/lucene/resources/i18n/cmsui.xml Tue Dec 19 08:40:52 2006
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: cmsui.xml 446542 2006-09-15 08:14:39Z andreas $ -->
+
+<catalogue xml:lang="en" xmlns:xhtml="http://www.w3.org/1999/xhtml">
+
+  <message key="Search">Search</message>
+  <message key="Rank">Rank</message>
+  <message key="Score">Score</message>
+  <message key="No Title">(no title)</message>
+  <message key="hits">{0} hits</message>
+  
+</catalogue>

Added: lenya/trunk/src/modules/lucene/resources/i18n/cmsui_de.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/lucene/resources/i18n/cmsui_de.xml?view=auto&rev=488725
==============================================================================
--- lenya/trunk/src/modules/lucene/resources/i18n/cmsui_de.xml (added)
+++ lenya/trunk/src/modules/lucene/resources/i18n/cmsui_de.xml Tue Dec 19 08:40:52 2006
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: cmsui_de.xml 446542 2006-09-15 08:14:39Z andreas $ -->
+
+<catalogue xml:lang="de" xmlns:xhtml="http://www.w3.org/1999/xhtml">
+
+  <message key="Search">Suche</message>
+  <message key="Rank">Rang</message>
+  <message key="Score">Quote</message>
+  <message key="No Title">(kein Titel)</message>
+  <message key="hits">{0} Ergebnisse</message>
+  
+</catalogue>
+

Modified: lenya/trunk/src/modules/lucene/sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/lucene/sitemap.xmap?view=diff&rev=488725&r1=488724&r2=488725
==============================================================================
--- lenya/trunk/src/modules/lucene/sitemap.xmap (original)
+++ lenya/trunk/src/modules/lucene/sitemap.xmap Tue Dec 19 08:40:52 2006
@@ -110,9 +110,10 @@
           <map:parameter name="root" value="{base-url:{page-envelope:publication-id}:{page-envelope:area}}"/>
           <map:parameter name="use-request-parameters" value="true"/>
         </map:transform>
-
+        
         <map:transform type="cinclude"/>
         <map:transform type="link-rewrite"/>
+        <map:transform type="i18n"/>
 
         <map:serialize type="xml"/>
       </map:match>

Modified: lenya/trunk/src/modules/lucene/xslt/search2html.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/lucene/xslt/search2html.xsl?view=diff&rev=488725&r1=488724&r2=488725
==============================================================================
--- lenya/trunk/src/modules/lucene/xslt/search2html.xsl (original)
+++ lenya/trunk/src/modules/lucene/xslt/search2html.xsl Tue Dec 19 08:40:52 2006
@@ -22,6 +22,7 @@
   xmlns:xhtml="http://www.w3.org/1999/xhtml"
   xmlns="http://www.w3.org/1999/xhtml"
   xmlns:cinclude="http://apache.org/cocoon/include/1.0"
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
   exclude-result-prefixes="cinclude search xhtml"
 >
 
@@ -38,13 +39,26 @@
   </xsl:template>
 
   <xsl:template match="search:hits">
+    <!--
     <h1>
         <xsl:value-of select="@total-count"/> hit<xsl:if test="@total-count &gt; 1">s</xsl:if>
         <xsl:text>, </xsl:text>
         <xsl:value-of select="@count-of-pages"/> result page<xsl:if test="@count-of-pages &gt; 1">s</xsl:if> on query
         <em><xsl:value-of select="/search:results/@query-string"/></em>
     </h1>
+    -->
+    <h1><i18n:text>Search</i18n:text></h1>
+    <form action="" method="get" style="margin-bottom: 20px">
+      <input name="queryString" type="text" style="width: 400px" value="{/search:results/@query-string}"
+      />&#160;<input type="submit" name="submit" value="Search" i18n:attr="value"/>
+    </form>
     
+    <h2>
+      <i18n:translate>
+        <i18n:text>hits</i18n:text>
+        <i18n:param><xsl:value-of select="@total-count"/></i18n:param>
+      </i18n:translate>
+    </h2>
     <ul class="search-results">
       <xsl:apply-templates/>
     </ul>
@@ -89,18 +103,26 @@
   
   <xsl:template match="search:hit">
     <li class="search-result">
-      <div class="search-result-score">Score: <xsl:value-of select="format-number( @score, '### %' )"/></div> 
-      <div class="search-result-rank">Rank: <xsl:value-of select="@rank"/></div>
+      <div class="search-result-rank"><xsl:value-of select="@rank + 1"/>. </div>
       <div class="search-result-title">
-        <xsl:variable name="title" select="search:field[attribute::name='title']"/>
+        <xsl:variable name="titleField" select="search:field[attribute::name='title']"/>
+        <xsl:variable name="title">
+          <xsl:choose>
+            <xsl:when test="normalize-space($titleField) != ''">
+              <xsl:value-of select="$titleField"/>
+            </xsl:when>
+            <xsl:otherwise><i18n:text>No Title</i18n:text></xsl:otherwise>
+          </xsl:choose>
+        </xsl:variable>
         <xsl:choose>
           <xsl:when test="normalize-space(search:field[@name = 'uid']) != ''">
             <a href="{$root}{search:field[attribute::name='uid']}"><xsl:value-of select="$title"/></a>
           </xsl:when>
           <xsl:otherwise>
-            <xsl:value-of select="$title"/> (not in site structure)
+            <xsl:value-of select="$title"/> (<i18n:text>not in site structure</i18n:text>)
           </xsl:otherwise>
         </xsl:choose>
+      <span class="search-result-score"> (<i18n:text>Score</i18n:text>: <xsl:value-of select="format-number( @score, '### %' )"/>)</span>
       </div>
       <div class="search-result-description"><xsl:value-of select="search:field[attribute::name='description']"/></div>
     </li>
@@ -145,7 +167,6 @@
     <xsl:param name="next-index"/>
 
     <xsl:if test="$has-previous = 'true'">
-      
       <xsl:call-template name="navigation-link">
         <xsl:with-param name="query-string"><xsl:value-of select="$query-string"/></xsl:with-param>
         <xsl:with-param name="page-length"><xsl:value-of select="$page-length"/></xsl:with-param>

Modified: lenya/trunk/src/pubs/default/config/publication.xconf
URL: http://svn.apache.org/viewvc/lenya/trunk/src/pubs/default/config/publication.xconf?view=diff&rev=488725&r1=488724&r2=488725
==============================================================================
--- lenya/trunk/src/pubs/default/config/publication.xconf (original)
+++ lenya/trunk/src/pubs/default/config/publication.xconf Tue Dec 19 08:40:52 2006
@@ -54,6 +54,7 @@
   <module name="workflow-impl"/>
   <module name="notification"/>
   <module name="svg"/>
+  <module name="lucene"/>
   <!-- TODO: The goal is to have a blog module ;-) -->
   <!--
   <module name="blog"/>

Modified: lenya/trunk/src/pubs/default/resources/shared/css/page.xml
URL: http://svn.apache.org/viewvc/lenya/trunk/src/pubs/default/resources/shared/css/page.xml?view=diff&rev=488725&r1=488724&r2=488725
==============================================================================
--- lenya/trunk/src/pubs/default/resources/shared/css/page.xml (original)
+++ lenya/trunk/src/pubs/default/resources/shared/css/page.xml Tue Dec 19 08:40:52 2006
@@ -382,28 +382,33 @@
 
 /* Search Results */
 
-.search-results {} 
+.search-results {
+    list-style-type: none;
+    margin: 0;
+    padding: 0;
+} 
 
 .search-result {
-    padding: 0.50em;
+    padding: 0.50em 0;
 }
 
 .search-result-score {
-    font-size: 90%; 
-    float: right;
+    /* float: right; */
+    font-size: 90%;
 }
 
 .search-result-rank {
-    font-size: 90%; 
-    float: right; 
-    margin-right: 20px;
+    float: left; 
+    font-size: 110%;
 }
 
 .search-result-title {
-    font-size: 105%;
+    margin: 0 0 0 30px;
+    padding: 0;
+    font-size: 110%;
 }
 
 .search-result-description {
-    font-size: 90%;
+    margin-left: 30px;
 }
 </css>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org