forked from zaclys/searxng
[fix] static content paths
This commit is contained in:
parent
2f9a386c0d
commit
798bef77f9
|
@ -1,7 +1,7 @@
|
||||||
<div class="result {{ result.class }}">
|
<div class="result {{ result.class }}">
|
||||||
|
|
||||||
{% if "icon_"~result.engine~".ico" in favicons %}
|
{% if "icon_"~result.engine~".ico" in favicons %}
|
||||||
<img width="14" height="14" class="favicon" src="static/{{theme}}/img/icons/icon_{{result.engine}}.ico" alt="{{result.engine}}" />
|
<img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico') }}" alt="{{result.engine}}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div class="result {{ result.class }}">
|
<div class="result {{ result.class }}">
|
||||||
<h3 class="result_title">{% if "icon_"~result.engine~".ico" in favicons %}<img width="14" height="14" class="favicon" src="static/{{theme}}/img/icons/icon_{{result.engine}}.ico" alt="{{result.engine}}" />{% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
|
<h3 class="result_title">{% if "icon_"~result.engine~".ico" in favicons %}<img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico') }}" alt="{{result.engine}}" />{% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
|
||||||
<p class="url">{{ result.pretty_url }} <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}">cached</a></p>
|
<p class="url">{{ result.pretty_url }} <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}">cached</a></p>
|
||||||
{% if result.publishedDate %}<p class="published_date">{{ result.publishedDate }}</p>{% endif %}
|
{% if result.publishedDate %}<p class="published_date">{{ result.publishedDate }}</p>{% endif %}
|
||||||
<p class="content">{% if result.img_src %}<img src="{{ result.img_src }}" class="image" />{% endif %}{% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p>
|
<p class="content">{% if result.img_src %}<img src="{{ result.img_src }}" class="image" />{% endif %}{% if result.content %}{{ result.content|safe }}<br class="last"/>{% endif %}</p>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{% from 'oscar/macros.html' import icon %}
|
{% from 'oscar/macros.html' import icon %}
|
||||||
|
|
||||||
<h4 class="result_header">{% if result.engine~".png" in favicons %}<img width="32" height="32" class="favicon" src="static/{{ theme }}/img/icons/{{ result.engine }}.png" alt="{{ result.engine }}" /> {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h4>
|
<h4 class="result_header">{% if result.engine~".png" in favicons %}<img width="32" height="32" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico') }}" alt="{{ result.engine }}" /> {% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h4>
|
||||||
|
|
||||||
{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}
|
{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}
|
||||||
<small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}">{{ icon('link') }} {{ _('cached') }}</a></small>
|
<small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}">{{ icon('link') }} {{ _('cached') }}</a></small>
|
||||||
|
|
|
@ -49,7 +49,7 @@ class ViewsTestCase(SearxTestCase):
|
||||||
)
|
)
|
||||||
result = self.app.post('/', data={'q': 'test'})
|
result = self.app.post('/', data={'q': 'test'})
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
'<h3 class="result_title"><img width="14" height="14" class="favicon" src="static/themes/default/img/icons/icon_youtube.ico" alt="youtube" /><a href="http://second.test.xyz">Second <span class="highlight">Test</span></a></h3>', # noqa
|
'<h3 class="result_title"><img width="14" height="14" class="favicon" src="/static/themes/default/img/icons/icon_youtube.ico" alt="youtube" /><a href="http://second.test.xyz">Second <span class="highlight">Test</span></a></h3>', # noqa
|
||||||
result.data
|
result.data
|
||||||
)
|
)
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
|
|
|
@ -73,7 +73,7 @@ babel = Babel(app)
|
||||||
global_favicons = []
|
global_favicons = []
|
||||||
for indice, theme in enumerate(themes):
|
for indice, theme in enumerate(themes):
|
||||||
global_favicons.append([])
|
global_favicons.append([])
|
||||||
theme_img_path = searx_dir+"/static/"+theme+"/img/icons/"
|
theme_img_path = searx_dir+"/static/themes/"+theme+"/img/icons/"
|
||||||
for (dirpath, dirnames, filenames) in os.walk(theme_img_path):
|
for (dirpath, dirnames, filenames) in os.walk(theme_img_path):
|
||||||
global_favicons[indice].extend(filenames)
|
global_favicons[indice].extend(filenames)
|
||||||
|
|
||||||
|
@ -506,7 +506,7 @@ def opensearch():
|
||||||
@app.route('/favicon.ico')
|
@app.route('/favicon.ico')
|
||||||
def favicon():
|
def favicon():
|
||||||
return send_from_directory(os.path.join(app.root_path,
|
return send_from_directory(os.path.join(app.root_path,
|
||||||
'static',
|
'static/themes',
|
||||||
get_current_theme_name(),
|
get_current_theme_name(),
|
||||||
'img'),
|
'img'),
|
||||||
'favicon.png',
|
'favicon.png',
|
||||||
|
|
Loading…
Reference in New Issue