Added model for Request, basic UI to Create Request
authorPrasandeep Singh <prasan.ubhi@gmail.com>
Fri, 1 Dec 2017 01:33:13 +0000 (20:33 -0500)
committerSuresh Marru <smarru@apache.org>
Thu, 14 Dec 2017 01:51:20 +0000 (20:51 -0500)
46 files changed:
allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/__init__.py [moved from allocation-manager/user-interface/website/website/__init__.py with 100% similarity]
allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/__init__.pyc [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/settings.py [moved from allocation-manager/user-interface/website/website/settings.py with 89% similarity]
allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/settings.pyc [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/urls.py [moved from allocation-manager/user-interface/website/website/urls.py with 63% similarity]
allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/urls.pyc [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/wsgi.py [moved from allocation-manager/user-interface/website/website/wsgi.py with 67% similarity]
allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/wsgi.pyc [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/__init__.py [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/__init__.pyc [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/admin.py [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/admin.pyc [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/apps.py [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/apps.pyc [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/forms.py [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/forms.pyc [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0001_initial.py [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0001_initial.pyc [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0003_auto_20171128_0601.py [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0003_auto_20171128_0601.pyc [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0004_auto_20171201_0047.py [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0004_auto_20171201_0047.pyc [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/migrations/__init__.py [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/migrations/__init__.pyc [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/models.py [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/models.pyc [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/static/dashboard/images/background.jpg [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/static/dashboard/style.css [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/base.html [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/detail.html [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/form-template.html [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/index.html [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/registration_form.html [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/request_form.html [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/tests.py [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/urls.py [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/urls.pyc [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/views.py [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/dashboard/views.pyc [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/db.sqlite3 [new file with mode: 0644]
allocation-manager/django/ResourceAllocationManager/manage.py [moved from allocation-manager/user-interface/website/manage.py with 89% similarity]
allocation-manager/user-interface/website/db.sqlite3 [deleted file]
allocation-manager/user-interface/website/website/__init__.pyc [deleted file]
allocation-manager/user-interface/website/website/settings.pyc [deleted file]
allocation-manager/user-interface/website/website/urls.pyc [deleted file]
allocation-manager/user-interface/website/website/wsgi.pyc [deleted file]

diff --git a/allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/__init__.pyc b/allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/__init__.pyc
new file mode 100644 (file)
index 0000000..a178c62
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/__init__.pyc differ
@@ -1,5 +1,5 @@
 """
-Django settings for website project.
+Django settings for ResourceAllocationManager project.
 
 Generated by 'django-admin startproject' using Django 1.10.
 
@@ -20,7 +20,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 # See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
 
 # SECURITY WARNING: keep the secret key used in production secret!
-SECRET_KEY = 'f=!$c_6mi%*dtt+8ld+l%k_k3%(fb1m#)rh@-czbanibuk)2h9'
+SECRET_KEY = 'l659=^n0i$6zlrr7l!xf69ubigl8av0uxb4ey8j_qwe+0+dwz3'
 
 # SECURITY WARNING: don't run with debug turned on in production!
 DEBUG = True
@@ -31,6 +31,7 @@ ALLOWED_HOSTS = []
 # Application definition
 
 INSTALLED_APPS = [
+    'dashboard.apps.DashboardConfig',
     'django.contrib.admin',
     'django.contrib.auth',
     'django.contrib.contenttypes',
@@ -49,7 +50,7 @@ MIDDLEWARE = [
     'django.middleware.clickjacking.XFrameOptionsMiddleware',
 ]
 
-ROOT_URLCONF = 'website.urls'
+ROOT_URLCONF = 'ResourceAllocationManager.urls'
 
 TEMPLATES = [
     {
@@ -67,7 +68,7 @@ TEMPLATES = [
     },
 ]
 
-WSGI_APPLICATION = 'website.wsgi.application'
+WSGI_APPLICATION = 'ResourceAllocationManager.wsgi.application'
 
 
 # Database
@@ -118,3 +119,9 @@ USE_TZ = True
 # https://docs.djangoproject.com/en/1.10/howto/static-files/
 
 STATIC_URL = '/static/'
+
+MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
+MEDIA_URL = '/media/'
+
+
+
diff --git a/allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/settings.pyc b/allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/settings.pyc
new file mode 100644 (file)
index 0000000..cd3260c
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/settings.pyc differ
@@ -1,4 +1,4 @@
-"""website URL Configuration
+"""ResourceAllocationManager URL Configuration
 
 The `urlpatterns` list routes URLs to views. For more information please see:
     https://docs.djangoproject.com/en/1.10/topics/http/urls/
@@ -13,9 +13,16 @@ Including another URLconf
     1. Import the include() function: from django.conf.urls import url, include
     2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
 """
-from django.conf.urls import url
+from django.conf.urls import include,url
 from django.contrib import admin
+from django.conf import settings
+from django.conf.urls.static import static
 
 urlpatterns = [
     url(r'^admin/', admin.site.urls),
+    url(r'^dashboard/', include('dashboard.urls')),
 ]
+
+if settings.DEBUG:
+    urlpatterns += static(settings.STATIC_URL, document_root= settings.STATIC_ROOT)
+    urlpatterns += static(settings.MEDIA_URL, document_root= settings.MEDIA_ROOT)
\ No newline at end of file
diff --git a/allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/urls.pyc b/allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/urls.pyc
new file mode 100644 (file)
index 0000000..46b0c48
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/urls.pyc differ
@@ -1,5 +1,5 @@
 """
-WSGI config for website project.
+WSGI config for ResourceAllocationManager project.
 
 It exposes the WSGI callable as a module-level variable named ``application``.
 
@@ -11,6 +11,6 @@ import os
 
 from django.core.wsgi import get_wsgi_application
 
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "website.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ResourceAllocationManager.settings")
 
 application = get_wsgi_application()
diff --git a/allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/wsgi.pyc b/allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/wsgi.pyc
new file mode 100644 (file)
index 0000000..99452e8
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/ResourceAllocationManager/wsgi.pyc differ
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/__init__.py b/allocation-manager/django/ResourceAllocationManager/dashboard/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/__init__.pyc b/allocation-manager/django/ResourceAllocationManager/dashboard/__init__.pyc
new file mode 100644 (file)
index 0000000..000787e
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/dashboard/__init__.pyc differ
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/admin.py b/allocation-manager/django/ResourceAllocationManager/dashboard/admin.py
new file mode 100644 (file)
index 0000000..e1995e6
--- /dev/null
@@ -0,0 +1,5 @@
+from django.contrib import admin
+from .models import Request
+
+
+admin.site.register(Request)
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/admin.pyc b/allocation-manager/django/ResourceAllocationManager/dashboard/admin.pyc
new file mode 100644 (file)
index 0000000..ca8985a
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/dashboard/admin.pyc differ
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/apps.py b/allocation-manager/django/ResourceAllocationManager/dashboard/apps.py
new file mode 100644 (file)
index 0000000..468fa77
--- /dev/null
@@ -0,0 +1,7 @@
+from __future__ import unicode_literals
+
+from django.apps import AppConfig
+
+
+class DashboardConfig(AppConfig):
+    name = 'dashboard'
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/apps.pyc b/allocation-manager/django/ResourceAllocationManager/dashboard/apps.pyc
new file mode 100644 (file)
index 0000000..d1a31a4
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/dashboard/apps.pyc differ
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/forms.py b/allocation-manager/django/ResourceAllocationManager/dashboard/forms.py
new file mode 100644 (file)
index 0000000..f345ec8
--- /dev/null
@@ -0,0 +1,10 @@
+from django.contrib.auth.models import User
+from django import forms
+
+
+class UserForm(forms.ModelForm):
+    password = forms.CharField(widget=forms.PasswordInput)
+
+    class Meta:
+        model = User
+        fields = ['username', 'email', 'password']
\ No newline at end of file
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/forms.pyc b/allocation-manager/django/ResourceAllocationManager/dashboard/forms.pyc
new file mode 100644 (file)
index 0000000..32e638f
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/dashboard/forms.pyc differ
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0001_initial.py b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0001_initial.py
new file mode 100644 (file)
index 0000000..b5a6800
--- /dev/null
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.10 on 2017-11-20 23:04
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+    initial = True
+
+    dependencies = [
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='Album',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('artist', models.CharField(max_length=250)),
+                ('album_title', models.CharField(max_length=500)),
+                ('genre', models.CharField(max_length=100)),
+                ('album_logo', models.CharField(max_length=1000)),
+            ],
+        ),
+        migrations.CreateModel(
+            name='Song',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('file_type', models.CharField(max_length=10)),
+                ('song_title', models.CharField(max_length=250)),
+                ('album', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='dashboard.Album')),
+            ],
+        ),
+    ]
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0001_initial.pyc b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0001_initial.pyc
new file mode 100644 (file)
index 0000000..ab7ebfd
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0001_initial.pyc differ
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0003_auto_20171128_0601.py b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0003_auto_20171128_0601.py
new file mode 100644 (file)
index 0000000..9214cda
--- /dev/null
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.10 on 2017-11-28 06:01
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('dashboard', '0002_song_is_favourite'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='album',
+            name='album_logo',
+            field=models.FileField(upload_to=b''),
+        ),
+    ]
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0003_auto_20171128_0601.pyc b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0003_auto_20171128_0601.pyc
new file mode 100644 (file)
index 0000000..6f2e3d8
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0003_auto_20171128_0601.pyc differ
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0004_auto_20171201_0047.py b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0004_auto_20171201_0047.py
new file mode 100644 (file)
index 0000000..df2fa83
--- /dev/null
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.10 on 2017-12-01 00:47
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('dashboard', '0003_auto_20171128_0601'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='Request',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('request_title', models.CharField(max_length=250)),
+                ('request_description', models.CharField(max_length=500)),
+                ('request_status', models.CharField(max_length=20)),
+                ('request_comments', models.FileField(upload_to=b'')),
+                ('allocation_type', models.CharField(max_length=100)),
+                ('cpu_hours_requested', models.CharField(max_length=10)),
+                ('cpu_hours_allocated', models.CharField(max_length=10)),
+            ],
+        ),
+        migrations.RemoveField(
+            model_name='song',
+            name='album',
+        ),
+        migrations.DeleteModel(
+            name='Album',
+        ),
+        migrations.DeleteModel(
+            name='Song',
+        ),
+    ]
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0004_auto_20171201_0047.pyc b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0004_auto_20171201_0047.pyc
new file mode 100644 (file)
index 0000000..27abfa6
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/0004_auto_20171201_0047.pyc differ
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/__init__.py b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/__init__.pyc b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/__init__.pyc
new file mode 100644 (file)
index 0000000..a069f05
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/dashboard/migrations/__init__.pyc differ
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/models.py b/allocation-manager/django/ResourceAllocationManager/dashboard/models.py
new file mode 100644 (file)
index 0000000..a17a0fb
--- /dev/null
@@ -0,0 +1,26 @@
+from __future__ import unicode_literals
+
+from django.db import models
+from django.core.urlresolvers import reverse
+
+
+
+# Create your models here.
+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)
+    request_comments = models.FileField()
+    allocation_type = models.CharField(max_length=100)
+    cpu_hours_requested = models.CharField(max_length=10)
+    cpu_hours_allocated = models.CharField(max_length=10)
+
+
+    def get_absolute_url(self):
+        return reverse('dashboard/detail.html', kwargs={'pk': self.pk})
+
+
+    def __str__(self):
+        return self.request_title + ' - ' + self.request_status
+
+
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/models.pyc b/allocation-manager/django/ResourceAllocationManager/dashboard/models.pyc
new file mode 100644 (file)
index 0000000..75427c8
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/dashboard/models.pyc differ
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/static/dashboard/images/background.jpg b/allocation-manager/django/ResourceAllocationManager/dashboard/static/dashboard/images/background.jpg
new file mode 100644 (file)
index 0000000..ced3d83
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/dashboard/static/dashboard/images/background.jpg differ
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/static/dashboard/style.css b/allocation-manager/django/ResourceAllocationManager/dashboard/static/dashboard/style.css
new file mode 100644 (file)
index 0000000..0771cc2
--- /dev/null
@@ -0,0 +1,11 @@
+/*body {*/
+    /*background:white url("images/background.jpg");*/
+/*}*/
+
+.navbar{
+    border-radius: 0;
+}
+
+.navbar-brand{
+    font-family: 'Spectral+SC', cursive;
+}
\ No newline at end of file
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/base.html b/allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/base.html
new file mode 100644 (file)
index 0000000..a16c82c
--- /dev/null
@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>{% block title%} Allocation Manager - {% endblock %}</title>
+    <!-- Loads the path to your static files -->
+    {% load staticfiles %}
+    <!-- Latest compiled and minified CSS -->
+    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
+    <link href="https://fonts.googleapis.com/css?family=Spectral+SC" rel="stylesheet">
+    <link rel="stylesheet" type="text/css" href="{% static 'dashboard/style.css' %}"/>
+    <script
+      src="https://code.jquery.com/jquery-3.2.1.min.js"
+      integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
+      crossorigin="anonymous"></script>
+    <!-- Latest compiled and minified JavaScript -->
+    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
+</head>
+<body>
+    <nav class="navbar navbar-inverse">
+    <div class="container-fluid">
+        <!--Header -->
+        <div class="navbar-header">
+            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#topNavBar">
+                <span class="icon-bar"></span>
+                <span class="icon-bar"></span>
+                <span class="icon-bar"></span>
+            </button>
+            <a class="navbar-brand" href="{%  url 'dashboard:index' %}">Allocation Manager</a>
+        </div>
+
+        <!-- Requests -->
+        <div class="collapse navbar-collapse" id="topNavBar">
+
+            <ul class="nav navbar-nav">
+                <li class="active">
+                    <a href="{% url 'dashboard:index' %}">
+                        <span class="glyphicon glyphicon-briefcase" aria-hidden="true"></span>&nbsp
+                        Requests
+                    </a>
+                </li>
+            </ul>
+
+
+            <form class="navbar-form navbar-left" role="search" method="get" action="#">
+                <div class="form-group">
+                    <input type="text" class="form-control" name="q" value="">
+                </div>
+                <button type="submit" class="btn btn-default">Search</button>
+            </form>
+
+
+            <ul class="nav navbar-nav navbar-right">
+                <li class="">
+                    <a href="{% url 'dashboard:request-add' %}">
+                        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>&nbsp
+                        Create Request
+                    </a>
+                </li>
+                <li class="">
+                    <a href="#">
+                        <span class="glyphicon glyphicon-off" aria-hidden="true"></span>&nbsp
+                        Logout
+                    </a>
+                </li>
+            </ul>
+        </div>
+    </div>
+</nav>
+
+{% block body %}
+{% endblock %}
+</body>
+</html>
\ No newline at end of file
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/detail.html b/allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/detail.html
new file mode 100644 (file)
index 0000000..0b4b312
--- /dev/null
@@ -0,0 +1,13 @@
+{% extends 'dashboard/base.html' %}
+{% block title %} Request Details{% endblock %}
+
+{% block body %}
+    <!--<img src="{{ album.album_logo.url }}">-->
+
+    <h1>{{ request.request_title }}</h1>
+    <h3>{{ request.request_description }} </h3>
+
+    {% if error_message %}
+        <p><strong>{{ error_message }}</strong></p>
+    {% endif %}
+{%  endblock %}
\ No newline at end of file
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/form-template.html b/allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/form-template.html
new file mode 100644 (file)
index 0000000..d3fc113
--- /dev/null
@@ -0,0 +1,6 @@
+{% for field in form %}
+    <div class="form-group">
+        <label class="control-label col-sm-2">{{ field.label_tag }}</label>
+        <div class="col-sm-10">{{ field }}</div>
+    </div>
+{% endfor %}
\ No newline at end of file
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/index.html b/allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/index.html
new file mode 100644 (file)
index 0000000..4a3f0bd
--- /dev/null
@@ -0,0 +1,25 @@
+{% extends 'dashboard/base.html' %}
+{% block title %} Allcation 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>
+    {%  else %}
+        <h3>You don't have any requests</h3>
+    {% endif %}
+{%  endblock %}
\ No newline at end of file
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/registration_form.html b/allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/registration_form.html
new file mode 100644 (file)
index 0000000..440a97b
--- /dev/null
@@ -0,0 +1,27 @@
+{% extends 'dashboard/base.html' %}
+{% block title %}Register{% endblock %}
+{% block albums_active %}active{% endblock %}
+
+{%  block body %}
+    <div class="container-fluid">
+        <div class="row">
+            <div class="col-sm-12 col-md-7">
+                <div class="panel panel-default">
+                    <div class="panel-body">
+                        <h3>Create a New Account</h3>
+                        <!-- enctype to handle file uploads-->
+                        <form class="form-horizontal" action="" method="post" enctype="multipart/form-data">
+                            {% csrf_token %}
+                            {% include 'dashboard/form-template.html' %}
+                            <div class="form-group">
+                                <div class="col-sm-offset-2 col-sm-10">
+                                    <button type="submit" class="btn btn-success">Submit</button>
+                                </div>
+                            </div>
+                        </form>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+{% endblock %}
\ No newline at end of file
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/request_form.html b/allocation-manager/django/ResourceAllocationManager/dashboard/templates/dashboard/request_form.html
new file mode 100644 (file)
index 0000000..4db6286
--- /dev/null
@@ -0,0 +1,26 @@
+{% extends 'dashboard/base.html' %}
+{% block title %}Create a New Request{% endblock %}
+{% block request_active %}active{% endblock %}
+
+{%  block body %}
+    <div class="container-fluid">
+        <div class="row">
+            <div class="col-sm-12 col-md-7">
+                <div class="panel panel-default">
+                    <div class="panel-body">
+                        <!-- enctype to handle file uploads-->
+                        <form class="form-horizontal" action="" method="post" enctype="multipart/form-data">
+                            {% csrf_token %}
+                            {% include 'dashboard/form-template.html' %}
+                            <div class="form-group">
+                                <div class="col-sm-offset-2 col-sm-10">
+                                    <button type="submit" class="btn btn-success">Submit</button>
+                                </div>
+                            </div>
+                        </form>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+{% endblock %}
\ No newline at end of file
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/tests.py b/allocation-manager/django/ResourceAllocationManager/dashboard/tests.py
new file mode 100644 (file)
index 0000000..7ce503c
--- /dev/null
@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/urls.py b/allocation-manager/django/ResourceAllocationManager/dashboard/urls.py
new file mode 100644 (file)
index 0000000..8f26ba3
--- /dev/null
@@ -0,0 +1,27 @@
+from django.conf.urls import url
+from . import views
+
+app_name ='dashboard'
+
+urlpatterns = [
+    # /dashboard/
+    # url(r'^$', views.index, name='index'),
+    url(r'^$', views.IndexView.as_view(), name='index'),
+
+
+    url(r'^register/$', views.UserFormView.as_view(), name='register'),
+
+    # /dashboard/712/
+    # url(r'^(?P<request_id>[0-9]+)/$', views.detail, name='detail'),
+    url(r'^(?P<pk>[0-9]+)/$', views.DetailView.as_view(), name='detail'),
+
+
+    # /dashboard/request/add
+    url(r'^request/add/$', views.RequestCreate.as_view(), name='request-add'),
+
+    # /dashboard/request/2/
+    url(r'^request/(?P<pk>[0-9]+)/$', views.RequestUpdate.as_view(), name='request-update'),
+
+    # /dashboard/request/2/delete/
+    url(r'^request/(?P<pk>[0-9]+)/delete/$', views.RequestDelete.as_view(), name='request-delete'),
+]
\ No newline at end of file
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/urls.pyc b/allocation-manager/django/ResourceAllocationManager/dashboard/urls.pyc
new file mode 100644 (file)
index 0000000..ad9dfb3
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/dashboard/urls.pyc differ
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/views.py b/allocation-manager/django/ResourceAllocationManager/dashboard/views.py
new file mode 100644 (file)
index 0000000..1d3cdd8
--- /dev/null
@@ -0,0 +1,121 @@
+from django.views import generic
+from django.views.generic import View
+from django.views.generic.edit import CreateView, UpdateView, DeleteView
+from django.shortcuts import render, redirect
+from django.contrib.auth import authenticate, login
+from django.core.urlresolvers import reverse_lazy
+from .models import Request
+from .forms import UserForm
+
+
+class IndexView(generic.ListView):
+    template_name = 'dashboard/index.html'
+    context_object_name = 'all_requests'
+
+    def get_queryset(self):
+        return Request.objects.all()
+
+
+class DetailView(generic.DetailView):
+    model = Request
+    template_name = 'dashboard/detail.html'
+
+
+class RequestCreate(CreateView):
+    model = Request
+    fields = ['request_title', 'request_status', 'cpu_hours_requested', 'cpu_hours_allocated']
+
+
+class RequestUpdate(UpdateView):
+    model = Request
+    fields = ['request_title', 'request_status', 'cpu_hours_requested', 'cpu_hours_allocated']
+
+
+class RequestDelete(DeleteView):
+    model = Request
+    success_url = reverse_lazy('dashboard:index')
+
+
+class UserFormView(View):
+    form_class = UserForm
+    template_name = 'dashboard/registration_form.html'
+
+
+    # Display a blank form
+    def get(self, request):
+        form = self.form_class(None)
+        return render(request, self.template_name, {'form': form})
+
+    # process form data
+    def post(self, request):
+        form = self.form_class(request.POST)
+
+        if form.is_valid():
+            user = form.save(commit=False)
+
+            # cleaned (normalized) data
+            username = form.cleaned_data['username']
+            password = form.cleaned_data['password']
+            user.set_password(password)
+            user.save()
+
+            # returns user objects if credentials are correct
+            user = authenticate(username=username, password=password)
+            if user is not None:
+                if user.is_active:
+                    login(request, user)
+                    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})
+
+#
+#
+#
+#
diff --git a/allocation-manager/django/ResourceAllocationManager/dashboard/views.pyc b/allocation-manager/django/ResourceAllocationManager/dashboard/views.pyc
new file mode 100644 (file)
index 0000000..23eb1ec
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/dashboard/views.pyc differ
diff --git a/allocation-manager/django/ResourceAllocationManager/db.sqlite3 b/allocation-manager/django/ResourceAllocationManager/db.sqlite3
new file mode 100644 (file)
index 0000000..fdac439
Binary files /dev/null and b/allocation-manager/django/ResourceAllocationManager/db.sqlite3 differ
@@ -3,7 +3,7 @@ import os
 import sys
 
 if __name__ == "__main__":
-    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "website.settings")
+    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ResourceAllocationManager.settings")
     try:
         from django.core.management import execute_from_command_line
     except ImportError:
diff --git a/allocation-manager/user-interface/website/db.sqlite3 b/allocation-manager/user-interface/website/db.sqlite3
deleted file mode 100644 (file)
index fb67489..0000000
Binary files a/allocation-manager/user-interface/website/db.sqlite3 and /dev/null differ
diff --git a/allocation-manager/user-interface/website/website/__init__.pyc b/allocation-manager/user-interface/website/website/__init__.pyc
deleted file mode 100644 (file)
index 664fb91..0000000
Binary files a/allocation-manager/user-interface/website/website/__init__.pyc and /dev/null differ
diff --git a/allocation-manager/user-interface/website/website/settings.pyc b/allocation-manager/user-interface/website/website/settings.pyc
deleted file mode 100644 (file)
index 67b9b68..0000000
Binary files a/allocation-manager/user-interface/website/website/settings.pyc and /dev/null differ
diff --git a/allocation-manager/user-interface/website/website/urls.pyc b/allocation-manager/user-interface/website/website/urls.pyc
deleted file mode 100644 (file)
index 8f8b0bb..0000000
Binary files a/allocation-manager/user-interface/website/website/urls.pyc and /dev/null differ
diff --git a/allocation-manager/user-interface/website/website/wsgi.pyc b/allocation-manager/user-interface/website/website/wsgi.pyc
deleted file mode 100644 (file)
index 78a5664..0000000
Binary files a/allocation-manager/user-interface/website/website/wsgi.pyc and /dev/null differ