Created landing page for User Dashboard, updated Request Model
authorPrasandeep Singh <prasan.ubhi@gmail.com>
Tue, 5 Dec 2017 00:58:59 +0000 (19:58 -0500)
committerSuresh Marru <smarru@apache.org>
Thu, 14 Dec 2017 01:51:20 +0000 (20:51 -0500)
14 files changed:
allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0007_auto_20171205_0024.py [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0007_auto_20171205_0024.pyc [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0008_auto_20171205_0028.py [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0008_auto_20171205_0028.pyc [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0009_auto_20171205_0029.py [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0009_auto_20171205_0029.pyc [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/models.py
allocation-manager/django/ResourceAllocationManager/dashboard/models.pyc
allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/base.html
allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/detail.html
allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/index.html
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/migrations/0007_auto_20171205_0024.py b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0007_auto_20171205_0024.py
new file mode 100644 (file)
index 0000000..66e300e
--- /dev/null
@@ -0,0 +1,70 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.10 on 2017-12-05 00:24
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('dashboard', '0006_request_request_date'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='request',
+            name='allocation_type',
+            field=models.CharField(blank=True, max_length=100),
+        ),
+        migrations.AlterField(
+            model_name='request',
+            name='applications_to_be_used',
+            field=models.CharField(blank=True, max_length=100),
+        ),
+        migrations.AlterField(
+            model_name='request',
+            name='disk_usage_range_per_job',
+            field=models.BigIntegerField(blank=True),
+        ),
+        migrations.AlterField(
+            model_name='request',
+            name='document',
+            field=models.FileField(blank=True, upload_to=b''),
+        ),
+        migrations.AlterField(
+            model_name='request',
+            name='field_of_science',
+            field=models.CharField(blank=True, max_length=50),
+        ),
+        migrations.AlterField(
+            model_name='request',
+            name='keywords',
+            field=models.CharField(blank=True, max_length=100),
+        ),
+        migrations.AlterField(
+            model_name='request',
+            name='max_memory_per_cpu',
+            field=models.BigIntegerField(blank=True),
+        ),
+        migrations.AlterField(
+            model_name='request',
+            name='num_cpus_per_job',
+            field=models.BigIntegerField(blank=True),
+        ),
+        migrations.AlterField(
+            model_name='request',
+            name='request_reviewed_and_funded_by',
+            field=models.CharField(blank=True, max_length=100),
+        ),
+        migrations.AlterField(
+            model_name='request',
+            name='specific_resource_selection',
+            field=models.CharField(blank=True, max_length=100),
+        ),
+        migrations.AlterField(
+            model_name='request',
+            name='typical_su_per_job',
+            field=models.BigIntegerField(blank=True),
+        ),
+    ]
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0007_auto_20171205_0024.pyc b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0007_auto_20171205_0024.pyc
new file mode 100644 (file)
index 0000000..0b57df8
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0007_auto_20171205_0024.pyc differ
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0008_auto_20171205_0028.py b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0008_auto_20171205_0028.py
new file mode 100644 (file)
index 0000000..2f2fca1
--- /dev/null
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.10 on 2017-12-05 00:28
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('dashboard', '0007_auto_20171205_0024'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='request',
+            name='disk_usage_range_per_job',
+            field=models.BigIntegerField(null=True),
+        ),
+        migrations.AlterField(
+            model_name='request',
+            name='max_memory_per_cpu',
+            field=models.BigIntegerField(null=True),
+        ),
+        migrations.AlterField(
+            model_name='request',
+            name='num_cpus_per_job',
+            field=models.BigIntegerField(null=True),
+        ),
+        migrations.AlterField(
+            model_name='request',
+            name='typical_su_per_job',
+            field=models.BigIntegerField(null=True),
+        ),
+    ]
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0008_auto_20171205_0028.pyc b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0008_auto_20171205_0028.pyc
new file mode 100644 (file)
index 0000000..6c59ccd
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0008_auto_20171205_0028.pyc differ
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0009_auto_20171205_0029.py b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0009_auto_20171205_0029.py
new file mode 100644 (file)
index 0000000..fdc92b2
--- /dev/null
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.10 on 2017-12-05 00:29
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('dashboard', '0008_auto_20171205_0028'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='request',
+            name='disk_usage_range_per_job',
+            field=models.BigIntegerField(blank=True, null=True),
+        ),
+        migrations.AlterField(
+            model_name='request',
+            name='max_memory_per_cpu',
+            field=models.BigIntegerField(blank=True, null=True),
+        ),
+        migrations.AlterField(
+            model_name='request',
+            name='num_cpus_per_job',
+            field=models.BigIntegerField(blank=True, null=True),
+        ),
+        migrations.AlterField(
+            model_name='request',
+            name='typical_su_per_job',
+            field=models.BigIntegerField(blank=True, null=True),
+        ),
+    ]
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0009_auto_20171205_0029.pyc b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0009_auto_20171205_0029.pyc
new file mode 100644 (file)
index 0000000..1551e24
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0009_auto_20171205_0029.pyc differ
index d8b9ec8..7d28ed1 100644 (file)
@@ -9,19 +9,19 @@ class Request(models.Model):
     request_title = models.CharField(max_length=250)
     request_description = models.CharField(max_length=500)
     request_status = models.CharField(max_length=20)
-    allocation_type = models.CharField(max_length=100)
-    applications_to_be_used = models.CharField(max_length=100)
-    disk_usage_range_per_job = models.BigIntegerField()
-    document = models.FileField()
-    field_of_science = models.CharField(max_length=50)
-    keywords = models.CharField(max_length=100)
-    max_memory_per_cpu = models.BigIntegerField()
-    num_cpus_per_job = models.BigIntegerField()
-    request_reviewed_and_funded_by = models.CharField(max_length=100)
+    allocation_type = models.CharField(blank=True,max_length=100)
+    applications_to_be_used = models.CharField(blank=True,max_length=100)
+    disk_usage_range_per_job = models.BigIntegerField(blank=True,null=True)
+    document = models.FileField(blank=True)
+    field_of_science = models.CharField(blank=True,max_length=50)
+    keywords = models.CharField(blank=True,max_length=100)
+    max_memory_per_cpu = models.BigIntegerField(blank=True,null=True)
+    num_cpus_per_job = models.BigIntegerField(blank=True,null=True)
+    request_reviewed_and_funded_by = models.CharField(blank=True,max_length=100)
     request_date = models.DateTimeField(blank=True, null=True)
     service_units = models.BigIntegerField()
-    specific_resource_selection = models.CharField(max_length=100)
-    typical_su_per_job = models.BigIntegerField()
+    specific_resource_selection = models.CharField(blank=True,max_length=100)
+    typical_su_per_job = models.BigIntegerField(blank=True,null=True)
 
     def get_absolute_url(self):
         return reverse('dashboard/detail.html', kwargs={'pk': self.pk})
index 3c552d2..7987bd4 100644 (file)
Binary files a/allocation-manager/django/ResourceAllocationManager/dashboard/models.pyc and b/allocation-manager/django/ResourceAllocationManager/dashboard/models.pyc differ
index 779bc55..768f112 100644 (file)
@@ -10,7 +10,6 @@
     <link href="https://fonts.googleapis.com/css?family=Spectral+SC" rel="stylesheet">
     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.7.5/css/bootstrap-select.min.css">
     <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-fileinput/4.4.5/css/fileinput.min.css" media="all" rel="stylesheet" type="text/css" />
-
     <link rel="stylesheet" type="text/css" href="{% static 'dashboard/style.css' %}"/>
     <script
       src="https://code.jquery.com/jquery-3.2.1.min.js"
index 34478ee..9859092 100644 (file)
@@ -2,7 +2,6 @@
 {% block title %} Request Details{% endblock %}
 
 {% block body %}
-{#    <!--<img src="{{ album.album_logo.url }}">-->#}
 
     <h1>{{ request.request_title }}</h1>
     <h3>{{ request.request_description }} </h3>
index 4a3f0bd..88e25c4 100644 (file)
@@ -1,24 +1,35 @@
 {% extends 'dashboard/base.html' %}
-{% block title %} Allcation Manager - Home{% endblock %}
+{% block title %} Allocation Manager - Home{% endblock %}
 {% block body %}
     {% if all_requests %}
-        <h3>Here are all my requests</h3>
-    <!-- Details-->
-    <ul>
-        {% for request in all_requests %}
-         <li>
-             <a href="{% url 'dashboard:detail' request.id %}">{{ request.request_title }}</a>
-             <!-- Delete -->
-            <form action="{% url 'dashboard:request-delete' request.id %}" method="post" style="display: inline">
-                {% csrf_token %}
-                <input type="hidden" name="request_id" value="{{ request.id }}">
-                <button type="submit" class="btn btn-default btn-sm">
-                    <span class="glyphicon glyphicon-trash"></span>
-                </button>
-            </form>
-         </li>
-        {% endfor %}
-    </ul>
+        <h3 style="margin-left: 7%">My Requests</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>Allocation Status</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>10</td>
+                    <td>Pending</td>
+                  </tr>
+                {% endfor %}
+            </tbody>
+          </table>
+        </div>
+
+
     {%  else %}
         <h3>You don't have any requests</h3>
     {% endif %}
index 5139e55..706a7f0 100644 (file)
@@ -72,55 +72,3 @@ class UserFormView(View):
                     return redirect('dashboard:index')
         return render(request, self.template_name, {'form': form})
 
-
-
-
-
-# # from django.http import Http404
-# # from django.http import HttpResponse
-# # from django.template import loader
-# from django.shortcuts import render, get_object_or_404
-# from .models import Album, Song
-#
-# def index(request):
-#     all_albums = Album.objects.all()
-#     context = {'all_albums': all_albums}
-#     return render(request, 'dashboard/index.html', context)
-#
-#
-#
-#     # html = ''
-#     # all_albums = Album.objects.all()
-#     # for album in all_albums:
-#     #     url = '/dashboard/' + str(album.id) + '/'
-#     #     html += '<a href="' + url + '">' + album.album_title + '</a><br>'
-#     # return HttpResponse(html)
-#
-# def detail(request, album_id):
-#     album = get_object_or_404(Album, pk=album_id)
-#     # try:
-#     #     album = Album.objects.get(pk=album_id)
-#     # except Album.DoesNotExist:
-#     #     raise Http404("Album does not exists")
-#     return render(request, 'dashboard/detail.html', {'album':album} )
-#     # return HttpResponse("<h2>This will contain detaails for " +str(album_id) + "</h2>")
-#
-#
-# def favourite(request, album_id):
-#     album = get_object_or_404(Album, pk=album_id)
-#     try:
-#         selected_song = album.song_set.get(pk=request.POST['song'])
-#     except (KeyError, Song.DoesNotExist):
-#         return render(request, 'dashboard/detail.html', {
-#             'album' : album,
-#             'error_message' : "You did not select a valid song",
-#         })
-#     else:
-#         selected_song.is_favourite = True
-#         selected_song.save()
-#         return render(request, 'dashboard/detail.html', {'album': album})
-
-#
-#
-#
-#
index ca69975..4f74faa 100644 (file)
Binary files a/allocation-manager/django/ResourceAllocationManager/dashboard/views.pyc and b/allocation-manager/django/ResourceAllocationManager/dashboard/views.pyc differ
index 871c8b6..f3033e4 100644 (file)
Binary files a/allocation-manager/django/ResourceAllocationManager/db.sqlite3 and b/allocation-manager/django/ResourceAllocationManager/db.sqlite3 differ