on master help sign in
[enh] add unique class for each endpoint - closes #1133
commitde1b08a941a6834a39159b9a2aa3ff3552df029f authorAdam Tauber <asciimoo@gmail.com> dateThu 4 Jun 2020, 19:20 (6 years ago) parent5af873b
5 files changed+5−4
searx/templates/courgette/base.html+1−1 searx/templates/legacy/base.html+1−1 searx/templates/oscar/base.html+1−1 searx/templates/simple/base.html+1−1 searx/webapp.py+1
searx/templates/courgette/base.html+1−1
@@ -29,7 +29,7 @@
2929 searx.autocompleter = {% if autocomplete %}true{% else %}false{% endif %};
3030 </script>
3131 </head>
32− <body>
32+ <body class="{{ endpoint }}_endpoint" >
3333 <div id="container">
3434 {% block content %}
3535 {% endblock %}
searx/templates/legacy/base.html+1−1
@@ -20,7 +20,7 @@
2020 <link title="{{ instance_name }}" type="application/opensearchdescription+xml" rel="search" href="{{ url_for('opensearch') }}"/>
2121 {% endblock %}
2222 </head>
23− <body>
23+ <body class="{{ endpoint }}_endpoint" >
2424 <div id="container">
2525 {% block content %}
2626 {% endblock %}
searx/templates/oscar/base.html+1−1
@@ -47,7 +47,7 @@
4747 </style>
4848 </noscript>
4949</head>
50−<body>
50+<body class="{{ endpoint }}_endpoint" >
5151 {% include 'oscar/navbar.html' %}
5252
5353 <div class="container">
searx/templates/simple/base.html+1−1
@@ -32,7 +32,7 @@
3232 {% endblock %}
3333 <link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.png') }}" />
3434</head>
35−<body>
35+<body class="{{ endpoint }}_endpoint" >
3636 <main id="main_{{ self._TemplateReference__context.name|replace("simple/", "")|replace(".html", "") }}">
3737 {% if errors %}
3838 <div class="dialog-error" role="alert">
searx/webapp.py+1
@@ -425,6 +425,7 @@ def render(template_name, override_theme=None, **kwargs):
425425 kwargs['brand'] = brand
426426
427427 kwargs['scripts'] = set()
428+ kwargs['endpoint'] = 'results' if 'q' in kwargs else request.endpoint
428429 for plugin in request.user_plugins:
429430 for script in plugin.js_dependencies:
430431 kwargs['scripts'].add(script)