You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by gh...@apache.org on 2014/06/17 17:09:24 UTC

svn commit: r1603198 - in /roller/trunk/app/src/main/webapp: WEB-INF/velocity/weblog.vm themes/basic/searchresults.vm themes/brushedmetal/searchresults.vm themes/frontpage/weblog.vm themes/sotto/searchresults.vm

Author: ghuber
Date: Tue Jun 17 15:09:23 2014
New Revision: 1603198

URL: http://svn.apache.org/r1603198
Log:
Fix for ROL-1789.

Modified:
    roller/trunk/app/src/main/webapp/WEB-INF/velocity/weblog.vm
    roller/trunk/app/src/main/webapp/themes/basic/searchresults.vm
    roller/trunk/app/src/main/webapp/themes/brushedmetal/searchresults.vm
    roller/trunk/app/src/main/webapp/themes/frontpage/weblog.vm
    roller/trunk/app/src/main/webapp/themes/sotto/searchresults.vm

Modified: roller/trunk/app/src/main/webapp/WEB-INF/velocity/weblog.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/velocity/weblog.vm?rev=1603198&r1=1603197&r2=1603198&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/velocity/weblog.vm (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/velocity/weblog.vm Tue Jun 17 15:09:23 2014
@@ -735,12 +735,14 @@ Show search form for a weblog.
           <input type="text" id="q" name="q" size="10" class="text small" maxlength="255" value="#if($model.term)$model.term#end" />
           #if( $showCatChooser )
             #set( $cats = $model.weblog.getWeblogCategories())
-            <select name="cat">
-            <option value="">- $text.get("mainPage.category") -</option>
-            #foreach( $cat in $cats )
-              <option #if($cat.name == $model.term)selected="selected"#end>$cat.name</option>
+            #if(!$site && !$cats.empty)
+              <select name="cat">
+                <option value="">- $text.get("mainPage.category") -</option>
+                #foreach( $cat in $cats )
+                  <option #if($cat.name == $model.term)selected="selected"#end>$cat.name</option>
+                #end
+              </select>
             #end
-            </select>
           #end
           <input type="submit" class="button" value="$text.get( "macro.weblog.searchbutton" )" id="searchbutton" />
         </p>
@@ -763,12 +765,14 @@ Show search form for a weblog.
           <input type="search" id="q" name="q" placeholder="Search..." maxlength="255" value="#if($model.term)$model.term#end" />
           #if( $showCatChooser )
             #set( $cats = $model.weblog.getWeblogCategories())
-            <select name="cat">
-            <option value="">- $text.get("mainPage.category") -</option>
-            #foreach( $cat in $cats )
-              <option #if($cat.name == $model.term)selected="selected"#end>$cat.name</option>
+            #if(!$site && !$cats.empty)
+              <select name="cat">
+                <option value="">- $text.get("mainPage.category") -</option>
+                #foreach( $cat in $cats )
+                  <option #if($cat.name == $model.term)selected="selected"#end>$cat.name</option>
+                #end
+              </select>
             #end
-            </select>
           #end
           <input type="submit" id="searchbutton" data-role="button" data-theme="e" value="$text.get( "macro.weblog.searchbutton" )" />
         </p>
@@ -798,19 +802,21 @@ Show search again form for a weblog.
         $text.get( "macro.weblog.searchdictionary", [$model.term, $model.term, $model.term] )
         $text.get( "macro.weblog.searchhits", [$model.hits])
         <form method="get" action="$url.search" style="margin: 5px">
-            <input type="text" id="q" name="q" class="text medium" maxlength="255" value="$model.term" style="padding-left: 1px" /><br />
-            #set( $cats = $model.weblog.getWeblogCategories())
+          <input type="text" id="q" name="q" class="text medium" maxlength="255" value="$model.term" style="padding-left: 1px" /><br />
+          #set( $cats = $model.weblog.getWeblogCategories())
+          #if(!$site && !$cats.empty)
             <select name="cat" class="select">
-            <option value="">$text.get( "macro.searchresults.incategory" )</option>
-            #foreach( $cat in $cats )
-              <option #if($cat.name == $model.weblogCategory.name)selected="selected"#end>$cat.name</option>
-            #end
+              <option value="">$text.get( "macro.searchresults.incategory" )</option>
+              #foreach( $cat in $cats )
+                <option #if($cat.name == $model.weblogCategory.name)selected="selected"#end>$cat.name</option>
+              #end
             </select>
+          #end
 
-            <input type="submit" value="$text.get( "macro.weblog.searchagain" )" class="button" />
+          <input type="submit" value="$text.get( "macro.weblog.searchagain" )" class="button" />
         </form>
 
-        $text.get( "macro.weblog.searchgoogle", [$model.term, $url.absoluteSite, $url.site, ${website.handle}] )
+        $text.get( "macro.weblog.searchgoogle", [$model.term, $url.absoluteSite, $url.site, ${weblog.handle}] )
     </div>
 #end
 ## Mobile Version
@@ -819,16 +825,18 @@ Show search again form for a weblog.
         $text.get( "macro.weblog.searchdictionary", [$model.term, $model.term, $model.term] )
         $text.get( "macro.weblog.searchhits", [$model.hits])
         <form method="get" action="$url.search" style="margin: 5px">
-            <input type="search" id="q" name="q" placeholder="Search..." maxlength="255" value="$model.term" />
-            #set( $cats = $model.weblog.getWeblogCategories())
+          <input type="search" id="q" name="q" placeholder="Search..." maxlength="255" value="$model.term" />
+          #set( $cats = $model.weblog.getWeblogCategories())
+          #if(!$site && !$cats.empty)
             <select name="cat" class="select">
-            <option value="">$text.get( "macro.searchresults.incategory" )</option>
-            #foreach( $cat in $cats )
-              <option #if($cat.name == $model.weblogCategory.name)selected="selected"#end>$cat.name</option>
-            #end
+              <option value="">$text.get( "macro.searchresults.incategory" )</option>
+              #foreach( $cat in $cats )
+                <option #if($cat.name == $model.weblogCategory.name)selected="selected"#end>$cat.name</option>
+              #end
             </select>
+          #end
 
-            <input type="submit" data-role="button" data-theme="e" value="$text.get( "macro.weblog.searchagain" )" />
+          <input type="submit" data-role="button" data-theme="e" value="$text.get( "macro.weblog.searchagain" )" />
         </form>
 
     </div>

Modified: roller/trunk/app/src/main/webapp/themes/basic/searchresults.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/basic/searchresults.vm?rev=1603198&r1=1603197&r2=1603198&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/themes/basic/searchresults.vm (original)
+++ roller/trunk/app/src/main/webapp/themes/basic/searchresults.vm Tue Jun 17 15:09:23 2014
@@ -20,7 +20,9 @@
         #set($pager = $model.getWeblogEntriesPager()) 
         <div class="next-previous">
             #showWeblogSearchAgainForm($model.weblog)
-            #showNextPrevSearchControl($pager)
+            #if($model.hits > 0)
+                #showNextPrevSearchControl($pager)
+            #end
         </div>
 
         ## show entries

Modified: roller/trunk/app/src/main/webapp/themes/brushedmetal/searchresults.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/brushedmetal/searchresults.vm?rev=1603198&r1=1603197&r2=1603198&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/themes/brushedmetal/searchresults.vm (original)
+++ roller/trunk/app/src/main/webapp/themes/brushedmetal/searchresults.vm Tue Jun 17 15:09:23 2014
@@ -22,7 +22,9 @@
         #set($pager = $model.getWeblogEntriesPager()) 
         <div class="next-previous">
              #showWeblogSearchAgainForm($model.weblog)
-             #showNextPrevSearchControl($pager)
+             #if($model.hits > 0)
+                 #showNextPrevSearchControl($pager)
+             #end
         </div>
 
         ## show entries

Modified: roller/trunk/app/src/main/webapp/themes/frontpage/weblog.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/frontpage/weblog.vm?rev=1603198&r1=1603197&r2=1603198&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/themes/frontpage/weblog.vm (original)
+++ roller/trunk/app/src/main/webapp/themes/frontpage/weblog.vm Tue Jun 17 15:09:23 2014
@@ -92,7 +92,9 @@
                         <h2>Search results</h2>
                         <div class="next-previous">
                             #showWeblogSearchAgainForm($model.weblog)
-                            #showNextPrevSearchControl($pager)
+                            #if($model.hits > 0)
+                                #showNextPrevSearchControl($pager)
+                            #end
                         </div>
                         <br />
                         <br />

Modified: roller/trunk/app/src/main/webapp/themes/sotto/searchresults.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/sotto/searchresults.vm?rev=1603198&r1=1603197&r2=1603198&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/themes/sotto/searchresults.vm (original)
+++ roller/trunk/app/src/main/webapp/themes/sotto/searchresults.vm Tue Jun 17 15:09:23 2014
@@ -23,7 +23,9 @@
         #set($pager = $model.getWeblogEntriesPager()) 
         <div class="next-previous">
             #showWeblogSearchAgainForm($model.weblog)
-            #showNextPrevSearchControl($pager)
+            #if($model.hits > 0)
+                #showNextPrevSearchControl($pager)
+            #end
         </div>
 
         ## show entries