Merge pull request #118 from dalf/master

default theme : small modifications
This commit is contained in:
Adam Tauber 2014-10-30 08:09:07 +01:00
commit 58cc03351a
16 changed files with 135 additions and 145 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 837 B

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -41,5 +41,9 @@ if(searx.autocompleter) {
} }
}); });
if (!!('ontouchstart' in window)) {
document.getElementsByTagName("html")[0].className += " touch";
}
})(window, document); })(window, document);

View File

@ -97,6 +97,7 @@ h1 {
div.title { div.title {
background: url('../img/searx.png') no-repeat; background: url('../img/searx.png') no-repeat;
width: 100%; width: 100%;
min-height: 80px;
background-position: center; background-position: center;
h1 { h1 {
@ -126,6 +127,7 @@ fieldset {
#categories { #categories {
margin: 0 10px; margin: 0 10px;
.user-select;
} }
.checkbox_container { .checkbox_container {
@ -260,8 +262,12 @@ a {
.published_date { .published_date {
font-size: 0.8em; font-size: 0.8em;
color: @color-result-publishdate-font; color: @color-result-publishdate-font;
margin: 5px 20px; Margin: 5px 20px;
} }
.thumbnail {
width: 400px;
}
} }
.engines { .engines {
@ -297,14 +303,14 @@ a {
} }
.image_result { .image_result {
float: left; display: inline-block;
margin: 10px 10px; margin: 10px 10px;
position: relative; position: relative;
height: 160px; max-height: 160px;
img { img {
border: 0; border: 0;
height: 160px; max-height: 160px;
} }
p { p {
@ -369,17 +375,17 @@ tr {
#results { #results {
margin: auto; margin: auto;
padding: 0; padding: 0;
width: @results-width; width: @results-width;
margin-bottom: 20px; margin-bottom: 20px;
} }
#sidebar { #sidebar {
position: fixed; position: fixed;
bottom: 10px; bottom: 10px;
left: 10px; left: 10px;
margin: 0 2px 5px 5px; margin: 0 2px 5px 5px;
padding: 0 2px 2px 2px; padding: 0 2px 2px 2px;
width: 14em; width: 14em;
input { input {
padding: 0; padding: 0;
@ -390,9 +396,17 @@ tr {
color: @color-result-search-url-font; color: @color-result-search-url-font;
cursor: pointer; cursor: pointer;
} }
input[type="submit"] { input[type="submit"] {
text-decoration: underline; text-decoration: underline;
} }
}
#suggestions {
span {
display: block;
}
} }
#suggestions, #answers { #suggestions, #answers {
@ -418,7 +432,8 @@ tr {
} }
form { form {
display: inline; display: inline-block;
min-width: 210px;
} }
} }
@ -436,6 +451,7 @@ tr {
border: 1px solid #ddd; border: 1px solid #ddd;
padding: 5px; padding: 5px;
font-size: 0.8em; font-size: 0.8em;
/* box-shadow: 0px 0px 5px #CCC; */
img { img {
max-width: 20em; max-width: 20em;
@ -501,7 +517,10 @@ tr {
#pagination { #pagination {
clear: both; clear: both;
width: 40em;
br {
clear: both;
}
} }
#apis { #apis {
@ -511,18 +530,19 @@ tr {
@media screen and (max-width: @results-width) { @media screen and (max-width: @results-width) {
#results { #results {
margin: auto; margin: auto;
padding: 0; padding: 0;
width: 90%; width: 90%;
} }
.github { .github {
display: none; display: none;
} }
.checkbox_container { .checkbox_container {
display: block; display: block;
width: 90%; width: 90%;
//float: left; //float: left;
label { label {
@ -530,7 +550,7 @@ tr {
} }
} }
.right { .preferences_container {
display: none; display: none;
postion: fixed !important; postion: fixed !important;
top: 100px; top: 100px;
@ -541,20 +561,61 @@ tr {
@media screen and (max-width: 75em) { @media screen and (max-width: 75em) {
#infoboxes { div.title {
position: inherit;
max-width: inherit;
.infobox { h1 {
clear:both; font-size: 1em;
}
}
img { html.touch #categories {
float: left; width: 95%;
max-width: 10em; height: 30px;
} text-align: left;
} overflow-x: scroll;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
} #categories_container {
width: 1000px;
width: -moz-max-content;
width: -webkit-max-content;
width: max-content;
.checkbox_container {
display: inline-block;
width: auto;
}
}
}
#categories {
font-size: 90%;
clear: both;
.checkbox_container {
margin-top: 2px;
margin: auto;
}
}
#suggestions, #answers {
margin-top: 5px;
}
#infoboxes {
position: inherit;
max-width: inherit;
.infobox {
clear:both;
img {
float: left;
max-width: 10em;
}
}
}
#categories { #categories {
font-size: 90%; font-size: 90%;
@ -583,13 +644,24 @@ tr {
display: none; display: none;
} }
#search_url { #search_url {
display: none; display: none;
} }
.result { .result {
border-top: 1px solid @color-result-top-border; border-top: 1px solid @color-result-top-border;
margin: 7px 0 6px 0; margin: 8px 0 8px 0;
.thumbnail {
max-width: 98%;
}
}
.image_result {
max-width: 98%;
img {
max-width: 98%;
}
} }
} }

View File

@ -13,10 +13,6 @@
{% block head %} {% block head %}
<link title="searx" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/> <link title="searx" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/>
{% endblock %} {% endblock %}
<script type="text/javascript">
searx = {};
searx.autocompleter = {% if autocomplete %}true{% else %}false{% endif %};
</script>
</head> </head>
<body> <body>
<div id="container"> <div id="container">
@ -26,6 +22,10 @@
<script src="{{ url_for('static', filename='js/mootools-core-1.4.5-min.js') }}" ></script> <script src="{{ url_for('static', filename='js/mootools-core-1.4.5-min.js') }}" ></script>
<script src="{{ url_for('static', filename='js/mootools-autocompleter-1.1.2-min.js') }}" ></script> <script src="{{ url_for('static', filename='js/mootools-autocompleter-1.1.2-min.js') }}" ></script>
{% endif %} {% endif %}
<script type="text/javascript">
searx = {};
searx.autocompleter = {% if autocomplete %}true{% else %}false{% endif %};
</script>
<script src="{{ url_for('static', filename='js/searx.js') }}" ></script> <script src="{{ url_for('static', filename='js/searx.js') }}" ></script>
</div> </div>
</body> </body>

View File

@ -1,7 +1,9 @@
<div id="categories"> <div id="categories">
<div id="categories_container">
{% for category in categories %} {% for category in categories %}
<div class="checkbox_container"> <div class="checkbox_container">
<input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} /><label for="checkbox_{{ category|replace(' ', '_') }}">{{ _(category) }}</label> <input type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} /><label for="checkbox_{{ category|replace(' ', '_') }}">{{ _(category) }}</label>
</div> </div>
{% endfor %} {% endfor %}
</div>
</div> </div>

View File

@ -1,6 +1,5 @@
{% extends "default/base.html" %} {% extends "default/base.html" %}
{% block content %} {% block content %}
{% include 'default/github_ribbon.html' %}
<div class="center"> <div class="center">
<div class="title"><h1>searx</h1></div> <div class="title"><h1>searx</h1></div>
{% include 'default/search.html' %} {% include 'default/search.html' %}
@ -9,4 +8,6 @@
<a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a> <a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a>
</p> </p>
</div> </div>
{% include 'default/github_ribbon.html' %}
{% endblock %} {% endblock %}

View File

@ -2,7 +2,7 @@
<h2>{{ infobox.infobox }}</h2> <h2>{{ infobox.infobox }}</h2>
{% if infobox.img_src %}<img src="{{ infobox.img_src }}" />{% endif %} {% if infobox.img_src %}<img src="{{ infobox.img_src }}" />{% endif %}
<p>{{ infobox.entity }}</p> <p>{{ infobox.entity }}</p>
<p>{{ infobox.content }}</p> <p>{{ infobox.content | safe }}</p>
{% if infobox.attributes %} {% if infobox.attributes %}
<div class="attributes"> <div class="attributes">
<table> <table>

View File

@ -1,13 +1,6 @@
<div class="result {{ result.class }}"> <div class="result {{ result.class }}">
<h3 class="result_title"> {% if result['favicon'] %}<img width="14" height="14" class="favicon" src="static/{{theme}}/img/icon_{{result['favicon']}}.ico" />{% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
{% if result['favicon'] %}
<img width="14" height="14" class="favicon" src="static/{{theme}}/img/icon_{{result['favicon']}}.ico" />
{% endif %}
<div>
<h3 class="result_title"><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>
</div>
</div> </div>

View File

@ -1,12 +1,8 @@
<div class="result"> <div class="result">
{% if result['favicon'] %}
<img width="14" height="14" class="favicon" src="static/{{theme}}/img/icon_{{result['favicon']}}.ico" />
{% endif %}
<p> <p>
<h3 class="result_title"><a href="{{ result.url }}">{{ result.title|safe }}</a></h3> <h3 class="result_title"> {% if result['favicon'] %}<img width="14" height="14" class="favicon" src="static/{{theme}}/img/icon_{{result['favicon']}}.ico" />{% endif %}<a href="{{ result.url }}">{{ result.title|safe }}</a></h3>
{% if result.publishedDate %}<p class="published_date">{{ result.publishedDate }}</p>{% endif %} {% if result.publishedDate %}<p class="published_date">{{ result.publishedDate }}</p>{% endif %}
<a href="{{ result.url }}"><img width="400px" src="{{ result.thumbnail }}" title={{ result.title }} alt=" {{ result.title }}"/></a> <a href="{{ result.url }}"><img class="thumbnail" src="{{ result.thumbnail }}" title={{ result.title }} alt=" {{ result.title }}"/></a>
<p class="url">{{ result.url }}</p> <p class="url">{{ result.url }}</p>
</p> </p>
</div> </div>

View File

@ -1,7 +1,7 @@
{% extends "default/base.html" %} {% extends "default/base.html" %}
{% block title %}{{ q }} - {% endblock %} {% block title %}{{ q }} - {% endblock %}
{% block content %} {% block content %}
<div class="right"><a href="{{ url_for('preferences') }}" id="preferences"><span>preferences</span></a></div> <div class="preferences_container right"><a href="{{ url_for('preferences') }}" id="preferences"><span>preferences</span></a></div>
<div class="small search center"> <div class="small search center">
{% include 'default/search.html' %} {% include 'default/search.html' %}
</div> </div>
@ -80,7 +80,7 @@
</form> </form>
{% endif %} {% endif %}
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}"> <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
<div class="left"> <div class="right">
{% for category in selected_categories %} {% for category in selected_categories %}
<input type="hidden" name="category_{{ category }}" value="1"/> <input type="hidden" name="category_{{ category }}" value="1"/>
{% endfor %} {% endfor %}
@ -89,6 +89,8 @@
<input type="submit" value="{{ _('next page') }} >>" /> <input type="submit" value="{{ _('next page') }} >>" />
</div> </div>
</form> </form>
<br />
</div> </div>
{% endif %} {% endif %}
</div> </div>

View File

@ -1,6 +1,6 @@
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form"> <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form">
<div id="search_wrapper"> <div id="search_wrapper">
<input type="text" placeholder="{{ _('Search for...') }}" id="q" class="q" name="q" tabindex="1" autocomplete="off" {% if q %}value="{{ q }}"{% endif %}/> <input type="text" placeholder="{{ _('Search for...') }}" id="q" class="q" name="q" tabindex="1" autocomplete="off" size="100" {% if q %}value="{{ q }}"{% endif %}/>
<input type="submit" value="search" id="search_submit" /> <input type="submit" value="search" id="search_submit" />
</div> </div>
{% include 'default/categories.html' %} {% include 'default/categories.html' %}

View File

@ -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"><a href="http://first.test.xyz">First <span class="highlight">Test</span></a></h3>', # noqa '<h3 class="result_title"> <img width="14" height="14" class="favicon" src="static/default/img/icon_youtube.ico" /><a href="http://first.test.xyz">First <span class="highlight">Test</span></a></h3>', # noqa
result.data result.data
) )
self.assertIn( self.assertIn(