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);

View File

@ -97,6 +97,7 @@ h1 {
div.title {
background: url('../img/searx.png') no-repeat;
width: 100%;
min-height: 80px;
background-position: center;
h1 {
@ -126,6 +127,7 @@ fieldset {
#categories {
margin: 0 10px;
.user-select;
}
.checkbox_container {
@ -260,8 +262,12 @@ a {
.published_date {
font-size: 0.8em;
color: @color-result-publishdate-font;
margin: 5px 20px;
Margin: 5px 20px;
}
.thumbnail {
width: 400px;
}
}
.engines {
@ -297,14 +303,14 @@ a {
}
.image_result {
float: left;
display: inline-block;
margin: 10px 10px;
position: relative;
height: 160px;
max-height: 160px;
img {
border: 0;
height: 160px;
max-height: 160px;
}
p {
@ -369,17 +375,17 @@ tr {
#results {
margin: auto;
padding: 0;
width: @results-width;
width: @results-width;
margin-bottom: 20px;
}
#sidebar {
position: fixed;
bottom: 10px;
left: 10px;
bottom: 10px;
left: 10px;
margin: 0 2px 5px 5px;
padding: 0 2px 2px 2px;
width: 14em;
width: 14em;
input {
padding: 0;
@ -390,9 +396,17 @@ tr {
color: @color-result-search-url-font;
cursor: pointer;
}
input[type="submit"] {
input[type="submit"] {
text-decoration: underline;
}
}
}
#suggestions {
span {
display: block;
}
}
#suggestions, #answers {
@ -418,7 +432,8 @@ tr {
}
form {
display: inline;
display: inline-block;
min-width: 210px;
}
}
@ -436,6 +451,7 @@ tr {
border: 1px solid #ddd;
padding: 5px;
font-size: 0.8em;
/* box-shadow: 0px 0px 5px #CCC; */
img {
max-width: 20em;
@ -501,7 +517,10 @@ tr {
#pagination {
clear: both;
width: 40em;
br {
clear: both;
}
}
#apis {
@ -511,18 +530,19 @@ tr {
@media screen and (max-width: @results-width) {
#results {
margin: auto;
padding: 0;
width: 90%;
}
#results {
margin: auto;
padding: 0;
width: 90%;
}
.github {
display: none;
}
.checkbox_container {
display: block;
width: 90%;
width: 90%;
//float: left;
label {
@ -530,7 +550,7 @@ tr {
}
}
.right {
.preferences_container {
display: none;
postion: fixed !important;
top: 100px;
@ -541,20 +561,61 @@ tr {
@media screen and (max-width: 75em) {
#infoboxes {
position: inherit;
max-width: inherit;
div.title {
.infobox {
clear:both;
h1 {
font-size: 1em;
}
}
img {
float: left;
max-width: 10em;
}
}
html.touch #categories {
width: 95%;
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 {
font-size: 90%;
@ -583,13 +644,24 @@ tr {
display: none;
}
#search_url {
display: none;
}
#search_url {
display: none;
}
.result {
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 %}
<link title="searx" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/>
{% endblock %}
<script type="text/javascript">
searx = {};
searx.autocompleter = {% if autocomplete %}true{% else %}false{% endif %};
</script>
</head>
<body>
<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-autocompleter-1.1.2-min.js') }}" ></script>
{% 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>
</div>
</body>

View File

@ -1,7 +1,9 @@
<div id="categories">
<div id="categories_container">
{% for category in categories %}
<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>
</div>
<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>
</div>
{% endfor %}
</div>
</div>

View File

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

View File

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

View File

@ -1,13 +1,6 @@
<div class="result {{ result.class }}">
{% 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>
<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>
<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>
</div>
</div>

View File

@ -1,12 +1,8 @@
<div class="result">
{% if result['favicon'] %}
<img width="14" height="14" class="favicon" src="static/{{theme}}/img/icon_{{result['favicon']}}.ico" />
{% endif %}
<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 %}
<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>
</div>

View File

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

View File

@ -1,6 +1,6 @@
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" id="search_form">
<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" />
</div>
{% include 'default/categories.html' %}

View File

@ -49,7 +49,7 @@ class ViewsTestCase(SearxTestCase):
)
result = self.app.post('/', data={'q': 'test'})
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
)
self.assertIn(