Implemented the requested changes
This commit is contained in:
parent
c7947492a0
commit
3a2b279e33
|
@ -59,6 +59,7 @@ app.config['BANG_PATH'] = os.getenv(
|
||||||
app.config['BANG_FILE'] = os.path.join(
|
app.config['BANG_FILE'] = os.path.join(
|
||||||
app.config['BANG_PATH'],
|
app.config['BANG_PATH'],
|
||||||
'bangs.json')
|
'bangs.json')
|
||||||
|
app.config['RELEASES_URL'] = 'https://github.com/benbusby/whoogle-search/releases'
|
||||||
|
|
||||||
# The alternative to Google Translate is treated a bit differently than other
|
# The alternative to Google Translate is treated a bit differently than other
|
||||||
# social media site alternatives, in that it is used for any translation
|
# social media site alternatives, in that it is used for any translation
|
||||||
|
|
|
@ -26,10 +26,14 @@ from requests import exceptions, get
|
||||||
# Load DDG bang json files only on init
|
# Load DDG bang json files only on init
|
||||||
bang_json = json.load(open(app.config['BANG_FILE']))
|
bang_json = json.load(open(app.config['BANG_FILE']))
|
||||||
|
|
||||||
# Get the newest version of WHOOGLE
|
|
||||||
link_releases = "https://github.com/benbusby/whoogle-search/releases"
|
# Check the newest version of WHOOGLE
|
||||||
update = bsoup(get(link_releases).text, "html.parser")
|
update = bsoup(get(app.config['RELEASES_URL']).text, 'html.parser')
|
||||||
newest_version = update.select_one('[class="Link--primary"]').string[1:]
|
newest_version = update.select_one('[class="Link--primary"]').string[1:]
|
||||||
|
current_version = int(''.join(filter(str.isdigit, app.config['VERSION_NUMBER'])))
|
||||||
|
newest_version = int(''.join(filter(str.isdigit, newest_version)))
|
||||||
|
newest_version = newest_version if (current_version
|
||||||
|
< newest_version) else ''
|
||||||
|
|
||||||
|
|
||||||
def auth_required(f):
|
def auth_required(f):
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ response|safe }}
|
{{ response|safe }}
|
||||||
</body>
|
</body>
|
||||||
{% include "footer.html" %}
|
{% include 'footer.html' %}
|
||||||
<script src="{{ cb_url('autocomplete.js') }}"></script>
|
<script src="{{ cb_url('autocomplete.js') }}"></script>
|
||||||
<script src="{{ cb_url('utils.js') }}"></script>
|
<script src="{{ cb_url('utils.js') }}"></script>
|
||||||
<script src="{{ cb_url('keyboard.js') }}"></script>
|
<script src="{{ cb_url('keyboard.js') }}"></script>
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta2/css/all.min.css" rel="stylesheet">
|
|
||||||
<footer>
|
<footer>
|
||||||
<p class="footer">
|
<p class="footer">
|
||||||
Whoogle Search v{{ version_number }} ||
|
Whoogle Search v{{ version_number }} ||
|
||||||
<a id="gh-link" href="https://github.com/benbusby/whoogle-search">{{ translation['github-link'] }}</a>
|
<a id="gh-link" href="https://github.com/benbusby/whoogle-search">{{ translation['github-link'] }}</a>
|
||||||
{% if newest_version != version_number %}
|
{% if newest_version %}
|
||||||
|| <span class="update_available">Update Available <i class="far fa-arrow-alt-circle-up"></i></span>
|
|| <span class="update_available">Update Available 🟢</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
</footer>
|
</footer>
|
|
@ -231,6 +231,6 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% include "footer.html" %}
|
{% include 'footer.html' %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user