Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 2 commits
  • 7 files changed
  • 0 commit comments
  • 2 contributors
Showing with 0 additions and 140 deletions.
  1. 0 apps/chat/__init__.py
  2. +0 −16 apps/chat/cron.py
  3. +0 −60 apps/chat/templates/chat/chat.html
  4. +0 −22 apps/chat/tests.py
  5. +0 −6 apps/chat/urls.py
  6. +0 −30 apps/chat/views.py
  7. +0 −6 settings.py
View
0 apps/chat/__init__.py
No changes.
View
16 apps/chat/cron.py
@@ -1,16 +0,0 @@
-import urllib2
-
-from django.conf import settings
-from django.core.cache import cache
-
-import cronjobs
-
-
-@cronjobs.register
-def get_queue_status():
- """Update the live chat queue status."""
-
- status_path = '/plugins/fastpath/workgroup-stats?workgroup=support&rand='
- url = settings.CHAT_SERVER + status_path
- xml = urllib2.urlopen(url)
- cache.set(settings.CHAT_CACHE_KEY, xml.read())
View
60 apps/chat/templates/chat/chat.html
@@ -1,60 +0,0 @@
-{# vim: set ts=2 et sts=2 sw=2: #}
-{% extends 'base.html' %}
-{% set title = _('Live Chat') %}
-{% set scripts = ('chat',) %}
-{% set styles = ('chat',) %}
-{% set crumbs = [(None, _('Chat'))] %}
-
-{% block content %}
- <article id="chat" class="main">
- <hgroup>
- <h1>{{ _('Live Chat') }}</h1>
- <h2>{% trans %}Live Chat provides real time text support right in your browser.
- If Foxkeh says we're open, click on him to begin a one-on-one chat with one
- of our volunteers.{% endtrans %}</h2>
- </hgroup>
- <section id="chat-status" data-server="{{ settings.CHAT_SERVER }}" data-status="{{ url('chat.queue-status') }}">
- <h1>{{ _('Checking Live Chat Status...') }}</h1>
- </section>
- <section>
- <h1 id="How_to_get_started">{{ _('How to get started') }}</h1>
- <ol>
- <li>{% trans %}If this page says "We're Open," that means people are ready to help
- you with your Firefox problem. Click on the fox to launch the chat
- window.{% endtrans %}</li>
- <li>{% trans %}Fill out as many of the fields as you can and click <span
- class='button'>Start Chat</span>.{% endtrans %}</li>
- <li>{% trans %}When someone answers your question, the request window will change
- to show a chat field and the conversation starts.{% endtrans %}</li>
- </ol>
-
- <h1 id="What_you_should_know">{{ _('What you should know') }}</h1>
-
- <ul>
- <li>{% trans %}Helpers are volunteers, not Mozilla employees.{% endtrans %}</li>
- <li>{% trans %}We're currently only providing support in English.{% endtrans %}</li>
- <li>{% trans report='mailto:abuse@support.mozilla.com' %}We'll never ask you to give us
- personal information, including passwords. If someone does,
- <a href="{{ report }}">report them</a>.{% endtrans %}</li>
- <li>{% trans rules=url('wiki.document', 'Forum and chat rules and guidelines') %}We expect our users
- and helpers to be polite with each other; <a href="{{ rules }}">see our rules</a>.{% endtrans %}</li>
- <li>{% trans %}Transcripts are kept for quality purposes and to keep info in the
- knowledge base up to date. You'll be given a chance to request a copy
- of the transcript when your chat is over.{% endtrans %}</li>
- <li>{% trans %}Right now we only help with issues using Firefox. If you want chat
- support for other products, or for writing add-ons or contributing code,
- please go to <a href="http://irc.mozilla.org">Mozilla's
- IRC network</a>.{% endtrans %}</li>
- </ul>
-
- <p><a href="{{ url('wiki.document', 'Terms of service') }}">{{ _('Terms of service') }}</a>
- | <a href="http://www.mozilla.com/privacy-policy.html">{{ _('Privacy Policy') }}</a></p>
-
- <h1 id="Want_to_help">{{ _('Want to help?') }}</h1>
-
- <p>{% trans help=url('wiki.document', 'Helping with Live Chat') %}Our Live Chat volunteers are regular Firefox users like you!
- Check out what you need to know to
- <a href="{{ help }}">help users through Live Chat</a>.{% endtrans %}</p>
- </section>
- </article>
-{% endblock %}
View
22 apps/chat/tests.py
@@ -1,22 +0,0 @@
-from django.conf import settings
-from django.core.cache import cache
-
-from nose.tools import eq_
-
-from sumo.tests import TestCase
-from sumo.urlresolvers import reverse
-
-
-class ChatTestCase(TestCase):
- def test_uncached(self):
- cache.delete(settings.CHAT_CACHE_KEY)
- resp = self.client.get(reverse('chat.queue-status', locale='en-US'))
- eq_(503, resp.status_code)
- eq_('', resp.content)
-
- def test_cached(self):
- source = 'The Output'
- cache.set(settings.CHAT_CACHE_KEY, source)
- resp = self.client.get(reverse('chat.queue-status', locale='en-US'))
- eq_(200, resp.status_code)
- eq_(source, resp.content)
View
6 apps/chat/urls.py
@@ -1,6 +0,0 @@
-from django.conf.urls.defaults import patterns, url
-
-urlpatterns = patterns('chat.views',
- url(r'^$', 'chat', name='chat.home'),
- url(r'^/queue-status$', 'queue_status', name='chat.queue-status'),
-)
View
30 apps/chat/views.py
@@ -1,30 +0,0 @@
-from django.conf import settings
-from django.core.cache import cache
-from django.http import HttpResponse
-from django.views.decorators.cache import never_cache
-from django.views.decorators.http import require_GET
-
-import jingo
-
-
-@require_GET
-def chat(request):
- """Display the current state of the chat queue."""
- return jingo.render(request, 'chat/chat.html')
-
-
-@never_cache
-@require_GET
-def queue_status(request):
- """Dump the queue status out of the cache.
-
- See chat.crons.get_queue_status.
-
- """
-
- xml = cache.get(settings.CHAT_CACHE_KEY)
- status = 200
- if not xml:
- xml = ''
- status = 503
- return HttpResponse(xml, mimetype='application/xml', status=status)
View
6 settings.py
@@ -502,7 +502,6 @@ def JINJA_CONFIG():
'messages': [
('vendor/**', 'ignore'),
('apps/access/**', 'ignore'),
- ('apps/chat/**', 'ignore'),
('apps/customercare/**', 'ignore'),
('apps/dashboards/**', 'ignore'),
('apps/flagit/**', 'ignore'),
@@ -859,11 +858,6 @@ def read_only_mode(env):
# Anonymous watches must be confirmed.
CONFIRM_ANONYMOUS_WATCHES = True
-
-# URL of the chat server.
-CHAT_SERVER = 'https://chat-support.mozilla.com:9091'
-CHAT_CACHE_KEY = 'sumo-chat-queue-status'
-
# recaptcha
RECAPTCHA_USE_SSL = False
RECAPTCHA_PRIVATE_KEY = 'SET ME IN SETTINGS_LOCAL'

No commit comments for this range

Something went wrong with that request. Please try again.