on master help sign in
[fix] proper src/href url handling
commita4f89a798196f7d0c8a72ca80b34d2e9b6c040d5 authorAdam Tauber <asciimoo@gmail.com> dateTue 4 Mar 2014, 20:31 (13 years ago) parente86947d
7 files changed+18−18
searx/templates/about.html+3−3 searx/templates/base.html+3−3 searx/templates/github_ribbon.html+1−1 searx/templates/index.html+2−2 searx/templates/preferences.html+2−2 searx/templates/results.html+6−6 searx/templates/search.html+1−1
searx/templates/about.html+3−3
@@ -2,9 +2,9 @@
22{% block content %}
33{% include 'github_ribbon.html' %}
44<div class="row">
5− <h1>About <a href="/">searx</a></h1>
5+ <h1>About <a href="{{ url_for('index') }}">searx</a></h1>
66
7− <p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>, aggregating the results of other <a href="/preferences">search engines</a> while not storing information about its users.
7+ <p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>, aggregating the results of other <a href="{{ url_for('preferences') }}">search engines</a> while not storing information about its users.
88 </p>
99 <h2>Why use Searx?</h2>
1010 <ul>
@@ -60,7 +60,7 @@ Searx can be added to your browser's search bar; moreover, it can be set as the
6060<p>See the <a href="https://github.com/asciimoo/searx/wiki/Installation">installation and setup</a> wiki page</p>
6161
6262<h3>How to debug engines?</h3>
63−<p><a href="/stats">Stats page</a> contains some useful data about the engines used.</p>
63+<p><a href="{{ url_for('stats') }}">Stats page</a> contains some useful data about the engines used.</p>
6464
6565</div>
6666{% endblock %}
searx/templates/base.html+3−3
@@ -6,19 +6,19 @@
66 <meta name="keywords" content="searx, search, search engine, metasearch, meta search" />
77 <meta name="viewport" content="width=device-width, maximum-scale=1.0, user-scalable=1" />
88 <title>{% block title %}{% endblock %}searx</title>
9− <link rel="stylesheet" href="/static/css/style.css" type="text/css" media="screen" />
9+ <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" type="text/css" media="screen" />
1010 <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}?v=2" />
1111 {% block styles %}
1212 {% endblock %}
1313 {% block head %}
14− <link title="searx" type="application/opensearchdescription+xml" rel="search" href="/opensearch.xml"/>
14+ <link title="searx" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/>
1515 {% endblock %}
1616</head>
1717<body>
1818<div id="container">
1919{% block content %}
2020{% endblock %}
21−<script src="/static/js/searx.js" ></script>
21+<script src="{{ url_for('static', filename='js/searx.js') }}" ></script>
2222</div>
2323</body>
2424</html>
searx/templates/github_ribbon.html+1−1
@@ -1,3 +1,3 @@
11<a href="https://github.com/asciimoo/searx" class="github">
2− <img style="position: absolute; top: 0; right: 0; border: 0;" src="/static/img/github_ribbon.png" alt="Fork me on GitHub" class="github"/>
2+ <img style="position: absolute; top: 0; right: 0; border: 0;" src="{{ url_for('static', filename='img/github_ribbon.png') }}" alt="Fork me on GitHub" class="github"/>
33</a>
searx/templates/index.html+2−2
@@ -4,8 +4,8 @@
44 <div class="title"><h1>searx</h1></div>
55 {% include 'search.html' %}
66 <p class="top_margin">
7− <a href="/about" class="hmarg">{{ _('about') }}</a>
8− <a href="/preferences" class="hmarg">{{ _('preferences') }}</a>
7+ <a href="{{ url_for('about') }}" class="hmarg">{{ _('about') }}</a>
8+ <a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a>
99 </p>
1010</div>
1111{% endblock %}
searx/templates/preferences.html+2−2
@@ -4,7 +4,7 @@
44<div class="row">
55 <h2>{{ _('Preferences') }}</h2>
66
7− <form method="post" action="/preferences" id="search_form">
7+ <form method="post" action="{{ url_for('preferences') }}" id="search_form">
88 <fieldset>
99 <legend>{{ _('Default categories') }}</legend>
1010 <p>
@@ -66,6 +66,6 @@
6666
6767 <input type="submit" value="{{ _('save') }}" />
6868 </form>
69− <div class="right"><a href="/">{{ _('back') }}</a></div>
69+ <div class="right"><a href="{{ url_for('index') }}">{{ _('back') }}</a></div>
7070</div>
7171{% endblock %}
searx/templates/results.html+6−6
@@ -1,7 +1,7 @@
11{% extends "base.html" %}
22{% block title %}{{ q }} - {% endblock %}
33{% block content %}
4−<div class="right"><a href="/preferences" id="preferences"><span>preferences</span></a></div>
4+<div class="right"><a href="{{ url_for('preferences') }}" id="preferences"><span>preferences</span></a></div>
55<div class="small search">
66 {% include 'search.html' %}
77</div>
@@ -10,8 +10,8 @@
1010 {% if suggestions %}
1111 <div id="suggestions"><span>{{ _('Suggestions') }}</span>
1212 {% for suggestion in suggestions %}
13− <form method="post" action="/">
14− <input type="hidden" name="q" value="{{suggestion}}">
13+ <form method="post" action="{{ url_for('index') }}">
14+ <input type="hidden" name="q" value="{{ suggestion }}">
1515 <input type="submit" value="{{ suggestion }}" />
1616 </form>
1717 {% endfor %}
@@ -25,7 +25,7 @@
2525 <div id="apis">
2626 {{ _('Download results') }}
2727 {% for output_type in ('csv', 'json', 'rss') %}
28− <form method="post" action="/">
28+ <form method="post" action="{{ url_for('index') }}">
2929 <div class="left">
3030 <input type="hidden" name="q" value="{{ q }}" />
3131 <input type="hidden" name="format" value="{{ output_type }}" />
@@ -52,7 +52,7 @@
5252 {% if paging %}
5353 <div id="pagination">
5454 {% if pageno > 1 %}
55− <form method="post" action="/">
55+ <form method="post" action="{{ url_for('index') }}">
5656 <div class="left">
5757 <input type="hidden" name="q" value="{{ q }}" />
5858 {% for category in selected_categories %}
@@ -63,7 +63,7 @@
6363 </div>
6464 </form>
6565 {% endif %}
66− <form method="post" action="/">
66+ <form method="post" action="{{ url_for('index') }}">
6767 <div class="left">
6868 {% for category in selected_categories %}
6969 <input type="hidden" name="category_{{ category }}" value="1"/>
searx/templates/search.html+1−1
@@ -1,4 +1,4 @@
1−<form method="post" action="/" id="search_form">
1+<form method="post" action="{{ url_for('index') }}" id="search_form">
22 <div id="search_wrapper">
33 <input type="text" id="q" class="q" name="q" tabindex="1" autocomplete="off" {% if q %}value="{{ q }}"{% endif %}/>
44 <input type="submit" value="search" id="search_submit" />