on master help sign in
[fix] static content paths
commit798bef77f9b43e713aeb9ac2938785538538a99c authorAdam Tauber <asciimoo@gmail.com> dateThu 1 Jan 2015, 19:24 (12 years ago) parent2f9a386
5 files changed+6−6
searx/templates/courgette/result_templates/default.html+1−1 searx/templates/default/result_templates/default.html+1−1 searx/templates/oscar/result_templates/default.html+1−1 searx/tests/test_webapp.py+1−1 searx/webapp.py+2−2
searx/templates/courgette/result_templates/default.html+1−1
@@ -1,7 +1,7 @@
11<div class="result {{ result.class }}">
22
33 {% if "icon_"~result.engine~".ico" in favicons %}
4− <img width="14" height="14" class="favicon" src="static/{{theme}}/img/icons/icon_{{result.engine}}.ico" alt="{{result.engine}}" />
4+ <img width="14" height="14" class="favicon" src="{{ url_for('static', filename='img/icons/icon_'+result.engine+'.ico') }}" alt="{{result.engine}}" />
55 {% endif %}
66
77 <div>
searx/templates/default/result_templates/default.html+1−1
@@ -1,5 +1,5 @@
11<div class="result {{ result.class }}">
2− <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>
2+ <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>
33 <p class="url">{{ result.pretty_url }} <a class="cache_link" href="https://web.archive.org/web/{{ result.url }}">cached</a></p>
44 {% if result.publishedDate %}<p class="published_date">{{ result.publishedDate }}</p>{% endif %}
55 <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>
searx/templates/oscar/result_templates/default.html+1−1
@@ -1,6 +1,6 @@
11{% from 'oscar/macros.html' import icon %}
22
3−<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>
3+<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>
44
55{% if result.publishedDate %}<time class="text-muted" datetime="{{ result.pubdate }}" >{{ result.publishedDate }}</time>{% endif %}
66<small><a class="text-info" href="https://web.archive.org/web/{{ result.url }}">{{ icon('link') }} {{ _('cached') }}</a></small>
searx/tests/test_webapp.py+1−1
@@ -49,7 +49,7 @@ class ViewsTestCase(SearxTestCase):
4949 )
5050 result = self.app.post('/', data={'q': 'test'})
5151 self.assertIn(
52− '<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
52+ '<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
5353 result.data
5454 )
5555 self.assertIn(
searx/webapp.py+2−2
@@ -73,7 +73,7 @@ babel = Babel(app)
7373global_favicons = []
7474for indice, theme in enumerate(themes):
7575 global_favicons.append([])
76− theme_img_path = searx_dir+"/static/"+theme+"/img/icons/"
76+ theme_img_path = searx_dir+"/static/themes/"+theme+"/img/icons/"
7777 for (dirpath, dirnames, filenames) in os.walk(theme_img_path):
7878 global_favicons[indice].extend(filenames)
7979
@@ -506,7 +506,7 @@ def opensearch():
506506@app.route('/favicon.ico')
507507def favicon():
508508 return send_from_directory(os.path.join(app.root_path,
509− 'static',
509+ 'static/themes',
510510 get_current_theme_name(),
511511 'img'),
512512 'favicon.png',