Source

DJFacet / demoproject / apps / djfacet / templates / djfacet / components / snippet_facet.html

{# ps. the block declaration is needed because we may call this using 'render_block_to_string' #}

{% block inner_facet_values %}

	
{% if twocolumnsflag %}
	

	<!-- CASE 1: TWO COLUMNS ::::: EG IN THE SPLASH PAGE -->


	
	{% for facetvalue_group in facetvalues %}
	<div class="unit size1of2 minHeight">
		<ul>
	
		{% for facetvalue in facetvalue_group %}


			{# here the anchor is given only if the results N is > TOTITEMS! #}

			{% ifnotequal facetvalue.howmany  totitems  %}
				<li><a href="{{url_prefix}}?filter={{facetvalue.id}}&amp;resulttype={{result_typeObj.uniquename}}{{newurl_stub}}"  id="{{facetgroup.uniquename}}_{{facetvalue.id}}" class="{{facet.name}} active" 
					title="{% if facetvalue.subspreview  %}Subcategories:{% for e in facetvalue.subspreview %}&#13;{{e.name}}{% endfor %}	
							{% else %}No subcategories{% endif %}"> 
					{{facetvalue.displayname|capfirst|default:"---"}} ({{facetvalue.howmany|default:"0"}})							
				</a> </li>					
				
				{# [  {{facetvalue.tot_all}}, {{facetvalue.tot_inbatch}}, {{facetvalue.tot_left}}] #}
						
			{% else %}	
				<li><a class="inactive" title="Filter inactive because your search already produced {{totitems}} results">{{facetvalue.displayname|capfirst|default:"---"}} ({{facetvalue.howmany|default:"0"}})</a></li>							

			{% endifnotequal %}


		{% endfor %}

		{#  LINK TO THE FACET-ALL-VALUES PAGE: always in splash page #}	

		{% if  forloop.last  %}

			{% if djfacet_splashpage %}

		  		<li>
					<a href="{{url_prefix}}facet/{{facet.uniquename}}/?resulttype={{result_typeObj.uniquename}}&amp;totitems={{totitems}}{{newurl_stub}}" ><span > more...</span></a>    
					
					{# 2012-04-26:removed this cause the count was mistaken with MPTT  ...and {{facetvalue_group.0.tot_left}} more.</span></a>  #}
					
					
				</li>

			{% endif %}

		{% endif %}
		</ul>
	</div>
	{% endfor %}




<!-- CASE 2: ONE COLUMN ::::: EG IN THE SEARCH RESULTS PAGE-->


{% else %}	 {# TWOCOLUMNSFLAG = False #}



<div class="facet">
	<ul class="facetOptions resultsList">



		{% if  facetvalues %}
		
		
			{% for facetvalue in facetvalues %}


			{# here the anchor is given only if the results N is > TOTITEMS! #}

				{% ifnotequal facetvalue.howmany  totitems  %}
					<li><a href="{{url_prefix}}?filter={{facetvalue.id}}&amp;resulttype={{result_typeObj.uniquename}}{{newurl_stub}}"  id="{{facetgroup.uniquename}}_{{facetvalue.id}}" class="{{facet.name}} active" 
						title="{% if facetvalue.subspreview  %}Subcategories:{% for e in facetvalue.subspreview %}&#13;{{e.name}}{% endfor %}	
								{% else %}No subcategories{% endif %}"> 
						{{facetvalue.displayname|capfirst|default:"---"}} ({{facetvalue.howmany|default:"0"}})							
					</a></li>							
				{% else %}	
					<li><a class="inactive" title="Filter inactive because your search already produced {{totitems}} results">{{facetvalue.displayname|capfirst|default:"---"}} ({{facetvalue.howmany|default:"0"}})</a></li>							

				{% endifnotequal %}


				{#  LINK TO THE FACET-ALL-VALUES PAGE: only if we have more values, or mptt #}
				
				{% if  forloop.last  and facetvalue.tot_left > 0 or forloop.last  and facet.mptt %} 

		  		<li>
					<a href="{{url_prefix}}facet/{{facet.uniquename}}/?resulttype={{result_typeObj.uniquename}}&amp;totitems={{totitems}}{{newurl_stub}}" ><span> more...</span></a>    
				
					{# 2012-04-26:removed this cause the count was mistaken with MPTT  ...and {{facetvalue.tot_left}} more.</span></a>  #}
				</li>


				{% endif %}
			
			{% endfor %}

	
		{% else %} 
		
			<i>No filters available</i>
		
		{% endif %} 
	
	
	
	</ul>
</div>


{% endif %}



			
{% endblock %}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.