← Back to team overview

team4alfanous team mailing list archive

[Branch ~team4alfanous/alfanous/alfanous-git] Rev 513: first step to the multiple search units in the WUI

 

------------------------------------------------------------
revno: 513
committer: Assem Chelli <assem.ch@xxxxxxxxx>
timestamp: Sun 2013-01-06 19:31:20 +0100
message:
  first step to the multiple search units in the WUI
removed:
  src/alfanous-django/templates/wui.html
added:
  src/alfanous-django/templates/aya_search.html
  src/alfanous-django/templates/translation_search.html
  src/alfanous-django/templates/word_search.html
modified:
  src/alfanous-django/templates/base.html
  src/alfanous-django/urls.py
  src/alfanous-django/wui/views.py


--
lp:alfanous
https://code.launchpad.net/~team4alfanous/alfanous/alfanous-git

Your team Alfanous team is subscribed to branch lp:alfanous.
To unsubscribe from this branch go to https://code.launchpad.net/~team4alfanous/alfanous/alfanous-git/+edit-subscription
=== added file 'src/alfanous-django/templates/aya_search.html'
--- src/alfanous-django/templates/aya_search.html	1970-01-01 00:00:00 +0000
+++ src/alfanous-django/templates/aya_search.html	2013-01-06 18:31:20 +0000
@@ -0,0 +1,151 @@
+{% extends "results.html" %}
+
+{% load custom_filters %}
+
+{% block options %}
+<input type="checkbox"  name="fuzzy" value="True" {{ params.fuzzy|yesno:"checked," }} /> 
+	<span class="xtitle">{{ _("Fuzzy search") }} </span> 
+<input type="checkbox" name="vocalized" value="False" {{ params.vocalized|yesno:"checked," }} /> 
+	<span class="xtitle">{{ _("Unvocalized text") }} </span>
+<input type="checkbox" name="script" value="uthmani" {{ params.script|yesno:"checked," }} /> 
+	<span class="xtitle">{{ _("Uthmani script") }} </span>
+<br/>
+{% endblock %}
+
+
+{% block help_panel %}
+	<div id="help" class="modal" style="width: 675px; text-align: left;">
+		<h2>{{ _("Help") }}</h2>	
+	<table dir="{{ bidi }}" style=" border: 2px dashed gray;margin: 5px;width: 672px;">
+	<tbody>
+	
+	<tr>
+		<th class="style6">{{ _("Exact search") }} </th>
+		<td class="style5" ><a  href='/?{% build_search_link params ' رب' 1 False %}'> رب</a></td>
+		<td class="style4" ><a  href='/?{% build_search_link params 'فأسقيناكموه' 1 False %}'> فأسقيناكموه </a></td>
+	</tr>
+	<tr>
+		<th class="style3">{{ _("Phrase search") }}  </th>
+		<td class="style2"><a href='/?{% build_search_link params '"رب العالمين"' 1 False %}'>"رب العالمين"</a></td>
+		<td class="style2"><a href='/?{% build_search_link params '"رسول الله"' 1 False %}'>"رسول الله"</a></td>
+	</tr>
+	<tr>
+		<th class="style6">{{ _("Logical relations") }}</th>
+		<td class="style5"><a href='/?{% build_search_link params '(الصلاة - الزكاة) + سورة:البقرة' 1 False %}'>(الصلاة - الزكاة) + سورة:البقرة</a></td>
+	    <td class="style4"><a href='/?{% build_search_link params 'سميع | بصير' 1 False %}'> سميع | بصير</a></td>
+	</tr> 
+	<tr>
+		<th class="style3">{{ _("Wildcards") }}</th>
+		<td class="style2"><a href='/?{% build_search_link params '*نبي*' 1 False %}'>*نبي*</a></td>
+		<td class="style2"><a href='/?{% build_search_link params 'نعم؟' 1 False %}'>نعم؟</a></td>
+	</tr>
+	<tr>
+		<th class="style6">{{ _("Fields") }}</th>
+		<td class="style5"><a href='/?{% build_search_link params 'سورة:يس' 1 False %}'>سورة:يس</a></td>
+	    <td class="style4"><a href='/?{% build_search_link params 'سجدة:نعم' 1 False %}'>سجدة:نعم</a></td>
+	</tr>
+	<tr>
+		<th class="style3">{{ _("Intervals") }} </th>
+		<td class="style2"><a href='/?{% build_search_link params 'رقم_السورة:[1 الى 5] + الله' 1 False %}'>  رقم_السورة:[1 الى 5] + الله</a></td>
+		<td> </td>
+	</tr>
+	<tr>
+		<th class="style6">{{ _("Partial vocalization") }} </th>
+		<td class="style5"><a href="/?{% build_search_link params "آية_:'مَن'" 1 False %}">آية_:'مَن'</a></td>
+	    <td class="style4"><a href="/?{% build_search_link params "آية_:'المَلكُ'" 1 False %}">آية_:'المَلكُ'</a></td>
+	</tr>
+	<tr>
+		<th class="style3">{{ _("Word properties") }}</th>
+		<td class="style2"><a href='/?{% build_search_link params '{قول،اسم}' 1 False %}'>{قول،اسم}</a></td>
+		<td class="style2"><a href='/?{% build_search_link params '{ملك،فعل}' 1 False %}'>{ملك،فعل}</a></td>
+	</tr>
+	<tr>
+		<th class="style9">{{ _("Derivations") }}</th>
+		<td class="style8"><a href='/?{% build_search_link params '>>ملك' 1 False %}'>&gt;&gt;ملك</a></td>
+	    <td class="style7"><a href='/?{% build_search_link params '>ملك' 1 False %}'> &gt;ملك</a></td>
+	</tr>
+	</tbody></table>
+		<br/>
+		<p> {{ _("The website does not work well on Internet Explorer, we suggest to use another explorer such as: ") }} <a href="https://www.mozilla.org/firefox/"; target="_blank">{{ _("Firefox") }}</a>.</p>
+		<br/>
+			<button type="button" class='close gray button'> {{ _("Close") }} </button>	
+		<br />
+	</div>
+{% endblock %}
+
+{% block sortedby_panel %}
+	<span class="xtitle">{{ _("Sorted by") }} :</span>
+	<select id="sortedby" class="styled" name="sortedby">
+		<option value="score" {% ifequal params.sortedby "score" %}selected{% endifequal %}>{{ _("Relevance") }}</option>
+		<option value="mushaf" {% ifequal params.sortedby "mushaf" %}selected{% endifequal %}>{{ _("Mus'haf") }}</option>
+		<option value="tanzil" {% ifequal params.sortedby "tanzil" %}selected{% endifequal %}>{{ _("Tanzil") }}</option>
+		<option value="subject" {% ifequal params.sortedby "subject" %}selected{% endifequal %}>{{ _("Topics") }}</option>
+		<option value="ayalength" {% ifequal params.sortedby "ayalength" %}selected{% endifequal %}>{{ _("Ayah length") }}</option>
+	</select><br /><!--[if lte IE 8]><![endif]-->
+{% endblock %}
+
+{% block translations_panel %}
+	<span class="xtitle">&nbsp;&nbsp;&nbsp; {{ _("Translation:") }} :</span>
+	<select id="translation" class="styled" name="translation">
+					<option value="en.transliteration">{{ _("Default") }}</option>
+					<option value="None" {% ifequal params.translation "None" %}selected{% endifequal %}>{{ _("No translation") }}</option>
+					{% for translation_id, translation_name in info.show.translations.items %}
+					<option value="{{ translation_id }}" {% ifequal params.translation translation_id %}selected{% endifequal %}>{{ translation_name }}</option>
+					{% endfor %}
+	</select><br /><!--[if lte IE 8]><![endif]-->
+{% endblock %}
+
+{% block recitations_panel %}
+	<span class="xtitle">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {{ _("Recitation:") }}</span>
+	<select id="recitation" class="styled" name="recitation">
+		<option value="14">{{ _("Default") }}</option>
+		<option value="0" {% ifequal params.recitation "0" %}selected{% endifequal %}>{{ _("No recitation") }}</option>
+		{% for recitation_id, recitation_details in info.show.recitations.items %}
+			{% if recitation_id != "ayahCount" %}
+					<option value="{{ recitation_id }}" {% ifequal params.recitation recitation_id %}selected{% endifequal %}>{{ recitation_details.name }} - {{ recitation_details.bitrate }} </option>
+			{% endif %}
+		{% endfor %}
+	</select><br /><!--[if lte IE 8]><![endif]-->
+{% endblock %}
+
+{% block pages_bottom %} 
+	{% block pages_top %}
+		<br />
+		{% if results.search.interval.nb_pages > 1 %}
+				<div class='pages'>
+				{% if results.search.interval.page != 1 %}
+					{% with results.search.interval.page|add:"-1"|stringformat:"s" as prev_page %}
+						<a class='no_decoration' href='?{% build_search_link params params.query prev_page False%}'> 
+					{% endwith %} 
+					<img src='/static/images/prev_en.gif' alt='Previous page' title = 'Previous page' />
+					</a>
+				{% endif %}
+				<div style=' display:inline-block; position:relative; top:-8px;'>
+				{% for i in results.search.interval.nb_pages|get_range %}
+					{% with results.search.interval.page as page %}
+						{% if  i == page %}
+							 {{ i }}  	
+						{% elif i <= page|add:"+7" and i >= page|add:"-3"  %} 
+							{# pages  in range [-3,+7] #} 
+							<a class='page_link' href="?{% build_search_link params params.query i False %}">{{ i }}</a> 
+						{% elif i|divisibleby:"50" and i < page or i == 1  %} {# Prio: Left #}
+							{# first page ; and every 50 pages before current page #}
+							<a class='page_link' href="?{% build_search_link params params.query i False %}">{{ i }}</a> .. 
+						{% elif i|divisibleby:"50" and i > page or i == results.search.interval.nb_pages  %}
+							{# last page;  and every 50 pages after current page #}
+							.. <a class='page_link' href="?{% build_search_link params params.query i False %}">{{ i }}</a> 
+						{% endif %}	
+					{% endwith %}
+				{% endfor %}
+				</div>
+				{% if results.search.interval.page != results.search.interval.nb_pages %}
+					{% with results.search.interval.page|add:"+1"|stringformat:"s" as next_page %}
+						<a class='no_decoration' href='?{% build_search_link params params.query next_page False%}'> 
+					{% endwith %} 
+					<img src='/static/images/next_en.gif' alt='Next page' title = 'Next page' /></a>
+				{% endif %}
+				
+				</div>
+		{% endif %}
+	{% endblock %}
+{% endblock %}
\ No newline at end of file

=== modified file 'src/alfanous-django/templates/base.html'
--- src/alfanous-django/templates/base.html	2013-01-06 15:10:08 +0000
+++ src/alfanous-django/templates/base.html	2013-01-06 18:31:20 +0000
@@ -208,13 +208,13 @@
 <div id="alfanousheader">
 <ul class="headermenu">
 <li class="menuitem"><span>{{ _("Ayahs") }}</span></li>
-{# <li class="menuitem"><a href="#">{{ _("Surahs") }}</a></li> #}
-<li class="menuitem"><a href="#">{{ _("Words") }}</a></li>
-<li class="menuitem"><a href="#">{{ _("Translations") }}</a></li>
-{# <li class="menuitem"><a href="#">{{ _("Taffsirs") }}</a></li> #}
-{# <li class="menuitem"><a href="#">{{ _("Hadiths") }}</a></li> #}
-{# <li class="menuitem"><a href="#">{{ _("Dreams") }}</a></li> #}
-{# <li class="menuitem"><a href="#">{{ _("Poems") }}</a></li> #}
+{# <li class="menuitem"><a href="/sura/">{{ _("Surahs") }}</a></li> #}
+<li class="menuitem"><a href="/word/">{{ _("Words") }}</a></li>
+<li class="menuitem"><a href="/translation/">{{ _("Translations") }}</a></li>
+{# <li class="menuitem"><a href="/taffsir/">{{ _("Taffsirs") }}</a></li> #}
+{# <li class="menuitem"><a href="/hadith/">{{ _("Hadiths") }}</a></li> #}
+{# <li class="menuitem"><a href="/dream/">{{ _("Dreams") }}</a></li> #}
+{# <li class="menuitem"><a href="/poem/">{{ _("Poems") }}</a></li> #}
 </ul>
 <div style="clear: left"></div>
 </div>
@@ -244,15 +244,9 @@
 <br/>
 
  
-
-<input type="checkbox"  name="fuzzy" value="True" {{ params.fuzzy|yesno:"checked," }} /> 
-	<span class="xtitle">{{ _("Fuzzy search") }} </span> 
-<input type="checkbox" name="vocalized" value="False" {{ params.vocalized|yesno:"checked," }} /> 
-	<span class="xtitle">{{ _("Unvocalized text") }} </span>
-<input type="checkbox" name="script" value="uthmani" {{ params.script|yesno:"checked," }} /> 
-	<span class="xtitle">{{ _("Uthmani script") }} </span>
-<br/>
-
+{% block options %}
+
+{% endblock %}
 
 
 

=== added file 'src/alfanous-django/templates/translation_search.html'
=== added file 'src/alfanous-django/templates/word_search.html'
=== removed file 'src/alfanous-django/templates/wui.html'
--- src/alfanous-django/templates/wui.html	2013-01-05 14:01:59 +0000
+++ src/alfanous-django/templates/wui.html	1970-01-01 00:00:00 +0000
@@ -1,140 +0,0 @@
-{% extends "results.html" %}
-
-{% load custom_filters %}
-
-{% block help_panel %}
-	<div id="help" class="modal" style="width: 675px; text-align: left;">
-		<h2>{{ _("Help") }}</h2>	
-	<table dir="{{ bidi }}" style=" border: 2px dashed gray;margin: 5px;width: 672px;">
-	<tbody>
-	
-	<tr>
-		<th class="style6">{{ _("Exact search") }} </th>
-		<td class="style5" ><a  href='/?{% build_search_link params ' رب' 1 False %}'> رب</a></td>
-		<td class="style4" ><a  href='/?{% build_search_link params 'فأسقيناكموه' 1 False %}'> فأسقيناكموه </a></td>
-	</tr>
-	<tr>
-		<th class="style3">{{ _("Phrase search") }}  </th>
-		<td class="style2"><a href='/?{% build_search_link params '"رب العالمين"' 1 False %}'>"رب العالمين"</a></td>
-		<td class="style2"><a href='/?{% build_search_link params '"رسول الله"' 1 False %}'>"رسول الله"</a></td>
-	</tr>
-	<tr>
-		<th class="style6">{{ _("Logical relations") }}</th>
-		<td class="style5"><a href='/?{% build_search_link params '(الصلاة - الزكاة) + سورة:البقرة' 1 False %}'>(الصلاة - الزكاة) + سورة:البقرة</a></td>
-	    <td class="style4"><a href='/?{% build_search_link params 'سميع | بصير' 1 False %}'> سميع | بصير</a></td>
-	</tr> 
-	<tr>
-		<th class="style3">{{ _("Wildcards") }}</th>
-		<td class="style2"><a href='/?{% build_search_link params '*نبي*' 1 False %}'>*نبي*</a></td>
-		<td class="style2"><a href='/?{% build_search_link params 'نعم؟' 1 False %}'>نعم؟</a></td>
-	</tr>
-	<tr>
-		<th class="style6">{{ _("Fields") }}</th>
-		<td class="style5"><a href='/?{% build_search_link params 'سورة:يس' 1 False %}'>سورة:يس</a></td>
-	    <td class="style4"><a href='/?{% build_search_link params 'سجدة:نعم' 1 False %}'>سجدة:نعم</a></td>
-	</tr>
-	<tr>
-		<th class="style3">{{ _("Intervals") }} </th>
-		<td class="style2"><a href='/?{% build_search_link params 'رقم_السورة:[1 الى 5] + الله' 1 False %}'>  رقم_السورة:[1 الى 5] + الله</a></td>
-		<td> </td>
-	</tr>
-	<tr>
-		<th class="style6">{{ _("Partial vocalization") }} </th>
-		<td class="style5"><a href="/?{% build_search_link params "آية_:'مَن'" 1 False %}">آية_:'مَن'</a></td>
-	    <td class="style4"><a href="/?{% build_search_link params "آية_:'المَلكُ'" 1 False %}">آية_:'المَلكُ'</a></td>
-	</tr>
-	<tr>
-		<th class="style3">{{ _("Word properties") }}</th>
-		<td class="style2"><a href='/?{% build_search_link params '{قول،اسم}' 1 False %}'>{قول،اسم}</a></td>
-		<td class="style2"><a href='/?{% build_search_link params '{ملك،فعل}' 1 False %}'>{ملك،فعل}</a></td>
-	</tr>
-	<tr>
-		<th class="style9">{{ _("Derivations") }}</th>
-		<td class="style8"><a href='/?{% build_search_link params '>>ملك' 1 False %}'>&gt;&gt;ملك</a></td>
-	    <td class="style7"><a href='/?{% build_search_link params '>ملك' 1 False %}'> &gt;ملك</a></td>
-	</tr>
-	</tbody></table>
-		<br/>
-		<p> {{ _("The website does not work well on Internet Explorer, we suggest to use another explorer such as: ") }} <a href="https://www.mozilla.org/firefox/"; target="_blank">{{ _("Firefox") }}</a>.</p>
-		<br/>
-			<button type="button" class='close gray button'> {{ _("Close") }} </button>	
-		<br />
-	</div>
-{% endblock %}
-
-{% block sortedby_panel %}
-	<span class="xtitle">{{ _("Sorted by") }} :</span>
-	<select id="sortedby" class="styled" name="sortedby">
-		<option value="score" {% ifequal params.sortedby "score" %}selected{% endifequal %}>{{ _("Relevance") }}</option>
-		<option value="mushaf" {% ifequal params.sortedby "mushaf" %}selected{% endifequal %}>{{ _("Mus'haf") }}</option>
-		<option value="tanzil" {% ifequal params.sortedby "tanzil" %}selected{% endifequal %}>{{ _("Tanzil") }}</option>
-		<option value="subject" {% ifequal params.sortedby "subject" %}selected{% endifequal %}>{{ _("Topics") }}</option>
-		<option value="ayalength" {% ifequal params.sortedby "ayalength" %}selected{% endifequal %}>{{ _("Ayah length") }}</option>
-	</select><br /><!--[if lte IE 8]><![endif]-->
-{% endblock %}
-
-{% block translations_panel %}
-	<span class="xtitle">&nbsp;&nbsp;&nbsp; {{ _("Translation:") }} :</span>
-	<select id="translation" class="styled" name="translation">
-					<option value="en.transliteration">{{ _("Default") }}</option>
-					<option value="None" {% ifequal params.translation "None" %}selected{% endifequal %}>{{ _("No translation") }}</option>
-					{% for translation_id, translation_name in info.show.translations.items %}
-					<option value="{{ translation_id }}" {% ifequal params.translation translation_id %}selected{% endifequal %}>{{ translation_name }}</option>
-					{% endfor %}
-	</select><br /><!--[if lte IE 8]><![endif]-->
-{% endblock %}
-
-{% block recitations_panel %}
-	<span class="xtitle">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {{ _("Recitation:") }}</span>
-	<select id="recitation" class="styled" name="recitation">
-		<option value="14">{{ _("Default") }}</option>
-		<option value="0" {% ifequal params.recitation "0" %}selected{% endifequal %}>{{ _("No recitation") }}</option>
-		{% for recitation_id, recitation_details in info.show.recitations.items %}
-			{% if recitation_id != "ayahCount" %}
-					<option value="{{ recitation_id }}" {% ifequal params.recitation recitation_id %}selected{% endifequal %}>{{ recitation_details.name }} - {{ recitation_details.bitrate }} </option>
-			{% endif %}
-		{% endfor %}
-	</select><br /><!--[if lte IE 8]><![endif]-->
-{% endblock %}
-
-{% block pages_bottom %} 
-	{% block pages_top %}
-		<br />
-		{% if results.search.interval.nb_pages > 1 %}
-				<div class='pages'>
-				{% if results.search.interval.page != 1 %}
-					{% with results.search.interval.page|add:"-1"|stringformat:"s" as prev_page %}
-						<a class='no_decoration' href='?{% build_search_link params params.query prev_page False%}'> 
-					{% endwith %} 
-					<img src='/static/images/prev_en.gif' alt='Previous page' title = 'Previous page' />
-					</a>
-				{% endif %}
-				<div style=' display:inline-block; position:relative; top:-8px;'>
-				{% for i in results.search.interval.nb_pages|get_range %}
-					{% with results.search.interval.page as page %}
-						{% if  i == page %}
-							 {{ i }}  	
-						{% elif i <= page|add:"+7" and i >= page|add:"-3"  %} 
-							{# pages  in range [-3,+7] #} 
-							<a class='page_link' href="?{% build_search_link params params.query i False %}">{{ i }}</a> 
-						{% elif i|divisibleby:"50" and i < page or i == 1  %} {# Prio: Left #}
-							{# first page ; and every 50 pages before current page #}
-							<a class='page_link' href="?{% build_search_link params params.query i False %}">{{ i }}</a> .. 
-						{% elif i|divisibleby:"50" and i > page or i == results.search.interval.nb_pages  %}
-							{# last page;  and every 50 pages after current page #}
-							.. <a class='page_link' href="?{% build_search_link params params.query i False %}">{{ i }}</a> 
-						{% endif %}	
-					{% endwith %}
-				{% endfor %}
-				</div>
-				{% if results.search.interval.page != results.search.interval.nb_pages %}
-					{% with results.search.interval.page|add:"+1"|stringformat:"s" as next_page %}
-						<a class='no_decoration' href='?{% build_search_link params params.query next_page False%}'> 
-					{% endwith %} 
-					<img src='/static/images/next_en.gif' alt='Next page' title = 'Next page' /></a>
-				{% endif %}
-				
-				</div>
-		{% endif %}
-	{% endblock %}
-{% endblock %}
\ No newline at end of file

=== modified file 'src/alfanous-django/urls.py'
--- src/alfanous-django/urls.py	2012-11-23 13:19:36 +0000
+++ src/alfanous-django/urls.py	2013-01-06 18:31:20 +0000
@@ -4,15 +4,16 @@
 from django.contrib import admin
 admin.autodiscover()
 
-urlpatterns = patterns('',
+urlpatterns = patterns( '',
     # Examples:
     # url(r'^$', 'alfanousDjango.views.home', name='home'),
-    url(r'^jos2/', 'alfanous-django.wui.views.jos2'),
-   
+    url( r'^jos2/', 'alfanous-django.wui.views.jos2' ),
+
     # Uncomment the admin/doc line below to enable admin documentation:
     # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
 
     # Uncomment the next line to enable the admin:
-    url(r'^admin/', include(admin.site.urls)),
-    url(r'^', 'alfanous-django.wui.views.results'),
-)
+    url( r'^admin/', include( admin.site.urls ) ),
+    url( r'^(?P<unit>\w+)/', 'alfanous-django.wui.views.results' ),
+    url( r'^', 'alfanous-django.wui.views.results' ),
+ )

=== modified file 'src/alfanous-django/wui/views.py'
--- src/alfanous-django/wui/views.py	2013-01-05 18:36:24 +0000
+++ src/alfanous-django/wui/views.py	2013-01-06 18:31:20 +0000
@@ -44,29 +44,36 @@
     return response
 
 
-def results( request ):
-    """    """
+def results( request, unit = "aya" ):
+    """     """
+    if unit not in ["aya", "word", "translations"]: # authorized units
+    	unit = "aya"
+    mutable_request = {}
+    for k, v in request.GET.items():
+    	mutable_request[k] = v
+
     show_params = { "action":"show", "query": "all" }
 
-    if request.GET.has_key( "query" ) and not ( request.GET.has_key( "action" ) and not request.GET["action"] == "search" ):
-        search_params = request.GET
-        suggest_params = { "action":"suggest", "query": request.GET["query"] }
-    elif request.GET.has_key( "search" ):
+    if mutable_request.has_key( "query" ) and not ( mutable_request.has_key( "action" ) and not mutable_request["action"] == "search" ):
+        search_params = mutable_request
+        suggest_params = { "action":"suggest", "query": mutable_request["query"] }
+    elif mutable_request.has_key( "search" ):
     	## back-compatibility of links:
     	# if it's a classic API style, wrap it to the new API style
         search_params = { "action": "search",
-                        "query": request.GET["search"],
-                        "page": request.GET["page"] if request.GET.has_key( "page" ) else 1,
-                        "sortedby": request.GET["sortedby"] if request.GET.has_key( "sortedby" ) else "relevance"
+                        "query": mutable_request["search"],
+                        "page": mutable_request["page"] if mutable_request.has_key( "page" ) else 1,
+                        "sortedby": rmutable_request["sortedby"] if mutable_request.has_key( "sortedby" ) else "relevance"
                         }
-        suggest_params = { 
+        suggest_params = {
 						"action":"suggest",
-                        "query": request.GET["search"]
+                        "query": mutable_request["search"]
                                         }
     else:
         search_params = {}
         suggest_params = {}
-
+    #override the unit flag
+    mutable_request["unit"] = unit
     #use search as first action
     raw_search = RAWoutput.do( search_params ) if search_params else None
     #use suggest as second action
@@ -74,7 +81,6 @@
     #use show as third action
     raw_show = RAWoutput.do( show_params )   if show_params else None
 
-
     # language information
     language = translation.get_language_from_request( request )
     language_info = get_language_info( language )
@@ -85,8 +91,9 @@
     translation.activate( language )
     request.LANGUAGE_CODE = translation.get_language()
 
+    mytemplate = unit + '_search.html'
 
-    return render_to_response( 'wui.html',
+    return render_to_response( mytemplate ,
                               {
                                 'current_path': request.get_full_path(),
                                 "bidi": "rtl" if language_info['bidi']