Browse Source

[fix] menu without js - closes #747

Adam Tauber 8 years ago
parent
commit
9782633054

+ 1
- 1
searx/static/themes/oscar/css/logicodev.min.css
File diff suppressed because it is too large
View File


+ 36
- 1
searx/static/themes/oscar/less/logicodev/navbar.less View File

@@ -15,7 +15,7 @@
15 15
     line-height: 30px;
16 16
 }
17 17
 
18
-.navbar, .navbar-default{
18
+.navbar, .navbar-default, .menu {
19 19
     background-color: @black;
20 20
     border: none;
21 21
     border-top: 4px solid @light-green;
@@ -52,3 +52,38 @@
52 52
 .navbar-toggle {
53 53
     margin-top: 0;
54 54
 }
55
+
56
+.menu {
57
+    margin: 0;
58
+    padding: 0;
59
+    position: absolute;
60
+    top: 4px;
61
+    border: 0;
62
+    z-index: 1000000000;
63
+    height: 40px;
64
+    line-height: 40px;
65
+    ul {
66
+        padding: 0;
67
+        margin: 0;
68
+        li {
69
+            padding: 0 0.6em;
70
+            margin: 0;
71
+            float: left;
72
+            list-style: none;
73
+            a {
74
+                color: @dim-gray;
75
+            }
76
+        }
77
+        li.active a {
78
+            color: @light-green;
79
+        }
80
+    }
81
+}
82
+
83
+.menu-right {
84
+    right: 2em;
85
+}
86
+
87
+.menu-left {
88
+    left: 2em;
89
+}

+ 0
- 1
searx/templates/oscar/about.html View File

@@ -1,5 +1,4 @@
1 1
 {% extends "oscar/base.html" %}
2
-{% block site_alert_warning_nojs %} {% endblock %}
3 2
 {% block title %}{{ _('about') }} - {% endblock %}
4 3
 {% block content %}
5 4
 <div{% if rtl %} dir="ltr"{% endif %}>

+ 0
- 7
searx/templates/oscar/base.html View File

@@ -59,13 +59,6 @@
59 59
     {% endblock %}
60 60
     {% block site_alert_warning %}
61 61
     {% endblock %}
62
-    {% block site_alert_warning_nojs %}
63
-    <noscript>
64
-        <div class="visible-xs-block">
65
-        {% include 'oscar/messages/js_disabled.html' %}
66
-        </div>
67
-    </noscript>
68
-    {% endblock %}
69 62
     {% block site_alert_info %}
70 63
     {% endblock %}
71 64
     {% block site_alert_success %}

+ 0
- 1
searx/templates/oscar/categories.html View File

@@ -3,7 +3,6 @@
3 3
     {% for category in categories | reverse %}
4 4
         <input class="hidden" type="checkbox" id="checkbox_{{ category|replace(' ', '_') }}" name="category_{{ category }}" {% if category in selected_categories %}checked="checked"{% endif %} />
5 5
         <label for="checkbox_{{ category|replace(' ', '_') }}">{{ _(category) }}</label>
6
-        </label>
7 6
     {% endfor %}
8 7
 {% else %}
9 8
     {% for category in categories %}

+ 0
- 4
searx/templates/oscar/messages/js_disabled.html View File

@@ -1,4 +0,0 @@
1
-<div class="alert alert-warning" role="alert">
2
-    <strong class="lead">{{ _('Warning!') }}</strong>
3
-    {{ _('Please enable JavaScript to use full functionality of this site.') }}
4
-</div>

+ 7
- 33
searx/templates/oscar/navbar.html View File

@@ -1,40 +1,14 @@
1 1
 <!-- Static navbar -->
2 2
 <div class="navbar navbar-default" role="navigation">
3 3
     <div class="container-fluid">
4
-        {% if rtl %}
5
-        <div class="navbar-collapse collapse navbar-left">
6
-            <ul class="nav navbar-nav navbar-left"> <!-- results.html -->
7
-                <li{% if template_name == 'preferences.html' %} class="active"{% endif %}><a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a></li>
8
-                <li{% if template_name == 'about.html' %} class="active"{% endif %}><a href="{{ url_for('about') }}" class="hmarg">{{ _('about') }}</a></li>
9
-                <li{% if template_name == 'index.html' %} class="active"{% endif %}><a href="{{ url_for('index') }}" class="hmarg">{{ _('home') }}</a></li>
10
-            </ul>
11
-        </div>
12
-        <div class="navbar-header navbar-right">
13
-            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
14
-                <span class="sr-only">{{ _('Toggle navigation') }}</span>
15
-                <span class="icon-bar"></span>
16
-                <span class="icon-bar"></span>
17
-                <span class="icon-bar"></span>
18
-            </button>
19
-            <a class="navbar-brand" href="{{ url_for('index') }}">{{ instance_name }}</a>
20
-        </div>
21
-        {% else %}
22
-        <div class="navbar-header">
23
-            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
24
-                <span class="sr-only">{{ _('Toggle navigation') }}</span>
25
-                <span class="icon-bar"></span>
26
-                <span class="icon-bar"></span>
27
-                <span class="icon-bar"></span>
28
-            </button>
4
+        <div class="navbar-header{% if rtl %} navbar-right{% endif %}">
29 5
             <a class="navbar-brand" href="{{ url_for('index') }}">{{ instance_name }}</a>
30 6
         </div>
31
-        <div class="navbar-collapse collapse">
32
-            <ul class="nav navbar-nav navbar-right"> <!-- results.html -->
33
-                <li{% if template_name == 'index.html' %} class="active"{% endif %}><a href="{{ url_for('index') }}" class="hmarg">{{ _('home') }}</a></li>
34
-                <li{% if template_name == 'about.html' %} class="active"{% endif %}><a href="{{ url_for('about') }}" class="hmarg">{{ _('about') }}</a></li>
35
-                <li{% if template_name == 'preferences.html' %} class="active"{% endif %}><a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a></li>
36
-            </ul>
37
-        </div><!--/.nav-collapse -->
38
-        {% endif %}
39 7
     </div><!--/.container-fluid -->
40 8
 </div>
9
+<div class="menu menu-{% if rtl %}left{% else %}right{% endif %}">
10
+    <ul> <!-- results.html -->
11
+        <li{% if template_name == 'about.html' %} class="active"{% endif %}><a href="{{ url_for('about') }}" class="hmarg">{{ _('about') }}</a></li>
12
+        <li{% if template_name == 'preferences.html' %} class="active"{% endif %}><a href="{{ url_for('preferences') }}" class="hmarg">{{ _('preferences') }}</a></li>
13
+    </ul>
14
+</div><!--/.nav-collapse -->

+ 0
- 5
searx/templates/oscar/preferences.html View File

@@ -1,11 +1,6 @@
1 1
 {% from 'oscar/macros.html' import preferences_item_header, preferences_item_header_rtl, preferences_item_footer, preferences_item_footer_rtl, checkbox_toggle %}
2 2
 {% extends "oscar/base.html" %}
3 3
 {% block title %}{{ _('preferences') }} - {% endblock %}
4
-{% block site_alert_warning_nojs %}
5
-<noscript>
6
-    {% include 'oscar/messages/js_disabled.html' %}
7
-</noscript>
8
-{% endblock %}
9 4
 {% block content %}
10 5
 <div>
11 6