|
68 | 68 | <#assign selectedValue = "" >
|
69 | 69 | <#assign valueNumber = 1>
|
70 | 70 | <#list f.values?values as value>
|
| 71 | + <#if user.loggedIn || value.publiclyAvailable> |
| 72 | + <#if value.selected> |
| 73 | + <#assign selectedValue = value.id > |
| 74 | + </#if> |
| 75 | + <#assign valueLabel = value.name > |
| 76 | + <#if !(valueLabel?has_content)> |
| 77 | + <#assign valueLabel = value.id > |
| 78 | + </#if> |
| 79 | + <#if value.selected> |
| 80 | + <li id="${value.id?html}" class="li-selected"> |
| 81 | + <a href="#" class="selected"> |
| 82 | + <@sl.getInput f value sl.getValueID(f.id, valueNumber) valueNumber 'filter-form' /> |
| 83 | + <@sl.getSelectedLabel sl.getValueID(filter.id, valueNumber)?html value f getCurrentCount(f value) /> |
| 84 | + </a> |
| 85 | + </li> |
| 86 | + <#else> |
| 87 | + <li id="${value.id?html}"> |
| 88 | + <a href="#"> |
| 89 | + <@sl.getInput f value sl.getValueID(f.id, valueNumber) valueNumber 'filter-form' /> |
| 90 | + <@sl.getLabel sl.getValueID(f.id, valueNumber) value f getCurrentCount(f value) /> |
| 91 | + </a> |
| 92 | + </li> |
| 93 | + </#if> |
| 94 | + <#assign valueNumber = valueNumber + 1> |
| 95 | + </#if> |
| 96 | + </#list> |
| 97 | +</#macro> |
| 98 | + |
| 99 | +<#function getCurrentCount f v> |
| 100 | + <#if filters[f.id]??> |
| 101 | + <#assign filter = filters[f.id]> |
| 102 | + <#if filter.values[v.id]??> |
| 103 | + <#return filter.values[v.id].count > |
| 104 | + <#else> |
| 105 | + <#return 0 /> |
| 106 | + </#if> |
| 107 | + <#else> |
| 108 | + <#return 0 /> |
| 109 | + </#if> |
| 110 | +</#function> |
| 111 | + |
| 112 | +<#macro filterFacets f> |
| 113 | + <#assign selectedValue = "" > |
| 114 | + <#assign valueNumber = 1> |
| 115 | + <#list f.values?values as value> |
| 116 | + <#if user.loggedIn || value.publiclyAvailable> |
71 | 117 | <#if value.selected>
|
72 | 118 | <#assign selectedValue = value.id >
|
73 | 119 | </#if>
|
|
79 | 125 | <li id="${value.id?html}" class="li-selected">
|
80 | 126 | <a href="#" class="selected">
|
81 | 127 | <@sl.getInput f value sl.getValueID(f.id, valueNumber) valueNumber 'filter-form' />
|
82 |
| - <@sl.getSelectedLabel sl.getValueID(filter.id, valueNumber)?html value f getCurrentCount(f value) /> |
| 128 | + <@sl.getSelectedLabel sl.getValueID(f.id, valueNumber)?html value f getCurrentCount(f value) /> |
83 | 129 | </a>
|
84 | 130 | </li>
|
85 | 131 | <#else>
|
|
91 | 137 | </li>
|
92 | 138 | </#if>
|
93 | 139 | <#assign valueNumber = valueNumber + 1>
|
94 |
| - </#list> |
95 |
| -</#macro> |
96 |
| - |
97 |
| -<#function getCurrentCount f v> |
98 |
| - <#if filters[f.id]??> |
99 |
| - <#assign filter = filters[f.id]> |
100 |
| - <#if filter.values[v.id]??> |
101 |
| - <#return filter.values[v.id].count > |
102 |
| - <#else> |
103 |
| - <#return 0 /> |
104 |
| - </#if> |
105 |
| - <#else> |
106 |
| - <#return 0 /> |
107 |
| - </#if> |
108 |
| -</#function> |
109 |
| - |
110 |
| -<#macro filterFacets f> |
111 |
| - <#assign selectedValue = "" > |
112 |
| - <#assign valueNumber = 1> |
113 |
| - <#list f.values?values as value> |
114 |
| - <#if value.selected> |
115 |
| - <#assign selectedValue = value.id > |
116 |
| - </#if> |
117 |
| - <#assign valueLabel = value.name > |
118 |
| - <#if !(valueLabel?has_content)> |
119 |
| - <#assign valueLabel = value.id > |
120 |
| - </#if> |
121 |
| - <#if value.selected> |
122 |
| - <li id="${value.id?html}" class="li-selected"> |
123 |
| - <a href="#" class="selected"> |
124 |
| - <@sl.getInput f value sl.getValueID(f.id, valueNumber) valueNumber 'filter-form' /> |
125 |
| - <@sl.getSelectedLabel sl.getValueID(f.id, valueNumber)?html value f getCurrentCount(f value) /> |
126 |
| - </a> |
127 |
| - </li> |
128 |
| - <#else> |
129 |
| - <li id="${value.id?html}"> |
130 |
| - <a href="#"> |
131 |
| - <@sl.getInput f value sl.getValueID(f.id, valueNumber) valueNumber 'filter-form' /> |
132 |
| - <@sl.getLabel sl.getValueID(f.id, valueNumber) value f getCurrentCount(f value) /> |
133 |
| - </a> |
134 |
| - </li> |
135 | 140 | </#if>
|
136 |
| - <#assign valueNumber = valueNumber + 1> |
137 | 141 | </#list>
|
138 | 142 | </#macro>
|
139 | 143 |
|
|
0 commit comments