Added screens for reviewer and admin dashboards
authorPrasandeep Singh <prasan.ubhi@gmail.com>
Mon, 11 Dec 2017 03:07:38 +0000 (22:07 -0500)
committerSuresh Marru <smarru@apache.org>
Thu, 14 Dec 2017 01:51:20 +0000 (20:51 -0500)
allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/admin.html [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/index.html
allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/request_form.html
allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/reviewer.html [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/urls.py
allocation-manager/django/ResourceAllocationManager/dashboard/urls.pyc
allocation-manager/django/ResourceAllocationManager/dashboard/views.py
allocation-manager/django/ResourceAllocationManager/dashboard/views.pyc
allocation-manager/django/ResourceAllocationManager/db.sqlite3

diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/admin.html b/allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/admin.html
new file mode 100644 (file)
index 0000000..1dda602
--- /dev/null
@@ -0,0 +1,47 @@
+{% extends 'dashboard/base.html' %}
+{% block title %} Allocation Manager - Admin{% endblock %}
+{% block body %}
+    {% if all_requests %}
+        <h3 style="margin-left: 7%">Requests to Approve/Reject</h3>
+        <!-- All Requests-->
+        <div class="container">
+          <table class="table table-hover table-bordered table-striped table-responsive">
+            <thead class="thead-inverse">
+              <tr style="background-color: #337ab7;color:white">
+                <th>Request-ID</th>
+                <th>Request Title</th>
+                <th>Request Description</th>
+                <th>Allocation Requested</th>
+                <th style="text-align: center">Assign Reviewer(s)</th>
+              </tr>
+            </thead>
+            <tbody>
+                {% for request in all_requests %}
+                  <tr>
+                    <td>{{ request.id }}</td>
+                    <td>{{ request.request_title }}</td>
+                    <td>{{ request.request_description }}</td>
+                    <td>{{ request.service_units}}</td>
+                    <td>
+                        <div class="form-group">
+                            <div class="col-sm-10">
+                                <select class="selectpicker" data-style="btn-primary" data-live-search="true" multiple>
+                                    <option>Reviewer 1</option>
+                                    <option>Reviewer 2</option>
+                                    <option>Reviewer 3</option>
+                                    <option>Reviewer 4</option>
+                                </select>
+                                <button type="submit" class="btn btn-success">Assign</button>
+                            </div>
+                        </div>
+                    </td>
+                  </tr>
+                {% endfor %}
+            </tbody>
+          </table>
+        </div>
+
+    {%  else %}
+        <h3>No Requests to Review</h3>
+    {% endif %}
+{%  endblock %}
\ No newline at end of file
index 88e25c4..fac06d2 100644 (file)
@@ -22,7 +22,7 @@
                     <td>{{ request.request_title }}</td>
                     <td>{{ request.request_description }}</td>
                     <td>10</td>
-                    <td>Pending</td>
+                    <td>{{ request.request_status }}</td>
                   </tr>
                 {% endfor %}
             </tbody>
index 5e973c3..65a7e06 100644 (file)
@@ -3,7 +3,9 @@
 {% block request_active %}active{% endblock %}
 
 {%  block body %}
+
     <div class="container-fluid">
+        <h2>New Request</h2>
         <div class="row">
             <div class="col-sm-12 col-md-7">
                 <div class="panel panel-default">
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/reviewer.html b/allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/reviewer.html
new file mode 100644 (file)
index 0000000..80f6d73
--- /dev/null
@@ -0,0 +1,33 @@
+{% extends 'dashboard/base.html' %}
+{% block title %} Allocation Manager - Reviewer{% endblock %}
+{% block body %}
+    {% if all_requests %}
+        <h3 style="margin-left: 7%">Requests to Review</h3>
+        <!-- All Requests-->
+        <div class="container">
+          <table class="table table-hover table-bordered table-striped table-responsive">
+            <thead class="thead-inverse">
+              <tr style="background-color: #337ab7;color:white">
+                <th>Request-ID</th>
+                <th>Request Title</th>
+                <th>Request Description</th>
+                <th>Allocation Requested</th>
+              </tr>
+            </thead>
+            <tbody>
+                {% for request in all_requests %}
+                  <tr>
+                    <td>{{ request.id }}</td>
+                    <td>{{ request.request_title }}</td>
+                    <td>{{ request.request_description }}</td>
+                    <td>{{ request.service_units}}</td>
+                  </tr>
+                {% endfor %}
+            </tbody>
+          </table>
+        </div>
+
+    {%  else %}
+        <h3>No Requests to Review</h3>
+    {% endif %}
+{%  endblock %}
\ No newline at end of file
index 8f26ba3..1beadcb 100644 (file)
@@ -8,6 +8,13 @@ urlpatterns = [
     # url(r'^$', views.index, name='index'),
     url(r'^$', views.IndexView.as_view(), name='index'),
 
+    # /dashboard/reviewer
+    url(r'^reviewer/$', views.ReviewerView.as_view(), name='reviewer'),
+
+
+    # /dashboard/admin
+    url(r'^admin/$', views.AdminView.as_view(), name='admin'),
+
 
     url(r'^register/$', views.UserFormView.as_view(), name='register'),
 
index ad9dfb3..abfcbe7 100644 (file)
Binary files a/allocation-manager/django/ResourceAllocationManager/dashboard/urls.pyc and b/allocation-manager/django/ResourceAllocationManager/dashboard/urls.pyc differ
index 706a7f0..6e51a30 100644 (file)
@@ -15,6 +15,22 @@ class IndexView(generic.ListView):
     def get_queryset(self):
         return Request.objects.all()
 
+class ReviewerView(generic.ListView):
+    template_name = 'dashboard/reviewer.html'
+    context_object_name = 'all_requests'
+
+    def get_queryset(self):
+        return Request.objects.all()
+
+
+class AdminView(generic.ListView):
+    template_name = 'dashboard/admin.html'
+    context_object_name = 'all_requests'
+
+    def get_queryset(self):
+        return Request.objects.all()
+
+
 
 class DetailView(generic.DetailView):
     model = Request
index 4f74faa..149ad31 100644 (file)
Binary files a/allocation-manager/django/ResourceAllocationManager/dashboard/views.pyc and b/allocation-manager/django/ResourceAllocationManager/dashboard/views.pyc differ
index f3033e4..a8a979a 100644 (file)
Binary files a/allocation-manager/django/ResourceAllocationManager/db.sqlite3 and b/allocation-manager/django/ResourceAllocationManager/db.sqlite3 differ