Browse Source

[enh] add unique class for each endpoint - closes #1133

Adam Tauber 4 years ago
parent
commit
de1b08a941

+ 1 - 1
searx/templates/courgette/base.html

@@ -29,7 +29,7 @@
             searx.autocompleter = {% if autocomplete %}true{% else %}false{% endif %};
         </script>
     </head>
-    <body>
+    <body class="{{ endpoint }}_endpoint" >
         <div id="container">
             {% block content %}
             {% endblock %}

+ 1 - 1
searx/templates/legacy/base.html

@@ -20,7 +20,7 @@
         <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/>
         {% endblock %}
     </head>
-    <body>
+    <body class="{{ endpoint }}_endpoint" >
         <div id="container">
             {% block content %}
             {% endblock %}

+ 1 - 1
searx/templates/oscar/base.html

@@ -47,7 +47,7 @@
         </style>
     </noscript>
 </head>
-<body>
+<body class="{{ endpoint }}_endpoint" >
     {% include 'oscar/navbar.html' %}
 
     <div class="container">

+ 1 - 1
searx/templates/simple/base.html

@@ -32,7 +32,7 @@
   {% endblock %}
   <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}" />
 </head>
-<body>
+<body class="{{ endpoint }}_endpoint" >
   <main id="main_{{  self._TemplateReference__context.name|replace("simple/", "")|replace(".html", "") }}">
     {% if errors %}
         <div class="dialog-error" role="alert">

+ 1 - 0
searx/webapp.py

@@ -425,6 +425,7 @@ def render(template_name, override_theme=None, **kwargs):
     kwargs['brand'] = brand
 
     kwargs['scripts'] = set()
+    kwargs['endpoint'] = 'results' if 'q' in kwargs else request.endpoint
     for plugin in request.user_plugins:
         for script in plugin.js_dependencies:
             kwargs['scripts'].add(script)