Skip to content

Commit a755f02

Browse files
authored
Merge pull request #2752 from specify/favicon-improvements
Improve favicon resolution & add manifest.json
2 parents 98db5f0 + 508eba1 commit a755f02

16 files changed

+145
-134
lines changed
Loading
-3.6 KB
Binary file not shown.
Loading
Lines changed: 40 additions & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "Specify 7",
3+
"short_name": "Specify",
4+
"theme_color": "#F79244",
5+
"background_color": "#F79244",
6+
"display": "minimal-ui",
7+
"scope": "/",
8+
"id": "/specify/",
9+
"start_url": "/",
10+
"icons": [
11+
{
12+
"src": "/static/img/favicon-512x512.png",
13+
"type": "image/svg+xml",
14+
"sizes": "512x512"
15+
},
16+
{
17+
"src": "/static/img/short_logo.svg",
18+
"type": "image/png",
19+
"sizes": "150x150"
20+
}
21+
]
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{% load script_manifest %}{% load raven %}
2+
</script>
3+
{% if use_raven %}
4+
<script src="//cdn.ravenjs.com/1.1.16/raven.min.js"></script>
5+
<script>
6+
Raven.config("{% sentry_public_dsn %}").install();
7+
</script>
8+
{% endif %}
9+
<script src="{% script_src 'main.js' %}"></script>
10+
<meta name="viewport" content="width=device-width">
11+
<meta name="theme-color" content="#F79244"/>
12+
<link rel="apple-touch-icon" sizes="180x180" href="/static/img/apple-touch-icon.png">
13+
<link rel="mask-icon" href="/static/img/safari-pinned-tab.svg" color="#F79244">
14+
<link rel="shortcut icon" href="/favicon.ico" sizes="any">
15+
<link rel="icon" href="/static/img/favicon-512x512.png" sizes="any">
16+
<link rel="icon" href="/static/img/short_logo.svg" type="image/svg+xml">
17+
<link rel="manifest" href="/static/manifest.json">
18+
</head>
19+
20+
<body>
21+
<div id="root"></div>
22+
<div id="portal-root"></div>
Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,9 @@
1-
{% load raven %} {% load script_manifest %} {% load i18n %}
2-
<!DOCTYPE html>
3-
{% get_current_language as LANGUAGE_CODE %}
4-
<html lang="{{ LANGUAGE_CODE }}">
5-
<head>
6-
<meta charset="utf-8" />
7-
<script id="entrypoint-name">"chooseCollection"</script>
8-
{% if use_raven %}
9-
<script src="https://cdn.ravenjs.com/1.1.16/raven.min.js"></script>
10-
<script>
11-
Raven.config("{% sentry_public_dsn %}").install();
12-
</script>
13-
{% endif %}
14-
<script src="{% script_src 'main.js' %}"></script>
15-
</head>
16-
17-
<body>
18-
<div id="root"></div>
19-
<div id="portal-root"></div>
20-
21-
{{ form.non_field_errors|json_script:'form-errors' }}
22-
{{ form.collection.errors|json_script:'collection-errors' }}
23-
{{ available_collections|json_script:'available-collections' }}
24-
{{ initial_value|json_script:'initial-value' }}
25-
{{ next|json_script:'next-url' }}
26-
27-
</body>
28-
</html>
1+
{% include "head.html" %}
2+
"chooseCollection"
3+
{% include "body.html" %}
4+
{{ form.non_field_errors|json_script:'form-errors' }}
5+
{{ form.collection.errors|json_script:'collection-errors' }}
6+
{{ available_collections|json_script:'available-collections' }}
7+
{{ initial_value|json_script:'initial-value' }}
8+
{{ next|json_script:'next-url' }}
9+
{% include "footer.html" %}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
</body>
2+
</html>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% load i18n %}
2+
<!DOCTYPE html>
3+
{% get_current_language as LANGUAGE_CODE %}
4+
<html lang="{{ LANGUAGE_CODE }}">
5+
<head>
6+
<meta charset="utf-8" />
7+
<script id="entrypoint-name">
Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,13 @@
1-
{% load raven %}
2-
{% load script_manifest %}
1+
{% include "head.html" %}
2+
"login"
3+
{% include "body.html" %}
34
{% load i18n %}
4-
<!DOCTYPE html>
5-
{% get_current_language as LANGUAGE_CODE %}
6-
<html lang="{{ LANGUAGE_CODE }}">
7-
<head>
8-
<meta charset="utf-8">
9-
<script id="entrypoint-name">"login"</script>
10-
{% if use_raven %}
11-
<script src="https://cdn.ravenjs.com/1.1.16/raven.min.js"></script>
12-
<script>Raven.config('{% sentry_public_dsn %}').install()</script>
13-
{% endif %}
14-
<script src="{% script_src 'main.js' %}"></script>
15-
</head>
16-
17-
<body>
18-
<div id="root"></div>
19-
<div id="portal-root"></div>
20-
21-
{% get_available_languages as LANGUAGES %}
22-
{{ LANGUAGES|json_script:'languages' }}
23-
{{ next|json_script:'next-url' }}
24-
{{ request.session.external_user|json_script:'external-user' }}
25-
{{ form.non_field_errors|json_script:'form-errors' }}
26-
{{ form.username.errors|json_script:'username-errors' }}
27-
{{ form.password.errors|json_script:'password-errors' }}
28-
<script id="csrf-token">"{{ csrf_token }}"</script>
29-
</body>
30-
</html>
31-
5+
{% get_available_languages as LANGUAGES %}
6+
{{ LANGUAGES|json_script:'languages' }}
7+
{{ next|json_script:'next-url' }}
8+
{{ request.session.external_user|json_script:'external-user' }}
9+
{{ form.non_field_errors|json_script:'form-errors' }}
10+
{{ form.username.errors|json_script:'username-errors' }}
11+
{{ form.password.errors|json_script:'password-errors' }}
12+
<script id="csrf-token">"{{ csrf_token }}"</script>
13+
{% include "footer.html" %}
Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,11 @@
1-
{% load raven %}
2-
{% load script_manifest %}
1+
{% include "head.html" %}
2+
"login"
3+
{% include "body.html" %}
34
{% load i18n %}
4-
<!DOCTYPE html>
5-
{% get_current_language as LANGUAGE_CODE %}
6-
<html lang="{{ LANGUAGE_CODE }}">
7-
<head>
8-
<meta charset="utf-8">
9-
<script id="entrypoint-name">"login"</script>
10-
{% if use_raven %}
11-
<script src="https://cdn.ravenjs.com/1.1.16/raven.min.js"></script>
12-
<script>Raven.config('{% sentry_public_dsn %}').install()</script>
13-
{% endif %}
14-
<script src="{% script_src 'main.js' %}"></script>
15-
</head>
16-
17-
<body>
18-
<div id="root"></div>
19-
<div id="portal-root"></div>
20-
21-
{% get_available_languages as LANGUAGES %}
22-
{{ LANGUAGES|json_script:'languages' }}
23-
{{ next|json_script:'next-url' }}
24-
{{ providers|json_script:'providers' }}
25-
{{ request.session.invite_token|json_script:'invite-token' }}
26-
<script id="csrf-token">"{{ csrf_token }}"</script>
27-
</body>
28-
</html>
5+
{% get_available_languages as LANGUAGES %}
6+
{{ LANGUAGES|json_script:'languages' }}
7+
{{ next|json_script:'next-url' }}
8+
{{ providers|json_script:'providers' }}
9+
{{ request.session.invite_token|json_script:'invite-token' }}
10+
<script id="csrf-token">"{{ csrf_token }}"</script>
11+
{% include "footer.html" %}
Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,8 @@
1-
{% load raven %} {% load script_manifest %} {% load i18n %}
2-
<!DOCTYPE html>
3-
{% get_current_language as LANGUAGE_CODE %}
4-
<html lang="{{ LANGUAGE_CODE }}">
5-
<head>
6-
<meta charset="utf-8" />
7-
<script id="entrypoint-name">"passwordChange"</script>
8-
{% if use_raven %}
9-
<script src="//cdn.ravenjs.com/1.1.16/raven.min.js"></script>
10-
<script>
11-
Raven.config("{% sentry_public_dsn %}").install();
12-
</script>
13-
{% endif %}
14-
<script src="{% script_src 'main.js' %}"></script>
15-
</head>
16-
17-
<body>
18-
<div id="root"></div>
19-
<div id="portal-root"></div>
20-
21-
{{ form.non_field_errors|json_script:'form-errors' }}
22-
{{ form.old_password.errors|json_script:'old-password-errors' }}
23-
{{ form.new_password1.errors|json_script:'new-password-errors' }}
24-
{{ form.new_password2.errors|json_script:'repeat-password-errors' }}
25-
26-
</body>
27-
</html>
1+
{% include "head.html" %}
2+
"passwordChange"
3+
{% include "body.html" %}
4+
{{ form.non_field_errors|json_script:'form-errors' }}
5+
{{ form.old_password.errors|json_script:'old-password-errors' }}
6+
{{ form.new_password1.errors|json_script:'new-password-errors' }}
7+
{{ form.new_password2.errors|json_script:'repeat-password-errors' }}
8+
{% include "footer.html" %}
Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
1-
{% load raven %} {% load script_manifest %} {% load i18n %}
2-
<!DOCTYPE html>
3-
{% get_current_language as LANGUAGE_CODE %}
4-
<html lang="{{ LANGUAGE_CODE }}">
5-
<head>
6-
<meta charset="utf-8" />
7-
<script id="entrypoint-name">"main"</script>
8-
{% if use_raven %}
9-
<script src="//cdn.ravenjs.com/1.1.16/raven.min.js"></script>
10-
<script>
11-
Raven.config("{% sentry_public_dsn %}").install();
12-
</script>
13-
{% endif %}
14-
<script src="{% script_src 'main.js' %}"></script>
15-
</head>
16-
17-
<body>
18-
<div id="root"></div>
19-
<div id="portal-root"></div>
20-
</body>
21-
</html>
1+
{% include "head.html" %}
2+
"main"
3+
{% include "body.html" %}
4+
{% include "footer.html" %}

specifyweb/settings/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@
141141
('config', SPECIFY_CONFIG_DIR),
142142
)
143143

144+
# Add web app manifest
145+
WEBPACK_LOADER = {
146+
'MANIFEST_FILE': os.path.join(SPECIFY_CONFIG_DIR, "/static/manifest.json"),
147+
}
148+
144149
# List of finder classes that know how to find static files in
145150
# various locations.
146151
STATICFILES_FINDERS = (

specifyweb/urls.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
from .workbench import urls as wb_urls
2121

2222
urlpatterns = [
23-
url(r'^favicon.ico', RedirectView.as_view(url='/static/img/fav_icon.png')),
23+
24+
# This will redirect all browsers looking for the favicon to the SVG.
25+
url(r'^favicon.ico', RedirectView.as_view(url='/static/img/short_logo.svg')),
2426

2527
# just redirect root url to the main specify view
2628
url(r'^$', skip_collection_access_check(RedirectView.as_view(url='/specify/'))),

0 commit comments

Comments
 (0)