``/im/get_menu`` GET Get cloud bar menu
==================== ========= ==================
+|
+
+====================== =========================
+Request Parameter Name Value
+====================== =========================
+location Location to pass in the next parameter
+====================== =========================
+
Example reply if request user is not authenticated:
::
from astakos.im.settings import IM_MODULES, INVITATIONS_ENABLED, IM_STATIC_URL, \
COOKIE_NAME
from django.conf import settings
+from django.core.urlresolvers import reverse
def im_modules(request):
return {'im_modules': IM_MODULES}
return {'CLOUDBAR_LOC': CB_LOCATION,
'CLOUDBAR_COOKIE_NAME': CB_COOKIE_NAME,
- 'ACTIVE_SERVICE': CB_ACTIVE_SERVICE}
-
+ 'ACTIVE_SERVICE': CB_ACTIVE_SERVICE,
+ 'GET_SERVICES_URL': reverse('astakos.im.api.get_services'),
+ 'GET_MENU_URL': reverse('astakos.im.api.get_menu')}
var profile = $('<div class="profile"></div>');
// create services links and set the active class to the current service
- $.getJSON('/im/get_services/', function(data) {
+ $.getJSON(window.GET_SERVICES_URL, function(data) {
$.each(data, function(i, el){
var slink = $("<a>");
if (el.icon) {
var user = $('<div class="user"></div>');
var username = $('<a href="#"></a>');
var usermenu = $("<ul>");
- $.getJSON('/im/get_menu/?location='.concat(window.location.toString()), function(data) {
+ var get_menu_url = window.GET_MENU_URL.concat('?location=').concat(window.location.toString());
+ $.getJSON(get_menu_url, function(data) {
$.each(data, function(i,el) {
if (i == 0){
username.text(el.name);
var CLOUDBAR_LOCATION = "{{ CLOUDBAR_LOC }}";
var CLOUDBAR_COOKIE_NAME = "{{ CLOUDBAR_COOKIE_NAME }}";
var CLOUDBAR_ACTIVE_SERVICE = '{{ CLOUDBAR_ACTIVE_SERVICE }}';
+
+ var GET_SERVICES_URL = "{{ GET_SERVICES_URL }}";
+ var GET_MENU_URL = "{{ GET_MENU_URL }}";
$(document).ready(function(){
$.getScript(CLOUDBAR_LOCATION + 'cloudbar.js');