Skip to content

Commit 87aae82

Browse files
authored
Merge pull request qiita-spots#1881 from antgonza/fix-1868
fix qiita-spots#1868
2 parents 6b89f42 + b3efee1 commit 87aae82

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

qiita_pet/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
# -----------------------------------------------------------------------------
88

99
allowed_min_browser_versions = {
10-
'chrome': 39,
11-
'firefox': 34,
12-
'safari': 7,
13-
'IE': 10
10+
'chrome': 51,
1411
}
1512

1613
__version__ = "0.2.0-dev"

qiita_pet/templates/sitebase.html

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,23 @@
4949
objbrowserName = M[0];
5050
objBrMajorVersion = M[1];
5151

52-
if ((objbrowserName == "Chrome" && objBrMajorVersion < {{allowed_min_browser_versions['chrome']}}) ||
53-
(objbrowserName == "Firefox" && objBrMajorVersion < {{allowed_min_browser_versions['firefox']}}) ||
54-
(objbrowserName == "Safari" && objBrMajorVersion < {{allowed_min_browser_versions['safari']}}) ||
55-
((objbrowserName == "IE" || objbrowserName == "MSIE") && objBrMajorVersion < {{allowed_min_browser_versions['IE']}})) {
52+
if ((objbrowserName == "Chrome" && objBrMajorVersion < {{allowed_min_browser_versions['chrome']}})
53+
{% if 'firefox' in allowed_min_browser_versions %}
54+
|| (objbrowserName == "Firefox" && objBrMajorVersion < {{allowed_min_browser_versions['firefox']}})
55+
{% else %}
56+
|| (objbrowserName == "Firefox")
57+
{% end %}
58+
{% if 'safari' in allowed_min_browser_versions %}
59+
|| (objbrowserName == "Safari" && objBrMajorVersion < {{allowed_min_browser_versions['safari']}})
60+
{% else %}
61+
|| (objbrowserName == "Safari")
62+
{% end %}
63+
{% if 'IE' in allowed_min_browser_versions %}
64+
|| ((objbrowserName == "IE" || objbrowserName == "MSIE") && objBrMajorVersion < {{allowed_min_browser_versions['IE']}})
65+
{% else %}
66+
|| (objbrowserName == "IE" || objbrowserName == "MSIE")
67+
{% end %}
68+
) {
5669
// Show overlay because too old a browser
5770
ol = document.getElementById("overlay");
5871
ol.style.visibility = "visible";
@@ -284,9 +297,15 @@ <h6>
284297
<img src="{% raw qiita_config.portal_dir %}{{portal_styling.logo}}" alt="Qiita logo" id="small-logo"/>
285298
<h1>This site only works with the following browsers</h1>
286299
<p id="explanation"><strong>Chrome >= {{allowed_min_browser_versions['chrome']}}:</strong> You can download Chrome from <a href="https://www.google.com/chrome/browser/">here</a> or you can find instructions on how to update it <a href="https://support.google.com/chrome/answer/95414?hl=en">here</a></p>
287-
<p id="explanation"><strong>Safari >= {{allowed_min_browser_versions['safari']}}:</strong> You can update Safari following <a href="http://support.apple.com/en-us/HT6104">these</a> instructions.</p>
288-
<p id="explanation"><strong>Firefox >= {{allowed_min_browser_versions['firefox']}}:</strong> For instructions on how to install or update Firefox go <a href="https://support.mozilla.org/en-US/kb/update-firefox-latest-version">here.</a></p>
289-
<p id="explanation"><strong>Internet Explorer >= {{allowed_min_browser_versions['IE']}}:</strong> For instructions on how to update IE go <a href="http://windows.microsoft.com/en-us/internet-explorer">here.</a></p>
300+
{% if 'safari' in allowed_min_browser_versions %}
301+
<p id="explanation"><strong>Safari >= {{allowed_min_browser_versions['safari']}}:</strong> You can update Safari following <a href="http://support.apple.com/en-us/HT6104">these</a> instructions.</p>
302+
{% end %}
303+
{% if 'firefox' in allowed_min_browser_versions %}
304+
<p id="explanation"><strong>Firefox >= {{allowed_min_browser_versions['firefox']}}:</strong> For instructions on how to install or update Firefox go <a href="https://support.mozilla.org/en-US/kb/update-firefox-latest-version">here.</a></p>
305+
{% end %}
306+
{% if 'IE' in allowed_min_browser_versions %}
307+
<p id="explanation"><strong>Internet Explorer >= {{allowed_min_browser_versions['IE']}}:</strong> For instructions on how to update IE go <a href="http://windows.microsoft.com/en-us/internet-explorer">here.</a></p>
308+
{% end %}
290309
</div>
291310
</body>
292311
</html>

0 commit comments

Comments
 (0)