Added new set of files.
authorMadhusudan.C.S <madhusudancs@gmail.com>
Thu, 06 Aug 2009 20:20:36 +0530
changeset 8 294ff7ac9cb6
parent 7 3e6916eb3d2c
child 9 38727da8a948
Added new set of files.
app/projrev/views/helpers/access.py
app/projrev/views/login.py
app/projrev/views/proposal.py
app/site-content/css/colorbox.css
app/site-content/css/login.css
app/site-content/css/projrev.css
app/site-content/images/button-bg.png
app/site-content/images/controls.png
app/site-content/images/loading.gif
app/site-content/images/login-page-bg.jpg
app/site-content/js/jquery.colorbox-min.js
app/site-content/proposals/2009/08/04/latexusrguide.pdf
app/site-content/proposals/2009/08/06/a.out
app/site-content/proposals/2009/08/06/arm.py
app/site-content/proposals/2009/08/06/arm_.py
app/site-content/proposals/2009/08/06/c.c
app/site-content/proposals/2009/08/06/c_.c
app/site-content/proposals/2009/08/06/c__.c
app/site-content/proposals/2009/08/06/c___.c
app/site-content/proposals/2009/08/06/c____.c
app/site-content/proposals/2009/08/06/gcd.py
app/site-content/proposals/2009/08/06/pytriads.py
app/site-content/proposals/2009/08/06/pytriads_.py
app/site-content/proposals/2009/08/06/pytriads__.py
app/site-content/proposals/2009/08/06/test.py
app/site-content/proposals/2009/08/06/test_.py
app/templates/projrev/auth/login.html
app/templates/projrev/base.html
app/templates/projrev/error.html
app/templates/projrev/proposal/get_micr.html
app/templates/projrev/proposal/withdraw.html
--- a/app/projrev/views/helpers/access.py	Thu Aug 06 18:49:06 2009 +0530
+++ b/app/projrev/views/helpers/access.py	Thu Aug 06 20:20:36 2009 +0530
@@ -7,21 +7,47 @@
 ]
 
 
-def checkAccess(func, request):
+from functools import wraps
+
+from django.shortcuts import render_to_response
+from django.template import RequestContext
+
+
+rights = {}
+rights['getMicr'] = 'proposer'
+
+def checkAccess(func):
   """ To check the access of the user and then return the appropriate function 
-object
+  object.
  """
-  user_kind = rights[func.__name__]
-  if user.is_authenticated():
-    if user_kind == 'staff':
-      if user.is_staff:
-        return func(request)
-      else:
-        return 
-        
-    if user_kind == 'proposer':
-      if not user.is_staff:
-        return func(request)
-      else:
-        return
-    
\ No newline at end of file
+
+  @wraps(func)
+  def wrapper(request, *args, **kwargs):
+    """The decorator for access check.
+    """
+
+    user_kind = rights[func.__name__]
+    user = request.user
+
+    template = 'projrev/error.html'
+    context = {}
+
+    if user.is_authenticated():
+      if user_kind == 'staff':
+        if user.is_staff:
+          return func(request, *args, **kwargs)
+        else:
+          context['not_staff'] = True 
+          return render_to_response(template, RequestContext(request, context)) 
+
+      if user_kind == 'proposer':
+        if not user.is_staff:
+          return func(request, *args, **kwargs)
+        else:
+          context['not_proposer'] = True
+          return render_to_response(template, RequestContext(request, context))
+    else:
+      context['not_authenticated'] = True
+      return render_to_response(template, RequestContext(request, context))
+
+  return wrapper
\ No newline at end of file
--- a/app/projrev/views/login.py	Thu Aug 06 18:49:06 2009 +0530
+++ b/app/projrev/views/login.py	Thu Aug 06 20:20:36 2009 +0530
@@ -9,8 +9,10 @@
 
 from django.contrib.auth import authenticate
 from django.contrib.auth import login
+from django.contrib.auth import logout
 from django.contrib.auth.forms import AuthenticationForm
 from django.contrib.auth.models import User
+from django.core.urlresolvers import reverse
 from django.db import IntegrityError
 from django.http import HttpResponseRedirect
 from django.shortcuts import render_to_response
@@ -21,6 +23,9 @@
   """Validate the user and log him in.
   """
 
+  template = 'projrev/auth/login.html'
+  context = {}
+
   if request.POST:
     username = request.POST['username']
     password = request.POST['password']
@@ -34,10 +39,7 @@
         # Return a 'disabled account' error message
     else:
       # Return an 'invalid login' error message.
-      pass
-  else:
-    context = {}
-    template = 'projrev/auth/login.html'
+      context['error'] = True
 
   return render_to_response(template, context)
 
@@ -87,4 +89,6 @@
 def logout_view(request):
   """Logout the user
   """
-  
\ No newline at end of file
+
+  logout(request)
+  return HttpResponseRedirect(reverse('app.projrev.views.base.home'))
--- a/app/projrev/views/proposal.py	Thu Aug 06 18:49:06 2009 +0530
+++ b/app/projrev/views/proposal.py	Thu Aug 06 20:20:36 2009 +0530
@@ -13,7 +13,7 @@
 
 from django.core.urlresolvers import reverse
 from django.http import HttpResponseRedirect
-from django.shortcuts import render_to_response, get_object_or_404
+from django.shortcuts import render_to_response
 from django.template import RequestContext
 
 from projrev.models import Project
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/site-content/css/colorbox.css	Thu Aug 06 20:20:36 2009 +0530
@@ -0,0 +1,35 @@
+/*
+    ColorBox Core Style
+    The following rules are the styles that are consistant between all ColorBox themes
+*/
+#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
+#cboxOverlay{position:fixed; width:100%; height:100%;}
+#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
+#cboxContent{position:relative; overflow:visible;}
+#cboxLoadedContent{overflow:auto;}
+#cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;}
+#cboxTitle{margin:0;}
+#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;}
+#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
+
+/* 
+	ColorBox example user style
+	These rules are ordered and tabbed in a way that represents the order/nesting of the generated HTML, 
+	in hope that this will make the relationship easier to understand. Thanks, jack@colorpowered.com
+*/
+#cboxOverlay{background:#000;}
+
+#colorbox{}
+	#cboxContent{background:#000; margin-top:20px;}
+		#cboxLoadedContent{background:#000; padding:5px;}
+                #cboxTitle{position:absolute; top:-20px; left:0; color:#ccc;}
+                #cboxCurrent{position:absolute; top:-20px; right:0px; color:#ccc;}
+                #cboxSlideshow{position:absolute; top:-20px; right:90px; color:#fff;}
+                #cboxPrevious{position:absolute; top:50%; left:5px; margin-top:-32px; background:url(/site-content/images/controls.png) top left no-repeat; width:28px; height:65px; text-indent:-9999px;}
+                #cboxPrevious.hover{background-position:bottom left;}
+                #cboxNext{position:absolute; top:50%; right:5px; margin-top:-32px; background:url(/site-content/images/controls.png) top right no-repeat; width:28px; height:65px; text-indent:-9999px;}
+                #cboxNext.hover{background-position:bottom right;}
+                #cboxLoadingOverlay{background:#000;}
+		#cboxLoadingGraphic{background:url(/site-content/images/loading.gif) center center no-repeat;}
+		#cboxClose{position:absolute; top:5px; right:5px; display:block; background:url(/site-content/images/controls.png) top center no-repeat; width:38px; height:19px; text-indent:-9999px;}
+		#cboxClose.hover{background-position:bottom center;}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/site-content/css/login.css	Thu Aug 06 20:20:36 2009 +0530
@@ -0,0 +1,21 @@
+*					{ margin: 0; padding: 0; }
+body				{ font-family: Georgia, serif; background: url(/site-content/images/login-page-bg.jpg) top center no-repeat #c4c4c4; color: #3a3a3a;  }
+
+.clear				{ clear: both; }
+
+form				{ width: 406px; margin: 170px auto 0; }
+
+legend				{ display: none; }
+
+fieldset			{ border: 0; }
+
+label				{ width: 115px; text-align: right; float: left; margin: 0 10px 0 0; padding: 9px 0 0 0; font-size: 16px; }
+
+input				{ width: 220px; display: block; padding: 4px; margin: 0 0 10px 0; font-size: 18px;
+					  color: #3a3a3a; font-family: Georgia, serif;}
+input[type=checkbox]{ width: 20px; margin: 0; display: inline-block; }
+					  
+.button				{ background: url(/site-content/images/button-bg.png) repeat-x top center; border: 1px solid #999;
+					  -moz-border-radius: 5px; padding: 5px; color: black; font-weight: bold;
+					  -webkit-border-radius: 5px; font-size: 13px;  width: 70px; }
+.button:hover		{ background: white; color: black; }
--- a/app/site-content/css/projrev.css	Thu Aug 06 18:49:06 2009 +0530
+++ b/app/site-content/css/projrev.css	Thu Aug 06 20:20:36 2009 +0530
@@ -483,4 +483,12 @@
   left: 22%;
 	font: normal 1em "Trebuchet MS", Tahoma, sans-serif;
   color:#f00;
+}
+
+div.access-error {
+  padding: 3px;
+  margin-left: 3%;
+  width: auto;
+  font: normal 1em "Trebuchet MS", Tahoma, sans-serif;
+  color:#f00;
 }
\ No newline at end of file
Binary file app/site-content/images/button-bg.png has changed
Binary file app/site-content/images/controls.png has changed
Binary file app/site-content/images/loading.gif has changed
Binary file app/site-content/images/login-page-bg.jpg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/site-content/js/jquery.colorbox-min.js	Thu Aug 06 20:20:36 2009 +0530
@@ -0,0 +1,3 @@
+// ColorBox v1.2.7 - a full featured, light-weight, customizable lightbox based on jQuery 1.3
+
+(function(B){var G,V,W,d,z,k,b,F,c,Q,D,e,s,j,m,P,l,H,t;var X,i,g,a,p,A,T,w,I,q="colorbox",o="hover";var y,f,R,L,K,J,r,M;var x="cbox_open",O="cbox_load",u="cbox_complete",h="cbox_close",n="cbox_closed";var C={transition:"elastic",speed:350,width:false,height:false,initialWidth:"400",initialHeight:"400",maxWidth:false,maxHeight:false,resize:true,inline:false,html:false,iframe:false,photo:false,href:false,title:false,rel:false,opacity:0.9,preloading:true,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:false,overlayClose:true,slideshow:false,slideshowAuto:true,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow"};B(function(){R()});function N(Y){if(Y.keyCode==37){Y.preventDefault();H.click()}else{if(Y.keyCode==39){Y.preventDefault();l.click()}}}function E(Y,Z){Z=Z=="x"?document.documentElement.clientWidth:document.documentElement.clientHeight;return(typeof Y=="string")?(Y.match(/%/)?(Z/100)*parseInt(Y,10):parseInt(Y,10)):Y}function v(Y){return T.photo?true:Y.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(.*))?$/i)}function U(){for(var Y in T){if(typeof(T[Y])=="function"){T[Y]=T[Y].call(p)}}}B.fn.colorbox=function(Z,Y){if(this.length){this.each(function(){var aa=B(this).data(q)?B.extend({},B(this).data(q),Z):B.extend({},C,Z);B(this).data(q,aa).addClass("cboxelement")})}else{B(this).data(q,B.extend({},C,Z))}B(this).unbind("click.colorbox").bind("click.colorbox",function(ab){p=this;T=B(p).data(q);U();B().bind("keydown.cbox_close",function(ac){if(ac.keyCode==27){ac.preventDefault();t.click()}});if(T.overlayClose===true){G.css({cursor:"pointer"}).one("click",M)}p.blur();I=Y||false;var aa=T.rel||p.rel;if(aa&&aa!="nofollow"){c=B(".cboxelement").filter(function(){var ac=B(this).data(q).rel||this.rel;return(ac==aa)});A=c.index(p);if(A<0){c=c.add(p);A=c.length-1}}else{c=B(p);A=0}if(!w){B.event.trigger(x);t.html(T.close);G.css({opacity:T.opacity}).show();w=true;K(E(T.initialWidth,"x"),E(T.initialHeight,"y"),0);if(B.browser.msie&&B.browser.version<7){Q.bind("resize.cboxie6 scroll.cboxie6",function(){G.css({width:Q.width(),height:Q.height(),top:Q.scrollTop(),left:Q.scrollLeft()})})}}r();L();ab.preventDefault()});if(Z&&Z.open){B(this).triggerHandler("click.colorbox")}return this};R=function(){function Y(Z){return B('<div id="cbox'+Z+'"/>')}Q=B(window);V=B('<div id="colorbox"/>');G=Y("Overlay").hide();W=Y("Wrapper");d=Y("Content").append(D=Y("LoadedContent").css({width:0,height:0}),e=Y("LoadingOverlay"),s=Y("LoadingGraphic"),j=Y("Title"),m=Y("Current"),P=Y("Slideshow"),l=Y("Next"),H=Y("Previous"),t=Y("Close"));W.append(B("<div/>").append(Y("TopLeft"),z=Y("TopCenter"),Y("TopRight")),B("<div/>").append(k=Y("MiddleLeft"),d,b=Y("MiddleRight")),B("<div/>").append(Y("BottomLeft"),F=Y("BottomCenter"),Y("BottomRight"))).children().children().css({"float":"left"});B("body").prepend(G,V.append(W));if(B.browser.msie&&B.browser.version<7){G.css("position","absolute")}d.children().addClass(o).mouseover(function(){B(this).addClass(o)}).mouseout(function(){B(this).removeClass(o)}).hide();X=z.height()+F.height()+d.outerHeight(true)-d.height();i=k.width()+b.width()+d.outerWidth(true)-d.width();g=D.outerHeight(true);a=D.outerWidth(true);V.css({"padding-bottom":X,"padding-right":i}).hide();l.click(f);H.click(y);t.click(M);d.children().removeClass(o)};K=function(ab,aa,Z,ac){var ad=document.documentElement.clientHeight;var af=ad/2-aa/2;var ae=document.documentElement.clientWidth/2-ab/2;if(aa>ad){af-=(aa-ad)}if(af<0){af=0}if(ae<0){ae=0}af+=Q.scrollTop();ae+=Q.scrollLeft();ab=ab-i;aa=aa-X;W[0].style.width=W[0].style.height="9999px";function ag(ah){z[0].style.width=F[0].style.width=d[0].style.width=ah.style.width;s[0].style.height=e[0].style.height=d[0].style.height=k[0].style.height=b[0].style.height=ah.style.height}var Y=(V.width()===ab&&V.height()===aa)?0:Z;V.dequeue().animate({height:aa,width:ab,top:af,left:ae},{duration:Y,complete:function(){ag(this);W[0].style.width=(ab+i)+"px";W[0].style.height=(aa+X)+"px";if(ac){ac()}},step:function(){ag(this)}})};J=function(ad){if(!w){return}Q.unbind("resize.cbox_resize");var ab=T.transition=="none"?0:T.speed;D.remove();D=B(ad);var Z;var aj;function ah(){if(T.width){Z=maxWidth}else{Z=maxWidth&&maxWidth<D.width()?maxWidth:D.width()}return Z}function ag(){if(T.height){aj=maxHeight}else{aj=maxHeight&&maxHeight<D.height()?maxHeight:D.height()}return aj}D.hide().appendTo("body").attr({id:"cboxLoadedContent"}).css({width:ah()}).css({height:ag()}).prependTo(d);if(B.browser.msie&&B.browser.version<7){B("select").not(B("#colorbox select")).filter(function(){return B(this).css("visibility")!="hidden"}).css({visibility:"hidden"}).one(h,function(){B(this).css({visibility:"inherit"})})}var Y=B("#cboxPhoto")[0];if(Y&&T.height){var ae=(aj-parseInt(Y.style.height,10))/2;Y.style.marginTop=(ae>0?ae:0)+"px"}function ai(am){var al=Z+a+i;var an=aj+g+X;K(al,an,am,function(){if(!w){return}if(B.browser.msie){if(Y){D.fadeIn(100)}V.css("filter","")}d.children().show();B("#cboxIframeTemp").after("<iframe id='cboxIframe' name='iframe_"+new Date().getTime()+"' frameborder=0 src='"+(T.href||p.href)+"' />").remove();e.hide();s.hide();P.hide();if(c.length>1){m.html(T.current.replace(/\{current\}/,A+1).replace(/\{total\}/,c.length));l.html(T.next);H.html(T.previous);B().unbind("keydown",N).one("keydown",N);if(T.slideshow){P.show()}}else{m.hide();l.hide();H.hide()}j.html(T.title||p.title);B.event.trigger(u);if(I){I.call(p)}if(T.transition==="fade"){V.fadeTo(ab,1,function(){if(B.browser.msie){d.css("filter","")}})}Q.bind("resize.cbox_resize",function(){K(al,an,0)})})}if(T.transition=="fade"){V.fadeTo(ab,0,function(){ai(0)})}else{ai(ab)}if(T.preloading&&c.length>1){var ac=A>0?c[A-1]:c[c.length-1];var af=A<c.length-1?c[A+1]:c[0];var ak=B(af).data(q).href||af.href;var aa=B(ac).data(q).href||ac.href;if(v(ak)){B("<img />").attr("src",ak)}if(v(aa)){B("<img />").attr("src",aa)}}};L=function(){p=c[A];T=B(p).data(q);U();B.event.trigger(O);e.show();s.show();t.show();var Y=T.height?E(T.height,"y")-g-X:false;var ab=T.width?E(T.width,"x")-a-i:false;if(T.maxHeight){maxHeight=T.maxHeight?E(T.maxHeight,"y")-g-X:false;Y=Y&&Y<maxHeight?Y:maxHeight}if(T.maxWidth){maxWidth=T.maxWidth?E(T.maxWidth,"x")-a-i:false;ab=ab&&ab<maxWidth?ab:maxWidth}maxHeight=Y;maxWidth=ab;var Z=T.href||p.href;if(T.inline){B('<div id="cboxInlineTemp" />').hide().insertBefore(B(Z)[0]).bind(O+" "+h,function(){D.children().insertBefore(this);B(this).remove()});J(B(Z).wrapAll("<div/>").parent())}else{if(T.iframe){J(B("<div><div id='cboxIframeTemp' /></div>"))}else{if(T.html){J(B("<div/>").html(T.html))}else{if(v(Z)){var aa=new Image();aa.onload=function(){aa.onload=null;if((maxHeight||maxWidth)&&T.resize){var ae=this.width;var ac=this.height;var ag=0;var af=this;var ad=function(){ac+=ac*ag;ae+=ae*ag;af.height=ac;af.width=ae};if(maxWidth&&ae>maxWidth){ag=(maxWidth-ae)/ae;ad()}if(maxHeight&&ac>maxHeight){ag=(maxHeight-ac)/ac;ad()}}J(B("<div />").css({width:this.width,height:this.height}).append(B(this).css({width:this.width,height:this.height,display:"block",margin:"auto",border:0}).attr("id","cboxPhoto")));if(c.length>1){B(this).css({cursor:"pointer"}).click(f)}if(B.browser.msie&&B.browser.version==7){this.style.msInterpolationMode="bicubic"}};aa.src=Z}else{B("<div />").load(Z,function(ac,ad){if(ad=="success"){J(B(this))}else{J(B("<p>Request unsuccessful.</p>"))}})}}}}};f=function(){A=A<c.length-1?A+1:0;L()};y=function(){A=A>0?A-1:c.length-1;L()};r=function(){var Z,Y,aa="cboxSlideshow_";P.bind(h,function(){clearTimeout(Y);P.unbind()});function ab(){P.text(T.slideshowStop).bind(u,function(){Y=setTimeout(f,T.slideshowSpeed)}).bind(O,function(){clearTimeout(Y)}).one("click",function(){Z();B(this).removeClass(o)});V.removeClass(aa+"off").addClass(aa+"on")}Z=function(){clearTimeout(Y);P.text(T.slideshowStart).unbind(u+" "+O).one("click",function(){ab();Y=setTimeout(f,T.slideshowSpeed);B(this).removeClass(o)});V.removeClass(aa+"on").addClass(aa+"off")};if(T.slideshow&&c.length>1){if(T.slideshowAuto){ab()}else{Z()}}};M=function(){B.event.trigger(h);w=false;B().unbind("keydown",N).unbind("keydown.cbox_close");Q.unbind("resize.cbox_resize resize.cboxie6 scroll.cboxie6");G.css({cursor:"auto"}).fadeOut("fast");d.children().hide();V.stop(true,false).removeClass().fadeOut("fast",function(){p.focus();D.remove();V.css({opacity:1});B.event.trigger(n)})};var S=B.fn.colorbox;S.init=R;S.next=f;S.prev=y;S.close=M;S.load=L;S.position=K;S.dimensions=J;S.element=function(){return p};S.settings=C})(jQuery);
\ No newline at end of file
Binary file app/site-content/proposals/2009/08/04/latexusrguide.pdf has changed
Binary file app/site-content/proposals/2009/08/06/a.out has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/site-content/proposals/2009/08/06/arm.py	Thu Aug 06 20:20:36 2009 +0530
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/site-content/proposals/2009/08/06/arm_.py	Thu Aug 06 20:20:36 2009 +0530
@@ -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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/site-content/proposals/2009/08/06/c.c	Thu Aug 06 20:20:36 2009 +0530
@@ -0,0 +1,27 @@
+#include <stdio.h>
+
+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); 
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/site-content/proposals/2009/08/06/c_.c	Thu Aug 06 20:20:36 2009 +0530
@@ -0,0 +1,27 @@
+#include <stdio.h>
+
+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); 
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/site-content/proposals/2009/08/06/c__.c	Thu Aug 06 20:20:36 2009 +0530
@@ -0,0 +1,27 @@
+#include <stdio.h>
+
+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); 
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/site-content/proposals/2009/08/06/c___.c	Thu Aug 06 20:20:36 2009 +0530
@@ -0,0 +1,27 @@
+#include <stdio.h>
+
+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); 
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/site-content/proposals/2009/08/06/c____.c	Thu Aug 06 20:20:36 2009 +0530
@@ -0,0 +1,27 @@
+#include <stdio.h>
+
+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); 
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/site-content/proposals/2009/08/06/gcd.py	Thu Aug 06 20:20:36 2009 +0530
@@ -0,0 +1,6 @@
+def gcd(a, b):
+  if a % b == 0:
+    return b
+  return gcd(b, a %b)
+
+print gcd (10, 20)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/site-content/proposals/2009/08/06/pytriads.py	Thu Aug 06 20:20:36 2009 +0530
@@ -0,0 +1,6 @@
+def pytriads():
+  for a in range(3, 100):
+    for b in range(a+1, 100):
+      if gcd(a, b) == 1:
+        
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/site-content/proposals/2009/08/06/pytriads_.py	Thu Aug 06 20:20:36 2009 +0530
@@ -0,0 +1,6 @@
+def pytriads():
+  for a in range(3, 100):
+    for b in range(a+1, 100):
+      if gcd(a, b) == 1:
+        
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/site-content/proposals/2009/08/06/pytriads__.py	Thu Aug 06 20:20:36 2009 +0530
@@ -0,0 +1,6 @@
+def pytriads():
+  for a in range(3, 100):
+    for b in range(a+1, 100):
+      if gcd(a, b) == 1:
+        
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/site-content/proposals/2009/08/06/test.py	Thu Aug 06 20:20:36 2009 +0530
@@ -0,0 +1,5 @@
+a, b = 0, 1
+while b < 10:
+    print b,
+    a, b = b, a + b
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/site-content/proposals/2009/08/06/test_.py	Thu Aug 06 20:20:36 2009 +0530
@@ -0,0 +1,5 @@
+a, b = 0, 1
+while b < 10:
+    print b,
+    a, b = b, a + b
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/templates/projrev/auth/login.html	Thu Aug 06 20:20:36 2009 +0530
@@ -0,0 +1,29 @@
+{% extends "projrev/base.html" %}
+{% block stylesheets %}
+<link rel="stylesheet" href="/site-content/css/login.css" type="text/css"/>
+{% endblock stylesheets %}
+{% block body %}
+  <form id="login-form" action="#" method="POST">
+    <fieldset>
+    
+      <legend>Log in</legend>
+      
+      <label for="login">Email</label>
+      <input type="text" id="login" name="username"/>
+      <div class="clear"></div>
+      
+      <label for="password">Password</label>
+      <input type="password" id="password" name="password"/>
+      <div class="clear"></div>
+
+      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+      <a href="/create_account" >Create Account</a>
+      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+      <a href="/forgot_password" >Forgot Password</a>
+      <div class="clear"></div>
+      <br />
+      <br />
+      <input type="submit" style="margin: -20px 0 0 287px;" class="button" name="commit" value="Log in"/> 
+    </fieldset>
+  </form>
+{% endblock body %}
\ No newline at end of file
--- a/app/templates/projrev/base.html	Thu Aug 06 18:49:06 2009 +0530
+++ b/app/templates/projrev/base.html	Thu Aug 06 20:20:36 2009 +0530
@@ -41,36 +41,39 @@
 		
 		{% block sidebar %}		
 		<div id="sidebar" >
-		
-			<div class="sidebox">
-			
-				<h1>Short About</h1>
-				
-				<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum. 
-				Cras id urna. Morbi tincidunt, orci ac convallis aliquam, lectus turpis varius lorem, eu 
-				posuere nunc justo tempus leo.</p>	
-						
-			</div>			
-
 			<div class="sidebox">	
 			
 				<h1>Links</h1>
 				<ul class="sidemenu">
 				  {% if user.is_authenticated %}
-    <p>Welcome, {{ user.username }}. Thanks for logging in.</p>
-{% else %}
-    <p>Welcome, new user. Please log in.</p>
-{% endif %}
-				  
-					<li><a href="http://www.dreamhost.com/r.cgi?287326" class="top">Dreamhost</a></li>
-					<li><a href="http://www.4templates.com/?aff=ealigam">4templates</a></li>
-					<li><a href="http://store.templatemonster.com/?aff=ealigam">TemplateMonster</a></li>	
-					<li><a href="http://www.fotolia.com/partner/114283">Fotolia.com</a></li>									
-					<li><a href="http://www.text-link-ads.com/?ref=40025">Text Link Ads</a></li> 		
+            <li>Welcome, {{ user.username }}</li>
+            <li><a href="/logout/" class="top">Logout</a></li>
+            {% if user.is_staff%}
+              <li><a href="/proposal/review/" class="top">Review Proposals</a></li>
+            {% else %}
+              <li><a href="/proposal/submit/" class="top">Create/Edit Proposals</a></li>
+            {% endif %}
+          {% else %}
+            <li>Welcome, new user. Please log in.</li>
+            <li><a href="/login/" class="top">Login</a></li>
+          {% endif %}
+          
+				   
+					
+		
 				</ul>
 				
 			</div>
-			
+
+      <div class="sidebox">
+      
+        <h1>Short About</h1>
+        
+        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum. 
+        Cras id urna. Morbi tincidunt, orci ac convallis aliquam, lectus turpis varius lorem, eu 
+        posuere nunc justo tempus leo.</p>  
+            
+      </div>
 			<div class="sidebox">	
 						
 				<h1>Search Box</h1>	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/templates/projrev/error.html	Thu Aug 06 20:20:36 2009 +0530
@@ -0,0 +1,27 @@
+{% extends "projrev/base.html" %}
+{% block content %}
+<div class="post">
+			
+	<a name="TemplateInfo"></a>	
+	<h1>Access Error</h1>
+
+	<form enctype="multipart/form-data" method="post" action="">			
+    {% if not_staff %}
+      <div class="access-error">
+        <p>You are not a reviewer to access this page.</p>
+      </div>
+    {% endif %}
+    {% if not_proposer %}
+      <div class="access-error">
+        <p>You are a reviewer to and cannot submit a proposal.</p>
+      </div>
+    {% endif %}
+    {% if not_authenticated %}
+      <div class="access-error">
+        <p>You are not logged in.</p>
+      </div>
+    {% endif %}
+	</form>
+				
+</div>
+{% endblock content %}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/templates/projrev/proposal/get_micr.html	Thu Aug 06 20:20:36 2009 +0530
@@ -0,0 +1,33 @@
+{% extends "projrev/base.html" %}
+{% block content %}
+<div class="post">
+			
+	<a name="TemplateInfo"></a>	
+	<h1>Type Your MICR Code</h1>
+				
+	<p>Fill up the form below, and upload your proposal file by clicking on Browse.</p>
+
+	<form method="post" action="">			
+		<p>
+		{% if error %}
+		  <div class="error">
+		    Invalid MICR Code.
+		  </div>
+		{% endif %}
+		<label for="micr_code" class="micr">Enter your MICR Code: </label>
+    <input type=text" name="micr_code" class="micr"></input>
+    <br /><br /><br />
+    <input class="micr_button" type="submit" name="submit" value="New Proposal" />
+		<input class="micr_button" type="submit" name="submit" value="Edit Proposal for MICR Code" />
+		<input class="micr_button" type="submit" name="submit" value="Withdraw Proposal for MICR Code" />
+		</p>		
+	</form>
+				
+	<p class="post-footer align-right">					
+		<span class="comments">Reviews (5)</span>
+		<span class="date">Last reviewed: Nov 11, 2006</span>
+		<span class="date">Last submitted: Nov 11, 2006</span>	
+	</p>
+				
+</div>
+{% endblock content %}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/templates/projrev/proposal/withdraw.html	Thu Aug 06 20:20:36 2009 +0530
@@ -0,0 +1,23 @@
+{% extends "projrev/base.html" %}
+{% block content %}
+<div class="post">
+			
+	<a name="TemplateInfo"></a>	
+	<h1>Withdrawing Proposal</h1>
+
+	<form enctype="multipart/form-data" method="post" action="">			
+    {% if withdrawn %}
+      <p>Your proposal was successfully withdrawn.</p>
+    {% else %}
+      <p>There was an error and your proposal could not be withdrawn.</p>
+    {% endif %}
+	</form>
+				
+	<p class="post-footer align-right">					
+		<span class="comments">Reviews (5)</span>
+		<span class="date">Last reviewed: Nov 11, 2006</span>
+		<span class="date">Last submitted: Nov 11, 2006</span>	
+	</p>
+				
+</div>
+{% endblock content %}
\ No newline at end of file