Commit ede69396 authored by Arnau Vàzquez's avatar Arnau Vàzquez
Browse files

Merge branch '60-rename-theme' into 'master'

Renaming theme, folder name and templates

Closes #60

See merge request e/cloud/my-spot!64
parents dfc5b6c3 b4f58da3
...@@ -6,7 +6,7 @@ SEARX_MORTY_URL=https://localhost:8089 ...@@ -6,7 +6,7 @@ SEARX_MORTY_URL=https://localhost:8089
SEARX_SECRET=":@)%NN0+OqNdy:{prWQlZ{p9|oO9p-UyJq@%V!~G:arrSx6fXz.{jd%=XF44ncj" SEARX_SECRET=":@)%NN0+OqNdy:{prWQlZ{p9|oO9p-UyJq@%V!~G:arrSx6fXz.{jd%=XF44ncj"
SEARX_MORTY_KEY="taKB1WGTa63LEI6RdjWWKshS4oYSHQWGu9Eyjr1OlpQ=" SEARX_MORTY_KEY="taKB1WGTa63LEI6RdjWWKshS4oYSHQWGu9Eyjr1OlpQ="
SEARX_REDIS_HOST=redis SEARX_REDIS_HOST=redis
SEARX_UI_DEFAULT_THEME=eelo SEARX_UI_DEFAULT_THEME=etheme
SEARX_PROXY_HTTP=socks5h://tor-socks-proxy:9150 SEARX_PROXY_HTTP=socks5h://tor-socks-proxy:9150
SEARX_PROXY_HTTPS=socks5h://tor-socks-proxy:9150 SEARX_PROXY_HTTPS=socks5h://tor-socks-proxy:9150
FILTRON_PORT=8088 FILTRON_PORT=8088
......
...@@ -6,7 +6,7 @@ SEARX_MORTY_URL=https://localhost:8089 ...@@ -6,7 +6,7 @@ SEARX_MORTY_URL=https://localhost:8089
SEARX_SECRET="SECRET2BEREPLACED" SEARX_SECRET="SECRET2BEREPLACED"
SEARX_MORTY_KEY="KEY2BEREPLACED" SEARX_MORTY_KEY="KEY2BEREPLACED"
SEARX_REDIS_HOST=redis SEARX_REDIS_HOST=redis
SEARX_UI_DEFAULT_THEME=eelo SEARX_UI_DEFAULT_THEME=etheme
SEARX_PROXY_HTTP=http://proxy01.ecloud.global:1099 SEARX_PROXY_HTTP=http://proxy01.ecloud.global:1099
SEARX_PROXY_HTTPS=http://proxy01.ecloud.global:1099 SEARX_PROXY_HTTPS=http://proxy01.ecloud.global:1099
WIREGUARD_IP=127.0.0.1 WIREGUARD_IP=127.0.0.1
......
...@@ -24,7 +24,7 @@ build:web: ...@@ -24,7 +24,7 @@ build:web:
- ./manage.sh update_dev_packages - ./manage.sh update_dev_packages
script: script:
- ./manage.sh locales - ./manage.sh locales
- make V=1 themes.eelo - make V=1 themes.etheme
.build:docker: .build:docker:
stage: build stage: build
......
...@@ -121,14 +121,14 @@ node.clean: ...@@ -121,14 +121,14 @@ node.clean:
./searx/static/themes/oscar/node_modules \ ./searx/static/themes/oscar/node_modules \
./searx/static/themes/simple/package-lock.json \ ./searx/static/themes/simple/package-lock.json \
./searx/static/themes/simple/node_modules \ ./searx/static/themes/simple/node_modules \
./searx/static/themes/eelo/package-lock.json \ ./searx/static/themes/etheme/package-lock.json \
./searx/static/themes/eelo/node_modules ./searx/static/themes/etheme/node_modules
# build themes # build themes
# ------------ # ------------
PHONY += themes themes.oscar themes.simple themes.eelo PHONY += themes themes.oscar themes.simple themes.etheme
themes: buildenv themes.oscar themes.simple themes.eelo themes: buildenv themes.oscar themes.simple themes.etheme
quiet_cmd_lessc = LESSC $3 quiet_cmd_lessc = LESSC $3
cmd_lessc = PATH="$$(npm bin):$$PATH" \ cmd_lessc = PATH="$$(npm bin):$$PATH" \
...@@ -146,9 +146,9 @@ themes.simple: node.env ...@@ -146,9 +146,9 @@ themes.simple: node.env
$(Q)echo '[!] build simple theme' $(Q)echo '[!] build simple theme'
$(call cmd,grunt,searx/static/themes/simple/gruntfile.js) $(call cmd,grunt,searx/static/themes/simple/gruntfile.js)
themes.eelo: node.env themes.etheme: node.env
$(Q)echo '[!] build eelo theme' $(Q)echo '[!] build etheme theme'
$(call cmd,grunt,searx/static/themes/eelo/gruntfile.js) $(call cmd,grunt,searx/static/themes/etheme/gruntfile.js)
# docker # docker
# ------ # ------
......
# spot for [/e/](https://e.foundation) # spot for [/e/](https://e.foundation)
![logo](searx/static/themes/eelo/img/favicon.png) ![logo](searx/static/themes/etheme/img/favicon.png)
A privacy-respecting, hackable [metasearch engine](https://en.wikipedia.org/wiki/Metasearch_engine). A privacy-respecting, hackable [metasearch engine](https://en.wikipedia.org/wiki/Metasearch_engine).
...@@ -8,7 +8,7 @@ Spot was forked from searx: read [documentation](https://asciimoo.github.io/sear ...@@ -8,7 +8,7 @@ Spot was forked from searx: read [documentation](https://asciimoo.github.io/sear
## Changes between Spot and Searx ## Changes between Spot and Searx
* eelo theme * /e/ theme
* redis cache on http requests (TTL 1 day) * redis cache on http requests (TTL 1 day)
* docker packaging thinking to be production ready * docker packaging thinking to be production ready
......
...@@ -98,8 +98,8 @@ npm_packages() { ...@@ -98,8 +98,8 @@ npm_packages() {
cd -- "$BASE_DIR/searx/static/themes/simple" cd -- "$BASE_DIR/searx/static/themes/simple"
npm install npm install
echo '[!] install NPM packages for eelo theme' echo '[!] install NPM packages for etheme theme'
cd -- "$BASE_DIR/searx/static/themes/eelo" cd -- "$BASE_DIR/searx/static/themes/etheme"
npm install npm install
} }
......
...@@ -82,7 +82,8 @@ class EnumStringSetting(Setting): ...@@ -82,7 +82,8 @@ class EnumStringSetting(Setting):
def _validate_selection(self, selection): def _validate_selection(self, selection):
if selection not in self.choices: # pylint: disable=no-member if selection not in self.choices: # pylint: disable=no-member
raise ValidationException('Invalid value: "{0}"'.format(selection)) message = f"Invalid value '{selection}' was not found in {self.choices}" # pylint: disable=no-member
raise ValidationException(message)
def parse(self, data): def parse(self, data):
"""Parse and validate ``data`` and store the result at ``self.value`` """Parse and validate ``data`` and store the result at ``self.value``
...@@ -445,6 +446,8 @@ class Preferences: ...@@ -445,6 +446,8 @@ class Preferences:
def parse_dict(self, input_data): def parse_dict(self, input_data):
"""parse preferences from request (``flask.request.form``)""" """parse preferences from request (``flask.request.form``)"""
for user_setting_name, user_setting in input_data.items(): for user_setting_name, user_setting in input_data.items():
if user_setting_name == 'theme' and user_setting == 'eelo': # Fix theme name for old cookies
user_setting = settings['ui'].get('default_theme', 'oscar')
if user_setting_name in self.key_value_settings: if user_setting_name in self.key_value_settings:
if self.key_value_settings[user_setting_name].locked: if self.key_value_settings[user_setting_name].locked:
continue continue
......
...@@ -419,7 +419,7 @@ nav a { ...@@ -419,7 +419,7 @@ nav a {
nav a:hover { nav a:hover {
color: #5068dd; color: #5068dd;
} }
nav #eelo_links > * { nav #etheme_links > * {
margin-right: 32px; margin-right: 32px;
} }
#nav_toggle_btn { #nav_toggle_btn {
......
...@@ -5,12 +5,12 @@ module.exports = function(grunt) { ...@@ -5,12 +5,12 @@ module.exports = function(grunt) {
uglify: { uglify: {
dist: { dist: {
files: { files: {
'js/eelo.min.js': ['js/eelo.js'] 'js/etheme.min.js': ['js/etheme.js']
} }
} }
}, },
jshint: { jshint: {
files: ['gruntfile.js', 'js/eelo.js'], files: ['gruntfile.js', 'js/etheme.js'],
options: { options: {
reporterOutput: "", reporterOutput: "",
// options here to override JSHint defaults // options here to override JSHint defaults
...@@ -25,18 +25,18 @@ module.exports = function(grunt) { ...@@ -25,18 +25,18 @@ module.exports = function(grunt) {
less: { less: {
development: { development: {
options: { options: {
paths: ["less/eelo"] paths: ["less/etheme"]
//banner: '/*! less/eelo/oscar.css | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n' //banner: '/*! less/etheme/oscar.css | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
}, },
files: {"css/eelo.css": "less/eelo/eelo.less"} files: {"css/etheme.css": "less/etheme/etheme.less"}
}, },
production: { production: {
options: { options: {
paths: ["less/eelo"], paths: ["less/etheme"],
//banner: '/*! less/eelo/oscar.css | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n', //banner: '/*! less/etheme/oscar.css | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n',
cleancss: true cleancss: true
}, },
files: {"css/eelo.min.css": "less/eelo/eelo.less"} files: {"css/etheme.min.css": "less/etheme/etheme.less"}
}, },
/* /*
// built with ./manage.sh styles // built with ./manage.sh styles
...@@ -54,8 +54,8 @@ module.exports = function(grunt) { ...@@ -54,8 +54,8 @@ module.exports = function(grunt) {
files: ['<%= jshint.files %>'], files: ['<%= jshint.files %>'],
tasks: ['jshint', 'uglify'] tasks: ['jshint', 'uglify']
}, },
eelo_styles: { etheme_styles: {
files: ['less/eelo/**/*.less'], files: ['less/etheme/**/*.less'],
tasks: ['less:development', 'less:production'] tasks: ['less:development', 'less:production']
}, },
bootstrap_styles: { bootstrap_styles: {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment