Commit 01b8a58a authored by Luc Didry's avatar Luc Didry

Rework on theme frama to use oscar as much as possible

parent 3fd405dc
......@@ -12,5 +12,19 @@ $(document).ready(function() {
}
return false;
});
// frama theme
$('#menu .checkbox-toggle').click(function(e) {
$('#menu li').removeClass('active');
$(this).parent().addClass('active');
$('#categories input[type="checkbox"]').each(function(i, checkbox) {
$(checkbox).prop('checked', false);
});
$('#categories label').removeClass('btn-primary').removeClass('active').addClass('btn-default');
$($('#'+$(this).attr('data-target'))).prop('checked', 'checked');
$($('#'+$(this).attr('data-target'))).parent().removeClass('btn-default').addClass('btn-primary').addClass('active');
if($('#q').val()) {
$('#search_form').submit();
}
});
}
});
@font-face {
font-family: 'PT Sans Caption';
font-style: normal;
font-weight: 400;
src: local('PT Sans Caption'), local('PTSans-Caption'), url(../fonts/pt-sans-caption.ttf) format('truetype');
}
@font-face {
font-family: 'PT Sans Caption';
font-style: normal;
font-weight: 700;
src: local('PT Sans Caption Bold'), local('PTSans-CaptionBold'), url(../fonts/pt-sans-caption-bold.ttf) format('truetype');
}
.frama {
color: #6A5687;
}
.services {
color: #9BAE5F;
}
.container {
margin-bottom: 15px;
}
.menu-container {
margin-bottom: -2em;
}
.title {
font-weight: bold;
font-family: "DejaVu Sans", Verdana, Geneva, sans-serif;
}
.title img {
max-height: 1.2em;
}
#cog {
font-size: 2.5em;
color: #555555;
}
#categories {
padding: 0;
}
.no-left-border {
border-left: 0;
}
.result-title {
font-size: 125%;
}
.url {
font-size: 80%;
}
a.result-href, a.result-href:hover, a.result-href:focus {
color:#C64B3E;
}
.has-results {
margin-top: 5px;
padding-left: 5px;
}
#menu {
margin-left: 1em;
}
@media (min-width: 768px) {
.title {
font-size: 500%;
margin: 20px 0 20px 0;
padding-left: 1em;
}
.has-results,
#search_form {
margin-top: 1em;
}
}
@media (min-width: 992px) {
#menu {
margin-top: 1.8em;
}
.has-results #menu {
margin-top: 0.8em;
}
.explain {
margin-top: 6em;
}
}
@media (max-width: 767px) {
.title {
font-size: 200%;
margin-right: -1em;
margin-bottom: 1em;
}
#search-input-group {
padding-left: 5px;
}
#search_form {
margin-top: 1em;
}
.has-results {
padding-left: 20px;
}
.has-results #menu {
margin-top: -0.3em;
}
#menu {
margin-top: 1em;
}
}
.image_result {
height:160px;
}
.image_result img {
max-height:150px;
}
.image_result p {
margin:0;
padding:0;
}
.image_result p span a {
display:none;
color:#fff;
}
.image_result p:hover span a {
display:block;
position:absolute;
top:0;
left:15px;
padding:4px;
background-color:rgba(0,0,0,0.6);
}
#search_url_input {
display: block;
}
#search_url_input {
width: 100%;
}
.search_bookmark,
.suggest_input {
display: inline-block;
}
.suggest_input {
margin: 0 3px 3px 0;
}
.font-50px {
font-size: 50px;
}
.input-group-addon img {
max-height: 1.4em;
}
#sidebar_results {
padding-top: 10px;
}
.suggestion_item > button {
white-space: normal;
}
.label-default {
background: #fff;
}
#menu label.checkbox-toggle {
padding: 3px 20px;
font-weight: normal;
margin: 0;
}
.checkbox-toggle {
border-style: none !important;
}
.onoffswitch {
position: relative; width: 145px;
-webkit-user-select:none; -moz-user-select:none; -ms-user-select: none;
}
.onoffswitch-checkbox {
display: none;
}
.onoffswitch-label {
display: block; overflow: hidden; cursor: pointer;
/*border: 2px solid #999999;*/ border-radius: 20px;
}
.onoffswitch-inner {
display: block; width: 200%; margin-left: -100%;
-moz-transition: margin 0.3s ease-in 0s; -webkit-transition: margin 0.3s ease-in 0s;
-o-transition: margin 0.3s ease-in 0s; transition: margin 0.3s ease-in 0s;
}
.onoffswitch-inner:before, .onoffswitch-inner:after {
display: block; float: left; width: 50%; height: 30px; padding: 0; line-height: 30px;
font-size: 14px; color: white; font-family: Trebuchet, Arial, sans-serif; font-weight: bold;
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
}
.onoffswitch-inner:before {
padding-left: 10px;
background-color: #EEEEEE; color: #999999;
}
.onoffswitch-inner:after {
padding-right: 10px;
background-color: #2ECC71; color: #FFFFFF;
text-align: right;
}
.onoffswitch-switch {
display: block; width: 18px; margin: 6px;
background: #FFFFFF;
border: 2px solid #999999; border-radius: 20px;
position: absolute; top: 0; bottom: 0; right: 114px;
-moz-transition: all 0.3s ease-in 0s; -webkit-transition: all 0.3s ease-in 0s;
-o-transition: all 0.3s ease-in 0s; transition: all 0.3s ease-in 0s;
}
.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner {
margin-left: 0;
}
.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch {
right: 0px;
}
if (document.getElementById('search_submit') !== null) {
document.getElementById('search_submit').onclick = function() {
if (document.getElementById('q') !== null && document.getElementById('q').value !== '' ) {
document.getElementById('search_form').submit();
}
}
}
if (document.getElementById('search_empty') !== null) {
document.getElementById('search_empty').onclick = function(event) {
document.getElementById('q').value = '';
document.getElementById('q').focus();
}
}
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{% extends "frama/base.html" %}
{% block site_alert_warning_nojs %} {% endblock %}
{% block title %}{{ _('about') }} - {% endblock %}
{% block content %}
<div class="row">
<div class="col-md-12 has-results">
{% include 'frama/cog.html' %}
{% include 'frama/search.html' %}
</div>
</div>
<div{% if rtl %} dir="ltr"{% endif %}>
<h1>About <a href="{{ url_for('index') }}">searx</a></h1>
<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.
</p>
<h2>Why use Searx?</h2>
<ul>
<li>Searx may not offer you as personalised results as Google, but it doesn't generate a profile about you</li>
<li>Searx doesn't care about what you search for, never shares anything with a third party, and it can't be used to compromise you</li>
<li>Searx is free software, the code is 100% open and you can help to make it better. See more on <a href="https://github.com/asciimoo/searx">github</a></li>
</ul>
<p>If you do care about privacy, want to be a conscious user, or otherwise believe
in digital freedom, make Searx your default search engine or run it on your own server</p>
<h2>Technical details - How does it work?</h2>
<p>Searx is a <a href="https://en.wikipedia.org/wiki/Metasearch_engine">metasearch engine</a>,
inspired by the <a href="http://seeks-project.info/">seeks project</a>.<br />
It provides basic privacy by mixing your queries with searches on other platforms without storing search data. Queries are made using a POST request on every browser (except chrome*). Therefore they show up in neither our logs, nor your url history. In case of Chrome* users there is an exception, Searx uses the search bar to perform GET requests.<br />
Searx can be added to your browser's search bar; moreover, it can be set as the default search engine.
</p>
<h2>How can I make it my own?</h2>
<p>Searx appreciates your concern regarding logs, so take the <a href="https://github.com/asciimoo/searx">code</a> and run it yourself! <br />Add your Searx to this <a href="https://github.com/asciimoo/searx/wiki/Searx-instances">list</a> to help other people reclaim their privacy and make the Internet freer!
<br />The more decentralized the Internet, is the more freedom we have!</p>
<h2>More about searx</h2>
<ul>
<li><a href="https://github.com/asciimoo/searx">github</a></li>
<li><a href="https://www.ohloh.net/p/searx/">ohloh</a></li>
<li><a href="https://twitter.com/Searx_engine">twitter</a></li>
<li>IRC: #searx @ freenode (<a href="https://kiwiirc.com/client/irc.freenode.com/searx">webclient</a>)</li>
<li><a href="https://www.transifex.com/projects/p/searx/">transifex</a></li>
</ul>
<hr />
<h2 id="faq">FAQ</h2>
<h3>How to add to firefox?</h3>
<p><a href="#" onclick="window.external.AddSearchProvider(window.location.protocol + '//' + window.location.host + '{{ url_for('opensearch') }}');">Install</a> searx as a search engine on any version of Firefox! (javascript required)</p>
<h2 id="dev_faq">Developer FAQ</h2>
<h3>New engines?</h3>
<ul>
<li>Edit your <a href="https://raw.github.com/asciimoo/searx/master/searx/settings.yml">settings.yml</a></li>
<li>Create your custom engine module, check the <a href="https://github.com/asciimoo/searx/blob/master/examples/basic_engine.py">example engine</a></li>
</ul>
<p>Don't forget to restart searx after config edit!</p>
<h3>Installation/WSGI support?</h3>
<p>See the <a href="https://github.com/asciimoo/searx/wiki/Installation">installation and setup</a> wiki page</p>
<h3>How to debug engines?</h3>
<p><a href="{{ url_for('stats') }}">Stats page</a> contains some useful data about the engines used.</p>
</div>
{% endblock %}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"{% if rtl %} dir="rtl"{% endif %}>
<head>
<meta charset="UTF-8" />
<meta name="description" content="Searx - a privacy-respecting, hackable metasearch engine" />
<meta name="keywords" content="searx, search, search engine, metasearch, meta search" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="searx/{{ searx_version }}">
<meta name="referrer" content="no-referrer">
<meta name="viewport" content="width=device-width, initial-scale=1 , maximum-scale=1.0, user-scalable=1" />
{% block meta %}{% endblock %}
<title>{% block title %}{% endblock %}searx</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}" type="text/css" />
<link rel="stylesheet" href="{{ url_for('static', filename='themes/oscar/css/oscar.min.css') }}" type="text/css" />
<link rel="stylesheet" href="{{ url_for('static', filename='nav/css/frama.css') }}" type="text/css" />
<link rel="stylesheet" href="{{ url_for('static', filename='css/frama.css') }}" type="text/css" />
<link rel="stylesheet" href="{{ url_for('static', filename='themes/oscar/css/leaflet.min.css') }}" type="text/css" />
{% for css in styles %}
<link rel="stylesheet" href="{{ url_for('static', filename=css) }}" type="text/css" />
{% endfor %}
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="{{ url_for('static', filename='js/html5shiv.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/respond.min.js') }}"></script>
<![endif]-->
<link rel="shortcut icon" href="{{ url_for('static', filename='themes/oscar/img/favicon.png') }}" />
{% block styles %}
{% endblock %}
{% block head %}
{% endblock %}
<link title="searx" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/>
<script type="text/javascript">
searx = {};
searx.method = "{{ method or 'POST' }}";
searx.autocompleter = {% if autocomplete %}true{% else %}false{% endif %};
</script>
<noscript>
<style type="text/css">
.tab-content > .active_if_nojs, .active_if_nojs {display: block !important; visibility: visible !important;}
.margin_top_if_nojs {margin-top: 20px;}
.hide_if_nojs {display: none !important;overflow:none !important;}
.disabled_if_nojs {pointer-events: none; cursor: default; text-decoration: line-through;}
</style>
</noscript>
</head>
<body>
<div class="container">
{% block site_alert_error %}
{% endblock %}
{% block site_alert_warning %}
{% endblock %}
{% block site_alert_warning_nojs %}
<noscript>
<div class="visible-xs-block">
{% include 'oscar/messages/js_disabled.html' %}
</div>
</noscript>
{% endblock %}
{% block site_alert_info %}
{% endblock %}
{% block site_alert_success %}
{% endblock %}
{% block content %}
{% endblock %}
</div>
<div class="footer">
<div class="container">
{% block footer %}
{% endblock %}
<p class="text-muted">{{ _('Powered by') }} <a href="https://github.com/asciimoo/searx">searx</a> - {{ searx_version }} - {{ _('a privacy-respecting, hackable metasearch engine') }}</p>
</div>
</div>
<script src="{{ url_for('static', filename='js/jquery-1.11.1.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
{% if autocomplete %}<script src="{{ url_for('static', filename='js/typeahead.bundle.min.js') }}"></script>{% endif %}
<script src="{{ url_for('static', filename='js/require-2.1.15.min.js') }}"></script>
<script src="{{ url_for('static', filename='themes/oscar/js/searx.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/frama.js') }}" ></script>
{% for script in scripts %}
<script src="{{ url_for('static', filename=script) }}"></script>
{% endfor %}
</body>
</html>
<!-- used if scripts are disabled -->
<noscript>
<div id="categories" class="btn-group btn-toggle">
{% if rtl %}
{% for category in categories | reverse %}
<!--<div class="checkbox">-->
<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}_nojs" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />
<label class="btn btn-sm btn-primary active label_hide_if_not_checked" for="checkbox_{{ category|replace(' ', '_') }}_nojs">{{ _(category) }}</label>
<label class="btn btn-sm btn-default label_hide_if_checked" for="checkbox_{{ category|replace(' ', '_') }}_nojs">{{ _(category) }}</label>
<!--</div>-->
{% if category in selected_categories %}<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}_dis_activation" name="category_{{ category }}" value="off" checked="checked"/>{% endif %}
{% endfor %}
{% else %}
{% for category in categories %}
<!--<div class="checkbox">-->
<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}_nojs" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />
<label class="btn btn-sm btn-primary active label_hide_if_not_checked" for="checkbox_{{ category|replace(' ', '_') }}_nojs">{{ _(category) }}</label>
<label class="btn btn-sm btn-default label_hide_if_checked" for="checkbox_{{ category|replace(' ', '_') }}_nojs">{{ _(category) }}</label>
<!--</div>-->
{% if category in selected_categories %}<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}_dis_activation" name="category_{{ category }}" value="off" checked="checked"/>{% endif %}
{% endfor %}
{% endif %}
</div>
</noscript>
<div id="categories" class="hidden-xs">
<ul class="nav nav-pills nav-justified">
{% if rtl %}
{% for category in categories | reverse %}
<li class="{% if category in selected_categories %}active{% endif %}">
<label class="checkbox-toggle btn {% if category in selected_categories %}btn-primary active{% else %}btn-default{% endif %}" data-btn-class="primary">
<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />{{ _(category)|capitalize }}
</label>
</li>
{% endfor %}
{% else %}
{% for category in categories %}
<li class="{% if category in selected_categories %}active{% endif %}">
<label class="checkbox-toggle btn {% if category in selected_categories %}btn-primary active{% else %}btn-default{% endif %}" data-btn-class="primary">
<input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />{{ _(category)|capitalize }}
</label>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
<div id="menu" class="pull-right dropdown">
<a id="cog" data-toggle="dropdown" href="#"><span class="glyphicon glyphicon-cog"></span><span class="caret"></span></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li><a href="{{ url_for('about') }}" class="hmarg">{{ _('about') }}</a></li>
<li><a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences')|capitalize }}</a></li>
<li>
<a href="#" onclick="window.external.AddSearchProvider(window.location.protocol + '//' + window.location.host + '{{ url_for('opensearch') }}');">
{{ _('Install in browser') }}
</a>
</li>
<li class="divider visible-xs-block"></li>
{% for category in categories %}
<li class="visible-xs-block{% if category in selected_categories %} active{% endif %}">
<a href="#" class="checkbox-toggle" data-target="checkbox_{{ category|replace(' ', '_') }}">
{{ _(category)|capitalize }}
</a>
</li>
{% endfor %}
</ul>
</div>
{% extends "frama/base.html" %}
{% block content %}
<div class="col-md-12">
{% include 'frama/cog.html' %}
<div class="text-center row menu-container">
<h1 class="hidden-xs text-hide center-block title"><img class="center-block img-responsive" src="{{ url_for('static', filename='themes/oscar/img/searx_logo.png') }}" alt="searx logo"/>searx</h1>
<h1 class="visible-xs title"><img src="{{ url_for('static', filename='img/searx_logo_alone.png') }}" alt="searx logo"/>Searx</h1>
</div>
{% include 'frama/search.html' %}
</div>
{% endblock %}
{% macro checkbox_toggle(id, blocked) -%}
<div class="onoffswitch">
<input type="checkbox" id="{{ id }}" name="{{ id }}"{% if blocked %} checked="checked"{% endif %} class="onoffswitch-checkbox" />
<label class="onoffswitch-label" for="{{ id }}">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
{%- endmacro %}
This diff is collapsed.
{% extends "frama/base.html" %}
{% block title %}{{ q }} - {% endblock %}
{% block meta %}<link rel="alternate" type="application/rss+xml" title="Searx search: {{ q }}" href="{{ url_for('index') }}?q={{ q|urlencode }}&amp;format=rss&amp;{% for category in selected_categories %}category_{{ category }}=1&amp;{% endfor %}pageno={{ pageno }}">{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-12 has-results">
{% include 'frama/cog.html' %}
{% include 'frama/search.html' %}
</div>
</div>
<div id="results" class="container-fluid">
<div class="row">
<div class="col-sm-8" id="main_results">
<h1 class="sr-only">{{ _('Search results') }}</h1>
{% if answers %}
{% for answer in answers %}
<div class="result well">
<span>{{ answer }}</span>
</div>
{% endfor %}
{% endif %}
{% for result in results %}
<div class="result {% if result['template'] %}result-{{ result.template|replace('.html', '') }}{% else %}result-default{% endif %}">
{% set index = loop.index %}
{% if result.template %}
{% include get_result_template('oscar', result['template']) %}
{% else %}
{% include 'oscar/result_templates/default.html' %}
{% endif %}
</div>
{% endfor %}
{% if not results and not answers %}
{% include 'oscar/messages/no_results.html' %}
{% endif %}
<div class="clearfix"></div>
{% if paging %}
{% if rtl %}
<div id="pagination">
<div class="pull-left">
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
<input type="hidden" name="q" value="{{ q }}" />
{% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
<input type="hidden" name="q" value="{{ q }}" />
<input type="hidden" name="pageno" value="{{ pageno+1 }}" />
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-backward"></span> {{ _('next page') }}</button>
</form>
</div>
<div class="pull-right">
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
{% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
<input type="hidden" name="pageno" value="{{ pageno-1 }}" />
<button type="submit" class="btn btn-default" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-forward"></span> {{ _('previous page') }}</button>
</form>
</div>
</div><!-- /#pagination -->
<div class="clearfix"></div>
{% else %}
<div id="pagination">
<div class="pull-left">
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
<input type="hidden" name="q" value="{{ q }}" />
{% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
<input type="hidden" name="pageno" value="{{ pageno-1 }}" />
<button type="submit" class="btn btn-default btn-info" {% if pageno == 1 %}disabled{% endif %}><span class="glyphicon glyphicon-backward"></span> {{ _('previous page') }}</button>
</form>
</div>
<div class="pull-right">
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" class="pull-left">
{% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1"/>{% endfor %}
<input type="hidden" name="q" value="{{ q }}" />
<input type="hidden" name="pageno" value="{{ pageno+1 }}" />
<button type="submit" class="btn btn-default btn-info"><span class="glyphicon glyphicon-forward"></span> {{ _('next page') }}</button>
</form>
</div>
</div><!-- /#pagination -->
<div class="clearfix"></div>
{% endif %}
{% endif %}
</div><!-- /#main_results -->
<div class="col-sm-4" id="sidebar_results">
{% if suggestions %}
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">{{ _('Suggestions') }}</h4>
</div>
<div class="panel-body">
{% for suggestion in suggestions %}
<form method="{{ method or 'POST' }}" action="{{ url_for('index') }}" role="navigation" class="form-inline pull-{% if rtl %}right{% else %}left{% endif %} suggestion_item">
<input type="hidden" name="q" value="{{ suggestion }}">
<button type="submit" class="btn btn-default btn-xs">{{ suggestion }}</button>
</form>
{% endfor %}
</div>
</div>
{% endif %}
{% if infoboxes %}
{% for infobox in infoboxes %}
{% include 'oscar/infobox.html' %}
{% endfor %}
{% endif %}