Browse Source

[mod] inline suggestions

Adam Tauber 11 years ago
parent
commit
ead8d30ea0
3 changed files with 29 additions and 24 deletions
  1. 5
    3
      searx/static/css/style.css
  2. 14
    11
      searx/static/less/style.less
  3. 10
    10
      searx/templates/results.html

+ 5
- 3
searx/static/css/style.css View File

62
 #results{margin:auto;padding:0;width:50em;margin-bottom:20px}
62
 #results{margin:auto;padding:0;width:50em;margin-bottom:20px}
63
 #sidebar{position:absolute;top:100px;left:10px;margin:0 2px 5px 5px;padding:0 2px 2px 2px;width:14em}#sidebar input{padding:0;margin:3px;font-size:.8em;display:inline-block;background:transparent;color:#444;cursor:pointer}
63
 #sidebar{position:absolute;top:100px;left:10px;margin:0 2px 5px 5px;padding:0 2px 2px 2px;width:14em}#sidebar input{padding:0;margin:3px;font-size:.8em;display:inline-block;background:transparent;color:#444;cursor:pointer}
64
 #sidebar input[type="submit"]{text-decoration:underline}
64
 #sidebar input[type="submit"]{text-decoration:underline}
65
-#suggestions span{display:block;margin:0 2px 2px 2px;padding:0}
66
-#suggestions form{display:block}
65
+#suggestions span{display:inline;margin:0 2px 2px 2px;padding:0}
66
+#suggestions input{padding:0;margin:3px;font-size:.8em;display:inline-block;background:transparent;color:#444;cursor:pointer}
67
+#suggestions input[type="submit"]{text-decoration:underline}
68
+#suggestions form{display:inline}
67
 #search_url{margin-top:8px}#search_url input{border:1px solid #888;padding:4px;color:#444;width:14em;display:block;margin:4px;font-size:.8em}
69
 #search_url{margin-top:8px}#search_url input{border:1px solid #888;padding:4px;color:#444;width:14em;display:block;margin:4px;font-size:.8em}
68
 #preferences{top:10px;padding:0;border:0;background:url('../img/preference-icon.png') no-repeat;background-size:28px 28px;opacity:.8;width:28px;height:30px;display:block}#preferences *{display:none}
70
 #preferences{top:10px;padding:0;border:0;background:url('../img/preference-icon.png') no-repeat;background-size:28px 28px;opacity:.8;width:28px;height:30px;display:block}#preferences *{display:none}
69
 #pagination{clear:both;width:40em}
71
 #pagination{clear:both;width:40em}
70
 #apis{margin-top:8px;clear:both}
72
 #apis{margin-top:8px;clear:both}
71
-@media screen and (max-width:50em){#categories{font-size:90%;clear:both}#categories .checkbox_container{margin-top:2px;margin:auto} #results{margin:auto;padding:0;width:90%} .checkbox_container{display:block;width:90%}.checkbox_container label{border-bottom:0}}@media screen and (max-width:70em){#suggestions span{display:inline} #suggestions form{display:inline} .right{display:none;postion:fixed !important;top:100px;right:0} #sidebar{position:static;max-width:50em;margin:0 0 2px 0;padding:0;float:none;border:none;width:auto}#sidebar input{border:0} #apis{display:none} #search_url{display:none} .result{border-top:1px solid #e8e7e6;margin:7px 0 6px 0}.result img{max-width:90%;width:auto;height:auto}}.favicon{float:left;margin-right:4px;margin-top:2px}
73
+@media screen and (max-width:50em){#categories{font-size:90%;clear:both}#categories .checkbox_container{margin-top:2px;margin:auto} #results{margin:auto;padding:0;width:90%} .checkbox_container{display:block;width:90%}.checkbox_container label{border-bottom:0}}@media screen and (max-width:70em){.right{display:none;postion:fixed !important;top:100px;right:0} #sidebar{position:static;max-width:50em;margin:0 0 2px 0;padding:0;float:none;border:none;width:auto}#sidebar input{border:0} #apis{display:none} #search_url{display:none} .result{border-top:1px solid #e8e7e6;margin:7px 0 6px 0}.result img{max-width:90%;width:auto;height:auto}}.favicon{float:left;margin-right:4px;margin-top:2px}
72
 .preferences_back{background:none repeat scroll 0 0 #3498db;border:0 none;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;cursor:pointer;display:inline-block;margin:2px 4px;padding:4px 6px}.preferences_back a{color:#fff}
74
 .preferences_back{background:none repeat scroll 0 0 #3498db;border:0 none;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;cursor:pointer;display:inline-block;margin:2px 4px;padding:4px 6px}.preferences_back a{color:#fff}

+ 14
- 11
searx/static/less/style.less View File

383
 #suggestions {
383
 #suggestions {
384
 
384
 
385
 	span {
385
 	span {
386
-		display: block;
386
+		display: inline;
387
 		margin: 0 2px 2px 2px;
387
 		margin: 0 2px 2px 2px;
388
 		padding: 0;
388
 		padding: 0;
389
 	}
389
 	}
390
+	input {
391
+		padding: 0;
392
+		margin: 3px;
393
+		font-size: 0.8em;
394
+		display: inline-block;
395
+        background: transparent;
396
+        color: @color-result-search-url-font;
397
+		cursor: pointer;
398
+	}
399
+    input[type="submit"] {
400
+		text-decoration: underline;
401
+    }
390
 
402
 
391
 	form {
403
 	form {
392
-		display: block;
404
+		display: inline;
393
 	}
405
 	}
394
 }
406
 }
395
 
407
 
463
 }
475
 }
464
 
476
 
465
 @media screen and (max-width: 70em) {
477
 @media screen and (max-width: 70em) {
466
-	#suggestions {
467
-		span {
468
-			display: inline;
469
-		}
470
-
471
-		form {
472
-			display: inline;
473
-		}
474
-	}
475
 	.right {
478
 	.right {
476
 		display: none;
479
 		display: none;
477
 		postion: fixed !important;
480
 		postion: fixed !important;

+ 10
- 10
searx/templates/results.html View File

7
 </div>
7
 </div>
8
 <div id="results">
8
 <div id="results">
9
     <div id="sidebar">
9
     <div id="sidebar">
10
-        {% if suggestions %}
11
-        <div id="suggestions"><span>{{ _('Suggestions') }}</span>
12
-            {% for suggestion in suggestions %}
13
-            <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
14
-                <input type="hidden" name="q" value="{{ suggestion }}">
15
-                <input type="submit" value="{{ suggestion }}" />
16
-            </form>
17
-            {% endfor %}
18
-        </div>
19
-        {% endif %}
20
 
10
 
21
         <div id="search_url">
11
         <div id="search_url">
22
             {{ _('Search URL') }}:
12
             {{ _('Search URL') }}:
40
         </div>
30
         </div>
41
     </div>
31
     </div>
42
 
32
 
33
+    {% if suggestions %}
34
+    <div id="suggestions"><span>{{ _('Suggestions') }}</span>
35
+        {% for suggestion in suggestions %}
36
+        <form method="{{ method or 'POST' }}" action="{{ url_for('index') }}">
37
+            <input type="hidden" name="q" value="{{ suggestion }}">
38
+            <input type="submit" value="{{ suggestion }}" />
39
+        </form>
40
+        {% endfor %}
41
+    </div>
42
+    {% endif %}
43
 
43
 
44
     {% for result in results %}
44
     {% for result in results %}
45
         {% if result['template'] %}
45
         {% if result['template'] %}