Revision ded3a1b7
b/docs/source/devguide.rst | ||
---|---|---|
210 | 210 |
``/im/get_menu`` GET Get cloud bar menu |
211 | 211 |
==================== ========= ================== |
212 | 212 |
|
213 |
| |
|
214 |
|
|
215 |
====================== ========================= |
|
216 |
Request Parameter Name Value |
|
217 |
====================== ========================= |
|
218 |
location Location to pass in the next parameter |
|
219 |
====================== ========================= |
|
220 |
|
|
213 | 221 |
Example reply if request user is not authenticated: |
214 | 222 |
|
215 | 223 |
:: |
b/snf-astakos-app/astakos/im/context_processors.py | ||
---|---|---|
34 | 34 |
from astakos.im.settings import IM_MODULES, INVITATIONS_ENABLED, IM_STATIC_URL, \ |
35 | 35 |
COOKIE_NAME |
36 | 36 |
from django.conf import settings |
37 |
from django.core.urlresolvers import reverse |
|
37 | 38 |
|
38 | 39 |
def im_modules(request): |
39 | 40 |
return {'im_modules': IM_MODULES} |
... | ... | |
60 | 61 |
|
61 | 62 |
return {'CLOUDBAR_LOC': CB_LOCATION, |
62 | 63 |
'CLOUDBAR_COOKIE_NAME': CB_COOKIE_NAME, |
63 |
'ACTIVE_SERVICE': CB_ACTIVE_SERVICE} |
|
64 |
|
|
64 |
'ACTIVE_SERVICE': CB_ACTIVE_SERVICE, |
|
65 |
'GET_SERVICES_URL': reverse('astakos.im.api.get_services'), |
|
66 |
'GET_MENU_URL': reverse('astakos.im.api.get_menu')} |
b/snf-astakos-app/astakos/im/static/im/cloudbar/cloudbar.js | ||
---|---|---|
37 | 37 |
var profile = $('<div class="profile"></div>'); |
38 | 38 |
|
39 | 39 |
// create services links and set the active class to the current service |
40 |
$.getJSON('/im/get_services/', function(data) {
|
|
40 |
$.getJSON(window.GET_SERVICES_URL, function(data) {
|
|
41 | 41 |
$.each(data, function(i, el){ |
42 | 42 |
var slink = $("<a>"); |
43 | 43 |
if (el.icon) { |
... | ... | |
58 | 58 |
var user = $('<div class="user"></div>'); |
59 | 59 |
var username = $('<a href="#"></a>'); |
60 | 60 |
var usermenu = $("<ul>"); |
61 |
$.getJSON('/im/get_menu/?location='.concat(window.location.toString()), function(data) { |
|
61 |
var get_menu_url = window.GET_MENU_URL.concat('?location=').concat(window.location.toString()); |
|
62 |
$.getJSON(get_menu_url, function(data) { |
|
62 | 63 |
$.each(data, function(i,el) { |
63 | 64 |
if (i == 0){ |
64 | 65 |
username.text(el.name); |
b/snf-astakos-app/astakos/im/templates/im/base.html | ||
---|---|---|
61 | 61 |
var CLOUDBAR_LOCATION = "{{ CLOUDBAR_LOC }}"; |
62 | 62 |
var CLOUDBAR_COOKIE_NAME = "{{ CLOUDBAR_COOKIE_NAME }}"; |
63 | 63 |
var CLOUDBAR_ACTIVE_SERVICE = '{{ CLOUDBAR_ACTIVE_SERVICE }}'; |
64 |
|
|
65 |
var GET_SERVICES_URL = "{{ GET_SERVICES_URL }}"; |
|
66 |
var GET_MENU_URL = "{{ GET_MENU_URL }}"; |
|
64 | 67 |
|
65 | 68 |
$(document).ready(function(){ |
66 | 69 |
$.getScript(CLOUDBAR_LOCATION + 'cloudbar.js'); |
Also available in: Unified diff