Revision cb79e2ed snf-astakos-app/astakos/im/api.py

b/snf-astakos-app/astakos/im/api.py
116 116

  
117 117
    return HttpResponse(content=data, mimetype=mimetype)
118 118

  
119
def get_menu(request):
119
def get_menu(request, with_extra_links=False, with_signout=True):
120 120
    location = request.GET.get('location', '')
121 121
    exclude = []
122 122
    index_url = reverse('index')
......
136 136
        l.append({ 'url': absolute(reverse('astakos.im.views.index')),
137 137
                  'name': request.user.email})
138 138
        l.append({ 'url': absolute(reverse('astakos.im.views.edit_profile')),
139
                  'name': "View your profile" })
140
        if request.user.password:
141
            l.append({ 'url': absolute(reverse('password_change')),
142
                      'name': "Change your password" })
143
        if INVITATIONS_ENABLED:
144
            l.append({ 'url': absolute(reverse('astakos.im.views.invite')),
145
                      'name': "Invite some friends" })
146
        l.append({ 'url': absolute(reverse('astakos.im.views.send_feedback')),
147
                  'name': "Send feedback" })
148
        l.append({ 'url': absolute(reverse('astakos.im.views.logout')),
149
                  'name': "Sign out"})
139
                  'name': "My account" })
140
        if with_extra_links:
141
            if request.user.password:
142
                l.append({ 'url': absolute(reverse('password_change')),
143
                          'name': "Change password" })
144
            if INVITATIONS_ENABLED:
145
                l.append({ 'url': absolute(reverse('astakos.im.views.invite')),
146
                          'name': "Invitations" })
147
            l.append({ 'url': absolute(reverse('astakos.im.views.send_feedback')),
148
                      'name': "Feedback" })
149
        if with_signout:
150
            l.append({ 'url': absolute(reverse('astakos.im.views.logout')),
151
                      'name': "Sign out"})
150 152

  
151 153
    callback = request.GET.get('callback', None)
152 154
    data = json.dumps(tuple(l))

Also available in: Unified diff