Commit 6f5eafcb660d4d08a79ce18158bf4580333ba7ef
1 parent
00546f53
Exists in
master
and in
39 other branches
Loading conversejs using app
Showing
10 changed files
with
77 additions
and
0 deletions
Show diff stats
src/conversejs/templates/conversejs/includes/chatpanel.html
0 → 100644
| @@ -0,0 +1,9 @@ | @@ -0,0 +1,9 @@ | ||
| 1 | +{% extends 'conversejs/includes/base.html' %} | ||
| 2 | +{% block conversejs_baseinclude %} | ||
| 3 | +<div id="chatpanel"> | ||
| 4 | + <div id="collective-xmpp-chat-data"></div> | ||
| 5 | + <div id="toggle-controlbox"> | ||
| 6 | + <a href="#" class="chat toggle-online-users"><strong class="conn-feedback">Mensageiro</strong> <strong style="display: none" id="online-count">(0)</strong></a> | ||
| 7 | + </div> | ||
| 8 | +</div> | ||
| 9 | +{% endblock %} |
src/conversejs/templates/conversejs/includes/initialize.html
0 → 100644
| @@ -0,0 +1,17 @@ | @@ -0,0 +1,17 @@ | ||
| 1 | +{% extends 'conversejs/includes/base.html' %} | ||
| 2 | +{% block conversejs_baseinclude %} | ||
| 3 | +<script> | ||
| 4 | + require(["jquery", "converse"], function ($, converse) { | ||
| 5 | + converse.initialize({ | ||
| 6 | + auto_list_rooms: false, | ||
| 7 | + auto_subscribe: false, | ||
| 8 | + bosh_service_url: 'https://bind.opkode.im', // Please use this connection manager only for testing purposes | ||
| 9 | + hide_muc_server: false, | ||
| 10 | + i18n: locales['{{ request.LANGUAGE_CODE }}'], // Refer to ./locale/locales.js to see which locales are supported | ||
| 11 | + prebind: true, | ||
| 12 | + show_controlbox_by_default: true, | ||
| 13 | + xhr_user_search: false | ||
| 14 | + }); | ||
| 15 | + }); | ||
| 16 | +</script> | ||
| 17 | +{% endblock %} |
src/conversejs/templates/conversejs/includes/static.html
0 → 100644
| @@ -0,0 +1,7 @@ | @@ -0,0 +1,7 @@ | ||
| 1 | +{% extends 'conversejs/includes/base.html' %} | ||
| 2 | +{% block conversejs_baseinclude %} | ||
| 3 | +<script data-main="{{ STATIC_URL }}converse.js/main" src="{{ STATIC_URL }}converse.js/Libraries/require-jquery.js"></script> | ||
| 4 | + | ||
| 5 | +<link rel="stylesheet" href="{{ STATIC_URL }}converse.js/converse.min.css" | ||
| 6 | + type="text/css" media="screen, projection" /> | ||
| 7 | +{% endblock %} |
| @@ -0,0 +1,21 @@ | @@ -0,0 +1,21 @@ | ||
| 1 | + | ||
| 2 | +from django import template | ||
| 3 | + | ||
| 4 | +register = template.Library() | ||
| 5 | +TEMPLATE_PATH = 'conversejs/includes/' | ||
| 6 | + | ||
| 7 | +@register.inclusion_tag(TEMPLATE_PATH + 'initialize.html', takes_context=True) | ||
| 8 | +def conversejs_initialize(context): | ||
| 9 | + request = context.get('request') | ||
| 10 | + return locals() | ||
| 11 | + | ||
| 12 | +@register.inclusion_tag(TEMPLATE_PATH + 'chatpanel.html', takes_context=True) | ||
| 13 | +def conversejs_chatpanel(context): | ||
| 14 | + request = context.get('request') | ||
| 15 | + return locals() | ||
| 16 | + | ||
| 17 | +@register.inclusion_tag(TEMPLATE_PATH + 'static.html', takes_context=True) | ||
| 18 | +def conversejs_static(context): | ||
| 19 | + request = context.get('request') | ||
| 20 | + STATIC_URL = context.get('STATIC_URL') | ||
| 21 | + return locals() |
| @@ -0,0 +1,16 @@ | @@ -0,0 +1,16 @@ | ||
| 1 | +""" | ||
| 2 | +This file demonstrates writing tests using the unittest module. These will pass | ||
| 3 | +when you run "manage.py test". | ||
| 4 | + | ||
| 5 | +Replace this with more appropriate tests for your application. | ||
| 6 | +""" | ||
| 7 | + | ||
| 8 | +from django.test import TestCase | ||
| 9 | + | ||
| 10 | + | ||
| 11 | +class SimpleTest(TestCase): | ||
| 12 | + def test_basic_addition(self): | ||
| 13 | + """ | ||
| 14 | + Tests that 1 + 1 always equals 2. | ||
| 15 | + """ | ||
| 16 | + self.assertEqual(1 + 1, 2) |
| @@ -0,0 +1 @@ | @@ -0,0 +1 @@ | ||
| 1 | +# Create your views here. |