From c06a1e1bbf88bb38c4f9f7b024cc1303a90eec94 Mon Sep 17 00:00:00 2001 From: Shiv K Sah Date: Thu, 3 Aug 2017 20:50:51 +0530 Subject: [PATCH] Call/SMS reporting --- .../templates/dashboard/report/call-sms.html | 154 ++++++++++++++++++ cloud/endagaweb/views/reports.py | 27 +++ 2 files changed, 181 insertions(+) create mode 100644 cloud/endagaweb/templates/dashboard/report/call-sms.html create mode 100644 cloud/endagaweb/views/reports.py diff --git a/cloud/endagaweb/templates/dashboard/report/call-sms.html b/cloud/endagaweb/templates/dashboard/report/call-sms.html new file mode 100644 index 00000000..221fe735 --- /dev/null +++ b/cloud/endagaweb/templates/dashboard/report/call-sms.html @@ -0,0 +1,154 @@ +{% extends "dashboard/layout.html" %} +{% comment %} +Copyright (c) 2016-present, Facebook, Inc. +All rights reserved. + +This source code is licensed under the BSD-style license found in the +LICENSE file in the root directory of this source tree. An additional grant +of patent rights can be found in the PATENTS file in the same directory. +{% endcomment %} +{% load apptags %} +{% load humanize %} +{% load crispy_forms_tags %} + + +{% block title %} + {% tmpl_const "SITENAME" %} | Report + {% if report_summary %} + | "{{ report_summary }}" + {% endif %} +{% endblock %} + +{% block pagestyle %} + + + +{% endblock %} + +{% block content %} + {% include "dashboard/report/header.html" with header='Call & SMS' %} + +
+ {% include "dashboard/report/nav.html" with active_tab='call_sms' %} + +
+ + {% include "dashboard/report/filter.html" with action_url='/dashboard/reports/calls' %} + {% if network_has_activity %} +
+
+
+
+
+
+
+
+
+ +
+ {% include 'dashboard/timezone-notice.html' %} +
+ {% else %} +

There is no network activity to display.

+ {% endif %} +
+
+{% endblock %} + + +{% block js %} +{% if network_has_activity %} + + + + + + + + + + + + +{% endif %} + +{% endblock %} \ No newline at end of file diff --git a/cloud/endagaweb/views/reports.py b/cloud/endagaweb/views/reports.py new file mode 100644 index 00000000..a1ab15c7 --- /dev/null +++ b/cloud/endagaweb/views/reports.py @@ -0,0 +1,27 @@ +"""Network views. + +Copyright (c) 2016-present, Facebook, Inc. +All rights reserved. + +This source code is licensed under the BSD-style license found in the +LICENSE file in the root directory of this source tree. An additional grant +of patent rights can be found in the PATENTS file in the same directory. +""" + + +class CallReportView(BaseReport): + """View Call and SMS reports on basis of Network or tower level.""" + + def __init__(self, **kwargs): + template = "dashboard/report/call-sms.html" + url_namespace = "call-report" + reports = {'Call': ['Number of Calls', 'Minutes of Call'], + 'SMS': ['Number of SMS']} + super(CallReportView, self).__init__(reports, template, + url_namespace, **kwargs) + + def get(self, request): + return self.handle_request(request) + + def post(self, request): + return self.handle_request(request) \ No newline at end of file