Fix more template syntax error
authorMagnus Hagander <magnus@hagander.net>
Fri, 23 Mar 2018 12:47:31 +0000 (13:47 +0100)
committerMagnus Hagander <magnus@hagander.net>
Fri, 23 Mar 2018 12:47:31 +0000 (13:47 +0100)
Can't use = for comparison, must use ==. Been broken for a long time,
but older django painted over the problem.

templates/search/listsearch.html
templates/search/sitesearch.html

index 6dcc75b813c85feb3f92ba4e24c01944db67c9c2..ad67d158938177bfd0040fe2fe9bb8955138b029 100644 (file)
 <option value="">-- All lists</option>
 {%for l in lists %}
 {%ifchanged l.group%}
-<option value="{{l.group.negid}}"{%if l.group.negid = listid%} SELECTED{%endif%}>-- {{l.group}}</option>
+<option value="{{l.group.negid}}"{%if l.group.negid == listid%} SELECTED{%endif%}>-- {{l.group}}</option>
 {%endifchanged%}
-<option value="{{l.id}}"{%if l.id = listid%} SELECTED{%endif%}>{{l}}</option>
+<option value="{{l.id}}"{%if l.id == listid%} SELECTED{%endif%}>{{l}}</option>
 {%endfor%}
     </select></td>
    </tr>
    <tr>
     <td class="colFirstR">Post date:</td>
     <td class="colLast"><select name="d">{%for d in dates%}
-     <option value="{{d.val}}"{%if d.val = dateval %} SELECTED{%endif%}>{{d.text}}</option>{%endfor%}
+     <option value="{{d.val}}"{%if d.val == dateval %} SELECTED{%endif%}>{{d.text}}</option>{%endfor%}
     </select></td>
    </tr>
    <tr class="lastrow">
  <div>{{search_error}}</div>
  {%else%}
   <!-- docbot goes here -->
-  {%if hitcount = 0 %}
+  {%if hitcount == 0 %}
    <p>Your search for <b>{{query}}</b> returned no hits.</p>
   {%else%}
-   <h2>Results {{firsthit}}-{{lasthit}} of {%if hitcount = 1000%}more than 1000{%else%}{{hitcount}}{%endif%}.</h2>
+   <h2>Results {{firsthit}}-{{lasthit}} of {%if hitcount == 1000%}more than 1000{%else%}{{hitcount}}{%endif%}.</h2>
    {%if pagelinks %}Result pages: {{pagelinks|safe}}<br/><br/>{%endif%}
    {%for hit in hits %}
     {{forloop.counter0|add:firsthit}}. <a href="https://www.postgresql.org/message-id/{{hit.messageid}}">{{hit.subject}}</a> [{{hit.rank|floatformat:2}}]<br/>
index 35300e61f8a372953dbf4aa35f08cb9e690edc7a..a6e59ba02843472b0539166475a78a8fbb9c204d 100644 (file)
  <div>{{search_error}}</div>
  {%else%}
   <!-- docbot goes here -->
-  {%if hitcount = 0 %}
+  {%if hitcount == 0 %}
    <p>Your search for <b>{{query}}</b> returned no hits.</p>
   {%else%}
-   <h2>Results {{firsthit}}-{{lasthit}} of {%if hitcount = 1000%}more than 1000{%else%}{{hitcount}}{%endif%}.</h2>
+   <h2>Results {{firsthit}}-{{lasthit}} of {%if hitcount == 1000%}more than 1000{%else%}{{hitcount}}{%endif%}.</h2>
    {%if pagelinks %}Result pages: {{pagelinks|safe}}<br/><br/>{%endif%}
    {%for hit in hits %}
     {{forloop.counter0|add:firsthit}}. <a href="{{hit.url}}">{{hit.title}}</a> [{{hit.rank|floatformat:2}}]<br/>