Commit 69e9929f authored by Sofia Papagiannaki's avatar Sofia Papagiannaki
Browse files

Change menu ``Report`` to ``Usage``

parent 65b2ccab
...@@ -185,21 +185,24 @@ def get_menu(request, with_extra_links=False, with_signout=True): ...@@ -185,21 +185,24 @@ def get_menu(request, with_extra_links=False, with_signout=True):
append(item( append(item(
url=absolute(request, reverse('group_list')), url=absolute(request, reverse('group_list')),
name="Projects", name="Projects",
submenu=(item( # submenu=(item(
url=absolute(request, # url=absolute(request,
reverse('group_list')), # reverse('group_list')),
name="Overview"), # name="Overview"),
item( # item(
url=absolute(request, # url=absolute(request,
reverse('group_create_list')), # reverse('group_create_list')),
name="Create"), # name="Create"),
item( # item(
url=absolute(request, # url=absolute(request,
reverse('group_search')), # reverse('group_search')),
name="Join"),))) # name="Join"),
# )
)
)
append(item( append(item(
url=absolute(request, reverse('resource_list')), url=absolute(request, reverse('resource_usage')),
name="Report")) name="Usage"))
append(item( append(item(
url=absolute(request, reverse('feedback')), url=absolute(request, reverse('feedback')),
name="Feedback")) name="Feedback"))
......
...@@ -110,7 +110,7 @@ class AstakosCallpoint(): ...@@ -110,7 +110,7 @@ class AstakosCallpoint():
b = get_backend() b = get_backend()
return b.list_users(filter) return b.list_users(filter)
def get_user_status(self, user_id): def get_user_usage(self, user_id):
b = get_backend() b = get_backend()
return b.get_resource_usage(user_id) return b.get_resource_usage(user_id)
......
...@@ -200,7 +200,7 @@ class AstakosAPI(Specificator): ...@@ -200,7 +200,7 @@ class AstakosAPI(Specificator):
) )
) )
def get_user_status( def get_user_usage(
self, self,
user_id=Nonnegative user_id=Nonnegative
): ):
......
...@@ -49,7 +49,7 @@ urlpatterns = patterns('astakos.im.views', ...@@ -49,7 +49,7 @@ urlpatterns = patterns('astakos.im.views',
url(r'^approval_terms/?$', 'approval_terms', {}, name='latest_terms'), url(r'^approval_terms/?$', 'approval_terms', {}, name='latest_terms'),
url(r'^approval_terms/(?P<term_id>\d+)/?$', 'approval_terms'), url(r'^approval_terms/(?P<term_id>\d+)/?$', 'approval_terms'),
url(r'^send/activation/(?P<user_id>\d+)/?$', 'send_activation', {}, name='send_activation'), url(r'^send/activation/(?P<user_id>\d+)/?$', 'send_activation', {}, name='send_activation'),
url(r'^resources/?$', 'resource_list', {}, name='resource_list'), url(r'^resources/?$', 'resource_usage', {}, name='resource_usage'),
# url(r'^billing/?$', 'billing', {}, name='billing'), # url(r'^billing/?$', 'billing', {}, name='billing'),
url(r'^timeline/?$', 'timeline', {}, name='timeline'), url(r'^timeline/?$', 'timeline', {}, name='timeline'),
url(r'^group/add/complete/?$', 'group_add_complete', {}, name='group_add_complete'), url(r'^group/add/complete/?$', 'group_add_complete', {}, name='group_add_complete'),
......
...@@ -1274,7 +1274,7 @@ def disapprove_member(request, membership): ...@@ -1274,7 +1274,7 @@ def disapprove_member(request, membership):
@require_http_methods(["POST", "GET"]) @require_http_methods(["POST", "GET"])
@signed_terms_required @signed_terms_required
@login_required @login_required
def resource_list(request): def resource_usage(request):
def with_class(entry): def with_class(entry):
entry['load_class'] = 'red' entry['load_class'] = 'red'
max_value = float(entry['maxValue']) max_value = float(entry['maxValue'])
...@@ -1293,7 +1293,7 @@ def resource_list(request): ...@@ -1293,7 +1293,7 @@ def resource_list(request):
entry['plural'] = engine.plural(entry.get('name')) entry['plural'] = engine.plural(entry.get('name'))
return entry return entry
result = callpoint.get_user_status(request.user.id) result = callpoint.get_user_usage(request.user.id)
if result.is_success: if result.is_success:
backenddata = map(with_class, result.data) backenddata = map(with_class, result.data)
data = map(pluralize, result.data) data = map(pluralize, result.data)
...@@ -1302,10 +1302,7 @@ def resource_list(request): ...@@ -1302,10 +1302,7 @@ def resource_list(request):
messages.error(request, result.reason) messages.error(request, result.reason)
resource_catalog = ResourcePresentation(RESOURCES_PRESENTATION_DATA) resource_catalog = ResourcePresentation(RESOURCES_PRESENTATION_DATA)
resource_catalog.update_from_result_report(result) resource_catalog.update_from_result_report(result)
return render_response('im/resource_usage.html',
return render_response('im/resource_list.html',
data=data, data=data,
context_instance=get_context(request), context_instance=get_context(request),
resource_catalog=resource_catalog, resource_catalog=resource_catalog,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment