forked from zaclys/searxng
		
	[feat] results: show source of suggested answer
This commit is contained in:
		
							parent
							
								
									17394ad558
								
							
						
					
					
						commit
						0264a1a205
					
				
					 3 changed files with 18 additions and 6 deletions
				
			
		| 
						 | 
					@ -636,6 +636,18 @@ summary.title {
 | 
				
			||||||
  span {
 | 
					  span {
 | 
				
			||||||
    overflow-wrap: anywhere;
 | 
					    overflow-wrap: anywhere;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .answer {
 | 
				
			||||||
 | 
					    display: flex;
 | 
				
			||||||
 | 
					    flex-direction: column;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .answer-url {
 | 
				
			||||||
 | 
					    margin-left: auto;
 | 
				
			||||||
 | 
					    margin-top: 5px;
 | 
				
			||||||
 | 
					    margin-right: 10px;
 | 
				
			||||||
 | 
					    margin-bottom: 10px;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#infoboxes {
 | 
					#infoboxes {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -23,11 +23,10 @@
 | 
				
			||||||
    <div id="answers" role="complementary" aria-labelledby="answers-title"><h4 class="title" id="answers-title">{{ _('Answers') }} : </h4>
 | 
					    <div id="answers" role="complementary" aria-labelledby="answers-title"><h4 class="title" id="answers-title">{{ _('Answers') }} : </h4>
 | 
				
			||||||
        {%- for answer in answers.values() -%}
 | 
					        {%- for answer in answers.values() -%}
 | 
				
			||||||
        <div class="answer">
 | 
					        <div class="answer">
 | 
				
			||||||
              {% if answer.url %}
 | 
					        <span>{{ answer.answer }}</span>
 | 
				
			||||||
                <a href="{{ answer.url }}">{{ answer.answer }}</a>
 | 
					          {% if answer.url -%}
 | 
				
			||||||
              {% else %}
 | 
					          <a href="{{ answer.url }}" class="answer-url">{{ urlparse(answer.url).hostname }}</a>
 | 
				
			||||||
                <span>{{ answer.answer }}</span>
 | 
					          {% endif -%}
 | 
				
			||||||
              {% endif %}
 | 
					 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
        {%- endfor -%}
 | 
					        {%- endfor -%}
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -22,7 +22,7 @@ from typing import List, Dict, Iterable
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import urllib
 | 
					import urllib
 | 
				
			||||||
import urllib.parse
 | 
					import urllib.parse
 | 
				
			||||||
from urllib.parse import urlencode, unquote
 | 
					from urllib.parse import urlencode, urlparse, unquote
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import httpx
 | 
					import httpx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -444,6 +444,7 @@ def render(template_name: str, **kwargs):
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					    kwargs['urlparse'] = urlparse
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # scripts from plugins
 | 
					    # scripts from plugins
 | 
				
			||||||
    kwargs['scripts'] = set()
 | 
					    kwargs['scripts'] = set()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue