# HG changeset patch # User Madhusudan.C.S # Date 1249366875 14400 # Node ID c94bd9ae70d24c6e634f5872ad940e6cc2eaf4cc First commit. diff -r 000000000000 -r c94bd9ae70d2 .hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Tue Aug 04 02:21:15 2009 -0400 @@ -0,0 +1,24 @@ +# use glob syntax. +syntax: glob + +*.pyc +*.zip +*~ +.project +.pydevproject +app.yaml +build +tests/coverageResults +*,cover +tests/.coverage +*.git +*.egg-info +eggs +parts +.installed.cfg +bin +develop-eggs +.gitignore +.DS_Store +index.yaml +.settings diff -r 000000000000 -r c94bd9ae70d2 app/__init__.py diff -r 000000000000 -r c94bd9ae70d2 app/manage.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/manage.py Tue Aug 04 02:21:15 2009 -0400 @@ -0,0 +1,12 @@ +#!/usr/bin/env python +import os +from django.core.management import execute_manager +try: + import settings # Assumed to be in the same directory. +except ImportError: + import sys + sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) + sys.exit(1) + +if __name__ == "__main__": + execute_manager(settings) diff -r 000000000000 -r c94bd9ae70d2 app/projrev/__init__.py diff -r 000000000000 -r c94bd9ae70d2 app/projrev/models.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/projrev/models.py Tue Aug 04 02:21:15 2009 -0400 @@ -0,0 +1,215 @@ +"""This module contains the data model for the project funded by NME +through ICT. +""" + + +__authors__ = [ + '"Madhusudan.C.S" ', +] + + +from django.db import models +from django.contrib.auth.models import User + + +class Project(models.Model): + """Model class for NME funded projects. + """ + + LINE_ITEM_CHOICES = [('ME', 'Mechanical'), + ('CE', 'Chemical'), + ('EE', 'Electrical'), + ('AE', 'Aero Space'), + ('CS', 'Computer Science'), + ('IT', 'Information Technology'), + ] + + STATE_CHOICES = [('MH', 'Maharashtra'), + ('KA', 'Karnataka'), + ('KL', 'Kerala'), + ('TN', 'Tamil Nadu'), + ('AP', 'Andra Pradesh'), + ] + + DISTRICT_CHOICES = [('AD', 'Adilabad'), + ('RT', 'Ratnagiri'), + ('MU', 'Mumbai suburban'), + ('PU', 'Pune'), + ('PL', 'Palakkad'), + ('BN', 'Bangalore Urban district'), + ('CK', 'Chikmagalur District'), + ] + + # Field containing the Line Item to which the project belongs to. + line_item = models.CharField(max_length=256, + choices=LINE_ITEM_CHOICES) + + # Field containing the name of the institution working on the + # project. + institution = models.CharField(max_length=256) + + # Field containing the state to which the institution belongs to. + state = models.CharField(max_length=256, + choices=STATE_CHOICES) + + # Field containing the district to which the institution belongs + # to in the state of India. + district = models.CharField(max_length=256, + choices=DISTRICT_CHOICES) + + # Field containing the autogenerated MICR code for the project. + micr_code = models.CharField(max_length=15, unique=True) + + # Field containing the status of the project. + # status of the project can be one among the following + # New, Revised, Funded, Pilot, DPE + status = models.CharField(max_length=256, + choices=[('new', 'New'), ('pilot', 'Pilot')]) + + @classmethod + def getLineItem(cls, code): + """Get the State name from its code. + """ + + line_item_dict = dict(cls.LINE_ITEM_CHOICES) + return line_item_dict[code] + + @classmethod + def getLineItem(cls, code): + """Get the State name from its code. + """ + + line_item_dict = dict(cls.LINE_ITEM_CHOICES) + return line_item_dict[code] + + @classmethod + def getState(cls, code): + """Get the State name from its code. + """ + + state_dict = dict(cls.STATE_CHOICES) + return state_dict[code] + + @classmethod + def getState(cls, code): + """Get the State name from its code. + """ + + state_dict = dict(cls.STATE_CHOICES) + return state_dict[code] + + @classmethod + def getDistrict(cls, code): + """Get the State name from its code. + """ + + district_dict = dict(cls.DISTRICT_CHOICES) + return district_dict[code] + +class Proposal(models.Model): + """Model class for the project's proposal. + """ + + #: Field representing the relation to the corresponding project. + project = models.ForeignKey(Project) + + #: Field containing the Line Item to which the project belongs to. + document = models.FileField(upload_to='proposals/%Y/%m/%d') + + #: Field containing the date on which the document was submitted + submitted_on = models.DateTimeField(auto_now_add=True) + + #: Field containing the reference to the user who submitted the proposal. + submitted_by = models.ForeignKey(User, null=True) + + #: Field containing the revision number of the proposal belonging to + #: the Project. + rev_num = models.PositiveIntegerField() + + +class Timeline(models.Model): + """Model class for the project's timeline. + """ + + #: Field representing the relation to the corresponding project. + project = models.ForeignKey(Project) + + #: Field containing the date and time of submission of proposal. + submitted = models.DateTimeField() + + #: Field containing the last date and time of review of proposal. + reviewed = models.DateTimeField() + + #: Field containing the date and time of amount paid for the project. + amount_paid = models.DateTimeField() + + #: Field containing the date and time of presentation of the project. + presentation = models.DateTimeField() + + #: Field containing the date and time of monitoring of the project. + monitoring = models.DateTimeField() + + +class Fund(models.Model): + """Model class for the project's funds. + """ + + #: Field representing the relation to the corresponding project. + project = models.ForeignKey(Project) + + #: Field containing the amount sanctioned as funds for the project. + sanctioned = models.FloatField() + + #: Field containing the expenses for the sanctioned fund for + #: the project. + expenses = models.FloatField() + + #: Field containing the date and time on which the funds were + #: sanctioned for the project. + sanctioned_on = models.DateTimeField(auto_now_add=True) + + +class Review(models.Model): + """Model class for the project's proposal's review. + """ + + #: Field representing the relation to the corresponding project. + project = models.ForeignKey(Project) + + #: Field containing the comment entered along with the review. + comment = models.TextField() + + #: Field representing the reference to the person who + #: did the review. + reviewer = models.ForeignKey(User, null=True) + + #: Field containing the date and time of review of the proposal. + reviewed_on = models.DateTimeField(auto_now_add=True) + + #: Field containing the review value for this attribute. + attribute1 = models.PositiveSmallIntegerField( + choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]) + + attribute2 = models.PositiveSmallIntegerField( + choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]) + + attribute3 = models.PositiveSmallIntegerField( + choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]) + + attribute4 = models.PositiveSmallIntegerField( + choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]) + + attribute5 = models.PositiveSmallIntegerField( + choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]) + + attribute6 = models.PositiveSmallIntegerField( + choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]) + + attribute7 = models.PositiveSmallIntegerField( + choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]) + + attribute8 = models.PositiveSmallIntegerField( + choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]) + + attribute9 = models.PositiveSmallIntegerField( + choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5)]) diff -r 000000000000 -r c94bd9ae70d2 app/projrev/views/__init__.py diff -r 000000000000 -r c94bd9ae70d2 app/projrev/views/helpers/__init__.py diff -r 000000000000 -r c94bd9ae70d2 app/projrev/views/helpers/forms.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/projrev/views/helpers/forms.py Tue Aug 04 02:21:15 2009 -0400 @@ -0,0 +1,43 @@ +"""This module contains the form helpers +""" + + +__authors__ = [ + '"Madhusudan.C.S" ', +] + +from django import forms + +from projrev.models import Project +from projrev.models import Review + +class ProposalForm(forms.ModelForm): + """Creates a form for the project. + """ + + document = forms.FileField() + micr_code = forms.CharField(max_length=15, required=False) + + class Meta: + # We store most of the data in Project model. So even though the + # name and the purpose of the form is for Proposal acceptance, we + # use Project model here. + model = Project + + # fields in the Project that must not appear in the form, but have + # be automatically generated. + fields = ('micr_code', 'line_item', 'institution', 'state', 'district') + +class ReviewForm(forms.ModelForm): + """Creates a form for review of proposal. + """ + + project = forms.ModelChoiceField(queryset=Project.objects.all(), + widget=forms.HiddenInput(), + required=False) + + class Meta: + # Create a form from Review data model. + model = Review + + exclude = ('reviewer') \ No newline at end of file diff -r 000000000000 -r c94bd9ae70d2 app/projrev/views/login.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/projrev/views/login.py Tue Aug 04 02:21:15 2009 -0400 @@ -0,0 +1,35 @@ +"""This module contains the views for the login for the portal. +""" + + +__authors__ = [ + '"Madhusudan.C.S" ', +] + + +from django.contrib.auth import authenticate, login +from django.shortcuts import render_to_response, get_object_or_404 + + +def login_validate(request): + """Validate the user and log him in. + """ + + username = request.POST['username'] + password = request.POST['password'] + user = authenticate(username=username, password=password) + if user is not None: + if user.is_active: + login(request, user) + # Redirect to a success page. + else: + pass + # Return a 'disabled account' error message + else: + # Return an 'invalid login' error message. + pass + +def logout_view(request): + """Logout the user + """ + \ No newline at end of file diff -r 000000000000 -r c94bd9ae70d2 app/projrev/views/proposal.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/projrev/views/proposal.py Tue Aug 04 02:21:15 2009 -0400 @@ -0,0 +1,205 @@ +"""This module contains the views for the project's proposal +funded by NME through ICT. +""" + + +__authors__ = [ + '"Madhusudan.C.S" ', +] + + +import time + +from django.shortcuts import render_to_response, get_object_or_404 + +from projrev.models import Project +from projrev.models import Proposal +from projrev.views.helpers import forms as projrev_forms + + +def submit(request): + """View for proposal submission. + """ + + if request.method == 'POST': + return submitPost(request) + else: + return submitGet(request) + +def submitPost(request): + """Handles POST request for the submitted proposal form. + """ + + prop_form = projrev_forms.ProposalForm(request.POST, request.FILES) + + project = None + proposal = None + + if prop_form.is_valid(): + cleaned_data = prop_form.cleaned_data + + # Generate MICR code + cleaned_data['micr_code'] = '%s%s%s%d' % ( + cleaned_data['state'], cleaned_data['district'], + cleaned_data['line_item'], + int(time.time() * 1000) % 1000000000) + + cleaned_data['line_item'] = Project.getLineItem(cleaned_data['line_item']) + cleaned_data['state'] = Project.getState(cleaned_data['state']) + cleaned_data['district'] = Project.getDistrict(cleaned_data['district']) + + # If the form is valid create a new project or update the project + # if it already exists from the form. + project = prop_form.save() + + project.status = 'new' + + project.save() + + # Create a proposal for the project. + proposal = project.proposal_set.create( + document=prop_form.cleaned_data['document'], rev_num = 0) + + proposal.save() + + return submitGet(request, project, proposal) + +def submitGet(request, project=None, proposal=None): + """Handles GET request for the submission of proposal form. + """ + + context = {} + + if proposal: + context['document'] = proposal.document + + if not project: + prop_form = projrev_forms.ProposalForm() + else: + prop_form = projrev_forms.ProposalForm(instance=project) + + context['form'] = prop_form + + template = 'projrev/proposal/submit.html' + + return render_to_response(template, context) + +def review(request, micr_code=None): + """ + """ + + if request.method == 'POST': + return reviewPost(request, micr_code) + else: + return reviewGet(request, micr_code) + +def reviewPost(request, micr_code=None): + """ + """ + + rev_form = projrev_forms.ReviewForm(request.POST) + + if rev_form.is_valid(): + cleaned_data = rev_form.cleaned_data + + cleaned_data['project'] = Project.objects.get(micr_code=micr_code) + + # If the form is valid create a new project or update the project + # if it already exists from the form. + review = rev_form.save() + + return reviewGet(request, micr_code, rev_form) + +def reviewGet(request, micr_code=None, rev_form=None): + """ + """ + + if not micr_code: + template = 'projrev/proposal/list.html' + context = { + 'projects': Project.objects.all(), + 'row_url': '/proposal/review/', + } + + return render_to_response(template, context) + + if not rev_form: + rev_form = projrev_forms.ReviewForm() + + proposal_path = str(Project.objects.get( + micr_code=micr_code).proposal_set.all()[0].document) + + proposal_name = proposal_path.split('/')[-1] + + context = { + 'form': rev_form, + 'project': Project.objects.get(micr_code=micr_code), + 'proposal_path': proposal_path, + 'proposal_name': proposal_name, + } + + template = 'projrev/proposal/review.html' + + return render_to_response(template, context) + +def rank(request, micr_code=None): + """ + """ + + if request.method == 'POST': + return rankPost(request, micr_code) + else: + return rankGet(request, micr_code) + +def rankPost(request, micr_code=None): + """ + """ + + return rankGet(request, micr_code) + +def rankGet(request, micr_code=None): + """ + """ + + if not micr_code: + template = 'projrev/proposal/list.html' + context = { + 'projects': Project.objects.all(), + 'row_url': '/proposal/rank/', + } + + return render_to_response(template, context) + + projects = Project.objects.get(micr_code=micr_code) + + proposal_path = str(projects.proposal_set.all()[0].document) + + proposal_name = proposal_path.split('/')[-1] + + reviews = projects.review_set.all() + + review_score = [0] * 9 + for review in reviews: + review_score[0] += review.attribute1 + review_score[1] += review.attribute2 + review_score[2] += review.attribute3 + review_score[3] += review.attribute4 + review_score[4] += review.attribute5 + review_score[5] += review.attribute6 + review_score[6] += review.attribute7 + review_score[7] += review.attribute8 + review_score[8] += review.attribute9 + + total_score = sum(review_score) + + context = { + 'project': projects, + 'proposal_path': proposal_path, + 'proposal_name': proposal_name, + 'review_score': review_score, + 'total_score': total_score, + } + + template = 'projrev/proposal/rank.html' + + return render_to_response(template, context) diff -r 000000000000 -r c94bd9ae70d2 app/settings.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/settings.py Tue Aug 04 02:21:15 2009 -0400 @@ -0,0 +1,86 @@ +# Django settings for app project. + +import os + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +ADMINS = ( + ('Madhusudan.C.S', 'madhusudancs@gmail.com'), +) + +MANAGERS = ADMINS + +DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. +DATABASE_NAME = 'nme_ict' # Or path to database file if using sqlite3. +DATABASE_USER = 'madhu' # Not used with sqlite3. +DATABASE_PASSWORD = '' # Not used with sqlite3. +DATABASE_HOST = 'localhost' # Set to empty string for localhost. Not used with sqlite3. +DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. + +# Local time zone for this installation. Choices can be found here: +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. +# If running in a Windows environment this must be set to the same as your +# system time zone. +TIME_ZONE = 'Asia/Kolkata' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'en-us' + +SITE_ID = 1 + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True + +ROOT_PATH = os.path.dirname(__file__) + +# Absolute path to the directory that holds media. +# Example: "/home/media/media.lawrence.com/" +MEDIA_ROOT = os.path.join(ROOT_PATH, 'site-content') + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash if there is a path component (optional in other cases). +# Examples: "http://media.lawrence.com", "http://example.com/media/" +MEDIA_URL = '/site-content/' + +# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a +# trailing slash. +# Examples: "http://foo.com/media/", "/media/". +ADMIN_MEDIA_PREFIX = '/media/' + +# Make this unique, and don't share it with anybody. +SECRET_KEY = '4akwt2sqybl#+rr^l3hk(c#3dj^$+=3l$88-j-l%uy%)*%l8_m' + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.load_template_source', + 'django.template.loaders.app_directories.load_template_source', +# 'django.template.loaders.eggs.load_template_source', +) + +MIDDLEWARE_CLASSES = ( + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', +) + +ROOT_URLCONF = 'app.urls' + +TEMPLATE_DIRS = ( + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. + os.path.join(ROOT_PATH, 'templates'), +) + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'django.contrib.admin', + 'app.projrev', +) diff -r 000000000000 -r c94bd9ae70d2 app/site-content/css/projrev.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/site-content/css/projrev.css Tue Aug 04 02:21:15 2009 -0400 @@ -0,0 +1,444 @@ +/******************************************** + AUTHOR: Erwin Aligam + WEBSITE: http://www.styleshout.com/ + TEMPLATE NAME: PixelGreen + TEMPLATE CODE: S-0010 + VERSION: 1.2 + LAST MODIFIED: June-05-2007 + *******************************************/ + +/******************************************** + HTML ELEMENTS +********************************************/ + +/* top elements */ +* { padding: 0; margin: 0; } + +body { + margin: 0; padding: 0; + font: normal 73%/1.5em 'Trebuchet MS', Tahoma, sans-serif; + color: #555; + background: #FFF url(/site-content/images/bg.jpg) repeat-x; + text-align: center; +} + +/* links */ +a { background: inherit; color: #72A545; text-decoration: none; } +a:hover { background: inherit; color: #006699; text-decoration: underline; } + +/* headers */ +h1, h2, h3 { font: bold 1em 'Trebuchet MS', Tahoma, Sans-serif; } +h1 { font-size: 1.4em; color: #65944A; } +h2 { font-size: 1.2em; text-transform: uppercase; } +h3 { font-size: 1.2em; } + +p, h1, h2, h3 { + margin: 10px 15px; +} +.list{ + +} +ul, ol { + margin: 10px 30px; + padding: 0 15px; +} + +/* images */ +img { + border: 1px solid #DADADA; + padding: 5px; + background: #FAFAFA; +} +img.float-right { + margin: 5px 0px 5px 15px; +} +img.float-left { + margin: 5px 15px 5px 0px; +} + +code { + margin: 5px 0; + padding: 10px; + text-align: left; + display: block; + overflow: auto; + font: 500 1em/1.5em 'Lucida Console', 'courier new', monospace; + /* white-space: pre; */ + background: #FAFAFA; + border: 1px solid #f2f2f2; + border-left: 3px solid #72A545; +} +acronym { + cursor: help; + border-bottom: 1px solid #777; +} +blockquote { + margin: 15px; padding: 0 0 0 20px; + background-color: #FAFAFA; + background-position: 8px 10px; + border: 1px solid #f2f2f2; + border-left: 3px solid #72A545; + font: bold 1.2em/1.5em "Trebuchet MS", Tahoma, sans-serif; + color: #666666; +} + +/* start - table */ +table { + border-collapse: collapse; + margin: 10px 15px; +} +th strong { + color: #fff; +} +th { + background: #74A846; + height: 29px; + padding-left: 11px; + padding-right: 11px; + color: #fff; + text-align: left; + border-left: 1px solid #B6D59A; + border-bottom: solid 2px #FFF; +} +tr { + height: 30px; +} +td { + padding-left: 11px; + padding-right: 11px; + /* border-left: 1px solid #FFE1C3; */ + border-left: 1px solid #FFF; + border-bottom: solid 1px #ffffff; +} +td.first,th.first { + border-left: 0px; +} +tr.row-a { + background: #F8F8F8; +} +tr.row-b { + background: #EFEFEF; +} +/* end - table */ + +/* form elements */ +form { + margin:10px 15px; padding: 0; + border: 1px solid #f2f2f2; + background-color: #FAFAFA; +} +label { + float: left; + width: 40%; + font-weight:bold; + margin:5px 0; + margin-right: 1em; + text-align: right; +} +input { + padding: 3px; + margin-left: 3%; + width: 40%; + border:1px solid #eee; + font: normal 1em "Trebuchet MS", Tahoma, sans-serif; + color:#777; +} +select { + margin-left: 3%; + width: auto; +} +textarea { + width:40%; + margin-left: 3%; + padding:3px; + font: normal 1em "Trebuchet MS", Tahoma, sans-serif; + border:1px solid #eee; + height:100px; + display:inline; + color:#777; +} +input.button { + width: auto; + float: none; + font: bold 1em Arial, Sans-serif; + background: #FFF url(/site-content/images/gradientbg.jpg) repeat-x; + padding: 2px 3px; + margin-left: 35%; + color: #333; + border: 1px solid #DADADA; +} +ul.errorlist { + width: 60%; + color: #ff0000; + margin:5px 0; + margin-right: 1em; + text-align: right; +} + +/* search form */ +.searchform { + background-color: transparent; + border: none; margin: 0; padding: 0; +} +.searchform p { margin: 10px; padding: 0; } +.searchform input.textbox { + width: 130px; + color: #333; + height: 20px; + padding: 2px; + vertical-align: top; +} +.searchform input.button { + font: bold 12px Arial, Sans-serif; + color: #333; + width: 60px; + height: 26px; + border: 1px solid #DADADA; + padding: 3px 5px; + vertical-align: top; +} + +/*********************** + LAYOUT +************************/ + +#header-content, #content, #footer-content { + width: 90%; +} + +/* header */ +#header { + height: 100px; + text-align: center; +} +#header-content { + margin: 0 auto; padding: 0; + position: relative; +} +#header-content h1#logo { + position: absolute; + font: bold 45px 'Trebuchet MS', Sans-serif; + letter-spacing: -2px; + color: #FFF; + margin: 0; padding: 0; + + /* change the values of left and top to adjust the position of the logo */ + top: 0; left: 0px; +} +#header-content h1#logo a { + text-decoration: none; + color: #FFF; +} +#header-content #slogan { + position: absolute; + font: bold 12px 'Trebuchet Ms', Sans-serif; + text-transform: none; + color: #FFF; + margin: 0; padding: 0; + + /* change the values of left and top to adjust the position of the slogan */ + top: 55px; left: 40px; +} + +/* header menu */ +#header-content ul { + position: absolute; + right: -5px; top: 15px; + font: bolder 1.3em 'Trebuchet MS', sans-serif; + color: #FFF; + list-style: none; + margin: 0; padding: 0; +} +#header-content li { + display: inline; +} +#header-content li a { + float: left; + display: block; + padding: 3px 12px; + color: #FFF; + background-color: #333; + text-decoration: none; + border-right: 1px solid #272727; +} +#header-content li a:hover { + background: #65944A; + color: #FFF; +} +#header-content li a#current { + background: #65944A; + color: #FFF; +} + +/* header photo */ +.headerphoto { + margin: 0 auto; + width: 90%; + height: 200px; + padding: 15px 10px 10px 10px; + background: #FFF url(/site-content/images/headerphoto.jpg) no-repeat center; +} + +/* content */ +#content-wrap { + clear: both; + float: left; + width: 100%; +} +#content { + text-align: left; + padding: 0; + margin: 0 auto; +} + +/* sidebar */ +#sidebar { + float: right; + width: 30%; + margin: 0 0 10px 0; padding: 0; +} +#sidebar h1 { + padding: 10px 0px 5px 10px; + margin: 0; + font: bold 1.3em 'Trebuchet MS', Tahoma, Sans-serif; +} +.sidebox { + background: #F5F5F5; + border: 1px solid #EFEDED; + margin-bottom: 10px; +} + +/* sidebar menu */ +#sidebar ul.sidemenu { + list-style:none; + margin: 10px 0 15px 0; + padding: 0; + background: #F2F2F2; +} +#sidebar ul.sidemenu li { + padding: 0px 10px; +} +#sidebar ul.sidemenu a { + display:block; + font-weight:normal; + color: #333; + height: 1.5em; + padding:.3em 0 .3em 15px; + line-height: 1.5em; + border-bottom: 1px dashed #D4D4D4; + text-decoration:none; +} +#sidebar ul.sidemenu a.top{ + border-top: 1px dashed #D4D4D4; +} +#sidebar ul.sidemenu a:hover { + padding: .3em 0 .3em 10px; + border-left: 5px solid #65944A; + color: #65944A; +} + +/* main */ +#main { + float: left; + width: 68%; + margin: 0 0 10px 0; padding: 0; +} +#main h1 { + padding: 10px 0px 0px 5px; + margin: 0 0 0 10px; + border-bottom: 1px solid #f2f2f2; + font: normal 1.5em 'Trebuchet MS', Tahoma, Sans-serif; +} + +.post { + margin: 0; padding: 0; + background: #FFF url(/site-content/images/gradientbg.jpg) repeat-x; + border: 1px solid #EFEDED; +} +.post .post-footer { + background-color: #FAFAFA; + border: 1px solid #f2f2f2; + padding: 5px; margin-top: 20px; + font-size: 95%; +} +.post .post-footer .date { + background: url(/site-content/images/'clock.gif') no-repeat 0 center; + padding-left: 20px; margin: 0 10px 0 5px; +} +.post .post-footer .comments { + background: url(/site-content/images/'comment.gif') no-repeat 0 center; + padding-left: 20px; margin: 0 10px 0 5px; +} +.post .post-footer .readmore { + background: url(/site-content/images/'page.gif') no-repeat 0 center; + padding-left: 20px; margin: 0 10px 0 5px; +} + +/* footer */ +#footer { + clear: both; + margin: 0; padding: 0; + font: normal .95em/1.6em 'Trebuchet MS', Tahoma, Arial, sans-serif; + text-align: left; +} + +#footer h1, #footer p { margin-left: 0; } + +#footer-content { + border-top: 1px solid #EAEAEA; + margin: 0 auto; + padding-left: 15px; +} +#footer-content a { + text-decoration: none; + color: #777; +} +#footer-content a:hover { + text-decoration: underline; + color: #333; +} +#footer-content ul { + list-style: none; + margin: 0; padding: 0; +} +#footer-content .col { + width: 32%; + padding: 0 5px 30px 0; +} +#footer-content .col2 { + width: 33%; + padding: 0 0 30px 0; +} + +/* alignment classes */ +.float-left { float: left; } +.float-right { float: right; } +.align-left { text-align: left; } +.align-right { text-align: right; } + +/* additional classes */ +.clear { clear: both; } +.gray { color: #BFBFBF; } + + +/* My Form Elements */ +div.review-center-box { + margin:10px 15px; + padding: 10px; + height: auto; + border: 1px solid #f2f2f2; + background-color: #FAFAFA; +} +div.review-left { + float: left; + width: 20%; + font-weight:bold; + margin: 0 5% 1em 20%; + text-align: right; +} +div.review-right { + width: 80%; + margin: 1px 0 0 10%; + font: normal 1em "Trebuchet MS", Tahoma, sans-serif; + color:#777; +} \ No newline at end of file diff -r 000000000000 -r c94bd9ae70d2 app/site-content/images/bg.jpg Binary file app/site-content/images/bg.jpg has changed diff -r 000000000000 -r c94bd9ae70d2 app/site-content/images/bullet.gif Binary file app/site-content/images/bullet.gif has changed diff -r 000000000000 -r c94bd9ae70d2 app/site-content/images/clock.gif Binary file app/site-content/images/clock.gif has changed diff -r 000000000000 -r c94bd9ae70d2 app/site-content/images/comment.gif Binary file app/site-content/images/comment.gif has changed diff -r 000000000000 -r c94bd9ae70d2 app/site-content/images/firefox-gray.jpg Binary file app/site-content/images/firefox-gray.jpg has changed diff -r 000000000000 -r c94bd9ae70d2 app/site-content/images/gradientbg.jpg Binary file app/site-content/images/gradientbg.jpg has changed diff -r 000000000000 -r c94bd9ae70d2 app/site-content/images/headerphoto.jpg Binary file app/site-content/images/headerphoto.jpg has changed diff -r 000000000000 -r c94bd9ae70d2 app/site-content/images/page.gif Binary file app/site-content/images/page.gif has changed diff -r 000000000000 -r c94bd9ae70d2 app/site-content/proposals/2009/07/28/arm.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/site-content/proposals/2009/07/28/arm.py Tue Aug 04 02:21:15 2009 -0400 @@ -0,0 +1,6 @@ +for i in range(100, 1000): + a = i % 10 + b = (i / 10) % 10 + c = (i / 100) % 10 + if i == a ** 3 + b ** 3 + c ** 3: + print "Armstrong Number: ", i diff -r 000000000000 -r c94bd9ae70d2 app/site-content/proposals/2009/07/28/arm_.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/site-content/proposals/2009/07/28/arm_.py Tue Aug 04 02:21:15 2009 -0400 @@ -0,0 +1,6 @@ +for i in range(100, 1000): + a = i % 10 + b = (i / 10) % 10 + c = (i / 100) % 10 + if i == a ** 3 + b ** 3 + c ** 3: + print "Armstrong Number: ", i diff -r 000000000000 -r c94bd9ae70d2 app/site-content/proposals/2009/07/29/c.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/site-content/proposals/2009/07/29/c.c Tue Aug 04 02:21:15 2009 -0400 @@ -0,0 +1,27 @@ +#include + +main() +{ + + int n, count = 1; + float x, sum = 0,average; + do { + printf("how many numbers? "); + scanf("%d", &n); + sum = 0; + count = 1; + while (count <= n) { + printf("x = "); + printf("\n(to end program, enter 0 for x): "); + scanf("%f", &x); + if (x == 0) + break; + sum += x; + ++count; + } + average = sum/n; + printf("\nthe average is %f\n", average); + } while (x != 0); +} + + diff -r 000000000000 -r c94bd9ae70d2 app/templates/projrev/base.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/templates/projrev/base.html Tue Aug 04 02:21:15 2009 -0400 @@ -0,0 +1,133 @@ + + + + + + + + + + + +{% block scripts %} + +{% endblock scripts %} + +National Mission on Education through ICT + + + + +{% block body %} + +
+ + {% block header %} + + +
+ {% endblock header %} + + +
+ + {% block sidebar %} + + {% endblock sidebar %} + +
+ {% block content %} + {% comment %} To be filled in inherited templates {% endcomment %} + {% endblock content %} +
+ +
+ +{% block footer %} + +{% endblock footer %} + + +
+{% endblock body %} + + diff -r 000000000000 -r c94bd9ae70d2 app/templates/projrev/proposal/list.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/templates/projrev/proposal/list.html Tue Aug 04 02:21:15 2009 -0400 @@ -0,0 +1,25 @@ +{% extends "projrev/base.html" %} +{% block content %} +
+
+ + + + + + + + + {% for project in projects %} + + + + + + + {% endfor %} +
MICR CodeLine ItemInstitutionStateDistrict
+ {{ project.micr_code }}{{ project.line_item }}{{ project.institution }}{{ project.state }}{{ project.district }}
+
+
+{% endblock content %} \ No newline at end of file diff -r 000000000000 -r c94bd9ae70d2 app/templates/projrev/proposal/rank.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/templates/projrev/proposal/rank.html Tue Aug 04 02:21:15 2009 -0400 @@ -0,0 +1,132 @@ +{% extends "projrev/base.html" %} +{% block content %} +
+ + +

Review the proposal

+ +

The proposal details are given below followed by a Review form.

+ +
+
+ Project MICR Code: +
+
+ {{ project.micr_code }} +
+
+
+ Institution: +
+
+ {{ project.institution }} +
+
+
+ Project Line Item: +
+
+ {{ project.line_item }} +
+
+
+ State: +
+
+ {{ project.state }} +
+
+
+ District: +
+
+ {{ project.district }} +
+
+
+ Proposal Document: +
+ +
+ +
+ Attribute Name +
+
+ Score +
+
+
+ Attribute 1: +
+
+ {{ review_score.0 }} +
+
+
+ Attribute 2: +
+
+ {{ review_score.1 }} +
+
+
+ Attribute 3: +
+
+ {{ review_score.2 }} +

+
+ Attribute 4: +
+
+ {{ review_score.3 }} +

+
+ Attribute 5: +
+
+ {{ review_score.4 }} +

+
+ Attribute 6: +
+
+ {{ review_score.5 }} +

+
+ Attribute 7: +
+
+ {{ review_score.6 }} +

+
+ Attribute 8: +
+
+ {{ review_score.7 }} +

+
+ Attribute 9: +
+
+ {{ review_score.8 }} +

+
+ Overall Score: +
+
+ {{ total_score }} +
+

+ + +
+{% endblock content %} \ No newline at end of file diff -r 000000000000 -r c94bd9ae70d2 app/templates/projrev/proposal/review.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/templates/projrev/proposal/review.html Tue Aug 04 02:21:15 2009 -0400 @@ -0,0 +1,68 @@ +{% extends "projrev/base.html" %} +{% block content %} +
+ + +

Review the proposal

+ +

The proposal details are given below followed by a Review form.

+ +
+
+ Project MICR Code: +
+
+ {{ project.micr_code }} +
+
+
+ Institution: +
+
+ {{ project.institution }} +
+
+
+ Project Line Item: +
+
+ {{ project.line_item }} +
+
+
+ State: +
+
+ {{ project.state }} +
+
+
+ District: +
+
+ {{ project.district }} +
+
+
+ Proposal Document: +
+ +
+
+

+ {{ form.as_p }} +
+ +

+
+ + + +
+{% endblock content %} \ No newline at end of file diff -r 000000000000 -r c94bd9ae70d2 app/templates/projrev/proposal/submit.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/templates/projrev/proposal/submit.html Tue Aug 04 02:21:15 2009 -0400 @@ -0,0 +1,25 @@ +{% extends "projrev/base.html" %} +{% block content %} +
+ + +

Submit your proposal

+ +

Fill up the form below, and upload your proposal file by clicking on Browse.

+ +
+

+ {{ form.as_p }} +
+ +

+
+ + + +
+{% endblock content %} \ No newline at end of file diff -r 000000000000 -r c94bd9ae70d2 app/urls.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/urls.py Tue Aug 04 02:21:15 2009 -0400 @@ -0,0 +1,31 @@ +from django.conf.urls.defaults import * +from django.conf import settings + + +# Uncomment the next two lines to enable the admin: +from django.contrib import admin +admin.autodiscover() + +urlpatterns = patterns('', + # Example: + # (r'^app/', include('app.foo.urls')), + + # Uncomment the admin/doc line below and add 'django.contrib.admindocs' + # to INSTALLED_APPS to enable admin documentation: + (r'^admin/doc/', include('django.contrib.admindocs.urls')), + + # Uncomment the next line to enable the admin: + (r'^admin/', include(admin.site.urls)), + (r'^login/$', 'app.projrev.views.login.login_validate'), + (r'^logout/$', 'app.projrev.views.login.logout_view'), + (r'^proposal/submit/$', 'app.projrev.views.proposal.submit'), + (r'^proposal/review/$', 'app.projrev.views.proposal.review'), + (r'^proposal/review/(?P[A-Z]{6}\d{9})/$', + 'app.projrev.views.proposal.review'), + (r'^proposal/rank/$', 'app.projrev.views.proposal.rank'), + (r'^proposal/rank/(?P[A-Z]{6}\d{9})$', + 'app.projrev.views.proposal.rank'), + (r'^site-content/(?P.*)', 'django.views.static.serve', + {'document_root': settings.MEDIA_ROOT}), + +)