Commit 97186e7490b0d349e821973008ab335124b4fe84
1 parent
c1b92d9a
Exists in
master
and in
13 other branches
Only start conversejs if not in a mobile device
Showing
3 changed files
with
12 additions
and
4 deletions
Show diff stats
requirements.txt
src/colab/custom_settings.py
| @@ -21,6 +21,7 @@ INSTALLED_APPS = INSTALLED_APPS + ( | @@ -21,6 +21,7 @@ INSTALLED_APPS = INSTALLED_APPS + ( | ||
| 21 | 'raven.contrib.django.raven_compat', | 21 | 'raven.contrib.django.raven_compat', |
| 22 | 'south', | 22 | 'south', |
| 23 | 'cliauth', | 23 | 'cliauth', |
| 24 | + 'django_mobile', | ||
| 24 | 'django_browserid', | 25 | 'django_browserid', |
| 25 | 'conversejs', | 26 | 'conversejs', |
| 26 | 27 | ||
| @@ -118,6 +119,7 @@ TEMPLATE_CONTEXT_PROCESSORS = ( | @@ -118,6 +119,7 @@ TEMPLATE_CONTEXT_PROCESSORS = ( | ||
| 118 | 'django.contrib.messages.context_processors.messages', | 119 | 'django.contrib.messages.context_processors.messages', |
| 119 | 'django.core.context_processors.request', | 120 | 'django.core.context_processors.request', |
| 120 | 'django_browserid.context_processors.browserid', | 121 | 'django_browserid.context_processors.browserid', |
| 122 | + 'django_mobile.context_processors.is_mobile', | ||
| 121 | ) | 123 | ) |
| 122 | 124 | ||
| 123 | MIDDLEWARE_CLASSES = ( | 125 | MIDDLEWARE_CLASSES = ( |
| @@ -128,6 +130,8 @@ MIDDLEWARE_CLASSES = ( | @@ -128,6 +130,8 @@ MIDDLEWARE_CLASSES = ( | ||
| 128 | 'django.contrib.auth.middleware.AuthenticationMiddleware', | 130 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 129 | 'django.contrib.messages.middleware.MessageMiddleware', | 131 | 'django.contrib.messages.middleware.MessageMiddleware', |
| 130 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', | 132 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
| 133 | + 'django_mobile.middleware.MobileDetectionMiddleware', | ||
| 134 | + 'django_mobile.middleware.SetFlavourMiddleware', | ||
| 131 | ) | 135 | ) |
| 132 | 136 | ||
| 133 | # Add the django_browserid authentication backend. | 137 | # Add the django_browserid authentication backend. |
src/templates/base.html
| @@ -10,7 +10,9 @@ | @@ -10,7 +10,9 @@ | ||
| 10 | href="{{ STATIC_URL }}third-party/font-awesome/css/font-awesome.min.css" | 10 | href="{{ STATIC_URL }}third-party/font-awesome/css/font-awesome.min.css" |
| 11 | type="text/css" media="screen" charset="utf-8"/> | 11 | type="text/css" media="screen" charset="utf-8"/> |
| 12 | 12 | ||
| 13 | - {% conversejs_static %} | 13 | + {% if not is_mobile %} |
| 14 | + {% conversejs_static %} | ||
| 15 | + {% endif %} | ||
| 14 | 16 | ||
| 15 | <link rel="stylesheet" href="{{ STATIC_URL }}css/screen.css" | 17 | <link rel="stylesheet" href="{{ STATIC_URL }}css/screen.css" |
| 16 | type="text/css" media="screen" charset="utf-8"/> | 18 | type="text/css" media="screen" charset="utf-8"/> |
| @@ -156,10 +158,11 @@ | @@ -156,10 +158,11 @@ | ||
| 156 | {% endblock %} | 158 | {% endblock %} |
| 157 | </div> | 159 | </div> |
| 158 | 160 | ||
| 159 | - <div class="visible-lg"> | 161 | + |
| 162 | + {% if not is_mobile %} | ||
| 160 | {% conversejs_chatpanel %} | 163 | {% conversejs_chatpanel %} |
| 161 | - </div> | ||
| 162 | - {% conversejs_initialize %} | 164 | + {% conversejs_initialize %} |
| 165 | + {% endif %} | ||
| 163 | 166 | ||
| 164 | {% browserid_js %} | 167 | {% browserid_js %} |
| 165 | </body> | 168 | </body> |